//set x y height and width of swf
var nav_x=500;
var nav_y=108;
var nav_w=778;
var nav_h=200;

//end set hieght

var doShowroomPopups=false;

// Flash nav Code:
//

//Macromedia functions
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;
}
//END Macromedia functions

//NO USER EDITABLE BELOW
var nav_r=nav_x+nav_w;var nav_b=nav_y+nav_h;var ie=document.all?true:false;var mac=navigator.appVersion.indexOf("acintosh")>-1;
var mx=0;var my=0;var ief="";var je=navigator.javaEnabled();var jsurl="notset";var liveconnect="notset";var state="closed";var canclose=false;var fplver=""
var ns6=navigator.appName=="Netscape"&&(navigator.userAgent.indexOf("/5.")>-1||navigator.userAgent.indexOf("/6.")>-1);var loded=false;var ns62=ns6&&parseFloat(navigator.vendorSub)>=6.2
var nua=navigator.userAgent.toLowerCase();var exp=(nua.indexOf("msie")>-1||nua.indexOf("aol")>-1)&&navigator.appName!="Netscape";var callflag=false
//var logolink=(mac&&exp)?true:false


function showHide() {
	var args=showHide.arguments;
	if(loded==true)
	//if(loded==true&&logolink==true)
	{
		var i,p,v,obj;
		for (i=0; i<(args.length-2); i+=3)
			if ((obj=MM_findObj(args[i]))!=null) {
				v=args[i+2];
				if (obj.style) {
					obj=obj.style;
					v=(v=='show')?'visible':(v='hide')?'hidden':v;
				};
				obj.visibility=v;
			}
		if(ns6&&(v=="show"||v=="visible")){
			ns6open();
		}else{
			if(ns6&&(v=="hide"||v=="hidden")){
				ns6C();
			};
		}
	}else{
		var jumpstr="showHide(\""+args[0]+"\",\""+args[1]+"\",\""+args[2]+"\")";
		var jumptime=setTimeout(jumpstr,50);
	};
}

function setjscall(isversion){//get and set capabilities
if(loded==true){var minver=parseInt(isversion.substring(8,10));var majver=parseInt(isversion.substring(4,5));var plug=majver>=6&&minver>=40;jsurl=true;canclose=true;if(je==true&&!(ie==true&&mac==true)){liveconnect=true;}if(je==false||(ns6&&!ns62)||(ns6&&plug==false)||(mac&&exp)){liveconnect=false;}
if(liveconnect==true){if(!(ns6&&!ns62)&&MM_findObj("menu")&&(MM_findObj("menu").GetVariable("closemenus")==false||MM_findObj("menu").GetVariable("closemenus")=="false")){MM_findObj("menu").SetVariable("liveconnect","true");MM_findObj("menu").SetVariable("closemenus","false");MM_findObj("menu").SetVariable("jsurl","true");var nua=navigator.userAgent.toLowerCase();if(!mac&&exp){
		//is pc explorer so remove background arcs
MM_findObj("menu").SetVariable("pcie","true");};if(!exp&&!mac&&!ns6&&liveconnect==true&&navigator.userAgent.toLowerCase().indexOf("mozilla/4.")>-1&&navigator.appName=="Netscape"){
		//is pc netscape 4 to 4.75 so tell the plugin this
MM_findObj("menu").SetVariable("pcns","true");};}else{clearTimeout("calltime");var callstr="setjscall(\""+setjscall.arguments[0]+"\")";var calltime=setTimeout(callstr,50);};};}else{
var callstr="setjscall(\""+setjscall.arguments[0]+"\")";clearTimeout("calltime");var calltime=setTimeout(callstr,50);};
};

function closemenus(){
if(loded==true){if(mac&&exp){showHide('nav','','show');showHide('nav','','hide');}
if(canclose==true&&(jsurl==false||(!exp&&!mac&&!ns6&&liveconnect==true&&navigator.userAgent.toLowerCase().indexOf("mozilla/4.")>-1&&navigator.appName=="Netscape"))){
	//is pc netscape 4 to 4.75 so close on timer
	/*clearTimeout("jsurl_pcns");*/
	showHide('nav','','show');showHide('nav','','hide');}else{if(canclose==true&&jsurl==true){clearTimeout("ief");if(exp==true&&mac==true){showHide('nav','','show');showHide('nav','','hide');}else{showHide('nav','','hide');}
}else{if(jsurl!=true){
    		//catch ie4Mac
    		if(state=="closed"||canclose==true){}else{clearTimeout("ief");};};};
};canclose=false;
};
}

//------end of flash nav code

// Determine which sort of browser
netscape4=false;
if (navigator.appName=="Netscape" && navigator.appVersion[0]<=4) {
  netscape4=true;
}


//  This Code is subject to the terms, conditions, warranties, and disclaimers of the Webmonkey Public License, Version 1.0 located at http://www.hotwired.com/webmonkey/javascript/code_library/license/wpl.html. Original Code is (c) 1998 Wired Digital Inc. (and, if applicable, Modifications are (c) Date: _______________ Author: ________________; Author URL: ______________; Author Email:___________________). All Rights Reserved. This Code came from the Webmonkey Code Library located at http://www.hotwired.com/webmonkey/javascript/code_library/. Webmonkey is a registered trademark of Wired Ventures Inc.
function WM_preloadImages() {

/*
WM_preloadImages()
Loads images into the browser's cache for later use.

Source: Webmonkey Code Library
(http://www.hotwired.com/webmonkey/javascript/code_library/)

Author: Nadav Savio
Author Email: nadav@wired.com

Usage: WM_preloadImages('image 1 URL', 'image 2 URL', 'image 3 URL', ...);
*/

  // Don't bother if there's no document.images
  if (document.images) {
    if (typeof(document.WM) == 'undefined'){
      document.WM = new Object();
    }
    document.WM.loadedImages = new Array();
    // Loop through all the arguments.
    var argLength = WM_preloadImages.arguments.length;
    for(arg=0;arg<argLength;arg++) {
      // For each arg, create a new image.
      document.WM.loadedImages[arg] = new Image();
      // Then set the source of that image to the current argument.
      document.WM.loadedImages[arg].src = WM_preloadImages.arguments[arg];
    }
  }
}

//  This Code is subject to the terms, conditions, warranties, and disclaimers of the Webmonkey Public License, Version 1.0 located at http://www.hotwired.com/webmonkey/javascript/code_library/license/wpl.html. Original Code is (c) 1998 Wired Digital Inc. (and, if applicable, Modifications are (c) Date: _______________ Author: ________________; Author URL: ______________; Author Email:___________________). All Rights Reserved. This Code came from the Webmonkey Code Library located at http://www.hotwired.com/webmonkey/javascript/code_library/. Webmonkey is a registered trademark of Wired Ventures Inc.
function WM_imageSwap(daImage, daSrc){
  var objStr,obj;
  /*
    WM_imageSwap()
    Changes the source of an image.

    Source: Webmonkey Code Library
    (http://www.hotwired.com/webmonkey/javascript/code_library/)

    Author: Shvatz
    Author Email: shvatz@wired.com

    Usage: WM_imageSwap(originalImage, 'newSourceUrl');

    Requires: WM_preloadImages() (optional, but recommended)
    Thanks to Ken Sundermeyer (ksundermeyer@macromedia.com) for his help
    with variables in ie3 for the mac.
    */
  // Check to make sure that images are supported in the DOM.
  if(document.images){
    // Check to see whether you are using a name, number, or object
    if (typeof(daImage) == 'string') {
      // This whole objStr nonesense is here solely to gain compatability
      // with ie3 for the mac.
      objStr = 'document.' + daImage;
      obj = eval(objStr);
      obj.src = daSrc;
    } else if ((typeof(daImage) == 'object') && daImage && daImage.src) {
    daImage.src = daSrc;
    }
  }
}
// Display of DHTML Popup:
// Code from "DHTML and CSS for the World Wide Web"
//
var isDHTML = 0;
var isID = 0;
var isAll = 0;
var isLayers = 0;
var domStyle;

if (document.getElementById) {isID = 1; isDHTML = 1;}
else {
if (document.all) {isAll = 1; isDHTML = 1;}
else {
browserVersion = parseInt(navigator.appVersion);
if ((navigator.appName.indexOf('Netscape') != -1) && (browserVersion == 4)) {isLayers = 1; isDHTML = 1;}
}}

function findDOM(objectID,withStyle) {
	if (withStyle == 1) {
		if (isID) { return (document.getElementById(objectID).style) ; }
		else {
			if (isAll) { return (document.all[objectID].style); }
		else {
			if (isLayers) { return (document.layers[objectID]); }
		};}
	}
	else {
		if (isID) { return (document.getElementById(objectID)) ; }
		else {
			if (isAll) { return (document.all[objectID]); }
		else {
			if (isLayers) { return (document.layers[objectID]); }
		};}
	}
}
function findLivePageWidth() {
	if (window.innerWidth != null)
		return window.innerWidth;
	if (document.body.clientWidth != null)
		return document.body.clientWidth;
	return (null);
}

function popUp(evt,objectID,xoff,yoff){
	if (isDHTML) { // Makes sure this is a DHTML browser
		var livePageWidth = findLivePageWidth();
		//alert(livePageWidth);
		domStyle = findDOM(objectID,1);
		dom = findDOM(objectID,0);
		state = domStyle.visibility;
		if (dom.offsetWidth) elemWidth = dom.offsetWidth;
		else { if (dom.clip.width)	elemWidth = dom.clip.width; }
		if (state == "visible" || state == "show")  { domStyle.visibility = "hidden"; }
		else {
			if (evt.pageY) { //Calculates the position for Navigator 4
				topVal = evt.pageY + 4;
				leftVal = evt.pageX - (elemWidth / 2);
			}
			else {
				if (evt.y) { // Calculates the position for IE4
					topVal = evt.y + 4 + document.body.scrollTop + yoff;
					leftVal = evt.x - (elemWidth / 2) + document.body.scrollLeft + xoff;
				}
			}
		/*If the element goes off the page to the left, this moves it back */
			if(leftVal < 2) { leftVal = 2; }
			else {
				if ((leftVal + elemWidth) > livePageWidth) { leftVal = leftVal - (elemWidth / 2); }
			}
			domStyle.top = topVal; // Positions the element from the top
			domStyle.left = leftVal; // Positions the element from the left
			domStyle.visibility = "visible"; // Makes the element visable
		}
	}
}
// This method inserts the layer/style tags into the html
// to provide background image as lowest layer.
function showBackground(dir, name) {
  if (netscape4) {
    document.write("<layer id=\"background\" pagex=\"0\" pagey=\"0\" z-index=\"1\" width=\"763\" height=\"439\" background=\""+dir+"/"+name+".jpg\">&nbsp;</layer>");
  } else {
    document.write("<style type=\"text/css\">");
    document.write("  div.background {");
    document.write("    z-index: 1;");
    document.write("    position: absolute;");
    document.write("    top: 0;");
    document.write("    left: 0;");
    document.write("    width: 763;");
    document.write("    height: 439;");
    document.write("    background-image: url("+dir+"/"+name+".jpg);");
    document.write("    background-repeat: no-repeat;");
    document.write("  }");
    document.write("</style>");
    document.write("<div class=\"background\">&nbsp;</div>");
  }
}
function showBackgroundImg(name) {
  if (netscape4) {
    document.write("<layer id=\"background\" pagex=\"0\" pagey=\"0\" z-index=\"1\" width=\"763\" height=\"439\" background=\""+name+"\">&nbsp;</layer>");
  } else {
    document.write("<style type=\"text/css\">");
    document.write("  div.background {");
    document.write("    z-index: 1;");
    document.write("    position: absolute;");
    document.write("    top: 0;");
    document.write("    left: 0;");
    document.write("    width: 763;");
    document.write("    height: 439;");
    document.write("    background-image: url("+name+");");
    document.write("    background-repeat: no-repeat;");
    document.write("  }");
    document.write("</style>");
    document.write("<div class=\"background\">&nbsp;</div>");
  }
}

function startScreenLayer() {
  if (netscape4) {
    document.write("<layer id=\"screen\" z-index=\"2\">");
  } else {
    document.write("<div class=\"screen\">");
  }

}

function footerLinksLeft() {
  if (netscape4) {
    return "<span class=\"footerlinksleftNS\">";
  } else {
    return "<span class=\"footerlinksleftIE\">";
  }

}

function footerLinksRight() {
  if (netscape4) {
    return "<span class=\"footerlinksrightNS\">";
  } else {
    return "<span class=\"footerlinksrightIE\">";
  }

}

function endLayer() {
  if (netscape4) {
    document.write("</layer>");
  } else {
    document.write("</div>");
  }
}
function hideDetailPopup() {
  detailPopup.close();
}

function openPromoWin(url) {
  win=window.open(appserverbase+url, "", "menubar=no,toolbar=no,location=no,directories=no,scrollbars=yes,status=yes,resizable=yes");
}

function openPromoWindow(url,params) {
  win=window.open(url, "", params);
}

function openPrivacyWin(url) {
  win=window.open(appserverbase+url, "", "menubar=no,toolbar=no,location=no,directories=no,scrollbars=yes,status=yes,resizable=yes,width=360,height=450");
}

function openTandCWin(url) {
  win=window.open(appserverbase+url, "", "menubar=no,toolbar=no,location=no,directories=no,scrollbars=yes,status=yes,resizable=yes,width=360,height=450");
}

function openToolWin(url) {
  win=window.open(appserverbase+url, "", "menubar=no,toolbar=no,location=no,directories=no,scrollbars=yes,status=yes,resizable=yes,width=550,height=500");
}

function newWin(url) {
  win=window.open(url, "", "menubar=no,toolbar=no,location=no,directories=no,scrollbars=yes,status=yes,resizable=yes");
}

function openDealerLocWin(url) {
  win=window.open(url, "", "menubar=no,toolbar=no,location=no,directories=no,scrollbars=yes,status=yes,resizable=yes,width=600,height=500");
}

function goAbsolute(url) {
  if (document.images)
    location.href(url);
  else
    location.href = url;
}

function goRelative(url) {
  if (document.images)
    location.replace(appserverbase+url);
  else
    location.href = appserverbase+url;
}

function webserverUrl(url) {
  return webserverbase+url;
}


function openThirdPartyWindow(url) {
  win=window.open(url, "", "menubar=no,toolbar=no,location=no,directories=no,scrollbars=yes,status=yes,resizable=yes");
}
// Used to show and hide layers in NS 4
function MM_showHideLayers() { //v3.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v='hide')?'hidden':v; }
    obj.visibility=v; }
}

// Move text from layer 1 to layer 2 - IE only
function moveText(o1,o2) {
  o2.innerHTML=o1.innerHTML;
}

// Change font weight of object - IE only
function bold(obj){
  if (!netscape4) {
    var dom=findDOM(obj,1);
    dom ['fontWeight'] = 'bold';
  }
}
function norm(obj){
  if (!netscape4) {
    var dom=findDOM(obj,1);
    dom ['fontWeight'] = 'normal';
  }
}

// Used when selecting a link has no action
function doNothing() {
}

// Reloads page for Netscape 4.7 on page resize
function MM_reloadPage(init) {  //reloads the window if Nav4 resized
	if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
	document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
	else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);
// This code is from Dynamic Web Coding www.dyn-web.com
// Copyright 2002 by Sharon Paine Permission granted to use this code as long as this entire notice is included.
// Permission granted to SimplytheBest.net to feature script in its
// DHTML script collection at http://simplythebest.net/scripts/dhtml_scripts.html

var dom = (document.getElementById) ? true : false;
var ns5 = ((navigator.userAgent.indexOf("Gecko")>-1) && dom) ? true: false;
var ie5 = ((navigator.userAgent.indexOf("MSIE")>-1) && dom) ? true : false;
var ns4 = (document.layers && !dom) ? true : false;
var ie4 = (document.all && !dom) ? true : false;
var nodyn = (!ns5 && !ns4 && !ie4 && !ie5) ? true : false;

var origWidth, origHeight;
if (ns4) {
	origWidth = window.innerWidth; origHeight = window.innerHeight;
	window.onresize = function() { if (window.innerWidth != origWidth || window.innerHeight != origHeight) history.go(0); }
}

if (nodyn) { event = "nope" }
var tipFollowMouse	= true;
var offX		 	= 10;	// how far from mouse to show tip
var offY		 	= -10;

var tooltip, tipcss;
function initTip(tipobj,tipname) {
	if (nodyn) return;
	tooltip = (ns4)? tipobj.document: (ie4)? document.all[tipname]: (ie5||ns5)? document.getElementById(tipname): null;
	tipcss = (ns4)? tipobj: tooltip.style;
	if (tooltip&&tipFollowMouse) {
		//if (ns4) document.captureEvents(Event.MOUSEMOVE);
		//document.onmousemove = trackMouse;
            doShowroomPopups=true;
	}
}

var t1,t2;	// for setTimeouts
var tipOn = false;	// check if over tooltip link
function doTooltip(evt,num) {

      // set initial popup position
      if (mouseX==0&&mouseY==0) {
        mouseX = (ns4||ns5)? evt.pageX: window.event.clientX + document.body.scrollLeft;
        mouseY = (ns4||ns5)? evt.pageY: window.event.clientY + document.body.scrollTop;
      }

	if (!tooltip) return;
	if (t1) clearTimeout(t1);
        if (t2) clearTimeout(t2);
	tipOn = true;

	if (!tipFollowMouse) positionTip(evt);
	else positionTip(evt);
        tipcss.visibility='visible';
}

var mouseX=0, mouseY=0;
function trackMouse(evt) {
	  mouseX = (ns4||ns5)? evt.pageX: window.event.clientX + document.body.scrollLeft;
          mouseY = (ns4||ns5)? evt.pageY: window.event.clientY + document.body.scrollTop;
          if (tipOn) positionTip(evt);
}
function positionTip(evt) {
          if (!tipFollowMouse) {
                  mouseX = (ns4||ns5)? evt.pageX: window.event.clientX + document.body.scrollLeft;
                  mouseY = (ns4||ns5)? evt.pageY: window.event.clientY + document.body.scrollTop;
          }
          // tooltip width and height
          var tpWd = (ns4)? tooltip.width: (ie4||ie5)? tooltip.clientWidth: tooltip.offsetWidth;
          var tpHt = (ns4)? tooltip.height: (ie4||ie5)? tooltip.clientHeight: tooltip.offsetHeight;
          // document area in view (subtract scrollbar width for ns)
          var winWd = (ns4||ns5)? window.innerWidth-20+window.pageXOffset: document.body.clientWidth+document.body.scrollLeft;
          var winHt = (ns4||ns5)? window.innerHeight-20+window.pageYOffset: document.body.clientHeight+document.body.scrollTop;
          // check mouse position against tip and window dimensions
          // and position the tooltip
          if ((mouseX+offX+tpWd)>winWd)
                  tipcss.left = (ns4)? mouseX-(tpWd+offX): mouseX-(tpWd+offX)+"px";
          else tipcss.left = (ns4)? mouseX+offX: mouseX+offX+"px";
          if ((mouseY+offY+tpHt)>winHt)
                  tipcss.top = (ns4)? winHt-(tpHt+offY): winHt-(tpHt+offY)+"px";
          else tipcss.top = (ns4)? mouseY+offY: mouseY+offY+"px";
          if (!tipFollowMouse) t1=setTimeout("tipcss.visibility='visible'",100);
}
function hideTip() {
	if (!tooltip) return;
        tipcss.visibility='hidden';
        tipOn = false;
}



// Flash nav Code:
//

function posit(e){
	if (doShowroomPopups==true) {trackMouse(e);}
	/*
	trackmouse change by Cap Gemini NOTE:
	trackmouse(e) here will not transfer e. e/event must be tested/ (x).parames stripped and sent/trackmouse changed to handle the new arguments

	*/
	if(loded==true){
		//xy positional handler
		var tx=0;var ty=0;tx=ie?event.clientX + document.body.scrollLeft:e.pageX;tx=tx<0?0:tx;mx=tx;ty=ie?event.clientY + document.body.scrollTop:e.pageY;ty=ty<0?0:ty;my=ty;
		if(tx<nav_x||tx>nav_r||ty>nav_b||ty<nav_y){
			//is outside swf area
			if(liveconnect==true){
				MM_findObj("menu").SetVariable("closemenus","true");
			}
			if(jsurl==false||(!exp&&!mac&&!ns6&&liveconnect==true&&navigator.userAgent.toLowerCase().indexOf("mozilla/4.")>-1&&navigator.appName=="Netscape")){
				//is pc netscape 4 to 4.75 so setClose
				if(canclose==true){
					/*var jsurl_pcns=setTimeout("closemenus()",500);*/
					closemenus();
				};
			};
			state="closed";
		}else{
			//is inside swf area
			/*clearTimeout("jsurl_pcns");*/
			state="open";
		};
	};
};
document.layers?document.captureEvents(Event.MOUSEMOVE):void(0);document.onmousemove=posit;

/*function callclose(){if(callflag==false&&loded==true){showHide("calltoAction","","hide");callflag=true;};}*/
function ieclose(){clearTimeout("ief");if(state=="closed"){if(loded==true){showHide('nav','','show');showHide('nav','','hide');};ief=setTimeout("ieclose()",50);};};

function ns6C(){
//alert('calling ns6C')
if(ns6==true){
	MM_findObj("nav").style.left="-1000";
};
if(loded!=true){
	//showHide('nav','','hide');
	if(mac&&exp){
		ief=setTimeout("ieclose()",50);
	};
};
loded=true;
}

function ns6open(){if(ns6==true){MM_findObj("nav").style.left="0";};}
function focposit(){setjscall(fplver);posit();}
//onload=ns6C;

if(!top.onfocus){;}else{top.onfocus=focposit;}
