
function populateHondaMenu(){
//Puts values into drop-down box

//Enter values below.  Number of getName must match number of getValue.  Must be separated by #
	var getName = "-- View a different Honda --#Accord#Civic#Crosstour#CR-V#Element#Fit#Insight#Odyssey#Pilot#Ridgeline";
	var getValue = "-- Click Here --#honda_accord_types.php#honda_civic_types.php#honda_crosstour.php#honda_crv_types.php#honda_element_types.php#honda_fit_types.php#honda_insight_types.php#honda_odyssey_types.php#honda_pilot_types.php#honda_ridgeline_types.php";

setArrays(getName, getValue);
}


function setArrays(varName, varValue){
//Breaks out lists into arrays
	arrayName = varName.split('#');
	arrayValue = varValue.split('#');

	clearList(document.frm.ddMenu);

	for (var i = 0; i < arrayName.length; i++){

		addElement(document.frm.ddMenu, arrayName[i], arrayValue[i])

	}

}


function clearList(list) {
//Clears dd box forddGoToMenu
    var i = 0;
    var o = list.options;

    for (i = o.length; i >= 0; --i)
		o[i] = null;
    list.disabled = true;
}


function addElement(list, text_in, value_in){
//Updates dd box forddGoToMenu

    var o = list.options;
    var nIdx;
	if (o.length < 0)// IE for Mac 4.5 sets length to -1 if list is empty
		nIdx = 0;
	else
		nIdx = o.length;

	o[nIdx] = new Option(text_in, value_in);
	list.disabled = false;
}


function goTo(){
//Goes to Selection Made
	indx = document.frm.ddMenu.selectedIndex;
	
	if(indx !=0){
		window.location = document.frm.ddMenu.options[indx].value;
	}
}

