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('center_tab_'+tab);
    if (!identity)
                return false;
    identity.className="tab_selected left";
    currentTabContent.className="hidden";

    var TabContent = document.getElementById('TabContent'+tab);

    TabContent.className=""; 
    currentTabContent = TabContent;
    currNum=tab;
}

function hightlightTab(tab) {
        if ((tab!=currNum) || (switcher == 1)){
		identity=document.getElementById('center_tab_'+tab);
		if (!identity)
                        return false;
		identity.className="tab_selected left";
       	}
}


function unlightTab(tab) {
	if ((tab!=currNum) || (switcher == 1)){
		identity=document.getElementById('center_tab_'+tab);
		if (!identity)
                        return false;
		identity.className="tab left";
	}

}

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 = "";
}


switchTab(0);

