function addvalue(thisform) {
with (thisform)
{
//alert ("I like to add value");
var yearval = year.value;
var yearval1 = year1.value.length;
var yearval2 = year2.value.length;
var yearval3 = year3.value.length;
var makerval = maker.value;
var modelval = model.value;
var makerindex = maker.selectedIndex;
var modelindex = model.selectedIndex;
//alert ("Maker index is " + makerindex);
//alert ("year1 is " + yearval1);
//alert ("year2 is " + yearval2);
//alert ("year3 is " + yearval3);
//alert ("Model index is " + modelindex);
if (makerindex == 0 || modelindex == 0)
{alert ("You must select both a make and model");
maker.focus();
return false;
}
if (yearval1 == 0)
{//alert ("Populating first column");
maker1.value=makerval;
model1.value=modelval;
year1.value=yearval;
return true;
}
if (yearval2 == 0)
{//alert ("Populating second column");
maker2.value=makerval;
model2.value=modelval;
year2.value=yearval;
return true;
}
if (yearval3 == 0)
{//alert ("Populating third column");
maker3.value=makerval;
model3.value=modelval;
year3.value=yearval;
return true;
}
maker1.value=makerval;
model1.value=modelval;
year1.value=yearval;
return false;
}
}
////////////////////////////////////////////////////////////////
function clearvalue(thisform) {
with (thisform)
{
maker1.value='';
model1.value='';
year1.value='';
maker2.value='';
model2.value='';
year2.value='';
maker3.value='';
model3.value='';
year3.value='';
}
}
function resetForm(){
//alert ("Reset Form called");
for(var k=0;k
=0) {
alert(alerttxt);
return false
} else {
return true
}
}
}
function validate_form(thisform,code) { //1
with (thisform) {
var fcode = code;
if (fcode == 1 || fcode ==3) // add or 3 tomorrow
{
if (validate_required(state,"You must select a State")==false) { //3
state.focus();
return false;
}
} //3
if (fcode == 1)
{
if (validate_required(maker,"You must select a Make")==false) { //5
maker.focus();
return false;
} //5
}
if (fcode == 2)
{
//alert("Youve gotten to code two blue");
if (validate_required(stateType,"You must select a State")==false) { //3
stateType.focus();
return false;
} //
}
if (fcode == 2)
{
//alert("Youve gotten to code two blue");
if (validate_required(typeType,"You must select a Vehicle Type")==false) { //3
typeType.focus();
return false;
} //
}
if (fcode == 3)
{
if (!smartbasic.checked && !smartelite.checked)
{
alert("You must check a smartway type");
smartbasic.focus();
return false;
}
}
if (fcode == 4)
{
if (state.selectedIndex == -1)
{
alert("You must select a State or ALL STATES");
state.focus();
return false;
}
if (year.selectedIndex == -1)
{
alert("You must select a Model Year or ALL YEARS");
year.focus();
return false;
}
if (maker.selectedIndex == -1)
{
alert("You must select a Vehicle Make or ALL MAKES");
maker.focus();
return false;
}
}
return true;
} //2
} //1
function MM_findObj(n, d) { //v4.01
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< document.CompareCheckForm.selectedVehicle.length; counter++) {
// If a checkbox has been selected it will return true
// (If not it will return false)
if (document.CompareCheckForm.selectedVehicle[counter].checked) {
checkbox_choices = checkbox_choices + 1;
if (checkbox_choices == 1) {
querystring = querystring + "?vehicle_ID=" + document.CompareCheckForm.selectedVehicle[counter].value;
} else {
querystring = querystring + "&vehicle_ID" + checkbox_choices + "=" + document.CompareCheckForm.selectedVehicle[counter].value;
}
}
}
if (checkbox_choices > 3 ) {
// If there were more than three selections made display an alert box
msg="You're limited to only three selections.\n"
msg=msg + "You have made " + checkbox_choices + " selections.\n"
msg=msg + "Please remove " + (checkbox_choices-3) + " selection(s)."
alert(msg)
return (false);
}
if (checkbox_choices == 0 ) {
// If there were less then selections made display an alert box
alert("Please make selections. \n")
return (false);
}
URL = URL + querystring;
day = new Date();
id = day.getTime();
//alert(URL);
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=720,height=500');");
}
function popUp5(URL) {
var popUpFlag = 1; // turns Pop-up feature on (1) and off (0) cw 01/11/07
//var checkbox_choices = 0;
//var querystring = "?vehicle_ID=1";
var querystring = "";
//querystring = querystring + "?vehicle_ID=1000";
URL = URL + querystring;
day = new Date();
//alert(URL);
id = day.getTime();
if (popUpFlag) {
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=565,height=500');");
} else {
//alert(URL.replace(".do","_Full.do"));
location.href = URL.replace(".do","_Full.do"); // with Pop-ups off go to "Full" screen view action cw 01/11/07
}
}
function popUp6(url,frname,width,height) {
window.open(url,frname,
"resizable=1,menubar=no,toolbar=no,location=no,directories=no,width="
+width+",height="+height+",scrollbars=yes");
}
// added for Dynmic Menus Browser detection
var BrowserDetect = {
init: function () {
this.browser = this.searchString(this.dataBrowser) || "An unknown browser";
this.version = this.searchVersion(navigator.userAgent)
|| this.searchVersion(navigator.appVersion)
|| "an unknown version";
this.OS = this.searchString(this.dataOS) || "an unknown OS";
},
searchString: function (data) {
for (var i=0;i