
var tabArray=new Array("tab1", "tab2", "tab3");
var ct="tab1";

var firstBold="#D7B40A";
var firstFade="#E6DCA5";

var secondBold="#239BC3";
var secondFade="#AFD2DC";

var thirdBold="#CD7814";
var thirdFade="#E1BE9B";

var textBold="#000000";
var textFade="#A8A8A8";

function init(){
	document.getElementById("tab1").style.backgroundColor=firstBold;
	document.getElementById("tab1").style.color=textBold;
	document.getElementById("tab2").style.backgroundColor=secondFade;
	document.getElementById("tab2").style.color=textFade;
	document.getElementById("tab3").style.backgroundColor=thirdFade;
	document.getElementById("tab3").style.color=textFade;
}

function focusTab(currentTab){
	if(currentTab != ct){
		for(i in tabArray){
			if(document.getElementById(tabArray[i]).style.zIndex == "3"){
				document.getElementById(tabArray[i]).style.zIndex = "2";
			}else{
				document.getElementById(tabArray[i]).style.zIndex = "1";
			}
			document.getElementById(currentTab).style.zIndex = "3";
		}
		switch(currentTab){
			case "tab1":
				document.getElementById("tab1").style.backgroundColor=firstBold;
				document.getElementById("tab1").style.color=textBold;
				document.getElementById("tab2").style.backgroundColor=secondFade;
				document.getElementById("tab2").style.color=textFade;
				document.getElementById("tab3").style.backgroundColor=thirdFade;
				document.getElementById("tab3").style.color=textFade;
				break;

			case "tab2":
				document.getElementById("tab1").style.backgroundColor=firstFade;
				document.getElementById("tab1").style.color=textFade;
				document.getElementById("tab2").style.backgroundColor=secondBold;
				document.getElementById("tab2").style.color=textBold;
				document.getElementById("tab3").style.backgroundColor=thirdFade;
				document.getElementById("tab3").style.color=textFade;
				break;

			case "tab3":
				document.getElementById("tab1").style.backgroundColor=firstFade;
				document.getElementById("tab1").style.color=textFade;
				document.getElementById("tab2").style.backgroundColor=secondFade;
				document.getElementById("tab2").style.color=textFade;
				document.getElementById("tab3").style.backgroundColor=thirdBold;
				document.getElementById("tab3").style.color=textBold;
		}
		ct=currentTab;
	}
}

function openlink(page){
	if(window.opener.name=="toteIndex"){
		window.opener.open(page, "toteLink");
	}else{
		window.open(page, "toteLink");
	}
}
