var quantityElem={create:function(b,a){b=b||1;cartItem.currentValue=b;a=a||{};this.width=a.width||30;this.height=a.height||24;this.arrowSize=a.arrowSize||20;this.border=a.border||1;this.borderColor=a.borderColor||"#ccc";this.color=a.color||"#ccc";this.innerColor=a.innerColor||"#fff";this.textColor=a.textColor||"#000";this.callback=a.callback;return"<div style='padding: 0px; width:"+(1*this.width+2*this.arrowSize)+"px; height:"+this.height+"px; background:"+this.innerColor+"; color:"+this.textColor+
"; border:"+this.border+"px solid "+this.borderColor+"; text-align: left; position: relative;'><div onclick='quantityElem.onDecrement(event,this);' style='width:"+this.arrowSize+"px; height:"+this.height+"px; background: url(./style/decrement.png) "+(this.arrowSize-16)/2+"px "+(this.height-16)/2+"px no-repeat "+this.color+"; position: absolute; top: 0px; left:0px; cursor: pointer;'></div><input style='height:"+this.height+"px; width:"+this.width+"px; background:"+this.innerColor+"; color:"+this.textColor+
";  text-align: center; line-height:"+this.height+"px; border: 0px; padding: 0px; margin: 0px; position: absolute; top: 0px; left:"+this.arrowSize+"px;' type='text' onKeyDown='quantityElem.onKeyDown(event,this);'  onfocusout='quantityElem.onFocusOut(event,this);' value="+b+"><div onclick='quantityElem.onIncrement(event,this);' style='width:"+this.arrowSize+"px; height:"+this.height+"px; background: url(./style/increment.png) "+(this.arrowSize-16)/2+"px "+(this.height-16)/2+"px no-repeat "+this.color+
"; position: absolute; top: 0px; right: 0px; cursor: pointer;'></div></div>"},onIncrement:function(b,a){var c=a.parentNode.childNodes,d;for(d in c)if("INPUT"===c[d].tagName){c[d].value=1E6<1*c[d].value?1E6:1*c[d].value+1;quantityElem.callback&&quantityElem.callback.call(quantityElem.callback,c[d]);break}},onDecrement:function(b,a){var c=a.parentNode.childNodes,d;for(d in c)if("INPUT"===c[d].tagName){c[d].value=1<1*c[d].value?1*c[d].value-1:1;quantityElem.callback&&quantityElem.callback.call(quantityElem.callback,
c[d]);break}},onKeyDown:function(b,a){b=b||window.event;if(13==(b.which||b.keyCode))a.value=0<a.value?1E6<a.value?1E6:a.value:0,a.blur(),quantityElem.callback&&quantityElem.callback.call(quantityElem.callback,a)},onFocusOut:function(b,a){a.value=0<a.value?1E6<a.value?1E6:a.value:0;quantityElem.callback&&quantityElem.callback.call(quantityElem.callback,a)}},sharingElem={create:function(){return"<div class='cartShareContainer'><div id='fb' onclick='sharingElem.onClick(event,this);' class='cartShareBtn cartShareFB'></div><div id='tw' onclick='sharingElem.onClick(event,this);' class='cartShareBtn cartShareTW'></div><div id='tm' onclick='sharingElem.onClick(event,this);' class='cartShareBtn cartShareTM'></div><div id='in' onclick='sharingElem.onClick(event,this);' class='cartShareBtn cartShareIN'></div><div id='vk' onclick='sharingElem.onClick(event,this);' class='cartShareBtn cartShareVK'></div><div id='gg' onclick='sharingElem.onClick(event,this);' class='cartShareBtn cartShareGG'></div><div id='em' onclick='sharingElem.onClick(event,this);' class='cartShareBtn cartShareEM'></div></div>"},
onClick:function(b,a){var c=FULL_SRC,d=document.title,e=INNER.currentPage.num+"/"+cartItem.id;switch(a.id){case "fb":window.open("https://facebook.com/sharer.php?u="+encodeURIComponent(c+"#"+e),"","");break;case "tw":window.open("https://twitter.com/intent/tweet?url="+encodeURIComponent(c+"#"+e)+"&text="+d,"","");break;case "in":window.open("http://www.linkedin.com/shareArticle?mini=true&url="+encodeURIComponent(c+"#"+e+"&title="+d),"","");break;case "tm":window.open("http://www.tumblr.com/share/link?url="+
encodeURIComponent(c+"#"+e+"&name="+d+"&description="),"","");break;case "bg":window.open("http://blogger.com/blog-this.g?u="+encodeURIComponent(c+"#"+e+"&t="+d)+"&n=publication","","");break;case "gg":window.open("https://plus.google.com/share?url="+encodeURIComponent(c+"#"+e),"","");break;case "vk":window.open("http://vk.com/share.php?url="+encodeURIComponent(c+"#"+e+"&title="+d)+"&image="+encodeURIComponent(window.location.href.substr(0,window.location.href.indexOf("index.html"))+COVER_SRC)+"&description=",
"","");break;case "em":window.location="mailto:?subject="+encodeURIComponent(d+"&body="+c+"#"+e)}}},selectElem={create:function(b){var b=b||{},a=b.values,c="";if(1==a.length)c+="<div class='SelectElem' data-optID='"+b.id+"' data-selID='"+a[0].id+"'>"+a[0].name+"</div>";else{var d="",e;for(e in a)d+="<li data-optID='"+a[e].id+"' onclick='selectElem.onSelect(event,this);'>"+a[e].name+"</li>";c+="<div class='SelectElem pointer'  data-optID='"+b.id+"' data-setID='"+a[0].id+"' onclick='selectElem.onClick(event,this);'><div class='SelectElemCheck'></div>"+
a[0].name+"</div><div class='SelectElemList' data-status='hide' onmouseout='selectElem.onMouseOut(event,this);'>"+("<ul>"+d+"</ul>")+"</div>"}return c},onClick:function(b,a){var a=a.parentNode,c=a.offsetTop+popoverElem.obj.offsetTop,d=a.offsetLeft+popoverElem.obj.offsetLeft,e=a.offsetWidth,a=a.parentNode.getElementsByTagName("UL")[0].parentNode;"hide"==a.getAttribute("data-status")?(a.style.top=c+30+"px",a.style.left=d+"px",a.style.width=e+"px",a.style.display="block",a.setAttribute("data-status",
"show")):(a.style.display="none",a.setAttribute("data-status","hide"))},onMouseOut:function(){},onSelect:function(b,a){var c=a.parentNode.parentNode.parentNode.childNodes[0],d=a.getAttribute("data-optID"),e=a.innerText;c.setAttribute("data-selID",d);c.innerHTML="<div class='SelectElemCheck'></div>"+e;selectElem.onHide(a.parentNode.parentNode);for(var f in cartContent.optionsToCart)if(cartContent.optionsToCart[f].id==c.getAttribute("data-optID"))cartContent.optionsToCart[f].value=d},onHide:function(b){b.style.display=
"none";b.setAttribute("data-status","hide")},hideAll:function(){}},imagesElem={create:function(b,a){("undefined"==typeof b[0]||null==b[0].url)&&b.push({url:"./style/noimages.jpg"});a=a||{};this.numInLine=a.numInLine||"3";this.padding=a.padding||"3";var c="";if(b[1]){for(var c=c+"<div style='width: 100%; overflow: auto;'>",d=1;b[d]&&7>d;)c+="<div style='width: "+96/this.numInLine+"%; height: 65px; float: left; cursor: pointer; margin-bottom: 5px;' ><div style='padding: "+this.padding+"px;'><img  src='"+
b[d].url+"' width=100% onclick='imagesElem.onSelect(event,this);'></div></div>",d++;c+="</div>"}return"<div style='width:100%; overflow: hidden;'><img id='imagesElemMain' width='95%' src='"+b[0].url+"'>"+c+"</div>"},onSelect:function(b,a){var c=a.src,d=document.getElementById("imagesElemMain");a.src=d.src;d.src=c}},viewCartElem={obj:{},create:function(b,a){a=a||{};this.icon=a.icon||"./styles/cart.png";this.font=a.font||"Helvetica";this.color=a.color||"#fff";this.ID="viewCart";for(var c in cart.cartStore[cart.shopID][cart.publicationID])this.count+=
cart.cartStore[cart.shopID][cart.publicationID][c].qty;this.parentElem=b||document.getElementsByTagName("BODY");c=document.createElement("div");c.id=this.ID;c.style.margin="3px 10px 3px 0";c.style.paddingRight="25px";c.style.color=this.color;c.style.fontFamily=this.font;c.style.fontSize="13px";c.style.lineHeight="24px";c.style["float"]="right";c.style.cursor="pointer";c.style.textAlign="right";c.style.background="url(./style/cart.png) no-repeat right";c.style.position="absolute";c.style.top="0px";
c.style.right="140px";this.parentElem.style.borderLeft="1px inset #ccc";this.parentElem.style.paddingLeft="10px";browser.setEvent(c,"click",viewCartElem.action);this.parentElem.parentNode.appendChild(c);this.obj=c;this.count=c.textContent;cartContent.checkTotalQty()},changeCount:function(){document.getElementById(viewCartElem.ID).innerHTML=cartContent.totalQty},action:function(){popoverElem.create();cartContent.list()}},popoverElem={obj:{},create:function(b,a){a=a||{};b=b||"#popover";if(document.getElementById("#popover"))popoverElem.onClose();
this.id=b;this.width=a.width||"550";this.height=a.height||"400";this.color=a.color||"#f8f8f8";blackBG.create();blackBG.checkListener(cartItem.onClose)||blackBG.addListener(cartItem.onClose);blackBG.checkListener(cartContent.onClose)||blackBG.addListener(cartContent.onClose);blackBG.checkListener(cartItem.redraw)||blackBG.addListener(cartItem.redraw);var c=document.createElement("div");c.style.top=(workspace.h-1*this.height)/2+"px";c.style.left=(workspace.w-1*this.width)/2+"px";c.style.width=this.width+
"px";c.style.height=this.height+"px";if(browser.supportHTML5)c.style.background="url(./style/preloader2.gif) no-repeat center"+this.color;c.style.backgroundSize="5%";c.style.position="fixed";c.id=this.id;document.getElementById("blackBG").appendChild(c);workspace.addListener(this.onResize);browser.setEvent(c,"click",function(a){popoverElem.onClick(a)});this.obj=c},content:function(b,a){var b=b||"",c=popoverElem.obj;if(c)c.style.background=popoverElem.color,c.innerHTML=b;a&&a.call(a)},onLoad:function(){var b=
popoverElem.obj;if(b&&browser.supportHTML5)b.style.background="url(./style/preloader2.gif) no-repeat center "+popoverElem.color},onClick:function(b){b=b||window.event;b.preventDefault?b.preventDefault():b.returnValue=!1;b.stopPropagation?b.stopPropagation():b.cancelBubble=!0;return!1},onResize:function(){var b=document.getElementById(popoverElem.id);if(b)b.style.top=(workspace.h-b.offsetHeight)/2+"px",b.style.left=(workspace.w-b.offsetWidth)/2+"px"},onClose:function(){blackBG.remove()}},cartItem=
{currentElem:[],currentValue:0,id:"",createItem:function(b,a,c){a=a||{};this.itemID=b||NaN;this.parent=c||document.getElementById("blackBG");this.scale=1*a.scale||1;this.publScale=1*a.publScale||1;this.top=1*a.top||0;this.left=1*a.left||0;this.width=1*a.width||100;this.height=1*a.height||40;this.orientation=a.orientation||"left";this.cost=a.cost||"0";this.title=a.title||"";this.hasPriceTag="true"==a.hasPriceTag;this.hasProductNameOnTag="true"==a.hasProductNameOnTag;this.borderColor=a.borderColor||
"#fff";this.borderSize=1*a.borderSize*this.publScale||3*this.publScale;this.circleColor=a.circleColor||"#259c2b";this.circleRadius=1*(a.circleRadius+2)*this.publScale||18*this.publScale;this.circlePadding=1*a.circlePadding*this.publScale||6*this.publScale;this.basketColor=a.basketColor||"#ffffff";this.basketEmptySrc=a.basketEmptySrc||"./style/cart.png";this.basketFullSrc=a.basketFullSrc||"./style/cart_down.png";a.priceTagOpacity=0==a.priceTagOpacity?"0":a.priceTagOpacity;this.priceTagOpacity=a.priceTagOpacity||
"0.5";this.priceTagRadius=1*a.priceTagRadius*this.publScale||3*this.publScale;this.priceTagColor=a.priceTagColor||"255, 255, 255";this.priceColor=a.priceColor||"#259c2b";this.fontSize=14*this.publScale;this.fontSizeSml=12*this.publScale;this.onClickAction=a.onClickAction;b=document.createElement("div");b.style.position="absolute";b.style.cursor="pointer";b.style.overflow="hidden";b.style.fontFamily="'Lucida GrandeFB', Georgia, Arial";if(browser.supportHTML5)b.style.display="table";b.style.top="topleft"==
this.orientation||"topright"==this.orientation?(this.top+this.circleRadius)*this.scale+"px":this.top*this.scale+"px";b.style.left="topleft"==this.orientation||"left"==this.orientation||"bottomleft"==this.orientation?(this.left+this.circleRadius)*this.scale+"px":this.left*this.scale+"px";b.style.width=(this.width-this.circleRadius)*this.scale+"px";b.style.height="left"==this.orientation||"right"==this.orientation?this.height*this.scale+"px":(this.height-this.circleRadius)*this.scale+"px";b.style.borderRadius=
this.priceTagRadius*this.scale+"px";b.style.fontSize=this.fontSize*this.scale+"px";b.style.color=this.priceColor;b.style.opacity=this.hasPriceTag?"1":"0";b.style.background=browser.supportHTML5?"rgba("+this.priceTagColor+","+this.priceTagOpacity+")":"url(style/bg_opacity.png)";b.innerHTML=this.hasProductNameOnTag?"<div style='width: "+(this.width-this.circleRadius)*this.scale+"px; display: table-cell; vertical-align: middle; text-align: center;'> <span style='font-size: "+this.fontSizeSml*this.scale+
"px; line-height: "+(this.fontSizeSml+5)*this.scale+"px;'>"+this.title+"</span><br><span style='text-align: center;  font-size: "+this.fontSize*this.scale+"px;'>"+formatPrice(shopProperties.currency,this.cost)+"</span></div>":"<div style='display: table-cell; vertical-align: middle; text-align: center; width: "+(this.width-this.circleRadius)*this.scale+"px;'>"+formatPrice(shopProperties.currency,this.cost)+"</div>";b.setAttribute("itemID",this.itemID);b.setAttribute("onClickAction",this.onClickAction);
this.parent.appendChild(b);a=document.createElement("div");a.className="cartIcon";a.style[browser.prefix+"BoxShadow"]="0 "+2*this.publScale*this.scale+"px "+5*this.publScale*this.scale+"px rgba(0,0,0,0.5)";a.style.background=this.circleColor;a.style.borderRadius=this.circleRadius*this.scale+"px";a.style.borderWidth=this.borderSize*this.scale+"px";a.style.borderColor=this.borderColor;a.style.borderStyle="solid";a.style.overflow="hidden";a.style.lineHeight=16*this.scale*this.publScale+"px";a.style.fontSize=
this.fontSizeSml*this.scale+"px";a.style.fontWeight="bold";a.style.color=this.basketColor;a.style.padding=this.circlePadding*this.scale+"px";var d=document.createElement("img");d.style.display="block";d.style.width=16*this.scale*this.publScale+"px";d.style.height=16*this.scale*this.publScale+"px";d.setAttribute("itemID",this.itemID);d.setAttribute("onClickAction",this.onClickAction);d.style["float"]="left";d.style.position="relative";c=document.createElement("span");c.style.display="block";c.style.lineHeight=
23*this.scale+"px";c.style.fontSize=this.fontSizeSml*this.scale+"px";c.style.fontWeight="bold";c.style.overflow="hidden";c.style.color=this.basketColor;c.style.position="relative";c.style.top=1*this.scale+"px";c.style.left=-1*this.scale+"px";c=cart.getItemQuantity(this.itemID,cartProperties.publicationID);c=0<c?c:"";a.appendChild(d);a.setAttribute("itemID",this.itemID);a.setAttribute("qty",c);this.parent.appendChild(a);d.src=0<c?this.basketFullSrc:this.basketEmptySrc;switch(this.orientation){case "left":a.style.top=
this.top*this.scale+(b.offsetHeight-a.offsetHeight)/2+"px";a.style.right=this.parent.offsetWidth-this.left*this.scale-a.offsetHeight+"px";break;case "right":a.style.top=this.top*this.scale+(b.offsetHeight-a.offsetHeight)/2+"px";a.style.left=this.left*this.scale-a.offsetHeight/2+b.offsetWidth+"px";break;case "topleft":a.style.top=this.top*this.scale+"px";a.style.right=this.parent.offsetWidth-this.left*this.scale-a.offsetHeight+"px";break;case "topright":a.style.top=this.top*this.scale+"px";a.style.left=
0<c?this.left*this.scale-a.offsetHeight/2+b.offsetWidth+"px":this.left*this.scale+b.offsetWidth-a.offsetHeight/2+"px";break;case "bottomleft":a.style.top=this.top*this.scale-a.offsetHeight/2+b.offsetHeight+"px";a.style.right=this.parent.offsetWidth-this.left*this.scale-a.offsetHeight+"px";break;case "bottomright":a.style.top=this.top*this.scale-a.offsetHeight/2+b.offsetHeight+"px",a.style.left=0<c?this.left*this.scale-a.offsetHeight/2+b.offsetWidth+"px":this.left*this.scale+b.offsetWidth-a.offsetHeight/
2+"px"}browser.setEvent(a,"click",function(){cartItem.onDown(d)});browser.setEvent(b,"click",function(){cartItem.onDown(d)})},onDown:function(b){var b=b.getAttribute("itemID"),a=cartProperties.onClickAction,c=document.getElementById("Page").childNodes,d;for(d in c)if("undefined"!=typeof c[d].hasAttribute&&c[d].hasAttribute("itemID"))for(var e in c[d].childNodes)"IMG"==c[d].childNodes[e].tagName&&"undefined"!=typeof c[d].childNodes[e].hasAttribute&&c[d].childNodes[e].hasAttribute("itemID")&&c[d].childNodes[e].getAttribute("itemID")==
b&&(this.currentElem.push(c[d].childNodes[e]),a=c[d].childNodes[e].getAttribute("onClickAction")||a);"Window"==a?(popoverElem.create(),cart.getItems(cartContent.itemDescription,cartContent.serverError,b)):cart.getItems(cartItem.openLink,cartContent.serverError,b)},onClose:function(){cartItem.currentElem=[];cartItem.currentValue=0},draw:function(b){for(var a=document.getElementById("Page"),c={},d=0;d<b.length;d++){var e=INNER.cart[d+1];c.cost=b[d].price;c.title=b[d].name;c.scale=page.scale;c.publScale=
""==e.scale?cartProperties.scale:e.scale;c.top=1*e.top;c.left=1*e.left;c.width=1*e.width;c.height=1*e.height;var f="True"==e.useGlobal;c.hasPriceTag=f?cartProperties.hasPriceTag:e.hasPriceTag;c.hasPriceTag=c.hasPriceTag.toLowerCase();c.hasProductNameOnTag=f?cartProperties.hasProductNameOnTag:e.hasProductNameOnTag;c.hasProductNameOnTag=c.hasProductNameOnTag.toLowerCase();c.orientation=f?cartProperties.circleOrientation:e.circleOrientation;c.circleColor=f?cartProperties.circleColor:e.circleColor;c.circleRadius=
cartProperties.circleRadius;c.priceTagOpacity=f?cartProperties.priceTagColorAlpha:e.priceTagColorAlpha;c.priceTagColor=f?cartProperties.priceTagColor:e.priceTagColor;c.priceColor=f?cartProperties.priceTagFontColor:e.priceTagFontColor;c.onClickAction=f?cartProperties.onClickAction:e.onClickAction;cartItem.createItem(b[d].id,c,a)}},redraw:function(){var b=document.getElementById("Page").childNodes,a;for(a in b)if("undefined"!=typeof b[a].hasAttribute&&b[a].hasAttribute("itemID"))for(var c in b[a].childNodes){var d=
b[a].childNodes[c];if("IMG"==d.tagName&&d.hasAttribute("itemID"))d=1*cart.getItemQuantity(d.getAttribute("itemID"),cartProperties.publicationID),d=0<d?d:"",b[a].childNodes[c].src=0<d?cartItem.basketFullSrc:cartItem.basketEmptySrc}},openLink:function(b){"undefined"===typeof b[0].url|""==b[0].url|null==b[0].url||window.open(b[0].url)}},cartContent={optionsToCart:[],totalQtyElem:{},totalPriceElem:{},totalPrice:0,totalQty:0,content:[],itemDescription:function(b,a){if(document.getElementById("#popover")){cartContent.currentItem=
b[0];a=a||{};this.color=a.color||"#ccc";var c="";try{c="[object Array]"===Object.prototype.toString.call(cartContent.currentItem.media)?"<div id='ItemDscImg'>"+imagesElem.create(cartContent.currentItem.media)+"</div>":"<div id='ItemDscImg'><img id='imagesElemMain' width='95%' src='./style/noimages.jpg'></div>"}catch(d){}var e="";cartContent.optionsToCart=[];if(cartContent.currentItem.options)for(var f in cartContent.currentItem.options)e+="<div id='ItemDscTextLeft'>"+cartContent.currentItem.options[f].name+
"</div><div id='ItemDscTextRight'>"+selectElem.create(cartContent.currentItem.options[f])+"</div>",cartContent.optionsToCart.push({id:cartContent.currentItem.options[f].id,value:cartContent.currentItem.options[f].values[0].id});f=!shopProperties.usePublicationCart?"":"<div id='ItemDscTextLeft'>"+LOCALS.CART_QUANTITY+"</div><div id='ItemDscTextRight'>"+quantityElem.create("1",{height:"24",callback:cartContent.onChangeQuantityCurrent})+"</div>";var h="";"undefined"===typeof cartContent.currentItem.description|
""==cartContent.currentItem.description|null==cartContent.currentItem.description||(h+="<div id='ItemDscTextDetails'><div id='ItemDscTextDetailsContent'></div><div data-status='hide' id='ItemDscTextDetailsHide' onclick='cartContent.onHideDetails(event,this);'>"+LOCALS.HIDE_BUTTON+"</div></div>",window.setTimeout(function(){"firefox"!=browser.name?document.getElementById("ItemDscTextDetailsContent").innerText=cartContent.currentItem.description:document.getElementById("ItemDscTextDetailsContent").textContent=
cartContent.currentItem.description},200));var g="";"undefined"===typeof cartContent.currentItem.sku|""==cartContent.currentItem.sku|null==cartContent.currentItem.sku||(g+="<div id='ItemDscTextSku'>"+LOCALS.CART_ARTICLE+" : "+cartContent.currentItem.sku+"</div>");e="<div id='ItemDscText'><div id='ItemDscTextHeader'>"+cartContent.currentItem.name+"</div>"+g+"<div id='ItemDscTextPrice'>"+formatPrice(shopProperties.currency,cartContent.currentItem.price)+"</div><div id='ItemDscShare'>"+sharingElem.create()+
"</div>"+h+"<div> "+f+e+"</div></div>";popoverElem.content("<div id='PopoverHeader'>"+(shopProperties.usePublicationCart?LOCALS.CART_ADD_TITLE:LOCALS.PRODUCT_INFORMATION)+"</div><div id='PopoverCloseBTN' onclick='popoverElem.onClose();'></div>"+(shopProperties.usePublicationCart?"":"undefined"===typeof cartContent.currentItem.url|""==cartContent.currentItem.url|null==cartContent.currentItem.url?"<div id='PopoverViewInactiveBTN'>"+LOCALS.VIEW_ON_WEBSITE_BUTTON+"</div>":"<div id='PopoverAddBTN' onclick='window.open(cartContent.currentItem.url)' >"+
LOCALS.VIEW_ON_WEBSITE_BUTTON+"</div>")+(!shopProperties.usePublicationCart?"":"<div id='PopoverAddBTN' onclick='cartContent.onAdd(event);' >"+LOCALS.CART_ADD_BUTTON+"</div>")+(!shopProperties.usePublicationCart?"":"<div id='PopoverCheckoutBTN' onclick='cartContent.onProceedCheckout();'>"+LOCALS.CART_PROCEED_BUTTON+"</div>")+"<div id='ItemDescriptionContainer' style='height:"+(1*popoverElem.height-155)+"px; text-align: center; padding-top: 30px;'>"+c+e+"</div>");cartItem.id=b[0].id;if(0==CID.length)c=
window.location.hash+"/"+cartItem.id,IFRAME_AT_PUBL_COM&&XD.postMessage(XD.serialize({hash:c}),IFRAME_AT_PUBL_COM),window.location.hash=c}},serverError:function(){popoverElem.onClose()},onHideDetails:function(b,a){if("show"==a.getAttribute("data-status")){a.innerHTML=LOCALS.HIDE_BUTTON;a.setAttribute("data-status","hide");var a=a.parentNode.childNodes,c;for(c in a)if("ItemDscTextDetailsContent"==a[c].id)a[c].style.display="block"}else for(c in a.innerHTML=LOCALS.DETAILS_BUTTON,a.setAttribute("data-status",
"show"),a=a.parentNode.childNodes,a)if("ItemDscTextDetailsContent"==a[c].id)a[c].style.display="none"},clearConfirm:function(){popoverElem.create("#popover",{height:300});popoverElem.content("<div id='PopoverHeader'>"+LOCALS.CART_CLEAN_CONFIRMATION_TITLE+"</div><div id='PopoverCloseBTN' onclick='popoverElem.onClose();'></div>"+("<div id='PopoverOkBTN' onclick='cart.clear(cartProperties.publicationID);  cartContent.checkTotalQty();  popoverElem.onClose();' >"+LOCALS.OK_BUTTON+"</div>")+("<div id='PopoverCancelBTN' onclick='popoverElem.onClose();' >"+
LOCALS.CANCEL_BUTTON+"</div>")+"<div id='ItemDescriptionContainer' style='height:"+(1*popoverElem.height-155)+"px; text-align: center;'>"+LOCALS.CART_CLEAN_CONFIRMATION+"?</div>")},backDoor:function(){var b="<div id='PopoverHeader'>"+LOCALS.CART_DEMO_CHECKOUT_TITLE+"</div><div id='PopoverCloseBTN' onclick='popoverElem.onClose();'></div>"+("<div id='PopoverCancelBTN' onclick='cartContent.list();' >"+LOCALS.OK_BUTTON+"</div>")+"<div id='ItemDescriptionContainer' style='height:"+(1*popoverElem.height-
155)+"px; text-align: center;'>"+LOCALS.CART_DEMO_CHECKOUT_CONTENT.replace("{0}",shopProperties.demoURL+"' onclick='cartContent.openFB();")+"</div>";popoverElem.content(b)},openFB:function(){window.open(shopProperties.demoURL)},list:function(){cartContent.checkTotalQty();this.itemsArray=[];var b="<li data-header='header' style='background-color: #f8f8f8;'><div style='width: 60%;'><span style='padding-left: 15px; font-weight: bold;'> </span></div><div style='width: 17%; text-align: center;'><span style='color: #575757;'>"+
LOCALS.CART_QTY+"</span></div><div style='width: 18%; text-align: center;'><span style='color: #575757;'>"+LOCALS.CART_PRICE+"</span></div><div style='min-width: 14px;'></div></li>";if(0!=cartContent.totalQty)for(var a in cart.cartStore[cart.shopID][cart.publicationID]){this.itemsArray.push(cart.cartStore[cart.shopID][cart.publicationID][a].itemID);var c=cart.cartStore[cart.shopID][cart.publicationID][a],b=b+"<li data-itemId = "+c.itemID+" data-cartItemId = "+a+"><div data-img = 'img' style='width: 15%; text-align: center;' class='preloader'></div><div data-opt = 'opt' style='width: 45%; text-align: left;'> </div><div data-qty = "+
c.qty+" style='width: 17%; text-align: center; padding-left:7px; height: 24px; position: relative;'>"+quantityElem.create(c.qty,{height:24,callback:cartContent.onChangeQuantity})+"</div><div data-price = '' style='width: 18%; text-align: center;'> </div><div id='CartDelete' class='pointer' onclick='cartContent.onDelItem(event,this);'></div></li>"}else b="<div style='width: 100%; text-align: center; padding: 40px 0; background-color: #f8f8f8;'>"+LOCALS.CART_EMPTY+"</div>";popoverElem.content("<div id='PopoverHeader'>"+
LOCALS.CART_TITLE+"</div><div id='PopoverCloseBTN' onclick='popoverElem.onClose();'></div><div id='PopoverTotalPrice'><span id='totalQtyElem'>"+LOCALS.CART_ITEMS+": "+cartContent.totalQty+"</span><span id='totalPriceElem'>"+LOCALS.CART_TOTAL+": </span></div><div id='PopoverAddBTN' onclick='cartContent.onCheckout();'>"+LOCALS.CART_CHECKOUT_BUTTON+"</div><div id='CartListContainer' style='height:"+(1*popoverElem.height-160)+"px;'>"+("<ul id='CartList' >"+b+"</ul>")+"</div></div>");cart.getItems(this.listRaster,
cartContent.serverError,this.itemsArray)},setListElems:function(){var b=popoverElem.obj.getElementsByTagName("*"),a;for(a in b){if("totalQtyElem"==b[a].id)cartContent.totalQtyElem=b[a];if("totalPriceElem"==b[a].id)cartContent.totalPriceElem=b[a]}},listRaster:function(b){if(document.getElementById("#popover")){var a=document.getElementById("CartList");cartContent.setListElems();a=document.getElementById("CartList");cartContent.currentItem=b;for(var c in a.childNodes)if("undefined"!=typeof a.childNodes[c].hasAttribute&&
a.childNodes[c].hasAttribute("data-itemId")){var d=a.childNodes[c],e=cart.cartStore[cart.shopID][cart.publicationID][d.getAttribute("data-cartitemId")],f={},h;for(h in b)if(b[h].id==d.getAttribute("data-itemId")){f=b[h];break}for(var g in d.childNodes){if("undefined"!=typeof d.childNodes[g].hasAttribute&&d.childNodes[g].hasAttribute("data-img")){var j="undefined"==typeof f.media[0]||null==f.media[0].url?"./style/noimages.jpg":f.media[0].url;d.childNodes[g].className="";d.childNodes[g].innerHTML="<img class='pointer' id='cartItemId"+
f.id+"'  width='70%' src="+j+" onclick='cartContent.goToItemDescription(this);'>"}if("undefined"!=typeof d.childNodes[g].hasAttribute&&d.childNodes[g].hasAttribute("data-opt")){var k=j="",i;for(i in e.options){var k="",l;for(l in f.options[i].values)if(e.options[i].value==f.options[i].values[l].id){k=f.options[i].values[l].name;break}j+=f.options[i].name+": "+k+"<br>"}d.childNodes[g].innerHTML="<div style='margin: 0px 15px; padding: 5px;'><b>"+f.name+"</b></div><br><div style='margin: 0px 15px;'>"+
j+"</div>"}if("undefined"!=typeof d.childNodes[g].hasAttribute&&d.childNodes[g].hasAttribute("data-qty"))var m=d.childNodes[g].getElementsByTagName("INPUT")[0].value;if("undefined"!=typeof d.childNodes[g].hasAttribute&&d.childNodes[g].hasAttribute("data-price"))d.childNodes[g].setAttribute("data-price",b[h].price),d.childNodes[g].innerHTML=formatPrice(shopProperties.currency,m*b[h].price),cartContent.totalPrice+=m*b[h].price}}cartContent.totalPriceElem.innerHTML=LOCALS.CART_TOTAL+":  "+formatPrice(shopProperties.currency,
cartContent.totalPrice)}},goToItemDescription:function(b){b=[b.id.substr(10)];cart.getItems(cartContent.itemDescription,cartContent.serverError,b)},checkTotalQty:function(){cartContent.totalQty=0;var b=cart.cartStore[cart.shopID][cart.publicationID];if(b)for(var a in b)cartContent.totalQty+=1*b[a].qty;viewCartElem.changeCount();try{0<cartContent.totalQty?cartContent.totalQtyElem.innerHTML=LOCALS.CART_ITEMS+": "+cartContent.totalQty:(cartContent.totalQtyElem.innerHTML=LOCALS.CART_ITEMS+": "+cartContent.totalQty,
document.getElementById("CartListContainer").innerHTML="<div style='width: 100%; text-align: center; padding: 40px 0; background-color: #f8f8f8;'>"+LOCALS.CART_EMPTY+"</div>",cartContent.totalPriceElem.innerHTML=LOCALS.CART_TOTAL+":  "+formatPrice(shopProperties.currency,0)),cartContent.checkTotalPrice()}catch(c){}},checkTotalPrice:function(){var b=cartContent.totalPrice=0,a=0;if("undefined"!=typeof document.getElementById("CartList")){var c=document.getElementById("CartList").childNodes,d;for(d in c)if("undefined"!=
typeof c[d].hasAttribute&&c[d].hasAttribute("data-itemId")){var a=b=0,e;for(e in c[d].childNodes)"undefined"!=typeof c[d].childNodes[e].hasAttribute&&c[d].childNodes[e].hasAttribute("data-qty")&&(b=parseFloat(c[d].childNodes[e].getAttribute("data-qty"))),"undefined"!=typeof c[d].childNodes[e].hasAttribute&&c[d].childNodes[e].hasAttribute("data-price")&&(a=parseFloat(c[d].childNodes[e].getAttribute("data-price")));cartContent.totalPrice+=b*a}}cartContent.totalPriceElem.innerHTML=LOCALS.CART_TOTAL+
":  "+formatPrice(shopProperties.currency,cartContent.totalPrice)},onDelItem:function(b,a){a.parentElement.hasAttribute("data-cartItemId")&&cart.delItem(a.parentElement.getAttribute("data-cartItemId"));a.parentElement.parentElement.removeChild(a.parentElement);cartContent.checkTotalQty()},onChangeQuantity:function(b){var a=b.parentNode.parentNode.parentNode,c=a.getAttribute("data-cartItemID");cart.changeQuantity(c,b.value);for(var d in a.childNodes)if("undefined"!=typeof a.childNodes[d].hasAttribute&&
a.childNodes[d].hasAttribute("data-qty")&&a.childNodes[d].setAttribute("data-qty",b.value),"undefined"!=typeof a.childNodes[d].hasAttribute&&a.childNodes[d].hasAttribute("data-price"))a.childNodes[d].innerHTML=formatPrice(shopProperties.currency,b.value*a.childNodes[d].getAttribute("data-price"));cartContent.checkTotalQty()},onChangeQuantityCurrent:function(b){cartItem.currentValue=1*b.value},onKeyDown:function(b,a){b=b||window.event;if(13==(b.which||b.keyCode))cartItem.currentValue=1*a.value,a.blur()},
onClose:function(){this.optionsToCart=[];var b=window.location.hash.split("/")[0];IFRAME_AT_PUBL_COM&&XD.postMessage(XD.serialize({hash:b}),IFRAME_AT_PUBL_COM);window.location.hash=b},onAdd:function(){cart.addItem(cartContent.currentItem.id,cartItem.currentValue,cartContent.optionsToCart);cartContent.checkTotalQty();popoverElem.onClose()},onCheckout:function(){if(0<cartContent.totalQty){var b={},a;for(a in shopProperties.providers)b.type=a,"demo"==a?cartContent.backDoor():(b.currency=shopProperties.currency,
b.providers=shopProperties.providers,cart.checkout(b,function(){},function(){}),popoverElem.onClose())}},onProceedCheckout:function(){cart.addItem(cartContent.currentItem.id,cartItem.currentValue,cartContent.optionsToCart);cartContent.checkTotalQty();cartContent.list();var b=window.location.hash.split("/")[0];IFRAME_AT_PUBL_COM&&XD.postMessage(XD.serialize({hash:b}),IFRAME_AT_PUBL_COM);window.location.hash=b},checkCID:function(){}};
chunk=function(b,a){"undefined"===typeof a&&(a=2);return b.match(RegExp(".{1,"+a+"}","g"))||[]};
formatPrice=function(b,a){b=b||{};b.code=b.code||"USD";b.symbol=b.symbol||"&#36;";b.name=b.name||"US Dollar";b.placeSymbolBeforePrice=b.placeSymbolBeforePrice||!0;b.thousandsDelimiter=b.thousandsDelimiter||" ";b.decimalSeparator=b.decimalSeparator||",";b.accuracy=b.accuracy||1;var a=parseFloat((a+"").replace(b.decimalSeparator,".").replace(/[^0-9\.]+/ig,"")).toFixed(b.accuracy),c=a.split("."),d=c[1],c=c[0],c=chunk(c.reverse(),3).join(b.thousandsDelimiter).reverse(),a=shopProperties.hideZeroDecimals&&
0==d?c:c+b.decimalSeparator+d;return a=!b.placeSymbolAfterPrice?b.symbol+""+a:a+""+b.symbol};var cart=new Cart,waitBlackBG=function(){"undefined"!==typeof blackBG&&"undefined"!==typeof LOCALS?cart.getCheckoutStatus(cartContent.clearConfirm,cartProperties.publicationID):setTimeout(waitBlackBG,100)};waitBlackBG();var waitDOM=function(){document.getElementById("htmlLink")?viewCartElem.create(document.getElementById("htmlLink")):setTimeout(waitDOM,100)};shopProperties.usePublicationCart&&waitDOM();
