function IsNumeric(strString)
//  check for valid numeric strings	
{

	var strValidChars = "0123456789.-";
	var strChar;
	var blnResult = true;
	
	if (strString.length == 0) return false;
	
	//  test strString consists of valid characters listed above
	for (i = 0; i < strString.length && blnResult == true; i++)
	{
		strChar = strString.charAt(i);
		if (strValidChars.indexOf(strChar) == -1)
		{
			blnResult = false;
		}
	}
	return blnResult;
}
function isValidEmail(str)
{
   return (str.indexOf(".") > 2) && (str.indexOf("@") > 0);
}
function alltrim(str) 
{
	return str.replace(/^\s+|\s+$/g, '');
}

function validateForm() 
{ 
	if(document.getElementById("name").value == "" )
	{
		alert("Please enter your name");
		document.getElementById("name").focus();
		return false;
	}
	if(alltrim(document.getElementById("name").value)== "" )
	{
		alert("Please enter your name");
		document.getElementById("name").focus();
		return false;
	}
	
	if(document.getElementById("phone").value == "" )
	{
		alert("Please enter your phone");
		document.getElementById("phone").focus();
		return false;
	}
	 if (!IsNumeric(document.getElementById("phone").value))
	{
	alert ("Please enter your phone in numeric");
	document.getElementById("phone").focus();
	return false;
	}
	if(document.getElementById("email").value == "" )
	{
		alert("Please enter your Email");
		document.getElementById("email").focus();
		return false;
	}
	if (!isValidEmail(document.getElementById("email").value))
	{
	alert ("please enter your correct email.")
	document.getElementById("email").focus();
	return false;
	}
	
}

