var activemenu = false;
var activemenuhighlight = false;
var menutimeout = false;


//**********************
//*** PRELOAD IMAGES ***
//**********************

// normal image
topCompany = new Image(70,70);
topCompany.src = '/lib/yhst-45845399722688/com.jpg';
// rollover image
topCompanyOn = new Image(70,70);
topCompanyOn.src = '/lib/yhst-45845399722688/com.jpg';

// normal image
topCustServ = new Image(121,70);
topCustServ.src = '/lib/yhst-45845399722688/cus-ser.jpg';
// rollover image
topCustServOn = new Image(121,70);
topCustServOn.src = '/lib/yhst-45845399722688/cus-ser.jpg';

// normal image
topFaqs = new Image(68,23);
topFaqs.src = 'http://site.bamboostylesonline.com/images/topFaqs.gif';
// rollover image
topFaqsOn = new Image(68,23);
topFaqsOn.src = 'http://site.bamboostylesonline.com/images/topFaqsOn.gif';

function showMenu(menuid, menuidhighlight) {
    if (activemenu == menuid) {
        myClearTimeout();
        return;
    }
    hideMenu();

    var menuDiv = document.getElementById(menuid);
    menuDiv.style.display = 'block';
    activemenu = menuid;
	
	if(menuidhighlight) {
		var menuDiv = document.getElementById(menuidhighlight);
	    menuDiv.style.display = 'block';
	    activemenuhighlight = menuidhighlight;
	}
	
	//*********************
	//*** HIGHLIGHT TAB ***
	//*********************
	if(menuid == "companymenu") document.images.topCompany.src = topCompanyOn.src;
	else if(menuid == "custservmenu") document.images.topCustServ.src = topCustServOn.src;
	//else if(menuid == "faqsmenu") document.images.topFaqs.src = topFaqsOn.src;
	
	
}

function mySetTimeout() {
    if (!activemenu)  return;
    menutimeout = setTimeout("hideMenu()", 350);
}

function myClearTimeout() {
    if (!menutimeout)  return;

    clearTimeout(menutimeout);
    menutimeout = false;
}

function hideMenu() {
    if (!activemenu)  return;
    myClearTimeout();

    var menuDiv = document.getElementById(activemenu);
    menuDiv.style.display = 'none';
	
	//****** CLEAR MENU HIGHLIGHT
	if(activemenuhighlight) {
		var menuDiv = document.getElementById(activemenuhighlight);
	    menuDiv.style.display = 'none';
	}
	
	//*********************************
	//**** TURN OFF ALL MENU ITEMS ****
	//*********************************
	document.images.topCompany.src = topCompany.src;
	document.images.topCustServ.src = topCustServ.src;
	//document.images.topFaqs.src = topFaqs.src;
	
    activemenu = false;
	activemenuhighlight = false;
}

function getUrl(url){
	window.location = url;
}

function leftLinkOver(which){
	var activeDiv = document.getElementById(which.id);
	var activeLink = document.getElementById(which.id + 'Link');
	if (document.images) {
		activeDiv.className = 'leftLinkDivOn';
		activeLink.className = 'menuLinkOn';
	}
}

function leftLinkOff(which){
	var activeDiv = document.getElementById(which.id);
	var activeLink = document.getElementById(which.id + 'Link');
	if (document.images) {
		activeDiv.className = 'leftLinkDiv';
		activeLink.className = 'menuLink';
	}
}

