// JavaScript Document
	function fun_phone()
	{
		try
		{
			var f=document.PartRequest;
			var vPhoneType;
		}
		catch(Exception){}
	}
	
	function DispModel()
	{
		try
		{
			var f = document.PartRequest;
			
			if ((window.parent.newiframe.document.frm_onchange.int_C_Make8.selectedIndex!=0)) 
			{
				window.parent.newiframe.document.frm_onchange.txt_O_OtherMake.value='';
				window.parent.newiframe.document.frm_onchange.txt_O_OtherModel.value='';
				document.getElementById('showtd1').style.display= "none";
				document.getElementById('showtd2').style.display= "none";
			}		
			else 
			{
				window.parent.newiframe.document.frm_onchange.int_C_Model8.selectedIndex = 0;
				document.getElementById('showtd1').style.display= "";
				document.getElementById('showtd2').style.display= "";
			}
		}
		catch(Exception){}
	}	

	function fun_model()
	{
		try
		{
			if (window.parent.newiframe.document.frm_onchange.int_C_Model8.selectedIndex==1)
			{
				document.getElementById('showtd2').style.display= "";
			}
			else
			{
				window.parent.newiframe.document.frm_onchange.txt_O_OtherModel.value='';
				document.getElementById('showtd2').style.display= "none";
			}
		}
		catch(Exception){}
	}
	
	function DispDescr()
	{
		try
		{
			if (document.PartRequest.int_C_PartID8.options[document.PartRequest.int_C_PartID8.selectedIndex].text == 'Other - Not Listed')
			{
				document.PartRequest.txt_O_PartDesc.value = "";
				document.getElementById('partdisp').style.display= "";
				document.getElementById('partdispfont').style.fontWeight= "bold";
			}
			else
			{
				document.getElementById('partdisp').style.display= "none";
				document.getElementById('partdispfont').style.fontWeight= "";
			}
		}
		catch(Exception){}
	}
	
	function f_Countries(pmedit)
	{
		try
		{
			if (PartRequest.txt_C_ShipCountries8.value==1)
			{
				PartRequest.txt_C_ShipStates8.selectedIndex=1
				document.getElementById('showtd3').style.display= "";
				document.getElementById('showtd4').style.display= "";
			}
			else if (PartRequest.txt_C_ShipCountries8.value==2 || PartRequest.txt_C_ShipCountries8.value==3)
			{
				if (!pmedit)
				{
					PartRequest.txt_C_ShipStates8.selectedIndex=0
				}
				PartRequest.txt_O_OtherCountries.value='';
				PartRequest.txt_O_OtherStates.value='';
				document.getElementById('showtd3').style.display= "none";
				document.getElementById('showtd4').style.display= "none";
			}
			else
			{
				PartRequest.txt_C_ShipStates8.selectedIndex=1
				document.getElementById('showtd3').style.display= "";
				document.getElementById('showtd4').style.display= "none";
				PartRequest.txt_O_OtherCountries.value='';
			}
		}
		catch(Exception){}
	}
	
	function f_States()
	{
		try
		{
			if (PartRequest.txt_C_ShipStates8.value==1)
			{
				document.getElementById('showtd3').style.display= "";
			}
			else
			{
				document.getElementById('showtd3').style.display= "none";
				PartRequest.txt_O_OtherStates.value='';
			}
		}
		catch(Exception){}
	}
	
	function CheckStep1()
	{
		try
		{
			var vObject
			
			if (window.parent.newiframe.document.frm_onchange.int_C_Year.options[window.parent.newiframe.document.frm_onchange.int_C_Year.selectedIndex].value == "")
			{
				alert( "Select a Year" );
				vObject = window.parent.newiframe.document.frm_onchange.int_C_Year;
			}
			else if (window.parent.newiframe.document.frm_onchange.int_C_Make8.options[window.parent.newiframe.document.frm_onchange.int_C_Make8.selectedIndex].value == "")
			{
				alert( "Select a Make" );
				vObject = window.parent.newiframe.document.frm_onchange.int_C_Make8;
			}
	
			else if (window.parent.newiframe.document.frm_onchange.int_C_Model8.value == "")
			{
				alert( "Select a Model" );
				vObject = window.parent.newiframe.document.frm_onchange.int_C_Model8
			}
			else if (window.parent.newiframe.document.frm_onchange.int_O_SubModel8.value == "")
			{
				if (window.parent.newiframe.document.getElementById("showsuball").style.display == "")
				{
					alert( "Select a Sub Model" );
					vObject = window.parent.newiframe.document.frm_onchange.int_O_SubModel8
				}
			}
			else if(window.parent.newiframe.document.frm_onchange.txt_O_OtherBodyStyleID8.value == "")
			{
				if (window.parent.newiframe.document.getElementById("showbodytd2").style.display == "")
				{
					alert('Enter a Body Style');
					vObject = window.parent.newiframe.document.frm_onchange.txt_O_OtherBodyStyleID8
				}
			}
			else if (window.parent.newiframe.document.frm_onchange.int_C_TransmissionID8.value == "")
			{
				alert( "Select a Transmission" );
				vObject = document.PartRequest.int_C_TransmissionID8
			}
			else if (document.PartRequest.int_O_BodyStyleID8.options[document.PartRequest.int_O_BodyStyleID8.selectedIndex].value == "")
			{
				alert( "Select a Body Style" );
				vObject = document.PartRequest.int_O_BodyStyleID8
			}
			if (typeof(vObject) == "object")
			{//-- Return false if vObjject variable is a OBJECT
				//#--Show the VECHICLE INFORMATION div
				ShowMe(1);
				vObject.focus()
				return false;
			}
			return true
		}
		catch(Exception){}
	}

	function CheckStep2()
	{
		try
		{
			var vObject
	
			if (document.PartRequest.int_C_PartID8.options[document.PartRequest.int_C_PartID8.selectedIndex].value == "")
			{
				alert( "Select a Part" );
				vObject	= document.PartRequest.int_C_PartID8;
			}
			else if (document.PartRequest.int_C_PartID8.options[document.PartRequest.int_C_PartID8.selectedIndex].text == 'Other - Not Listed' && document.PartRequest.txt_O_PartDesc.value == "")
			{
				alert( "Enter a Part Description" );
				vObject	= document.PartRequest.txt_O_PartDesc;
			}
			
			if (typeof(vObject) == "object")
			{//-- Return false if vObjject variable is a OBJECT
				//#--Show the PART INFORMATION div
				ShowMe(2);
				vObject.focus()
				return false;
			}
	
			return true
		}
		catch(Exception){}
	}
	
	function CheckStep3()
	{
		try
		{
			var vObject; 
			if (document.PartRequest.txt_C_Name.value == "")
			{
				alert( "Enter Your Name" );
				vObject = document.PartRequest.txt_C_Name;
			}
			else if (!isEmail(trim(document.PartRequest.txt_C_Email.value)))
			{
				alert("Enter Your Correct Email Address (ie. your@email.com)")
				vObject = document.PartRequest.txt_C_Email;
			}
			else if (document.PartRequest.txt_C_Phone.value == "")
			{
				alert( "Enter Your Phone Number" );
				vObject = document.PartRequest.txt_C_Phone;
			}
			else if (document.PartRequest.txt_C_ShipCountries8.value == "")
			{
				alert( "Select a Country" );
				vObject	= document.PartRequest.txt_C_ShipCountries8;
			}
			else if (document.PartRequest.txt_C_ShipZipCode.value == ""  && (document.PartRequest.txt_C_ShipCountries8.value =="3" || document.PartRequest.txt_C_ShipCountries8.value =="2"))
			{
				alert( "Enter a Zip/Postal Code" );
				vObject	= document.PartRequest.txt_C_ShipZipCode;
			}
			else if ((isNaN(document.PartRequest.txt_C_ShipZipCode.value)) && document.PartRequest.txt_C_ShipCountries8.value =="2" )
			{
				alert( "Enter a Valid US Zip Code" );
				vObject	= document.PartRequest.txt_C_ShipZipCode;
			}

			else if ((document.PartRequest.txt_C_ShipZipCode.value.length <5 || document.PartRequest.txt_C_ShipZipCode.value.length >5) && document.PartRequest.txt_C_ShipCountries8.value =="2" )
			{
				alert( "Enter a Valid US Zip Code" );
				vObject	= document.PartRequest.txt_C_ShipZipCode;
			}
			else if ((document.PartRequest.txt_C_ShipZipCode.value.length <6 || document.PartRequest.txt_C_ShipZipCode.value.length >7) && document.PartRequest.txt_C_ShipCountries8.value =="3" )
			{
				alert( "Enter a Valid Canada Postal Code" );
				vObject	= document.PartRequest.txt_C_ShipZipCode;
			}
			if (typeof(vObject) == "object")
			{//-- Return false if vObjject variable is a OBJECT
				//#--Show the CONTACT INFORMATION div
				ShowMe(3);
				vObject.focus()
				return false;
			}
			return true
		}
		catch(Exception){}
	}
	

	function CheckPartInfo()
	{
    //return true;
		try
		{	
			var vObject;
			if (document.PartRequest.int_C_PartID8.value != "")
			{
			 	for (lintIndex=0;lintIndex<=PartRequest.hidPart.length-1;lintIndex++)
				{
					if (PartRequest.hidPart[lintIndex].id==PartRequest.int_C_PartID8.value)
					{
						//alert(document.PartRequest.int_C_SubPartID.value);
						if (document.PartRequest.hidPart[lintIndex].value=='Y' && document.PartRequest.int_C_SubPartID.value<=0)
						{
							alert ("Select Part Side");
							vObject	= document.PartRequest.int_C_SubPartID;
							 break;
						}
					}
				}
				
			}
			if (typeof(vObject) == "object")
			{//-- Return false if vObjject variable is a OBJECT
				//#--Show the SHIPPING INFORMATION div
				vObject.focus()
				return false;
			}
			return true
		}
		catch(Exception){}
	}



	function CheckStep4()
	{
		try
		{	
			if (document.PartRequest.txt_C_Name.value == "")
			{
			alert("Please enter Name")
			vObject=document.PartRequest.txt_C_Name.focus()
			return
			}
			
			if (!isEmail(trim(document.PartRequest.txt_C_Email.value)))
			{
			alert("Please enter correct email address")
			vObject=document.PartRequest.txt_C_Email.focus()
			return
			}
			if (trim(document.PartRequest.txt_C_ShipCountries8.value) == "")
			{
				alert( "Select a Country" );
				vObject=document.PartRequest.txt_C_ShipCountries8.focus();
				return
			}
			if (trim(document.PartRequest.txt_C_ShipZipCode.value) == ""  && (document.PartRequest.txt_C_ShipCountries8.value =="3" || document.PartRequest.txt_C_ShipCountries8.value =="2"))
			{
				alert( "Enter a Zip/Postal Code" );
				 document.PartRequest.txt_C_ShipZipCode.focus();
				return
			}
					else if ((isNaN(document.PartRequest.txt_C_ShipZipCode.value)) && document.PartRequest.txt_C_ShipCountries8.value =="2" )
			{
				alert( "Enter a Valid US Zip Code" );
				vObject	= document.PartRequest.txt_C_ShipZipCode;
			}
				else if ((document.PartRequest.txt_C_ShipZipCode.value.length <5 || document.PartRequest.txt_C_ShipZipCode.value.length >5) && document.PartRequest.txt_C_ShipCountries8.value =="2" )
			{
				alert( "Enter a Valid US Zip Code" );
				vObject	= document.PartRequest.txt_C_ShipZipCode;
			}
			else if ((document.PartRequest.txt_C_ShipZipCode.value.length <6 || document.PartRequest.txt_C_ShipZipCode.value.length >7) && document.PartRequest.txt_C_ShipCountries8.value =="3" )
			{
				alert( "Enter a Valid Canada Postal Code" );
				vObject	= document.PartRequest.txt_C_ShipZipCode;
			}
			if (trim(document.PartRequest.txt_C_Phone.value) == "")
			{
			alert("Please enter phone number test")
			vObject=document.PartRequest.txt_C_Phone.focus()
			return
			}	
			if (typeof(vObject) == "object")
			{//-- Return false if vObjject variable is a OBJECT
				//#--Show the SHIPPING INFORMATION div
				ShowMe(4);
				vObject.focus()
				return false;
			}
			return true
		}
		catch(Exception){}
	}
	
	function checkForm()
	{
			//#--Assign iFrame values to local hidden values
      
			AssignAllValues()
			
      //#--
		 
			if (CheckStep1() && CheckStep2()&& CheckPartInfo()  && CheckStep3() && CheckStep4())
			{ 	 	
				PartRequest.h_modelid8.value = window.parent.newiframe.document.frm_onchange.int_C_Make8.value; 

				submit_confirm();	
				return true;
			}
			else
			{    
				return false;
			}
	}
	
	function AssignAllValues()
	{
			document.PartRequest.int_C_Year.value = window.parent.newiframe.document.frm_onchange.int_C_Year.value
			document.PartRequest.int_C_Make8.value = window.parent.newiframe.document.frm_onchange.int_C_Make8.value
			document.PartRequest.txt_O_OtherMake.value=window.parent.newiframe.document.frm_onchange.txt_O_OtherMake.value

			if (window.parent.newiframe.document.frm_onchange.int_C_Model8)
				document.PartRequest.int_C_Model8.value=window.parent.newiframe.document.frm_onchange.int_C_Model8.value

			if (window.parent.newiframe.document.frm_onchange.txt_O_OtherModel)
				document.PartRequest.txt_O_OtherModel.value=window.parent.newiframe.document.frm_onchange.txt_O_OtherModel.value
				
			document.PartRequest.int_O_SubModel8.value=window.parent.newiframe.document.frm_onchange.int_O_SubModel8.value
			document.PartRequest.txt_O_OtherSubModel.value=window.parent.newiframe.document.frm_onchange.txt_O_OtherSubModel.value
			
			document.PartRequest.txt_O_VIN.value=window.parent.newiframe.document.frm_onchange.txt_O_VIN.value
			
			if (isObject(window.parent.newiframe.document.frm_onchange.int_O_EngineSize8))
				document.PartRequest.int_O_EngineSize8.value=window.parent.newiframe.document.frm_onchange.int_O_EngineSize8.value
			else
				document.PartRequest.txt_O_EngineSizeOther.value=window.parent.newiframe.document.frm_onchange.txt_O_EngineSizeOther.value
			
			document.PartRequest.int_O_AxleID8.value=window.parent.newiframe.document.frm_onchange.int_O_AxleID8.value
			document.PartRequest.int_C_TransmissionID8.value = window.parent.newiframe.document.frm_onchange.int_C_TransmissionID8.value

			document.PartRequest.int_O_FuelID8.value = window.parent.newiframe.document.frm_onchange.int_O_FuelID8.value
			document.PartRequest.int_O_BodyStyleID8.value=window.parent.newiframe.document.frm_onchange.int_O_BodyStyleID8.value
			document.PartRequest.txt_O_OtherBodyStyleID8.value=window.parent.newiframe.document.frm_onchange.txt_O_OtherBodyStyleID8.value
			document.PartRequest.h_modelid8.value=window.parent.newiframe.document.frm_onchange.h_modelid8.value
	}
	
	
	function part1()
	{
		try
		{
			vIsSubModel = false
			if (window.parent.newiframe.document.getElementById("showsuball").style.display == "")
			{
				vIsSubModel = (window.parent.newiframe.document.frm_onchange.int_O_SubModel8.value == "" )
			}
			///#--Checks whether Body Style div tag is visible
			vIsBodyStyle = false
			if (window.parent.newiframe.document.getElementById("showbodytd2").style.display =="")
			{
				vIsBodyStyle = (window.parent.newiframe.document.frm_onchange.txt_O_OtherBodyStyleID8.value == "")
			}
	
			vYear = (window.parent.newiframe.document.frm_onchange.int_C_Year.options.value == "")
			vMake = (window.parent.newiframe.document.frm_onchange.int_C_Make8.options.value == "" || (window.parent.newiframe.document.frm_onchange.int_C_Make8.value== "1" && window.parent.newiframe.document.frm_onchange.txt_O_OtherMake.value == "") )
			vModel = (window.parent.newiframe.document.frm_onchange.int_C_Model8.value == "" || (window.parent.newiframe.document.frm_onchange.int_C_Model8.value == "1" &&  window.parent.newiframe.document.frm_onchange.txt_O_OtherModel.value == ""))
			vTransmission = (window.parent.newiframe.document.frm_onchange.int_C_TransmissionID8.value == "")
			if (vYear || vMake || vModel || vTransmission || vIsSubModel || vIsBodyStyle)
			{
				document.getElementById("imgVehicleHead1").src = "Images/bluearrow.gif";
				if(document.getElementById("imgVehicleHead2")){document.getElementById("imgVehicleHead2").src = "Images/bluearrow.gif";};
				if(document.getElementById("imgVehicleHead3")){document.getElementById("imgVehicleHead3").src = "Images/bluearrow.gif";};
				if(document.getElementById("imgVehicleHead4")){document.getElementById("imgVehicleHead4").src = "Images/bluearrow.gif";};
				if(document.getElementById("imgVehicleHead5")){document.getElementById("imgVehicleHead5").src = "Images/bluearrow.gif";};
				
				return false;
			}
			else
			{
					document.getElementById("imgVehicleHead1").src = "Images/tic.gif";
					if(document.getElementById("imgVehicleHead2")){document.getElementById("imgVehicleHead2").src = "Images/tic.gif";};
					if(document.getElementById("imgVehicleHead3")){document.getElementById("imgVehicleHead3").src = "Images/tic.gif";};
					if(document.getElementById("imgVehicleHead4")){document.getElementById("imgVehicleHead4").src = "Images/tic.gif";};
					if(document.getElementById("imgVehicleHead5")){document.getElementById("imgVehicleHead5").src = "Images/tic.gif";};
				return true;
			}
		}
		catch(exception){}
	}
	
	function checkpart1()
	{
		if (window.parent.newiframe.document.frm_onchange.int_C_Year.options.value == "")
		{
			alert("Please select a Year")
			window.parent.newiframe.document.frm_onchange.int_C_Year.focus()
			return 
		}

		if (window.parent.newiframe.document.frm_onchange.int_C_Make8.options.value == "")
		{
			alert("Please select a Make")
			window.parent.newiframe.document.frm_onchange.int_C_Make8.focus()
			return
		}
		
		if ((window.parent.newiframe.document.frm_onchange.int_C_Make8.value== "1" && window.parent.newiframe.document.frm_onchange.txt_O_OtherMake.value == ""))
		{
			alert("Please enter Other Make")
			window.parent.newiframe.document.frm_onchange.txt_O_OtherMake.focus()			
			return
		}

		if (window.parent.newiframe.document.frm_onchange.int_C_Model8.value == "")
		{
			alert("Please select a Model")
			window.parent.newiframe.document.frm_onchange.int_C_Model8.focus()
			return
		}

		if ((window.parent.newiframe.document.frm_onchange.int_C_Model8.value == "1" &&  window.parent.newiframe.document.frm_onchange.txt_O_OtherModel.value == ""))
		{		
			alert("Please enter Other Model")
			window.parent.newiframe.document.frm_onchange.txt_O_OtherModel.focus()
			return
		}

		//#--Check Sub Model
		if (window.parent.newiframe.document.getElementById("showsuball").style.display == "")
			vIsSubModel = (window.parent.newiframe.document.frm_onchange.int_O_SubModel8.value == "" )

		///#--Checks whether Body Style div tag is visible
		vIsBodyStyle = false
		if (window.parent.newiframe.document.getElementById("showbodytd1").style.display =="")
			vIsBodyStyle = (window.parent.newiframe.document.frm_onchange.int_O_BodyStyleID8.value == "")

		if (vIsSubModel)
		{
			alert("Please select a Sub Model")
			window.parent.newiframe.document.frm_onchange.int_O_SubModel8.focus()
			return
		}
			
		if (vIsBodyStyle)
		{
			alert("Please select a Body Style")
			window.parent.newiframe.document.frm_onchange.int_O_BodyStyleID8.focus()
			return
		}

		if (window.parent.newiframe.document.frm_onchange.int_C_TransmissionID8.value == "")
		{
			alert("Please enter Transmission")
			window.parent.newiframe.document.frm_onchange.int_C_TransmissionID8.focus()
			return
		}



	}
	
	function part2()
	{
		var vImage
		var vRetValue
		try
		{
    
			if (document.PartRequest.int_C_PartID.value == "" || 
				(document.PartRequest.int_C_PartID8.options[document.PartRequest.int_C_PartID8.selectedIndex].text == 'Other - Not Listed' && document.PartRequest.txt_O_PartDesc.value == ""))
			{
				vImage = "Images/bluearrow.gif";
				vRetValue = false;
			}
			else if (document.PartRequest.hidPartSt.value == "Y" )
			{
				if (document.PartRequest.int_C_SubPartID.value>0)
				{
					vImage = "Images/tic.gif";
					vRetValue = true;
				}
				else
				{
				vImage = "Images/bluearrow.gif";
				vRetValue = false;
				}
			}
			else
			{
				vImage = "Images/tic.gif";
				vRetValue = true;
			}

			if(document.getElementById("imgPartHead1")){document.getElementById("imgPartHead1").src = vImage;};
			if(document.getElementById("imgPartHead2")){document.getElementById("imgPartHead2").src = vImage;};
			if(document.getElementById("imgPartHead3")){document.getElementById("imgPartHead3").src = vImage;};
			if(document.getElementById("imgPartHead4")){document.getElementById("imgPartHead4").src = vImage;};
			if(document.getElementById("imgPartHead5")){document.getElementById("imgPartHead5").src = vImage;};
			return vRetValue;
			
		}
		catch(exception){}
	}
	
	function checkpart2()
	{
		if (document.PartRequest.int_C_PartID.value == "")
		{
			 if (document.PartRequest.hidPageSt.value=="PartRequest")
			 {
			 	alert('Please select a part');
			}
			document.PartRequest.int_C_PartID.focus()
			return false;
		}

		if (document.PartRequest.int_C_PartID8.options[document.PartRequest.int_C_PartID8.selectedIndex].text == 'Other - Not Listed' && document.PartRequest.txt_O_PartDesc.value == "")
		{
			alert('Please enter Part Description')
			document.PartRequest.txt_O_PartDesc.focus()
			return false;
		}
	}


	function part3()
	{
		
		if (document.PartRequest.hidPageSt.value=="Vendor")
		{
			lflgSt=part3Vendor();
		}
		else if (document.PartRequest.hidPageSt.value=="PartRequest")
		{
			lflgSt=part3PartRequest();
		}
		return lflgSt;
	}
	function trim(str)
{    
	return str.replace( /^ +/, "" ).replace( / +$/, "" );
}
	function part3PartRequest()
	{
	try
		{	
			if (document.PartRequest.txt_C_Name.value == "" ||
				!isEmail(trim(document.PartRequest.txt_C_Email.value)) ||
				document.PartRequest.txt_C_Phone.value == ""  )
			{
				document.getElementById("imgContactHead1").src = "Images/bluearrow.gif";
				document.getElementById("imgContactHead2").src = "Images/bluearrow.gif";
				document.getElementById("imgContactHead3").src = "Images/bluearrow.gif";
				document.getElementById("imgContactHead4").src = "Images/bluearrow.gif";
				document.getElementById("imgContactHead5").src = "Images/bluearrow.gif";
				return false;
			}
			else
			{
				document.getElementById("imgContactHead1").src = "Images/tic.gif";
				document.getElementById("imgContactHead2").src = "Images/tic.gif";
				document.getElementById("imgContactHead3").src = "Images/tic.gif";
				document.getElementById("imgContactHead4").src = "Images/tic.gif";
				document.getElementById("imgContactHead5").src = "Images/tic.gif";
				return true;
			}
		}
		catch(exception){}
	}

	
	
	
	function part3Vendor()
	{
	try
		{	
			if (document.PartRequest.txt_C_Name.value == "" ||
				!isValidEmail(document.PartRequest.txt_C_Email.value) ||
				document.PartRequest.txt_C_Phone.value == "" ||
				document.PartRequest.txt_C_ShipCity.value == "" ||
				document.PartRequest.txt_C_ShipCountries8.options[document.PartRequest.txt_C_ShipCountries8.selectedIndex].value == "" ||
				(document.PartRequest.txt_C_ShipCountries8.options[document.PartRequest.txt_C_ShipCountries8.selectedIndex].value == 1 &&  
									document.PartRequest.txt_O_OtherCountries.value =='') || 
				document.PartRequest.txt_C_ShipStates8.options[document.PartRequest.txt_C_ShipStates8.selectedIndex].value == "" ||
				(document.PartRequest.txt_C_ShipStates8.options[document.PartRequest.txt_C_ShipStates8.selectedIndex].value == 1 && 
								document.PartRequest.txt_O_OtherStates.value =='') ||
			document.PartRequest.txt_C_ShipZipCode.value == "")

			{
				document.getElementById("imgContactHead1").src = "Images/bluearrow.gif";
				document.getElementById("imgContactHead2").src = "Images/bluearrow.gif";
				document.getElementById("imgContactHead3").src = "Images/bluearrow.gif";
				document.getElementById("imgContactHead4").src = "Images/bluearrow.gif";
				document.getElementById("imgContactHead5").src = "Images/bluearrow.gif";
				return false;
			}
			else
			{
				document.getElementById("imgContactHead1").src = "Images/tic.gif";
				document.getElementById("imgContactHead2").src = "Images/tic.gif";
				document.getElementById("imgContactHead3").src = "Images/tic.gif";
				document.getElementById("imgContactHead4").src = "Images/tic.gif";
				document.getElementById("imgContactHead5").src = "Images/tic.gif";
				return true;
			}
		}
		catch(exception){}
	}
function isEmail(fstrEmail) 
{
  var re = new RegExp("^[a-zA-Z0-9._-]+@[a-zA-Z0-9._-]+\.([a-zA-Z]{2,4})$");
	fstrEmail=trim(fstrEmail);
	lintPos=fstrEmail.indexOf("@")
	lstrwww=(fstrEmail.substr(0, 3).toUpperCase());
	lstrhttp=(fstrEmail.substr(0, 4).toUpperCase());
	lstrDot=fstrEmail.substr(lintPos);
	lintpos=lstrDot.indexOf(".");
	if (fstrEmail.indexOf(",")!=-1 || fstrEmail.indexOf(".")==-1 || lintpos==-1 || lstrwww =="FTP" || lstrwww =="WWW" || lstrhttp=="HTTP" )
	{
		return false
	}
	else if (fstrEmail.match(re)) {
    return true;
  } else {
    return false;
  }
}	
	function checkpart3()
	{
	
		if (document.PartRequest.txt_C_Name.value == "")
		{
			alert("Please enter Name")
			document.PartRequest.txt_C_Name.focus()
			return
		}
 
		if (!isEmail(trim(document.PartRequest.txt_C_Email.value)))
		{
			alert("Please enter correct email address")
			document.PartRequest.txt_C_Email.focus()
			return
		}
		if (trim(document.PartRequest.txt_C_ShipCountries8.value) == "")
			{
				alert( "Select a Country" );
				document.PartRequest.txt_C_ShipCountries8.focus();
				return
			}
			if (trim(document.PartRequest.txt_C_ShipZipCode.value) == "" && (document.PartRequest.txt_C_ShipCountries8.value =="3" || document.PartRequest.txt_C_ShipCountries8.value =="2"))
			{
				alert( "Enter a Zip/Postal Code" );
				 document.PartRequest.txt_C_ShipZipCode.focus();
				return
			}
					else if ((isNaN(document.PartRequest.txt_C_ShipZipCode.value)) && document.PartRequest.txt_C_ShipCountries8.value =="2" )
			{
				alert( "Enter a Valid US Zip Code (ie. 90210)" );
				vObject	= document.PartRequest.txt_C_ShipZipCode;
			}
				else if ((document.PartRequest.txt_C_ShipZipCode.value.length <5 || document.PartRequest.txt_C_ShipZipCode.value.length >5) && document.PartRequest.txt_C_ShipCountries8.value =="2" )
			{
				alert( "Enter a Valid US Zip Code (ie. 90210)" );
				vObject	= document.PartRequest.txt_C_ShipZipCode;
			}
			else if ((document.PartRequest.txt_C_ShipZipCode.value.length <6 || document.PartRequest.txt_C_ShipZipCode.value.length >7) && document.PartRequest.txt_C_ShipCountries8.value =="3" )
			{
				alert( "Enter a Valid Canadian Post Code (ie. K7R 2G9)");
				vObject	= document.PartRequest.txt_C_ShipZipCode;
			}
		if (trim(document.PartRequest.txt_C_Phone.value) == "")
		{
			alert("Please enter phone number test")
			document.PartRequest.txt_C_Phone.focus()
			return
		}
		
	}
	function part4()
	{ 
		try
		{
 			if (trim(document.PartRequest.txt_C_Name.value) == "" ||	document.PartRequest.txt_C_Email.value == "" ||
			document.PartRequest.txt_C_Phone.value == "" ||	document.PartRequest.txt_C_ShipCountries8.value == "" ||
			(   (document.PartRequest.txt_C_ShipCountries8.value==2 ||	document.PartRequest.txt_C_ShipCountries8.value==3)
				&& (document.PartRequest.txt_C_ShipZipCode.value == ""))) 
		 
			{
				document.getElementById("imgReviewHead1").src = "Images/bluearrow.gif";
				document.getElementById("imgReviewHead2").src = "Images/bluearrow.gif";
				document.getElementById("imgReviewHead3").src = "Images/bluearrow.gif";
				document.getElementById("imgContactHead5").src = "Images/bluearrow.gif";
				document.getElementById("imgReviewHead5").src = "Images/bluearrow.gif";
				return false;
			}
			else
			{
				document.getElementById("imgReviewHead1").src = "Images/tic.gif";
				document.getElementById("imgReviewHead2").src = "Images/tic.gif";
				document.getElementById("imgReviewHead3").src = "Images/tic.gif";
				document.getElementById("imgContactHead5").src = "Images/tic.gif";
				document.getElementById("imgReviewHead5").src = "Images/tic.gif";
 
				return true;
			}
		}
		catch(Exception){}
	}
	
	function checkpart4()
	{
		
		if (document.PartRequest.txt_C_Name.value == "")
		{
			alert("Please enter Name")
			document.PartRequest.txt_C_Name.focus()
			return false;
		}
		
		 if (!isEmail(trim(document.PartRequest.txt_C_Email.value)))
			{
				alert("Enter Your Correct Email Address (ie. your@email.com)")
				  document.PartRequest.txt_C_Email.focus();	return false;
			}
		if (document.PartRequest.txt_C_Phone.value =='') 
		{
			alert("Please enter the Phone no")
			document.PartRequest.txt_C_Phone.focus()
			return false;
		}
		if (document.PartRequest.txt_C_ShipCountries8.value == "")
		{
			alert("Please select a Country")
			document.PartRequest.txt_C_ShipCountries8.focus()
			return false;
		}
		if (document.PartRequest.txt_C_ShipZipCode.value == "" && (document.PartRequest.txt_C_ShipCountries8.value =="2"))
		{
			alert("Enter a Valid US Zip Code (ie. 90210)");
			document.PartRequest.txt_C_ShipZipCode.focus();
			return false;
		}
		if (document.PartRequest.txt_C_ShipZipCode.value == "" && (document.PartRequest.txt_C_ShipCountries8.value =="3"))
		{
			alert("Enter a Valid Canadian Post Code (ie. K7R 2G9)");
			document.PartRequest.txt_C_ShipZipCode.focus();
			return false;
		}
		else if ((isNaN(document.PartRequest.txt_C_ShipZipCode.value)) && document.PartRequest.txt_C_ShipCountries8.value =="2" )
		{
			alert( "Enter a Valid US Zip Code (ie. 90210)");
			document.PartRequest.txt_C_ShipZipCode.focus();
			return false;
		}
			else if ((document.PartRequest.txt_C_ShipZipCode.value.length <5 || document.PartRequest.txt_C_ShipZipCode.value.length >5) && document.PartRequest.txt_C_ShipCountries8.value =="2" )
		{
			alert( "Enter a Valid US Zip Code (ie. 90210)" );
			  document.PartRequest.txt_C_ShipZipCode.focus();
			  return false;
		}
		else if ((document.PartRequest.txt_C_ShipZipCode.value.length <6 || document.PartRequest.txt_C_ShipZipCode.value.length >7) && document.PartRequest.txt_C_ShipCountries8.value =="3" )
		{
			alert( "Enter a Valid Canadian Post Code (ie. K7R 2G9)" );
			  document.PartRequest.txt_C_ShipZipCode.focus();
			return false;
		}
			return true;
	}
	
	function checkComplete()
	{
		try
		{
			part1();
			part2();
			part3();
			part4();
			checktick();
		}
		catch(errTmp){}
			
	}
	
	function checktick()
	{
		try
		{
				vIsSubModel = false
				if (window.parent.newiframe.document.getElementById("showsuball").style.display == "")
				{
					vIsSubModel = (window.parent.newiframe.document.frm_onchange.int_O_SubModel8.value == "" )
				}
				vIsBodyStyle = false
				if (window.parent.newiframe.document.getElementById("showbodytd2").style.display =="")
				{
				vIsBodyStyle = (window.parent.newiframe.document.frm_onchange.txt_O_OtherBodyStyleID8.value == "")
				}
				vYear = (window.parent.newiframe.document.frm_onchange.int_C_Year.options.value == "")
				vMake = (window.parent.newiframe.document.frm_onchange.int_C_Make8.options.value == "" || (window.parent.newiframe.document.frm_onchange.int_C_Make8.value== "1" && window.parent.newiframe.document.frm_onchange.txt_O_OtherMake.value == "") )
				vModel = (window.parent.newiframe.document.frm_onchange.int_C_Model8.value == "" || (window.parent.newiframe.document.frm_onchange.int_C_Model8.value == "1" &&  window.parent.newiframe.document.frm_onchange.txt_O_OtherModel.value == ""))
				vTransmission = (window.parent.newiframe.document.frm_onchange.int_C_TransmissionID8.value == "")
			if (vYear || vMake || vModel || vTransmission || vIsSubModel || vIsBodyStyle || document.PartRequest.int_C_PartID.value == "" || (document.PartRequest.int_C_PartID8.selectedIndex == 1 && document.PartRequest.txt_O_PartDesc.value == "") || document.PartRequest.txt_C_Name.value == "" ||
				document.PartRequest.txt_C_Email.value == "" ||
				document.PartRequest.txt_C_Email.value.indexOf('@',1) == -1 || document.PartRequest.txt_C_Email.value.indexOf('.',3) == -1 ||
				document.PartRequest.txt_C_Phone.value == "" || document.PartRequest.txt_C_ShipCity.value == "" ||
					document.PartRequest.txt_C_ShipCountries8.value == "" || document.PartRequest.txt_C_ShipZipCode.value == "")
					{
						document.getElementById("imgReviewHead1").src = "Images/bluearrow.gif";
						document.getElementById("imgReviewHead2").src = "Images/bluearrow.gif";		
						document.getElementById("imgReviewHead3").src = "Images/bluearrow.gif";
						document.getElementById("imgReviewHead4").src = "Images/bluearrow.gif";
						document.getElementById("imgReviewHead5").src = "Images/bluearrow.gif";
						return false;		
					}
					else
					{
					document.getElementById("imgReviewHead1").src = "Images/tic.gif";
					document.getElementById("imgReviewHead2").src = "Images/tic.gif";		
					document.getElementById("imgReviewHead3").src = "Images/tic.gif";		
					document.getElementById("imgReviewHead4").src = "Images/tic.gif";
					document.getElementById("imgReviewHead5").src = "Images/tic.gif";		
					return true;
					}
		}
		catch(Exception){}
	}
	

	function ShowStep(pmStep)
	{
		
    try
		{
			
      if (pmStep > document.PartRequest.hid_curpage.value)
			{
				top.document.PartRequest.hid_count.value = 1			

				if (pmStep == "2" || pmStep == "3" || pmStep == "4" || pmStep == "5") 
				//#--Vehicle Information
				//#--Checks whether all mandatory fields are filled or not
				{
					
          if (part1() == false) //Checks Vehicle Information
					{
						//#--Show tab 1
						
            ShowMe(1)
            
						//#--Returns error msg while any mandatory field is empty
						checkpart1()
            
						return
					}
          
				}
				if (pmStep == "3" || pmStep == "4" || pmStep == "5")
				//#--Part Informtaion
				//#--Checks whether all mandatory fields are filled or not
				{
					if (part2() == false)
					{
						//#--Show tab 2
						ShowMe(2)
						//#--Returns error msg while any mandatory field is empty
						checkpart2()
						return
					}
				}
				if (pmStep == "4" || pmStep == "5") 
				//#--Contact Information
				//#--Checks whether all mandatory fields are filled or not
				{
					if (part3() == false)
					{//#--Returns error msg while any mandatory field is empty
						//#--Show tab 3
						ShowMe(3)
						//#--Returns error msg while any mandatory field is empty
						checkpart3(); 					
						return;
					}
				}
				if (pmStep == "5") 
				//#--Shipping Information
				//#--Checks whether all mandatory fields are filled or not
				{ 	part4();	
				 	if (checkpart4()==true)
					{//#--Returns error msg while any mandatory field is empty
						 //#--Show tab 4
						ShowMe(5)
						//#--Returns error msg while any mandatory field is empty
						return;
					} else
					{ 
						ShowMe(3);return ;
					}
				 
				}
			}
				ShowMe(pmStep);
				switch (pmStep){
				case 1:
					document.newiframe.frm_onchange.int_C_Year.focus()
				case 2:
					document.PartRequest.int_C_PartID8.focus()
				case 3:
					document.PartRequest.txt_C_Name.focus()
				case 4:
					document.PartRequest.txt_C_Name.focus()
				}
		}
		catch(Exception){}
	}
	function ShowMe(pmStep)
	{
		try
		{
			
			/*--This part should execute only for vendores*/
			if (document.getElementById("hid_isVendor"))
			{
				if (document.getElementById("hid_isVendor").value == 'yes')
					pmStep = 1
			}
			/*--End of part*/
			if (document.getElementById("step1"))
			{
				document.getElementById("step1").style.display = (pmStep == 1?"":"none")
				document.getElementById("step1Bullet").style.display = (pmStep == 1?"":"none")
			}
	
			if (document.getElementById("step2"))
			{
				document.getElementById("step2").style.display = (pmStep == 2?"":"none")
				document.getElementById("step2Bullet").style.display = (pmStep == 2?"":"none")
			}

			if (document.getElementById("step3"))
			{
				document.getElementById("step3").style.display = (pmStep == 3?"":"none")
				document.getElementById("step3Bullet").style.display = (pmStep == 3?"":"none")
			}	


			if (document.getElementById("step4"))
			{
				document.getElementById("step4").style.display = (pmStep == 4?"":"none")
				document.getElementById("step4Bullet").style.display = (pmStep == 4?"":"none")
			}
	
			if (document.getElementById("step5"))
			{
				document.getElementById("step5").style.display = (pmStep == 5?"":"none")
				document.getElementById("step5Bullet").style.display = (pmStep == 5?"":"none")
			}

			if (pmStep == 5) 
			{
				document.getElementById("txt25").value = document.getElementById("txt_C_Email").value;
				document.getElementById("txt21").value = document.getElementById("int_C_PartID8")[document.getElementById("int_C_PartID8").selectedIndex].id;
				if (document.getElementById('divSubPart').style.display == "" )
				{
					if(document.getElementById("int_C_SubPartID")[document.getElementById("int_C_SubPartID").selectedIndex].id.toUpperCase()!="NOT APPLICABLE")
					{
						document.getElementById("txt51").value = document.getElementById("int_C_SubPartID")[document.getElementById("int_C_SubPartID").selectedIndex].id;	
						document.getElementById("divPart").style.display ="";
					}
					else
					{
						document.getElementById("txt51").value = "";
						document.getElementById("divPart").style.display ="NONE";
					}
				}
				else
				{		document.getElementById("txt51").value = "";
						document.getElementById("divPart").style.display ="NONE";
				}
				document.getElementById("txt22").value = document.getElementById("txt_O_PartDesc").value;
				document.getElementById("txt23").value = document.getElementById("txt_O_Company").value;
				document.getElementById("txt24").value = document.getElementById("txt_C_Name").value;
				document.getElementById("txt25").value = document.getElementById("txt_C_Email").value;
				document.getElementById("txt26").value = document.getElementById("txt_C_Phone").value;
				document.getElementById("txt27").value = document.getElementById("txt_O_BestTime").value;
			 	document.getElementById("txt28").value = document.getElementById("txt_O_OtherPhoneNo").value;
				document.getElementById("txt29").value = document.getElementById("txt_O_ShipAddress").value;
	
				document.getElementById("txt30").value = document.getElementById("txt_C_ShipCity").value;
				document.getElementById("txt32").value = document.getElementById("txt_C_ShipZipCode").value;
			
			//	if (document.all.txt_O_OtherStates.value)
			//		document.all.txt31.value = document.all.txt_O_OtherStates.value;
			//	else
			//		document.all.txt31.value = document.all.txt_C_ShipStates8.options[document.all.txt_C_ShipStates8.selectedIndex].text;
	
			//	if (document.all.txt_C_ShipCountries8.value == 1)
			//		document.all.txt33.value = document.all.txt_O_OtherCountries.value;
			//	else
					document.getElementById("txt33").value = document.getElementById("txt_C_ShipCountries8")[document.getElementById("txt_C_ShipCountries8").selectedIndex].id
				if(document.getElementById("txt_O_ShipAddress").value != "")
				{
					vShipAddress =  document.getElementById("txt_O_ShipAddress").value
					if (document.getElementById("txt_O_ShipFlatNo").value != "")
					{
						vShipAddress = vShipAddress + ", " + document.getElementById("txt_O_ShipFlatNo").value  
					}
				}
				document.getElementById("txt29").value = vShipAddress		//document.getElementById("txt_O_ShipAddress").value;
			}
			document.PartRequest.hid_curpage.value = pmStep
		}
		catch(Exception){}
	}