// show hide layers with + / - menus_status_array = new Array (); // remembers state of switchesvar globalShowHide = 'hide';function showHideAll() {	if (document.getElementById) {		// loop over all toggle-able elements on the page		for (var i=0; i<menus_array.length; i++) {			var theid = menus_array[i];			var switch_id = document.getElementById(theid);			//var imgid = theid+'Button';			//var button_id = document.getElementById(imgid);						if (globalShowHide == 'show') {				//button_id.setAttribute ('src', img_open);				switch_id.className = 'showSwitch';				menus_status_array[theid] = 'show'; 			} else {				//button_id.setAttribute ('src', img_close);				switch_id.className = 'hideSwitch';				menus_status_array[theid] = 'hide'; 			}		}		// toggle global show/hide variable		if (globalShowHide == 'show')			globalShowHide = 'hide';		else			globalShowHide = 'show';	}}img_open = "img/minus.gif";img_closed =  "img/plus.gif";function showHide (theid) {	if (document.getElementById) {    	var switch_id = document.getElementById(theid);    	var imgid = theid+'PM';    	var button_id = document.getElementById(imgid);    	if (menus_status_array[theid] != 'show') {       		button_id.setAttribute ('src', img_open);      		switch_id.className = 'showSwitch';	  		menus_status_array[theid] = 'show';     	} else {      		button_id.setAttribute ('src', img_closed);      		switch_id.className = 'hideSwitch';	  		menus_status_array[theid] = 'hide';     	}		// check if global toggle should be flipped		var numShow=0;		var numHide=0;		for (var i=0; i<menus_array.length; i++) {			var theid = menus_array[i];			if (menus_status_array[theid] == 'show')				numShow++;			else				numHide++;		}		if (numShow <= numHide)			globalShowHide = 'show';		else			globalShowHide = 'hide';  	}}// resetMenu, called when the page loadsfunction resetMenu () {     for (var i=0; i<menus_array.length; i++) {    	var idname = menus_array[i];      	var switch_id = document.getElementById(idname);      	var imgid = idname+'PM';      	var button_id = document.getElementById(imgid);      	if (i == 0 || i == 1) {      		button_id.setAttribute ('src', img_open);       		switch_id.className = 'showSwitch';	    	menus_status_array [idname] = 'show';      	} else {	    	button_id.setAttribute ('src', img_closed);       		switch_id.className = 'hideSwitch';	    	menus_status_array [idname] = 'hide';	    }	}}// Open URLfunction openpage(address) {	window.location=address;}// Open URL in new window, three sizesfunction openLarge(newUrl){	var windowOptions = "location=no";    windowOptions    += ",toolbar=no";    windowOptions    += ",menubar=no";    windowOptions    += ",status=no";    windowOptions    += ",scrollbars=yes";    windowOptions    += ",resizable=yes";    windowOptions    += ",width=700";    windowOptions    += ",height=470";   var hwin=window.open(newUrl, 'DealerTrack', windowOptions);    if (navigator.userAgent.indexOf("MSIE") < 0)    { hwin.focus(); }    return false;}function openMedium(newUrl){	var windowOptions = "location=no";    windowOptions    += ",toolbar=no";    windowOptions    += ",menubar=no";    windowOptions    += ",status=no";    windowOptions    += ",scrollbars=yes";    windowOptions    += ",resizable=yes";    windowOptions    += ",width=400";    windowOptions    += ",height=300";   var hwin=window.open(newUrl, 'DealerTrack', windowOptions);    if (navigator.userAgent.indexOf("MSIE") < 0)    { hwin.focus(); }    return false;}function openSmall(newUrl){	var windowOptions = "location=no";    windowOptions    += ",toolbar=no";    windowOptions    += ",menubar=no";    windowOptions    += ",status=no";    windowOptions    += ",scrollbars=yes";    windowOptions    += ",resizable=yes";    windowOptions    += ",width=220";    windowOptions    += ",height=250";   var hwin=window.open(newUrl, 'DealerTrack', windowOptions);    if (navigator.userAgent.indexOf("MSIE") < 0)    { hwin.focus(); }    return false;}// Show hide layer tooltip script/*function show(object) {	if (document.layers && document.layers[object] != null)	    document.layers[object].visibility = 'visible';	else if (document.all)	    document.all[object].style.visibility = 'visible';}function hide(object) {	if (document.layers && document.layers[object] != null)	    document.layers[object].visibility = 'hidden';	else if (document.all)	    document.all[object].style.visibility = 'hidden';} */// ------------------------------------------------// buttons on off// BIG buttons on/offfunction b1on(what) { what.style.color = '#99ff33'; }function b1off(what) { what.style.color = '#ffffff'; }// SMALL buttons on/offfunction b2on(what) { what.style.color = '#228B22'; }function b2off(what) { what.style.color = '#000000'; }// ------------------------------------------------// Resize popup windows //Input the IDs of the IFRAMES you wish to dynamically resize to match its content height://Separate each ID with a comma. Examples: ["myframe1", "myframe2"] or ["myframe"] or [] for none:var iframeids=["myframe"]//Should script hide iframe from browsers that don't support this script (non IE5+/NS6+ browsers. Recommended):var iframehide="yes"var getFFVersion=navigator.userAgent.substring(navigator.userAgent.indexOf("Firefox")).split("/")[1]var FFextraHeight=parseFloat(getFFVersion)>=0.1? 32 : 0 //extra height in px to add to iframe in FireFox 1.0+ browsersfunction resizeCaller() {var dyniframe=new Array()for (i=0; i<iframeids.length; i++){if (document.getElementById)resizeIframe(iframeids[i])//reveal iframe for lower end browsers? (see var above):if ((document.all || document.getElementById) && iframehide=="no"){var tempobj=document.all? document.all[iframeids[i]] : document.getElementById(iframeids[i])tempobj.style.display="block"}}}function resizeIframe(frameid){var currentfr=document.getElementById(frameid)if (currentfr && !window.opera){currentfr.style.display="block"if (currentfr.contentDocument && currentfr.contentDocument.body.offsetHeight) //ns6 syntaxcurrentfr.height = currentfr.contentDocument.body.offsetHeight+FFextraHeight; else if (currentfr.Document && currentfr.Document.body.scrollHeight) //ie5+ syntaxcurrentfr.height = currentfr.Document.body.scrollHeight;if (currentfr.addEventListener)currentfr.addEventListener("load", readjustIframe, false)else if (currentfr.attachEvent){currentfr.detachEvent("onload", readjustIframe) // Bug fix linecurrentfr.attachEvent("onload", readjustIframe)}}}function readjustIframe(loadevt) {var crossevt=(window.event)? event : loadevtvar iframeroot=(crossevt.currentTarget)? crossevt.currentTarget : crossevt.srcElementif (iframeroot)resizeIframe(iframeroot.id);}function loadintoIframe(iframeid, url){if (document.getElementById)document.getElementById(iframeid).src=url}if (window.addEventListener)window.addEventListener("load", resizeCaller, false)else if (window.attachEvent)window.attachEvent("onload", resizeCaller)elsewindow.onload=resizeCaller// for tooltipsvar DH = 0; var an = 0; var al = 0; var ai = 0;if (document.getElementById) {	ai = 1; DH = 1;} else {	if (document.all) {		al = 1; DH = 1;	} else { 		browserVersion = parseInt(navigator.appVersion); 		if ((navigator.appName.indexOf('Netscape') != -1) && (browserVersion == 4)) {			an = 1; DH = 1;		}	}}function fd(oi, wS) {	if (ai) return wS ? document.getElementById(oi).style:document.getElementById(oi); 	if (al) return wS ? document.all[oi].style: document.all[oi]; 	if (an) return document.layers[oi];}function pw() {	return window.innerWidth != null? window.innerWidth: document.body.clientWidth != null? document.body.clientWidth:null;}function mouseX(evt) {	if (evt.pageX) 		return evt.pageX; 	else if (evt.clientX)		return evt.clientX + (document.documentElement.scrollLeft ?  document.documentElement.scrollLeft : document.body.scrollLeft); 	else return null;}function mouseY(evt) {	if (evt.pageY) 		return evt.pageY; 	else if (evt.clientY)		return evt.clientY + (document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop); 	else return null;}function popUp(evt,oi) {	if (DH) {		var wp = pw(); ds = fd(oi,1); dm = fd(oi,0); 		st = ds.visibility; 		if (dm.offsetWidth) 			ew = dm.offsetWidth; 		else if (dm.clip.width) 			ew = dm.clip.width; 		if (st == "visible" || st == "show") { 			ds.visibility = "hidden"; 		} else {			tv = mouseY(evt) + 5;			lv = mouseX(evt) + 15;			/*lv = mouseX(evt) - (ew/4); 			if (lv < 2) 				lv = 2; 			else if (lv + ew > wp) 				lv -= ew/2; */			if (!an) {				lv += 'px'; tv += 'px';			} 			ds.left = lv; ds.top = tv; 			ds.visibility = "visible";		}	}}