//deaker zip switch
var dealerZip = true;

// browser detection
function browserStats() {
  var ua = " " + navigator.userAgent.toLowerCase();
  this.nn = ua.indexOf( "mozilla" ) > 0;
  this.safari = ua.indexOf( "safari" ) > 0;
  ua.indexOf( "compatible" ) > 0 ? this.nn = false : "";
  this.ie = ua.indexOf( "msie" ) > 0;
  this.version = parseInt( navigator.appVersion );
  this.mac = ua.indexOf( "mac" ) > 0;
  this.ie ? ua.indexOf( "msie 5" ) > 0 ? this.version = 5 : "" : "";
  this.ie ? ua.indexOf( "msie 6" ) > 0 ? this.version = 6 : "" : "";
  return this;
}

var b = new browserStats();

//File path
var cssPath = "/css/", cssFile;

//Netscape
b.nn && b.version >= 5 ? cssFile = "netscape_font_adjust.css":"";

//IE
b.ie ? cssFile = "ie_font_adjust.css" : b.mac && b.ie && b.version >= 5 ? cssFile = "mac_ie_font_adjust.css":"";

//Safari
b.mac && b.safari ? cssFile = "safari_font_adjust.css":"";

cssFile ? document.write( '<link rel="stylesheet" href="' + cssPath + cssFile + '" type="text/css" />' ) : "";

//alert(cssFile);

//Global Netscape browser resize fix
if(b.nn && b.version < 5) {widthCheck = window.innerWidth;heightCheck = window.innerHeight;window.onresize = resizeFix;}
function resizeFix(){widthCheck != window.innerWidth || heightCheck != window.innerHeight ? window.location.reload(true) : "";}

//Tracking Functions
function trackHit(){
_hbSend();
}

function trackNamedHit(argLid,argPos){
  var whiteSpace = / /g;
  var newId = argLid.replace(whiteSpace,"+");
  var newPos = argPos.replace(whiteSpace,"+");
  _hbSet('lid',newId);
  _hbSet('lpos',newPos);
  trackHit();
}


//DHTML FUNCTIONS
var d=document; var _a=(d.all)?1:0; var l=(!d.getElementById && b.nn)?1:0;
function getE(e,f){if(l){f=(f)?f:self;V=f.document.layers;if(V[e])return V[e];for(W=0;W<V.length;)t=getE(e,V[W++]);return t;}if(_a)return d.all[e];return d.getElementById(e);}
function showE(e){e=getE(e);if(l)e.visibility='show';else e.style.visibility='visible';}
function hideE(e){e=getE(e);if(l)e.visibility='hide';else e.style.visibility='hidden';}
function getX(e){e=getE(e);if(l)return e.left;else return e.style.left;}
function setX(e,x){e=getE(e);if(l)e.left=x;else e.style.left=x;}
function getY(e){e=getE(e);if(l)return e.top;else return e.style.top;}
function setY(e,y){e=getE(e);if(l)e.top=y;else e.style.top=y;}
function setZ(e,z){e=getE(e);if(l)e.zIndex=z;else e.style.zIndex=z;}
function setW(e,w){e=getE(e);if(l)e.clip.width=w;else e.style.width=w;}
function getW(e){e=getE(e);if(l)return e.document.width;if(_a)return e.scrollWidth;return e.offsetWidth;}
function setH(e,h){e=getE(e);if(l)e.clip.height=h;else e.style.height=h;}
function getH(e){e=getE(e);if(l)return e.document.height;if(_a)return e.scrollHeight;return e.offsetHeight;}
function setC(e,t,r,b,x){e=getE(e);if(l){X=e.clip;X.top=t;X.right=r;X.bottom=b;X.left=x;}else e.style.clip='rect('+t+' '+r+' '+b+' '+x+')';}
function writeH(e,h){e=getE(e);if(l){Y=e.document;Y.write(h);Y.close();}else e.innerHTML=h;trackHit();}
function getMouseX(e){if(_a)return event.clientX;return e.pageX;}
function getMouseY(e){if(_a)return event.clientY;return e.pageY;}
function getScrollX(){if(_a)return d.body.scrollLeft;return window.pageXOffset;}
function getScrollY(){if(_a)return d.body.scrollTop;return window.pageYOffset;}