name, company, address, city, state, zip, phone, email
function validateForm() 
{
	
	if (document.Webform._fnName.value == "")
	{
		alert ("Name is required");
		document.Webform._fnName.focus();
		return false;
	}
	if (document.Webform._fnCompany.value =="")
	{
		alert ("Company is required");
		document.Webform._fnCompany.focus();
		return false;
	}

	if (document.Webform._fnAddress.value == "")
	{
		alert ("Address is required");
		document.Webform._fnAddress.focus();
		return false;
	}
	if (document.Webform._fnCity.value=="")
	{
		alert ("City is required");
		document.Webform._fnCity.focus();		
		return false;
	}
	if (document.Webform._fnPhone.value =="" || document.Webform._fnPhone.value.length < 10 || !(isNumber(document.Webform._fnPhone.value)))
	{
		alert ("Phone is required");
		document.Webform._fnPhone.focus();
		return false;
	}
	if (echeck(document.Webform._fnEmail.value)==false)
	{
		alert ("Email is required");
		document.Webform._fnEmail.focus();
		return false;
	}
	return true;
}

function isNumber(val)
{

	var ValidChars = "0123456789";
	var flag=true;
	var Char;
	for (i = 0; i < val.length && flag == true; i++) 
      { 
      Char = val.charAt(i); 
      if (ValidChars.indexOf(Char) == -1) 
         {
         flag = false;
         }
      }
	return flag;
}
function echeck(str) 
{

		var at="@";
		var dot=".";
		var lat=str.indexOf(at);
		var lstr=str.length;
		var ldot=str.indexOf(dot);
		if (str.indexOf(at)==-1){
		   return false;
		}
		if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
		   return false;
		}

		if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
		    return false;
		}

		 if (str.indexOf(at,(lat+1))!=-1){
		    return false;
		 }

		 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
		    return false;
		 }

		 if (str.indexOf(dot,(lat+2))==-1){
		    return false;
		 }
		
		 if (str.indexOf(" ")!=-1){
		    return false;
		 }

 		 return true;
	}


