// Show site Link




function showSite(){
		$("#siteTip").show(300);
		setTimeout("hideSite()",5000);
}
function hideSite(){
		$("#siteTip").hide(300);
}
$(document).ready(function() {
    $(".strike img").hover(function() { $(".strike .tips").show(); }, function() { $(".strike .tips").hide(); })
})
function setGray() {
    $('body').prepend('<div id="layer_gray" style="z-index: 500;display:none; left:0;position:absolute;top:0;background: #000000; width: ' + $(document).width() + 'px; height:' + $(document).height() + 'px;"/>');
    $("#layer_gray").css("opacity", "0.7");
    $("#layer_gray").show();
}
function cancelGray() {
    $("#layer_gray").remove();
}
function showActRemind() {
    var windowWidth = document.documentElement.clientWidth;
    var windowHeight = document.documentElement.clientHeight;
    var popupHeight = $("#actRemindBox").height();
    var popupWidth = $("#actRemindBox").width();
    var top = windowHeight / 2 - popupHeight / 2;
    var left = windowWidth / 2 - popupWidth / 2;
    $("#actRemindBox").show();
    $("#actRemindBox").css("position", "fixed");
    $("#actRemindBox").css("top", top+"px");
    $("#actRemindBox").css("left", left+"px");
    $("#actRemindBox").css("z-index", 1200); 
    setGray();
}
function hideActRemind() {
    cancelGray();
    $("#actRemindBox").hide();
}
function showLoadTime(control) {
    var cc = document.getElementById(control);
    cc.innerHTML = getTranTime();
}
function getCookie(name) {
    var arg = name + "=";
    var alen = arg.length;
    var clen = document.cookie.length;
    var i = 0;
    while (i < clen) {
        var j = i + alen;
        if (document.cookie.substring(i, j) == arg) {
            return getCookieVal(j);
        }
        i = document.cookie.indexOf(" ", i) + 1;
        if (i == 0) break;
    }
    return "";
}
function getCookieVal(offset) {
    var endstr = document.cookie.indexOf(";", offset);
    if (endstr == -1) {
        endstr = document.cookie.length;
    }
    return unescape(document.cookie.substring(offset, endstr));
}
function getTranTime() {
    var time = getCookie('page_tran_time');
    return parseFloat(time) / 1000;
}

$(document).ready(function(){
		$("#imageBtn").hover(function(){$(this).addClass("btn")},function(){$(this).removeClass("btn")})
		$(".login h2 img").hover(function(){$(".login h2 img").attr("src","images/reg2.gif")}, function(){$(".login h2 img").attr("src","images/reg1.gif")})			   
})

var getNotifying = false;
var notify_num = 12;
function getNotify() {
    if (notify_num < 1)
        return;
    if (getNotifying)
        return;
    notify_num--;
    getNotifying = true;
    $.get("/ajax.aspx", { _action: "getMsgNotify", ran: new Date() },
    function(data) {
        getNotifying = false;
        if (data == undefined || data == null || data == "") {
            $("#msgCount").text("");
            return;
        }
        var msgCount = parseInt(data);
        if (msgCount > 0)
            $("#msgCount").text("[" + msgCount + "]");
        else
            $("#msgCount").text("");
           
    });

}

$(document).ready(function() {
    $(document).keypress(function() {
        if (notify_num == 0) {
            notify_num = 12;
        }
    });
    $(document).mousemove(function() {
        if (notify_num == 0) {
            notify_num = 12;
        }
    });
});
