if (document.images) {
      getaquote = new Image();
      getaquote.src = "/images/getaquote_off.gif";
      getaquoteover = new Image();
      getaquoteover.src = "/images/getaquote_on.gif";
	  
	  brochurerequest = new Image();
      brochurerequest.src = "/images/brochurerequest_off.gif";
      brochurerequestover = new Image();
      brochurerequestover.src = "/images/brochurerequest_on.gif";
	  
	  contactus = new Image();
      contactus.src = "/images/contactus_off.gif";
      contactusover = new Image();
      contactusover.src = "/images/contactus_on.gif";
	  
	  search = new Image();
      search.src = "/images/search_off.gif";
      searchover = new Image();
      searchover.src = "/images/search_on.gif";
	  
	  dealerlocator = new Image();
      dealerlocator.src = "/images/dealerlocator_off.gif";
      dealerlocatorover = new Image();
      dealerlocatorover.src = "/images/dealerlocator_on.gif";
	  
	  nprgas = new Image();
      nprgas.src = "/images/nprgas_off.gif";
      nprgasover = new Image();
      nprgasover.src = "/images/nprgas_over.gif";
	  
	  nprdiesel = new Image();
      nprdiesel.src = "/images/nprdiesel_off.gif";
      nprdieselover = new Image();
      nprdieselover.src = "/images/nprdiesel_over.gif";

	  nqrdiesel = new Image();
      nqrdiesel.src = "/images/nqrdiesel_off.gif";
      nqrdieselover = new Image();
      nqrdieselover.src = "/images/nqrdiesel_over.gif";

	  nrrdiesel = new Image();
      nrrdiesel.src = "/images/nrrdiesel_off.gif";
      nrrdieselover = new Image();
      nrrdieselover.src = "/images/nrrdiesel_over.gif";

	  crewcab = new Image();
      crewcab.src = "/images/crewcab_off.gif";
      crewcabover = new Image();
      crewcabover.src = "/images/crewcab_over.gif";
	  
	  frr = new Image();
      frr.src = "/images/frr_off.gif";
      frrover = new Image();
      frrover.src = "/images/frr_over.gif";
	  
	  fsr = new Image();
      fsr.src = "/images/fsr_off.gif";
      fsrover = new Image();
      fsrover.src = "/images/fsr_over.gif";
	  
	  ftr = new Image();
      ftr.src = "/images/ftr_off.gif";
      ftrover = new Image();
      ftrover.src = "/images/ftr_over.gif";
	  
	  fvr = new Image();
      fvr.src = "/images/fvr_off.gif";
      fvrover = new Image();
      fvrover.src = "/images/fvr_over.gif";

	  fxr = new Image();
      fxr.src = "/images/fxr_off.gif";
      fxrover = new Image();
      fxrover.src = "/images/fxr_over.gif";

	  advantages1 = new Image();
      advantages1.src = "/images/advantages_tab_off.gif";
      advantages1over = new Image();
      advantages1over.src = "/images/advantages_tab_over.gif";
	  
	  advantages2 = new Image();
      advantages2.src = "/images/advantages_tab_off.gif";
      advantages2over = new Image();
      advantages2over.src = "/images/advantages_tab_over.gif";
	  
	  advantages3 = new Image();
      advantages3.src = "/images/advantages_tab_off.gif";
      advantages3over = new Image();
      advantages3over.src = "/images/advantages_tab_over.gif";
	  
	  advantages4 = new Image();
      advantages4.src = "/images/advantages_tab_off.gif";
      advantages4over = new Image();
      advantages4over.src = "/images/advantages_tab_over.gif";
	  
	  advantages5 = new Image();
      advantages5.src = "/images/advantages_tab_off.gif";
      advantages5over = new Image();
      advantages5over.src = "/images/advantages_tab_over.gif";
	  
	  specs1 = new Image();
      specs1.src = "/images/specs_tab_off.gif";
      specs1over = new Image();
      specs1over.src = "/images/specs_tab_over.gif";

	  specs2 = new Image();
      specs2.src = "/images/specs_tab_off.gif";
      specs2over = new Image();
      specs2over.src = "/images/specs_tab_over.gif";
	  
	  specs3 = new Image();
      specs3.src = "/images/specs_tab_off.gif";
      specs3over = new Image();
      specs3over.src = "/images/specs_tab_over.gif";

	  specs4 = new Image();
      specs4.src = "/images/specs_tab_off.gif";
      specs4over = new Image();
      specs4over.src = "/images/specs_tab_over.gif";
	  
	  specs5 = new Image();
      specs5.src = "/images/specs_tab_off.gif";
      specs5over = new Image();
      specs5over.src = "/images/specs_tab_over.gif";
	  
	  equipment1 = new Image();
      equipment1.src = "/images/equipment_tab_off.gif";
      equipment1over = new Image();
      equipment1over.src = "/images/equipment_tab_over.gif";
	  
	  equipment2 = new Image();
      equipment2.src = "/images/equipment_tab_off.gif";
      equipment2over = new Image();
      equipment2over.src = "/images/equipment_tab_over.gif";
	  
	  equipment3 = new Image();
      equipment3.src = "/images/equipment_tab_off.gif";
      equipment3over = new Image();
      equipment3over.src = "/images/equipment_tab_over.gif";

	  equipment4 = new Image();
      equipment4.src = "/images/equipment_tab_off.gif";
      equipment4over = new Image();
      equipment4over.src = "/images/equipment_tab_over.gif";
	  
	  equipment5 = new Image();
      equipment5.src = "/images/equipment_tab_off.gif";
      equipment5over = new Image();
      equipment5over.src = "/images/equipment_tab_over.gif";
	  
	  options1 = new Image();
      options1.src = "/images/options_tab_off.gif";
      options1over = new Image();
      options1over.src = "/images/options_tab_over.gif";
	  
	  options2 = new Image();
      options2.src = "/images/options_tab_off.gif";
      options2over = new Image();
      options2over.src = "/images/options_tab_over.gif";
	  
	  options3 = new Image();
      options3.src = "/images/options_tab_off.gif";
      options3over = new Image();
      options3over.src = "/images/options_tab_over.gif";
	  
	  options4 = new Image();
      options4.src = "/images/options_tab_off.gif";
      options4over = new Image();
      options4over.src = "/images/options_tab_over.gif";
	  
	  options5 = new Image();
      options5.src = "/images/options_tab_off.gif";
      options5over = new Image();
      options5over.src = "/images/options_tab_over.gif";

	  warranty1 = new Image();
      warranty1.src = "/images/warranty_tab_off.gif";
      warranty1over = new Image();
      warranty1over.src = "/images/warranty_tab_over.gif";
	  
	  warranty2 = new Image();
      warranty2.src = "/images/warranty_tab_off.gif";
      warranty2over = new Image();
      warranty2over.src = "/images/warranty_tab_over.gif";
	  
	  warranty3 = new Image();
      warranty3.src = "/images/warranty_tab_off.gif";
      warranty3over = new Image();
      warranty3over.src = "/images/warranty_tab_over.gif";
	  
	  warranty4 = new Image();
      warranty4.src = "/images/warranty_tab_off.gif";
      warranty4over = new Image();
      warranty4over.src = "/images/warranty_tab_over.gif";
	  
	  warranty5 = new Image();
      warranty5.src = "/images/warranty_tab_off.gif";
      warranty5over = new Image();
      warranty5over.src = "/images/warranty_tab_over.gif";
}

function over(name){
	if (document.images) {
		document[name].src = eval(name + "over.src");
	}
}

function off(name){
	if (document.images) {
		document[name].src = eval(name + ".src");
	}
}



































//---------------------------------------------------------------------------------
//
// Function: 	popup
//
// Description: This function popups a new window with a specified width
//              and height and brings the focus to the popup window
//
// Parameters:  pagename -  the name of the page to be opened in the popup
//							window
//
//				width - the width of the window to be opened
//
//				height - the height of the window to be opened
//
//				scroll - 'yes' if the window should have scrollbars, 'no' if not
//
//				resizeable - 'yes' if the window should be resizeable, 'no' if not
//
// Programmer:  Happy Tsugawa-Banta
//
// Date: 		2/7/01
//
// Updates:     2/7/01 - added these comments (HT)
//
//--------------------------------------------------------------------------------


function popup(pagename,width,height,scroll,resizable) {
	var popup = window.open(pagename,"popup_window","toolbar=no,directories=no,location=no,status=no,menubar=no,scrollbars=" + scroll + ",resizable=" + resizable + ",width=" + width + ",height=" + height + ",left=0,top=0");

    popup.focus();

}

//---------------------------------------------------------------------------------
//
// Function: 	popupFeature
//
// Description: This function popups a new window with a specified width
//              and height and brings the focus to the popup window
//
// Parameters:  pagename -  the name of the page to be opened in the popup
//							window
//
//				width - the width of the window to be opened
//
//				height - the height of the window to be opened
//
//				scroll - 'yes' if the window should have scrollbars, 'no' if not
//
//				resizeable - 'yes' if the window should be resizeable, 'no' if not
//
// Programmer:  Happy Tsugawa-Banta
//
// Date: 		2/7/01
//
// Updates:     2/7/01 - added these comments (HT)
//
//--------------------------------------------------------------------------------


function popup(pagename) {
	var popup = window.open(pagename,"popup_features","toolbar=no,directories=no,location=no,status=no,menubar=no,scrollbars=no,resizable=no,width=371,height=507,left=0,top=0");

    popup.focus();

}


//---------------------------------------------------------------------------------
//
// Function: 	popupPrint
//
// Description: This function popups a new window with a specified width
//              and height and brings the focus to the popup window and keeps the menu bar
//
// Parameters:  pagename -  the name of the page to be opened in the popup
//							window
//
//				width - the width of the window to be opened
//
//				height - the height of the window to be opened
//
// Programmer:  Happy Tsugawa-Banta
//
// Date: 		9/6/01
//
//
//--------------------------------------------------------------------------------


function popupPrint(pagename,width,height) {
	var popupPrint = window.open(pagename,"popup_print","toolbar=yes,directories=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=" + width + ",height=" + height + ",left=0,top=0");

    popupPrint.focus();

}


//---------------------------------------------------------------------------------
//
// Function:    over
//
// Description: This function swaps the current image with the "over" state of the
//              graphic
//
// Parameters:  name - the name of the image
//
// Programmer:  Happy Tsugawa-Banta
//
// Date:        2/9/01
//
// Updates:     2/9/01 - added these comments (HT)
//
//--------------------------------------------------------------------------------

function over(name){
	if (document.images) {
		document[name].src = eval(name + "over.src");
	}
}


//---------------------------------------------------------------------------------
//
// Function:    off
//
// Description: This function swaps the current image with the "off" or "original"
//              state of the graphic
//
// Parameters:  name - the name of the image
//
// Programmer:  Happy Tsugawa-Banta
//
// Date:        2/9/01
//
// Updates:     2/9/01 - added these comments (HT)
//
//--------------------------------------------------------------------------------

function off(name){
	if (document.images) {
		document[name].src = eval(name + ".src");
	}
}

//---------------------------------------------------------------------------------
//
// Function:    checkRadio
//
// Description: This validates that at least one Radio button in a group
//              has been selected. If there is a single radio button in the
//              group, and it hasn't been selected, the function selects it.
//
// Parameters:  name - the name of the radio button group
//              message - message to display if no button has been selected
//
// Programmer:  Happy Tsugawa-Banta
//
// Date:        2/9/01
//
// Updates:     6/8/01 - added behavior for single radio button SjG
//
//--------------------------------------------------------------------------------

function checkRadio(name,message){
	var radioChecked = 0;
	for (var j=0; j < name.length; j++){
		if (name[j].checked){
			radioChecked=1;
			return true;
		}
	}
    if (!name.length)
        {
        name.checked=1;
        radioChecked=1;
        }
	if (radioChecked == 1){
		form.submit();
        return true;
	} else {
		alert(message);
		return false;
	}
}

//--------------------------------------------------------------------------
//
// Function:    populateRadio
//
// Description: Iterates through the radio buttons in a group and selects
//              one matching a particular value
//
// Parameters:  buttons - the element representing the buttons
//              value - the value to select
//
// Programmer:  Karl Zilles
//
// Date:        5/16/01
//
// Updates:
//
//--------------------------------------------------------------------------

function populateRadio(buttons, value) {
	for (i=0; i<buttons.length; i++)
		if (buttons[i].value==value)
			buttons[i].checked = true;
}

//--------------------------------------------------------------------------
//
// Function:    countChecked
//
// Description: Iterates through the checkboxes in a group and counts how
//              many have been checked.
//
// Parameters:  element - name of the checkboxes
//
// Programmer:  SjG
//
// Date:        06/07/01
//
// Updates:
//
//--------------------------------------------------------------------------

function countChecked(element)
    {
    count=0;
    for(i=0; i<element.length; i++)
        {
        if (element[i].checked)
            {
            count++;
            }
        }
    return count;
}

//--------------------------------------------------------------------------
//
// Function:    checkAll
//
// Description: Iterates through the check boxes in a group and
//              checks or unchecks them
//
// Parameters:  element - name of the checkboxes
//              val - true for checked, false for unchecked
//
// Programmer:  SjG
//
// Date:        06/07/01
//
// Updates:
//
//--------------------------------------------------------------------------

function checkAll(element, val)
    {
    len = element.length;
    var i=0;
    for( i=0 ; i<len ; i++)
        {
        element[i].checked=val;
        }
    }

//--------------------------------------------------------------------------
//
// Function:    toggleSet
//
// Description: Toggles the state of a single checkbox that controls
//              the state of many checkboxes (i.e., "check here to select
//              all" situations)
//
// Parameters:  primary - name of the controller checkbox
//              children - name of the dependent checkboxes
//
// Programmer:  SjG
//
// Date:        06/07/01
//
// Updates:
//
//--------------------------------------------------------------------------

function toggleSet(primary, children)
    {
    if (primary.checked)
        {
        checkAll(children,true);
        }
    else
        {
        checkAll(children,false);
        }
    }
//--------------------------------------------------------------------------
//
// Function:    populateSelect
//
// Description: Iterates through the select options in a dropdown and selects
//              one matching a particular value
//
// Parameters:  select - the element representing the select
//              value - the value to select
//
// Programmer:  Karl Zilles
//
// Date:        5/16/01
//
// Updates:
//
//--------------------------------------------------------------------------
function populateSelect(select, value) {
	for (i=0; i<select.length; i++)
		if (select.options[i].value==value)
			select.selectedIndex = i;
}



//---------------------------------------------------------------------------------
//
// Function: 	checkDateRange
//
// Description: This function checks to see if any of the start date or end date
//              fields have been selected.  If so, it makes sure all of the fields
//              are selected and makes sure that the start date is earlier than the 
//              end date.
//
// Parameters:  form - the name of the form
//
// Returns:     true if all everything is selected correctly, otherwise false
//
// Programmer:  Happy Tsugawa-Banta
// 
// Date: 		6/06/01
//
//--------------------------------------------------------------------------------

function checkDateRange()
{
	var startmonthvalue = eval(document.form.startmonth.selectedIndex);
	var startyearvalue = eval(document.form.startyear.selectedIndex);
	var endmonthvalue = eval(document.form.endmonth.selectedIndex);
	var endyearvalue = eval(document.form.endyear.selectedIndex);
		
	// Check if any of the start or end fields have been selected
	if ( (( startmonthvalue != "" ) || ( startmonthvalue != -1 )) || (( startyearvalue != "" ) || ( startyearvalue != -1 )) || (( endmonthvalue != "" ) || ( endmonthvalue != -1 )) || (( endyearvalue != "" ) || ( endyearvalue != -1 )) ) 
	{
		// Make sure all date fields have been selected
		if ( (( startmonthvalue == "" ) || ( startmonthvalue == -1 )) || (( startyearvalue == "" ) || ( startyearvalue == -1 )) || (( endmonthvalue == "" ) || ( endmonthvalue == -1 )) || (( endyearvalue == "" ) || ( endyearvalue == -1 )) )
		{
			alert("Please fill out all start and end date fields.");
			return false;
		}
		// Make sure starting dates are before ending dates
		if ( (startyearvalue > endyearvalue) || ( (startyearvalue == endyearvalue) && (startmonthvalue > endmonthvalue) ) )
		{
			alert("Please make sure the starting date is before the ending date.");
			return false;
		}
	}
	return true;
}


//---------------------------------------------------------------------------------
//
// Function: 	deleteCheckUser
//
// Description: This function checks to make sure this is not the only user.  Then
//              it pops up a confirm box to warn that the user is about to delete a user.
//
// Returns:     true if this is not the only user and they choose to go on
//              with the delete, otherwise false
//
// Programmer:  Happy Tsugawa-Banta
// 
// Date: 		6/13/01
//
// Updates:
//
//--------------------------------------------------------------------------------

function deleteCheckUser()
{
	if (document.form.userid.length == 1)
    { 
        alert("There is only one current user - therefore you cannot delete this user");
        return false;
    }
	
	if (confirm("Are you sure you want to delete this user?"))
	{
		return validate(this.form,fields);
	} else {
		return false;
	}
}



//---------------------------------------------------------------------------------
//
// Function: 	compare
//
// Description: This function checks which item the user selected in the pulldown and
//              goes to the page by using the option value
//
// Programmer:  Happy Tsugawa-Banta
// 
// Date: 		1/31/01
//
// Updates:     
//
//--------------------------------------------------------------------------------

function compare(what) {
   var n = what.selectedIndex;
   filename = what.options[n].value;
   window.location=filename;
}

/*write layer styles by browser*/

var ns = (document.layers)? true:false
var ie = (document.all)? true:false


var lastShown = null;

function show_div(el) {
    if (lastShown == el)
       return;
    if (lastShown != null)
       hide_div(lastShown);
    el.getElementsByTagName("div")[0].style.display="block";
    el.style.zIndex=1000;
    lastShown = el;
}

function hide_div(el) {
    el.getElementsByTagName("div")[0].style.display="none";
    el.style.zIndex=0;
    lastShown = null;
}

function hide_button(el)
{
    setTimeout(function() { hide_div(el); }, 0);
}

function show_img(id, image) {
    document.getElementById(id).src="images/"+image;
}

function div_tab(id)
{
    var element = document.getElementById(id);
    var p = element.parentNode;
    var divs = p.getElementsByTagName("div");
    for (var i=0; i<divs.length; i++)
    {
        var d = divs[i];
        if (d.parentNode == p)
            d.style.display = d.id == id ? "block" : "none";
    }
}



