function highlightPageImage(image, imageUri){
	if(image != null)
			image.src=imageUri;
}
function goToURL(form){
	if(document.navform.siteselect.options[document.navform.siteselect.selectedIndex].value=="noNewWin"){
		return;
	}
	else{
		window.open(document.navform.siteselect.options[document.navform.siteselect.selectedIndex].value , 'newWin')
	}
}
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; 
  for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) 
  	x.src=x.oSrc;
}
function MM_findObj(n, d) { //v3.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document); return x;
}
function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; 
  document.MM_sr=new Array; 
  for(i=0;i<(a.length-2);i+=3)
  	if ((x=MM_findObj(a[i]))!=null){
   		document.MM_sr[j++]=x; 
		if(!x.oSrc){
			x.oSrc=x.src; 
			x.src=a[i+2];
		}
	}
}
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}
// Error message window
function display(text){
    alert(text);
}
function cleanUp(){
 	var popwindow = this.open("/auto_loans/control/PleaseWait.html","PleaseWait");
    if (popwindow != null) 
		popwindow.close();
 }
function popWindow(url) 
{
	popupWin = window.open(url, 'minreq', "width=423,height=300,scrollbars=no,scrolling=no");
	return true;
}

function new_window(popwin) 
{
	pop_window = window.open(popwin,'pop','toolbar=no,scrollbars=yes,width=500,height=600')
}
function cancel()
{
	var microsite = document.getElementById("siab_microsite");
	var answer=confirm("Are you sure you want to cancel?");
	if(answer){
		if(microsite != null && microsite.value == 'auto_greenpoints'){
			window.location=("/command?action=ev_orig_ShowPage&cmd_ShowPage=AppCancel&siab_command_nav_path=/auto_loans/auto_greenpoints/apply&siab_microsite=auto_greenpoints");
		} else if(microsite != null && microsite.value == 'auto_partners'){
			window.location=("/command?action=ev_orig_ShowPage&cmd_ShowPage=AppCancel&siab_command_nav_path=/auto_loans/auto_partners/apply&siab_microsite=auto_partners");
		} else {
			window.location=("/command?action=ev_orig_ShowPage&cmd_ShowPage=AppCancel");
		}
	}
}
function disableVehSel()
{
	document.profile.vehSelected.checked=false;
}
function switchProtocol()
{
	parent.location.protocol="https";
}
function hide() 
{
	document.getElementById("purchasing").style.display="none";
}
function unhide() 
{
	document.getElementById("purchasing").style.display="block";
}
function display(message)
{
	alert(message);
}

function getCretificate(form){
	form.submit();
}

var WM_acceptsCookies = false;
if(document.cookie == '') {
document.cookie = 'WM_acceptsCookies=yes'; // Try to set a cookie.
if(document.cookie.indexOf('WM_acceptsCookies=yes') != -1) {
WM_acceptsCookies = true; 
}// If it succeeds, set variable
} else { // there was already a cookie
WM_acceptsCookies = true;
}

function WM_setCookie (name, value, hours, path, domain, secure) {
if (WM_acceptsCookies) { // Don't waste your time if the browser doesn't accept cookies.
var not_NN2 = (navigator && navigator.appName 
&& (navigator.appName == 'Netscape') 
&& navigator.appVersion 
&& (parseInt(navigator.appVersion) == 2))?false:true;
if (!hours) 
hours = 2000;
if(hours && not_NN2) { // NN2 cannot handle Dates, so skip this part
if ( (typeof(hours) == 'string') && Date.parse(hours) ) { // already a Date string
var numHours = hours;
} else if (typeof(hours) == 'number') { // calculate Date from number of hours
var numHours = (new Date((new Date()).getTime() + hours*3600000)).toGMTString();
}
}
document.cookie = name + '=' + escape(value) + ((numHours)?(';expires=' + numHours):'') + ((path)?';path=' + path:'') + ((domain)?';domain=' + domain:'') + ((secure && (secure == true))?'; secure':''); // Set the cookie, adding any parameters that were specified.
}
} // WM_setCookie
function WM_readCookie(name) {
if(document.cookie == '') { // there's no cookie, so go no further
return false; 
} else { // there is a cookie
var firstChar, lastChar;
var theBigCookie = document.cookie;
firstChar = theBigCookie.indexOf(name); // find the start of 'name'
var NN2Hack = firstChar + name.length;
if((firstChar != -1) && (theBigCookie.charAt(NN2Hack) == '=')) { // if you found the cookie
firstChar += name.length + 1; // skip 'name' and '='
lastChar = theBigCookie.indexOf(';', firstChar); // Find the end of the value string (i.e. the next ';').
if(lastChar == -1) lastChar = theBigCookie.length;
return unescape(theBigCookie.substring(firstChar, lastChar));
} else { // If there was no cookie of that name, return false.
return false;
}
} 
} // WM_readCookie

function WM_killCookie(name, path, domain) {
var theValue = WM_readCookie(name); // We need the value to kill the cookie
if(theValue) {
document.cookie = name + '=' + theValue + '; expires=Fri, 13-Apr-1970 00:00:00 GMT' + ((path)?';path=' + path:'') + ((domain)?';domain=' + domain:''); // set an already-expired cookie
}
} // WM_killCookie
function new_window(popwin) 
{
	pop_window = window.open(popwin,'pop','toolbar=no,scrollbars=yes,width=500,height=600')
}
function disableVehSel()
{
	document.profile.vehSelected.checked=false;
}
function switchProtocol()
{
	parent.location.protocol="https";
}
var isNN = (navigator.appName.indexOf("Netscape")!=-1);
function autoTab(input,len, e) {
var keyCode = (isNN) ? e.which : e.keyCode; 
var filter = (isNN) ? [0,8,9] : [0,8,9,16,17,18,37,38,39,40,46];
if(input.value.length >= len && !containsElement(filter,keyCode)) {
input.value = input.value.slice(0, len);
input.form[(getIndex(input)+1) % input.form.length].focus();
}
function containsElement(arr, ele) {
var found = false, index = 0;
while(!found && index < arr.length)
if(arr[index] == ele)
found = true;
else
index++;
return found;
}
function getIndex(input) {
var index = -1, i = 0, found = false;
while (i < input.form.length && index == -1)
if (input.form[i] == input)index = i;
else i++;
return index;
}
return true;
}

var focusFlag = false;
var DB = 0;
function confirmPayment(field)
{
	if(field.value > 3500){
		if(!confirm("Is your Payment Monthly ?")){
			field.focus();
			field.select();
		}
	}
}
function DispSuggestedAmount(form)
{
    if(focusFlag == true){
       return;
    }	 
	var Mileage = 0;
	var MonthlyIncome = 0;
	var OtherIncome = 0;
	var TotalIncome = 0;
	var jaOtherIncome = 0;
	var jaMonthlyIncome = 0;
	var jaTotalIncome = 0;
	

	var AppType = document.appInfo.appType.value;
	var VehSel =  document.appInfo.vehSelected.value;

	if( VehSel == "VS"){
		if((document.appInfo.mileage.value).length != 0)
			Mileage = parseInt(document.appInfo.mileage.value, 10);
	}
	if((document.appInfo.grossIncome.value).length == 0)
		MonthlyIncome = 0;
	else
	MonthlyIncome = document.appInfo.grossIncome.value - 0;
	if((document.appInfo.otherIncome.value).length == 0)
		OtherIncome = 0;
	else
		OtherIncome = document.appInfo.otherIncome.value - 0;

	TotalIncome = MonthlyIncome + OtherIncome;
	if(AppType == "J"){
		if((document.appInfo.JASGrossIncome.value).length == 0)
			jaMonthlyIncome = 0;
		else
			jaMonthlyIncome = document.appInfo.JASGrossIncome.value - 0;
		if((document.appInfo.JAOtherIncome.value).length == 0)
			jaOtherIncome = 0;
		else
			jaOtherIncome = document.appInfo.JAOtherIncome.value - 0;
		jaTotalIncome = jaMonthlyIncome + jaOtherIncome;
	}
	SuggestedAmount = 0;
	if(AppType == "I"){
	   if(Mileage <= 25000){
			SuggestedAmount = (0.2 * TotalIncome * 72) / (Math.pow(1.165,6));
	   }
	   if(Mileage >= 25001 && Mileage <= 50000){
			SuggestedAmount = (0.2 * TotalIncome * 60) / (Math.pow(1.165,5));
	   }
	   if(Mileage >= 50001 && Mileage <= 60000){
			SuggestedAmount = (0.2 * TotalIncome * 48) / (Math.pow(1.165,4));
	   }
	   if(Mileage >= 60001 && Mileage <= 70000){
			SuggestedAmount = (0.2 * TotalIncome * 36) / (Math.pow(1.165,3));
	   }
       if(Mileage >= 70001 && Mileage <= 100000){
			SuggestedAmount = (0.2 * TotalIncome * 24) / (Math.pow(1.165,2));
	   }
    }
	if(document.appInfo.appType.value == "J"){
	   if(Mileage <= 25000){
			SuggestedAmount = (0.2 * (TotalIncome + jaTotalIncome) * 72) / (Math.pow(1.165,6));
	   }
	   if( Mileage >= 25001  && Mileage <= 50000){
			SuggestedAmount = (0.2 * (TotalIncome + jaTotalIncome) * 60) / (Math.pow(1.165,5));
	   }
	   if( Mileage >= 50001  && Mileage <= 60000){
			SuggestedAmount = (0.2 * (TotalIncome + jaTotalIncome) * 48) / (Math.pow(1.165,4));
	   }
	   if(Mileage >= 60001	&& Mileage <= 70000){
			SuggestedAmount = (0.2 * (TotalIncome + jaTotalIncome) * 36) / (Math.pow(1.165,3));
	   }
	   if(Mileage >= 70001 && Mileage <= 100000){
			SuggestedAmount = (0.2 * (TotalIncome + jaTotalIncome) * 24) / (Math.pow(1.165,2));
	   }
	}
	SuggestedAmount = Math.round(SuggestedAmount);
	if(SuggestedAmount > 50000)
		SuggestedAmount = 50000;
	Amtlen = SuggestedAmount.toString().length;
	if(Amtlen == 4 ){
		SuggestedAmount = SuggestedAmount.toString().substr(0,1) + "," + SuggestedAmount.toString().substr(1,(Amtlen- 1));
	}
	if(Amtlen == 5 ){
		SuggestedAmount = SuggestedAmount.toString().substr(0,2) + "," + SuggestedAmount.toString().substr(2,(Amtlen- 1));
	}
	if(Amtlen >= 6 ){	
		SuggestedAmount = SuggestedAmount.toString().substr(0,1) + "," + SuggestedAmount.toString().substr(1,3) + "," + SuggestedAmount.toString().substr(4,(Amtlen- 1));	
	}
	var msg = new String("Based on the information provided on this application up to this point, it appears that you may qualify for a credit extension up to $");
    msg = msg + SuggestedAmount + ". Although you may enter any desired credit amount, an amount equal to or less than $";
	msg = msg + SuggestedAmount + " may increase the likelihood of credit approval.";
	if(DB == 1){
	var dbmsg = "Mileage = " + Mileage;
		alert(dbmsg);
	}
	if(Mileage >= 0 && Mileage <=100000){
	   alert(msg);
	}
    focusFlag = true;
}
// This next little bit of code tests whether the user accepts cookies. For NetRaker Survey 11/03
var WM_acceptsCookies = false;
if(document.cookie == '') {
document.cookie = 'WM_acceptsCookies=yes'; // Try to set a cookie.
if(document.cookie.indexOf('WM_acceptsCookies=yes') != -1) {
WM_acceptsCookies = true; 
}// If it succeeds, set variable
} else { // there was already a cookie
WM_acceptsCookies = true;
}

function WM_setCookie (name, value, hours, path, domain, secure) {
if (WM_acceptsCookies) { // Don't waste your time if the browser doesn't accept cookies.
var not_NN2 = (navigator && navigator.appName 
&& (navigator.appName == 'Netscape') 
&& navigator.appVersion 
&& (parseInt(navigator.appVersion) == 2))?false:true;
if (!hours) 
hours = 2000;
if(hours && not_NN2) { // NN2 cannot handle Dates, so skip this part
if ( (typeof(hours) == 'string') && Date.parse(hours) ) { // already a Date string
var numHours = hours;
} else if (typeof(hours) == 'number') { // calculate Date from number of hours
var numHours = (new Date((new Date()).getTime() + hours*3600000)).toGMTString();
}
}
document.cookie = name + '=' + escape(value) + ((numHours)?(';expires=' + numHours):'') + ((path)?';path=' + path:'') + ((domain)?';domain=' + domain:'') + ((secure && (secure == true))?'; secure':''); // Set the cookie, adding any parameters that were specified.
}
} // WM_setCookie


function WM_readCookie(name) {
if(document.cookie == '') { // there's no cookie, so go no further
return false; 
} else { // there is a cookie
var firstChar, lastChar;
var theBigCookie = document.cookie;
firstChar = theBigCookie.indexOf(name); // find the start of 'name'
var NN2Hack = firstChar + name.length;
if((firstChar != -1) && (theBigCookie.charAt(NN2Hack) == '=')) { // if you found the cookie
firstChar += name.length + 1; // skip 'name' and '='
lastChar = theBigCookie.indexOf(';', firstChar); // Find the end of the value string (i.e. the next ';').
if(lastChar == -1) lastChar = theBigCookie.length;
return unescape(theBigCookie.substring(firstChar, lastChar));
} else { // If there was no cookie of that name, return false.
return false;
}
} 
} // WM_readCookie

function WM_killCookie(name, path, domain) {
var theValue = WM_readCookie(name); // We need the value to kill the cookie
if(theValue) {
document.cookie = name + '=' + theValue + '; expires=Fri, 13-Apr-1970 00:00:00 GMT' + ((path)?';path=' + path:'') + ((domain)?';domain=' + domain:''); // set an already-expired cookie
}
} // WM_killCookie
var startdate;
var starttimer;
var enddate;
var endtimer;

function customResearch1894291_load() {
//Store the current date and the time in milliseconds 
//This code is needed to compute the time spent 
//by a customer on a given site.
startdate = new Date();
starttimer = startdate.getTime();
}
function customResearch1894291_unload(){
	var agt=navigator.userAgent.toLowerCase();
	var is_aol   = (agt.indexOf("aol") != -1);
	if(!is_aol)
	{
		var n = 1; /* One out of n visitors will be given survey */
		var random_num;
		var offset = -1;
		var timespent;
		var cookiename = "NetRakerRID1894291";

		// Compute the current time.
		// The difference between endtimer and the starttimer 
		// is the time spent on this site.
		enddate = new Date()
		endtimer = enddate.getTime();
		timespent = endtimer - starttimer;
		timespent = timespent / (1000)
		
		// Process the request
		random_num = Math.round(n * Math.random());
		/*random_num = 1;*/ // uncomment this line to debug, this will trigger the research everytime 
		if ((random_num == 1) && (navigator.appName.indexOf('WebTV') == -1)) 
			if (!WM_readCookie(cookiename)) { 
		   /* comment this to prompt until they complete the survey */ 
		   WM_setCookie(cookiename,'1894291') 
		  win2 = window.open( 
		    "http://www.netraker.com/code/delivery.asp?action=IE&SID=498437&FID=1948885&ST=" + timespent, 
		    "Custom_Research", 
		    "WIDTH=518,HEIGHT=413,scrollbars,resizable,status");
			win2.blur();
			window.focus();
		}
	} 
}
function popWindow(url)
{
    // If the HowFindDrop dropdown has not been selected, do not display the disclosure/please wait popup window
    popupWin = window.open(url, 'disclosure', "width=490,height=400,scrollbars=yes,scrolling=yes");

}
function popConfirmInfo() {

   DispWin = window.open('','NewWin', 'toolbar=no,status=no,width=300,height=300')
   DispWin.document.write("<UL><LI><B>FIRST NAME: </B>" + document.form1.firstname.value);
   DispWin.document.write("<LI><B>LAST NAME: </B>" + document.form1.lastname.value);
   DispWin.document.write("<LI><B>STREET ADDRESS: </B>" + document.form1.stnumber.value);
   
   DispWin.document.write("<LI><B>STREET NAME: </B>" + document.form1.stname.value);
   DispWin.document.write("<LI><B>CITY: </B>" + document.form1.city.value);
   DispWin.document.write("<LI><B>STATE: </B>" + document.form1.state.value);
   
   DispWin.document.write("<LI><B>ZIP CODE: </B>" + document.form1.zip.value);
   DispWin.document.write("<LI><B>SSN#: </B>" + document.form1.ssn.value);
   DispWin.document.write("<LI><B>PHONE#: </B>" + document.form1.phN.value);
   
   DispWin.document.write("<LI><B>INCOME: </B>" + document.form1.grossMonthlySalary.value);
   DispWin.document.write("<LI><B>Desire Amount: </B>" + document.form1.desiredAmount.value);
   DispWin.document.write("<LI><B>Cash Down: </B>" + document.form1.cashDown.value);

   DispWin.document.write("</UL>");

}

function disableButtons(frm) 
{
	frm.submitButton.disabled=true;
	frm.modifyButton.disabled=true;
	frm.cancelButton.disabled=true;
}

var popwin;
function openWinProcess() 
{       
   if (!popwin  || popwin.closed) 
   {
      popwin = this.open("/auto_loans/control/PleaseWait.html","PleaseWait","toolbar=0,menubar=0,resizable=0,scrollbars=0,height=325,width=500,left=200,top=125");
   }  
}

// NOTE: showHelpNote is for the tool-tip explanations in the form.
function showHelpNote(tip, hght){

	if(popwin != null)
		popwin.close();
	var microsite = document.getElementById("siab_microsite");
	if(microsite != null && microsite.value == 'auto_greenpoints'){
		popwin = window.open("/originations/Help.jsp?microsite="+microsite.value+"&t="+tip, "Help", "width=451,height=300,left=450,top=200,scrollbars=no,scrolling=no");
	} else if(microsite != null && microsite.value == 'auto_partners') {
		popwin = window.open("/originations/ebay/Help.jsp?t="+tip, "Help", "width=451,height="+hght+",left=450,top=200,scrollbars=no,scrolling=no");
	} else {
		popwin = window.open("/originations/Help.jsp?t="+tip, "Help", "width=451,height="+hght+",left=450,top=200,scrollbars=no,scrolling=no");
	}
}

// close pop-up window 
 function clean() 
 {
     if (popwin != null)
        popwin.close();
 }
function buttonOn(){
	if(document.all){
		document.all(1).style.cursor = 'hand';
			}
	}
function buttonOff(){
    document.all(1).style.cursor = 'default';
	}
// Error message window

var lastMenu;
		function toggleClamShellMenu(objectID){
			if(lastMenu && (lastMenu != objectID)){document.getElementById(lastMenu).style.display = 'none';}
			var object = document.getElementById(objectID);
			if (object.style.display =='block') {object.style.display='none';} else {object.style.display='block';}
			lastMenu = objectID;
	}
// Help pop-up window (HSBC)
	
function expand() {
		var object = document.getElementById("nav_sub_gen");
		if (object.style.display =='block')  object.style.display='none';
		else object.style.display='block';
		return;
	}
	
var ctr = 0;
//Assume that there will not be more than 10 buttons
var clickedButList = new Array(10);

function submitMe(form, but, butName){
	if(ctr==0 || !alreadyClicked(butName))
	{
		//if not already clicked
		//Put the button name in to the array and submit.
		clickedButList[ctr] = butName;
		ctr = ctr+1;
		but.name = butName;
		form.action= form.action+'?action='+butName+'&siab_microsite=auto_ecare';
		form.submit();
		return true;
	}else{
		return false;
	}
  }
  
  //To prevent double submit
  function setName(but, butName){
    but.name = butName;        
  }
 
  function submitInfo(form, eventName){
		form.action= form.action+'?action='+eventName+'&siab_microsite=auto_ecare';
		form.submit();	
}

/*
 * function to check if the button has already been clicked or not
 * This verifies the clicked button list array to see
 * if there is an entry for this button name or not.
 * if present, returns true otherwise false.
 */
function alreadyClicked(lbutName)
{

	var i=0;
	var clicked = false;
	for(i=0; i < ctr; i++)
	{
		if(clickedButList[i] == lbutName)
		{
			clicked = true;
			break;
		}
	}
	return clicked;
}  

function autoTab(input,len, e) {

var isNN = (navigator.appName.indexOf("Netscape")!=-1);
var keyCode = (isNN) ? e.which : e.keyCode; 
var filter = (isNN) ? [0,8,9] : [0,8,9,16,17,18,37,38,39,40,46];
if(input.value.length >= len && !containsElement(filter,keyCode)) {
input.value = input.value.slice(0, len);
input.form[(getIndex(input)+1) % input.form.length].focus();
}
function containsElement(arr, ele) {
var found = false, index = 0;
while(!found && index < arr.length)
if(arr[index] == ele)
found = true;
else
index++;
return found;
}
function getIndex(input) {
var index = -1, i = 0, found = false;
while (i < input.form.length && index == -1)
if (input.form[i] == input)index = i;
else i++;
return index;
}
return true;
}



function validatePriorityCode(CODE) {
	var tdElement	= document.getElementById("PriorityNumberPrompt");
/*
	if ( CODE == "" ) {
		tdElement.innerHTML="<INPUT maxLength=10 name=InvitationNumber><br /><strong>Please provide Priority Number.</strong><BR /><SMALL>Example: AB343232</SMALL>";
		return false;
	} else {
		document.Invitation.submit();
	}
*/

	document.Invitation.submit();
}

function isException(urlStr) {
	
	var isExc = false;
	var excArray = new Array;
	excArray[0] = "http://pages.motors.ebay.com/services/purchase-protection.html";
	excArray[1] = "http://www.kbb.com/";
	excArray[2] = "https://signup.cj.com/member/brandedPublisherSignUp.do?air_refmerchantid=1176688";
	
	for(i=0; i<excArray.length; i++) {
		if(excArray[i]==urlStr) {
			isExc = true;
		}
	}
		
	return isExc;
}
function captureAdCode() {
	var url = window.location.href;
	var adcode = "";
	
	if(url != null) {
		adcode = url.substring( url.lastIndexOf("/")+1, url.length);
	}

	return adcode;
}

function createPrioritySubmit() {

	document.Invitation.action = document.Invitation.action + "/" + captureAdCode();
	document.Invitation.submit()
}


// NOTE: showHelpNote is for the tool-tip explanations in the form.
function showHelpNote(tip, hght,site){

	if (site == 'auto_greenpoints')
	{
		if (hght < 275)
		{
			hght = hght + 25;
		}
		else
		{
			hght = hght + 10;
		}
	
	}
	
	if (site == 'auto_partners')
	{
		hght = hght + 55;
	}	

	if(popwin != null)
		popwin.close();
	
	if(site != null && site == 'auto_partners') {
		popwin = window.open("/originations/ebay/Help.jsp?t="+tip, "Help", "width=451,height="+hght+",left=450,top=200,scrollbars=no,scrolling=no");
	} else {
		popwin = window.open("/originations/Help.jsp?t="+tip+"&site="+site, "Help", "width=451,height="+hght+",left=450,top=200,scrollbars=no,scrolling=no");
	}
}

function submitForm(form,event) {

	form.action = form.action + "?action=" + event;

}
function disableDropDownList() {

	var loanType = document.getElementById("loanType").value;
	var vehicleSel = document.getElementById("vehSelected").value;

	if (loanType == 'R' || loanType == 'r' || vehicleSel == 'VS')
	{
		disableSourceList("form071","modelHiddenTag","Unknown Model");
		disableSourceList("form094","trimHiddenTag","Unknown Trim");
		disableEmptyDropDownList();
	}
}

function disableSourceList(sourceDropDownElementName,hiddenTag,sourceUnknownVal) {

	var sourceDropDownElement = document.getElementById(sourceDropDownElementName);
	var hiddenTagVal = document.getElementById(hiddenTag).value;
	

	if (hiddenTagVal != "")
	{
		sourceDropDownElement.focus();
		for (j=0;j<sourceDropDownElement.length;j++)
		{
			if (sourceDropDownElement.options[j].text == sourceUnknownVal)
			{
				sourceDropDownElement.selectedIndex = j;
				break;
			}

		}
		sourceDropDownElement.disabled = true;
		var hiddenVal = sourceDropDownElement.options[sourceDropDownElement.selectedIndex].value;
		document.getElementById(hiddenTag).value = hiddenVal;
	}
}

function disableEmptyDropDownList() {
	var state = document.getElementById("form023");
	var years = document.getElementById("form074");
	var makes = document.getElementById("form066");
	var models = document.getElementById("form071");
	var trims = document.getElementById("form094");

	if (state.options[state.selectedIndex].value == "")	{
		emptyListDisabling(true,true,true,true);
	} else if (years.options[years.selectedIndex].value == "")	{
		emptyListDisabling(false,true,true,true);
	} else if (makes.options[makes.selectedIndex].value == "")	{
		emptyListDisabling(false,false,true,true);
	}else if (models.options[models.selectedIndex].value == "")	{
		emptyListDisabling(false,false,false,true);
	}
}

function emptyListDisabling(isYearDisabled, isMakeDisabled, isModelDisabled, isTrimDisabled) {
	var years = document.getElementById("form074");
	var makes = document.getElementById("form066");
	var models = document.getElementById("form071");
	var trims = document.getElementById("form094");
	
	years.disabled = isYearDisabled;
	makes.disabled = isMakeDisabled;
	models.disabled = isModelDisabled;
	trims.disabled = isTrimDisabled;
}
