﻿function __w_VisibilityMaxMin(oBtn, sInpExpanded, sContentID, sCookieID) {
    var oContent;
    var oInpExpanded;
    if (document.all == null)
        oContent = document.getElementById(sContentID),
        oInpExpanded = document.getElementById(sInpExpanded);
    else
        oContent = document.all(sContentID),
        oInpExpanded = document.all(sInpExpanded);
    if (oContent != null) {
        var sMaxIcon = oBtn.getAttribute('max_icon');
        var sMinIcon = oBtn.getAttribute('min_icon');
        var sMaxTip = oBtn.getAttribute('max_tip');
        var sMinTip = oBtn.getAttribute('min_tip');
        if (oContent.style.display == 'none') {
            oBtn.src = sMaxIcon;
            oBtn.title = sMinTip;
            oContent.style.display = '';
            oInpExpanded.value = 1;
            createCookie(sCookieID, 'true', 365);
        }
        else {
            oBtn.src = sMinIcon;
            oBtn.title = sMaxTip;
            oContent.style.display = 'none';
            oInpExpanded.value = 0;
            createCookie(sCookieID, 'false', 365);
        }
        return true; //cancel postback
    }
    return false; //failed so do postback
}
