// JavaScript Document
function isIE6()
{
    return (navigator.appVersion.indexOf("MSIE 6")!=-1);
}
var popupChat =
{
    isCookie : false,
    init : function (chatID)
    {
        document.cookie.indexOf("close_popup")!=-1 ? this.isCookie = true : this.isCookie = false;
        this.chatWind = "#"+chatID;
        this.bottom = $(this.chatWind).css("bottom");
    },
    setCookie : function ()
    {
        var expires = new Date();
        expires.setTime(expires.getTime()+1000*60*60*24*365);
        document.cookie = "close_popup=close" + "; expires=" + expires.toUTCString() +  "; path=/";
        this.isCookie = true;
    },
    show : function()
    {
        //if (this.isCookie) return false;
        if(isIE6())
        {
            $(this.chatWind).show();return;
        }
        $(this.chatWind).animate (
            {bottom:"0px"}, 2500
        );
    },
    hide: function()
    {
        if(isIE6())
        {
            $(this.chatWind).hide();return;
        }
        var time = (arguments.length === 0) ? 2500 : 700;
        $(this.chatWind).animate (
            {bottom:this.bottom}, time
        );
    }
}
$(document).ready(function()
    {
        popupChat.init("customChat");
        $("#closeChat").click(function(){popupChat.hide("fast"); popupChat.setCookie();});
        setTimeout("popupChat.show()", 30000);
        setTimeout("popupChat.hide()", 900000);
    });

