﻿var liveHelpToggleObject = {
    init: function () {
		// tweak for ChatImage
		$("#ChatImage").css("padding-bottom", "0");
		
        liveHelpToggleState = "opened";

        var openCloseButtonIcon = $("#liveHelpOpenCloseIcon");
        openCloseButtonIcon.width("15px");

        var openCloseButtonLabel = $(".liveHelpHeaderRightLabel");
        openCloseButtonLabel.html("CLOSE");
        /* Set mouse over/leave cursor style and click event handlers */
        $(".liveHelpHeader").hover(function () {
            $(this).css({ "cursor": "pointer" });
        }, function () {
            $(this).css({ "cursor": "default" });
        }).click(function () {
            switch (liveHelpToggleState) {
                case "closed":
                    openCloseButtonLabel.html("CLOSE");
                    liveHelpToggleObject.open();
                    $("#liveHelpOpenCloseIcon").attr("src", "Resources/Images/liveHelpToggleIconOpened.png");
                    liveHelpToggleState = "opened";
                    break;
                case "opened":
                    openCloseButtonLabel.html("OPEN");
                    liveHelpToggleObject.close();
                    $("#liveHelpOpenCloseIcon").attr("src", "Resources/Images/liveHelpToggleIconClosed.png");
                    liveHelpToggleState = "closed";
                    break;
            }
        });

    },

    open: function () {
        $(".liveHelpLogo").css("display", "block");
//        var logo = $(".liveHelpLogo");
        //$(".liveHelpLogo").slideToggle("slow");        
        $(".liveHelpToggleBackground").height("110px");
    },

    close: function () {
        $(".liveHelpLogo").css("display", "none");
        //$(".liveHelpLogo").slideToggle("slow");
        $(".liveHelpToggleBackground").height("20px");
    }

};

$(function () {
    liveHelpToggleObject.init();
});
