<!--

function FEmptyControl(control, prompt) {
  if (control.value=="") {
    alert("The " + prompt +" field is a required field, and it must be filled in before your form can be sent to our server.")
    control.focus()
    return false }
  return true }

function check_search_form(form) {
if (!FEmptyControl(form.keywords,'Enter some keywords for search please??')) return false
   return true }

function check_login_form(form) {
if (!FEmptyControl(form.dealer_id,'Enter your 5 digit Dealer ID please??')) return false
if (!FEmptyControl(form.password,'Enter your Dealer Password please??')) return false
   return true }

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

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) { //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<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);
  if(!x && d.getElementById) x=d.getElementById(n); 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
  return window.open(theURL,winName,features);
}

function MM_callJS(jsStr) { //v2.0
  return eval(jsStr)
}

function renderStateList() {
        var values = new Array( "AK", "AL", "AR", "AZ", "CA", "CO", "CT", "DC", "DE", "FL", "GA", "HI", "IA", "ID", "IL", "IN", "KS", "KY", "LA", "MA", "MD", "ME", "MI", "MN", "MO", "MS", "MT", "NC", "ND", "NE", "NH", "NJ", "NM", "NV", "NY", "OH", "OK", "OR", "PA", "RI", "SC", "SD", "TN", "TX", "UT", "VA", "VT", "WA", "WI", "WV", "WY" ) ;
        var captions = new Array( "Alaska", "Alabama", "Arkansas", "Arizona", "California", "Colorado", "Connecticut", "District of Columbia", "Delaware", "Florida", "Georgia", "Hawaii", "Iowa", "Idaho", "Illinois", "Indiana", "Kansas", "Kentucky", "Louisiana", "Massachusetts", "Maryland", "Maine", "Michigan", "Minnesota", "Missouri", "Mississippi", "Montana", "North Carolina", "North Dakota", "Nebraska", "New Hampshire", "New Jersey", "New Mexico", "Nevada", "New York", "Ohio", "Oklahoma", "Oregon", "Pennsylvania", "Rhode Island", "South Carolina", "South Dakota", "Tennessee", "Texas", "Utah", "Virginia", "Vermont", "Washington", "Wisconsin", "West Virginia", "Wyoming" ) ;
        var buffer = "" ;
        for ( var i = 0 ; i < values.length ; i++ ) {
                buffer += "<option value=\"" + values[ i ] + "\">" + captions[ i ] + "</option>" ;
        }
        return buffer ;
}

function renderFlashTag( Movie, Width, Height, Params ) {
        var buffer = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="' + Width + '" height="' + Height + '">' ;
        buffer += '<param name="movie" value="' + Movie + '">' ;
        var pairs = Params.split( ';' ) ;
        for ( var i = 0 ; i < pairs.length ; i++ ) {
                var name = pairs[ i ].split( '=' )[ 0 ] ;
                var value = pairs[ i ].split( '=' )[ 1 ] ;
                buffer += '<param name="' + name + '" value="' + value + '">' ;
        }
        buffer += '<embed src="' + Movie + '" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="' + Width + '" height="' + Height + '" ' ;
        for ( var i = 0 ; i < pairs.length ; i++ ) {
                var name = pairs[ i ].split( '=' )[ 0 ] ;
                var value = pairs[ i ].split( '=' )[ 1 ] ;
                buffer += name + '="' + value + '" ' ;
        }
        buffer += '></embed></object>' ;
        return buffer ;
}


function privacy() {
        var newWindow = MM_openBrWindow( 'privacy.php', '_privacy', 'width=650,height=450,toolbar=0,location=0,directories=0,status=0,menuBar=0,scrollBars=1,resizable=0' );
        newWindow.focus();
}

function copyright() {
        var newWindow = MM_openBrWindow( 'copyright.php', '_copyright', 'width=650,height=450,toolbar=0,location=0,directories=0,status=0,menuBar=0,scrollBars=1,resizable=0' );
        newWindow.focus();
}

function dealers() {
        var newWindow = MM_openBrWindow( 'dealers.php', '_dealers', 'width=650,height=450,toolbar=0,location=0,directories=0,status=0,menuBar=0,scrollBars=1,resizable=0' );
        newWindow.focus();
}

function contactus() {
        var newWindow = MM_openBrWindow( '/ContactUs/', '_contactus', 'width=613,height=400,toolbar=0,location=0,directories=0,status=0,menuBar=0,scrollBars=1,resizable=0' );
        newWindow.focus();
}

function bigpicture( model ) {
        var newWindow = MM_openBrWindow( 'imgpopup.php?model='+model, '_bigpicture', 'width=550,height=580,toolbar=0,location=0,directories=0,status=0,menuBar=0,resizable=0,left=100,top=10,screenX=100,screenY=10,scrollbars=no, resize=no');
        newWindow.focus();
}

function showDiv(divID) {
    //get a reference as above ...
    myReference = getRefToDiv(divID);
    if( !myReference ) {
        window.alert('Nothing works in this browser');
        return false; //don't go any further
        //return anything would work,
        //but I am using false to show failure
    }
    //now we have a reference to it
    if( myReference.style ) { //DOM & proprietary DOM
        myReference.style.visibility = 'visible';
    } else {
        if( myReference.visibility ) { //Netscape
            myReference.visibility = 'show';
        } else {
            window.alert('Nothing works in this browser');
            return false; //don't go any further
        }
    }
    return true;
}


function getRefToDiv(divID,oDoc) {
    if( !oDoc ) { oDoc = document; }
    if( document.layers ) {
        if( oDoc.layers[divID] ) { return oDoc.layers[divID]; } else {
            //repeatedly run through all child layers
            for( var x = 0, y; !y && x < oDoc.layers.length; x++ ) {
                //on success, return that layer, else return nothing
                y = getRefToDiv(divID,oDoc.layers[x].document); }
            return y; } }
    if( document.getElementById ) {
        return document.getElementById(divID); }
    if( document.all ) {
        return document.all[divID]; }
    return false;
}

var magicNumber = 0;
function positionFlash(divID, pos) {

  if (document.all) {

     availW = document.body.clientWidth;
     availH = document.body.clientHeight;

  } else {

    availW = innerWidth;
    availH = innerHeight;
  }

  magicNumber = (availW / 2) + pos;
  getRefToDiv(divID).style.left = magicNumber;
  getRefToDiv(divID).style.visibility = 'visible';

}
//-->