if (navigator.appName.indexOf("WebTV") != -1) { 
	window.location.href = "/html/help/misc/webtv.html"; 
}


var mainSwitch = 0;
var isModelsOn = false;
var lastLayer;
var lastImgLayer;
var lastImg;
var x1,x2,y1,y2;

function turnOn() {
	mainSwitch = 1;
}


if (window.captureEvents) {
        window.captureEvents(Event.MOUSEMOVE);
        window.onmousemove = mouseTracker;
} else {
        document.onmousemove = mouseTracker;
        
}

function mouseTracker(e) {
	e = e || window.Event || window.event;
    window.pageX = e.pageX || e.clientX;
    window.pageY = e.pageY || e.clientY;

	setTimeout("",2000);

			y1 = 0;				//pixels above nav
			x1 = 0;				//pixels to left of nav
			y2  = 100;			//pixels below nav
			x2 =  800;			//pixels to right of nav

			my1 = 0;			//pixels above model nav
			mx1 = 125;			//pixels to left of model nav
			my2  = 400;			//pixels below model nav
			mx2 =  250;			//pixels to right of model nav
		
		if (isModelsOn == true) {
			if((window.pageX < (mx1-10) || window.pageX > mx2 || window.pageY < (my1-5) || window.pageY > my2) ) {
				hide('models');
			}
		} else if ((window.pageX < (x1-10) || window.pageX > x2 || window.pageY < (y1-5) || window.pageY > y2) && lastLayer != null) {
				hide(lastLayer);
				changeImage(lastImg,lastImg + 'off','false');
				lastLayer = null;
		}
}

function menuSwitch(aLayer,imgName) {
	if (mainSwitch == 1) {
		if (lastLayer != null) {
			hide(lastLayer);
			changeImage(lastImg,lastImg + 'off','false');
		}
		changeImage(imgName,imgName + 'on','false');
		show(aLayer)
		lastLayer = aLayer;
		lastImg = imgName;
	}
}

function changeImage(imgName,imgObj,isLayerOn) {
	if (mainSwitch == 1) {
		if (isModelsOn == true) {
			hide('models');
		}
		if (isLayerOn == 'true' && lastLayer != null) {
			hide(lastLayer);
			lastLayer = null;
			window.document.images[lastImg].src = eval(lastImg + "off.src");
		}
		window.document.images[imgName].src = eval(imgObj + ".src");
	}
}

function changeLayerLast(isLayerOn) {
	if (mainSwitch == 1) {
		if (isModelsOn == true) {
			hide('models');
		}
		if (isLayerOn == 'true' && lastLayer != null) {
			hide(lastLayer);
			lastLayer = null;
			window.document.images[lastImg].src = eval(lastImg + "off.src");
		}		
	}
}

// hide element  
function hide(aLayer) {
	if (mainSwitch == 1) {
		if (aLayer == 'models') {
			isModelsOn = false;
			subOff('showroom', 'shop2');
		}
	  	theobjs[aLayer].objHide();
	}
}

// show element
function show(aLayer) {
	if (mainSwitch == 1) {
		if (aLayer == 'models') {
			isModelsOn = true;
			subOn('showroom', 'shop2');
		}
	   	theobjs[aLayer].objShow();
	}
}

//popup window function
//pass the url, the width, and the height
var theWin

function popup(theURL, width, height) {

	if(theWin == null || theWin.closed) {
		theWin = window.open(theURL, "popup", "toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=no,resizable=no,width=" + width + ",height=" + height + ",top=100,left=100");
	} else {
		theWin.close()
		theWin = window.open(theURL, "popup", "toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=no,resizable=no,width=" + width + ",height=" + height + ",top=100,left=100");
	}
}