//Note: This file contains unmodified, legacy site code.
function populateDrop(drpIn,drpOut){

	with (drpOut) {
		for(i=options.length-1;i>0;i--) {
			options[i] = null; // null out in reverse order (bug fix)
		}
		opt = 1;
		for(i=0;i<model2year.length;i++){
			
			//alert(drpIn[drpIn.selectedIndex].value+" = "+model2year[i][0]+" = "+
			  //(drpIn[drpIn.selectedIndex].value==model2year[i][0]));
			if(drpIn[drpIn.selectedIndex].value==model2year[i][0]) {
				options[0] = new Option("Select Year", "");
				options[opt] = new Option(model2year[i][1], model2year[i][1]);
				opt++;
			} else if (drpIn.selectedIndex==0) {//if no model is selected, no years are displayed
				options[0] = new Option("Select a Model First", "");
				//options[0] = new Option("------", "");
			}
		}
		selectedIndex = 0;
	}
}

function validateForm(){
    var drpM = document.techPubsForm.model;
    var drpY = document.techPubsForm.year;
    var errorStr = "";
    var errorDiv = document.getElementById("errorDiv");

    if (drpM.selectedIndex == 0) {
        errorStr = "Please select a Vehicle<br>Please select a year<br>";
    } else if (drpY.selectedIndex == 0) {
        errorStr = "Please select a year<br>";
    } else {
        document.techPubsForm.submit();
    }
    errorDiv.innerHTML = errorStr;
}

function setOverSrc(elem){
	elem.onmouseover=function(){this.src=this.src.replace(/(_on)*(\.\w+)$/,'_on$2')}
	elem.onmouseout=function(){this.src=this.src.replace(/(_on)+(\.\w+)$/,'$2')}
	elem.onload='';
}
