// last updated on sep-25
// created by boris kovalevsky
// imagerev.com
// email: pcne@hotmail.com
// all rights reserved
// JavaScript Document

function getInfo(par) {
	var yearSelection= document.getElementById("year_remote");
	var makeSelection = document.getElementById("make_remote");
	var modelSelection = document.getElementById("model_remote");
	
	if (par=='year') {
		var arg = yearSelection.value;
		removeChildren("make_remote");
		removeChildren("model_remote");
		addOption(makeSelection, "Make");
		addOption(modelSelection, "Model");
		var ctr = years_makes_arry.length;
		for (i=0; i<ctr; i++) {
			if(years_makes_arry[i][0] == arg) {
				addOption(makeSelection, years_makes_arry[i][1]);
			}
		}
		makeSelection.focus();
	}
	else if(par=='make') {
		removeChildren("model_remote");
		addOption(modelSelection, "Model");
		year = 	yearSelection.value;
		make =  makeSelection.value;
		//alert(''+year+' '+make);
		ctr = carYearMakeModel.length;
		for(i=0; i<ctr; i++) {
			if((carYearMakeModel[i][1]==make)&&(carYearMakeModel[i][0]==year)){
				addOption(modelSelection, carYearMakeModel[i][2]);
			}
		}
		modelSelection.focus();
	}
	
} // end func

function init() {
	var yearSelection = document.getElementById("year_remote");
	var makeSelection = document.getElementById("make_remote");
	var modelSelection = document.getElementById("model_remote");

//alert (years_arry.length);
	removeChildren("year_remote");
	removeChildren("make_remote");
	removeChildren("model_remote");
	
	addOption(yearSelection, "Year");
	addOption(makeSelection, "Make");
	addOption(modelSelection, "Model");
	//alert(years_arry.length);
	// put list of years into year drop down
	for (i=0; i < years_arry.length; i++) {
		var arg = years_arry[i];
		//alert("year is "+arg);
		addOption(yearSelection, arg);
	} // end for*/
} // func init

function send_data(g)
{
  //get_data();
  //if(Form_Validator(g)) {
	  g.submit();
  //}  
}
window.onload=init;