<!--
function IsEmail(email) 
{
	var passed = false;
	var intAtSign, intDot, intComma, intSpace, intLastDot, intDomain, intStrLen;

	intAtSign=email.value.indexOf("@");
	intDot=email.value.indexOf(".",intAtSign);
	intComma=email.value.indexOf(",");
	intSpace=email.value.indexOf(" ");
	intLastDot=email.value.lastIndexOf(".");
	intDomain=intDot-intAtSign;
	intStrLen=email.value.length;


	// *** CHECK FOR BLANK EMAIL 
	if  (email.value == "" ) 
    {
		alert("Your Email Address must contain at least 1 character before the \"@\".");
		email.focus();
		passed = false;
	}

	// **** CHECK FOR THE  @ SIGN?  
	else if (intAtSign == -1)
	{
		alert("Your Email Address is missing the \"@\".");
		email.focus();
		passed = false;
	}

	// **** Check for commas ****
	else if (intComma != -1)
	{
		alert("Comma is invalid in an Email Address.");
		email.focus();
		passed = false;
	}

	// **** Check for a space ****

	else if (intSpace != -1)
	{
		alert("Spaces are invalid in an Email Address.");
		email.focus();
		passed = false;
	}

	// **** Check for char between the @ and dot, chars between dots, and at least 1 char after the last dot ****
	else if ((intDot <= 2) || (intDomain <= 1)  || (intStrLen-(intLastDot+1) < 2)) 
	{
		alert("Please enter a valid Email address.\n" + email.value + " is invalid.");
		email.focus();
		passed = false;
	}

	//  If everything is in order, submit add site critiria.
	else 
	{
		passed = true;
	}
	return passed;
}


function IsEmptyField(field)
{
	if  (field.value == "" ) 
    {
		alert("This field can not be empty!");
		field.focus();
		return true;
	}

	return false;
}



function IsSelected(PullDownMenu, EmptyItem)
{
	if (PullDownMenu.selectedIndex == EmptyItem) {
		alert("You must select a item!");
		PullDownMenu.focus();
		return true;
	}	
	return false;
}


function checkform(form) 
{
	// if email is entered, check it is correct or not 
	if (form.Email.value != "" )  
		if (!IsEmail (form.Email) )  
			return false; 

	// count ErrorMessage words
	if ( (form.ErrorMessage.value.length < 1 ) || (form.ErrorMessage.value.length > 500) ) {
		form.ErrorMessage.focus();
		alert("Error message should enter 1 minimum and 500 maximum characters");
		return false;
	}

	return true;
}
//-->




