<!--

var KsKZT=0
var rCxuh=1
var bXovW=2
var UEpqX=0;
var lIiCG=1;
var XYTng=2;
var iKVrF=0
var LtDJj=1
var RompH=false 
function MD5(string){
function RotateLeft(lValue,iShiftBits){
return(lValue<<iShiftBits)|(lValue>>>(32-iShiftBits));
}
function AddUnsigned(lX,lY){
var lX4,lY4,lX8,lY8,lResult;
lX8=(lX&0x80000000);
lY8=(lY&0x80000000);
lX4=(lX&0x40000000);
lY4=(lY&0x40000000);
lResult=(lX&0x3FFFFFFF)+(lY&0x3FFFFFFF);
if(lX4&lY4){
return(lResult^0x80000000^lX8^lY8);
}
if(lX4|lY4){
if(lResult&0x40000000){
return(lResult^0xC0000000^lX8^lY8);
}else{
return(lResult^0x40000000^lX8^lY8);
}
}else{
return(lResult^lX8^lY8);
}
}
function F(x,y,z){return(x&y)|((~x)&z);}
function G(x,y,z){return(x&z)|(y&(~z));}
function H(x,y,z){return(x^y^z);}
function I(x,y,z){return(y^(x|(~z)));}
function FF(a,b,c,d,x,s,ac){
a=AddUnsigned(a,AddUnsigned(AddUnsigned(F(b,c,d),x),ac));
return AddUnsigned(RotateLeft(a,s),b);
};
function GG(a,b,c,d,x,s,ac){
a=AddUnsigned(a,AddUnsigned(AddUnsigned(G(b,c,d),x),ac));
return AddUnsigned(RotateLeft(a,s),b);
};
function HH(a,b,c,d,x,s,ac){
a=AddUnsigned(a,AddUnsigned(AddUnsigned(H(b,c,d),x),ac));
return AddUnsigned(RotateLeft(a,s),b);
};
function II(a,b,c,d,x,s,ac){
a=AddUnsigned(a,AddUnsigned(AddUnsigned(I(b,c,d),x),ac));
return AddUnsigned(RotateLeft(a,s),b);
};
function ConvertToWordArray(string){
var lWordCount;
var lMessageLength=string.length;
var lNumberOfWords_temp1=lMessageLength+8;
var lNumberOfWords_temp2=(lNumberOfWords_temp1-(lNumberOfWords_temp1%64))/64;
var lNumberOfWords=(lNumberOfWords_temp2+1)*16;
var lWordArray=Array(lNumberOfWords-1);
var lBytePosition=0;
var lByteCount=0;
while(lByteCount<lMessageLength){
lWordCount=(lByteCount-(lByteCount%4))/4;
lBytePosition=(lByteCount%4)*8;
lWordArray[lWordCount]=(lWordArray[lWordCount]|(string.charCodeAt(lByteCount)<<lBytePosition));
lByteCount++;
}
lWordCount=(lByteCount-(lByteCount%4))/4;
lBytePosition=(lByteCount%4)*8;
lWordArray[lWordCount]=lWordArray[lWordCount]|(0x80<<lBytePosition);
lWordArray[lNumberOfWords-2]=lMessageLength<<3;
lWordArray[lNumberOfWords-1]=lMessageLength>>>29;
return lWordArray;
};
function WordToHex(lValue){
var WordToHexValue="",WordToHexValue_temp="",lByte,lCount;
for(lCount=0;lCount<=3;lCount++){
lByte=(lValue>>>(lCount*8))&255;
WordToHexValue_temp="0"+lByte.toString(16);
WordToHexValue=WordToHexValue+WordToHexValue_temp.substr(WordToHexValue_temp.length-2,2);
}
return WordToHexValue;
};
function Utf8Encode(string){
string=string.replace(/\r\n/g,"\n");
var utftext="";
for(var n=0;n<string.length;n++){
var c=string.charCodeAt(n);
if(c<128){
utftext+=String.fromCharCode(c);
}
else if((c>127)&&(c<2048)){
utftext+=String.fromCharCode((c>>6)|192);
utftext+=String.fromCharCode((c&63)|128);
}
else{
utftext+=String.fromCharCode((c>>12)|224);
utftext+=String.fromCharCode(((c>>6)&63)|128);
utftext+=String.fromCharCode((c&63)|128);
}
}
return utftext;
};
var x=Array();
var k,AA,BB,CC,DD,a,b,c,d;
var S11=7,S12=12,S13=17,S14=22;
var S21=5,S22=9,S23=14,S24=20;
var S31=4,S32=11,S33=16,S34=23;
var S41=6,S42=10,S43=15,S44=21;
string=Utf8Encode(string);
x=ConvertToWordArray(string);
a=0x67452301;b=0xEFCDAB89;c=0x98BADCFE;d=0x10325476;
for(k=0;k<x.length;k+=16){
AA=a;BB=b;CC=c;DD=d;
a=FF(a,b,c,d,x[k+0],S11,0xD76AA478);
d=FF(d,a,b,c,x[k+1],S12,0xE8C7B756);
c=FF(c,d,a,b,x[k+2],S13,0x242070DB);
b=FF(b,c,d,a,x[k+3],S14,0xC1BDCEEE);
a=FF(a,b,c,d,x[k+4],S11,0xF57C0FAF);
d=FF(d,a,b,c,x[k+5],S12,0x4787C62A);
c=FF(c,d,a,b,x[k+6],S13,0xA8304613);
b=FF(b,c,d,a,x[k+7],S14,0xFD469501);
a=FF(a,b,c,d,x[k+8],S11,0x698098D8);
d=FF(d,a,b,c,x[k+9],S12,0x8B44F7AF);
c=FF(c,d,a,b,x[k+10],S13,0xFFFF5BB1);
b=FF(b,c,d,a,x[k+11],S14,0x895CD7BE);
a=FF(a,b,c,d,x[k+12],S11,0x6B901122);
d=FF(d,a,b,c,x[k+13],S12,0xFD987193);
c=FF(c,d,a,b,x[k+14],S13,0xA679438E);
b=FF(b,c,d,a,x[k+15],S14,0x49B40821);
a=GG(a,b,c,d,x[k+1],S21,0xF61E2562);
d=GG(d,a,b,c,x[k+6],S22,0xC040B340);
c=GG(c,d,a,b,x[k+11],S23,0x265E5A51);
b=GG(b,c,d,a,x[k+0],S24,0xE9B6C7AA);
a=GG(a,b,c,d,x[k+5],S21,0xD62F105D);
d=GG(d,a,b,c,x[k+10],S22,0x2441453);
c=GG(c,d,a,b,x[k+15],S23,0xD8A1E681);
b=GG(b,c,d,a,x[k+4],S24,0xE7D3FBC8);
a=GG(a,b,c,d,x[k+9],S21,0x21E1CDE6);
d=GG(d,a,b,c,x[k+14],S22,0xC33707D6);
c=GG(c,d,a,b,x[k+3],S23,0xF4D50D87);
b=GG(b,c,d,a,x[k+8],S24,0x455A14ED);
a=GG(a,b,c,d,x[k+13],S21,0xA9E3E905);
d=GG(d,a,b,c,x[k+2],S22,0xFCEFA3F8);
c=GG(c,d,a,b,x[k+7],S23,0x676F02D9);
b=GG(b,c,d,a,x[k+12],S24,0x8D2A4C8A);
a=HH(a,b,c,d,x[k+5],S31,0xFFFA3942);
d=HH(d,a,b,c,x[k+8],S32,0x8771F681);
c=HH(c,d,a,b,x[k+11],S33,0x6D9D6122);
b=HH(b,c,d,a,x[k+14],S34,0xFDE5380C);
a=HH(a,b,c,d,x[k+1],S31,0xA4BEEA44);
d=HH(d,a,b,c,x[k+4],S32,0x4BDECFA9);
c=HH(c,d,a,b,x[k+7],S33,0xF6BB4B60);
b=HH(b,c,d,a,x[k+10],S34,0xBEBFBC70);
a=HH(a,b,c,d,x[k+13],S31,0x289B7EC6);
d=HH(d,a,b,c,x[k+0],S32,0xEAA127FA);
c=HH(c,d,a,b,x[k+3],S33,0xD4EF3085);
b=HH(b,c,d,a,x[k+6],S34,0x4881D05);
a=HH(a,b,c,d,x[k+9],S31,0xD9D4D039);
d=HH(d,a,b,c,x[k+12],S32,0xE6DB99E5);
c=HH(c,d,a,b,x[k+15],S33,0x1FA27CF8);
b=HH(b,c,d,a,x[k+2],S34,0xC4AC5665);
a=II(a,b,c,d,x[k+0],S41,0xF4292244);
d=II(d,a,b,c,x[k+7],S42,0x432AFF97);
c=II(c,d,a,b,x[k+14],S43,0xAB9423A7);
b=II(b,c,d,a,x[k+5],S44,0xFC93A039);
a=II(a,b,c,d,x[k+12],S41,0x655B59C3);
d=II(d,a,b,c,x[k+3],S42,0x8F0CCC92);
c=II(c,d,a,b,x[k+10],S43,0xFFEFF47D);
b=II(b,c,d,a,x[k+1],S44,0x85845DD1);
a=II(a,b,c,d,x[k+8],S41,0x6FA87E4F);
d=II(d,a,b,c,x[k+15],S42,0xFE2CE6E0);
c=II(c,d,a,b,x[k+6],S43,0xA3014314);
b=II(b,c,d,a,x[k+13],S44,0x4E0811A1);
a=II(a,b,c,d,x[k+4],S41,0xF7537E82);
d=II(d,a,b,c,x[k+11],S42,0xBD3AF235);
c=II(c,d,a,b,x[k+2],S43,0x2AD7D2BB);
b=II(b,c,d,a,x[k+9],S44,0xEB86D391);
a=AddUnsigned(a,AA);
b=AddUnsigned(b,BB);
c=AddUnsigned(c,CC);
d=AddUnsigned(d,DD);
}
var temp=WordToHex(a)+WordToHex(b)+WordToHex(c)+WordToHex(d);
return temp.toLowerCase();
}
function WA_marketRemoveItem(suRBq)
{
lfdxN().nRnNl(suRBq)
var GoKIk=WA_Dialog.getCurrent();
GoKIk.DfwkE()
}
function lfdxN()
{
if(document.wa_global_settings_market==undefined)document.wa_global_settings_market=new nZJwx()
return document.wa_global_settings_market;
}
function uaAEK()
{
this.lgngA=function()
{
return this.nGQPS+"-"+this.cYLCl_index
}
this.nLDdq=function(noZUE,arAHH)
{
this.cYLCl=noZUE.obj.market.info.folder.substring(13);
this.cYLCl_index=noZUE.obj.index;
this.cYLCl_modif=noZUE.obj.market.info.critical_id_modif
this.nGQPS=noZUE.obj.market.id 

this.heNBi=1;
this.cpFgp=noZUE.title;
this.WetuE=noZUE.price;
this.glfSx=noZUE.weight;
this.HwDBn=noZUE.code_product;
}
this.ZBFTe=function(noZUE,arAHH)
{

this.cpFgp=noZUE.title;
this.WetuE=noZUE.price;
this.glfSx=noZUE.weight;
this.HwDBn=noZUE.code_product;
}
this.bOPwx=function()
{
var s="";
s+=this.lgngA();
if(this.m_opt_vals)
for(var i=0;i<this.m_opt_vals.length;i++)
{
var pbcwl=this.m_opt_vals[i]
if(pbcwl!=-1) s+="/"+pbcwl;
}
return s;
}
this.mrQKB=function()
{
var val="";
val+="j="+this.cYLCl+",";
val+="i="+this.cYLCl_index+",";
val+="m="+this.cYLCl_modif+",";
val+="q="+this.heNBi+",";
if(this.m_opt_vals)
{
for(var i=0;i<this.m_opt_vals.length;i++)
{
val+="o"+i+"=";
var LrjEG=this.m_opt_vals[i]
if(LrjEG>-1)
val+=LrjEG
else
val+=""
val+=","
}
}
return val;
}
this.VPMYp=function(map,k)
{
var v=map[k];
if(v=="undefined") return "";
return v;
}
this.RTqHo=function(map)
{
this.cYLCl=this.VPMYp(map,"j");
if(this.cYLCl=="") return false;
this.cYLCl_index=this.VPMYp(map,"i");
this.cYLCl_modif=this.VPMYp(map,"m");
this.heNBi=parseInt(map["q"]);
this.m_opt_vals=new Array();
for(var i=0;i<3;i++)
{
var FwBEO=parseInt(map["o"+i]);
if(isNaN(FwBEO))FwBEO=-1;
this.m_opt_vals.push(FwBEO)
}
return true;
}
this.PRHlu=function(s,sep_group,sep_val)
{
if(sep_group==null)sep_group=",";
if(sep_val==null)sep_val="=";
var m_array=new Array();
var tab=s.split(sep_group);
for(var i=0;i<tab.length;i++)
{
var tab3=tab[i].split(sep_val);
if(tab3.length==2)m_array[tab3[0]]=tab3[1];
}
return m_array;
}
this.YHHSu=function(jwRUK)
{
var EBtSm=this.PRHlu(jwRUK)
return this.RTqHo(EBtSm) 
}
this.xQcrE=function()
{
return omwmc(this.noZUE,this.m_opt_vals)
}
}
function OZpvo(rGxpr,RPTHX)
{
var BmKXH=rGxpr[0]
var mxGwk=rGxpr[1]
var TFesm=rGxpr[2]
if(BmKXH.length==0)
{
TFesm.call(mxGwk)
return;
}
var js=BmKXH.pop()
WA_loadScript(js.src,OZpvo,[BmKXH,mxGwk,TFesm]);
}
function WA_arrayContains(KJcBj,jwRUK)
{
for(var n=0;n<KJcBj.length;n++){if(KJcBj[n]==jwRUK)return true;}
return false;
}
function ulknh(KJcBj)
{
var EBtSm=new Array()
for(var n=0;n<KJcBj.length;n++)
{
var QqhQS=KJcBj[n]
if(QqhQS=="address") EBtSm=EBtSm.concat(["address_1","address_2","city","zip"])
else EBtSm.push(QqhQS)
}
return EBtSm;
}
function lwGgb()
{
this.bsvQr=function()
{
if(this.iLPmJ.length==0)return CONST_WA_GLOBAL_SETTINGS.default_selected_country;
return this.iLPmJ;
}
this.AXfvQ=function()
{
this.ktkPs()
}
this.PRHlu=function(s)
{
var JgJXE=new Array();
var tab=s.split(",");
for(var i=0;i<tab.length;i++)
{
var tab3=tab[i].split("=");
if(tab3.length==2)JgJXE[tab3[0]]=tab3[1];
}
return JgJXE;
}
this.wuLLb=function(cxrqD)
{
if(cxrqD==undefined) return ""
return(cxrqD==iKVrF)?"deliv-":"bill-"
}
this.QYlbW=function(mQrcd,cxrqD,vCqOL)
{
if(!vCqOL)vCqOL=""
var QZgfO=this.wuLLb(cxrqD)
if(mQrcd=="country")
{
if(cxrqD==iKVrF) return this.iLPmJ
if(cxrqD==LtDJj) mQrcd="countryCode"
}
if(mQrcd=="state")
{
mQrcd="stateCode"
}
var pbcwl=this.DrpmP[QZgfO+mQrcd]
if(!pbcwl) return vCqOL
pbcwl=pbcwl.replace(/\"/g,"'")
return pbcwl
}
this.bHJCg=function(pbcwl)
{
if(pbcwl==undefined)return ""
return pbcwl
}
this.RBDJs=function(key,val)
{
if((val==null)||(val==undefined)) val="";
WA_SetCookie("crbst-card-"+key,val)
}
this.rBApD=function(key)
{
var mxGwk=WA_GetCookie("crbst-card-"+key)
if(mxGwk=="null")mxGwk="";
return ""+mxGwk
}
this.tXXFV=function()
{
this.DrpmP=new Array()
var jwRUK=this.rBApD("order-infos")
var EBtSm=this.PRHlu(jwRUK)
for(var k1 in EBtSm)
{
var pbcwl=EBtSm[k1]
if((k1.indexOf("deliv-")==0)||(k1.indexOf("bill-")==0))
this.DrpmP[k1]=unescape(pbcwl)
}
this.iLPmJ=this.bHJCg(EBtSm["countryCode"])
this.xLdpo=this.bHJCg(EBtSm["typePayment"])
this.gsmwm=(this.bHJCg(EBtSm["differentBillingAddressChecked"])=="true")
this.dLPUR=(this.bHJCg(EBtSm["salesConditionChecked"])=="true")
}
this.ktkPs=function()
{
var jwRUK=""
for(var k1 in this.DrpmP)
{
var pbcwl=this.DrpmP[k1]
jwRUK+=k1+"="+escape(pbcwl)+","
}
var gdWch=""
gdWch+="countryCode="+escape(this.iLPmJ)+","
gdWch+="typePayment="+escape(this.xLdpo)+","
gdWch+="differentBillingAddressChecked="+(this.gsmwm)+","
gdWch+="salesConditionChecked="+(this.dLPUR)+","
jwRUK+=gdWch 
this.RBDJs("order-infos",jwRUK)
}
this.cgEpj=function(YMXKg)
{
if(trimString(YMXKg.value).length==0)
{
YMXKg.style.backgroundColor="#ff0000"
YMXKg.focus()
return false;;
}
YMXKg.style.backgroundColor=""
return true;
}
this.wAXIg=function(cxrqD)
{
var gMKZG=ulknh(CONST_WA_GLOBAL_SETTINGS.list_form_fields)
var JQqdI=ulknh(CONST_WA_GLOBAL_SETTINGS.list_mandatory_form_fields) 
var boeXQ=this.DrpmP;
var QZgfO=this.wuLLb(cxrqD) 
var IVuhe=document.getElementById("wa-market-form")
for(var n=0;n<gMKZG.length;n++)
{
var ReQaC=gMKZG[n]
var sPEmY=IVuhe[ReQaC]
var pbcwl=trimString(sPEmY.value)
if(ReQaC!="address_2")
if(WA_arrayContains(JQqdI,ReQaC))
{
if(this.cgEpj(sPEmY)==false)return false;
}
boeXQ[QZgfO+ReQaC]=pbcwl
}
var Gbgsk=document.getElementById("wa-select-state");
var JFYai=document.getElementById("wa-market-state");
if(Gbgsk&&(JFYai.style.display!="none"))
{
if(this.cgEpj(Gbgsk)==false)return false;
boeXQ[QZgfO+"stateCode"]=Gbgsk.value
}
else
{
boeXQ[QZgfO+"stateCode"]=""
}
if(cxrqD==LtDJj)
{
var qiHnj=document.getElementById("wa-select-form-country");
if(qiHnj)
{
boeXQ[QZgfO+"countryCode"]=qiHnj.value
}
}
this.ktkPs()
return true;
}
this.twFTg=""
this.iLPmJ=""
this.xLdpo=""
this.gsmwm=false;
this.dLPUR=false
this.tXXFV()
}
function nZJwx()
{
this.YJxNo=new Array();
this.mxGwk_callback=false;
this.AwMmk=false;
this.AGNkC=false;
this.CtEBU=new lwGgb()
this.nrEMv=CONST_WA_GLOBAL_SETTINGS.use_native_paypal_cart;
this.caTZD=function(mxGwk,TFesm)
{
this.mxGwk_callback=mxGwk
this.AwMmk=TFesm 
var awZkr=this.rBApD("data")
this.BkMDt(awZkr) 
var BmKXH=new Array()
var KJcBj=this.YJxNo;
for(var i=0;i<KJcBj.length;i++)
{
var GuJoH=KJcBj[i];
var nEvet=Translator.m_lang_for_filename
if(nEvet.length>0)nEvet="_"+nEvet;
var qXHEI=GuJoH.cYLCl;
var n=qXHEI.indexOf("_")
if(n>-1)qXHEI=qXHEI.substring(n+1)
GuJoH.nGQPS="wa-id-"+qXHEI 
var EYQxC=wa_global_market.markets[GuJoH.nGQPS]
if(this.AGNkC==false)
if(!EYQxC)
{
var bYXff="crbst_market_"+GuJoH.cYLCl+'/'
WA_declareMarket(GuJoH.nGQPS,bYXff,GuJoH.cYLCl_modif) 
var rDaOh=bYXff+'market-definition'+nEvet+'.js?v='+GuJoH.cYLCl_modif
BmKXH.push({id:qXHEI,src:rDaOh})
}
}
OZpvo([BmKXH,this,this.rLIol],true)
}
this.Cnciu=function()
{
this.RBDJs("data","")
this.CtEBU.RBDJs("order-infos","")
this.CtEBU.tXXFV()
this.BkMDt("")
}
this.rLIol=function()
{
this.AGNkC=true;
var KJcBj=this.YJxNo;
var lumAA=new Array();
for(var i=0;i<KJcBj.length;i++)
{
var GuJoH=KJcBj[i];
var qXHEI=GuJoH.nGQPS
var YWIwG=wa_global_market.markets[qXHEI] 

if(YWIwG.info)
{
var PmYPS=YWIwG.info.products 
var arAHH=GuJoH.cYLCl_index
var noZUE=PmYPS[arAHH]
GuJoH.noZUE=noZUE
GuJoH.ZBFTe(GuJoH.noZUE,arAHH)
if((noZUE.unavail==false)&&(GuJoH.cYLCl_modif==YWIwG.info.critical_id_modif))
{
lumAA.push(GuJoH)
}
}
else
{
}
}
this.YJxNo=lumAA
this.WXMlD() 

this.AwMmk.call(this.mxGwk_callback)
}
this.BkMDt=function(WHBYO)
{
var KJcBj=new Array();
var list_string_products=WHBYO.split(";")
for(var i=0;i<list_string_products.length;i++)
{
var s_data=list_string_products[i];
if(s_data&&(s_data.length>0))
{
var GuJoH=new uaAEK();
if(GuJoH.YHHSu(s_data))
{
KJcBj.push(GuJoH);
}
}
}
this.YJxNo=KJcBj;
var pVWko=this.hZgHV()
if(WA_getNumberMarketItemsInCart()!=pVWko)
{
this.mewbS()
this.usGqZ()
}
}
this.xIpwX=function()
{
var xYoSu=''
try{xYoSu=CONST_WA_GLOBAL_SETTINGS.currency_mnemonic}catch(e){}
return xYoSu
}
this.nRnNl=function(suRBq)
{
var list2=new Array();
var KJcBj=this.YJxNo
for(var i=0;i<KJcBj.length;i++)
{
var GuJoH=KJcBj[i];
if(i!=suRBq)
{
list2.push(GuJoH);
}
}
this.YJxNo=list2;
this.WXMlD()
}
this.addProductToShoppingCard=function(noZUE,optionsValues)
{
if(this.HMbTY()==false)
{
WA_Dialog.alert(Translator.tr("You can't use shopping card Your browser doesnt accept cookies !"));
return false;
}
var YGMln=noZUE.obj
var KJcBj=this.KaRRN();
var n=KJcBj.length
var PwEgY=new uaAEK()
PwEgY.nLDdq(noZUE,n);
PwEgY.m_opt_vals=optionsValues
var b_match=false;
for(var i=0;i<KJcBj.length;i++)
{
var GuJoH=KJcBj[i];
if(GuJoH.bOPwx()==PwEgY.bOPwx())
{
b_match=true;
GuJoH.heNBi++;
}
}
if(b_match==false)
{
var awZkr=this.rBApD("data")
var qItFx=PwEgY.mrQKB()
var FYbBW=awZkr.length+qItFx.length 
if(FYbBW>4000)
{
WA_Dialog.alert(Translator.tr("Cookies cart contains max data !"));
return false;
}
KJcBj.push(PwEgY);
}
return true
}
this.rNFCw=function()
{
var KJcBj=this.YJxNo
var awZkr="";
for(var i=0;i<KJcBj.length;i++)
{
var info=KJcBj[i];
awZkr+=info.mrQKB()+";";
}
return awZkr;
}
this.hZgHV=function()
{
var ontWx=0;
var KJcBj=this.YJxNo;
for(var i=0;i<KJcBj.length;i++)
{
var GuJoH=KJcBj[i];
ontWx+=GuJoH.heNBi
}
return ontWx;
}
this.mewbS=function()
{
this.RBDJs("nb_items",this.hZgHV())
}
this.WXMlD=function()
{
var KJcBj=this.YJxNo
var awZkr=this.rNFCw()
this.RBDJs("data",awZkr)
this.mewbS()
this.usGqZ();
}
this.usGqZ=function()
{
WA_refreshNumberMarketItemsInCart()
}
this.KaRRN=function()
{
return this.YJxNo;
}
this.HMbTY=function()
{
this.RBDJs("watestcookies","test")
return(this.rBApD("watestcookies")=="test");
}
this.RBDJs=function(key,val)
{
if((val==null)||(val==undefined)) val="";
WA_SetCookie("crbst-card-"+key,val)
}
this.rBApD=function(key)
{
var mxGwk=WA_GetCookie("crbst-card-"+key)
if(mxGwk=="null")mxGwk="";
return ""+mxGwk
}
this.oFChW=function(v)
{
return WA_formatPrice(v) 
}
this.MjgxZ=function(v)
{
return WA_basicFormatPrice(v)+" "+CONST_WA_GLOBAL_SETTINGS.currency_code;
}
this.ZMhfk=function(mgvGO)
{
return Math.round(mgvGO*100)/100
}
this.KboKW=function()
{
var KJcBj=this.KaRRN()
var price=0;
for(var i=0;i<KJcBj.length;i++)
{
var GuJoH=KJcBj[i];
price+=(GuJoH.xQcrE()*GuJoH.heNBi);
}
return price;
}
this.Ddrsq=function()
{
var mgvGO=this.KboKW()
var koWSx=0;
var KJcBj=CONST_WA_GLOBAL_SETTINGS.list_promo_codes
for(var i=0;i<KJcBj.length;i++)
{
var fWmBH=KJcBj[i];
if(MD5(trimString(this.CtEBU.twFTg.toUpperCase()))==fWmBH.c)
{
if(fWmBH.v.indexOf("%")>-1)
{
var koWSx=parseFloat(fWmBH.v)/100;
return mgvGO*koWSx;
}
else
{
return parseFloat(fWmBH.v);
}
break;
}
}
return 0;
}
this.computeShippingForValue=function(val)
{
var OixZs=CONST_WA_GLOBAL_SETTINGS.shipping_type
if(OixZs==KsKZT)return 0;
var ship_val=0;
var jVlBd=CONST_WA_GLOBAL_SETTINGS.shipping_intervals
for(var i=0;i<jVlBd.length;i++)
{
var HVHan=jVlBd[i];
if(HVHan.v<val)ship_val=HVHan.p
}
return ship_val;
}
this.gcWmU=function(LZwno)
{
var EBtSm=CONST_WA_GLOBAL_SETTINGS.JgJXE_list_extra_shipping_by_country_code
if(EBtSm==undefined)
{
EBtSm=new Array()
CONST_WA_GLOBAL_SETTINGS.JgJXE_list_extra_shipping_by_country_code=EBtSm;
var amwbZ=CONST_WA_GLOBAL_SETTINGS.list_extra_shipping_by_country_code
for(var suRBq in amwbZ)
{
var SfGCI=amwbZ[suRBq];
var cSHEk=SfGCI.c
for(var kNTSL in cSHEk)
{
var QYLBk=cSHEk[kNTSL];EBtSm[QYLBk]=SfGCI.p;
}
}
}
return EBtSm[LZwno];
}
this.hMqAm=function(LZwno)
{
var EBtSm=CONST_WA_GLOBAL_SETTINGS.JgJXE_list_tva_by_country_code
if(EBtSm==undefined)
{
EBtSm=new Array()
CONST_WA_GLOBAL_SETTINGS.JgJXE_list_tva_by_country_code=EBtSm;
var amwbZ=CONST_WA_GLOBAL_SETTINGS.list_tva_by_country_code
for(var suRBq in amwbZ)
{
var SfGCI=amwbZ[suRBq];
var cSHEk=SfGCI.c;
for(var kNTSL in cSHEk)
{
var QYLBk=cSHEk[kNTSL];EBtSm[QYLBk]=SfGCI.p;
}
}
}
return EBtSm[LZwno];
}
this.jHfhY=function()
{
var OixZs=CONST_WA_GLOBAL_SETTINGS.shipping_type
var KJcBj=this.KaRRN()
var global_ref_for_shipping=0;
var FvBwI=0;
var iLPmJ=this.CtEBU.iLPmJ;
if(iLPmJ.length>0)
{
FvBwI=this.gcWmU(iLPmJ);
if(isNaN(FvBwI)) FvBwI=0;
}
for(var i=0;i<KJcBj.length;i++)
{
var GuJoH=KJcBj[i];
if(OixZs==rCxuh)
{
global_ref_for_shipping+=(GuJoH.heNBi*GuJoH.xQcrE());
}
if(OixZs==bXovW)
{
global_ref_for_shipping+=(GuJoH.heNBi*GuJoH.glfSx);
}
}
return FvBwI+this.ZMhfk(this.computeShippingForValue(global_ref_for_shipping));
}
this.IMbUB=function()
{
return CONST_WA_GLOBAL_SETTINGS.tva_type==lIiCG
}
this.wGAAf=function()
{
return CONST_WA_GLOBAL_SETTINGS.tva_type==XYTng
}
this.TMcBN=function()
{
return CONST_WA_GLOBAL_SETTINGS.tva_type==UEpqX
}
this.pCGtu=function()
{
if(this.TMcBN())return 0;
var tax=0;
var country_code=this.CtEBU.iLPmJ;
if(country_code.length>0)
{
tax=this.hMqAm(country_code);
if(isNaN(tax))tax=0;
}
return tax;
}
this.CkdtY=function(mgvGO)
{
if(this.IMbUB())
{
var n0=this.pCGtu()/100;
return mgvGO*(n0/(1+n0));
}
if(this.wGAAf())
{
return mgvGO*this.pCGtu()/100;
}
return mgvGO;
}
this.bURNg=function()
{
if(this.TMcBN())return 0;
var KJcBj=this.KaRRN()
var bwnFu=0;
var rNnGb=0;
for(var i=0;i<KJcBj.length;i++)
{
var GuJoH=KJcBj[i];
bwnFu+=(GuJoH.xQcrE()*GuJoH.heNBi);
}
bwnFu+=this.jHfhY();
rNnGb=this.ZMhfk(this.CkdtY(bwnFu));
return rNnGb;
}
this.ueZgE=function()
{
var mgvGO=0;
mgvGO+=this.KboKW()
if(this.wGAAf())mgvGO+=this.bURNg()
mgvGO+=this.jHfhY()
mgvGO-=this.Ddrsq()
return mgvGO;
}
}
function TMLPd(KjMGr,VPSDr)
{
if(KjMGr.lab<VPSDr.lab) return-1;
if(KjMGr.lab>VPSDr.lab) return 1;
return 0
}
function WA_marketWatchQuantity()
{
var GoKIk=WA_Dialog.getCurrent()
GoKIk.PbuGc()
}
function WA_displayDialogMarketCart()
{
var GoKIk=new WA_Dialog();
GoKIk.CEhuQ=false;
GoKIk.KIGEN=function()
{
this.XFwIQ()
this.CEhuQ=setInterval("WA_marketWatchQuantity()",400)
}
GoKIk.XFwIQ=function()
{
if(this.CEhuQ)clearInterval(this.CEhuQ)
}
GoKIk.PbuGc=function()
{
var ccMpK=lfdxN();
var HinGT=ccMpK.KaRRN();
for(var n=0;n<HinGT.length;n++)
{
var GuJoH=HinGT[n]
var uORmS=document.getElementById("wa-cart-quantity-"+n)
var tZjKl=uORmS.value
var IpZRd=parseInt(tZjKl)
if(isNaN(IpZRd))IpZRd=0;
if((tZjKl!='')&&(IpZRd+""!=tZjKl))
{
uORmS.value=""+IpZRd
}
if(IpZRd!=GuJoH.heNBi)
{
GuJoH.heNBi=IpZRd
ccMpK.WXMlD()
this.CXUKr()
}
}
var JSdCo=document.getElementById("wa-promo-code")
if(JSdCo)
{
if(JSdCo.value!=ccMpK.CtEBU.twFTg)
{
ccMpK.CtEBU.twFTg=JSdCo.value
this.CXUKr()
}
}
}
GoKIk.onCustomKeypress=function(jTpJC)
{
if(jTpJC==13)
{
wa_timeout(Delegate.create(this,this.dvXrJ),0);
}
return false;
}
GoKIk.closeWin=function()
{
this.XFwIQ()
this.intern_closeWin()
}
GoKIk.CXUKr=function()
{
var ccMpK=lfdxN();
var HinGT=ccMpK.KaRRN();
if(HinGT.length==0) return;
for(var n=0;n<HinGT.length;n++)
{
var GuJoH=HinGT[n]
var robpP=document.getElementById("wa-cart-total-"+n)
var mgvGO=GuJoH.xQcrE() 
var poffg=GuJoH.heNBi*mgvGO
var jwRUK="<span style='"
jwRUK+=(poffg>0)?"color:"+WA_GLOBAL_COLOR_THEME.color_text+";font-weight:normal;":"color:#ff0000;font-weight:bold;"
jwRUK+="'>"
jwRUK+=ccMpK.oFChW(poffg)
jwRUK+="</span>"
robpP.innerHTML=jwRUK
}
var tUGBK=ccMpK.KboKW()
var SSXdB=ccMpK.bURNg()
var GNYaY=ccMpK.jHfhY()
var JUWKb=ccMpK.ueZgE()
var CxrSp=ccMpK.Ddrsq()
var gTnbi=""
var robpP=document.getElementById("wa-cart-amount-total")
gTnbi+=Translator.tr("Sub total")+" : "+ccMpK.oFChW(tUGBK)
gTnbi+="<br>"
if(GNYaY>0)
{
gTnbi+="<span>"+Translator.tr("Shipping amount")+" : "+ccMpK.oFChW(GNYaY)+"</span>";
gTnbi+="<br>"
}
if(ccMpK.IMbUB()||ccMpK.wGAAf())
{
if(ccMpK.IMbUB())
{
gTnbi+="<div style='width:100%;text-align:left;'>"
gTnbi+=Translator.tr("Tax included");
}
if(ccMpK.wGAAf())
{
gTnbi+="<div>"
gTnbi+=Translator.tr("Extra Tax");
}
gTnbi+=" : ";
gTnbi+=ccMpK.oFChW(SSXdB)+"</div>";
}
if(CxrSp>0)
{
gTnbi+="<span>"+Translator.tr("Promotion")+" : - "+ccMpK.oFChW(CxrSp)+"</span><br>";
}
gTnbi+="<span><b>"+Translator.tr("Total")+" : "+ccMpK.oFChW(JUWKb)+"</b></span>";
robpP.innerHTML=gTnbi
}
GoKIk.ufnUR=function()
{
WA_displayDialogMarketCart()
}
GoKIk.nMGLa=function()
{
this.closeWin()
}
GoKIk.dvXrJ=function()
{
var ccMpK=lfdxN();
if(WA_getNumberMarketItemsInCart()==0)return;
var dXNGa=document.getElementById("wa-market-select-country")
if(dXNGa)
{
ccMpK.CtEBU.iLPmJ=dXNGa.value
}
if(ccMpK.CtEBU.iLPmJ=="")
{
var dXNGa=document.getElementById("wa-market-select-country")
if(dXNGa)
{
dXNGa.focus()
dXNGa.style.backgroundColor="#ff0000"
return;
}
}
if(CONST_WA_GLOBAL_SETTINGS.link_sale_condition)
{
if(ccMpK.CtEBU.dLPUR!=true)
{
var ToNIn=document.getElementById("wa-sales-condition")
if(ToNIn)
{
ToNIn.focus()
var aPFsX=document.getElementById("wa-sales-condition-label")
aPFsX.style.backgroundColor="#ff0000"
return;
}
}
}
var qQiEi=CONST_WA_GLOBAL_SETTINGS.list_type_payment
if(qQiEi.length==1)
{
ccMpK.CtEBU.xLdpo=qQiEi[0]
}
var dXNGa=document.getElementById("wa-market-select-payment")
if(dXNGa)
{
ccMpK.CtEBU.xLdpo=dXNGa.value
if(ccMpK.CtEBU.xLdpo=="")
{
dXNGa.focus()
dXNGa.style.backgroundColor="#ff0000"
return;
}
}
tdCGF()
}
GoKIk.DfwkE=function()
{
WA_exec_callback_opera_compliant(this,this.xDTtP)
}
GoKIk.xDTtP=function()
{
var ccMpK=lfdxN();

var qiHnj=document.getElementById("wa-market-select-country")
if(qiHnj)
{
ccMpK.CtEBU.iLPmJ=qiHnj.value
}
ccMpK.CtEBU.AXfvQ()
var AHxGt=html_getLayer("market-cart-content")
var bppLr=html_getLayer("wa-market-payment-form") 
var jwRUK=""
var HinGT=ccMpK.KaRRN();
html_SetVisibility(bppLr,(HinGT.length>0))
if(HinGT.length==0)
{
jwRUK+="<span style='font-family:Arial;font-size:16px;'>"
jwRUK+=Translator.tr("No articles in Card !")
jwRUK+="</span>"
}
else
{
var nHnnn="border:1px solid "+WA_GLOBAL_COLOR_THEME.color0+";font-weight:normal;"
var MSBAV="border:1px solid "+WA_GLOBAL_COLOR_THEME.color0+";color:#ff0000;font-weight:bold;"
var WDYix="color:#222222;font-size:12px;"
jwRUK+="<table style='font-family:Arial;font-weight:normal;border:2px solid "+WA_GLOBAL_COLOR_THEME.color0+";border-collapse:collapse;width:100%;margin:auto;background-color:"+WA_GLOBAL_COLOR_THEME.color2+";'>"
jwRUK+="<thead style='font-size:13px;border:1px solid;'>"
jwRUK+="<tr>"
jwRUK+="<th  colspan=2 style='"+nHnnn+"'></th>" 
jwRUK+="<th style='"+nHnnn+"'  width=70px><b>"+Translator.tr("Price")+"</b></th>"
jwRUK+="<th style='"+nHnnn+"'  width=70px><b>"+Translator.tr("Quantity")+"</b></th>"
jwRUK+="<th style='"+nHnnn+"'  width=70px><b>"+Translator.tr("Total")+"</b></th>"
jwRUK+="<th style='"+nHnnn+"'  width=90px></th>"
jwRUK+="</tr>"
for(var n=0;n<HinGT.length;n++)
{
var GuJoH=HinGT[n]
jwRUK+="<tr>"
jwRUK+="<th style='"+nHnnn+"' >"
var YWIwG=wa_global_market.markets[GuJoH.nGQPS]
var peQfN=new Size(30,30)
var FNbip=peQfN
if(YWIwG.info.design.crop_thumb==false)
{
FNbip=GuJoH.noZUE.size_thumb.clone()
FNbip.scale(peQfN)
}
else
{
}
if(GuJoH.noZUE.img_thumb.length>0)
jwRUK+="<img border=0 src='"+GuJoH.noZUE.img_thumb+"' width="+FNbip.width+"px height="+FNbip.height+"px>"
jwRUK+="</th>"
jwRUK+="<th style='"+nHnnn+"text-align:left;padding:5px;background-color:"+WA_GLOBAL_COLOR_THEME.color1+";' >"
jwRUK+="<b>"+GuJoH.cpFgp+"</b>"
if(GuJoH.HwDBn.length>0)
{
jwRUK+="<span style='"+WDYix+"'>";
jwRUK+=" ["+GuJoH.HwDBn+"]";
jwRUK+="</span>";
}
if(GuJoH.m_opt_vals)
{
jwRUK+="<br>"
jwRUK+="<span style='"+WDYix+"'>";
for(var i_opt=0;i_opt<GuJoH.noZUE.options.length;i_opt++)
{
var GoIil=GuJoH.noZUE.options[i_opt]
if(GoIil)
{
var MhCJW=GuJoH.m_opt_vals[i_opt];
var tqqQo=GoIil.title;
if(tqqQo.length>0)
{
jwRUK+=tqqQo;
jwRUK+=":"
}
jwRUK+=GoIil.vals[MhCJW];
jwRUK+=" "
}
}
jwRUK+="</span>";
}
jwRUK+="</th>"
var mgvGO=GuJoH.xQcrE()
jwRUK+="<th style='"+nHnnn+"' >"+ccMpK.oFChW(mgvGO)+"</th>"
jwRUK+="<th style='"+nHnnn+"'  align=center><input type=text id='wa-cart-quantity-"+n+"' style='width:45px;' maxlength=3 value='"+GuJoH.heNBi+"' type=text/></th>"
jwRUK+="<th style='"
var poffg=GuJoH.heNBi*mgvGO
jwRUK+=(poffg>0)?nHnnn:MSBAV;
jwRUK+="' ><span id='wa-cart-total-"+n+"'>"
jwRUK+=ccMpK.oFChW(poffg)
jwRUK+="</span></th>"
jwRUK+="<th style='"+nHnnn+"' ><a href=\"javascript:WA_marketRemoveItem("+n+")\">"+Translator.tr("Remove card item")+"</a></th>"
jwRUK+="</tr>"
}
jwRUK+="<tr>"
jwRUK+="<th style='"+nHnnn+"text-align:right;padding:5px;' id='wa-cart-amount-total'  colspan=5>&nbsp;</th>"
jwRUK+="<th style='"+nHnnn+"' ></th>"
jwRUK+="</tr>"
jwRUK+="</thead>"
jwRUK+="</table>"
jwRUK+="<br>"
}
AHxGt.innerHTML=jwRUK
this.KIGEN()
WA_exec_callback_opera_compliant(this,this.CXUKr) 
}
GoKIk.dshUm=function()
{
var ccMpK=lfdxN();
this.addButton(Translator.tr("Continue Shopping"),this.nMGLa,[""],this)
this.addButton(Translator.tr("Checkout order"),this.dvXrJ,[""],this)
this.initializeWindow(670,700)
var dYTEY="font-family:Arial;font-size:12px;color:#000000;"
var jwRUK=""
jwRUK+="<div id='market-cart-content' style='width:100%;"+dYTEY+"' align=center>" 
jwRUK+="</div>"
jwRUK+="<br>"
jwRUK+="<div style='width:100%;"+dYTEY+"' align=center id='wa-market-payment-form'>"
jwRUK+="<br>"
var hHrYK=CONST_WA_GLOBAL_SETTINGS.list_favorite_country
var TrQgQ=CONST_WA_GLOBAL_SETTINGS.list_country
var QJDvZ=new Array()
for(var SFaEd=0;SFaEd<hHrYK.length;SFaEd++)
{
QJDvZ[hHrYK[SFaEd]]=true
}
for(var SFaEd=0;SFaEd<TrQgQ.length;SFaEd++)
{
QJDvZ[TrQgQ[SFaEd]]=true
}
var QAGpL=0;
var uhCEr=""
for(var c in QJDvZ)
{
QAGpL++;
uhCEr=c
}
if(QAGpL==1)
{
ccMpK.CtEBU.iLPmJ=uhCEr
}
if(QAGpL>1)
{
jwRUK+="<span style='font-weight:bold;'>"
jwRUK+=Translator.tr("Please choose a country to deliver your order")
jwRUK+="</span>"
jwRUK+="<br>"
jwRUK+="<select onchange=\"WA_marketChangeCountry(this)\" id='wa-market-select-country'>"
if(CONST_WA_GLOBAL_SETTINGS.default_selected_country.length==0)
{
jwRUK+="<option value=\"\">...</option>"
}
var eVkeb=new Array()
for(var SFaEd=0;SFaEd<hHrYK.length;SFaEd++)
{
var pKxlX=hHrYK[SFaEd]
eVkeb.push({code:pKxlX,lab:Translator.country(pKxlX)})
}
for(var SFaEd=0;SFaEd<eVkeb.length;SFaEd++)
{
var mxGwk=eVkeb[SFaEd]
var pKxlX=mxGwk.code
jwRUK+="<option "
if(ccMpK.CtEBU.bsvQr()==pKxlX)jwRUK+="selected "
jwRUK+="value=\""+pKxlX+"\">"+Translator.country(pKxlX)+"</option>"
}
if((hHrYK.length>0)&&(TrQgQ.length>0))
{
jwRUK+="<option value=\"\">-----</option>"
}
var OWVkB=new Array()
for(var SFaEd=0;SFaEd<TrQgQ.length;SFaEd++)
{
var pKxlX=TrQgQ[SFaEd]
OWVkB.push({code:pKxlX,lab:Translator.country(pKxlX)})
}
if((hHrYK.length==0)&&(TrQgQ.length==0))
{
var KJcBj=CONST_WA_COUNTRIES.codes
for(var SFaEd=0;SFaEd<KJcBj.length;SFaEd++)
{
var pKxlX=KJcBj[SFaEd]
OWVkB.push({code:pKxlX,lab:Translator.country(pKxlX)})
}
}
OWVkB.sort(TMLPd)
for(var SFaEd=0;SFaEd<OWVkB.length;SFaEd++)
{
var mxGwk=OWVkB[SFaEd]
var pKxlX=mxGwk.code
jwRUK+="<option "
if(ccMpK.CtEBU.bsvQr()==pKxlX)jwRUK+="selected "
jwRUK+="value=\""+pKxlX+"\">"+Translator.country(pKxlX)+"</option>"
}
jwRUK+="</select>"
jwRUK+="<br>"
jwRUK+="<br>"
}
if(CONST_WA_GLOBAL_SETTINGS.link_sale_condition)
{
jwRUK+="<a "+WA_LinkToHref(CONST_WA_GLOBAL_SETTINGS.link_sale_condition)+" style='color:#0000ff'>"
jwRUK+=Translator.tr("Terms of sell")
jwRUK+="</a>"
jwRUK+="<br>" 
jwRUK+="<span id='wa-sales-condition-label'  style='font-weight:bold;'>"
jwRUK+=Translator.tr("label_market_accept_terms")
jwRUK+="</span>"
jwRUK+="<input id='wa-sales-condition' onchange=\"WA_marketChangeSalesCondition(this)\" "
jwRUK+=(ccMpK.CtEBU.dLPUR)?"checked ":""
jwRUK+="type='checkbox' value='1'/>" 
jwRUK+="<br>"
}
var qQiEi=CONST_WA_GLOBAL_SETTINGS.list_type_payment
if(qQiEi.length>1)
{
jwRUK+="<span style='font-weight:bold;'>"
jwRUK+=Translator.tr("Choose a type of payment")
jwRUK+="</span>"
jwRUK+="<br>"
jwRUK+="<select onchange=\"WA_marketChangeTypePayment(this)\" id='wa-market-select-payment'>"
if((qQiEi.length>1)||(qQiEi.length==0))
{
jwRUK+="<option value=\"\">...</option>"
}
for(var SFaEd=0;SFaEd<qQiEi.length;SFaEd++)
{
var xLdpo=qQiEi[SFaEd]
jwRUK+="<option "
if(ccMpK.CtEBU.xLdpo==xLdpo)jwRUK+="selected "
jwRUK+="value=\""+xLdpo+"\">"+Translator.tr("label_market_"+xLdpo)+"</option>" 
}
jwRUK+="</select>"
jwRUK+="<br>"
jwRUK+="<br>"
}
if(CONST_WA_GLOBAL_SETTINGS.list_promo_codes)
{
var KJcBj=CONST_WA_GLOBAL_SETTINGS.list_promo_codes
jwRUK+="<span id='wa-promo-code-label'  style='font-weight:bold;'>"
jwRUK+=Translator.tr("form-label-code_promo")
jwRUK+="</span><br>"
jwRUK+="<input id='wa-promo-code' onchange=\"WA_marketChangePromoCode(this)\" " 
jwRUK+=" value='"+ccMpK.CtEBU.twFTg+"' "
jwRUK+="/>"
jwRUK+="<br>" 
}
jwRUK+="</div>"
this.writeContent(jwRUK)
var AHxGt=html_getLayer("market-cart-content")
AHxGt.innerHTML="<div width=100% align=center><img src='wa_loading.gif'></div>" 

ccMpK.caTZD(this,this.DfwkE)
}
GoKIk.dshUm() 
}
function WA_marketChangeCountry(dXNGa)
{
dXNGa.style.backgroundColor=""
var GoKIk=WA_Dialog.getCurrent()
GoKIk.DfwkE()
}
function WA_marketChangeTypePayment(dXNGa)
{
var ccMpK=lfdxN();
ccMpK.CtEBU.xLdpo=dXNGa.value
ccMpK.CtEBU.AXfvQ()
dXNGa.style.backgroundColor=""
}
function WA_marketChangeSalesCondition(YMXKg)
{
var ccMpK=lfdxN();
ccMpK.CtEBU.dLPUR=YMXKg.checked
ccMpK.CtEBU.AXfvQ() 
var aPFsX=document.getElementById("wa-sales-condition-label")
aPFsX.style.backgroundColor="" 
}
function WA_marketChangePromoCode(YMXKg)
{
var ccMpK=lfdxN();
ccMpK.CtEBU.twFTg=YMXKg.value
ccMpK.CtEBU.AXfvQ() 


}
function WA_LinkToHref(vRxmX)
{
var jwRUK=""
var nIdwW=vRxmX.url
var hUpvB=Translator.m_lang_for_filename
if(hUpvB.length>0)hUpvB="_"+hUpvB
nIdwW=nIdwW.replace(/@lng@/g,hUpvB)
jwRUK+="href=\""+nIdwW+"\" "
if(vRxmX.open==1)
{
jwRUK+="target="
jwRUK+="_blank"
}
return jwRUK;
}
function WA_displayDialogMarketProduct(qXHEI,suRBq)
{
var EYQxC=wa_global_market.markets[qXHEI]
var TEtRL=EYQxC.obj
var PmYPS=TEtRL.info.products
var noZUE=PmYPS[suRBq] 

var GoKIk=new WA_Dialog();

GoKIk.noZUE=noZUE
GoKIk.gaXaC=qXHEI
GoKIk.ufnUR=function()
{
WA_displayDialogMarketCart()
}
GoKIk.dDEhA=function()
{
var ccMpK=lfdxN();
ccMpK.caTZD(this,this.CsBIv) 
}
GoKIk.CsBIv=function()
{
var noZUE=this.noZUE;
var ccMpK=lfdxN();
var DFUxV=new Array();
var VPYpV=noZUE.obj.id;
for(var i=0;i<3;i++)
{
var jGnFW=-1;
var QZgfO=VPYpV+"-select-opt"
var dXNGa=document.getElementById(QZgfO+i)
if(dXNGa)
{
if(dXNGa.value.length==0)
{
dXNGa.style.backgroundColor="#ff0000";
dXNGa.focus()
return;
}
jGnFW=parseInt(dXNGa.value)
}
DFUxV.push(jGnFW)
}
if(ccMpK.addProductToShoppingCard(noZUE,DFUxV))
{
ccMpK.WXMlD()
WA_displayDialogMarketCart()
}
}
GoKIk.dshUm=function()
{
var qXHEI=this.gaXaC
var noZUE=this.noZUE
var jwRUK=""
this.addButton(Translator.tr("Go to my card"),this.ufnUR,[""],this)
if(noZUE.unavail==false)
{
this.addButton(Translator.tr("Add to card"),this.dDEhA,[""],this)
}
this.initializeWindow(670,this.idealHeight())
jwRUK+="<table border=0 width=100% cellpadding=4>"
jwRUK+="<tr>" 
if(noZUE.img_big.length>0)
{
jwRUK+="<td width='100px' align=center valign=top>"
var FNbip=noZUE.size_thumb.clone() 
FNbip.scale(new Size(200,200))
jwRUK+="<a href=\""+noZUE.img_big+"\" target=_blank>"
jwRUK+="<img border=0 src=\""+noZUE.img_big+"\" width='"+FNbip.width+"px' height='"+FNbip.height+"px'>"
jwRUK+="</a>"
jwRUK+="</td>"
}
var lqUmh="color:"+WA_GLOBAL_COLOR_THEME.color_text+";";
jwRUK+="<td valign=top style='font-family:Arial;'>"
jwRUK+="<span style='font-weight:bold;font-size:16px;"+lqUmh+"'>"
jwRUK+=noZUE.title
jwRUK+="</span>"
jwRUK+="<br>"
if(noZUE.sub_title.length>0)
{
jwRUK+="<span style='color:#333333;font-size:14px;'>"
jwRUK+=noZUE.sub_title
jwRUK+="</span>"
jwRUK+="<br>"
}
jwRUK+="<br>"
jwRUK+="<table border=0 width=100% cellspacing=0 cellpadding=0><tr><td>"
jwRUK+="<span style='"+lqUmh+";font-size:14px;'>"
jwRUK+=Translator.tr("Price")+" : "
jwRUK+="</span>"
jwRUK+="<span style='"+lqUmh+";font-size:18px;font-weight:bold;' id='"+noZUE.obj.id+"-price'>"
if(noZUE.unavail)
{
jwRUK+=Translator.tr("Unavailable")
}
jwRUK+="</span>"
if(noZUE.more_info)
{
jwRUK+="</td><td align=right>"
var vRxmX=noZUE.more_info
var Pteqr=WA_LinkToHref(vRxmX)
jwRUK+="<a "+Pteqr+" style='font-family:Arial;text-decoration:underline;font-weight:bold;font-size:12px;color:0000ff;'>"+Translator.tr("More product info link")+"</a>"
}
jwRUK+="</td></tr></table>"
jwRUK+="<br>"
var wCHtM=noZUE.obj.index
if(noZUE.unavail==false)
if(noZUE.options.length>0)
{
jwRUK+="<table border=0 cellspacing=0 cellpadding=0>"
for(var n=0;n<noZUE.options.length;n++)
{
var GoIil=noZUE.options[n]
if(GoIil)
{
jwRUK+="<tr><td align=right>"
jwRUK+="<span style='font-family:Arial;font-weight:bold;font-size:12px;"+lqUmh+"'>"
jwRUK+=GoIil.title+" :&nbsp;"
jwRUK+="</span>"
jwRUK+="</td><td align=left>"
jwRUK+="<select id='"+noZUE.obj.id+"-select-opt"+n+"' onchange=\"WA_market_changeCustomPrice('"+qXHEI+"',"+wCHtM+")\">"
jwRUK+="<option value=\"\">...</option>"
for(var SFaEd=0;SFaEd<GoIil.vals.length;SFaEd++)
{
var pbcwl=GoIil.vals[SFaEd]
jwRUK+="<option value=\""+SFaEd+"\">"+pbcwl+"</option>"
}
jwRUK+="</select>"
jwRUK+="</td></tr>";
}
}
jwRUK+="</table>"
}
jwRUK+="</td>"
jwRUK+="</tr>"
jwRUK+="</table>"
if(noZUE.description.length>0)
{
jwRUK+="<table border=0 width=100% cellpadding=4>"
jwRUK+="<tr><td colspan=2>"
jwRUK+="<span style='font-family:Arial;font-size:13px;"+lqUmh+"'>"
jwRUK+="<hr>"
jwRUK+=noZUE.description
jwRUK+="</span>"
jwRUK+="</td></tr>"
jwRUK+="</table>"
}
this.writeContent(jwRUK)
WA_market_changeCustomPrice(qXHEI,wCHtM)
}
GoKIk.displayWindowWithAutoResize(300,GoKIk.dshUm) 
}
function gmFbN(noZUE,VPYpV)
{
var LqVdO=new Array()
for(var i=0;i<3;i++)
{
var QZgfO=VPYpV+"-select-opt"
var dXNGa=document.getElementById(QZgfO+i)
LqVdO[i]=-1
if(dXNGa)
{
dXNGa.style.backgroundColor="";
var pbcwl=parseInt(dXNGa.value)
if(isNaN(pbcwl)==false)
LqVdO[i]=pbcwl
}
}
return omwmc(noZUE,LqVdO)
}
function omwmc(noZUE,LqVdO)
{
if(noZUE.unavail)return;
var MfmRs=false;
for(var i=0;i<noZUE.custom_prices.length;i++)
{
var UedOr=noZUE.custom_prices[i]
var guIRE=true;
for(var n=0;n<3;n++)
{
if(UedOr.tab[n]!=LqVdO[n])guIRE=false
}
if(guIRE)
{
MfmRs=UedOr;
break;
}
}
var mgvGO=noZUE.price
if(MfmRs)
{
mgvGO=MfmRs.pr
}
return mgvGO;
}
function WA_market_changeCustomPrice(qXHEI,wCHtM)
{
var ccMpK=lfdxN();
var EYQxC=wa_global_market.markets[qXHEI]
var PmYPS=EYQxC.info.products;
var noZUE=PmYPS[wCHtM]
if(noZUE.unavail)return;
var VPYpV=noZUE.obj.id
var mgvGO=gmFbN(noZUE,VPYpV)
var KtTFe=html_getLayer(VPYpV+"-price")
if(KtTFe)
{
KtTFe.innerHTML=ccMpK.oFChW(mgvGO)
}
}
function tdCGF()
{
var ccMpK=lfdxN();
if(WA_getNumberMarketItemsInCart()==0)return;
var GuJoH=ccMpK.CtEBU
if((ccMpK.nrEMv)&&(GuJoH.xLdpo=="paypal"))
{
rRSNi();
return;
}
ORRrG(iKVrF)
}
function ORRrG(cxrqD)
{
var ccMpK=lfdxN();
var GuJoH=ccMpK.CtEBU
GuJoH.tXXFV()
var GoKIk=new WA_Dialog();
GoKIk.cxrqD=cxrqD
GoKIk.aEHvh=function(jTpJC)
{
return Translator.tr("form-label-"+jTpJC)
}
GoKIk.onCustomKeypress=function(jTpJC)
{
if(jTpJC==13)
{
wa_timeout(Delegate.create(this,this.YdxAt),0);
}
return false;
}
GoKIk.XOaXO=function()
{
if(this.cxrqD==iKVrF)
{
WA_displayDialogMarketCart()
}
else
{
ORRrG(iKVrF)
}
}
GoKIk.TFruX=function()
{
rRSNi()
}
GoKIk.YdxAt=function()
{
var ccMpK=lfdxN();
var GuJoH=ccMpK.CtEBU
if(GuJoH.wAXIg(this.cxrqD)==false) return;
GuJoH.AXfvQ()
if(this.cxrqD==iKVrF)
{
if(GuJoH.gsmwm==true)
{
ORRrG(LtDJj)
}
else
{
this.TFruX()
}
}
else
{
this.TFruX()
}
}
GoKIk.ZmDea=function(jTpJC,scFxB)
{
if(scFxB==undefined) scFxB=""
if(scFxB)scFxB=" size="+scFxB
return "<input name='"+jTpJC+"' value=\""+GuJoH.QYlbW(jTpJC,this.cxrqD)+"\" type=text "+scFxB+">"
}
GoKIk.QdxGE=function(IhKEB)
{
return "<td width=150px align=right valign=top>"+Translator.tr(IhKEB)+" :</td>"
}
GoKIk.dshUm=function()
{
var ccMpK=lfdxN();
var GuJoH=ccMpK.CtEBU
this.addButton("< "+Translator.tr('Back'),this.XOaXO,[""],this)
this.addButton(Translator.tr('Continue')+" >",this.YdxAt,[""],this)
this.initializeWindow(600,600)
var FjpLi="form-label-"
var gMKZG=CONST_WA_GLOBAL_SETTINGS.list_form_fields 
var jwRUK=""
jwRUK+="<form id='wa-market-form' onSubmit='return false'>"
jwRUK+="<table border=0 width=100% cellspacing=5 style='font-family:Arial;font-size:15px;'>"
jwRUK+="<tr><td colspan=2 align=center style='font-size:18px;'>"
jwRUK+=Translator.tr((this.cxrqD==iKVrF)?"Fill Deliver information below":"Fill Billing information below")
jwRUK+="<br><br></td></tr>"
for(var n=0;n<gMKZG.length;n++)
{
var sPEmY=gMKZG[n]
if(sPEmY=="address")
{
jwRUK+="<tr>"+this.QdxGE("Address");
jwRUK+="<td>"
jwRUK+=this.ZmDea("address_1",30)
jwRUK+="</td></tr>"
jwRUK+="<tr><td></td><td>"
jwRUK+=this.ZmDea("address_2",30)
jwRUK+="</td></tr>"
jwRUK+="<tr>"+this.QdxGE("form-label-city");
jwRUK+="<td>"
jwRUK+=this.ZmDea("city")+"&nbsp;"+this.aEHvh("zip")+" : "+this.ZmDea("zip",10)
jwRUK+="</td></tr>" 
jwRUK+="<tr>"+this.QdxGE("form-label-country");
jwRUK+="<td>"
if(this.cxrqD==LtDJj)
{
jwRUK+="<select id='wa-select-form-country' onchange='WA_marketChangeFormCountry("+this.cxrqD+")'>"
var OWVkB=new Array();
var KJcBj=CONST_WA_COUNTRIES.codes
for(var SFaEd=0;SFaEd<KJcBj.length;SFaEd++)
{
var pKxlX=KJcBj[SFaEd]
OWVkB.push({code:pKxlX,lab:Translator.country(pKxlX)})
}
OWVkB.sort(TMLPd)
var XBejD=GuJoH.bsvQr()
XBejD=GuJoH.QYlbW('countryCode',this.cxrqD,XBejD)
for(var SFaEd=0;SFaEd<OWVkB.length;SFaEd++)
{
var mxGwk=OWVkB[SFaEd]
var pKxlX=mxGwk.code
jwRUK+="<option "
if(XBejD==pKxlX)jwRUK+="selected "
jwRUK+="value=\""+pKxlX+"\">"+Translator.country(pKxlX)+"</option>"
}
jwRUK+="</select>"
}
else
{
jwRUK+=Translator.country(ccMpK.CtEBU.iLPmJ);
}
jwRUK+="<br><span id='wa-market-state'>"
jwRUK+="<select id='wa-select-state'></select>"
jwRUK+="</span>" 
jwRUK+="</td></tr>"
}
else
{
jwRUK+="<tr>"+this.QdxGE("form-label-"+sPEmY);
jwRUK+="<td>"
jwRUK+=this.ZmDea(sPEmY,30) 
jwRUK+="</td></tr>"
}
}
if(this.cxrqD==iKVrF)
{
jwRUK+="<tr><td colspan=2 align=center >"
jwRUK+=Translator.tr("Billing adress is different")+" <input type=checkbox "
if(ccMpK.CtEBU.gsmwm)jwRUK+="checked "
jwRUK+="onchange='WA_marketCheckBillingAdress(this)'>"
jwRUK+="</td></tr>"
}
jwRUK+="</table>"
jwRUK+="</form>"
this.writeContent(jwRUK)
WA_exec_callback_opera_compliant(this,this.RHbnw) 
}
GoKIk.RHbnw=function()
{
WA_marketChangeFormCountry(this.cxrqD)
}
GoKIk.dshUm()
}
function FEjgT(cxrqD,dXNGa,EBtSm)
{
var ccMpK=lfdxN();
var GuJoH=ccMpK.CtEBU
var Tenqd=GuJoH.QYlbW("stateCode",cxrqD) 
dXNGa.options.length=0
for(var n=0;n<EBtSm.length;n++)
{
var val=EBtSm[n]
var elOptNew=document.createElement('option');
elOptNew.value=val;
if(val.length==0)val="--- "+Translator.tr("form-label-state")+" ---"
elOptNew.text=val;
if(elOptNew.value==Tenqd)elOptNew.selected=true
try{
dXNGa.add(elOptNew,null);
}
catch(ex){
dXNGa.add(elOptNew);
}
}
}
function WA_marketChangeFormCountry(cxrqD)
{
var ccMpK=lfdxN();
var GuJoH=ccMpK.CtEBU
var LZwno=GuJoH.iLPmJ
var dXNGa=document.getElementById("wa-select-form-country");
if(dXNGa) LZwno=dXNGa.value;
html_SetDisplay("wa-market-state",(LZwno=="US")||(LZwno=="CA")||(LZwno=="BR"))
var Gbgsk=document.getElementById("wa-select-state");
if(Gbgsk)
{
if(LZwno=="US") FEjgT(cxrqD,Gbgsk,["","Alabama","Alaska","Arizona","Arkansas","Armed Forces Americas(exc.Canada)","Armed Forces Eur, ME, Afr, CDN","Armed Forces Pacific","California","Colorado","Connecticut","D.C.","Delaware","Florida","Georgia","Hawaii","Idaho","Illinois","Indiana","Iowa","Kansas","Kentucky","Louisiana","Maine","Maryland","Massachusetts","Michigan","Minnesota","Mississippi","Missouri","Montana","Nebraska","Nevada","New Hampshire","New Jersey","New Mexico","New York","North Carolina","North Dakota","Ohio","Oklahoma","Oregon","Pennsylvania","Rhode Island","South Carolina","South Dakota","Tennessee","Texas","Utah","Vermont","Virginia","Washington(State)","West Virginia","Wisconsin","Wyoming"])
if(LZwno=="CA") FEjgT(cxrqD,Gbgsk,["","Alberta","British Columbia","Manitoba","New Brunswick","Newfoundland and Labrador","Northwest Territories","Nova Scotia","Nunavut","Ontario","Prince Edward Isl.","Quebec","Saskatchewan","Yukon Territory"])
if(LZwno=="BR") FEjgT(cxrqD,Gbgsk,["","Acre(AC)","Alagoas(AL)","Amapá(AP)","Amazonas(AM)","Bahia(BA)","Ceará(CE)","Espírito Santo(ES)","Goiás(GO)","Maranhão(MA)","Mato Grosso(MT)","Mato Grosso do Sul(MS)","Minas Gerais(MG)","Pará(PA)","Paraíba(PB)","Paraná(PR)","Pernambouc(PE)","Piauí(PI)","Rio de Janeiro(RJ)","Rio Grande do Norte(RN)","Rio Grande do Sul(RS)","Rondônia(RO)","Roraima(RR)","Santa Catarina(SC)","São Paulo(SP)","Sergipe(SE)","Tocantins(TO)","District fédéral(DF)"])
}
}
function WA_marketCheckBillingAdress(YMXKg)
{
var ccMpK=lfdxN();
var GuJoH=ccMpK.CtEBU
GuJoH.gsmwm=YMXKg.checked
GuJoH.AXfvQ()
}
function rRSNi()
{
var ccMpK=lfdxN();
var GuJoH=ccMpK.CtEBU
var wQYSI=CONST_WA_GLOBAL_SETTINGS.currency_info 

var GoKIk=new WA_Dialog();
GoKIk.XOaXO=function()
{
if(this.GuJoH.xLdpo=="paypal")
{
WA_displayDialogMarketCart();return;
}
if(this.GuJoH.gsmwm)
ORRrG(LtDJj)
else
ORRrG(iKVrF)
}
GoKIk.EHBZi=function(mQrcd,pbcwl)
{
pbcwl=""+pbcwl
pbcwl=pbcwl.replace(/'/g,"&lsquo;")
return "<input type=hidden name='"+mQrcd+"' value=\""+pbcwl+"\">"
}
GoKIk.dYKHW=function()
{
var ccMpK=lfdxN();
var jwRUK=""
if(wQYSI.charCodeAt(3)>=100) return""
jwRUK+="<form id='wa-http-sender' method=POST action='https://www.paypal.com/cgi-bin/webscr' target='_blank'>"
jwRUK+=this.EHBZi("cmd","_cart")
jwRUK+=this.EHBZi("business",CONST_WA_GLOBAL_SETTINGS.email_paypal_account)
jwRUK+=this.EHBZi("upload","1")
jwRUK+=this.EHBZi("charset","utf-8")
jwRUK+=this.EHBZi("no_note","0")
jwRUK+=this.EHBZi("currency_code",CONST_WA_GLOBAL_SETTINGS.currency_code)
jwRUK+=this.EHBZi("no_shipping","2")
var emPEu=ccMpK.KaRRN()
for(var i=0;i<emPEu.length;i++)
{
var info=emPEu[i];
var index=i+1;
var xLaML=info.xQcrE();
if(ccMpK.IMbUB())
{
var tegEN=ccMpK.ZMhfk(ccMpK.CkdtY(xLaML));
xLaML=xLaML-tegEN;
}
jwRUK+=this.EHBZi("amount_"+index,""+xLaML)
jwRUK+=this.EHBZi("quantity_"+index,info.heNBi)
var VBAVN=0;
if(info.HwDBn.length>0)
{
jwRUK+=this.EHBZi("on"+VBAVN+"_"+index,"ref")
jwRUK+=this.EHBZi("os"+VBAVN+"_"+index,info.HwDBn)
VBAVN++;
}
var vpYdo=""
if(info.m_opt_vals)
{
for(var i_opt=0;i_opt<info.noZUE.options.length;i_opt++)
{
var GoIil=info.noZUE.options[i_opt]
if(GoIil)
{
var MhCJW=info.m_opt_vals[i_opt];
var whpHB=GoIil.vals[MhCJW]
var tqqQo=GoIil.title;
if(tqqQo.length==0) tqqQo="opt"+(i_opt+1);
jwRUK+=this.EHBZi("on"+VBAVN+"_"+index,tqqQo)
jwRUK+=this.EHBZi("os"+VBAVN+"_"+index,whpHB)
if(vpYdo.length>0)vpYdo=vpYdo+", "
vpYdo+=whpHB
VBAVN++;
}
}
}
var BraKa=info.cpFgp;
if(vpYdo.length>0)BraKa=BraKa+"("+vpYdo+")"
jwRUK+=this.EHBZi("item_name_"+index,BraKa) 
}
var fFhqd=ccMpK.jHfhY()
if(ccMpK.IMbUB())
{
fFhqd=fFhqd-ccMpK.ZMhfk(ccMpK.CkdtY(fFhqd));
}
if(ccMpK.IMbUB())
{
var JOPqZ=ccMpK.KboKW();
var AoenO=ccMpK.jHfhY()
var bwnFu=JOPqZ+AoenO;
var IOpiN=ccMpK.ZMhfk(ccMpK.CkdtY(bwnFu));
var uIWtP=bwnFu-IOpiN;
uIWtP=uIWtP-fFhqd;
var MQMeM=0;
for(var i=0;i<emPEu.length;i++)
{
var info=emPEu[i];
var index=i+1;
var WJqsA=0;
var crSAm=0;
var xLaML=info.heNBi*info.xQcrE();
var n0=ccMpK.pCGtu()/100;
var tax=xLaML*(n0/(1+n0));
xLaML=xLaML-tax;
WJqsA=xLaML;
var JKAFA=info.xQcrE();
var tegEN=ccMpK.ZMhfk(ccMpK.CkdtY(JKAFA));
JKAFA=JKAFA-tegEN;
crSAm=info.heNBi*JKAFA;
if(crSAm>WJqsA)
{
JKAFA=info.m_price;
JKAFA=JKAFA-tegEN;
var gbPCI=JKAFA;
if((gbPCI>0)&&(gbPCI!=info.xQcrE()))
{
gbPCI=gbPCI-0.01;
}
jwRUK+=this.EHBZi("amount_"+index,gbPCI) 
crSAm=info.m_quantity*gbPCI;
}
MQMeM+=crSAm;
}
var CfsTJ=ccMpK.ZMhfk(uIWtP-MQMeM);
if(CfsTJ>0)
{
var index=emPEu.length+1;
jwRUK+=this.EHBZi("item_name_"+index,Translator.tr("TVA correction"))
jwRUK+=this.EHBZi("quantity_"+index,1)
jwRUK+=this.EHBZi("amount_"+index,CfsTJ)
}
jwRUK+=this.EHBZi("tax_cart",IOpiN)
}
else
{
jwRUK+=this.EHBZi("tax_cart",ccMpK.bURNg())
}
jwRUK+=this.EHBZi("handling_cart",fFhqd) 
jwRUK+="</form>"
return jwRUK;
}
GoKIk.bBRxu=function()
{
var hbcZQ=this.hpHWN(iKVrF);
var jwRUK="";
if(hbcZQ.length>0)
{
jwRUK+=""+Translator.tr("Shipping information")+":\n";
jwRUK+=hbcZQ;
}
return jwRUK;
}
GoKIk.IxvuH=function()
{
var hbcZQ=this.hpHWN(LtDJj);
var jwRUK="";
if(hbcZQ.length>0)
{
jwRUK+=Translator.tr("Billing information")+":\n";
jwRUK+=hbcZQ;
}
return jwRUK;
}
GoKIk.hpHWN=function(cxrqD)
{
var ccMpK=lfdxN();
var jwRUK="";
var oswWV=new Array();
var gMKZG=ulknh(CONST_WA_GLOBAL_SETTINGS.list_form_fields)
gMKZG.push("country")
gMKZG.push("state")
for(var i=0;i<gMKZG.length;i++)
{
var ReQaC=gMKZG[i];
oswWV[ReQaC]=this.GuJoH.QYlbW(ReQaC,cxrqD)
}
if(oswWV["firstname"])jwRUK+=oswWV["firstname"]+"\n"
if(oswWV["lastname"])jwRUK+=oswWV["lastname"]+"\n"
if(oswWV["company"])
{
jwRUK+=Translator.tr("form-label-company")+" : "+oswWV["company"]+"\n"
}
if(oswWV["fiscal_code"]) jwRUK+=Translator.tr("form-label-fiscal_code")+" : "+oswWV["fiscal_code"]+"\n"
if(oswWV["tva"]) jwRUK+=Translator.tr("form-label-tva")+" : "+oswWV["tva"]+"\n"
if(oswWV["address_1"]) jwRUK+=oswWV["address_1"]+"\n"
if(oswWV["address_2"]) jwRUK+=oswWV["address_2"]+"\n"
if(oswWV["zip"]) jwRUK+=oswWV["zip"]+" "
if(oswWV["city"]) jwRUK+=oswWV["city"]+"\n"
if(oswWV["country"])jwRUK+=Translator.country(oswWV["country"])
if(oswWV["state"]&&oswWV["state"].length>0) jwRUK+=" "+oswWV["state"];
jwRUK+="\n"
if(oswWV["phone"]) jwRUK+=Translator.tr("form-label-phone")+" : "+oswWV["phone"]+"\n"
if(oswWV["fax"]) jwRUK+=Translator.tr("form-label-fax")+" : "+oswWV["fax"]+"\n"
if(oswWV["email"]) jwRUK+=oswWV["email"]+"\n" 
if(oswWV["comment"])
{
jwRUK+=Translator.tr("form-label-comment")+" : \n";
jwRUK+=oswWV["comment"]+"\n"
}
return jwRUK;
}
GoKIk.cZMsC=function()
{
var ccMpK=lfdxN();
var jwRUK="";
var emPEu=ccMpK.KaRRN();
jwRUK+="**************\n"
for(var i=0;i<emPEu.length;i++)
{
var GuJoH=emPEu[i];
var index=i+1;
var BraKa=GuJoH.cpFgp;
if(GuJoH.HwDBn.length>0)
{
BraKa+=" ["+GuJoH.HwDBn+"]";
}
var vpYdo=""
if(GuJoH.m_opt_vals)
{
for(var i_opt=0;i_opt<GuJoH.noZUE.options.length;i_opt++)
{
var GoIil=GuJoH.noZUE.options[i_opt]
if(GoIil)
{
if(vpYdo.length>0)vpYdo=vpYdo+", "
var MhCJW=GuJoH.m_opt_vals[i_opt];
var whpHB=GoIil.vals[MhCJW]
var tqqQo=GoIil.title;
if(tqqQo.length>0) vpYdo+=tqqQo+" : "
vpYdo+=whpHB
}
}
}
if(vpYdo.length>0)BraKa=BraKa+"\n("+vpYdo+")"
jwRUK+=BraKa;
jwRUK+="\n"
jwRUK+=Translator.tr("Price")+" : "+ccMpK.MjgxZ(GuJoH.xQcrE())+"\n"
jwRUK+=Translator.tr("Quantity")+" : "+GuJoH.heNBi+"\n"
jwRUK+=Translator.tr("Total")+" : "+ccMpK.MjgxZ(GuJoH.xQcrE()*GuJoH.heNBi);
jwRUK+="\n"
jwRUK+="**************\n"
}
var tUGBK=ccMpK.KboKW()
var SSXdB=ccMpK.bURNg()
var GNYaY=ccMpK.jHfhY()
var JUWKb=ccMpK.ueZgE()
var CxrSp=ccMpK.Ddrsq() 
jwRUK+=Translator.tr("Sub total")+" : "+ccMpK.MjgxZ(tUGBK)+"\n";
if(CONST_WA_GLOBAL_SETTINGS.shipping_type!=KsKZT)
{
jwRUK+=Translator.tr("Shipping amount")+" : "+ccMpK.MjgxZ(GNYaY)+"\n";
}
if(ccMpK.IMbUB()||ccMpK.wGAAf())
{
if(ccMpK.IMbUB())
{
jwRUK+=Translator.tr("Tax included");
}
if(ccMpK.wGAAf())
{
jwRUK+=Translator.tr("Extra Tax");
}
jwRUK+=" : ";
jwRUK+=ccMpK.MjgxZ(SSXdB)+"\n";
}
if(CxrSp>0)
{
jwRUK+=Translator.tr("Promotion")+" : - "+ccMpK.MjgxZ(CxrSp)+"\n";
}
jwRUK+=Translator.tr("Total")+" : "+ccMpK.MjgxZ(JUWKb)+"\n";
return jwRUK;
}
GoKIk.EFQam=function()
{
var ccMpK=lfdxN();
var jwRUK="";
var emPEu=ccMpK.KaRRN()
jwRUK+="<table class=\"wa-cart-global-table\">"
jwRUK+="<tr class=\"wa-cart-title\">"
jwRUK+="<td>&nbsp;</td>"
jwRUK+="<td>"+Translator.tr("Price")+"</td>"
jwRUK+="<td>"+Translator.tr("Quantity")+"</td>"
jwRUK+="<td>"+Translator.tr("Total")+"</td>"
jwRUK+="</tr>"
for(var i=0;i<emPEu.length;i++)
{
jwRUK+="<tr>"
var GuJoH=emPEu[i];
var index=i+1;
jwRUK+="<td>"
var BraKa=GuJoH.cpFgp;
if(GuJoH.HwDBn.length>0)
{
BraKa+=" ["+GuJoH.HwDBn+"]";
}
BraKa="<b>"+BraKa+"</b>"
var vpYdo=""
if(GuJoH.m_opt_vals)
{
for(var i_opt=0;i_opt<GuJoH.noZUE.options.length;i_opt++)
{
var GoIil=GuJoH.noZUE.options[i_opt]
if(GoIil)
{
if(vpYdo.length>0)vpYdo=vpYdo+", "
var MhCJW=GuJoH.m_opt_vals[i_opt];
var whpHB=GoIil.vals[MhCJW]
var tqqQo=GoIil.title;
if(tqqQo.length>0) vpYdo+=tqqQo+" : "
vpYdo+=whpHB
}
}
}
if(vpYdo.length>0)BraKa=BraKa+"<br><span class=\"wa-cart-option\">("+vpYdo+")</span>"
jwRUK+=BraKa;
jwRUK+="</td>"
jwRUK+="<td>"+ccMpK.oFChW(GuJoH.xQcrE())+"</td>"
jwRUK+="<td>"+GuJoH.heNBi+"</td>"
jwRUK+="<td>"+ccMpK.oFChW(GuJoH.xQcrE()*GuJoH.heNBi)+"</td>"
jwRUK+="</tr>"
}
jwRUK+="<tr><td colspan=4>"
var tUGBK=ccMpK.KboKW()
var SSXdB=ccMpK.bURNg()
var GNYaY=ccMpK.jHfhY()
var JUWKb=ccMpK.ueZgE()
var CxrSp=ccMpK.Ddrsq() 
jwRUK+="<table class=\"wa-cart-table-total\">"
jwRUK+="<tr><td align=right >"+Translator.tr("Sub total")+" : "+ccMpK.oFChW(tUGBK)+"</td></tr>";
if(CONST_WA_GLOBAL_SETTINGS.shipping_type!=KsKZT)
{
jwRUK+="<tr><td align=right>"+Translator.tr("Shipping amount")+" : "+ccMpK.oFChW(GNYaY)+"</td></tr>";
}
if(ccMpK.IMbUB()||ccMpK.wGAAf())
{
if(ccMpK.IMbUB())
{
jwRUK+="<tr><td align=left >"+Translator.tr("Tax included");
}
if(ccMpK.wGAAf())
{
jwRUK+="<tr><td align=right >"+Translator.tr("Extra Tax");
}
jwRUK+=" : ";
jwRUK+=ccMpK.oFChW(SSXdB)+"</td></tr>";
}
if(CxrSp>0)
{
jwRUK+="<tr><td align=right class=\"wa-cart-promo\">"+Translator.tr("Promotion")+" : - "+ccMpK.oFChW(CxrSp)+"</td></tr>";
}
jwRUK+="<tr><td align=right class=\"wa-cart-total\">"+Translator.tr("Total")+" : "+ccMpK.oFChW(JUWKb)+"</td></tr>";
jwRUK+="</table>" 
jwRUK+="</td></tr>"
jwRUK+="</table>"
jwRUK=jwRUK.replace(/\"/g,"’")
return jwRUK;
}
GoKIk.Mbmqs=function(pbcwl)
{
if((""+pbcwl).length==1)pbcwl="0"+pbcwl;
return pbcwl
}
GoKIk.KoCdK=function()
{
var ccMpK=lfdxN();
var jwRUK=""
if(wQYSI.charCodeAt(3)>=100) return""
if(RompH)
{
jwRUK+="<form id='wa-http-sender' method=POST action='"+RompH_URL+"crbst_market_print_form.php' target='_blank'>"
}
else
{
jwRUK+="<form id='wa-http-sender' method=POST action='crbst_market_print_form.php' target='_blank'>"
}
jwRUK+=this.EHBZi("type_payment",this.GuJoH.xLdpo)
jwRUK+=this.EHBZi("MAIL_TITLE_PREFIXE",Translator.tr("title email Order notification"))
jwRUK+=this.EHBZi("MAIN_TITLE",Translator.tr("PRINT_FORM_MAIN_TITLE"))
jwRUK+=this.EHBZi("PREFIXE_ORDER",Translator.tr("PRINT_FORM_PREFIXE_ORDER"))
var ZPMMl=""
var ZLuXV=new Date()
ZPMMl+="wa-"+this.Mbmqs(ZLuXV.getYear()-100)+this.Mbmqs(ZLuXV.getMonth()+1)+this.Mbmqs(ZLuXV.getDate())
ZPMMl+=ZLuXV.getHours()+this.Mbmqs(ZLuXV.getMinutes())+this.Mbmqs(ZLuXV.getSeconds())
ZPMMl+="-"+Math.round(Math.random()*100) 
jwRUK+=this.EHBZi("ID_ORDER",ZPMMl)
jwRUK+=this.EHBZi("CARD_TITLE",Translator.tr("PRINT_FORM_CARD_TITLE"))
jwRUK+=this.EHBZi("LABEL_TYPE_PAYMENT",Translator.tr("PRINT_FORM_LABEL_TYPE_PAYMENT"))
jwRUK+=this.EHBZi("send_copy_email_to_buyer",(ccMpK.send_copy_email_to_buyer)?"1":"0") 

var oswWV=new Array();
var gMKZG=ulknh(CONST_WA_GLOBAL_SETTINGS.list_form_fields)
gMKZG.push("country")
gMKZG.push("state")
for(var i=0;i<gMKZG.length;i++)
{
var ReQaC=gMKZG[i];
oswWV[ReQaC]=ccMpK.CtEBU.QYlbW(ReQaC,iKVrF)
}
jwRUK+=this.EHBZi("form_first_name",oswWV["firstname"]);
jwRUK+=this.EHBZi("form_last_name",oswWV["lastname"]);
jwRUK+=this.EHBZi("form_address1",oswWV["address_1"]);
jwRUK+=this.EHBZi("form_address2",oswWV["address_2"]);
jwRUK+=this.EHBZi("form_city",oswWV["address_2"]);
jwRUK+=this.EHBZi("form_zip",oswWV["zip"]);
jwRUK+=this.EHBZi("form_state",oswWV["state"]);
jwRUK+=this.EHBZi("form_country",oswWV["country"]);
jwRUK+=this.EHBZi("form_company",oswWV["company"]);
jwRUK+=this.EHBZi("form_fiscal_code",oswWV["fiscal_code"]);
jwRUK+=this.EHBZi("form_tva",oswWV["tva"]);
jwRUK+=this.EHBZi("form_phone",oswWV["phone"]);
jwRUK+=this.EHBZi("form_fax",oswWV["fax"]);
jwRUK+=this.EHBZi("CARD_TOTAL_PRICE",ccMpK.ueZgE());
jwRUK+=this.EHBZi("CARD_CURRENCY",CONST_WA_GLOBAL_SETTINGS.currency_code);
jwRUK+=this.EHBZi("CARD_LANG",Translator.m_lang);
jwRUK+=this.EHBZi("LABEL_PROCESS_ORDER",Translator.tr("PRINT_FORM_PROCESS_ORDER"));
jwRUK+=this.EHBZi("wa_promo_code",ccMpK.CtEBU.twFTg);
jwRUK+=this.EHBZi("email_buyer",this.GuJoH.QYlbW("email",iKVrF))
if(this.GuJoH.xLdpo=="custom")
{
jwRUK+=this.EHBZi("TYPE_PAYMENT",Translator.tr("PRINT_FORM_TYPE_CUSTOM"))
}
if(this.GuJoH.xLdpo=="check")
{
jwRUK+=this.EHBZi("TYPE_PAYMENT",Translator.tr("PRINT_FORM_TYPE_CHECK"))
jwRUK+=this.EHBZi("MESSAGE_CHECK",Translator.tr("PRINT_FORM_MESSAGE_CHECK"))
}
if(this.GuJoH.xLdpo=="wire")
{
jwRUK+=this.EHBZi("TYPE_PAYMENT",Translator.tr("PRINT_FORM_TYPE_WIRE"))
jwRUK+=this.EHBZi("MESSAGE_WIRE",Translator.tr("PRINT_FORM_MESSAGE_WIRE"))
}
if(this.GuJoH.xLdpo=="paypal")
{
jwRUK+=this.EHBZi("LABEL_PAYPAL_CART_TITLE",Translator.tr("PRINT_FORM_PAYPAL_CART_TITLE"));
jwRUK+=this.EHBZi("TYPE_PAYMENT","Paypal")
jwRUK+=this.EHBZi("MESSAGE_PAYPAL",Translator.tr("PRINT_FORM_MESSAGE_PAYPAL"))
}
jwRUK+=this.EHBZi("LABEL_PRINT",Translator.tr("PRINT_FORM_LABEL_PRINT"))
jwRUK+=this.EHBZi("card_html",this.EFQam())
jwRUK+=this.EHBZi("card_plain_text",this.cZMsC())
jwRUK+=this.EHBZi("LABEL_SELLER_INFORMATION",Translator.tr("Seller information"))
jwRUK+=this.EHBZi("LABEL_BANK_ACCOUNT",Translator.tr("Bank account information"))
jwRUK+=this.EHBZi("LABEL_ADDRESS",Translator.tr("Address"))
jwRUK+=this.EHBZi("seller_address",CONST_WA_GLOBAL_SETTINGS.seller_address)
jwRUK+=this.EHBZi("bank_account_informations",CONST_WA_GLOBAL_SETTINGS.bank_account_informations)
jwRUK+=this.EHBZi("buyer_info_shipping",this.bBRxu())
var uwuqI=""
if(GuJoH.gsmwm)
{
uwuqI=this.IxvuH();
};
jwRUK+=this.EHBZi("buyer_info_billing",uwuqI)
jwRUK+="</form>"
return jwRUK;
}
GoKIk.OmbpH=function()
{
var ccMpK=lfdxN();
ccMpK.Cnciu()
this.closeWin()
}
GoKIk.dshUm=function()
{
var ccMpK=lfdxN();
var OdaIM=true;
if(this.GuJoH.xLdpo=="paypal")
if((ccMpK.nrEMv==true)&&(CONST_WA_GLOBAL_SETTINGS.list_promo_codes==false))
{
OdaIM=true;
}
if((OdaIM==false)&&(this.GuJoH.xLdpo=="paypal"))
{
this.addButton(Translator.tr('Clear cart'),this.OmbpH,[""],this)
this.initializeWindow(400,200)
}
else
{
this.initializeWindow(400,150)
}
var jwRUK=""
if((OdaIM==false)&&(this.GuJoH.xLdpo=="paypal"))
{
jwRUK+=this.dYKHW()
}
if(OdaIM)
{
jwRUK+=this.KoCdK()
if((RompH==false)&&(document.webaca_is_preview))
{
WA_Dialog.alert(Translator.tr("Operation not allowed in preview mode"))
return
}
}
jwRUK+="<table border=0 style='width:100%;'><tr>";
jwRUK+="<td align=center style='"+this.cssText1()+"'>"
jwRUK+=Translator.tr("You have been redirected to the payment page")
if((OdaIM==false)&&(this.GuJoH.xLdpo=="paypal"))
{
jwRUK+="<br><br>"
jwRUK+=Translator.tr("You can clear your cart")
}
jwRUK+="</td></tr></table>"
this.writeContent(jwRUK) 
if(wQYSI.charCodeAt(3)>=100)
{
WA_Dialog.alert(Translator.tr("This cariboost edition can't support ebusiness features !'"))
return;
}
var IVuhe=document.getElementById("wa-http-sender")
IVuhe.submit()
if(OdaIM)
{
ccMpK.Cnciu()
}
}
GoKIk.GuJoH=GuJoH
GoKIk.dshUm()
}

-->
