var currNum=0;
var switcher = 0;
var currentTabContent = document.getElementById('TabContent'+currNum);

function switchTab(tab){
    if (!tab)
    	tab = 0;
    switcher = 1;
    unlightTab(currNum);
    hightlightTab(tab);
    switcher = 0;
    identity=document.getElementById('tab_'+tab);
    if (!identity)
		return false;

    if (identity.className == "tab")
	    identity.className="tab_selected";
    else if (identity.className == "tab_last")
            identity.className="tab_selected_last";

    currentTabContent.display="none";

    var TabContent=getStyleObject('TabContent'+tab);

    TabContent.display="block"; 
    currentTabContent = TabContent;
    currNum=tab;
}

function hightlightTab(tab){
        if ((tab!=currNum) || (switcher == 1)){
		identity=document.getElementById('tab_'+tab);
		if (!identity)
                        return false;

		if (identity.className == "tab")
			identity.className="tab_selected";
		else if (identity.className == "tab_last")
			identity.className="tab_selected_last";
	}
}


function unlightTab(tab){
	if ((tab!=currNum) || (switcher == 1)){
		identity=document.getElementById('tab_'+tab);
		if (!identity)
			return false;
		if (identity.className == "tab_selected")
			identity.className="tab";
		else if (identity.className == "tab_selected_last")
			identity.className="tab_last";
	}

}

function openContent(id) {

//	opener = document.getElementById("opener"+id);
	box = document.getElementById("box"+id);

	if (!box) 
		return false;

	box.style.display = (box.style.display == "") ? "none" : "";
}

function closeContent(id) {

        box = document.getElementById("box"+id);

        if (!box)
                return false;

        box.style.display = "none";
}


function show_custom() {
	cust = document.getElementById("customize");
	if (!cust)
                return false;
	cust.style.display = "";

	_details = document.getElementById("details");
        if (!_details)
                return false;
	_details.style.display = "none";

	_tab_nav = document.getElementById("tab_nav");
        if (!_tab_nav)
                return false;
	_tab_nav.style.display = "none";
}

function show_details() {
	cust = document.getElementById("customize");
        if (!cust)
                return false;
	cust.style.display = "none";

	_details = document.getElementById("details");
        if (!_details)
                return false;
	_details.style.display = "";

	_tab_nav = document.getElementById("tab_nav");
        if (!_tab_nav)
                return false;
	_tab_nav.style.display = "";
}



