function trim(str) {
	var	str = str.replace(/^\s\s*/, ''),
		ws = /\s/,
		i = str.length;
	while (ws.test(str.charAt(--i)));
	return str.slice(0, i + 1);
}


// this function checks for only spaces in a field or the illegal strings 'as above' 'asabove' or 'above'.
function verif(TheForm,TheField,TheValue){
	TheValue = TheValue.toLowerCase();
	longr=TheValue.length;
	test=" ";
	for (i=1;i<longr;i++){test=test+" "}
	if(TheValue==test || TheValue=="" ){
		return false;
	}
	if(TheValue.indexOf('as above') != -1 || TheValue=="above" || TheValue.indexOf('asabove') != -1){
		alert('This is not a paper form!  This form information is used separately, so \'As Above\' is not a valid entry.');
		return false;
	}
	return true;
}

function isEmail(adress) {
  var regex = /^([a-zA-Z0-9_\.\-]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([a-zA-Z0-9\-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$/;
  var emailTmp = trim(adress);
  return regex.test(emailTmp);
	}

function isInteger(valeur){// v1.01 Patrick TAI 3/7/2000
	match = 0;
	longueur = valeur.length;
	for(var a=0;a<longueur;a++){
		for(var i=0;i<10;i++){
			if(valeur.substring(a,a+1).indexOf(i)!=-1){match = match + 1;}
		}
	}
	if(match != longueur){return false};
	
return true;
}
