function check()
{
	document.form.submit();
	return true;
}
function RTrim(VALUE){
var w_space = String.fromCharCode(32);
var v_length = VALUE.length;
var strTemp = "";
if(v_length < 0){
return"";
}
var iTemp = v_length -1;

while(iTemp > -1){
if(VALUE.charAt(iTemp) == w_space){
}
else{
strTemp = VALUE.substring(0,iTemp +1);
break;
}
iTemp = iTemp-1;

} //End While
return strTemp;

} //End Function


function validsearch()
{
alert("test")
var year = document.form1.year.value;
alert(year)
var make = RTrim(document.form1.make.value);
MakeOne = make.replace(/\s/g,"-");
URL = 'http://www.discountacparts.com/selectmodel~year~'+year+'~make~'+MakeOne+'.asp';
alert("URL");
window.location.replace(URL);
return false;
}


function valid(myForm)
{
	//alert("test");
	var year = document.form.year.value;
	var make = RTrim(document.form.make.value);
	location.href = "selectmodel~Year~"+year+"~make~"+make+".asp";
return false;
}


<!--
function MM_preloadImages() { //v3.0
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.0
var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
if(!x && document.getElementById) x=document.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//-->
    function URLMove()
    {
       
		var murlYear=document.epc.year.value;
        var murlMake=document.epc.make.value;
        MakeOne=murlMake.replace(/\s/g,"~");
        URL = 'http://www.buyautoparts.com/modelcategory-'+murlYear+'-'+MakeOne+'.html';
        window.location.replace(URL);
        return false;       
    }
    function partsearch()
    {
       
		var murlYear=document.frm.year.value;
        var murlMake=document.frm.make.value;
        MakeOne=murlMake.replace(/\s/g,"~");
        URL = 'http://www.buyautoparts.com/modelcategory-'+murlYear+'-'+MakeOne+'.html';
        window.location.replace(URL);
        return false;       
    }
function searchURLMove()
    {
        var murlProduct="";
		murlProduct=SearchBox2.product.value;
        
//if(murlProduct!="" && )
		if ( murlProduct.length<3 )
		{
		alert("To search, you must enter at least 3 characters.");
		return false;
		}
		else if(murlProduct!="" )
		{
			if (!regular(murlProduct)) 
			{
				alert("Don't give Blank Space and Special Character")
				return false;
			}
			else
			{
				murlProduct=murlProduct.replace("-","~");
				var Searchmurl="";
				Searchmurl="http://www.buyautoparts.com/searchParts-"+murlProduct+".html";
				//alert (murl);
				SearchBox2.method="post";
				SearchBox2.action=Searchmurl;
				SearchBox2.submit=true;
			}

        }

    }
function regular(string) 
{
//if (!string) return false;
var Chars = "0123456789-ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";

for (var i = 0; i < string.length; i++)
{ 
	if (Chars.indexOf(string.charAt(i)) == -1)
	return false;
}
return true;
}

<!------Contact Us validation-------------!>
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.company.value == "")
	{
		alert("Please Enter the Company Name");
		document.contactus.company.select();
		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.year.value == "")
	{
		alert("Please Enter the Year");
		document.contactus.year.select();
		return false;
	}
	var num=document.contactus.year.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.year.focus();
			return false;
		}
	}
	if(document.contactus.make.value == "")
	{
		alert("Please Enter the Make Name");
		document.contactus.make.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;
	}
return true;	
}


//function vh_ttsLoaded(args)
//{
//	//loaded text to sppech audio =  args
//	//loaded text to speech is ready
//	alert('The text "' +args+ '" is loaded');
//	sayText(args,2,1,3);
//    sayText('all of our parts come with a full warranty.  If you have a problem we will replace the part at no charge.  No one can match our warranty',1,1,3)
//    sayText('We ship out of warehouses nationwide to ensure fast delivery.  Ground shipping is free',1,1,3)
//	sayText('Some of our compressors come with shipping oil.  We recommend you dump it out and start with clean oil.  There is an oil chart below.',2,1,3);
//	sayText('Some of our compressors come with shipping oil.  We recommend you dump it out and start with clean oil.  There is an oil chart below.',2,1,3);
//		sayText(' We always recommend using double end capped pag oil.  There is a chart below.',2,1,3);
//	sayText('Many of our compressors are available brand new.  New compressors last longer and perform better.  They are usually not much more money and always worth it.',2,1,3);
//	sayText('The drier is the filter on the system.  It pulls mositure and debris out of the freon.  A clean drier is crucial to a properly working a c system.  so important that we require it for the warranty.',2,1,3);
//	sayText('An expansion device is a generic term for a valve, a block or an orifice tube.  A valve or block controls pressure on the low side of the system. An orifice tube is a filter for a system with an accumulator.',2,1,3);
//	sayText('Most parts will ship same day on orders entered by four pm eastern standard time.  Please allow four to six business days for delivery.  We offer next day and second day shipping as well.',2,1,3);
//	sayText('So many reasons!  We have the largest selection of ac parts anywhere.  We offer more new parts than anyone else.  We have a toll free phone number.  We have the knowledgeable people answering the phone.  We offer the strongest warranty in the business.  and much much more.  d',2,1,3);
//	sayText('Give us a call.  We might be able to cross it.',2,1,3);">
//    sayText('Our products are the best in the industry',1,1,3);">
//	
//}

//=========Login validation===========//
function formvalidate()
{
	if (document.loginform.username.value=="")
	{
		alert("Please Enter User Name");
		document.loginform.username.select();
		document.loginform.username.focus();
		return false;
	}
	if (document.loginform.password.value=="")
	{
		alert("Please Enter Password");
		document.loginform.password.select();
		document.loginform.password.focus();
		return false;
	}
}

<!--
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}
//-->


