	function CheckEmail(ctl) {
		var re = /^([a-zA-Z0-9_\-])+(\.([a-zA-Z0-9_\-])+)*@((\[(((([0-1])?([0-9])?[0-9])|(2[0-4][0-9])|(2[0-5][0-5])))\.(((([0-1])?([0-9])?[0-9])|(2[0-4][0-9])|(2[0-5][0-5])))\.(((([0-1])?([0-9])?[0-9])|(2[0-4][0-9])|(2[0-5][0-5])))\.(((([0-1])?([0-9])?[0-9])|(2[0-4][0-9])|(2[0-5][0-5]))\]))|((([a-zA-Z0-9])+(([\-])+([a-zA-Z0-9])+)*\.)+([a-zA-Z])+(([\-])+([a-zA-Z0-9])+)*))$/i;
		return re.test(ctl.value);
	}

// Check Domain Name:
// ^(https?://)?(([\w!~*'().&=+$%-]+: )?[\w!~*'().&=+$%-]+@)?(([0-9]{1,3}\.){3}[0-9]{1,3}|([\w!~*'()-]+\.)*([\w^-][\w-]{0,61})?[\w]\.[a-z]{2,6})(:[0-9]{1,4})?((/*)|(/+[\w!~*'().;?:@&=+$,%#-]+)+/*)$


	function trimValue(val) {
		return val.replace(/^\s+|\s+$/g,"");
	}
	
	
	function setCookie(sName, sValue) {
	
		date = new Date();
		date.setDate(date.getDate() + 1);
		document.cookie = sName + "=" + escape(sValue) + "; path=/; expires=" + date.toGMTString();
	
	}
	
	function getCookie(sName) {
	
		// cookies are separated by semicolons
		var aCookie = document.cookie.split("; ");
	
		for (var i=0; i < aCookie.length; i++) {
	
			// a name/value pair (a crumb) is separated by an equal sign
			var aCrumb = aCookie[i].split("=");
	
			if (sName == aCrumb[0]) {
				return unescape(aCrumb[1]);
			}
	
		}
	
		// a cookie with the requested name does not exist
		return null;
	
	}
