/*
 * toffleague.js is required before this file
 */
function KS_swapBG(objName,colr) {
	if ((x=MM_findObj(objName))!=null){if(!x.oBG) x.oBG=x.style.backgroundColor; x.style.backgroundColor=colr;}
}
function KS_swapBGRestore(objName) {
	if ((x=MM_findObj(objName))!=null){if(x.oBG) x.style.backgroundColor=x.oBG;}
}

var ksOpenedMenuItem = null;				//current opened menu item
var ksMenuItemTimeout = null;				//reference to timeout object
var ksTimeOut = 1000;						//timeout time
//Cancel current timeout
function ksCancelMenuItemTimeOut(){
	if (ksMenuItemTimeout) clearTimeout(ksMenuItemTimeout);
	ksMenuItemTimeout = null;
}
//show menuitem and hide all other menuitems
function ksShowMenuItems(menuItem){
	ksCancelMenuItemTimeOut();				//cancel timeout
	ksHideMenuItems();						//hide opened menuitem
	obj = MM_findObj(menuItem);				//get menuitem
	obj.style.visibility = 'visible';		//show menuitem
	ksOpenedMenuItem = obj;					//make menuitem current
}
//start hide menu item timeout
function ksStartMenuItemTimeOut(){
	ksMenuItemTimeout = setTimeout("ksHideMenuItems()", ksTimeOut);
}
//hide opened menu item
function ksHideMenuItems(){
	if(ksOpenedMenuItem){
		ksOpenedMenuItem.style.visibility='hidden';
		ksOpenedMenuItem = null;
	}
}

/*
 * Link Tab and Panel content functions
 */
function setMenuActive(tab){
    for(i=0; i<tabDIVs.length; i++){
        var x = document.getElementById(tabDIVs[i]+"Lnk");
        var y = document.getElementById(tabDIVs[i]+"Panel");
        if(typeof(x) != undefined && x) x.className = "leftMenuLink";
        if(typeof(y) != undefined && y) y.style.display = "none";
    }
    
    document.getElementById(tab+"Lnk").className = "leftMenuActive";
    document.getElementById(tab+"Panel").style.display = "";
}





// TODO: REMOVE
/*
 * This is mainly used in iFrames to switch content display
 * /
function showTR(num){
	for(i=1; i<=7; i++){
		var x = MM_findObj("stepTR"+i);
		if(x) x.style.display = "none";
	}
	MM_findObj("stepTR"+num).style.display = "";
}


/*
 * Tab functions 
 * /

var tab_current;
function tabOver(num){
	v = MM_findObj("tab_img_"+num);
	if(v.src.indexOf("2") > -1){
		MM_swapImage('tab_img_'+num,'',v.src.replace("2","1"),1);
	}
}
function tabOut(num){
	if(!(num == tab_current))	MM_swapImgRestore();
}
function tabClick(num){
	tab_current = num;
	MM_swapImgRestore();
	w = MM_findObj("tab_img_"+num);
	if(w)w.src = w.src.replace("2","1");
	for(i=1; i<=5; i++){
		//swap all classnames
		x = MM_findObj("tab_td_"+i);
		if(x && i != num){
			x.className = "tab_2";
		}else if(x && i == num){
			x.className = "tab_1";
		}
		//Swap all images
		y = MM_findObj("tab_img_"+i);
		if(y && i != num){
			y.src = y.src.replace("1","2");
		}
		//show/hide inner DIV
		z = MM_findObj("tab_div_"+i);
		if(z && i != num){
			z.style.display = "none";
		}else if(z && i == num){
			z.style.display = "";
		}
	}
}

*/
