// JavaScript Document
function contactus(x)
{
	if(x.name.value=="")
	{
		alert("Please enter your Name!");
		x.name.focus();
		return (false);
	}
	if(x.title.value=="")
	{
		alert("Please enter Title");
		x.title.focus();
		return (false);
	}
	if (x.email.value == "")
	{
	alert("Please enter your E-Mail id!");
	x.email.focus();
	return (false);
	}
// test if valid email address, must have @ and .
var checkEmail = "@.";
var checkStr = x.email.value;
var EmailValid = false;
var EmailAt = false;
var EmailPeriod = false;
	for (i = 0;  i < checkStr.length;  i++)
	{
		ch = checkStr.charAt(i);
		for (j = 0;  j < checkEmail.length;  j++)
		{
			if (ch == checkEmail.charAt(j) && ch == "@")
			EmailAt = true;
			if (ch == checkEmail.charAt(j) && ch == ".")
			EmailPeriod = true;
	  		if (EmailAt && EmailPeriod)
			break;
	  		if (j == checkEmail.length)
			break;
		}
	// if both the @ and . were in the string
		if (EmailAt && EmailPeriod)
		{
			EmailValid = true
			break;
		}	
	}
	if (!EmailValid)
	{
		alert("The \"email\" field must contain an \"@\" and a \".\".");	
		x.email.focus();
		return (false);
	}
	if(x.phone.value=="")
	{
		alert("Please enter your Mobile Phone number or Land Phone number!");
		x.phone.focus();
		return (false);
	}
	if(isNaN(x.phone.value))
	{
		alert("Please enter Numbers only in the Phone text box!");
		x.phone.focus();
		return (false);
	}
	if(x.company.value=="")
	{
		alert("Please enter City Name");
		x.company.focus();
		return (false);
	}
	if(x.saddress.value=="")
	{
		alert("Please enter Street Address");
		x.saddress.focus();
		return (false);
	}
	 if(x.country.value=="")
	{
		alert("Please enter Country");
		x.country.focus();
		return (false);
	}
	if(x.city.value=="")
	{
		alert("Please enter City");
		x.city.focus();
		return (false);
	}
	if(x.state.value=="")
	{
		alert("Please enter State");
		x.state.focus();
		return (false);
	}

  

	if(x.zip.value=="")
	{
		alert("PLease enter Zip");
		x.zip.focus();
		return (false);
	}
	if(isNaN(x.zip.value))
	{
		alert("PLease enter Numbers only");
		x.zip.focus();
		return (false);
	}
	
	if(x.comments.value=="")
	{
		alert("PLease enter Comments or Request");
		x.comments.focus();
		return (false);
	}
}
