/**
*Dyanamic Ajax Selection Menu was build by Mark Skayff(Marcos Scaianschi) on 
*26th August 2009. You are free to use this code everytime 
*you place a notice like this on the head of your documents.
*Mark Skayff - Software&Design - Montevideo - Uruguay
*mjs22@adinet.com.uy - 598294936718
*
*This code is build to solve several compatibilty issues between the Internet Explorer and other browsers.
*Mainly because IE(Internet Explorer) features a Bug when attempting to populate dynamically a select element.
*You can study more about this IE bug here.http://support.microsoft.com/kb/276228
*
*
*/
function grabMods()
{
	var selMaker = showMeMaker();
	document.getElementById("years").innerHTML = "";
	top.frames['hiddenFrame'].location = "models.php?manuf="+selMaker;
}

function grabYears()
{
	var selModel = showMeModel();
	top.frames['hiddenFrame'].location ="years.php?model="+selModel;
}

function showMeModel()
{
	var modelObj = document.getElementById("models");
	var model = modelObj.selectedIndex;
	var option = modelObj.childNodes[model].value;

	return option;
}


function showMeMaker()
{
	var makeObj = document.getElementById("make");
	var make = makeObj.selectedIndex;
	var option = makeObj.childNodes[make+1].value;

	return option;
}

function resetFields()
{
	document.getElementById("make").selectedIndex = 0;
	document.getElementById("models").innerHTML = "";
	document.getElementById("years").innerHTML = "";
}

