/* javascripts.js */

///////////////////
// IE JavaScript so the CSS dropdowns work
//////////////////
startList = function() {
	if (document.all&&document.getElementById) {
		navRoot = document.getElementById("nav");
		for (i=0; i<navRoot.childNodes.length; i++) {
			node = navRoot.childNodes[i];
			if (node.nodeName=="LI") {
				node.onmouseover=function() {
					this.className+=" over";
				}
				node.onmouseout=function() {
					this.className=this.className.replace(" over", "");
				}
			}
		}
	}
}
/*window.onload=startList;*/

///////////////
// drop down menu in dealers section
//////////////
function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

/////////////////////
// CHECK FOR EXTERNAL LINKS
////////////////////
function externalLinks() {
        if (!document.getElementsByTagName) return;
        var anchors = document.getElementsByTagName("a");
        for (var i=0; i<anchors.length; i++) {
                var anchor = anchors[i];
                if (anchor.getAttribute("href") &&
                anchor.getAttribute("rel") == "external")
                anchor.target = "_blank";
        }
}
window.onload = startList, externalLinks;


/////////////////
// open popup window for images
/////////////////

	function openWindow(theURL,winName,myWidth,myHeight,isCenter) { //v3.0
	  var features="";
	  if(window.screen)if(isCenter)if(isCenter=="true"){
		var myLeft = (screen.width-myWidth)/2;
		var myTop = (screen.height-myHeight)/2;
		features+=(features!='')?',':'';
		features+=',scrollbars=no,resizable=no';
		features+=',left='+myLeft+',top='+myTop;
	  }
	  var winName = "Image";
	  
	  window.open(theURL,winName,features+((features!='')?',':'')+'width='+myWidth+',height='+myHeight);
	}


//////////////////
// status bar message
//////////////////
function showStatus(sMsg) {
    window.status = sMsg;
    return true;
}
	
////////////////////////
//show/hide a layer with display:none;
///////////////////////
function toggle( targetId ){
  if (document.getElementById){
    target = document.getElementById( targetId );
     if (target.style.display == "none"){
      target.style.display = "";
     } else {
      target.style.display = "none";
     }
   }
}