var initialtab
var sC = readCookie('Current_Tab')

var a = document.location.toString().split("/");
if (a.length >= 4) {
    if (a[3] == '' || a[3] == 'home.aspx') {
        sC = 1;
    }
}

//sC = 1
if (sC == null) {
    //Set Value
    initialtab = [1, "sc1"]
    createCookie('Current_Tab', '1', '1')
}
else {
    //alert(sC);
    initialtab = [sC, "sc" + sC]
}


var turntosingle = 0
var disabletablinks = 0
var previoustab = ""
if (turntosingle == 1)
    document.write('<style type="text/css">\n#tabcontentcontainer{display: none;}\n</style>')
function expandcontent(cid, aobject) {

    sC = cid.toString().substring(2);

    var a = document.location.toString().split("/");
    if (a.length >= 4) {
        if (a[3] == '' || a[3] == 'home.aspx') {
            sC = 1;
        }
    }

    //sC = 1
    createCookie('Current_Tab', sC, '1')

    if (disabletablinks == 1)
        aobject.onclick = new Function("return false")
    if (previoustab != "")
    //document.getElementById(previoustab).style.display="none"
        document.getElementById(previoustab).className = "tabcontent"
    if (cid != "") {
        //document.getElementById(cid).style.display="block"
        document.getElementById(cid).className = "tabcontentnext"
        previoustab = cid
    }
}
function highlighttab(aobject) {
    if (typeof tabobjlinks == "undefined")
        collectddtabs()
    for (i = 0; i < tabobjlinks.length; i++)
        tabobjlinks[i].className = ""
    aobject.className = "current"
}
function collectddtabs() {
    var tabobj = document.getElementById("navigation")
    tabobjlinks = tabobj.getElementsByTagName("A")
}
function do_onload() {
    collectddtabs()
    expandcontent(initialtab[1], tabobjlinks[initialtab[0] - 1])
}
function createCookie(name, value, days) {
    if (days) {
        var date = new Date();
        date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000));
        var expires = "; expires=" + date.toGMTString();
    }
    else var expires = "";
    document.cookie = name + "=" + value + expires + "; path=/";
}
function readCookie(name) {
    var nameEQ = name + "=";
    var ca = document.cookie.split(';');
    for (var i = 0; i < ca.length; i++) {
        var c = ca[i];
        while (c.charAt(0) == ' ') c = c.substring(1, c.length);
        if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length, c.length);
    }
    return null;
}
function eraseCookie(name) {
    createCookie(name, "", -1);
}
if (window.addEventListener)
    window.addEventListener("load", do_onload, false)
else if (window.attachEvent)
    window.attachEvent("onload", do_onload)
else if (document.getElementById)
    window.onload = do_onload
