function IsBlank(sFieldName)
{
var len = sFieldName.length;
var i;
	for (i=0;i< len;i++) 
	{
		if (sFieldName.charAt(i)!=" ")
		{
		return false;
		}
	}	
return true;
}


function IsValidEmail(value)
{
	var chkemail = /^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i;		
	if(!chkemail.test(value))
	{
		 return false;
	}
	return true
}
	
function ValidateForm(mythis)
{
	if (IsBlank(document.getElementById("txtName").value))
	{
		alert ("Name cannot not be blank.");
		document.getElementById("txtName").focus(); 
		return false;
	}
	
	if (IsBlank(document.getElementById("txtEmail").value))
	{
		alert ("Email cannot not be blank.");
		document.getElementById("txtEmail").focus(); 
		return false;
	}
	
	if (!IsValidEmail(document.getElementById("txtEmail").value))
	{
		alert ("Invalid email address.");
		document.getElementById("txtEmail").focus(); 
		return false;
	}
	return true;
}


