function trim(stringToTrim) {
	return stringToTrim.replace(/^\s+|\s+$/g,"");
}

function clearText(textBox){
	if(!textBox){
		return;
	}
	if(textBox.value=="Email Address"){
		textBox.value="";
	}
}

function putOriginalText(whichElement,whichText){
	if(trim(whichElement.value)==""){
		whichElement.value=whichText;
	}
}

var emailfilter=/^\w+[\+\.\w-]*@([\w-]+\.)*\w+[\w-]*\.([a-z]{2,4}|\d+)$/i

function checkmail(e){
	var returnval=emailfilter.test(e.value)
	if (returnval==false){
		alert("Please enter a valid email address.")
		e.select()
	}
	return returnval
}