
/* !Taken from before the oem parts selector on the homepage */
function gmpChgYear(year)
{
	if( year == "old" )
	{
		document.getElementById("selectMake").innerText = "[ Please wait... ]";
		document.location.href = "/partlocator/index.cfm?action=classicVehicles&siteid=215019&year=" + year;
	}
	else
	{
		//document.getElementById("selectMake").innerText = "[ Please wait... ]";
		//document.location.href = "/partlocator/index.cfm?siteid=215019&year=" + year;
		//fetchYearData(year);
		document.getElementById('selectMake').options[0].selected=true;
		document.getElementById('selectModel').innerHTML = '<option value="">-Model-</option>';
		document.getElementById('selectModel').options[0].selected=true;
	}

}

function GmpPartNumCheck()
{
	if (document.getElementById("keywordMake").options[document.getElementById("keywordMake").selectedIndex].value == "")
	{
		alert("You must choose a MAKE before you can search for a part.\nPlease choose a make");
		return false;
	}

	if( document.gmpKeywordSearch.partnumber1.value == "" )
	{
		alert("You must enter a part number or keyword to search.");
		return false;
	}

	if( document.gmpKeywordSearch.SearchType[1].checked )
	{
		document.gmpKeywordSearch.action = "/index.cfm?action=getJointLocator&siteid=215019&make=" + document.getElementById("keywordMake").value + "&searchText=" + document.gmpKeywordSearch.partnumber1.value;
	}

}



/* !Taken from after the oem parts selector on the homepage */
// javascript code generated by the CF_TwoSelectsRelated Cold Fusion tag (Nate Weiss, 4/98)
// portions adapted from Nick Heinle's code at http://webreference.com/javascript/960902/select_boxes.html
var maxlength = 10;
OneA = new Array;


var trueLength = OneA.length;  
var lst = OneA.length;              


function require_make() {
  with (document.getElementById("selectMake")) {
	  RetVal = true;
	  if (options[selectedIndex] == null) RetVal = false;
		  else RetVal = !(options[selectedIndex].value == '');
	  if (!RetVal) alert('You must choose an option for make.');
		return RetVal
	}
}


function require_model() {
  with (document.getElementById("selectModel")) {
	  RetVal = true;
	  if (options[selectedIndex] == null) RetVal = false;
		  else RetVal = !(options[selectedIndex].value == '');
	  if (!RetVal) alert('You must choose an option for model.');
		return RetVal
	}
}


function require_makeAndmodel() {
  return ((require_make()) && (require_model()));
}

		
function gmpPartsLocatorChangeMenu() {
	OneA.length = 0;
	selectedMake = document.getElementById("selectMake").selectedIndex;
	if (selectedMake == null) return;  
	//Get the appropriate array of models for this year and make.
	fetchYearData(document.getElementById("selectYear").value);
  tot = NewOpt.length;
	lst = document.getElementById("selectModel").options.length;
	
	for (i = lst; i > 0; i--) {
	  document.getElementById("selectModel").options[i] = null;
	}
  for (i = 0; i < tot; i++) {
	  document.getElementById("selectModel").options[i] = NewOpt[i];
	}
	
}