function HideShowLogin() {
    //if (document.getElementById("DhtmlPopupDiv").style.display == "none") {
    //document.getElementById("DhtmlPopupDiv").style.display = "block";
    if ($('#DhtmlPopupDiv').css('display') == "none") {
        $('#DhtmlPopupDiv').show();
        document.getElementById("loginButton").src = "/PublishingImages/HMS/CommonImages/header/close-btn.gif";
    }
    else {
        //document.getElementById("DhtmlPopupDiv").style.display = "none";
        $('#DhtmlPopupDiv').hide();
        document.getElementById("loginButton").src = "/PublishingImages/HMS/CommonImages/header/login-btn.gif";
    }
}


function DisplayLoggedMessage() {

    var LoginCookie = getCookie("LoginStatus");
    if (LoginCookie != null) {

        if (LoginCookie.toString() == "True") {
            //            document.getElementById("loginBlock").style.display = "none";
            //            document.getElementById("loggedInBlock").style.display = "block";
            $('#loginBlock').hide();
            var UserLoginStatus = getCookie("Refreshdone");
            if (UserLoginStatus == null) {
                setcookie();
            }
            else
                if (UserLoginStatus.toString() == "0") {
                parent.window.location.reload();
                $('#loggedInBlock').show();

                document.cookie = "Refreshdone=" + escape(1);
            }

        }
    }
}

function getCookie(name) {
    var dc = document.cookie;
    var cname = name + "=";
    if (dc.length > 0) {
        begin = dc.indexOf(cname);
        if (begin != -1) {
            begin += cname.length;
            end = dc.indexOf(";", begin);
            if (end == -1) end = dc.length;
            return unescape(dc.substring(begin, end));
        }
    }
    return null;
}

function Logout() {
    del_cookie("LoginStatus");
    del_cookie("HMS_USER_ID");
    del_cookie("HMS_USER_COL");
    document.getElementById("loginBlock").style.display = "block";
    document.getElementById("DhtmlPopupDiv").style.display = "none";
    document.getElementById("loggedInBlock").style.display = "none";

}

function del_cookie(name) {
    document.cookie = name +
'=; expires=Thu, 01-Jan-70 00:00:01 GMT;';
}

function ForgetMeNavigation(Url) {
    window.location.href(Url);
}

function setcookie() {
    document.cookie = "Refreshdone=" + escape(0);
}

function LeftNavArrow() {
    //window.max_script_run_time = 100000;
    if (document.getElementById('zz2_CurrentNav') != null) {
        //to get the page URL- starts
        var i = window.location.href.split("//")[1].split("/");
        var URLStr = "";
        for (c = 1; c <= i.length - 1; c++)
            URLStr = URLStr + "/" + i[c];
        if (URLStr.split("?").length != 1)
            URLStr = URLStr.split("?")[0];
        //to get the page URL- ends
        //alert(URLStr);
        //to retrieve and modify the CSS- starts
        var leftNavSplit = document.getElementById('zz2_CurrentNav').innerHTML.split(URLStr);
        if (leftNavSplit.length != 1) {
            var j = leftNavSplit[0].split('class=');
            var reqStrClass = j[j.length - 1].split('"')[1];
            var reqStrArr = reqStrClass.split(" ");
            var ModStrClass = reqStrArr[0] + " " + reqStrArr[1] + " " + "leftNavSelected" + " " + reqStrArr[2];
            //to retrieve and modify the CSS- ends
            
            //to retrieve id - starts
            var e = leftNavSplit[0].split("id=");
            var reqID = e[e.length - 1].split('"')[1].toString();
            if (document.implementation && document.implementation.createDocument) {
                reqID = e[e.length - 1].split('"')[1].toString();
            }
            else if (window.ActiveXObject) {
                reqID = e[e.length - 1].split(" ")[0].toString();
            }
            //to retrieve id - ends

            //game starts now
            var anc = document.getElementById(reqID).getElementsByTagName('a');
            anc[0].className = ModStrClass;
            //game ends here
        }
    }
}




        