//FUNCTION: validateEmail
//Contains a least one character procedding the @
//Contains a "@" following the procedding character(s)
//Contains at least one character following the @, followed by a dot (.), 
//	followed by either a two character or three character string 
//	(a two character country code or the standard three character US code, such as com, edu etc)
function validateEmail(sEmailAddress){
	//create the regexp to test the email address text
	var oEmailRegExp = /^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i
	//perform the test and return success as appropriate
	if (oEmailRegExp.test(sEmailAddress)){
		return true;
	}else{
		return false;
	}
}

/* Name		:createCookie
* Purpose	:creates a new cookie
* Returns	:n/a
*/
function createCookie(name, value, expireInDays){
	if(expireInDays){
		var dDate = new Date();
		dDate.setTime(dDate.getTime() + (expireInDays * 24 * 60 * 60 * 1000));
		var sExpires = "; expires=" + dDate.toGMTString();
	}else{
		var sExpires = "";
	}
	document.cookie = name + "=" + value + sExpires + "; path=/";
}
/* Name		:eraseCookie
* Purpose	:erases a cookie
* Returns	:n/a
*/
function eraseCookie(name){
	createCookie(name, "", -1);
}
/* Name		:readCookie
* Purpose	:reads a cookie
* Returns	:n/a
*/
function readCookie(name) {
	var nameEQ = name + "=";
	var ca = document.cookie.split(';');
	for(var i = 0; i < ca.length; i++) {
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
	}
	return null;
}