<!--

var qbNVg=0
var ElsdZ=1
var DNIPW=2
var jxaga=0;
var tAllf=1;
var wcHEQ=2;
var TmaKQ=0
var diKSd=1
var PcOOt=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(bIrLH)
{
HFBJY().MLEjT(bIrLH)
var lmDOt=WA_Dialog.getCurrent();
lmDOt.vUCua()
}
function HFBJY()
{
if(document.wa_global_settings_market==undefined)document.wa_global_settings_market=new rvCiB()
return document.wa_global_settings_market;
}
function agXAM()
{
this.PxXBN=function()
{
return this.cZqSr+"-"+this.TsNtU_index
}
this.GwtvA=function(lmQvG,ZSDjW)
{
this.TsNtU=lmQvG.obj.market.info.folder.substring(13);
this.TsNtU_index=lmQvG.obj.index;
this.TsNtU_modif=lmQvG.obj.market.info.critical_id_modif
this.cZqSr=lmQvG.obj.market.id 

this.mNSYE=1;
this.wYTnM=lmQvG.title;
this.gsmte=lmQvG.price;
this.gjFPM=lmQvG.weight;
this.AaRDN=lmQvG.code_product;
}
this.jBAQP=function(lmQvG,ZSDjW)
{

this.wYTnM=lmQvG.title;
this.gsmte=lmQvG.price;
this.gjFPM=lmQvG.weight;
this.AaRDN=lmQvG.code_product;
}
this.rrTWj=function()
{
var s="";
s+=this.PxXBN();
if(this.m_opt_vals)
for(var i=0;i<this.m_opt_vals.length;i++)
{
var XZrTd=this.m_opt_vals[i]
if(XZrTd!=-1) s+="/"+XZrTd;
}
return s;
}
this.KhBpQ=function()
{
var val="";
val+="j="+this.TsNtU+",";
val+="i="+this.TsNtU_index+",";
val+="m="+this.TsNtU_modif+",";
val+="q="+this.mNSYE+",";
if(this.m_opt_vals)
{
for(var i=0;i<this.m_opt_vals.length;i++)
{
val+="o"+i+"=";
var rqmtu=this.m_opt_vals[i]
if(rqmtu>-1)
val+=rqmtu
else
val+=""
val+=","
}
}
return val;
}
this.lnFYl=function(map,k)
{
var v=map[k];
if(v=="undefined") return "";
return v;
}
this.EmYcD=function(map)
{
this.TsNtU=this.lnFYl(map,"j");
if(this.TsNtU=="") return false;
this.TsNtU_index=this.lnFYl(map,"i");
this.TsNtU_modif=this.lnFYl(map,"m");
this.mNSYE=parseInt(map["q"]);
this.m_opt_vals=new Array();
for(var i=0;i<3;i++)
{
var wrlFT=parseInt(map["o"+i]);
if(isNaN(wrlFT))wrlFT=-1;
this.m_opt_vals.push(wrlFT)
}
return true;
}
this.kNunE=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.eHKvS=function(mBKWx)
{
var espHl=this.kNunE(mBKWx)
return this.EmYcD(espHl) 
}
this.aLJgd=function()
{
return RtHLe(this.lmQvG,this.m_opt_vals)
}
}
function rTMLS(tbVvU,TsNjP)
{
var iaObo=tbVvU[0]
var bSiCf=tbVvU[1]
var IABHb=tbVvU[2]
if(iaObo.length==0)
{
IABHb.call(bSiCf)
return;
}
var js=iaObo.pop()
WA_loadScript(js.src,rTMLS,[iaObo,bSiCf,IABHb]);
}
function WA_arrayContains(sTUQL,mBKWx)
{
for(var n=0;n<sTUQL.length;n++){if(sTUQL[n]==mBKWx)return true;}
return false;
}
function Hfkeg(sTUQL)
{
var espHl=new Array()
for(var n=0;n<sTUQL.length;n++)
{
var MkEZs=sTUQL[n]
if(MkEZs=="address") espHl=espHl.concat(["address_1","address_2","city","zip"])
else espHl.push(MkEZs)
}
return espHl;
}
function BESMo()
{
this.MpAgN=function()
{
if(this.SSpDL.length==0)return CONST_WA_GLOBAL_SETTINGS.default_selected_country;
return this.SSpDL;
}
this.FOfWi=function()
{
this.gKYwt()
}
this.kNunE=function(s)
{
var OsVQX=new Array();
var tab=s.split(",");
for(var i=0;i<tab.length;i++)
{
var tab3=tab[i].split("=");
if(tab3.length==2)OsVQX[tab3[0]]=tab3[1];
}
return OsVQX;
}
this.pwfJm=function(cMpkq)
{
if(cMpkq==undefined) return ""
return(cMpkq==TmaKQ)?"deliv-":"bill-"
}
this.jJZTR=function(XjqJk,cMpkq,SFXBo)
{
if(!SFXBo)SFXBo=""
var CuiZR=this.pwfJm(cMpkq)
if(XjqJk=="country")
{
if(cMpkq==TmaKQ) return this.SSpDL
if(cMpkq==diKSd) XjqJk="countryCode"
}
if(XjqJk=="state")
{
XjqJk="stateCode"
}
var XZrTd=this.TZxmJ[CuiZR+XjqJk]
if(!XZrTd) return SFXBo
XZrTd=XZrTd.replace(/\"/g,"'")
return XZrTd
}
this.uCKnV=function(XZrTd)
{
if(XZrTd==undefined)return ""
return XZrTd
}
this.JnfZw=function(key,val)
{
if((val==null)||(val==undefined)) val="";
WA_SetCookie("crbst-card-"+key,val)
}
this.jmrmW=function(key)
{
var bSiCf=WA_GetCookie("crbst-card-"+key)
if(bSiCf=="null")bSiCf="";
return ""+bSiCf
}
this.oglaP=function()
{
this.TZxmJ=new Array()
var mBKWx=this.jmrmW("order-infos")
var espHl=this.kNunE(mBKWx)
for(var k1 in espHl)
{
var XZrTd=espHl[k1]
if((k1.indexOf("deliv-")==0)||(k1.indexOf("bill-")==0))
this.TZxmJ[k1]=unescape(XZrTd)
}
this.SSpDL=this.uCKnV(espHl["countryCode"])
if(this.vxrCM.length==0)
{
this.vxrCM=this.uCKnV(espHl["typePayment"])
}
this.buTQu=(this.uCKnV(espHl["differentBillingAddressChecked"])=="true")
this.MmOFM=(this.uCKnV(espHl["salesConditionChecked"])=="true")
}
this.gKYwt=function()
{
var mBKWx=""
for(var k1 in this.TZxmJ)
{
var XZrTd=this.TZxmJ[k1]
mBKWx+=k1+"="+escape(XZrTd)+","
}
var xcrDQ=""
xcrDQ+="countryCode="+escape(this.SSpDL)+","
xcrDQ+="typePayment="+escape(this.vxrCM)+","
xcrDQ+="differentBillingAddressChecked="+(this.buTQu)+","
xcrDQ+="salesConditionChecked="+(this.MmOFM)+","
mBKWx+=xcrDQ 
this.JnfZw("order-infos",mBKWx)
}
this.WeEVd=function(EgcaV)
{
if(trimString(EgcaV.value).length==0)
{
EgcaV.style.backgroundColor="#ff0000"
EgcaV.focus()
return false;;
}
EgcaV.style.backgroundColor=""
return true;
}
this.OFwMc=function(cMpkq)
{
var rWbqb=Hfkeg(CONST_WA_GLOBAL_SETTINGS.list_form_fields)
var jILGQ=Hfkeg(CONST_WA_GLOBAL_SETTINGS.list_mandatory_form_fields) 
var UAQHC=this.TZxmJ;
var CuiZR=this.pwfJm(cMpkq) 
var qdFGJ=document.getElementById("wa-market-form")
for(var n=0;n<rWbqb.length;n++)
{
var erTFF=rWbqb[n]
var kVXHl=qdFGJ[erTFF]
var XZrTd=trimString(kVXHl.value)
if(erTFF!="address_2")
if(WA_arrayContains(jILGQ,erTFF))
{
if(this.WeEVd(kVXHl)==false)return false;
}
UAQHC[CuiZR+erTFF]=XZrTd
}
var muLOV=document.getElementById("wa-select-state");
var iGNvp=document.getElementById("wa-market-state");
if(muLOV&&(iGNvp.style.display!="none"))
{
if(this.WeEVd(muLOV)==false)return false;
UAQHC[CuiZR+"stateCode"]=muLOV.value
}
else
{
UAQHC[CuiZR+"stateCode"]=""
}
if(cMpkq==diKSd)
{
var keGpN=document.getElementById("wa-select-form-country");
if(keGpN)
{
UAQHC[CuiZR+"countryCode"]=keGpN.value
}
}
this.gKYwt()
return true;
}
this.FHBJh=""
this.SSpDL=""
this.vxrCM=""
this.buTQu=false;
this.MmOFM=false
this.oglaP()
}
function rvCiB()
{
this.LTMCE=new Array();
this.bSiCf_callback=false;
this.xEoaO=false;
this.bmaOp=false;
this.FQcsD=new BESMo()
this.FoKtL=CONST_WA_GLOBAL_SETTINGS.use_native_paypal_cart;
this.aJDeR=function(bSiCf,IABHb)
{
this.bSiCf_callback=bSiCf
this.xEoaO=IABHb 
var YOgCT=this.jmrmW("data")
this.pYBjh(YOgCT) 
var iaObo=new Array()
var sTUQL=this.LTMCE;
for(var i=0;i<sTUQL.length;i++)
{
var jRSWE=sTUQL[i];
var qWWUb=Translator.m_lang_for_filename
if(qWWUb.length>0)qWWUb="_"+qWWUb;
var LFSwC=jRSWE.TsNtU;
var n=LFSwC.indexOf("_")
if(n>-1)LFSwC=LFSwC.substring(n+1)
jRSWE.cZqSr="wa-id-"+LFSwC 
var OdVdX=wa_global_market.markets[jRSWE.cZqSr]
if(this.bmaOp==false)
if(!OdVdX)
{
var EHeOo="crbst_market_"+jRSWE.TsNtU+'/'
WA_declareMarket(jRSWE.cZqSr,EHeOo,jRSWE.TsNtU_modif) 
var wggTv=EHeOo+'market-definition'+qWWUb+'.js?v='+jRSWE.TsNtU_modif
iaObo.push({id:LFSwC,src:wggTv})
}
}
rTMLS([iaObo,this,this.TgEZd],true)
}
this.WEZpS=function()
{
this.JnfZw("data","")
this.FQcsD.JnfZw("order-infos","")
this.FQcsD.oglaP()
this.pYBjh("")
}
this.TgEZd=function()
{
this.bmaOp=true;
var sTUQL=this.LTMCE;
var opsTW=new Array();
for(var i=0;i<sTUQL.length;i++)
{
var jRSWE=sTUQL[i];
var LFSwC=jRSWE.cZqSr
var eFwup=wa_global_market.markets[LFSwC] 

if(eFwup.info)
{
var NsNbm=eFwup.info.products 
var ZSDjW=jRSWE.TsNtU_index
var lmQvG=NsNbm[ZSDjW]
jRSWE.lmQvG=lmQvG
jRSWE.jBAQP(jRSWE.lmQvG,ZSDjW)
if((lmQvG.unavail==false)&&(jRSWE.TsNtU_modif==eFwup.info.critical_id_modif))
{
opsTW.push(jRSWE)
}
}
else
{
}
}
this.LTMCE=opsTW
this.ULZYV() 

this.xEoaO.call(this.bSiCf_callback)
}
this.pYBjh=function(VBFQA)
{
var sTUQL=new Array();
var list_string_products=VBFQA.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 jRSWE=new agXAM();
if(jRSWE.eHKvS(s_data))
{
sTUQL.push(jRSWE);
}
}
}
this.LTMCE=sTUQL;
var YRcsg=this.LPBdo()
if(WA_getNumberMarketItemsInCart()!=YRcsg)
{
this.cpeEl()
this.ajPwd()
}
}
this.jrAUF=function()
{
var aMgKD=''
try{aMgKD=CONST_WA_GLOBAL_SETTINGS.currency_mnemonic}catch(e){}
return aMgKD
}
this.MLEjT=function(bIrLH)
{
var list2=new Array();
var sTUQL=this.LTMCE
for(var i=0;i<sTUQL.length;i++)
{
var jRSWE=sTUQL[i];
if(i!=bIrLH)
{
list2.push(jRSWE);
}
}
this.LTMCE=list2;
this.ULZYV()
}
this.addProductToShoppingCard=function(lmQvG,optionsValues)
{
if(this.LclNw()==false)
{
WA_Dialog.alert(Translator.tr("You can't use shopping card Your browser doesnt accept cookies !"));
return false;
}
var AiGiW=lmQvG.obj
var sTUQL=this.javpI();
var n=sTUQL.length
var UgkWW=new agXAM()
UgkWW.GwtvA(lmQvG,n);
UgkWW.m_opt_vals=optionsValues
var b_match=false;
for(var i=0;i<sTUQL.length;i++)
{
var jRSWE=sTUQL[i];
if(jRSWE.rrTWj()==UgkWW.rrTWj())
{
b_match=true;
jRSWE.mNSYE++;
}
}
if(b_match==false)
{
var YOgCT=this.jmrmW("data")
var accKe=UgkWW.KhBpQ()
var NcudI=YOgCT.length+accKe.length 
if(NcudI>4000)
{
WA_Dialog.alert(Translator.tr("Cookies cart contains max data !"));
return false;
}
sTUQL.push(UgkWW);
}
return true
}
this.TbNbG=function()
{
var sTUQL=this.LTMCE
var YOgCT="";
for(var i=0;i<sTUQL.length;i++)
{
var info=sTUQL[i];
YOgCT+=info.KhBpQ()+";";
}
return YOgCT;
}
this.LPBdo=function()
{
var CVetx=0;
var sTUQL=this.LTMCE;
for(var i=0;i<sTUQL.length;i++)
{
var jRSWE=sTUQL[i];
CVetx+=jRSWE.mNSYE
}
return CVetx;
}
this.cpeEl=function()
{
this.JnfZw("nb_items",this.LPBdo())
}
this.ULZYV=function()
{
var sTUQL=this.LTMCE
var YOgCT=this.TbNbG()
this.JnfZw("data",YOgCT)
this.cpeEl()
this.ajPwd();
}
this.ajPwd=function()
{
WA_refreshNumberMarketItemsInCart()
}
this.javpI=function()
{
return this.LTMCE;
}
this.LclNw=function()
{
this.JnfZw("watestcookies","test")
return(this.jmrmW("watestcookies")=="test");
}
this.JnfZw=function(key,val)
{
if((val==null)||(val==undefined)) val="";
WA_SetCookie("crbst-card-"+key,val)
}
this.jmrmW=function(key)
{
var bSiCf=WA_GetCookie("crbst-card-"+key)
if(bSiCf=="null")bSiCf="";
return ""+bSiCf
}
this.dKMCc=function(v)
{
return WA_formatPrice(v)
}
this.MWxiY=function(v)
{
return WA_basicFormatPrice(v)+" "+CONST_WA_GLOBAL_SETTINGS.currency_code;
}
this.QwGfe=function(sqNCA)
{
return Math.round(sqNCA*100)/100
}
this.YeeHp=function()
{
var sTUQL=this.javpI()
var price=0;
for(var i=0;i<sTUQL.length;i++)
{
var jRSWE=sTUQL[i];
price+=(jRSWE.aLJgd()*jRSWE.mNSYE);
}
return price;
}
this.TMrKd=function()
{
var sqNCA=this.YeeHp()
var vlawZ=0;
var sTUQL=CONST_WA_GLOBAL_SETTINGS.list_promo_codes
for(var i=0;i<sTUQL.length;i++)
{
var xagsj=sTUQL[i];
if(MD5(trimString(this.FQcsD.FHBJh.toUpperCase()))==xagsj.c)
{
if(xagsj.v.indexOf("%")>-1)
{
var vlawZ=parseFloat(xagsj.v)/100;
return sqNCA*vlawZ;
}
else
{
return parseFloat(xagsj.v);
}
break;
}
}
return 0;
}
this.fGPFb=function(gpFVm)
{
var VoHkX=0;
var IdbwS=CONST_WA_GLOBAL_SETTINGS.shipping_type
if(IdbwS==qbNVg)return VoHkX;
var pbHFH=CONST_WA_GLOBAL_SETTINGS.shipping_intervals
for(var i=0;i<pbHFH.length;i++)
{
var MNLTa=pbHFH[i];
if(MNLTa.v<gpFVm)VoHkX=MNLTa.p
}
return VoHkX;
}
this.kvsmJ=function(dZtuE,gpFVm)
{
var espHl=CONST_WA_GLOBAL_SETTINGS.OsVQX_list_extra_shipping_by_country_code
if(espHl==undefined)
{
espHl=new Array()
CONST_WA_GLOBAL_SETTINGS.OsVQX_list_extra_shipping_by_country_code=espHl;
var NUKkA=CONST_WA_GLOBAL_SETTINGS.list_extra_shipping_by_country_code
for(var bIrLH in NUKkA)
{
var onJXO=NUKkA[bIrLH];
var EGRZS=onJXO.c
for(var dXosq in EGRZS)
{
var GmLNe=EGRZS[dXosq];espHl[GmLNe]=onJXO.p;
}
}
}
var pbHFH=espHl[dZtuE]
if(pbHFH==undefined) return 0;
var extra_val=0;
for(var i=0;i<pbHFH.length;i++)
{
var MNLTa=pbHFH[i];
if(MNLTa.v<gpFVm)extra_val=MNLTa.p
}
if(isNaN(extra_val)) extra_val=0;
return extra_val;
}
this.EKbGG=function(dZtuE)
{
var espHl=CONST_WA_GLOBAL_SETTINGS.OsVQX_list_tva_by_country_code
if(espHl==undefined)
{
espHl=new Array()
CONST_WA_GLOBAL_SETTINGS.OsVQX_list_tva_by_country_code=espHl;
var NUKkA=CONST_WA_GLOBAL_SETTINGS.list_tva_by_country_code
for(var bIrLH in NUKkA)
{
var onJXO=NUKkA[bIrLH];
var EGRZS=onJXO.c;
for(var dXosq in EGRZS)
{
var GmLNe=EGRZS[dXosq];espHl[GmLNe]=onJXO.p;
}
}
}
return espHl[dZtuE];
}
this.qZKYJ=function()
{
var IdbwS=CONST_WA_GLOBAL_SETTINGS.shipping_type
var sTUQL=this.javpI()
var xvvMS=0;
for(var i=0;i<sTUQL.length;i++)
{
var jRSWE=sTUQL[i];
if(IdbwS==ElsdZ)
{
xvvMS+=(jRSWE.mNSYE*jRSWE.aLJgd());
}
if(IdbwS==DNIPW)
{
xvvMS+=(jRSWE.mNSYE*jRSWE.gjFPM);
}
}
if(IdbwS==ElsdZ)
{
xvvMS-=this.TMrKd()
}
var SSpDL=this.FQcsD.SSpDL;
var amJii=0;
amJii+=this.fGPFb(xvvMS);
amJii+=this.kvsmJ(SSpDL,xvvMS);
return this.QwGfe(amJii);
}
this.BTIQf=function()
{
return CONST_WA_GLOBAL_SETTINGS.tva_type==tAllf
}
this.gSZoH=function()
{
return CONST_WA_GLOBAL_SETTINGS.tva_type==wcHEQ
}
this.kqVnL=function()
{
return CONST_WA_GLOBAL_SETTINGS.tva_type==jxaga
}
this.XJqYn=function()
{
if(this.kqVnL())return 0;
var tax=0;
var country_code=this.FQcsD.SSpDL;
if(country_code.length>0)
{
tax=this.EKbGG(country_code);
if(isNaN(tax))tax=0;
}
return tax;
}
this.FwQRX=function(sqNCA)
{
if(this.BTIQf())
{
var n0=this.XJqYn()/100;
return sqNCA*(n0/(1+n0));
}
if(this.gSZoH())
{
return sqNCA*this.XJqYn()/100;
}
return sqNCA;
}
this.tvuse=function()
{
if(this.kqVnL())return 0;
var sTUQL=this.javpI()
var vfEXc=0;
var GrKtA=0;
for(var i=0;i<sTUQL.length;i++)
{
var jRSWE=sTUQL[i];
vfEXc+=(jRSWE.aLJgd()*jRSWE.mNSYE);
}
vfEXc+=this.qZKYJ();
GrKtA=this.QwGfe(this.FwQRX(vfEXc));
return GrKtA;
}
this.TDpxo=function()
{
var sqNCA=0;
sqNCA+=this.YeeHp()
if(this.gSZoH())sqNCA+=this.tvuse()
sqNCA+=this.qZKYJ()
sqNCA-=this.TMrKd()
return sqNCA;
}
}
function MYown(sQULm,wCcYw)
{
if(sQULm.lab<wCcYw.lab) return-1;
if(sQULm.lab>wCcYw.lab) return 1;
return 0
}
function WA_marketWatchQuantity()
{
var lmDOt=WA_Dialog.getCurrent()
lmDOt.rDimS()
}
function WA_displayDialogMarketCart()
{
var lmDOt=new WA_Dialog();
lmDOt.jVLrW=false;
lmDOt.GWmhm=function()
{
this.UKEcf()
this.jVLrW=setInterval("WA_marketWatchQuantity()",400)
}
lmDOt.UKEcf=function()
{
if(this.jVLrW)clearInterval(this.jVLrW)
}
lmDOt.rDimS=function()
{
var GmHTb=HFBJY();
var QQsMW=GmHTb.javpI();
for(var n=0;n<QQsMW.length;n++)
{
var jRSWE=QQsMW[n]
var FATWd=document.getElementById("wa-cart-quantity-"+n)
var XoZlw=FATWd.value
var UAtoI=parseInt(XoZlw)
if(isNaN(UAtoI))UAtoI=0;
if((XoZlw!='')&&(UAtoI+""!=XoZlw))
{
FATWd.value=""+UAtoI
}
if(UAtoI!=jRSWE.mNSYE)
{
jRSWE.mNSYE=UAtoI
GmHTb.ULZYV()
this.fcoEB()
}
}
var NLuKb=document.getElementById("wa-promo-code")
if(NLuKb)
{
if(NLuKb.value!=GmHTb.FQcsD.FHBJh)
{
GmHTb.FQcsD.FHBJh=NLuKb.value
this.fcoEB()
}
}
}
lmDOt.onCustomKeypress=function(sTJxK)
{
if(sTJxK==13)
{
wa_timeout(Delegate.create(this,this.CWTrt),0);
}
return false;
}
lmDOt.closeWin=function()
{
this.UKEcf()
this.intern_closeWin()
}
lmDOt.fcoEB=function()
{
var GmHTb=HFBJY();
var QQsMW=GmHTb.javpI();
if(QQsMW.length==0) return;
for(var n=0;n<QQsMW.length;n++)
{
var jRSWE=QQsMW[n]
var llgTt=document.getElementById("wa-cart-total-"+n)
var sqNCA=jRSWE.aLJgd() 
var NErYX=jRSWE.mNSYE*sqNCA
var mBKWx="<span style='"
mBKWx+=(NErYX>0)?"color:"+WA_GLOBAL_COLOR_THEME.color_text+";font-weight:normal;":"color:#ff0000;font-weight:bold;"
mBKWx+="'>"
mBKWx+=GmHTb.dKMCc(NErYX)
mBKWx+="</span>"
llgTt.innerHTML=mBKWx
}
var DbIqW=GmHTb.YeeHp()
var EeJYi=GmHTb.tvuse()
var eFLJt=GmHTb.qZKYJ()
var VpYYM=GmHTb.TDpxo()
var JmvDh=GmHTb.TMrKd()
var OAvwB=""
var llgTt=document.getElementById("wa-cart-amount-total")
OAvwB+=Translator.tr("Sub total")+" : "+GmHTb.dKMCc(DbIqW)
OAvwB+="<br>"
if(eFLJt>0)
{
OAvwB+="<span>"+Translator.tr("Shipping amount")+" : "+GmHTb.dKMCc(eFLJt)+"</span>";
OAvwB+="<br>"
}
if(GmHTb.BTIQf()||GmHTb.gSZoH())
{
if(GmHTb.BTIQf())
{
OAvwB+="<div style='width:100%;text-align:left;'>"
OAvwB+=Translator.tr("Tax included");
}
if(GmHTb.gSZoH())
{
OAvwB+="<div>"
OAvwB+=Translator.tr("Extra Tax");
}
OAvwB+=" : ";
OAvwB+=GmHTb.dKMCc(EeJYi)+"</div>";
}
if(JmvDh>0)
{
OAvwB+="<span>"+Translator.tr("Promotion")+" : - "+GmHTb.dKMCc(JmvDh)+"</span><br>";
}
OAvwB+="<span><b>"+Translator.tr("Total")+" : "+GmHTb.dKMCc(VpYYM)+"</b></span>";
llgTt.innerHTML=OAvwB
}
lmDOt.wVcgC=function()
{
WA_displayDialogMarketCart()
}
lmDOt.oCgcf=function()
{
this.closeWin()
}
lmDOt.CWTrt=function()
{
var GmHTb=HFBJY();
if(WA_getNumberMarketItemsInCart()==0)return;
var lEnAF=document.getElementById("wa-market-select-country")
if(lEnAF)
{
GmHTb.FQcsD.SSpDL=lEnAF.value
}
if(GmHTb.FQcsD.SSpDL=="")
{
var lEnAF=document.getElementById("wa-market-select-country")
if(lEnAF)
{
lEnAF.focus()
lEnAF.style.backgroundColor="#ff0000"
return;
}
}
if(CONST_WA_GLOBAL_SETTINGS.link_sale_condition)
{
if(GmHTb.FQcsD.MmOFM!=true)
{
var BVJRd=document.getElementById("wa-sales-condition")
if(BVJRd)
{
BVJRd.focus()
var QDYrv=document.getElementById("wa-sales-condition-label")
QDYrv.style.backgroundColor="#ff0000"
return;
}
}
}
var DUuwb=CONST_WA_GLOBAL_SETTINGS.list_type_payment
if(DUuwb.length==1)
{
GmHTb.FQcsD.vxrCM=DUuwb[0]
}
var lEnAF=document.getElementById("wa-market-select-payment")
if(lEnAF)
{
GmHTb.FQcsD.vxrCM=lEnAF.value
if(GmHTb.FQcsD.vxrCM=="")
{
lEnAF.focus()
lEnAF.style.backgroundColor="#ff0000"
return;
}
}
HwAtj()
}
lmDOt.vUCua=function()
{
WA_exec_callback_opera_compliant(this,this.TGYul)
}
lmDOt.TGYul=function()
{
var GmHTb=HFBJY();

var keGpN=document.getElementById("wa-market-select-country")
if(keGpN)
{
GmHTb.FQcsD.SSpDL=keGpN.value
}
GmHTb.FQcsD.FOfWi()
var EYFpF=html_getLayer("market-cart-content")
var PfVcE=html_getLayer("wa-market-payment-form") 
var mBKWx=""
var QQsMW=GmHTb.javpI();
html_SetVisibility(PfVcE,(QQsMW.length>0))
if(QQsMW.length==0)
{
mBKWx+="<span style='font-family:Arial;font-size:16px;'>"
mBKWx+=Translator.tr("No articles in Card !")
mBKWx+="</span>"
}
else
{
var QYGFV="border:1px solid "+WA_GLOBAL_COLOR_THEME.color0+";font-weight:normal;"
var gZfSf=new RGBColor(WA_GLOBAL_COLOR_THEME.color0);
var qQjgf=gZfSf.toHsl();
gZfSf.fromHsl(qQjgf[0],qQjgf[1],qQjgf[2]+0.2)
var PapxV="border:1px solid "+WA_GLOBAL_COLOR_THEME.color0+";font-weight:normal;color:"+WA_GLOBAL_COLOR_THEME.color_text+";background-color:"+gZfSf.toRGB()+";"
var Pngmx="border:1px solid "+WA_GLOBAL_COLOR_THEME.color0+";color:#ff0000;font-weight:bold;"
var PqbsV="color:#222222;font-size:12px;"
mBKWx+="<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+";'>"
mBKWx+="<thead style='font-size:13px;border:1px solid;'>"
mBKWx+="<tr>"
mBKWx+="<th  colspan=2 style='"+PapxV+"'></th>"
mBKWx+="<th style='"+PapxV+"'  width=70px><b>"+Translator.tr("Price")+"</b></th>"
mBKWx+="<th style='"+PapxV+"'  width=70px><b>"+Translator.tr("Quantity")+"</b></th>"
mBKWx+="<th style='"+PapxV+"'  width=70px><b>"+Translator.tr("Total")+"</b></th>"
mBKWx+="<th style='"+PapxV+"'  width=90px></th>"
mBKWx+="</tr>"
var FHfUL=new RGBColor(WA_GLOBAL_COLOR_THEME.color2);
var iHBcu=FHfUL.toHsl();
FHfUL.fromHsl(iHBcu[0],iHBcu[1],iHBcu[2]-0.1) 
for(var n=0;n<QQsMW.length;n++)
{
var XuvLQ="";
if(n%2==0)
{
XuvLQ="background-color:"+FHfUL.toRGB()+";"
}
var MHRMO=QYGFV+XuvLQ;
var jRSWE=QQsMW[n]
mBKWx+="<tr>"
mBKWx+="<th style='"+MHRMO+"' >"
var eFwup=wa_global_market.markets[jRSWE.cZqSr]
var nivPC=new Size(30,30)
var RTRlD=nivPC
if(eFwup.info.design.crop_thumb==false)
{
RTRlD=jRSWE.lmQvG.size_thumb.clone()
RTRlD.scale(nivPC)
}
else
{
}
if(jRSWE.lmQvG.img_thumb.length>0)
mBKWx+="<img border=0 src='"+jRSWE.lmQvG.img_thumb+"' width="+RTRlD.width+"px height="+RTRlD.height+"px>"
mBKWx+="</th>" 
mBKWx+="<th style='"+MHRMO+"text-align:left;padding:5px;' >"
mBKWx+="<b>"+jRSWE.wYTnM+"</b>"
if(jRSWE.AaRDN.length>0)
{
mBKWx+="<span style='"+PqbsV+"'>";
mBKWx+=" ["+jRSWE.AaRDN+"]";
mBKWx+="</span>";
}
if(jRSWE.m_opt_vals)
{
mBKWx+="<br>"
mBKWx+="<span style='"+PqbsV+"'>";
for(var i_opt=0;i_opt<jRSWE.lmQvG.options.length;i_opt++)
{
var KIeTK=jRSWE.lmQvG.options[i_opt]
if(KIeTK)
{
var hgSuo=jRSWE.m_opt_vals[i_opt];
var BdrGY=KIeTK.title;
if(BdrGY.length>0)
{
mBKWx+=BdrGY;
mBKWx+=":"
}
mBKWx+=KIeTK.vals[hgSuo];
mBKWx+=" "
}
}
mBKWx+="</span>";
}
mBKWx+="</th>"
var sqNCA=jRSWE.aLJgd()
mBKWx+="<th style='"+MHRMO+"' >"+GmHTb.dKMCc(sqNCA)+"</th>"
mBKWx+="<th style='"+MHRMO+"'  align=center><input type=text id='wa-cart-quantity-"+n+"' style='width:45px;' maxlength=3 value='"+jRSWE.mNSYE+"' type=text/></th>"
mBKWx+="<th style='"
var NErYX=jRSWE.mNSYE*sqNCA
mBKWx+=(NErYX>0)?MHRMO:(Pngmx+XuvLQ);
mBKWx+="' ><span id='wa-cart-total-"+n+"'>"
mBKWx+=GmHTb.dKMCc(NErYX)
mBKWx+="</span></th>"
mBKWx+="<th style='"+MHRMO+"' ><a href=\"javascript:WA_marketRemoveItem("+n+")\">"+Translator.tr("Remove card item")+"</a></th>"
mBKWx+="</tr>"
}
mBKWx+="<tr>"
mBKWx+="<th style='"+QYGFV+"text-align:right;padding:5px;' id='wa-cart-amount-total'  colspan=5>&nbsp;</th>"
mBKWx+="<th style='"+QYGFV+"' ></th>"
mBKWx+="</tr>"
mBKWx+="</thead>"
mBKWx+="</table>"
mBKWx+="<br>"
}
EYFpF.innerHTML=mBKWx
this.GWmhm()
WA_exec_callback_opera_compliant(this,this.fcoEB) 
}
lmDOt.KYOlu=function()
{
var GmHTb=HFBJY();
this.addButton(Translator.tr("Continue Shopping"),this.oCgcf,[""],this)
this.addButton(Translator.tr("Checkout order"),this.CWTrt,[""],this)
this.initializeWindow(670,700)
var dSmtE="font-family:Arial;font-size:12px;color:#000000;"
var mBKWx=""
mBKWx+="<div id='market-cart-content' style='width:100%;"+dSmtE+"' align=center>" 
mBKWx+="</div>"
mBKWx+="<br>"
mBKWx+="<div style='width:100%;"+dSmtE+"' align=center id='wa-market-payment-form'>" 
var WuniU=CONST_WA_GLOBAL_SETTINGS.list_favorite_country
var PBGNj=CONST_WA_GLOBAL_SETTINGS.list_country
var wOmOk=new Array()
for(var WBfDc=0;WBfDc<WuniU.length;WBfDc++)
{
wOmOk[WuniU[WBfDc]]=true
}
for(var WBfDc=0;WBfDc<PBGNj.length;WBfDc++)
{
wOmOk[PBGNj[WBfDc]]=true
}
var aZuxb=0;
var McpkH=""
for(var c in wOmOk)
{
aZuxb++;
McpkH=c
}
if(aZuxb>1)
{
mBKWx+="<span style='font-weight:bold;'>"
mBKWx+=Translator.tr("Please choose a country to deliver your order")
mBKWx+="</span>"
mBKWx+="<br>"
mBKWx+="<select onchange=\"WA_marketChangeCountry(this)\" id='wa-market-select-country'>"
if(CONST_WA_GLOBAL_SETTINGS.default_selected_country.length==0)
{
mBKWx+="<option value=\"\">...</option>"
}
var oSkGY=new Array()
for(var WBfDc=0;WBfDc<WuniU.length;WBfDc++)
{
var anpfb=WuniU[WBfDc]
oSkGY.push({code:anpfb,lab:Translator.country(anpfb)})
}
for(var WBfDc=0;WBfDc<oSkGY.length;WBfDc++)
{
var bSiCf=oSkGY[WBfDc]
var anpfb=bSiCf.code
mBKWx+="<option "
if(GmHTb.FQcsD.MpAgN()==anpfb)mBKWx+="selected "
mBKWx+="value=\""+anpfb+"\">"+Translator.country(anpfb)+"</option>"
}
if((WuniU.length>0)&&(PBGNj.length>0))
{
mBKWx+="<option value=\"\">-----</option>"
}
var oQriT=new Array()
for(var WBfDc=0;WBfDc<PBGNj.length;WBfDc++)
{
var anpfb=PBGNj[WBfDc]
oQriT.push({code:anpfb,lab:Translator.country(anpfb)})
}
if((WuniU.length==0)&&(PBGNj.length==0))
{
var sTUQL=CONST_WA_COUNTRIES.codes
for(var WBfDc=0;WBfDc<sTUQL.length;WBfDc++)
{
var anpfb=sTUQL[WBfDc]
oQriT.push({code:anpfb,lab:Translator.country(anpfb)})
}
}
oQriT.sort(MYown)
for(var WBfDc=0;WBfDc<oQriT.length;WBfDc++)
{
var bSiCf=oQriT[WBfDc]
var anpfb=bSiCf.code
mBKWx+="<option "
if(GmHTb.FQcsD.MpAgN()==anpfb)mBKWx+="selected "
mBKWx+="value=\""+anpfb+"\">"+Translator.country(anpfb)+"</option>"
}
mBKWx+="</select>"
mBKWx+="<br>"
mBKWx+="<br>"
}
var DUuwb=CONST_WA_GLOBAL_SETTINGS.list_type_payment
if(DUuwb.length>1)
{
mBKWx+="<span style='font-weight:bold;'>"
mBKWx+=Translator.tr("Choose a type of payment")
mBKWx+="</span>"
mBKWx+="<br>"
mBKWx+="<select onchange=\"WA_marketChangeTypePayment(this)\" id='wa-market-select-payment'>"
if((DUuwb.length>1)||(DUuwb.length==0))
{
mBKWx+="<option value=\"\">...</option>"
}
for(var WBfDc=0;WBfDc<DUuwb.length;WBfDc++)
{
var vxrCM=DUuwb[WBfDc]
mBKWx+="<option "
if(GmHTb.FQcsD.vxrCM==vxrCM)mBKWx+="selected "
mBKWx+="value=\""+vxrCM+"\">"+Translator.tr("label_market_"+vxrCM)+"</option>"
}
mBKWx+="</select>"
mBKWx+="<br>"
mBKWx+="<br>"
}
if(CONST_WA_GLOBAL_SETTINGS.list_promo_codes)
{
var sTUQL=CONST_WA_GLOBAL_SETTINGS.list_promo_codes
mBKWx+="<span id='wa-promo-code-label'  style='font-weight:bold;'>"
mBKWx+=Translator.tr("form-label-code_promo")
mBKWx+="</span><br>"
mBKWx+="<input id='wa-promo-code' onchange=\"WA_marketChangePromoCode(this)\" " 
mBKWx+=" value='"+GmHTb.FQcsD.FHBJh+"' "
mBKWx+="/>"
mBKWx+="<br>"
mBKWx+="<br>"
}
if(CONST_WA_GLOBAL_SETTINGS.link_sale_condition)
{
mBKWx+="<a "+WA_LinkToHref(CONST_WA_GLOBAL_SETTINGS.link_sale_condition)+" style='color:#0000ff'>"
mBKWx+=Translator.tr("Terms of sell")
mBKWx+="</a>"
mBKWx+="<br>" 
mBKWx+="<span id='wa-sales-condition-label'  style='font-weight:bold;'>"
mBKWx+=Translator.tr("label_market_accept_terms")
mBKWx+="</span>"
mBKWx+="<input id='wa-sales-condition' onchange=\"WA_marketChangeSalesCondition(this)\" "
mBKWx+=(GmHTb.FQcsD.MmOFM)?"checked ":""
mBKWx+="type='checkbox' value='1'/>" 
mBKWx+="<br>"
mBKWx+="<br>" 
}
if((aZuxb==1)||(DUuwb.length==1))
{
mBKWx+="<hr width=80%>"
mBKWx+="<br>"
if(aZuxb==1)
{
GmHTb.FQcsD.SSpDL=McpkH
mBKWx+="<span style='font-weight:bold;'>"
mBKWx+=Translator.tr("form-label-country")+" : "+Translator.country(GmHTb.FQcsD.SSpDL)
mBKWx+="</span>"
mBKWx+="<br>"
mBKWx+="<br>"
}
if(DUuwb.length==1)
{
var vxrCM=DUuwb[0]
mBKWx+="<span style='font-weight:bold;'>"
mBKWx+=Translator.tr("PRINT_FORM_LABEL_TYPE_PAYMENT")+" : "+Translator.tr("label_market_"+vxrCM)
mBKWx+="</span>"
mBKWx+="<br>"
mBKWx+="<br>"
}
}
mBKWx+="</div>"
this.writeContent(mBKWx)
var EYFpF=html_getLayer("market-cart-content")
EYFpF.innerHTML="<div width=100% align=center><img src='wa_loading.gif'></div>" 

GmHTb.aJDeR(this,this.vUCua)
}
lmDOt.KYOlu() 
}
function WA_marketChangeCountry(lEnAF)
{
lEnAF.style.backgroundColor=""
var lmDOt=WA_Dialog.getCurrent()
lmDOt.vUCua()
}
function WA_marketChangeTypePayment(lEnAF)
{
var GmHTb=HFBJY();
GmHTb.FQcsD.vxrCM=lEnAF.value
GmHTb.FQcsD.FOfWi()
lEnAF.style.backgroundColor=""
}
function WA_marketChangeSalesCondition(EgcaV)
{
var GmHTb=HFBJY();
GmHTb.FQcsD.MmOFM=EgcaV.checked
GmHTb.FQcsD.FOfWi() 
var QDYrv=document.getElementById("wa-sales-condition-label")
QDYrv.style.backgroundColor="" 
}
function WA_marketChangePromoCode(EgcaV)
{
var GmHTb=HFBJY();
GmHTb.FQcsD.FHBJh=EgcaV.value
GmHTb.FQcsD.FOfWi() 


}
function WA_LinkToHref(qwjCp)
{
var mBKWx=""
var eLHks=qwjCp.url
var mQfGm=Translator.m_lang_for_filename
if(mQfGm.length>0)mQfGm="_"+mQfGm
eLHks=eLHks.replace(/@lng@/g,mQfGm)
mBKWx+="href=\""+eLHks+"\" "
if(qwjCp.open==1)
{
mBKWx+="target="
mBKWx+="_blank"
}
return mBKWx;
}
function WA_displayDialogMarketProduct(LFSwC,bIrLH)
{
var OdVdX=wa_global_market.markets[LFSwC]
var UbdVc=OdVdX.obj
var NsNbm=UbdVc.info.products
var lmQvG=NsNbm[bIrLH] 

var lmDOt=new WA_Dialog();

lmDOt.lmQvG=lmQvG
lmDOt.JXhbE=LFSwC
lmDOt.wVcgC=function()
{
WA_displayDialogMarketCart()
}
lmDOt.HqPsJ=function()
{
var GmHTb=HFBJY();
GmHTb.aJDeR(this,this.gsZKu) 
}
lmDOt.gsZKu=function()
{
var lmQvG=this.lmQvG;
var GmHTb=HFBJY();
var OTrSt=new Array();
var iPgCp=lmQvG.obj.id;
for(var i=0;i<3;i++)
{
var aDeaB=-1;
var CuiZR=iPgCp+"-select-opt"
var lEnAF=document.getElementById(CuiZR+i)
if(lEnAF)
{
if(lEnAF.value.length==0)
{
lEnAF.style.backgroundColor="#ff0000";
lEnAF.focus()
return;
}
aDeaB=parseInt(lEnAF.value)
}
OTrSt.push(aDeaB)
}
if(GmHTb.addProductToShoppingCard(lmQvG,OTrSt))
{
GmHTb.ULZYV()
WA_displayDialogMarketCart()
}
}
lmDOt.KYOlu=function()
{
var LFSwC=this.JXhbE
var lmQvG=this.lmQvG
var mBKWx=""
this.addButton(Translator.tr("Go to my card"),this.wVcgC,[""],this)
if(lmQvG.unavail==false)
{
this.addButton(Translator.tr("Add to card"),this.HqPsJ,[""],this)
}
this.initializeWindow(670,this.idealHeight())
mBKWx+="<table border=0 width=100% cellpadding=4>"
mBKWx+="<tr>" 
if(lmQvG.img_big.length>0)
{
mBKWx+="<td width='100px' align=center valign=top>"
var RTRlD=lmQvG.size_thumb.clone() 
RTRlD.scale(new Size(200,200))
mBKWx+="<a href=\""+lmQvG.img_big+"\" target=_blank>"
mBKWx+="<img border=0 src=\""+lmQvG.img_big+"\" width='"+RTRlD.width+"px' height='"+RTRlD.height+"px'>"
mBKWx+="</a>"
mBKWx+="</td>"
}
var xGFVZ="color:"+WA_GLOBAL_COLOR_THEME.color_text+";";
mBKWx+="<td valign=top style='font-family:Arial;'>"
mBKWx+="<span style='font-weight:bold;font-size:16px;"+xGFVZ+"'>"
mBKWx+=lmQvG.title
mBKWx+="</span>"
mBKWx+="<br>"
if(lmQvG.sub_title.length>0)
{
mBKWx+="<span style='color:#333333;font-size:14px;'>"
mBKWx+=lmQvG.sub_title
mBKWx+="</span>"
mBKWx+="<br>"
}
mBKWx+="<br>"
mBKWx+="<table border=0 width=100% cellspacing=0 cellpadding=0><tr><td>"
mBKWx+="<span style='"+xGFVZ+";font-size:14px;'>"
mBKWx+=Translator.tr("Price")+" : "
mBKWx+="</span>"
mBKWx+="<span style='"+xGFVZ+";font-size:18px;font-weight:bold;' id='"+lmQvG.obj.id+"-price'>"
if(lmQvG.unavail)
{
mBKWx+=Translator.tr("Unavailable")
}
mBKWx+="</span>"
if(lmQvG.more_info)
{
mBKWx+="</td><td align=right>"
var qwjCp=lmQvG.more_info
var DYnoW=WA_LinkToHref(qwjCp)
mBKWx+="<a "+DYnoW+" style='font-family:Arial;text-decoration:underline;font-weight:bold;font-size:12px;color:0000ff;'>"+Translator.tr("More product info link")+"</a>"
}
mBKWx+="</td></tr></table>"
mBKWx+="<br>"
var RwreB=lmQvG.obj.index
if(lmQvG.unavail==false)
if(lmQvG.options.length>0)
{
mBKWx+="<table border=0 cellspacing=0 cellpadding=0>"
for(var n=0;n<lmQvG.options.length;n++)
{
var KIeTK=lmQvG.options[n]
if(KIeTK)
{
mBKWx+="<tr><td align=right>"
mBKWx+="<span style='font-family:Arial;font-weight:bold;font-size:12px;"+xGFVZ+"'>"
mBKWx+=KIeTK.title+" :&nbsp;"
mBKWx+="</span>"
mBKWx+="</td><td align=left>"
mBKWx+="<select id='"+lmQvG.obj.id+"-select-opt"+n+"' onchange=\"WA_market_changeCustomPrice('"+LFSwC+"',"+RwreB+")\">"
mBKWx+="<option value=\"\">...</option>"
for(var WBfDc=0;WBfDc<KIeTK.vals.length;WBfDc++)
{
var XZrTd=KIeTK.vals[WBfDc]
mBKWx+="<option value=\""+WBfDc+"\">"+XZrTd+"</option>"
}
mBKWx+="</select>"
mBKWx+="</td></tr>";
}
}
mBKWx+="</table>"
}
mBKWx+="</td>"
mBKWx+="</tr>"
mBKWx+="</table>"
if(lmQvG.description.length>0)
{
mBKWx+="<table border=0 width=100% cellpadding=4>"
mBKWx+="<tr><td colspan=2>"
mBKWx+="<span style='font-family:Arial;font-size:13px;"+xGFVZ+"'>"
mBKWx+="<hr>"
mBKWx+=lmQvG.description
mBKWx+="</span>"
mBKWx+="</td></tr>"
mBKWx+="</table>"
}
this.writeContent(mBKWx)
WA_market_changeCustomPrice(LFSwC,RwreB)
}
lmDOt.displayWindowWithAutoResize(300,lmDOt.KYOlu) 
}
function XYbdC(lmQvG,iPgCp)
{
var CHlVN=new Array()
for(var i=0;i<3;i++)
{
var CuiZR=iPgCp+"-select-opt"
var lEnAF=document.getElementById(CuiZR+i)
CHlVN[i]=-1
if(lEnAF)
{
lEnAF.style.backgroundColor="";
var XZrTd=parseInt(lEnAF.value)
if(isNaN(XZrTd)==false)
CHlVN[i]=XZrTd
}
}
return RtHLe(lmQvG,CHlVN)
}
function RtHLe(lmQvG,CHlVN)
{
if(lmQvG.unavail)return;
var ppQPs=false;
for(var i=0;i<lmQvG.custom_prices.length;i++)
{
var BfwGT=lmQvG.custom_prices[i]
var PVHma=true;
for(var n=0;n<3;n++)
{
if(BfwGT.tab[n]!=CHlVN[n])PVHma=false
}
if(PVHma)
{
ppQPs=BfwGT;
break;
}
}
var sqNCA=lmQvG.price
if(ppQPs)
{
sqNCA=ppQPs.pr
}
return sqNCA;
}
function WA_market_changeCustomPrice(LFSwC,RwreB)
{
var GmHTb=HFBJY();
var OdVdX=wa_global_market.markets[LFSwC]
var NsNbm=OdVdX.info.products;
var lmQvG=NsNbm[RwreB]
if(lmQvG.unavail)return;
var iPgCp=lmQvG.obj.id
var sqNCA=XYbdC(lmQvG,iPgCp)
var ImWpj=html_getLayer(iPgCp+"-price")
if(ImWpj)
{
ImWpj.innerHTML=GmHTb.dKMCc(sqNCA)
}
}
function HwAtj()
{
var GmHTb=HFBJY();
if(WA_getNumberMarketItemsInCart()==0)return;
var jRSWE=GmHTb.FQcsD
if((GmHTb.FoKtL)&&(jRSWE.vxrCM=="paypal"))
{
XKPkA();
return;
}
HNUnX(TmaKQ)
}
function HNUnX(cMpkq)
{
var GmHTb=HFBJY();
var jRSWE=GmHTb.FQcsD
jRSWE.oglaP()
var lmDOt=new WA_Dialog();
lmDOt.cMpkq=cMpkq
lmDOt.nBXil=function(sTJxK)
{
return Translator.tr("form-label-"+sTJxK)
}
lmDOt.onCustomKeypress=function(sTJxK)
{
if(sTJxK==13)
{
wa_timeout(Delegate.create(this,this.CeJjO),0);
}
return false;
}
lmDOt.gcEGV=function()
{
if(this.cMpkq==TmaKQ)
{
WA_displayDialogMarketCart()
}
else
{
HNUnX(TmaKQ)
}
}
lmDOt.xkSOZ=function()
{
XKPkA()
}
lmDOt.CeJjO=function()
{
var GmHTb=HFBJY();
var jRSWE=GmHTb.FQcsD
if(jRSWE.OFwMc(this.cMpkq)==false) return;
jRSWE.FOfWi()
if(this.cMpkq==TmaKQ)
{
if(jRSWE.buTQu==true)
{
HNUnX(diKSd)
}
else
{
this.xkSOZ()
}
}
else
{
this.xkSOZ()
}
}
lmDOt.glkNF=function(sTJxK,gToWa)
{
if(gToWa==undefined) gToWa=""
if(gToWa)gToWa=" size="+gToWa
return "<input name='"+sTJxK+"' value=\""+jRSWE.jJZTR(sTJxK,this.cMpkq)+"\" type=text "+gToWa+">"
}
lmDOt.UMldo=function(ulDMD)
{
return "<td width=150px align=right valign=top>"+Translator.tr(ulDMD)+" :</td>"
}
lmDOt.KYOlu=function()
{
var GmHTb=HFBJY();
var jRSWE=GmHTb.FQcsD 
this.addButton("< "+Translator.tr('Back'),this.gcEGV,[""],this)
this.addButton(Translator.tr('Continue')+" >",this.CeJjO,[""],this)
this.initializeWindow(600,600)
var lCVKG="form-label-"
var rWbqb=CONST_WA_GLOBAL_SETTINGS.list_form_fields 
var mBKWx=""
mBKWx+="<form id='wa-market-form' onSubmit='return false'>"
mBKWx+="<table border=0 width=100% cellspacing=5 style='font-family:Arial;font-size:15px;'>"
mBKWx+="<tr><td colspan=2 align=center style='font-size:18px;'>"
mBKWx+=Translator.tr((this.cMpkq==TmaKQ)?"Fill Deliver information below":"Fill Billing information below")
mBKWx+="<br><br></td></tr>"
for(var n=0;n<rWbqb.length;n++)
{
var kVXHl=rWbqb[n]
if(kVXHl=="address")
{
mBKWx+="<tr>"+this.UMldo("Address");
mBKWx+="<td>"
mBKWx+=this.glkNF("address_1",30)
mBKWx+="</td></tr>"
mBKWx+="<tr><td></td><td>"
mBKWx+=this.glkNF("address_2",30)
mBKWx+="</td></tr>"
mBKWx+="<tr>"+this.UMldo("form-label-city");
mBKWx+="<td>"
mBKWx+=this.glkNF("city")+"&nbsp;"+this.nBXil("zip")+" : "+this.glkNF("zip",10)
mBKWx+="</td></tr>" 
mBKWx+="<tr>"+this.UMldo("form-label-country");
mBKWx+="<td>"
if(this.cMpkq==diKSd)
{
mBKWx+="<select id='wa-select-form-country' onchange='WA_marketChangeFormCountry("+this.cMpkq+")'>"
var oQriT=new Array();
var sTUQL=CONST_WA_COUNTRIES.codes
for(var WBfDc=0;WBfDc<sTUQL.length;WBfDc++)
{
var anpfb=sTUQL[WBfDc]
oQriT.push({code:anpfb,lab:Translator.country(anpfb)})
}
oQriT.sort(MYown)
var CiidI=jRSWE.MpAgN()
CiidI=jRSWE.jJZTR('countryCode',this.cMpkq,CiidI)
for(var WBfDc=0;WBfDc<oQriT.length;WBfDc++)
{
var bSiCf=oQriT[WBfDc]
var anpfb=bSiCf.code
mBKWx+="<option "
if(CiidI==anpfb)mBKWx+="selected "
mBKWx+="value=\""+anpfb+"\">"+Translator.country(anpfb)+"</option>"
}
mBKWx+="</select>"
}
else
{
mBKWx+=Translator.country(GmHTb.FQcsD.SSpDL);
}
mBKWx+="<br><span id='wa-market-state'>"
mBKWx+="<select id='wa-select-state'></select>"
mBKWx+="</span>" 
mBKWx+="</td></tr>"
}
else
{
mBKWx+="<tr>"+this.UMldo("form-label-"+kVXHl);
mBKWx+="<td>"
mBKWx+=this.glkNF(kVXHl,30) 
mBKWx+="</td></tr>"
}
}
if(this.cMpkq==TmaKQ)
{
mBKWx+="<tr><td colspan=2 align=center >"
mBKWx+=Translator.tr("Billing adress is different")+" <input type=checkbox "
if(GmHTb.FQcsD.buTQu)mBKWx+="checked "
mBKWx+="onchange='WA_marketCheckBillingAdress(this)'>"
mBKWx+="</td></tr>"
}
mBKWx+="</table>"
mBKWx+="</form>"
this.writeContent(mBKWx)
WA_exec_callback_opera_compliant(this,this.NcthA) 
}
lmDOt.NcthA=function()
{
WA_marketChangeFormCountry(this.cMpkq)
}
lmDOt.KYOlu()
}
function LfHkD(cMpkq,lEnAF,espHl)
{
var GmHTb=HFBJY();
var jRSWE=GmHTb.FQcsD
var BdGlJ=jRSWE.jJZTR("stateCode",cMpkq) 
lEnAF.options.length=0
for(var n=0;n<espHl.length;n++)
{
var val=espHl[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==BdGlJ)elOptNew.selected=true
try{
lEnAF.add(elOptNew,null);
}
catch(ex){
lEnAF.add(elOptNew);
}
}
}
function WA_marketChangeFormCountry(cMpkq)
{
var GmHTb=HFBJY();
var jRSWE=GmHTb.FQcsD
var dZtuE=jRSWE.SSpDL
var lEnAF=document.getElementById("wa-select-form-country");
if(lEnAF) dZtuE=lEnAF.value;
html_SetDisplay("wa-market-state",(dZtuE=="US")||(dZtuE=="CA")||(dZtuE=="BR"))
var muLOV=document.getElementById("wa-select-state");
if(muLOV)
{
if(dZtuE=="US") LfHkD(cMpkq,muLOV,["","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(dZtuE=="CA") LfHkD(cMpkq,muLOV,["","Alberta","British Columbia","Manitoba","New Brunswick","Newfoundland and Labrador","Northwest Territories","Nova Scotia","Nunavut","Ontario","Prince Edward Isl.","Quebec","Saskatchewan","Yukon Territory"])
if(dZtuE=="BR") LfHkD(cMpkq,muLOV,["","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(EgcaV)
{
var GmHTb=HFBJY();
var jRSWE=GmHTb.FQcsD
jRSWE.buTQu=EgcaV.checked
jRSWE.FOfWi()
}
function XKPkA()
{
var GmHTb=HFBJY();


var lmDOt=new WA_Dialog();
lmDOt.gcEGV=function()
{
if(GmHTb.FQcsD.vxrCM=="paypal")
{
WA_displayDialogMarketCart();return;
}
if(GmHTb.FQcsD.buTQu)
HNUnX(diKSd)
else
HNUnX(TmaKQ)
}
lmDOt.EaXDU=function(XjqJk,XZrTd)
{
XZrTd=""+XZrTd
XZrTd=XZrTd.replace(/'/g,"&lsquo;")
return "<input type=hidden name='"+XjqJk+"' value=\""+XZrTd+"\">"
}
lmDOt.uNWUC=function()
{
var GmHTb=HFBJY();
var mBKWx=""
var ksZbO=CONST_WA_GLOBAL_SETTINGS.currency_info
if(ksZbO.charCodeAt(3)>=100) return""
mBKWx+="<form id='wa-http-sender' accept-charset='UTF-8' method=POST action='https://www.paypal.com/cgi-bin/webscr' target='_blank'>"
mBKWx+=this.EaXDU("cmd","_cart")
mBKWx+=this.EaXDU("business",CONST_WA_GLOBAL_SETTINGS.email_paypal_account)
mBKWx+=this.EaXDU("upload","1")
mBKWx+=this.EaXDU("charset","utf-8")
mBKWx+=this.EaXDU("no_note","0")
mBKWx+=this.EaXDU("currency_code",CONST_WA_GLOBAL_SETTINGS.currency_code)
mBKWx+=this.EaXDU("no_shipping","2")
var lWFNd=GmHTb.javpI()
for(var i=0;i<lWFNd.length;i++)
{
var info=lWFNd[i];
var index=i+1;
var xSUtp=info.aLJgd();
if(GmHTb.BTIQf())
{
var UQtms=GmHTb.QwGfe(GmHTb.FwQRX(xSUtp));
xSUtp=xSUtp-UQtms;
}
mBKWx+=this.EaXDU("amount_"+index,""+xSUtp)
mBKWx+=this.EaXDU("quantity_"+index,info.mNSYE)
var YNMPj=0;
if(info.AaRDN.length>0)
{
mBKWx+=this.EaXDU("on"+YNMPj+"_"+index,"ref")
mBKWx+=this.EaXDU("os"+YNMPj+"_"+index,info.AaRDN)
YNMPj++;
}
var EPpse=""
if(info.m_opt_vals)
{
for(var i_opt=0;i_opt<info.lmQvG.options.length;i_opt++)
{
var KIeTK=info.lmQvG.options[i_opt]
if(KIeTK)
{
var hgSuo=info.m_opt_vals[i_opt];
var AEmOl=KIeTK.vals[hgSuo]
var BdrGY=KIeTK.title;
if(BdrGY.length==0) BdrGY="opt"+(i_opt+1);
mBKWx+=this.EaXDU("on"+YNMPj+"_"+index,BdrGY)
mBKWx+=this.EaXDU("os"+YNMPj+"_"+index,AEmOl)
if(EPpse.length>0)EPpse=EPpse+", "
EPpse+=AEmOl
YNMPj++;
}
}
}
var OuqIO=info.wYTnM;
if(EPpse.length>0)OuqIO=OuqIO+"("+EPpse+")"
mBKWx+=this.EaXDU("item_name_"+index,OuqIO) 
}
var amJii=GmHTb.qZKYJ()
if(GmHTb.BTIQf())
{
amJii=amJii-GmHTb.QwGfe(GmHTb.FwQRX(amJii));
}
if(GmHTb.BTIQf())
{
var RlUWs=GmHTb.YeeHp();
var ktRpr=GmHTb.qZKYJ()
var vfEXc=RlUWs+ktRpr;
var CevQX=GmHTb.QwGfe(GmHTb.FwQRX(vfEXc));
var gVaJU=vfEXc-CevQX;
gVaJU=gVaJU-amJii;
var IbIog=0;
for(var i=0;i<lWFNd.length;i++)
{
var info=lWFNd[i];
var index=i+1;
var NXPwl=0;
var WjuWi=0;
var xSUtp=info.mNSYE*info.aLJgd();
var n0=GmHTb.XJqYn()/100;
var tax=xSUtp*(n0/(1+n0));
xSUtp=xSUtp-tax;
NXPwl=xSUtp;
var drpvY=info.aLJgd();
var UQtms=GmHTb.QwGfe(GmHTb.FwQRX(drpvY));
drpvY=drpvY-UQtms;
WjuWi=info.mNSYE*drpvY;
if(WjuWi>NXPwl)
{
drpvY=info.m_price;
drpvY=drpvY-UQtms;
var BECJb=drpvY;
if((BECJb>0)&&(BECJb!=info.aLJgd()))
{
BECJb=BECJb-0.01;
}
mBKWx+=this.EaXDU("amount_"+index,BECJb) 
WjuWi=info.m_quantity*BECJb;
}
IbIog+=WjuWi;
}
var grMnc=GmHTb.QwGfe(gVaJU-IbIog);
if(grMnc>0)
{
var index=lWFNd.length+1;
mBKWx+=this.EaXDU("item_name_"+index,Translator.tr("TVA correction"))
mBKWx+=this.EaXDU("quantity_"+index,1)
mBKWx+=this.EaXDU("amount_"+index,grMnc)
}
mBKWx+=this.EaXDU("tax_cart",CevQX)
}
else
{
mBKWx+=this.EaXDU("tax_cart",GmHTb.tvuse())
}
mBKWx+=this.EaXDU("handling_cart",amJii) 
mBKWx+="</form>"
return mBKWx;
}
lmDOt.bpKLm=function()
{
var TWTRI=this.GeiTk(TmaKQ);
var mBKWx="";
if(TWTRI.length>0)
{
mBKWx+=""+Translator.tr("Shipping information")+":\n";
mBKWx+=TWTRI;
}
return mBKWx;
}
lmDOt.PjTSp=function()
{
var TWTRI=this.GeiTk(diKSd);
var mBKWx="";
if(TWTRI.length>0)
{
mBKWx+=Translator.tr("Billing information")+":\n";
mBKWx+=TWTRI;
}
return mBKWx;
}
lmDOt.GeiTk=function(cMpkq)
{
var GmHTb=HFBJY();
var jRSWE=GmHTb.FQcsD
var mBKWx="";
var BLbNv=new Array();
var rWbqb=Hfkeg(CONST_WA_GLOBAL_SETTINGS.list_form_fields)
rWbqb.push("country")
rWbqb.push("state")
for(var i=0;i<rWbqb.length;i++)
{
var erTFF=rWbqb[i];
BLbNv[erTFF]=jRSWE.jJZTR(erTFF,cMpkq)
}
if(BLbNv["firstname"])mBKWx+=BLbNv["firstname"]+"\n"
if(BLbNv["lastname"])mBKWx+=BLbNv["lastname"]+"\n"
if(BLbNv["company"])
{
mBKWx+=Translator.tr("form-label-company")+" : "+BLbNv["company"]+"\n"
}
if(BLbNv["fiscal_code"]) mBKWx+=Translator.tr("form-label-fiscal_code")+" : "+BLbNv["fiscal_code"]+"\n"
if(BLbNv["tva"]) mBKWx+=Translator.tr("form-label-tva")+" : "+BLbNv["tva"]+"\n"
if(BLbNv["address_1"]) mBKWx+=BLbNv["address_1"]+"\n"
if(BLbNv["address_2"]) mBKWx+=BLbNv["address_2"]+"\n"
if(BLbNv["zip"]) mBKWx+=BLbNv["zip"]+" "
if(BLbNv["city"]) mBKWx+=BLbNv["city"]+"\n"
if(BLbNv["country"])mBKWx+=Translator.country(BLbNv["country"])
if(BLbNv["state"]&&BLbNv["state"].length>0) mBKWx+=" "+BLbNv["state"];
mBKWx+="\n"
if(BLbNv["phone"]) mBKWx+=Translator.tr("form-label-phone")+" : "+BLbNv["phone"]+"\n"
if(BLbNv["fax"]) mBKWx+=Translator.tr("form-label-fax")+" : "+BLbNv["fax"]+"\n"
if(BLbNv["email"]) mBKWx+=BLbNv["email"]+"\n" 
if(BLbNv["comment"])
{
mBKWx+=Translator.tr("form-label-comment")+" : \n";
mBKWx+=BLbNv["comment"]+"\n"
}
return mBKWx;
}
lmDOt.GafuU=function()
{
var GmHTb=HFBJY();
var mBKWx="";
var lWFNd=GmHTb.javpI();
mBKWx+="**************\n"
for(var i=0;i<lWFNd.length;i++)
{
var jRSWE=lWFNd[i];
var index=i+1;
var OuqIO=jRSWE.wYTnM;
if(jRSWE.AaRDN.length>0)
{
OuqIO+=" ["+jRSWE.AaRDN+"]";
}
var EPpse=""
if(jRSWE.m_opt_vals)
{
for(var i_opt=0;i_opt<jRSWE.lmQvG.options.length;i_opt++)
{
var KIeTK=jRSWE.lmQvG.options[i_opt]
if(KIeTK)
{
if(EPpse.length>0)EPpse=EPpse+", "
var hgSuo=jRSWE.m_opt_vals[i_opt];
var AEmOl=KIeTK.vals[hgSuo]
var BdrGY=KIeTK.title;
if(BdrGY.length>0) EPpse+=BdrGY+" : "
EPpse+=AEmOl
}
}
}
if(EPpse.length>0)OuqIO=OuqIO+"\n("+EPpse+")"
mBKWx+=OuqIO;
mBKWx+="\n"
mBKWx+=Translator.tr("Price")+" : "+GmHTb.MWxiY(jRSWE.aLJgd())+"\n"
mBKWx+=Translator.tr("Quantity")+" : "+jRSWE.mNSYE+"\n"
mBKWx+=Translator.tr("Total")+" : "+GmHTb.MWxiY(jRSWE.aLJgd()*jRSWE.mNSYE);
mBKWx+="\n"
mBKWx+="**************\n"
}
var DbIqW=GmHTb.YeeHp()
var EeJYi=GmHTb.tvuse()
var eFLJt=GmHTb.qZKYJ()
var VpYYM=GmHTb.TDpxo()
var JmvDh=GmHTb.TMrKd() 
mBKWx+=Translator.tr("Sub total")+" : "+GmHTb.MWxiY(DbIqW)+"\n";
if(CONST_WA_GLOBAL_SETTINGS.shipping_type!=qbNVg)
{
mBKWx+=Translator.tr("Shipping amount")+" : "+GmHTb.MWxiY(eFLJt)+"\n";
}
if(GmHTb.BTIQf()||GmHTb.gSZoH())
{
if(GmHTb.BTIQf())
{
mBKWx+=Translator.tr("Tax included");
}
if(GmHTb.gSZoH())
{
mBKWx+=Translator.tr("Extra Tax");
}
mBKWx+=" : ";
mBKWx+=GmHTb.MWxiY(EeJYi)+"\n";
}
if(JmvDh>0)
{
mBKWx+=Translator.tr("Promotion")+" : - "+GmHTb.MWxiY(JmvDh)+"\n";
}
mBKWx+=Translator.tr("Total")+" : "+GmHTb.MWxiY(VpYYM)+"\n";
return mBKWx;
}
lmDOt.mqfGU=function()
{
var GmHTb=HFBJY();
var mBKWx="";
var lWFNd=GmHTb.javpI()
mBKWx+="<table class=wa-cart-global-table >"
mBKWx+="<tr class=wa-cart-title >"
mBKWx+="<td>&nbsp;</td>"
mBKWx+="<td>"+Translator.tr("Price")+"</td>"
mBKWx+="<td>"+Translator.tr("Quantity")+"</td>"
mBKWx+="<td>"+Translator.tr("Total")+"</td>"
mBKWx+="</tr>"
for(var i=0;i<lWFNd.length;i++)
{
mBKWx+="<tr>"
var jRSWE=lWFNd[i];
var index=i+1;
mBKWx+="<td>"
var OuqIO=jRSWE.wYTnM;
if(jRSWE.AaRDN.length>0)
{
OuqIO+=" ["+jRSWE.AaRDN+"]";
}
OuqIO="<b>"+OuqIO+"</b>"
var EPpse=""
if(jRSWE.m_opt_vals)
{
for(var i_opt=0;i_opt<jRSWE.lmQvG.options.length;i_opt++)
{
var KIeTK=jRSWE.lmQvG.options[i_opt]
if(KIeTK)
{
if(EPpse.length>0)EPpse=EPpse+", "
var hgSuo=jRSWE.m_opt_vals[i_opt];
var AEmOl=KIeTK.vals[hgSuo]
var BdrGY=KIeTK.title;
if(BdrGY.length>0) EPpse+=BdrGY+" : "
EPpse+=AEmOl
}
}
}
if(EPpse.length>0)OuqIO=OuqIO+"<br><span class=wa-cart-option >("+EPpse+")</span>"
mBKWx+=OuqIO;
mBKWx+="</td>"
mBKWx+="<td>"+GmHTb.dKMCc(jRSWE.aLJgd())+"</td>"
mBKWx+="<td>"+jRSWE.mNSYE+"</td>"
mBKWx+="<td>"+GmHTb.dKMCc(jRSWE.aLJgd()*jRSWE.mNSYE)+"</td>"
mBKWx+="</tr>"
}
mBKWx+="<tr><td colspan=4>"
var DbIqW=GmHTb.YeeHp()
var EeJYi=GmHTb.tvuse()
var eFLJt=GmHTb.qZKYJ()
var VpYYM=GmHTb.TDpxo()
var JmvDh=GmHTb.TMrKd() 
mBKWx+="<table class=wa-cart-table-total >"
mBKWx+="<tr><td align=right >"+Translator.tr("Sub total")+" : "+GmHTb.dKMCc(DbIqW)+"</td></tr>";
if(CONST_WA_GLOBAL_SETTINGS.shipping_type!=qbNVg)
{
mBKWx+="<tr><td align=right>"+Translator.tr("Shipping amount")+" : "+GmHTb.dKMCc(eFLJt)+"</td></tr>";
}
if(GmHTb.BTIQf()||GmHTb.gSZoH())
{
if(GmHTb.BTIQf())
{
mBKWx+="<tr><td align=left >"+Translator.tr("Tax included");
}
if(GmHTb.gSZoH())
{
mBKWx+="<tr><td align=right >"+Translator.tr("Extra Tax");
}
mBKWx+=" : ";
mBKWx+=GmHTb.dKMCc(EeJYi)+"</td></tr>";
}
if(JmvDh>0)
{
mBKWx+="<tr><td align=right class=wa-cart-promo >"+Translator.tr("Promotion")+" : - "+GmHTb.dKMCc(JmvDh)+"</td></tr>";
}
mBKWx+="<tr><td align=right class=wa-cart-total >"+Translator.tr("Total")+" : "+GmHTb.dKMCc(VpYYM)+"</td></tr>";
mBKWx+="</table>" 
mBKWx+="</td></tr>"
mBKWx+="</table>"
mBKWx=mBKWx.replace(/\"/g,"'")
return mBKWx;
}
lmDOt.KSssp=function(XZrTd)
{
if((""+XZrTd).length==1)XZrTd="0"+XZrTd;
return XZrTd
}
lmDOt.WCkeg=function()
{
var GmHTb=HFBJY();
var jRSWE=GmHTb.FQcsD
var ksZbO=CONST_WA_GLOBAL_SETTINGS.currency_info
var mBKWx=""
if(ksZbO.charCodeAt(3)>=100) return""
if(PcOOt)
{
mBKWx+="<form id='wa-http-sender' accept-charset='UTF-8' method=POST action='"+PcOOt_URL+"crbst_market_print_form.php' target='_blank'>"
}
else
{
mBKWx+="<form id='wa-http-sender' accept-charset='UTF-8' method=POST action='crbst_market_print_form.php' target='_blank'>"
}
mBKWx+=this.EaXDU("type_payment",jRSWE.vxrCM)
mBKWx+=this.EaXDU("MAIL_TITLE_PREFIXE",Translator.tr("title email Order notification"))
mBKWx+=this.EaXDU("MAIN_TITLE",Translator.tr("PRINT_FORM_MAIN_TITLE"))
mBKWx+=this.EaXDU("PREFIXE_ORDER",Translator.tr("PRINT_FORM_PREFIXE_ORDER"))
var NqVYV=""
var MBpWp=new Date()
NqVYV+="wa-"+this.KSssp(MBpWp.getYear()-100)+this.KSssp(MBpWp.getMonth()+1)+this.KSssp(MBpWp.getDate())
NqVYV+=MBpWp.getHours()+this.KSssp(MBpWp.getMinutes())+this.KSssp(MBpWp.getSeconds())
NqVYV+="-"+Math.round(Math.random()*100) 
mBKWx+=this.EaXDU("ID_ORDER",NqVYV)
mBKWx+=this.EaXDU("CARD_TITLE",Translator.tr("PRINT_FORM_CARD_TITLE"))
mBKWx+=this.EaXDU("LABEL_TYPE_PAYMENT",Translator.tr("PRINT_FORM_LABEL_TYPE_PAYMENT"))
mBKWx+=this.EaXDU("send_copy_email_to_buyer",(CONST_WA_GLOBAL_SETTINGS.send_copy_email_to_buyer)?"1":"0") 

var BLbNv=new Array();
var rWbqb=Hfkeg(CONST_WA_GLOBAL_SETTINGS.list_form_fields)
rWbqb.push("country")
rWbqb.push("state")
for(var i=0;i<rWbqb.length;i++)
{
var erTFF=rWbqb[i];
BLbNv[erTFF]=GmHTb.FQcsD.jJZTR(erTFF,TmaKQ)
}
mBKWx+=this.EaXDU("form_first_name",BLbNv["firstname"]);
mBKWx+=this.EaXDU("form_last_name",BLbNv["lastname"]);
mBKWx+=this.EaXDU("form_address1",BLbNv["address_1"]);
mBKWx+=this.EaXDU("form_address2",BLbNv["address_2"]);
mBKWx+=this.EaXDU("form_city",BLbNv["address_2"]);
mBKWx+=this.EaXDU("form_zip",BLbNv["zip"]);
mBKWx+=this.EaXDU("form_state",BLbNv["state"]);
mBKWx+=this.EaXDU("form_country",BLbNv["country"]);
mBKWx+=this.EaXDU("form_company",BLbNv["company"]);
mBKWx+=this.EaXDU("form_fiscal_code",BLbNv["fiscal_code"]);
mBKWx+=this.EaXDU("form_tva",BLbNv["tva"]);
mBKWx+=this.EaXDU("form_phone",BLbNv["phone"]);
mBKWx+=this.EaXDU("form_fax",BLbNv["fax"]);
mBKWx+=this.EaXDU("CARD_TOTAL_PRICE",GmHTb.TDpxo());
mBKWx+=this.EaXDU("CARD_CURRENCY",CONST_WA_GLOBAL_SETTINGS.currency_code);
mBKWx+=this.EaXDU("CARD_LANG",Translator.m_lang);
mBKWx+=this.EaXDU("LABEL_PROCESS_ORDER",Translator.tr("PRINT_FORM_PROCESS_ORDER"));
mBKWx+=this.EaXDU("wa_promo_code",GmHTb.FQcsD.FHBJh);

mBKWx+=this.EaXDU("email_buyer",jRSWE.jJZTR("email",TmaKQ))
if(jRSWE.vxrCM=="custom")
{
mBKWx+=this.EaXDU("TYPE_PAYMENT",Translator.tr("PRINT_FORM_TYPE_CUSTOM"))
}
if(jRSWE.vxrCM=="check")
{
mBKWx+=this.EaXDU("TYPE_PAYMENT",Translator.tr("PRINT_FORM_TYPE_CHECK"))
mBKWx+=this.EaXDU("MESSAGE_CHECK",Translator.tr("PRINT_FORM_MESSAGE_CHECK"))
}
if(jRSWE.vxrCM=="wire")
{
mBKWx+=this.EaXDU("TYPE_PAYMENT",Translator.tr("PRINT_FORM_TYPE_WIRE"))
mBKWx+=this.EaXDU("MESSAGE_WIRE",Translator.tr("PRINT_FORM_MESSAGE_WIRE"))
}
if(jRSWE.vxrCM=="paypal")
{
mBKWx+=this.EaXDU("LABEL_PAYPAL_CART_TITLE",Translator.tr("PRINT_FORM_PAYPAL_CART_TITLE"));
mBKWx+=this.EaXDU("TYPE_PAYMENT","Paypal")
mBKWx+=this.EaXDU("MESSAGE_PAYPAL",Translator.tr("PRINT_FORM_MESSAGE_PAYPAL"))
}
mBKWx+=this.EaXDU("LABEL_PRINT",Translator.tr("PRINT_FORM_LABEL_PRINT"))
mBKWx+=this.EaXDU("card_html",this.mqfGU())
mBKWx+=this.EaXDU("card_plain_text",this.GafuU())
mBKWx+=this.EaXDU("LABEL_SELLER_INFORMATION",Translator.tr("Seller information"))
mBKWx+=this.EaXDU("LABEL_BANK_ACCOUNT",Translator.tr("Bank account information"))
mBKWx+=this.EaXDU("LABEL_ADDRESS",Translator.tr("Address"))
mBKWx+=this.EaXDU("seller_address",CONST_WA_GLOBAL_SETTINGS.seller_address)
mBKWx+=this.EaXDU("bank_account_informations",CONST_WA_GLOBAL_SETTINGS.bank_account_informations)
mBKWx+=this.EaXDU("buyer_info_shipping",this.bpKLm())
var mfoHI=""
if(jRSWE.buTQu)
{
mfoHI=this.PjTSp();
};
mBKWx+=this.EaXDU("buyer_info_billing",mfoHI)
mBKWx+="</form>"
return mBKWx;
}
lmDOt.XqxDP=function()
{
var GmHTb=HFBJY();
GmHTb.WEZpS()
this.closeWin()
}
lmDOt.KYOlu=function()
{
var ksZbO=CONST_WA_GLOBAL_SETTINGS.currency_info
var GmHTb=HFBJY();
var iCDWu=true;
var jRSWE=GmHTb.FQcsD 
if(jRSWE.vxrCM=="paypal")
if((GmHTb.FoKtL==true)&&(CONST_WA_GLOBAL_SETTINGS.list_promo_codes==false))
{
iCDWu=true;
}
if((iCDWu==false)&&(jRSWE.vxrCM=="paypal"))
{
this.addButton(Translator.tr('Clear cart'),this.XqxDP,[""],this)
this.initializeWindow(400,200)
}
else
{
this.initializeWindow(400,150)
}
var mBKWx=""
if((iCDWu==false)&&(jRSWE.vxrCM=="paypal"))
{
mBKWx+=this.uNWUC()
}
if(iCDWu)
{
mBKWx+=this.WCkeg()
if((PcOOt==false)&&(document.webaca_is_preview))
{
WA_Dialog.alert(Translator.tr("Operation not allowed in preview mode"))
return
}
}
mBKWx+="<table border=0 style='width:100%;'><tr>";
mBKWx+="<td align=center style='"+this.cssText1()+"'>"
mBKWx+=Translator.tr("You have been redirected to the payment page")
if((iCDWu==false)&&(jRSWE.vxrCM=="paypal"))
{
mBKWx+="<br><br>"
mBKWx+=Translator.tr("You can clear your cart")
}
mBKWx+="</td></tr></table>"
this.writeContent(mBKWx) 
if(ksZbO.charCodeAt(3)>=100)
{
WA_Dialog.alert(Translator.tr("This cariboost edition can't support ebusiness features !'"))
return;
}
var qdFGJ=document.getElementById("wa-http-sender")
qdFGJ.submit()
if(iCDWu)
{
GmHTb.WEZpS()
}
}
lmDOt.KYOlu()
}

-->
