function CheckForm(MyForm)
{
//Check Required fields
ErrorResponse='';

if(MyForm.FirstName.value == '')
	{
	ErrorResponse+='Please add first name before submiting.\n';	
	document.getElementById('TitleRow').bgColor ='red';
	}
if(MyForm.LastName.value == '')
	{
	ErrorResponse+='Please add last name before submiting.\n';	
	document.getElementById('ContactRow').bgColor ='red';
	}
if(MyForm.telephone.value == '')
	{
	ErrorResponse+='Please add Telephone before submiting.\n';	
	document.getElementById('TelephoneRow').bgColor ='red';
	}
//if(MyForm.email.value == '')
//	{
//	ErrorResponse+='Please add Email before submiting.\n';	
//	document.getElementById('EmailRow').bgColor ='red';
//	}	
	
ValidEmailFlag=isValidEmail(MyForm.email.value);
if(ValidEmailFlag == 1)
	{
	ErrorResponse+='A valid e-mail address is required.\n';
	document.getElementById('EmailRow').bgColor ='red';
	}


	
if(ErrorResponse == "")
		{
		//alert('Submiting form');
		MyForm.submit();
		}
else
		{
		alert(ErrorResponse);	
		}
}



function isValidEmail(strEmail){
validRegExp = /^[^@]+@[^@]+.[a-z]{2,}$/i;
// search email text for regular exp matches
if (strEmail.search(validRegExp) == -1) 
	{      
	return(1);
	} 
return (0); 
}



function UpdateBoxColor(ItemId)
{
document.getElementById(ItemId).bgColor ='white';	
}
