//home menu pop-out
var curParentCatID = "";
var parentCat;
var isInSubCat = false;
var seeAll = document.getElementById("cat--999");
if (seeAll) {
	seeAll.href = "/?cmd=sb-list&id=-999&srt=3";
}
document.getElementsByTagName('body')[0].onmouseover = function () {
	if (curParentCatID != "") {
		document.getElementById("cat-" + curParentCatID).className = "isParent";
		document.getElementById("cat-" + curParentCatID + "-subList").style.display = "none";	
		curParentCatID = "";		
	}
	if (isShowAll) {
		hideAll();
	}
}
function subcatPopout(e,catID) {
    if (curParentCatID != "") {
		document.getElementById("cat-" + curParentCatID).className = "isParent";
		document.getElementById("cat-" + curParentCatID + "-subList").style.display = "none";	
        curParentCatID = "";
    }
	var Y =	document.getElementById("cat-" + catID).offsetTop;
	document.getElementById("cat-" + catID).className = "navSelected navSelectedParent";
	document.getElementById("cat-" + catID + "-subList").style.display = "block";
	document.getElementById("cat-" + catID + "-subList").style.top = Y -2 + "px";
	curParentCatID	= catID;
	cancelBubbleEvent(e);
}
var isShowAll = false;
var wasShowAll = false;
function showAll(evt) {
	document.getElementById("catsDrop").style.display = "";
	isShowAll = true;
	wasShowAll = true;
	cancelBubbleEvent(evt);
}
function hideAll(evt) {
	document.getElementById("catsDrop").style.display = "none";
	isShowAll = false;
	wasShowAll = false;
}
function dontHide(evt) {
	isShowAll = false;
}
function enableHide(evt) {
	isShowAll = wasShowAll;
}
function cancelBubbleEvent(e) {
    var e = e || window.event;
    e.cancelBubble = true;
    if (e.stopPropagation) e.stopPropagation();
}

var objTabs = new Array();
var tabClasses = 'tabSlct highlight3';

function toggleTab(id, varName)
{
	var elm = document.getElementById(varName + id);
	var oldID = objTabs[varName];
	var temp;
	if (oldID == null)
	{
		oldID = 1;
	}
	var oldTab = document.getElementById(varName + oldID);
	temp = oldTab.className;
	var classes = tabClasses.split(' ');
	for (var i = 0; i < classes.length; i++)
	{
		temp = temp.replace(new RegExp(classes[i], 'g'), '');
	}
	oldTab.className = temp;
	document.getElementById(varName + oldID + '_cont').style.display = 'none';
	document.getElementById(varName + id + '_cont').style.display = 'block';
	elm.className = elm.className + ' ' + tabClasses;
	objTabs[varName] = id;
}

//loginpop toggle
function toggleLoginType(type) {
	if (type == "SB") { curType = "SB"; otherType = "FB";} 
	else {curType = "FB"; otherType = "SB";}
	document.getElementById("loginTab"+curType).className = "opt optSlct highlight6";
	document.getElementById("loginTab"+otherType).className = "opt";
	document.getElementById("login"+curType).style.display = "";
	document.getElementById("login"+otherType).style.display = "none";
	
}
//end login pop toggle
