browserVer = parseInt(navigator.appVersion);

function checkVersion ()
{
     if (browserVer>=3) return true;
     else return false;
}

function displayRows(rows)
{
	if (document.all) {
		document.all['t1'].style.display = 'none';
		document.all['t2'].style.display = 'none';
		document.all['t3'].style.display = 'none';
		document.all['t4'].style.display = 'none';
		document.all['t5'].style.display = 'none';
		for (i=1; i<=rows; i++) {
			tog = "t" + i;
			document.all[tog].style.display = 'block';
		}
  	} 
	else if (document.getElementById) {
		document.getElementById('t1').style.display = 'none';
		document.getElementById('t2').style.display = 'none';
		document.getElementById('t3').style.display = 'none';
		document.getElementById('t4').style.display = 'none';
		document.getElementById('t5').style.display = 'none';
		for (i=1; i<=rows; i++) {
			tog = "t" + i;
			document.getElementById(tog).style.display = 'block';
		}
  	} 
}

function initRows() {
	//if (document.layers) {
	  	//document.layers['t1'].style.visibility = 'hide'ow';
	  	//document.layers['t2'].style.visibility = 'hide';
	  	//document.layers['t3'].style.visibility = 'hide';
	  	//document.layers['t4'].style.visibility = 'hide';
	  	//document.layers['t5'].style.visibility = 'hide';
	//}
	//else 
	if (document.all) {
	  	document.all['t1'].style.display = 'block';
	  	document.all['t2'].style.display = 'none';
	  	document.all['t3'].style.display = 'none';
	  	document.all['t4'].style.display = 'none';
	  	document.all['t5'].style.display = 'none';
	} 
	else if (document.getElementById) {
		document.getElementById('t1').style.display = 'block';
	  	document.getElementById('t2').style.display = 'none';
	  	document.getElementById('t3').style.display = 'none';
	  	document.getElementById('t4').style.display = 'none';
	  	document.getElementById('t5').style.display = 'none';
	} 
	parent.top.initSelect("vehiclemake1","Choose a Year");
	parent.top.initSelect("vehiclemodel1","Choose a Year");
	parent.top.initSelect("vehiclemake2","Choose a Year");
	parent.top.initSelect("vehiclemodel2","Choose a Year");
	parent.top.initSelect("vehiclemake3","Choose a Year");
	parent.top.initSelect("vehiclemodel3","Choose a Year");
	parent.top.initSelect("vehiclemake4","Choose a Year");
	parent.top.initSelect("vehiclemodel4","Choose a Year");
	parent.top.initSelect("vehiclemake5","Choose a Year");
	parent.top.initSelect("vehiclemodel5","Choose a Year");
}

function initSelect(name,str)
{
	var sel = eval("document.calc."+name);
	sel.length = 4;
	sel.options[0].value = "";
	sel.options[0].text = "<-- " + str;
	sel.selectedIndex = 0;
}
	
function getMakes(row,year,dmake)
{
	parent.queryframe.location.href = "getmake.php?row=" + row + "&year=" + year + "&dmake=" + dmake;
}
	
function getModels(row,make) 
{
	year = eval("document.calc.vehicleyear" + row +  ".options[document.calc.vehicleyear" + row + ".selectedIndex].value");
	parent.queryframe.location.href = "getmodel.php?row=" + row +  "&year=" + year + "&make=" + make;
}
