
var mainSwitch = 0;
var lastButton = 1;
var lastDiv = 'a1';
var large = 1;
var imgPath = "images/";
var largeWin

button1on = new Image();
button1on.src = imgPath + "pic01_small_h.jpg";
button2on = new Image();
button2on.src = imgPath + "pic02_small_h.jpg";
button3on = new Image();
button3on.src = imgPath + "a3_h.gif";
button4on = new Image();
button4on.src = imgPath + "a4_h.gif";
button5on = new Image();
button5on.src = imgPath + "a5_h.gif";
button6on = new Image();
button6on.src = imgPath + "a6_h.gif";
button7on = new Image();
button7on.src = imgPath + "a7_h.gif";
button8on = new Image();
button8on.src = imgPath + "a8_h.gif";
button9on = new Image();
button9on.src = imgPath + "a9_h.gif";
button10on = new Image();
button10on.src = imgPath + "a10_h.gif";

t1on = new Image();
t1on.src = "gal_t1_h.gif";
t2on = new Image();
t2on.src = "gal_t2_h.gif";

button1off = new Image();
button1off.src = imgPath + "pic01_small.jpg";
button2off = new Image();
button2off.src = imgPath + "pic02_small.jpg";
button3off = new Image();
button3off.src = imgPath + "a3.gif";
button4off = new Image();
button4off.src = imgPath + "a4.gif";
button5off = new Image();
button5off.src = imgPath + "a5.gif";
button6off = new Image();
button6off.src = imgPath + "a6.gif";
button7off = new Image();
button7off.src = imgPath + "a7.gif";
button8off = new Image();
button8off.src = imgPath + "a8.gif";
button9off = new Image();
button9off.src = imgPath + "a9.gif";
button10off = new Image();
button10off.src = imgPath + "a10.gif";

t1off = new Image();
t1off.src = "gal_t1.gif";
t2off = new Image();
t2off.src = "gal_t2.gif";

//get browser type
var bName = navigator.appName;
var browser;

if(bName == "Netscape") {
	browser = "nn";
}

if (document.getElementById) {
   browser = "ns6";
} 
//image rollover for sub navs.
function tabOn(tab){
     	document.images[tab].src = eval(tab + "on.src");
}

function tabOff(tab){
          document.images[tab].src = eval(tab + "off.src");
}

function imgOn(theLayer, img, num) {
	if (img != "button" + lastButton) { 
		window.document.images[img].src = eval(img + "on.src");
	}
}

function imgOff(theLayer, img, num) {
	if (img != "button" + lastButton) { 
		window.document.images[img].src = eval(img + "off.src");
	}
}


//when thumbnail button is clicked, swap photo
function swapPhoto(theLayer, num) {
		window.document.images["photo"].src = imgPath + "photo_" + num + ".jpg";
		window.document.images["button" + lastButton].src = eval("button" + lastButton + "off.src");
		window.document.images["button" + num].src = eval("button" + num + "on.src");
		lastButton = num;
		large = num;
}

// If there is more than one level of buttons, use this function.
function showNext(aLayer) {
		if (mainSwitch == 1) {	
		    if (aLayer == 'a1' && lastDiv != aLayer) {
			hide(lastDiv);
			lastDiv = aLayer;
			}  
			if (aLayer == 'a2' && lastDiv != aLayer) {
			hide(lastDiv);
			lastDiv = aLayer;
			}  
		theobjs[aLayer].objShow();	
		}
	}
	

// Layer text
ns4 = (document.layers)? true:false
ie4 = (document.all)? true:false
var texttowrite
function layerWrite(id,num) {
	if (num == '1') {
	texttowrite = "<span class='body01'>Hybrid shown in Blue Ribbon Metallic</span>"
	}
	else if (num == '2') {
	texttowrite = "<span class='body01'>Hybrid shown in Blue Ribbon Metallic</span>"
	}
	else if (num == '3') {
	texttowrite = "<span class='body01'>SE V6 shown in Titanium Metallic</span>"
	}
	else if (num == '4') {
	texttowrite = "<span class='body01'>SE V6 shown in Titanium Metallic with available moonroof</span>"
	}
	else if (num == '5') {
	texttowrite = "<span class='body01'>SE shown in Titanium Metallic</span>"
	}
	else if (num == '6') {
	texttowrite = "<span class='body01'>XLE V6 shown in Magnetic Gray Metallic with available Smart Key System*<br>*Available on V6 model only.</span>"
	}
	else if (num == '7') {
	texttowrite = "<span class='body01'>SE shown in Titanium Metallic with available rear spoiler</span>"
	}		
   else if (num == '8') {
	texttowrite = "<span class='body01'>Hybrid shown in Desert Sand Mica</span>"
	}
   else if (num == '9') {
	texttowrite = "<span class='body01'>Hybrid shown in Desert Sand Mica</span>"
	}
   else if (num == '10') {
	texttowrite = "<span class='body01'>SE shown in Titanium Metallic</span>"
	}

	if (ns4) {
		document.layers[id].document.open();
		document.layers[id].document.write(texttowrite);
		document.layers[id].document.close();
	}
	else { 
	document.getElementById(id).innerHTML = texttowrite;
	}
}

