function alertUI2(msg) {
    var countdown = 2;
    alertUI(msg, countdown)
}

function alertUI(msg, countdown) {
    if (countdown < 1) {
        countdown = 2;
    }
    $.blockUI({ message: msg });
    var interval = setInterval(function () {
        if (--countdown <= 0) {
            $.unblockUI();
            clearInterval(interval);
        } else {
            // $.blockUI({ message: msg });
        }
    }, 1000);
}
function showOnline() {
    window.open("/service-online.aspx", "", "scrollbars=no, width=200, height=400, top=10, left=20");
}
//¼ÇÂ¼ÍøÕ¾À´Ô´
var fromSiteUrl = document.referrer;
try {
    if (fromSiteUrl.indexOf("worldofsportwatch.com") <= 0) {
        $.cookie('fromSiteUrl', fromSiteUrl, { path: '/' });
    }
} catch (e) {

}


function valideInput() {
    var objArg = arguments[0];
    var msg = arguments[1];
    var color1 = arguments[2];
    var color2 = arguments[3];
    objArg.focus(function () {
        if (this.value == msg) {
            this.value = "";
            $(this).css("color", color1);
        }
    }).blur(function () {
        if (this.value == '') {
            this.value = msg;
            $(this).css("color", color2);
        }
    });
}

$(document).ready(function () {
    $("p.time").MallbTimes(1000, PromotionUpdate);
});


function PromotionUpdate(id) {
    var rand = genRandNumber(0, 10000);
    jQuery.getJSON("/SetCart.aspx?action=getpromotionprice&jsoncallback=?",
                     { "id": id, "rond": rand },
                        function (data) {
                            if (data.id == 1) {
                                $("#promotion_" + id).html(data.items);
                            }
                        });
} 
