//-- Validate Email and run ChangeMade function.
function ChangeMadeEmail(field,Item) {	
ChangeMade(Item);	//-- Run ChangeMade function on form.
text = field.value
IsEmail(field);
}
//-- Validate Email after entry (include return alert messages)
function IsEmail(field) {
var positionofAt;
var positionofDot;
var s = field.value;
if (s.length == 0)
	return true;
positionofAt = s.indexOf('@',1);
if ((positionofAt == -1) || (positionofAt == (s.length-1))) {
	alert("This is not a valid E-mail");
	field.focus();
	return false;
	}
positionofDot = s.indexOf('.',1);
if ((positionofDot == -1) || (positionofDot >= (s.length-2))) {
	alert("This is not a valid E-mail");
	field.focus();
	return false;
	}
return true;
}
//-- Validate Email when validating page (no return alert messages)
function CheckEmailMask(text) {
if ((text == "") || (text == null))
	return true;
var positionofChar;
positionofChar = text.indexOf('@',1);
if ((positionofChar == -1) || (positionofChar == (text.length-1)))
	return false;
positionofChar = text.indexOf('.',1);
if ((positionofChar == -1) || (positionofChar >= (text.length-2)))
	return false;
return true;
}

function EmailRestrictedCharacters(event) {
var key,keychar;
if(window.event)
	key = window.event.keyCode;
else if (event.which)
	key = event.which;
else
	return true;
keychar = String.fromCharCode(key);
//Check for special characters like backspace then check for the numbers
if (("\'&#][()!$%*=+/").indexOf(keychar) > -1) {
	alert("Single quotes and special symbols are not allowed");
	return false;
	}
else
	return true;
}
