function trim(stringToTrim) {
	return stringToTrim.replace(/^\s+|\s+$/g,"");
}
function isValidEmail(str) {

   return (str.indexOf(".") > 2) && (str.indexOf("@") > 0);

}
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 validateenquiry()
{
 	if(trim(document.getElementById("Name").value)== "")
	{
		alert("please enter name.");
		document.getElementById("Name").focus();
		return false;
	}
	if(trim(document.getElementById("Phone").value)== "")
	{
		alert("please enter phone.");
		document.getElementById("Phone").focus();
		return false;
	}
	if (!IsNumeric(document.getElementById("Phone").value))
	{
		alert ("Please enter your phone no. in numeric.");
		document.getElementById("Phone").focus();
		return false;
	}
	if ((document.getElementById("Phone").value.length < 8))
	{
		alert ("Phone no. should be minimum 8 characters.");
		document.getElementById("Phone").focus();
		return false;
	}	
	if(trim(document.getElementById("email").value)== "")
	{
		alert("please enter 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;
	}
	
	if(trim(document.getElementById("Message").value)== "")
	{
		alert("please enter message.");
		document.getElementById("Message").focus();
		return false;
	}
		
	

}


