if (document.location.href.indexOf('/MeOrderInfo/') == -1) {
if (typeof(window.localStorage['CartList'])!='undefined')
if (window.localStorage['CartList']!='')
if (typeof(window.sessionStorage['isCartList'])=='undefined' || window.sessionStorage['isCartList']!='1') {
iAJAX.iPost_('/main/modules/MeOrderInfo/addShopCart.php?sn='+sn, window.localStorage['CartList'], function(json){
json = iAJAX.evalJson_(json); if (!json) return;
window.sessionStorage['isCartList'] = '1';
addShopCartProc_(json);
});
}
}
var div = $('#idShopCartNum,.idShopCartNum');
if (typeof(inc_msg_ShopCartNum_js_343053) == "string")
div = $(inc_msg_ShopCartNum_js_343053);
div.html("0");
$('body').attr('PrdQtyM', 0);
$('body').attr('PrdQtyN', 0);
var addShopCartOpenningD;
var timeCartClose;
var jCart;
var addShopCartAy = new Array(), toAddShopCart;
$('body').append("
");
$('body').append("");
$('body').append("");
window.addShopCart_ = function (s) { // function begin
var xy;
xy = (typeof(s)=='object') ? $(s).offset() : $('#idShopCartNum').offset();
var scrollTop = (document.all) ? document.documentElement.scrollTop : window.pageYOffset;
var CartPopup = document.getElementById("divCartLoading");
var cLeft = (xy.left<100) ? 0 : xy.left-100;
var cTop = (xy.top+30>scrollTop) ? xy.top+30 : scrollTop;
if (cLeft+250 > $(window).width()) cLeft = $(window).width()-250;
CartPopup.style.left = cLeft+"px";
CartPopup.style.top = cTop+"px";
// iAJAX.divLoading_('divCartLoading', 1, '');
// iAJAX.loading_(1);
if (typeof(s)!='string') s = '';
addShopCartAy.push(s);
if (typeof(toAddShopCart)!='undefined') clearTimeout(toAddShopCart);
toAddShopCart = setTimeout('addShopCartGet_()', 200);
} // function end
window.addShopCartGet_ = function() { // function begin
if (typeof(toAddShopCart)!='undefined') { clearTimeout(toAddShopCart); toAddShopCart = null; }
var s = addShopCartAy.pop();
if (s)
iAJAX.iGet_("/main/modules/MeOrderInfo/addShopCart.php?sn="+sn+"&"+s, addShopCartProc_);
else
iAJAX.iGet_("/main/modules/MeOrderInfo/addShopCart.php?sn="+sn, addShopCartProc_);
} // function end
window.addShopCartProc_ = function (json) { // function begin
if (addShopCartAy.length) { addShopCartGet_(); return; }
// iAJAX.divLoading_("divCartLoading", 0);
// iAJAX.loading_(0);
if (typeof(json)=='string') {
json = iAJAX.evalJson_(json); if (!json) return;
}
jCart = json;
//
if (typeof(json.CartList)=='undefined')
window.localStorage['CartList'] = '';
else
window.localStorage['CartList'] = json.CartList;
//
var div = $('#idShopCartNum,.idShopCartNum'); var num = 0;
if (typeof(jCart)!='undefined') num = jCart.prdtotalqty; //num = jCart.prdlist.length;
div.html(""+num+"");
if (num) { $('#divCartGo').show(); } else { $('#divCartGo').hide(); }
$('body').attr('PrdQty', num);
var xy = $('#idShopCartNum').offset();
var scrollTop = (document.all) ? document.documentElement.scrollTop : window.pageYOffset;
var CartPopup = document.getElementById("divCartPopup");
var cLeft = (xy.left<100) ? 0 : xy.left-100;
var cTop = (xy.top+30>scrollTop) ? xy.top+30 : scrollTop;
if (cLeft+250 > $(window).width()) cLeft = $(window).width()-250;
CartPopup.style.left = cLeft+"px";
CartPopup.style.top = cTop+"px";
var s = new Array();
s[s.length] = "";
CartPopup.innerHTML = s.join("");
CartPopup.style.height = "0px";
CartPopup.style.display = "";
addShopCartOpenningD = 0; setTimeout("addShopCartOpenning_(0)", 1);
timeCartClose = setTimeout("addShopCartClose_()", 5000);
} // function end
window.addShopCartOpenning_ = function (h) { // function begin
var CartPopup = document.getElementById("divCartPopup");
CartPopup.style.height = h+"px";
addShopCartOpenningD += 2;
if (h <= 400) setTimeout("addShopCartOpenning_("+(h+addShopCartOpenningD)+")", 1);
} // function end
window.addShopCartClose_ = function () { // function begin
var CartPopup = document.getElementById("divCartPopup");
addShopCartOpenningD = 10; setTimeout("addShopCartClosing_("+CartPopup.style.height.replace("px", "")+")", 1);
} // function end
window.addShopCartClosing_ = function (h) { // function begin
var CartPopup = document.getElementById("divCartPopup");
CartPopup.style.height = h+"px";
if (h > 0) setTimeout("addShopCartClosing_("+(h-addShopCartOpenningD)+")", 1); else CartPopup.style.display = "none";
} // function end
window.addShopCartSubmit_ = function () { // function begin
document.location.href = wdbROOT_URL+'/modules/MeOrderInfo/index.php?sn='+sn;
} // function end
window.ShopCartNumQty_ = function (n) { // function begin
if (typeof(n)=='undefined') n = 0;
if (n==0 || n=='' || n=='0')
top.$('.ShopCartNumQty').html(0);
else
top.$('.ShopCartNumQty').html(n).fadeIn();
} // function end