/* 检查新订单的时间间隔 */
var NEW_ORDER_INTERVAL = 180000;
/* *
* 开始检查新订单;
*/
function startCheckOrder()
{
checkOrder()
window.setInterval("checkOrder()", NEW_ORDER_INTERVAL);
}
/*
* 检查订单
*/
function checkOrder()
{
var lastCheckOrder = new Date(document.getCookie('ECS_LastCheckOrder'));
var today = new Date();
if (lastCheckOrder == null || today-lastCheckOrder >= NEW_ORDER_INTERVAL)
{
document.setCookie('ECS_LastCheckOrder', today.toGMTString());
try
{
Ajax.call('index.php?is_ajax=1&act=check_order','', checkOrderResponse, 'GET', 'JSON');
}
catch (e) { }
}
}