function hideshow(showdiv) {

    $(".hideshowlist div.hideshowlistitem").removeClass("show").addClass("hide");

    $(".hideshowlist #hideshowlistitem" + showdiv).removeClass("hide").addClass("show");

    if (typeof doBodySifr == "function") {

        doBodySifr();

    }

}

function makeSelected(selectedDiv) {

    oldA = $(".left_nav li.selected .sIFR-alternate a")

    oldA.removeClass("white")

    $(".left_nav li.selected .sIFR-alternate").html(oldA)

    temp = sIFR.getReplacementByFlashElement($(".left_nav li.selected .sIFR-flash")[0])

    temp.replaceText($(".left_nav li.selected .sIFR-alternate").html());



    $(".left_nav li").removeClass("selected");



    $(".left_nav #itemLI" + selectedDiv).addClass("selected");

    newA = $(".left_nav #itemLI" + selectedDiv + " .sIFR-alternate a")

    $(".left_nav #itemLI" + selectedDiv + " .sIFR-alternate").html(newA)

    html = $(".left_nav #itemLI" + selectedDiv + " .sIFR-alternate").html();

    html = html.replace('<A', '<a').replace('<a class=""', '<a class="white"')

    temp = sIFR.getReplacementByFlashElement($(".left_nav #itemLI" + selectedDiv + " .sIFR-flash")[0])

    temp.replaceText(html);

}



var safeclick = false;

var safeclick2 = false;



function toggleDropDown2(drop) {

    if (safeclick2 == false) {

        if ($("#" + drop + "_list").hasClass("hide")) {

            $(".dropdownlist").addClass("hide");

        }

        $("#" + drop + "_list").toggleClass("hide")

        if ($("#" + drop + "_list").hasClass("hide")) {

        } else {

            safeclick = true;

        }

    }

}

function toggleDropDown(drop) {

    safeclick2 = true;

    if ($("#" + drop + "_list").hasClass("hide")) {

        $(".dropdownlist").addClass("hide");

    }

    $("#" + drop + "_list").toggleClass("hide")

    if ($("#" + drop + "_list").hasClass("hide")) {

    } else {

        safeclick = true;

    }

}



function selectDropDown(txt, drop) {

    var id = $("[class*=" + drop + "_span]").attr("id");

    var objInput = document.getElementById(id);

    objInput.value = txt;

}



function selectDropDownValue(txt, val, drop) {

    var id = $("[class*=" + drop + "_span]").attr("id");

    var objInput = document.getElementById(id);

    objInput.value = txt;



    var idHid = $("[class*=" + drop + "_hidden]").attr("id");

    var objHid = document.getElementById(idHid);

    objHid.value = val;

}



$(document.body).click(function() {

    if (safeclick == false && $.fn != null) {

        $(".dropdownlist").addClass("hide");

    } else {

        safeclick = false;

        safeclick2 = false;

    }

});
