
var mainSwitch = 0;
var currentImage = 1;
var prevImage = 1;
var lastButton = 1;
var lastDiv = 'exterior';

function turnOn() {
	mainSwitch = 1;
}

//get browser type
var bName = navigator.appName;
var browser;

if(bName == "Netscape") {
	browser = "nn";
}

if (document.getElementById) {
   browser = "ns6";
} 

function imgOn(theLayer, img) {
	if (img != "button_" + lastButton) { 
		if (browser == 'nn') {
			document.layers[theLayer].document.images[img].src = eval(img + "on.src");
		} else {
			window.document.images[img].src = eval(img + "on.src");
		}
	}
}

function imgOff(theLayer, img) {
	if (img != "button_" + lastButton) { 
		if (browser == 'nn') {
			document.layers[theLayer].document.images[img].src = eval(img + "off.src");
		} else {
			window.document.images[img].src = eval(img + "off.src");
		}
	}
}

//when thumbnail button is clicked, swap photo
function swapLayer(theLayer, num, aLayer) {
	showLayer(aLayer);
	if (browser == 'nn') {
		document.layers[theLayer].document.images["button_" + lastButton].src = eval("button_" + lastButton + "off.src");
		document.layers[theLayer].document.images["button_" + num].src = eval("button_" + num + "on.src");
		lastButton = num;
	} else {
		window.document.images["button_" + lastButton].src = eval("button_" + lastButton + "off.src");
		window.document.images["button_" + num].src = eval("button_" + num + "on.src");
		lastButton = num;
	}
}

function showLayer(aLayer) {
		if (mainSwitch == 1) {	
			if (aLayer == 'exterior' && lastDiv != aLayer) {
			hideLayer(lastDiv);
			lastDiv = aLayer;
			}  
			if (aLayer == 'interior' && lastDiv != aLayer) {
			hideLayer(lastDiv);
			lastDiv = aLayer;
			}  
			if (aLayer == 'safety' && lastDiv != aLayer) {
			hideLayer(lastDiv);
			lastDiv = aLayer;
			}  
		theobjs[aLayer].objShow();	
		}
	}
	
function hideLayer(aLayer) {	
		if (mainSwitch == 1) {			
		   	theobjs[aLayer].objHide();	
		}
	}
	
var numLayers = 1;

//dir to images
var imageDir = "images/";

//dir to photos
var photoDir = "images/";

//images for the right nav and the bottom nav


button_1on = new Image();
button_1on.src = photoDir + "pog_h.gif";
button_2on = new Image();
button_2on.src = photoDir + "mic_h.gif";
button_3on = new Image();
button_3on.src = photoDir + "coach_h.gif";

button_1off = new Image();
button_1off.src = photoDir + "pog.gif";
button_2off = new Image();
button_2off.src = photoDir + "mic.gif";
button_3off = new Image();
button_3off.src = photoDir + "coach.gif";
