//image rollover for hornav with current section highlighted 
function navRollOver (whichNav,imageFileType) {	
	var rollOverSuffix = "-over";
	var whichNav = whichNav.replace(/^\s+|\s+$/g,'');
	var imageFileType = imageFileType.replace(/^\s+|\s+$/g,'');
	var imagePath = "/i/hornav-";
	var navRoot = document.getElementById(whichNav);
	var args = getUrlSubString();
	
	for(i=0; i<navRoot.childNodes.length; i++){
		node0 = navRoot.childNodes[i];
		if(node0.nodeName=='A'){
			for(a=0; a<node0.childNodes.length; a++){
				node1=node0.childNodes[a];
				if(node1.nodeName=="IMG"){
					node1.onmouseover=function(){
						srcactive = imagePath+this.id+rollOverSuffix+imageFileType;
						this.src = srcactive;						
					}
					node1.onmouseout=function(){
						if (
							(this.id=="carbuying" && args=="car-buying")||
							(this.id=="carrepair" && args=="car-repair")||
							(this.id=="carparts" && args=="car-parts")||
							(this.id=="carculture" && args=="car-culture")||
							(this.id=="topfives" && args=="car-top-fives")||
							(this.id=="autoloans" && args=="auto-loans")
							)
						{
							src = imagePath+this.id+rollOverSuffix+imageFileType;
						} else {
							src = imagePath+this.id+imageFileType;	
						}						
						this.src = src;
					}
				}
			}
		}
	}
}


//returns the current section to navRollOver
function getUrlSubString() {
	var url = document.URL;
	var whichPageArray=url.split("/");	
	return whichPageArray[3];
}

//writes the flash object code to the homepage
function addSwfFile() {
	document.write("<object classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\" codebase=\"http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0\" width=\"737\" height=\"236\" id=\"wheelscene-homepage\" align=\"middle\">");
	document.write("<param name=\"allowScriptAccess\" value=\"sameDomain\" />");
	document.write("<param name=\"movie\" value=\"http://media.wheelscene.com/swf/wheelscene-homepage.swf?version=1\" />");
	document.write("<param name=\"quality\" value=\"high\" />");
	document.write("<param name=\"FlashVars\" value=\"env=dev\" />");
	document.write("<embed src=\"http://media.wheelscene.com/swf/wheelscene-homepage.swf?version=1\" quality=\"high\" bgcolor=\"#ffffff\" width=\"737\" height=\"236\" name=\"wheelscene-homepage\" FlashVars=\"env=dev\" align=\"middle\" allowScriptAccess=\"sameDomain\" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" />");
	document.write("</object>");
}

function addSwfFile2() {
	document.write("<object classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\" codebase=\"http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0\" width=\"120\" height=\"240\" id=\"wheelscene-homepage\" align=\"middle\">");
	document.write("<param name=\"allowScriptAccess\" value=\"sameDomain\" />");
	document.write("<param name=\"movie\" value=\"http://media.wheelscene.com/swf/wheelscene-homepage.swf\" />");
	document.write("<param name=\"quality\" value=\"high\" />");
	document.write("<embed src=\"http://media.wheelscene.com/inc/EZCarPrices_120_240.swf\" quality=\"high\" bgcolor=\"#ffffff\" width=\"120\" height=\"240\" name=\"wheelscene-homepage\" align=\"middle\" allowScriptAccess=\"sameDomain\" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" />");
	document.write("</object>");
}
function tabToggle(whichTab) {
	if (whichTab == "autoshopping") {
		document.getElementById("content-interface").style.display = "none";
		document.getElementById("comments").style.display = "none";
		document.getElementById("yshop").style.display = "";
		document.getElementById("tabs-autoshopping").src = "/i/tabs-autoshopping-over.gif";
		document.getElementById("tabs-information").src = "/i/tabs-information.gif";
	} else if (whichTab == "information") {
		document.getElementById("content-interface").style.display = "";
		document.getElementById("comments").style.display = "";
		document.getElementById("yshop").style.display = "none";
		document.getElementById("tabs-autoshopping").src = "/i/tabs-autoshopping.gif";
		document.getElementById("tabs-information").src = "/i/tabs-information-over.gif";
	} 
}

//popup function for survey
function launchPop(theWindow,windowName,parameters) {
	var winOpen 
	winOpen = window.open(theWindow,windowName,parameters);
}
