

function updateShortlist(vehicleId, isChecked) {
//alert(vehicleId);
	var results = "a";
	var queryString = "vehicleId="+vehicleId;
	var url = "/gm/english/trailering-guide/" + division + "/vehicle/";
	//alert(url);
	if(isChecked) {
			
			url = url + "add?" + Math.floor(Math.random()*9999999);
			//var element = document.getElementById("vehSrchResults"+vehicleId);
			//element.style.border = '1px solid #ccc';
			
	}
	else {
		
		url = url + "remove?" + Math.floor(Math.random()*9999999);
		//var element = document.getElementById("vehSrchResults"+vehicleId);
		//element.style.border = 'none';
	}
	// note: errmsg01_loadSomeVehicleData is defined in head JSP
	// alert (url+queryString);
	$.ajax({
		type: "GET",
		url: url,
		data: queryString,
		dataType: "xml",
		async: false,
		success: function(yay){},
		error: function(boo){}
		
	})
	
	//hideStartOverButton();
	refreshShortlist ();
	return results;

}

var currentTime = new Date()
var hours = currentTime.getHours()
var minutes = currentTime.getMinutes()
var seconds = currentTime.getSeconds()
if (minutes < 10) 
minutes = "0" + minutes
if (seconds < 10) 
seconds = "0" + seconds
var timestamp = hours + ":" + minutes +  ":" + seconds
//alert(timestamp);



function refreshShortlist (){$('#sellist').load('/gm/tiles/trailering/include/leftNavResultsRefresh_FR.jsp?' + Math.floor(Math.random()*9999999))
}



function refreshSearchResults (vehicleId){
		//alert("refreshSearchResults" + vehicleId );
		var element = document.getElementById(vehicleId);
		if(element != null) {
			element.checked = false;
		}
		//alert(element);
	}

function removeVehicleResult (vehicleId){
		//alert("removeVehicleResult" + "vehSrchResults"+vehicleId );
	
		var element = document.getElementById("vehSrchResults"+vehicleId);

		//alert(element);
		if(element != null) {
			element.style.display = 'none';
		}
		
		updateShortlist(vehicleId, false);
		
	}

function removeCompareResult (vehicleId){
		//alert("removeCompareResult" + "compareResults"+vehicleId );
	
		var element = document.getElementById("compareResults"+vehicleId);
		//alert(element);
		if(element != null) {
			element.style.display = 'none';
		}
		
		updateShortlist(vehicleId, false);
		
	}




function navigateBackToStep1(){
	document.wizardStep1Form.submit();
}


var sURL = unescape(window.location.pathname);

function refresh()
{
	window.location.href = sURL;
}



function refresh()
{
	window.location.replace( sURL );
}


function refresh()
{
	window.location.reload( false );
}


function showHideTextField(){

 if(document.getElementById("additionalPassengers").selectedIndex == 9) {
		
			document.getElementById("moreThanEight").style.display = 'inline';
		}
		
		else {
		
		document.getElementById("moreThanEight").style.display = 'none';
	}

}

function changeVehicleType() {
	// Reset other form select boxes prior to submitting the form
	$("#vehSubStype").val("");
	$("#ser").val("");
	$("#cabty").val("");
}

function changeVehicleSubType() {
	$("#ser").val("");
	$("#cabty").val("");
}

function changeModelYear() {
	// Reset other form select boxes prior to submitting the form
	$("#vehSubStype").val("");
	$("#ser").val("");
	$("#cabty").val("");
}

function submitform(){
		if(document.getElementById("vehType").selectedIndex != 0 && document.getElementById("modYr").selectedIndex != 0) {
		document.vehSelectors.submit();
		}
}
