

 /* Category Show/Hide Functions */
 
function openOrClose (theid){
    
    var obj = $get(theid + "_mainTable");
    var img = $get(theid + '_img');
    
    obj.style.display = (obj && obj.style.display == "none") ? "" : "none";
    img.src = pageThemeImageURL + ((obj && obj.style.display == "none")? ImageOpenFile : ImageCloseFile) ;
    
    RecordCatState(theid, obj.style.display);
    
    return false;
}

function RecordCatState(theid, state){
    var currCookieValue = readCookie("catState");
    
    if (currCookieValue=="null" || currCookieValue== null) currCookieValue = "";
    
    currCookieValue = currCookieValue.replace("|" + theid, "").replace("null", "");
    
    if (state=="none") currCookieValue += "|" + theid;
    
    createCookie("catState", currCookieValue, 30);
    
}

function setCatState(){
    var currCookieValue = readCookie("catState");

    if (currCookieValue=="" || currCookieValue=="null" || currCookieValue== null) return;
    
    var arrCurrCookieValue = currCookieValue.split("|");
    
    for (i=0; i<arrCurrCookieValue.length ; i++) {
    
        if(arrCurrCookieValue[i]=='') continue;

        var img = $get(arrCurrCookieValue[i] + "_img");
        if(img) img.src = pageThemeImageURL + ImageOpenFile;
        
        var obj = $get(arrCurrCookieValue[i] + "_mainTable");
        if (obj) obj.style.display = "none";

    }
}


