var oFrame;
var oName;
var num;
var topE_left=topE_top=0;
var timecount = 1000;
var timerOn = false;
var timerID;

// Put all Top Level Layer's Here
function hideAll()
{
	doHide("Menu1");
	doHide("Menu2");
	doHide("Menu3");
}


// Hide Other Three Main Menu when Other is one.
function hideOthers(num)
{
	if (num=="1"){
	doHide("Menu2");
	}
	if (num=="2"){
	doHide("Menu1");
	}
}

/* ***************************************************
	Displays the layer.
	oName is the Name (ID) of the Layer
	offSet is the off-set position from the center.
		(-) moves it to the left
		(+) moves it to the right
	oXPos comment was deleted by the previous coder
* *****************************************************/
function showIt( oName, offSet, oXPos) {
	var XoffSet=offSet;
	var YoffSet=oYPos=0;
	//oYPos=0;
	//setDimensions();
	oRel = true;
	//var isMac = (navigator.appVersion.indexOf("Mac")!=-1) ? true : false;
	var locW;
	if(document.layers){//ie
		XoffSet+=37;
		YoffSet+=225;
	}
	if(document.all){
		XoffSet+=37;
		YoffSet+=225;
	}
	if(!document.all && document.getElementById){//ffx
		XoffSet+=44;
		YoffSet+=230;
	}
	var oXPos = oXPos+XoffSet;
	var oYPos = oYPos+YoffSet;
	var theDiv = findObj( oName, oFrame );
	if( !theDiv ) { return; }
	if( theDiv.style ) {
		theDiv = theDiv.style;
	}
	if( typeof( oXPos ) == 'number' ) {
		oXPos = Math.floor(oXPos);
		theDiv.left = oXPos;
	}
	if( typeof( oYPos ) == 'number' ) {
		theDiv.top = oYPos+'px';
	}
	theDiv.visibility = "visible";
}

// Hides a Layer
function doHide(oName) {
	var theDiv = findObj( oName, oFrame ); if( !theDiv ) { return; }
	if( theDiv.style ) { theDiv = theDiv.style; }
	theDiv.visibility = "hidden";

}
function startTime() {
    if (timerOn == false) {
           timerID=setTimeout( "hideAll()" , timecount);
           timerOn = true;
    }

}
function stopTime() {
     if (timerOn) {
	        clearTimeout(timerID);
            timerID = null;
            timerOn = false;
     }
}

// Returns the Layer
function findObj( oName, oFrame, oDoc ) {
	if( !oDoc ) {
		if( oFrame ) { oDoc = oFrame.document; }
		else { oDoc = window.document; } }
	if( oDoc[oName] ) { return oDoc[oName]; }
	if( oDoc.all && oDoc.all[oName] ) { return oDoc.all[oName]; }
	if( oDoc.getElementById && oDoc.getElementById(oName) ) { return oDoc.getElementById(oName); }
	for( var x = 0; x < oDoc.forms.length; x++ ) {
		if( oDoc.forms[x][oName] ) { return oDoc.forms[x][oName]; }
	}
	for( var x = 0; x < oDoc.anchors.length; x++ ) {
		if( oDoc.anchors[x].name == oName ) { return oDoc.anchors[x]; }
	}
	for( var x = 0; document.layers && x < oDoc.layers.length; x++ ) {
		var theOb = findObj( oName, null, oDoc.layers[x].document );
		if( theOb ) { return theOb; } }
	if( !oFrame && window[oName] ) { return window[oName]; }
	if( oFrame && oFrame[oName] ) { return oFrame[oName]; }
	for( var x = 0; oFrame && oFrame.frames && x < oFrame.frames.length; x++ ) {
		var theOb = findObj( oName, oFrame.frames[x], oFrame.frames[x].document );
		if( theOb ) { return theOb; }
	}
	return null;
}

// This Calculates the Size of the Browser
function setDimensions()
{
	if (parseInt(navigator.appVersion)>3) {
		if (document.layers) {
			winW = window.innerWidth;
			winH = window.innerHeight;
		} else if (document.documentElement && (document.documentElement.clientWidth || document.documentElement.clientHeight )) {
			winW = document.body.offsetWidth;
			winH = document.body.coffsetHeight;
		} else if (document.documentElement && (document.body.clientWidth || document.body.clientHeight )){
			winW = document.body.clientWidth;
			winH = document.body.clientHeight;
		}
	}
}

if (document.images) {
	Menu1aon = new Image();
	Menu1aon.src = '/products/zipzoom/images/h_nav_experience_top_1.gif';
	Menu1aoff = new Image();
	Menu1aoff.src = '/products/zipzoom/images/h_nav_experience_top_0.gif';
	Menu1bon = new Image();
	Menu1bon.src = '/products/zipzoom/images/h_nav_experience_btm_1.gif';
	Menu1boff = new Image();
	Menu1boff.src = '/products/zipzoom/images/h_nav_experience_btm_0.gif';
	Menu2aon = new Image();
	Menu2aon.src = '/products/zipzoom/images/h_nav_buy_top_1.gif';
	Menu2aoff = new Image();
	Menu2aoff.src = '/products/zipzoom/images/h_nav_buy_top_0.gif';
	Menu2bon = new Image();
	Menu2bon.src = '/products/zipzoom/images/h_nav_buy_btm_1.gif';
	Menu2boff = new Image();
	Menu2boff.src = '/products/zipzoom/images/h_nav_buy_btm_0.gif';

}

function swapOn(Menu) {
	if (document.images) {
		document.images[Menu+'a'].src = eval(Menu + 'aon.src');
		document.images[Menu+'b'].src = eval(Menu + 'bon.src');
	}
}

function swapOff(Menu) {
	if (document.images) {
		document.images[Menu+'a'].src = eval(Menu + 'aoff.src');
		document.images[Menu+'b'].src = eval(Menu + 'boff.src');
	}
}

function findPos(obj) {
	var objE=document.getElementById(obj);
	var curleft = curtop = 0;
	if (objE.offsetParent) {
		curleft = objE.offsetLeft
		curtop = objE.offsetTop
		while (objE = objE.offsetParent) {
			curleft += objE.offsetLeft
			curtop += objE.offsetTop
		}
	}
	topE_left=curleft;
	topE_top=curtop;
//	return [curleft,curtop];
}