
var HOMEPAGE="/index.html";
var defDatePattern='MM/dd/yyyy';
var __ctxPath = "";
var __mediaPath = "/media/";
var __defaultImage = "/images/default/00.jpg";
var __defaultCurrencySymbol = "US$";
var __defDatePattern='MM/dd/yyyy';
var __vaMsg = {
	notPass:"Invalid input, Please check it again.",
	required:"This field is required.",
	number:"must be number.",
	integer:"must non negative integar.",
	short:"Please enter a integar no greater than 32767.",
	double:"must be Integar or Decimal.",
	long:"must be of type Long.",
	maxValue:"Value must be less than:",
	minValue:"Value must be greater than:",
	maxlength:"Length must be less than:",
	minlength:"Length must be greater than:",
	price:"Invalid Amount!",
	money:"Invalid Amount! Please enter in the format of XX.XX",
	code:"Invalid Code. Only combination of letters, digits, _ and - is accepted.",
	phone:"Invalid phone number. Please enter phone number with 6-8 digits.",
	mobile:"Invalid mobile no.! 9 to 11 digits required!",
	email:"Invalid Email Address.",
	positiveInteger:"must be positive integar which is greater than 1.",
	double4:"Invalid format! Please enter integar or decimal.",
	noHtml:"HTML not supported.",
	radio:"Please at least select one.",
	url:"Invalid URL.",
	date:"???validate.date???",
	bill_n:"This system doesn't provide invoices.",
	wrap_n:"We provide FREE gift packing for all orders!",
	gcno_null:"Please enter a valid Gift certificate Code"
};

var __FMT = {
	customer_account:"My Account",
	customer_login:"Login",
	customer_logout:"Logout",
	customer_signup:"Sign Up",
	customer_username_isRequired:"Please enter a valid username.",
	customer_password_isRequired:"Please enter your password.",
	customer_login_fail:"Sorry, there is no match for that email address and/or password.",
	loginConfirm:"You need to login before proceed, would you like to login now?",
    minicart_addToCartSuccess:"Shopping Cart updated!",
    minicart_unit:"item(s)",
    minicart_id_cookie:"shoppingcartInCookie",
    minicart_totalprice_cookie:"cartTotalPrice",
    c_itemcount_cookie:"cartitemNo",
    f_itemcount_cookie:"favoriteitemNo",
    cannotMoveToC:"NOINVENTORY",
    noMoreInvetory:"NOMOREINVENTORY",
    update_stockNotEnough:"Can't update, because of out of stock.",
    update_noMoreInventory:"Out of stock",
    favorite_:"Favorite",
    notAnonymousF:"Sorry! Please login first.",
    couponNull:"Please enter a valid Coupon Code.",
    
    gc_INVALID_v:"0",
    gc_UNACTIVE_v:"-1",
    gc_UNDEAL_v:"-2",
    gc_EXPIRE_v:"-3",
    gc_NOT_ENOUGH_v:"-4",
    gc_AVAILABLE_v:"1",
    gc_MONEYNULL_v:"-5",
    
    gc_INVALID:"This is not Gift Certificate code",
    gc_UNACTIVE:"Gift Certificate is inactive",
    gc_UNDEAL:"Invalid Gift Certificate No.",
    gc_EXPIRE:"Gift Certificate is expire",
    gc_NOT_ENOUGH:"Gift Certificate is out of money",
    gc_MONEYNULL:"Gift Certificate is out of money",
    
    gc_used:"This Gift Certificate has already been used.",
    
    checkou_conplictSorry:"Sorry, the order can not be shipped to your address for following reason(s):",
    checkou_noship:"Sorry,we couldn't ship the items to this country.",
    checkou_bill_n:"No invoice",
    checkou_wrap_y:"I want",
    checkou_wrap_n:"No thanks",
    checkou_error:"We have some problem with network, this order is failed. Try again please.",
    button_clear:"Clear",
    button_close:"Close",
    button_select:"Select",
    productReview_subject_maxlength:"Title can be no longer than 128 characters!",
    productReview_subject_required:"Sorry, Review Title is required.",
    productReview_message_maxlength:"Your Review Content can be no longer than 1024 characters!",
    productReview_message_required:"Sorry, Review Content is required",
    productReview_username_required:"Sorry, Your Name is required.",
    productReview_voteSuccess:"Thanks for the valuable feedback you provided to other reviewers. Your vote will be counted and will appear on the product page soon.",
    productReview_isVoted:"You have already voted on this review.",
    productReview_isSelfReview:"Sorry but you can not vote on your own review.",
    first_login:"Login",
    image_btn_addtocart_on:"/images/btn/btn_add_to_cart.gif",
    image_btn_addtocart_preOrder:"/images/btn/btn_add_to_cart_preOrder.gif",
    image_btn_addtocart_backOrder:"/images/btn/btn_add_to_cart_backOrder.gif",
    image_btn_addtocart_off:"/images/btn/btn_add_to_cart_off.gif",
    productDetail_inventory_outof_stock:"Out of stock",
    productDetail_inventory_outof_stock_will_ship:"Not available now, but we will restock on {0}",
    productDetail_inventory_preOrder:"Preorder, it will be available on {0}",
    productDetail_inventory_backOrder:"Backorder, it will be available on {0}",
    productDetail_inventory_will_ship:"Preorder, it will be available soon.",
    productDetail_wholesalePrices:"Whole",
    addressDelete:"Are you sure deleting this shipping address?",
    orderQueryTimeNull:"Query condition time is null",
    select:"select...",
    unselected:"Unselected",
    button_uploadFile:"上传文件"
    
};
if(!eCom){var eCom=new Object();}function $(el){if(arguments.length>1){for(var i=0,els=[],length=arguments.length;i<length;i++){els.push($(arguments[i]));}return els;}if(typeof el=="string"){el=document.getElementById(el);}if((typeof Prototype=="undefined")||(typeof Element=="undefined")||(typeof Element.Methods=="undefined")){return el;
}else{return Element.extend(el);}}function addClass(el,className){removeClass(el,className);$(el).className+=" "+className;}function removeClass(el,className){var regex=new RegExp("(^|\\s)"+className+"(\\s|$)","g");$(el).className=$(el).className.replace(regex,"");}function fnSetStyle(el,reomveClassName,addClassName){removeClass(el,reomveClassName);
addClass(el,addClassName);}String.prototype.trim=function(){return this.replace(/(^\s*)|(\s*$)/g,"");};function trim(str){return str==null?null:str.trim();}function fnAppendUrl(url,paramName,paramValue){if(!url||!paramName||!paramValue){return url;}var tmpUrl=removeParamFromUrl(url,paramName);return tmpUrl+(tmpUrl.indexOf("?")>-1?"&":"?")+paramName+"="+paramValue;
}function removeParamFromUrl(url,paramName){return url.replace(new RegExp("("+paramName+"=[^&]*[&])|([?|&]"+paramName+"=[^&]*$)"),"");}function getEvent(){if(document.all){return window.event;}var func=getEvent.caller;while(func!=null){var arg0=func.arguments[0];if(arg0){if((arg0.constructor==Event||arg0.constructor==MouseEvent)||(typeof(arg0)=="object"&&arg0.preventDefault&&arg0.stopPropagation)){return arg0;
}}func=func.caller;}return null;}function getEventSourceObject(){var evt=getEvent();return evt.srcElement||evt.target;}function _defaultAjaxErrorHandler(errMsg,xhr){alert(errMsg);}function log(sMsg){typeof console=="undefined"?alert(sMsg):console.log(sMsg);}function setCookie(name,value,expires,path,domain,secure){document.cookie=name+"="+escape(value)+((expires)?"; expires="+expires.toGMTString():"")+((path)?"; path="+path:"")+((domain)?"; domain="+domain:"")+((secure)?"; secure":"");
}function getCookie(name){var prefix=name+"=";var start=document.cookie.indexOf(prefix);if(start==-1){return null;}start+=prefix.length;var end=document.cookie.indexOf(";",start);if(end==-1){end=document.cookie.length;}var cookieValue=document.cookie.substring(start,end);if(cookieValue){cookieValue=cookieValue.replace(/"/g,"");
}return unescape(cookieValue);}function fnResizeImage(oImg,reqWidth,reqHeight){if(reqWidth>=oImg.width&&reqHeight>=oImg.height){return;}if((oImg.width/oImg.height)>(reqWidth/reqHeight)){oImg.width=reqWidth;}else{oImg.height=reqHeight;}}function getCurrentUserId(){return getCookie("UID")||-2;}function isLogined(){return getCurrentUserId()>0;
}function getCurrentUserName(loginRequired){return(!loginRequired||isLogined())&&getCookie("UNAME")||"";}function getLoginUserEmail(loginRequired){return(!loginRequired||isLogined())&&getCookie("UEMAIL")||"";}var bCancel=false;function isIE(){return(navigator.userAgent.toLowerCase().indexOf("msie")!=-1);
}var onloadHandlers=[];function addOnload(handler){if(handler){onloadHandlers.push(handler);}}$j(document).ready(function(){for(var i=0;i<onloadHandlers.length;++i){onloadHandlers[i].call(this);}});function fillLoginPrompt(){var _str="";if(!isLogined()){_str=_str+'Welcome! <a href="'+__ctxPath+'/myaccount/account.html" class="red">Sign in</a> or <a href="'+__ctxPath+'/signup.html" class="green">Register</a>';
}else{_str=_str+'Hello, <a href="'+__ctxPath+'/myaccount/account.html" class="red">'+getCookie("UNAME")+"</a>!&nbsp;&nbsp;";_str=_str+'(<a href="'+__ctxPath+'/j_acegi_logout">Not '+getCookie("UNAME")+"</a>?)";}if($("loginPromptHolder")!=undefined&&$("loginPromptHolder")!=null){$("loginPromptHolder").innerHTML=_str;
}}function fnSelectTab(selectTabNumber,$tabFlag){var tab_flag="tab_";if($tabFlag){tab_flag=$tabFlag;}var tab_count=10;for(var d=1;d<=tab_count;d++){var head=$(tab_flag+"head_"+d);var content=$j("#"+tab_flag+"content_"+d);if(head!=null){if(d==selectTabNumber){addClass(head,"selected");content.show();}else{removeClass(head,"selected");
content.hide();}}}}var _eComDialogs=new Array();var currentDialog=null;var _dialogZIndex=10000;var dialogIdPrefix="divDlg";eCom.SimpleDialog=function(config){var dialogId=config.dialogId;var showTime=0;var dlgModalDom=document.createElement("div");dlgModalDom.id=dialogIdPrefix+dialogId;dlgModalDom.style.display="none";
dlgModalDom.className="dragwrap";var dlgParentDom=config.parentDom||document.body;dlgParentDom.appendChild(dlgModalDom);dlgModalDom.innerHTML=_getDlgBoxHtml(dialogId,config.dialogTitle);var divContentDom=$("_dlgContBox"+dialogId);var dialogContent=config.dialogContent;if(typeof dialogContent=="string"&&dialogContent.trim().length>=0){divContentDom.innerHTML=dialogContent;
}else{if(dialogContent!==null){divContentDom.appendChild(dialogContent);}}var staticDialogUrl=config.staticDialogUrl;var cacheEnabled=config.cacheEnabled||true;var onshowHandler=config.onshowHandler;var _savedOnshowHandler=null;var fillContentDivId=config.fillContentDivId||divContentDom;var savedDialogPageUrl=null;
var _fnOnshowHandlerProxy=function(){if(_savedOnshowHandler){if(typeof _savedOnshowHandler=="function"){_savedOnshowHandler.call(this);}else{eval(_savedOnshowHandler+"()");}}dlgModalDom.style.left=config.left||Math.round(((parseInt(document.documentElement.clientWidth||document.body.clientwidth)-parseInt($j(dlgModalDom).width()))/2))+"px";
dlgModalDom.style.top=config.top||Math.round(((parseInt(document.documentElement.clientHeight||document.body.clientHeight)-parseInt($j(dlgModalDom).height())-40)/2)+(document.documentElement.scrollTop||document.body.scrollTop))+"px";dlgModalDom.style.zIndex=_dialogZIndex+=10;dlgModalDom.style.display="block";
currentDialog=this;};return{showDialog:function(dynamicPageUrl,dynamicOnshowHandler){_savedOnshowHandler=dynamicOnshowHandler||onshowHandler;var _dialogPageUrl=dynamicPageUrl||staticDialogUrl;if(_dialogPageUrl&&(!cacheEnabled||_dialogPageUrl!=savedDialogPageUrl)){savedDialogPageUrl=_dialogPageUrl;_dialogPageUrl=fnAppendUrl(_dialogPageUrl,"inDialog","true");
fillDivWithPage(fillContentDivId,_dialogPageUrl,null,_fnOnshowHandlerProxy,"GET",true);}else{_fnOnshowHandlerProxy();}toggleBtn();showTime=new Date().valueOf();},closeDialog:function(){dlgModalDom.style.display="none";currentDialog=null;},getDialogId:function(){return dialogId;},getShowTime:function(){return showTime;
}};};function getSimpleDialog(dialogId){for(i=0;i<_eComDialogs.length;i++){if(_eComDialogs[i].getDialogId()==dialogId){return _eComDialogs[i];}}return null;}function _getDlgBoxHtml(dialogId,dialogTitle){return['<div class="dragtop"><div class="left">',dialogTitle,'</div><div class="right"><a href="javascript:void(0);" onclick="closeSimpleDialog(\'',dialogId,"');return false;\">close</a></div></div>",'<div class="dragcontent" id="_dlgContBox',dialogId,'"></div><div class="dragbottom"></div>'].join("");
}function fnCreateSimpleDialog(dialogId,dialogTitle,dialogContent,config){var _dlg=getSimpleDialog(dialogId);if(!_dlg){config.dialogId=dialogId;config.dialogTitle=dialogTitle;config.dialogContent=dialogContent;_dlg=new eCom.SimpleDialog(config);_eComDialogs.push(_dlg);}return _dlg;}function showSimpleDialog(dialogId){var _dlg=getSimpleDialog(dialogId);
if(_dlg){_dlg.showDialog();}}function closeSimpleDialog(dialogId){var _dlg=getSimpleDialog(dialogId);if(_dlg){_dlg.closeDialog();}}function evenCloseSimpleDialog(event){var target=event.originalTarget||event.srcElement;for(i=0;i<_eComDialogs.length;i++){if($j(target).parents("[id="+dialogIdPrefix+_eComDialogs[i].getDialogId()+"]").length==0){if(new Date().valueOf()-_eComDialogs[i].getShowTime()>100){_eComDialogs[i].closeDialog();
}}}}$j(document).click(function(event){event=event||window.event;evenCloseSimpleDialog(event);});function _ajaxReadyStateHandler(xhr,sUrl,ajaxCallback,ajaxErrorCallbackHandler){var readyState=xhr.readyState;if(readyState==4){var httpStatus=xhr.status;if(httpStatus>=200&&httpStatus<300){ajaxCallback.call(this,xhr.responseText);
}else{var errMsg="ERROR request: "+sUrl+"\n\nReadyState: "+readyState+"\nStatus: "+httpStatus+"\nHeaders: "+xhr.getAllResponseHeaders();var _ajaxErrorHandler=ajaxErrorCallbackHandler||_defaultAjaxErrorHandler;_ajaxErrorHandler.call(this,errMsg,xhr);}}}function ajaxCall(prmUrl,prms,postOrGet,async,ajaxCallback,ajaxErrorCallbackHandler){var xhr=null;
if(window.ActiveXObject){xhr=new ActiveXObject("Msxml2.XMLHTTP");}else{if(window.XMLHttpRequest){xhr=new XMLHttpRequest();}}if(xhr==null){return alert("XMLHttpRequest is not supported!");}var sUrl=prmUrl;if((prms&&prms.length>0)&&(postOrGet!="POST")){sUrl+=(sUrl.match(/\?/)?"&":"?")+prms;}var _async=async==null?true:async;
if(_async){xhr.onreadystatechange=function(){_ajaxReadyStateHandler(xhr,sUrl,ajaxCallback,ajaxErrorCallbackHandler);};}xhr.open(postOrGet,sUrl,_async);if(postOrGet=="POST"){xhr.setRequestHeader("Content-type","application/x-www-form-urlencoded");xhr.send(prms);}else{xhr.send(null);}if(!_async){_ajaxReadyStateHandler(xhr,sUrl,ajaxCallback,ajaxErrorCallbackHandler);
}}function fillDivWithPage(prmDivId,prmUrl,prms,fillCallback,postOrGet,async){if(prms==null||prms==""){postOrGet="GET";}ajaxCall(prmUrl,prms,postOrGet||"POST",async,function(responseText){var target=$(prmDivId);if(document.createRange){var rng=document.createRange();rng.setStartBefore(target);var htmlFrag=rng.createContextualFragment(responseText);
while(target.hasChildNodes()){target.removeChild(target.lastChild);}target.appendChild(htmlFrag);}else{target.innerHTML=responseText;}if(fillCallback){fillCallback.call(this);}});}function _isLoaded(url){var ss=document.getElementsByTagName(url.toLowerCase().lastIndexOf(".css")>0?"link":"script");for(i=0;
i<ss.length;i++){var _url=ss.href||ss[i].src||ss[i].syncUrl;if(_url&&_url.indexOf(url)!=-1){return true;}}return false;}function $importSync(url,defer){if(_isLoaded(url)){return;}ajaxCall(url.indexOf(__ctxPath)==0?url:(__ctxPath+url),null,"GET",false,function(responseText){if(responseText!=null){var oHead=document.getElementsByTagName("head")[0];
var oScript=document.createElement("script");oScript.type="text/javascript";oScript.defer=defer||true;oScript.text=responseText;oScript.syncUrl=url;oHead.appendChild(oScript);}},function(){alert("Failed to load script: "+url);});}function JsCssLoader(){this.load=function(url){if(_isLoaded(url)){this.onsuccess();
return;}if(url.toLowerCase().lastIndexOf(".css")>0){var s=document.createElement("link");s.setAttribute("rel","stylesheet");s.setAttribute("type","text/css");s.setAttribute("href",url);}else{var s=document.createElement("script");s.type="text/javascript";s.src=url;}var head=document.getElementsByTagName("head")[0];
head.appendChild(s);var self=this;s.onload=s.onreadystatechange=function(){if(s.readyState&&s.readyState=="loading"){return;}self.onsuccess(url);};s.onerror=function(){head.removeChild(s);self.onfailure(url,arguments);};};this.onsuccess=function(url){};this.onfailure=function(url,args){alert("Error loading JavaScript/StyleSheet: "+args[0]+" -- "+args[1]+" -- "+args[2]);
};}function $import(urls,callback){if(!(urls instanceof Array)){alert("Invalid $import call syntax, must be array.");return;}var _loader=new JsCssLoader();if(urls.length>1){_loader.onsuccess=function(){$import(urls.slice(1,urls.length),callback);};}else{if(callback){_loader.onsuccess=callback;}}_loader.load(urls[0].indexOf(__ctxPath)==0?urls[0]:(__ctxPath+urls[0]));
}function $importDwr(callback){$import(["/scripts/dwr/engine.js","/scripts/dwr/util.js"],callback);}function getJSON(url,param,callback){ajaxCall(url.indexOf(__ctxPath)==0?url:(__ctxPath+url),param,"GET",false,function(responseText){callback.call(this,eval("("+responseText+")"));},function(){alert("Failed to get JSON: "+url);
});}function fnValidateEmail(obj){var str=obj.value;var patn=/[a-z0-9!#$%&'*+\/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+\/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?/i;if(patn.test(str)){return true;}else{return false;}}function fnHidePop(e,id){e=e||window.event;o=e.relatedTarget||e.toElement;
if(o==null){return;}while(o.parentNode&&o.id!=id){o=o.parentNode;}if(o.id!=id){$(id).style.display="none";}}function fnCheckSearchForm($frm){if($frm.q.value==""){alert("Please submit the keyword!");$frm.q.focus();return false;}return true;}(function($){var methods={marquee:function marquee(user_settings){var self=$(this);
var sch=self.attr("scrollHeight");self.append(self.html());var settings={timeout:null,events:{play:function(evt){var self=$(this);var sct=self.scrollTop();if(sct>=sch){self.scrollTop(sct=sct-sch);}self.animate({scrollTop:sct+settings.step-sct%settings.step},2000,function(){if(settings.timeout){clearTimeout(settings.timeout);
}settings.timeout=setTimeout(function(){self.marqueePlay();},settings.time);});},stop:function(evt){var self=$(this);clearTimeout(settings.timeout);self.stop();}}};if(self.data("marquee.settings")){settings=self.data("marquee.settings");}settings=$.extend(user_settings,settings);for(var event in settings.events){var evt="marquee."+event;
self.unbind(evt);self.bind(evt,settings.events[event]);}self.data("marquee.settings",settings);self.marqueePlay();return self;},marqueePlay:function(){$(this).trigger("marquee.play");},marqueeStop:function(){$(this).trigger("marquee.stop");}};$.each(methods,function(i){$.fn[i]=this;});})(jQuery);var addthis_url=location.href;
var addthis_title=document.title;var addthis_pub="maxoffer";function at12Y(){var CSSPagePath="";addthis_url=encodeURIComponent(addthis_url);addthis_title=encodeURIComponent(addthis_title);addthis_title=addthis_title.replace(/'/g,"\\'");var at12y='<a href="'+at12I("")+'" onclick="return addthis_to();"></a>';
$j("#bookMarkImg").wrap(at12y);}function at12I(at12r){return"http://www.addthis.com/bookmark.php?v=12&winname=addthis&pub="+addthis_pub+"&s="+at12r+"&url="+addthis_url+"&title="+addthis_title;}function addthis_to(at12r){if(at12r=="favorites"){addthis_url=decodeURIComponent(addthis_url);addthis_title=decodeURIComponent(addthis_title);
if(document.all){window.external.AddFavorite(addthis_url,addthis_title);}else{window.sidebar.addPanel(addthis_title,addthis_url,"");}return false;}window.open(at12I(at12r),"addthis","scrollbars=yes,menubar=no,width=620,height=400,resizable=yes,toolbar=no,location=no,status=no");return false;}$j(document).ready(function(){toggleBtn();
at12Y();});function toggleBtn(){$j("button[class*='toggle']").hover(function(){var btn=$j(this);if(!_breakWitch(btn)){btn.addClass("on");}},function(){var btn=$j(this);if(!_breakWitch(btn)){btn.removeClass("on");}});}function _breakWitch(btn){return btn.hasClass("loading")||btn.hasClass("stock")||btn.hasClass("no-addtocart");
}
var ShoppingcartManager=function(){};ShoppingcartManager.addToC=function(skuCode,pSkuCodes,quantity,accessories){this.$add(skuCode,pSkuCodes,quantity,1,accessories);};ShoppingcartManager.addToF=function(skuCode,pSkuCodes,quantity){this.$add(skuCode,pSkuCodes,quantity,0);};ShoppingcartManager.submitCart=function(){$("cart_form").submit();
};ShoppingcartManager.$add=function(skuCode,pSkuCodes,quantity,type,accessories){if(!accessories){accessories="";}if($cm.isBusy){return;}else{$cm.isBusy=true;setTimeout("$cm.isBusy=false",1000);}var obj=getEventSourceObject();if(type==0){if(pSkuCodes==null||pSkuCodes.length==0){ajaxCall(__ctxPath+"/cart/shoppingcart.html","doAction=addProductToFavorite&productsku="+skuCode+"&quantity="+quantity+"&accessoryIds="+accessories,"POST",true,function(data){if(data=="ok"){ShoppingcartManager.alert(skuCode,0,obj);
}else{alert(__FMT.notAnonymousF);}});}else{ajaxCall(__ctxPath+"/cart/shoppingcart.html","doAction=addMultiProductToCart&productsku="+skuCode+"&quantity="+quantity+"&accessoryIds="+accessories+"&childrenskus="+pSkuCodes+"&isSaved=true","POST",true,function(data){if(data=="ok"){ShoppingcartManager.alert(skuCode,0,obj);
}else{alert(__FMT.notAnonymousF);}});}}else{if(type==1){$j(obj).removeClass("addtocart-on").addClass("loading");if(pSkuCodes==null||pSkuCodes.length==0){ajaxCall(__ctxPath+"/cart/shoppingcart.html","doAction=addProductToCart&productsku="+skuCode+"&quantity="+quantity+"&accessoryIds="+accessories,"POST",true,function(data){var jdata=eval("("+data+")");
var adata=jdata.message.split(":");if(adata[0]==__FMT.cannotMoveToC){alert(adata[1]+__FMT.update_stockNotEnough);}else{if(adata[0]==__FMT.noMoreInvetory){alert(adata[1]+__FMT.update_noMoreInventory);}else{ShoppingcartManager.alert(skuCode,1,obj,jdata);}}$j(obj).removeClass("loading").addClass("addtocart-on");
});}else{ajaxCall(__ctxPath+"/cart/shoppingcart.html","doAction=addMultiProductToCart&productsku="+skuCode+"&quantity="+quantity+"&accessoryIds="+accessories+"&childrenskus="+pSkuCodes,"POST",true,function(data){data=data.split(":");if(data[0]==__FMT.cannotMoveToC){alert(data[1]+__FMT.update_stockNotEnough);
}else{if(data[0]==__FMT.noMoreInvetory){alert(data[1]+__FMT.update_noMoreInventory);}else{ShoppingcartManager.alert(skuCode,1,obj);}}$j(obj).removeClass("loading").addClass("addtocart-on");});}}}};ShoppingcartManager.updateCartItem=function(){$("doAction").value="updateShoppingcartItem";ShoppingcartManager.submitCart();
};ShoppingcartManager.moveToC=function(itemId){$("selected_itemId").value=itemId;$("doAction").value="moveFavoriteItemToCart";ShoppingcartManager.submitCart();};ShoppingcartManager.moveToF=function(itemId){$("selected_itemId").value=itemId;$("doAction").value="moveCartItemToFavorite";ShoppingcartManager.submitCart();
};ShoppingcartManager.deleteItem=function(itemId){$("selected_itemId").value=itemId;$("doAction").value="deleteItem";ShoppingcartManager.submitCart();};ShoppingcartManager.clearC=function(){$("doAction").value="clearShoppingcart";ShoppingcartManager.submitCart();};ShoppingcartManager.clearF=function(){$("doAction").value="clearFavorite";
ShoppingcartManager.submitCart();};ShoppingcartManager.useCoupon=function(){if($("couponNo_input_id").value==""){alert(__FMT.couponNull);return false;}else{$("doAction").value="useCoupon";ShoppingcartManager.submitCart();}};ShoppingcartManager.notUseCoupon=function(){$("doAction").value="notuseCoupon";
ShoppingcartManager.submitCart();};ShoppingcartManager.alert=function(skucode,type,$obj,addToCartResult){var popuw=function(skucode,type){this.skucode=skucode;this.type=type;this.$obj=$obj;};popuw.prototype={id:"shoppingcartAlertWId_",skucode:"",type:1,messageDlgZIndex:1000,$obj:"",html:"<h2>"+addToCartResult.lastAddToCartItemQty+" item(s) added to your cart</h2>"+'<div class="left">'+'<div class="wrap-line">'+'<div class="photo">'+'<img src="'+__ctxPath+"/media/product/c/"+addToCartResult.lastAddToCartItemImage+'" width="130" height="130" alt="" onerror="$j(this).attr(\'originsrc\',this.src).attr(\'src\',__defaultImage).removeAttr(\'onerror\');" originsrc=""/>'+"</div>"+'<div class="txt">'+addToCartResult.lastAddToCartItemName+'<div class="blank10"></div>'+'<strong class="red f13px">'+__defaultCurrencySymbol+addToCartResult.lastAddToCartItemPrice+"</strong><br/>"+'<strong class="f13px">Quantity:'+addToCartResult.lastAddToCartItemQty+"</strong>"+"</div>"+"</div>"+"</div>"+'<div class="right">'+"<h2>Cart summary</h2>"+"Items in cart: "+addToCartResult.cartItemQty+"<br/>"+'Subtotal: <strong class="red f13px">'+__defaultCurrencySymbol+addToCartResult.total+"</strong>"+'<div class="blank10"></div>'+'<div class="out"><button class="toggle1 checkout" title="login" type="submit" value="" onclick="window.location.href=\''+__ctxPath+"/cart/shoppingcart.html'\"></button></div>"+'<div class="shop"><button class="toggle1 shopping" title="login" type="submit" value="" onclick="closeSimpleDialog(\'shoppingcartAlertWId_\');"></button></div>'+"</div>",show:function(){if(this.type==1){}else{this.html=this.html.replace("?Icount?",getCookie(__FMT.f_itemcount_cookie));
this.html=this.html.replace("?type?",__FMT.favorite_);}var cartDlg=fnCreateSimpleDialog(this.id,"","",{});$("_dlgContBox"+this.id).innerHTML=this.html;cartDlg.showDialog();if($mnc){$mnc.refresh();}}};var win=new popuw(skucode,type);win.show();};ShoppingcartManager.minicart=function(){};ShoppingcartManager.minicart.prototype={div:"minicartDiv",refresh:function(){var d=$(this.div);
if(d!=null){var itemcount=getCookie(__FMT.c_itemcount_cookie);itemcount=itemcount==null?"0":itemcount;var subtotal=getCookie(__FMT.minicart_totalprice_cookie);subtotal=subtotal==null?__defaultCurrencySymbol+"0.00":__defaultCurrencySymbol+subtotal;$(this.div).innerHTML=itemcount+" Item(s)"+"&nbsp;&nbsp;"+subtotal;
}}};var $mnc=new ShoppingcartManager.minicart();addOnload(function(){$mnc=new ShoppingcartManager.minicart();$mnc.refresh();});$cm=ShoppingcartManager;function moveCartBtn(b){if(!($j(b).hasClass("loading")||$j(b).hasClass("stock")||$j(b).hasClass("no-addtocart"))){if($j(b).hasClass("addtocart-on")){$j(b).removeClass("addtocart-on");
}else{$j(b).addClass("addtocart-on");}}}