
function contactvalid()
{
	if(document.contactus.custname.value == "")
	{
		alert("Please Enter the Name");
		document.contactus.custname.select();
		return false;
	}
id1=document.contactus.email.value.indexOf("@")
id2=document.contactus.email.value.indexOf(".")
if (document.contactus.email.value=="")
{
	alert("Please enter the Email ID");
	document.contactus.email.focus();
	return false;
}

 if(id1==-1)
		{
		alert("Invalid Email Id:");
		document.contactus.email.focus();
		return false;
		}	
	if(id2==-1)
		{
		alert("Please Enter Domain Name Also:");
		document.contactus.email.focus();
		return false;
		}
var iChars = "!#$%^&*()+=-[]\\\';,/{}|\":<>?";

  for (var i = 0; i < document.contactus.email.value.length; i++) {
  	if (iChars.indexOf(document.contactus.email.value.charAt(i)) != -1) {
  	alert ("Your username has special characters. \nThese are not allowed.\n Please remove them and try again.");
	document.contactus.email.focus();
  	return false;
  	}
  }
	if(document.contactus.city.value == "")
	{
		alert("Please Enter the City Name and State Name");
		document.contactus.city.select();
		return false;
	}
	if(document.contactus.phone.value == "")
	{
		alert("Please Enter the Phone Number");
		document.contactus.phone.select();
		return false;
	}
var num=document.contactus.phone.value;
	for(i=0;i<num.length;i++)
	{ 
		var number=num.substring(i,i+1);	
		if(!((((number>=0) && (number<=9)) || (number=='-'))))
		{
			alert("Enter only numbers in Phone Number");
			document.contactus.phone.focus();
			return false;
		}
	}
	if(document.contactus.year1.value == "")
	{
		alert("Please Enter the Year");
		document.contactus.year1.select();
		return false;
	}
var num=document.contactus.year1.value;
	for(i=0;i<num.length;i++)
	{ 
		var number=num.substring(i,i+1);	
		if(!((((number>=0) && (number<=9)))))
		{
			alert("Enter only numbers in Year");
			document.contactus.year1.focus();
			return false;
		}
	}
	if(document.contactus.make1.value == "")
	{
		alert("Please Enter the Make Name");
		document.contactus.make1.select();
		return false;
	}
	if(document.contactus.carinfo.value == "")
	{
		alert("Please Enter the Carinfo");
		document.contactus.carinfo.select();
		return false;
	}
	if(document.contactus.part.value == "")
	{
		alert("Please Enter the Part Name");
		document.contactus.part.select();
		return false;
	}
	/*var custname = document.contactus.custname.value;
	var email = document.contactus.email.value;
	var city = document.contactus.city.value;
	var phone = document.contactus.phone.value;
	var year = document.contactus.year.value;
	var make = document.contactus.make.value;
	var carinfo = document.contactus.carinfo.value;
	var part = document.contactus.part.value;
	var comments = document.contactus.comments.value;
	location.href = "http://www.turbochargerpros.com/sendmail~custname~"+custname+"~email~"+email+"~city~"+city+"~phone~"+phone+"~year~"+year+"~make~"+make+"~carinfo~"+carinfo+"~part~"+part+"~comments~"+comments+".asp";*/
return true;		
}
