<!--

var APtMb=0
var BxRwY=1
var WkgZH=2
var egVLU=0;
var pDeju=1;
var eWUUq=2;
var xwgfI=0
var eefdZ=1
var SoZwT=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(GBOiZ)
{
QZaSO().nsWSD(GBOiZ)
var HxZcJ=WA_Dialog.getCurrent();
HxZcJ.UqXZl()
}
function QZaSO()
{
if(document.wa_global_settings_market==undefined)document.wa_global_settings_market=new NXJmE()
return document.wa_global_settings_market;
}
function vXeqZ()
{
this.MRdLF=function()
{
return this.IgeJG+"-"+this.UaUTK_index
}
this.kUaqp=function(FoxFG,sfMKO)
{
this.UaUTK=FoxFG.obj.market.info.folder.substring(13);
this.UaUTK_index=FoxFG.obj.index;
this.UaUTK_modif=FoxFG.obj.market.info.critical_id_modif
this.IgeJG=FoxFG.obj.market.id 

this.hIMxs=1;
this.exhEx=FoxFG.title;
this.AqoXP=FoxFG.price;
this.ehOES=FoxFG.weight;
this.grTrb=FoxFG.code_product;
}
this.CoNHw=function(FoxFG,sfMKO)
{

this.exhEx=FoxFG.title;
this.AqoXP=FoxFG.price;
this.ehOES=FoxFG.weight;
this.grTrb=FoxFG.code_product;
}
this.hXdXp=function()
{
var s="";
s+=this.MRdLF();
if(this.m_opt_vals)
for(var i=0;i<this.m_opt_vals.length;i++)
{
var riOiZ=this.m_opt_vals[i]
if(riOiZ!=-1) s+="/"+riOiZ;
}
return s;
}
this.wwVxG=function()
{
var val="";
val+="j="+this.UaUTK+",";
val+="i="+this.UaUTK_index+",";
val+="m="+this.UaUTK_modif+",";
val+="q="+this.hIMxs+",";
if(this.m_opt_vals)
{
for(var i=0;i<this.m_opt_vals.length;i++)
{
val+="o"+i+"=";
var suQSN=this.m_opt_vals[i]
if(suQSN>-1)
val+=suQSN
else
val+=""
val+=","
}
}
return val;
}
this.TBiVc=function(map,k)
{
var v=map[k];
if(v=="undefined") return "";
return v;
}
this.XqMxm=function(map)
{
this.UaUTK=this.TBiVc(map,"j");
if(this.UaUTK=="") return false;
this.UaUTK_index=this.TBiVc(map,"i");
this.UaUTK_modif=this.TBiVc(map,"m");
this.hIMxs=parseInt(map["q"]);
this.m_opt_vals=new Array();
for(var i=0;i<3;i++)
{
var vgkHf=parseInt(map["o"+i]);
if(isNaN(vgkHf))vgkHf=-1;
this.m_opt_vals.push(vgkHf)
}
return true;
}
this.XJxYC=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.TrWUG=function(ABjUM)
{
var Lkqto=this.XJxYC(ABjUM)
return this.XqMxm(Lkqto) 
}
this.qWBCU=function()
{
return HqBQw(this.FoxFG,this.m_opt_vals)
}
}
function Wgkmw(OXLvU,finFZ)
{
var fItMb=OXLvU[0]
var qDkOU=OXLvU[1]
var DRMBa=OXLvU[2]
if(fItMb.length==0)
{
DRMBa.call(qDkOU)
return;
}
var js=fItMb.pop()
WA_loadScript(js.src,Wgkmw,[fItMb,qDkOU,DRMBa]);
}
function WA_arrayContains(sIkLZ,ABjUM)
{
for(var n=0;n<sIkLZ.length;n++){if(sIkLZ[n]==ABjUM)return true;}
return false;
}
function MFJNI(sIkLZ)
{
var Lkqto=new Array()
for(var n=0;n<sIkLZ.length;n++)
{
var UnksQ=sIkLZ[n]
if(UnksQ=="address") Lkqto=Lkqto.concat(["address_1","address_2","city","zip"])
else Lkqto.push(UnksQ)
}
return Lkqto;
}
function mqPbr()
{
this.fPTmc=function()
{
if(this.DNJvH.length==0)return CONST_WA_GLOBAL_SETTINGS.default_selected_country;
return this.DNJvH;
}
this.kZPgQ=function()
{
this.LbcUf()
}
this.XJxYC=function(s)
{
var xvxXg=new Array();
var tab=s.split(",");
for(var i=0;i<tab.length;i++)
{
var tab3=tab[i].split("=");
if(tab3.length==2)xvxXg[tab3[0]]=tab3[1];
}
return xvxXg;
}
this.SUDxS=function(KgiMh)
{
if(KgiMh==undefined) return ""
return(KgiMh==xwgfI)?"deliv-":"bill-"
}
this.JgCHD=function(SFePo,KgiMh,fisWf)
{
if(!fisWf)fisWf=""
var vTaMi=this.SUDxS(KgiMh)
if(SFePo=="country")
{
if(KgiMh==xwgfI) return this.DNJvH
if(KgiMh==eefdZ) SFePo="countryCode"
}
if(SFePo=="state")
{
SFePo="stateCode"
}
var riOiZ=this.XNJZI[vTaMi+SFePo]
if(!riOiZ) return fisWf
riOiZ=riOiZ.replace(/\"/g,"'")
return riOiZ
}
this.wvmuE=function(riOiZ)
{
if(riOiZ==undefined)return ""
return riOiZ
}
this.UnXnh=function(key,val)
{
if((val==null)||(val==undefined)) val="";
WA_SetCookie("crbst-card-"+key,val)
}
this.bYSbl=function(key)
{
var qDkOU=WA_GetCookie("crbst-card-"+key)
if(qDkOU=="null")qDkOU="";
return ""+qDkOU
}
this.kgirD=function()
{
this.XNJZI=new Array()
var ABjUM=this.bYSbl("order-infos")
var Lkqto=this.XJxYC(ABjUM)
for(var k1 in Lkqto)
{
var riOiZ=Lkqto[k1]
if((k1.indexOf("deliv-")==0)||(k1.indexOf("bill-")==0))
this.XNJZI[k1]=unescape(riOiZ)
}
this.DNJvH=this.wvmuE(Lkqto["countryCode"])
if(this.YmvPv.length==0)
{
this.YmvPv=this.wvmuE(Lkqto["typePayment"])
}
this.NgPUK=(this.wvmuE(Lkqto["differentBillingAddressChecked"])=="true")
this.gfxoo=(this.wvmuE(Lkqto["salesConditionChecked"])=="true")
}
this.LbcUf=function()
{
var ABjUM=""
for(var k1 in this.XNJZI)
{
var riOiZ=this.XNJZI[k1]
ABjUM+=k1+"="+escape(riOiZ)+","
}
var rARMe=""
rARMe+="countryCode="+escape(this.DNJvH)+","
rARMe+="typePayment="+escape(this.YmvPv)+","
rARMe+="differentBillingAddressChecked="+(this.NgPUK)+","
rARMe+="salesConditionChecked="+(this.gfxoo)+","
ABjUM+=rARMe 
this.UnXnh("order-infos",ABjUM)
}
this.xsbJs=function(FHVmT)
{
if(trimString(FHVmT.value).length==0)
{
FHVmT.style.backgroundColor="#ff0000"
FHVmT.focus()
return false;;
}
FHVmT.style.backgroundColor=""
return true;
}
this.iDkVL=function(KgiMh)
{
var oGQMP=MFJNI(CONST_WA_GLOBAL_SETTINGS.list_form_fields)
var dJgIJ=MFJNI(CONST_WA_GLOBAL_SETTINGS.list_mandatory_form_fields) 
var PDTfs=this.XNJZI;
var vTaMi=this.SUDxS(KgiMh) 
var ATXvM=document.getElementById("wa-market-form")
for(var n=0;n<oGQMP.length;n++)
{
var xKSfP=oGQMP[n]
var hCrVU=ATXvM[xKSfP]
var riOiZ=trimString(hCrVU.value)
if(xKSfP!="address_2")
if(WA_arrayContains(dJgIJ,xKSfP))
{
if(this.xsbJs(hCrVU)==false)return false;
}
PDTfs[vTaMi+xKSfP]=riOiZ
}
var MkSvX=document.getElementById("wa-select-state");
var aUqTa=document.getElementById("wa-market-state");
if(MkSvX&&(aUqTa.style.display!="none"))
{
if(this.xsbJs(MkSvX)==false)return false;
PDTfs[vTaMi+"stateCode"]=MkSvX.value
}
else
{
PDTfs[vTaMi+"stateCode"]=""
}
if(KgiMh==eefdZ)
{
var iMJIm=document.getElementById("wa-select-form-country");
if(iMJIm)
{
PDTfs[vTaMi+"countryCode"]=iMJIm.value
}
}
this.LbcUf()
return true;
}
this.hWnVf=""
this.DNJvH=""
this.YmvPv=""
this.NgPUK=false;
this.gfxoo=false
this.kgirD()
}
function NXJmE()
{
this.UxwjJ=new Array();
this.qDkOU_callback=false;
this.aIYLU=false;
this.emOSV=false;
this.FPhop=new mqPbr()
this.tXMIo=CONST_WA_GLOBAL_SETTINGS.use_native_paypal_cart;
this.DoiRb=function(qDkOU,DRMBa)
{
this.qDkOU_callback=qDkOU
this.aIYLU=DRMBa 
var ICuka=this.bYSbl("data")
this.lQmAc(ICuka) 
var fItMb=new Array()
var sIkLZ=this.UxwjJ;
for(var i=0;i<sIkLZ.length;i++)
{
var QCRmx=sIkLZ[i];
var nLFGb=Translator.m_lang_for_filename
if(nLFGb.length>0)nLFGb="_"+nLFGb;
var ReOpj=QCRmx.UaUTK;
var n=ReOpj.indexOf("_")
if(n>-1)ReOpj=ReOpj.substring(n+1)
QCRmx.IgeJG="wa-id-"+ReOpj 
var WNIBi=wa_global_market.markets[QCRmx.IgeJG]
if(this.emOSV==false)
if(!WNIBi)
{
var ScJtZ="crbst_market_"+QCRmx.UaUTK+'/'
WA_declareMarket(QCRmx.IgeJG,ScJtZ,QCRmx.UaUTK_modif) 
var AxPeT=ScJtZ+'market-definition'+nLFGb+'.js?v='+QCRmx.UaUTK_modif
fItMb.push({id:ReOpj,src:AxPeT})
}
}
Wgkmw([fItMb,this,this.TTUvK],true)
}
this.hAxOK=function()
{
this.UnXnh("data","")
this.FPhop.UnXnh("order-infos","")
this.FPhop.kgirD()
this.lQmAc("")
}
this.TTUvK=function()
{
this.emOSV=true;
var sIkLZ=this.UxwjJ;
var vPJWg=new Array();
for(var i=0;i<sIkLZ.length;i++)
{
var QCRmx=sIkLZ[i];
var ReOpj=QCRmx.IgeJG
var seEvU=wa_global_market.markets[ReOpj] 

if(seEvU.info)
{
var uspYU=seEvU.info.products 
var sfMKO=QCRmx.UaUTK_index
var FoxFG=uspYU[sfMKO]
QCRmx.FoxFG=FoxFG
QCRmx.CoNHw(QCRmx.FoxFG,sfMKO)
if((FoxFG.unavail==false)&&(QCRmx.UaUTK_modif==seEvU.info.critical_id_modif))
{
vPJWg.push(QCRmx)
}
}
else
{
}
}
this.UxwjJ=vPJWg
this.KwPEJ() 

this.aIYLU.call(this.qDkOU_callback)
}
this.lQmAc=function(dbYdV)
{
var sIkLZ=new Array();
var list_string_products=dbYdV.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 QCRmx=new vXeqZ();
if(QCRmx.TrWUG(s_data))
{
sIkLZ.push(QCRmx);
}
}
}
this.UxwjJ=sIkLZ;
var rxXOB=this.rLlLA()
if(WA_getNumberMarketItemsInCart()!=rxXOB)
{
this.NtoAM()
this.CXoEY()
}
}
this.WDOHU=function()
{
var pNOLY=''
try{pNOLY=CONST_WA_GLOBAL_SETTINGS.currency_mnemonic}catch(e){}
return pNOLY
}
this.nsWSD=function(GBOiZ)
{
var list2=new Array();
var sIkLZ=this.UxwjJ
for(var i=0;i<sIkLZ.length;i++)
{
var QCRmx=sIkLZ[i];
if(i!=GBOiZ)
{
list2.push(QCRmx);
}
}
this.UxwjJ=list2;
this.KwPEJ()
}
this.addProductToShoppingCard=function(FoxFG,optionsValues)
{
if(this.WWrGC()==false)
{
WA_Dialog.alert(Translator.tr("You can't use shopping card Your browser doesnt accept cookies !"));
return false;
}
var tehfc=FoxFG.obj
var sIkLZ=this.ZiBtJ();
var n=sIkLZ.length
var wvGVB=new vXeqZ()
wvGVB.kUaqp(FoxFG,n);
wvGVB.m_opt_vals=optionsValues
var b_match=false;
for(var i=0;i<sIkLZ.length;i++)
{
var QCRmx=sIkLZ[i];
if(QCRmx.hXdXp()==wvGVB.hXdXp())
{
b_match=true;
QCRmx.hIMxs++;
}
}
if(b_match==false)
{
var ICuka=this.bYSbl("data")
var DNhJn=wvGVB.wwVxG()
var UXKJE=ICuka.length+DNhJn.length 
if(UXKJE>4000)
{
WA_Dialog.alert(Translator.tr("Cookies cart contains max data !"));
return false;
}
sIkLZ.push(wvGVB);
}
return true
}
this.WuIVE=function()
{
var sIkLZ=this.UxwjJ
var ICuka="";
for(var i=0;i<sIkLZ.length;i++)
{
var info=sIkLZ[i];
ICuka+=info.wwVxG()+";";
}
return ICuka;
}
this.rLlLA=function()
{
var vnbbd=0;
var sIkLZ=this.UxwjJ;
for(var i=0;i<sIkLZ.length;i++)
{
var QCRmx=sIkLZ[i];
vnbbd+=QCRmx.hIMxs
}
return vnbbd;
}
this.NtoAM=function()
{
this.UnXnh("nb_items",this.rLlLA())
}
this.KwPEJ=function()
{
var sIkLZ=this.UxwjJ
var ICuka=this.WuIVE()
this.UnXnh("data",ICuka)
this.NtoAM()
this.CXoEY();
}
this.CXoEY=function()
{
WA_refreshNumberMarketItemsInCart()
}
this.ZiBtJ=function()
{
return this.UxwjJ;
}
this.WWrGC=function()
{
this.UnXnh("watestcookies","test")
return(this.bYSbl("watestcookies")=="test");
}
this.UnXnh=function(key,val)
{
if((val==null)||(val==undefined)) val="";
WA_SetCookie("crbst-card-"+key,val)
}
this.bYSbl=function(key)
{
var qDkOU=WA_GetCookie("crbst-card-"+key)
if(qDkOU=="null")qDkOU="";
return ""+qDkOU
}
this.FxFeU=function(v)
{
return WA_formatPrice(v) 
}
this.wYbQu=function(v)
{
return WA_basicFormatPrice(v)+" "+CONST_WA_GLOBAL_SETTINGS.currency_code;
}
this.ENsdJ=function(QLThx)
{
return Math.round(QLThx*100)/100
}
this.WQuDB=function()
{
var sIkLZ=this.ZiBtJ()
var price=0;
for(var i=0;i<sIkLZ.length;i++)
{
var QCRmx=sIkLZ[i];
price+=(QCRmx.qWBCU()*QCRmx.hIMxs);
}
return price;
}
this.XYWjH=function()
{
var QLThx=this.WQuDB()
var cwIRe=0;
var sIkLZ=CONST_WA_GLOBAL_SETTINGS.list_promo_codes
for(var i=0;i<sIkLZ.length;i++)
{
var adUgr=sIkLZ[i];
if(MD5(trimString(this.FPhop.hWnVf.toUpperCase()))==adUgr.c)
{
if(adUgr.v.indexOf("%")>-1)
{
var cwIRe=parseFloat(adUgr.v)/100;
return QLThx*cwIRe;
}
else
{
return parseFloat(adUgr.v);
}
break;
}
}
return 0;
}
this.computeShippingForValue=function(val)
{
var KrcIq=CONST_WA_GLOBAL_SETTINGS.shipping_type
if(KrcIq==APtMb)return 0;
var ship_val=0;
var lXPdT=CONST_WA_GLOBAL_SETTINGS.shipping_intervals
for(var i=0;i<lXPdT.length;i++)
{
var CtRBq=lXPdT[i];
if(CtRBq.v<val)ship_val=CtRBq.p
}
return ship_val;
}
this.LiRpa=function(AiQTe)
{
var Lkqto=CONST_WA_GLOBAL_SETTINGS.xvxXg_list_extra_shipping_by_country_code
if(Lkqto==undefined)
{
Lkqto=new Array()
CONST_WA_GLOBAL_SETTINGS.xvxXg_list_extra_shipping_by_country_code=Lkqto;
var sOrTB=CONST_WA_GLOBAL_SETTINGS.list_extra_shipping_by_country_code
for(var GBOiZ in sOrTB)
{
var lEQqF=sOrTB[GBOiZ];
var Rdagk=lEQqF.c
for(var JpJMw in Rdagk)
{
var WDaWe=Rdagk[JpJMw];Lkqto[WDaWe]=lEQqF.p;
}
}
}
return Lkqto[AiQTe];
}
this.BWJSU=function(AiQTe)
{
var Lkqto=CONST_WA_GLOBAL_SETTINGS.xvxXg_list_tva_by_country_code
if(Lkqto==undefined)
{
Lkqto=new Array()
CONST_WA_GLOBAL_SETTINGS.xvxXg_list_tva_by_country_code=Lkqto;
var sOrTB=CONST_WA_GLOBAL_SETTINGS.list_tva_by_country_code
for(var GBOiZ in sOrTB)
{
var lEQqF=sOrTB[GBOiZ];
var Rdagk=lEQqF.c;
for(var JpJMw in Rdagk)
{
var WDaWe=Rdagk[JpJMw];Lkqto[WDaWe]=lEQqF.p;
}
}
}
return Lkqto[AiQTe];
}
this.kvjfk=function()
{
var KrcIq=CONST_WA_GLOBAL_SETTINGS.shipping_type
var sIkLZ=this.ZiBtJ()
var global_ref_for_shipping=0;
var WKhXE=0;
var DNJvH=this.FPhop.DNJvH;
if(DNJvH.length>0)
{
WKhXE=this.LiRpa(DNJvH);
if(isNaN(WKhXE)) WKhXE=0;
}
for(var i=0;i<sIkLZ.length;i++)
{
var QCRmx=sIkLZ[i];
if(KrcIq==BxRwY)
{
global_ref_for_shipping+=(QCRmx.hIMxs*QCRmx.qWBCU());
}
if(KrcIq==WkgZH)
{
global_ref_for_shipping+=(QCRmx.hIMxs*QCRmx.ehOES);
}
}
return WKhXE+this.ENsdJ(this.computeShippingForValue(global_ref_for_shipping));
}
this.IliqL=function()
{
return CONST_WA_GLOBAL_SETTINGS.tva_type==pDeju
}
this.wuYvS=function()
{
return CONST_WA_GLOBAL_SETTINGS.tva_type==eWUUq
}
this.SYQDx=function()
{
return CONST_WA_GLOBAL_SETTINGS.tva_type==egVLU
}
this.QgjkE=function()
{
if(this.SYQDx())return 0;
var tax=0;
var country_code=this.FPhop.DNJvH;
if(country_code.length>0)
{
tax=this.BWJSU(country_code);
if(isNaN(tax))tax=0;
}
return tax;
}
this.PfSYV=function(QLThx)
{
if(this.IliqL())
{
var n0=this.QgjkE()/100;
return QLThx*(n0/(1+n0));
}
if(this.wuYvS())
{
return QLThx*this.QgjkE()/100;
}
return QLThx;
}
this.DQvCo=function()
{
if(this.SYQDx())return 0;
var sIkLZ=this.ZiBtJ()
var lDDoX=0;
var bxwGT=0;
for(var i=0;i<sIkLZ.length;i++)
{
var QCRmx=sIkLZ[i];
lDDoX+=(QCRmx.qWBCU()*QCRmx.hIMxs);
}
lDDoX+=this.kvjfk();
bxwGT=this.ENsdJ(this.PfSYV(lDDoX));
return bxwGT;
}
this.MkXhP=function()
{
var QLThx=0;
QLThx+=this.WQuDB()
if(this.wuYvS())QLThx+=this.DQvCo()
QLThx+=this.kvjfk()
QLThx-=this.XYWjH()
return QLThx;
}
}
function vOhgH(OZuMC,KQdtF)
{
if(OZuMC.lab<KQdtF.lab) return-1;
if(OZuMC.lab>KQdtF.lab) return 1;
return 0
}
function WA_marketWatchQuantity()
{
var HxZcJ=WA_Dialog.getCurrent()
HxZcJ.nWWEV()
}
function WA_displayDialogMarketCart()
{
var HxZcJ=new WA_Dialog();
HxZcJ.lwLAP=false;
HxZcJ.UUvcU=function()
{
this.tmXpw()
this.lwLAP=setInterval("WA_marketWatchQuantity()",400)
}
HxZcJ.tmXpw=function()
{
if(this.lwLAP)clearInterval(this.lwLAP)
}
HxZcJ.nWWEV=function()
{
var MhWHD=QZaSO();
var hkesl=MhWHD.ZiBtJ();
for(var n=0;n<hkesl.length;n++)
{
var QCRmx=hkesl[n]
var gLYbW=document.getElementById("wa-cart-quantity-"+n)
var hGEUg=gLYbW.value
var PIPkm=parseInt(hGEUg)
if(isNaN(PIPkm))PIPkm=0;
if((hGEUg!='')&&(PIPkm+""!=hGEUg))
{
gLYbW.value=""+PIPkm
}
if(PIPkm!=QCRmx.hIMxs)
{
QCRmx.hIMxs=PIPkm
MhWHD.KwPEJ()
this.sANcZ()
}
}
var bLKhB=document.getElementById("wa-promo-code")
if(bLKhB)
{
if(bLKhB.value!=MhWHD.FPhop.hWnVf)
{
MhWHD.FPhop.hWnVf=bLKhB.value
this.sANcZ()
}
}
}
HxZcJ.onCustomKeypress=function(xAAjA)
{
if(xAAjA==13)
{
wa_timeout(Delegate.create(this,this.nkrkA),0);
}
return false;
}
HxZcJ.closeWin=function()
{
this.tmXpw()
this.intern_closeWin()
}
HxZcJ.sANcZ=function()
{
var MhWHD=QZaSO();
var hkesl=MhWHD.ZiBtJ();
if(hkesl.length==0) return;
for(var n=0;n<hkesl.length;n++)
{
var QCRmx=hkesl[n]
var HPVtA=document.getElementById("wa-cart-total-"+n)
var QLThx=QCRmx.qWBCU() 
var CjCLk=QCRmx.hIMxs*QLThx
var ABjUM="<span style='"
ABjUM+=(CjCLk>0)?"color:"+WA_GLOBAL_COLOR_THEME.color_text+";font-weight:normal;":"color:#ff0000;font-weight:bold;"
ABjUM+="'>"
ABjUM+=MhWHD.FxFeU(CjCLk)
ABjUM+="</span>"
HPVtA.innerHTML=ABjUM
}
var kWWvB=MhWHD.WQuDB()
var mjCWa=MhWHD.DQvCo()
var viWEe=MhWHD.kvjfk()
var MSXsZ=MhWHD.MkXhP()
var GIQcQ=MhWHD.XYWjH()
var wvHuq=""
var HPVtA=document.getElementById("wa-cart-amount-total")
wvHuq+=Translator.tr("Sub total")+" : "+MhWHD.FxFeU(kWWvB)
wvHuq+="<br>"
if(viWEe>0)
{
wvHuq+="<span>"+Translator.tr("Shipping amount")+" : "+MhWHD.FxFeU(viWEe)+"</span>";
wvHuq+="<br>"
}
if(MhWHD.IliqL()||MhWHD.wuYvS())
{
if(MhWHD.IliqL())
{
wvHuq+="<div style='width:100%;text-align:left;'>"
wvHuq+=Translator.tr("Tax included");
}
if(MhWHD.wuYvS())
{
wvHuq+="<div>"
wvHuq+=Translator.tr("Extra Tax");
}
wvHuq+=" : ";
wvHuq+=MhWHD.FxFeU(mjCWa)+"</div>";
}
if(GIQcQ>0)
{
wvHuq+="<span>"+Translator.tr("Promotion")+" : - "+MhWHD.FxFeU(GIQcQ)+"</span><br>";
}
wvHuq+="<span><b>"+Translator.tr("Total")+" : "+MhWHD.FxFeU(MSXsZ)+"</b></span>";
HPVtA.innerHTML=wvHuq
}
HxZcJ.FnOrl=function()
{
WA_displayDialogMarketCart()
}
HxZcJ.pIIBa=function()
{
this.closeWin()
}
HxZcJ.nkrkA=function()
{
var MhWHD=QZaSO();
if(WA_getNumberMarketItemsInCart()==0)return;
var TVHWg=document.getElementById("wa-market-select-country")
if(TVHWg)
{
MhWHD.FPhop.DNJvH=TVHWg.value
}
if(MhWHD.FPhop.DNJvH=="")
{
var TVHWg=document.getElementById("wa-market-select-country")
if(TVHWg)
{
TVHWg.focus()
TVHWg.style.backgroundColor="#ff0000"
return;
}
}
if(CONST_WA_GLOBAL_SETTINGS.link_sale_condition)
{
if(MhWHD.FPhop.gfxoo!=true)
{
var ufZri=document.getElementById("wa-sales-condition")
if(ufZri)
{
ufZri.focus()
var oftTw=document.getElementById("wa-sales-condition-label")
oftTw.style.backgroundColor="#ff0000"
return;
}
}
}
var Deikn=CONST_WA_GLOBAL_SETTINGS.list_type_payment
if(Deikn.length==1)
{
MhWHD.FPhop.YmvPv=Deikn[0]
}
var TVHWg=document.getElementById("wa-market-select-payment")
if(TVHWg)
{
MhWHD.FPhop.YmvPv=TVHWg.value
if(MhWHD.FPhop.YmvPv=="")
{
TVHWg.focus()
TVHWg.style.backgroundColor="#ff0000"
return;
}
}
OKcQM()
}
HxZcJ.UqXZl=function()
{
WA_exec_callback_opera_compliant(this,this.vkspv)
}
HxZcJ.vkspv=function()
{
var MhWHD=QZaSO();

var iMJIm=document.getElementById("wa-market-select-country")
if(iMJIm)
{
MhWHD.FPhop.DNJvH=iMJIm.value
}
MhWHD.FPhop.kZPgQ()
var XGYNc=html_getLayer("market-cart-content")
var pGcbi=html_getLayer("wa-market-payment-form") 
var ABjUM=""
var hkesl=MhWHD.ZiBtJ();
html_SetVisibility(pGcbi,(hkesl.length>0))
if(hkesl.length==0)
{
ABjUM+="<span style='font-family:Arial;font-size:16px;'>"
ABjUM+=Translator.tr("No articles in Card !")
ABjUM+="</span>"
}
else
{
var cwmbR="border:1px solid "+WA_GLOBAL_COLOR_THEME.color0+";font-weight:normal;"
var YpdjB=new RGBColor(WA_GLOBAL_COLOR_THEME.color0);
var uYNmv=YpdjB.toHsl();
YpdjB.fromHsl(uYNmv[0],uYNmv[1],uYNmv[2]+0.2)
var DsnmZ="border:1px solid "+WA_GLOBAL_COLOR_THEME.color0+";font-weight:normal;color:"+WA_GLOBAL_COLOR_THEME.color_text+";background-color:"+YpdjB.toRGB()+";"
var lKKTr="border:1px solid "+WA_GLOBAL_COLOR_THEME.color0+";color:#ff0000;font-weight:bold;"
var bAZEj="color:#222222;font-size:12px;"
ABjUM+="<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+";'>"
ABjUM+="<thead style='font-size:13px;border:1px solid;'>"
ABjUM+="<tr>"
ABjUM+="<th  colspan=2 style='"+DsnmZ+"'></th>"
ABjUM+="<th style='"+DsnmZ+"'  width=70px><b>"+Translator.tr("Price")+"</b></th>"
ABjUM+="<th style='"+DsnmZ+"'  width=70px><b>"+Translator.tr("Quantity")+"</b></th>"
ABjUM+="<th style='"+DsnmZ+"'  width=70px><b>"+Translator.tr("Total")+"</b></th>"
ABjUM+="<th style='"+DsnmZ+"'  width=90px></th>"
ABjUM+="</tr>"
var GSxGs=new RGBColor(WA_GLOBAL_COLOR_THEME.color2);
var XpqWs=GSxGs.toHsl();
GSxGs.fromHsl(XpqWs[0],XpqWs[1],XpqWs[2]-0.1) 
for(var n=0;n<hkesl.length;n++)
{
var FntrC="";
if(n%2==0)
{
FntrC="background-color:"+GSxGs.toRGB()+";"
}
var migJa=cwmbR+FntrC;
var QCRmx=hkesl[n]
ABjUM+="<tr>"
ABjUM+="<th style='"+migJa+"' >"
var seEvU=wa_global_market.markets[QCRmx.IgeJG]
var PYvpn=new Size(30,30)
var JfJFx=PYvpn
if(seEvU.info.design.crop_thumb==false)
{
JfJFx=QCRmx.FoxFG.size_thumb.clone()
JfJFx.scale(PYvpn)
}
else
{
}
if(QCRmx.FoxFG.img_thumb.length>0)
ABjUM+="<img border=0 src='"+QCRmx.FoxFG.img_thumb+"' width="+JfJFx.width+"px height="+JfJFx.height+"px>"
ABjUM+="</th>" 
ABjUM+="<th style='"+migJa+"text-align:left;padding:5px;' >"
ABjUM+="<b>"+QCRmx.exhEx+"</b>"
if(QCRmx.grTrb.length>0)
{
ABjUM+="<span style='"+bAZEj+"'>";
ABjUM+=" ["+QCRmx.grTrb+"]";
ABjUM+="</span>";
}
if(QCRmx.m_opt_vals)
{
ABjUM+="<br>"
ABjUM+="<span style='"+bAZEj+"'>";
for(var i_opt=0;i_opt<QCRmx.FoxFG.options.length;i_opt++)
{
var ZwrEv=QCRmx.FoxFG.options[i_opt]
if(ZwrEv)
{
var xjnNK=QCRmx.m_opt_vals[i_opt];
var rUAgE=ZwrEv.title;
if(rUAgE.length>0)
{
ABjUM+=rUAgE;
ABjUM+=":"
}
ABjUM+=ZwrEv.vals[xjnNK];
ABjUM+=" "
}
}
ABjUM+="</span>";
}
ABjUM+="</th>"
var QLThx=QCRmx.qWBCU()
ABjUM+="<th style='"+migJa+"' >"+MhWHD.FxFeU(QLThx)+"</th>"
ABjUM+="<th style='"+migJa+"'  align=center><input type=text id='wa-cart-quantity-"+n+"' style='width:45px;' maxlength=3 value='"+QCRmx.hIMxs+"' type=text/></th>"
ABjUM+="<th style='"
var CjCLk=QCRmx.hIMxs*QLThx
ABjUM+=(CjCLk>0)?migJa:(lKKTr+FntrC);
ABjUM+="' ><span id='wa-cart-total-"+n+"'>"
ABjUM+=MhWHD.FxFeU(CjCLk)
ABjUM+="</span></th>"
ABjUM+="<th style='"+migJa+"' ><a href=\"javascript:WA_marketRemoveItem("+n+")\">"+Translator.tr("Remove card item")+"</a></th>"
ABjUM+="</tr>"
}
ABjUM+="<tr>"
ABjUM+="<th style='"+cwmbR+"text-align:right;padding:5px;' id='wa-cart-amount-total'  colspan=5>&nbsp;</th>"
ABjUM+="<th style='"+cwmbR+"' ></th>"
ABjUM+="</tr>"
ABjUM+="</thead>"
ABjUM+="</table>"
ABjUM+="<br>"
}
XGYNc.innerHTML=ABjUM
this.UUvcU()
WA_exec_callback_opera_compliant(this,this.sANcZ) 
}
HxZcJ.tuvNj=function()
{
var MhWHD=QZaSO();
this.addButton(Translator.tr("Continue Shopping"),this.pIIBa,[""],this)
this.addButton(Translator.tr("Checkout order"),this.nkrkA,[""],this)
this.initializeWindow(670,700)
var UDVsh="font-family:Arial;font-size:12px;color:#000000;"
var ABjUM=""
ABjUM+="<div id='market-cart-content' style='width:100%;"+UDVsh+"' align=center>" 
ABjUM+="</div>"
ABjUM+="<br>"
ABjUM+="<div style='width:100%;"+UDVsh+"' align=center id='wa-market-payment-form'>"
ABjUM+="<br>"
var dOWgr=CONST_WA_GLOBAL_SETTINGS.list_favorite_country
var MheMI=CONST_WA_GLOBAL_SETTINGS.list_country
var SZrbq=new Array()
for(var YloGh=0;YloGh<dOWgr.length;YloGh++)
{
SZrbq[dOWgr[YloGh]]=true
}
for(var YloGh=0;YloGh<MheMI.length;YloGh++)
{
SZrbq[MheMI[YloGh]]=true
}
var wAAue=0;
var FigwY=""
for(var c in SZrbq)
{
wAAue++;
FigwY=c
}
if(wAAue==1)
{
MhWHD.FPhop.DNJvH=FigwY
}
if(wAAue>1)
{
ABjUM+="<span style='font-weight:bold;'>"
ABjUM+=Translator.tr("Please choose a country to deliver your order")
ABjUM+="</span>"
ABjUM+="<br>"
ABjUM+="<select onchange=\"WA_marketChangeCountry(this)\" id='wa-market-select-country'>"
if(CONST_WA_GLOBAL_SETTINGS.default_selected_country.length==0)
{
ABjUM+="<option value=\"\">...</option>"
}
var lngGB=new Array()
for(var YloGh=0;YloGh<dOWgr.length;YloGh++)
{
var vHYUO=dOWgr[YloGh]
lngGB.push({code:vHYUO,lab:Translator.country(vHYUO)})
}
for(var YloGh=0;YloGh<lngGB.length;YloGh++)
{
var qDkOU=lngGB[YloGh]
var vHYUO=qDkOU.code
ABjUM+="<option "
if(MhWHD.FPhop.fPTmc()==vHYUO)ABjUM+="selected "
ABjUM+="value=\""+vHYUO+"\">"+Translator.country(vHYUO)+"</option>"
}
if((dOWgr.length>0)&&(MheMI.length>0))
{
ABjUM+="<option value=\"\">-----</option>"
}
var btdIX=new Array()
for(var YloGh=0;YloGh<MheMI.length;YloGh++)
{
var vHYUO=MheMI[YloGh]
btdIX.push({code:vHYUO,lab:Translator.country(vHYUO)})
}
if((dOWgr.length==0)&&(MheMI.length==0))
{
var sIkLZ=CONST_WA_COUNTRIES.codes
for(var YloGh=0;YloGh<sIkLZ.length;YloGh++)
{
var vHYUO=sIkLZ[YloGh]
btdIX.push({code:vHYUO,lab:Translator.country(vHYUO)})
}
}
btdIX.sort(vOhgH)
for(var YloGh=0;YloGh<btdIX.length;YloGh++)
{
var qDkOU=btdIX[YloGh]
var vHYUO=qDkOU.code
ABjUM+="<option "
if(MhWHD.FPhop.fPTmc()==vHYUO)ABjUM+="selected "
ABjUM+="value=\""+vHYUO+"\">"+Translator.country(vHYUO)+"</option>"
}
ABjUM+="</select>"
ABjUM+="<br>"
ABjUM+="<br>"
}
if(CONST_WA_GLOBAL_SETTINGS.link_sale_condition)
{
ABjUM+="<a "+WA_LinkToHref(CONST_WA_GLOBAL_SETTINGS.link_sale_condition)+" style='color:#0000ff'>"
ABjUM+=Translator.tr("Terms of sell")
ABjUM+="</a>"
ABjUM+="<br>" 
ABjUM+="<span id='wa-sales-condition-label'  style='font-weight:bold;'>"
ABjUM+=Translator.tr("label_market_accept_terms")
ABjUM+="</span>"
ABjUM+="<input id='wa-sales-condition' onchange=\"WA_marketChangeSalesCondition(this)\" "
ABjUM+=(MhWHD.FPhop.gfxoo)?"checked ":""
ABjUM+="type='checkbox' value='1'/>" 
ABjUM+="<br>"
ABjUM+="<br>"
}
var Deikn=CONST_WA_GLOBAL_SETTINGS.list_type_payment
if(Deikn.length>1)
{
ABjUM+="<span style='font-weight:bold;'>"
ABjUM+=Translator.tr("Choose a type of payment")
ABjUM+="</span>"
ABjUM+="<br>"
ABjUM+="<select onchange=\"WA_marketChangeTypePayment(this)\" id='wa-market-select-payment'>"
if((Deikn.length>1)||(Deikn.length==0))
{
ABjUM+="<option value=\"\">...</option>"
}
for(var YloGh=0;YloGh<Deikn.length;YloGh++)
{
var YmvPv=Deikn[YloGh]
ABjUM+="<option "
if(MhWHD.FPhop.YmvPv==YmvPv)ABjUM+="selected "
ABjUM+="value=\""+YmvPv+"\">"+Translator.tr("label_market_"+YmvPv)+"</option>"
}
ABjUM+="</select>"
ABjUM+="<br>"
ABjUM+="<br>"
}
if(CONST_WA_GLOBAL_SETTINGS.list_promo_codes)
{
var sIkLZ=CONST_WA_GLOBAL_SETTINGS.list_promo_codes
ABjUM+="<span id='wa-promo-code-label'  style='font-weight:bold;'>"
ABjUM+=Translator.tr("form-label-code_promo")
ABjUM+="</span><br>"
ABjUM+="<input id='wa-promo-code' onchange=\"WA_marketChangePromoCode(this)\" " 
ABjUM+=" value='"+MhWHD.FPhop.hWnVf+"' "
ABjUM+="/>"
ABjUM+="<br>" 
}
ABjUM+="</div>"
this.writeContent(ABjUM)
var XGYNc=html_getLayer("market-cart-content")
XGYNc.innerHTML="<div width=100% align=center><img src='wa_loading.gif'></div>" 

MhWHD.DoiRb(this,this.UqXZl)
}
HxZcJ.tuvNj() 
}
function WA_marketChangeCountry(TVHWg)
{
TVHWg.style.backgroundColor=""
var HxZcJ=WA_Dialog.getCurrent()
HxZcJ.UqXZl()
}
function WA_marketChangeTypePayment(TVHWg)
{
var MhWHD=QZaSO();
MhWHD.FPhop.YmvPv=TVHWg.value
MhWHD.FPhop.kZPgQ()
TVHWg.style.backgroundColor=""
}
function WA_marketChangeSalesCondition(FHVmT)
{
var MhWHD=QZaSO();
MhWHD.FPhop.gfxoo=FHVmT.checked
MhWHD.FPhop.kZPgQ() 
var oftTw=document.getElementById("wa-sales-condition-label")
oftTw.style.backgroundColor="" 
}
function WA_marketChangePromoCode(FHVmT)
{
var MhWHD=QZaSO();
MhWHD.FPhop.hWnVf=FHVmT.value
MhWHD.FPhop.kZPgQ() 


}
function WA_LinkToHref(ZldHF)
{
var ABjUM=""
var oFtEd=ZldHF.url
var ZgLcF=Translator.m_lang_for_filename
if(ZgLcF.length>0)ZgLcF="_"+ZgLcF
oFtEd=oFtEd.replace(/@lng@/g,ZgLcF)
ABjUM+="href=\""+oFtEd+"\" "
if(ZldHF.open==1)
{
ABjUM+="target="
ABjUM+="_blank"
}
return ABjUM;
}
function WA_displayDialogMarketProduct(ReOpj,GBOiZ)
{
var WNIBi=wa_global_market.markets[ReOpj]
var hXVeh=WNIBi.obj
var uspYU=hXVeh.info.products
var FoxFG=uspYU[GBOiZ] 

var HxZcJ=new WA_Dialog();

HxZcJ.FoxFG=FoxFG
HxZcJ.OEVmr=ReOpj
HxZcJ.FnOrl=function()
{
WA_displayDialogMarketCart()
}
HxZcJ.AsDKK=function()
{
var MhWHD=QZaSO();
MhWHD.DoiRb(this,this.XDeCh) 
}
HxZcJ.XDeCh=function()
{
var FoxFG=this.FoxFG;
var MhWHD=QZaSO();
var UJppw=new Array();
var deaRJ=FoxFG.obj.id;
for(var i=0;i<3;i++)
{
var IYKqO=-1;
var vTaMi=deaRJ+"-select-opt"
var TVHWg=document.getElementById(vTaMi+i)
if(TVHWg)
{
if(TVHWg.value.length==0)
{
TVHWg.style.backgroundColor="#ff0000";
TVHWg.focus()
return;
}
IYKqO=parseInt(TVHWg.value)
}
UJppw.push(IYKqO)
}
if(MhWHD.addProductToShoppingCard(FoxFG,UJppw))
{
MhWHD.KwPEJ()
WA_displayDialogMarketCart()
}
}
HxZcJ.tuvNj=function()
{
var ReOpj=this.OEVmr
var FoxFG=this.FoxFG
var ABjUM=""
this.addButton(Translator.tr("Go to my card"),this.FnOrl,[""],this)
if(FoxFG.unavail==false)
{
this.addButton(Translator.tr("Add to card"),this.AsDKK,[""],this)
}
this.initializeWindow(670,this.idealHeight())
ABjUM+="<table border=0 width=100% cellpadding=4>"
ABjUM+="<tr>" 
if(FoxFG.img_big.length>0)
{
ABjUM+="<td width='100px' align=center valign=top>"
var JfJFx=FoxFG.size_thumb.clone() 
JfJFx.scale(new Size(200,200))
ABjUM+="<a href=\""+FoxFG.img_big+"\" target=_blank>"
ABjUM+="<img border=0 src=\""+FoxFG.img_big+"\" width='"+JfJFx.width+"px' height='"+JfJFx.height+"px'>"
ABjUM+="</a>"
ABjUM+="</td>"
}
var DItcR="color:"+WA_GLOBAL_COLOR_THEME.color_text+";";
ABjUM+="<td valign=top style='font-family:Arial;'>"
ABjUM+="<span style='font-weight:bold;font-size:16px;"+DItcR+"'>"
ABjUM+=FoxFG.title
ABjUM+="</span>"
ABjUM+="<br>"
if(FoxFG.sub_title.length>0)
{
ABjUM+="<span style='color:#333333;font-size:14px;'>"
ABjUM+=FoxFG.sub_title
ABjUM+="</span>"
ABjUM+="<br>"
}
ABjUM+="<br>"
ABjUM+="<table border=0 width=100% cellspacing=0 cellpadding=0><tr><td>"
ABjUM+="<span style='"+DItcR+";font-size:14px;'>"
ABjUM+=Translator.tr("Price")+" : "
ABjUM+="</span>"
ABjUM+="<span style='"+DItcR+";font-size:18px;font-weight:bold;' id='"+FoxFG.obj.id+"-price'>"
if(FoxFG.unavail)
{
ABjUM+=Translator.tr("Unavailable")
}
ABjUM+="</span>"
if(FoxFG.more_info)
{
ABjUM+="</td><td align=right>"
var ZldHF=FoxFG.more_info
var uoqlI=WA_LinkToHref(ZldHF)
ABjUM+="<a "+uoqlI+" style='font-family:Arial;text-decoration:underline;font-weight:bold;font-size:12px;color:0000ff;'>"+Translator.tr("More product info link")+"</a>"
}
ABjUM+="</td></tr></table>"
ABjUM+="<br>"
var fHnaH=FoxFG.obj.index
if(FoxFG.unavail==false)
if(FoxFG.options.length>0)
{
ABjUM+="<table border=0 cellspacing=0 cellpadding=0>"
for(var n=0;n<FoxFG.options.length;n++)
{
var ZwrEv=FoxFG.options[n]
if(ZwrEv)
{
ABjUM+="<tr><td align=right>"
ABjUM+="<span style='font-family:Arial;font-weight:bold;font-size:12px;"+DItcR+"'>"
ABjUM+=ZwrEv.title+" :&nbsp;"
ABjUM+="</span>"
ABjUM+="</td><td align=left>"
ABjUM+="<select id='"+FoxFG.obj.id+"-select-opt"+n+"' onchange=\"WA_market_changeCustomPrice('"+ReOpj+"',"+fHnaH+")\">"
ABjUM+="<option value=\"\">...</option>"
for(var YloGh=0;YloGh<ZwrEv.vals.length;YloGh++)
{
var riOiZ=ZwrEv.vals[YloGh]
ABjUM+="<option value=\""+YloGh+"\">"+riOiZ+"</option>"
}
ABjUM+="</select>"
ABjUM+="</td></tr>";
}
}
ABjUM+="</table>"
}
ABjUM+="</td>"
ABjUM+="</tr>"
ABjUM+="</table>"
if(FoxFG.description.length>0)
{
ABjUM+="<table border=0 width=100% cellpadding=4>"
ABjUM+="<tr><td colspan=2>"
ABjUM+="<span style='font-family:Arial;font-size:13px;"+DItcR+"'>"
ABjUM+="<hr>"
ABjUM+=FoxFG.description
ABjUM+="</span>"
ABjUM+="</td></tr>"
ABjUM+="</table>"
}
this.writeContent(ABjUM)
WA_market_changeCustomPrice(ReOpj,fHnaH)
}
HxZcJ.displayWindowWithAutoResize(300,HxZcJ.tuvNj) 
}
function OAhaT(FoxFG,deaRJ)
{
var VfBdZ=new Array()
for(var i=0;i<3;i++)
{
var vTaMi=deaRJ+"-select-opt"
var TVHWg=document.getElementById(vTaMi+i)
VfBdZ[i]=-1
if(TVHWg)
{
TVHWg.style.backgroundColor="";
var riOiZ=parseInt(TVHWg.value)
if(isNaN(riOiZ)==false)
VfBdZ[i]=riOiZ
}
}
return HqBQw(FoxFG,VfBdZ)
}
function HqBQw(FoxFG,VfBdZ)
{
if(FoxFG.unavail)return;
var YtVqp=false;
for(var i=0;i<FoxFG.custom_prices.length;i++)
{
var GTwff=FoxFG.custom_prices[i]
var Ewjas=true;
for(var n=0;n<3;n++)
{
if(GTwff.tab[n]!=VfBdZ[n])Ewjas=false
}
if(Ewjas)
{
YtVqp=GTwff;
break;
}
}
var QLThx=FoxFG.price
if(YtVqp)
{
QLThx=YtVqp.pr
}
return QLThx;
}
function WA_market_changeCustomPrice(ReOpj,fHnaH)
{
var MhWHD=QZaSO();
var WNIBi=wa_global_market.markets[ReOpj]
var uspYU=WNIBi.info.products;
var FoxFG=uspYU[fHnaH]
if(FoxFG.unavail)return;
var deaRJ=FoxFG.obj.id
var QLThx=OAhaT(FoxFG,deaRJ)
var TvqbB=html_getLayer(deaRJ+"-price")
if(TvqbB)
{
TvqbB.innerHTML=MhWHD.FxFeU(QLThx)
}
}
function OKcQM()
{
var MhWHD=QZaSO();
if(WA_getNumberMarketItemsInCart()==0)return;
var QCRmx=MhWHD.FPhop
if((MhWHD.tXMIo)&&(QCRmx.YmvPv=="paypal"))
{
gtUAT();
return;
}
gwIFm(xwgfI)
}
function gwIFm(KgiMh)
{
var MhWHD=QZaSO();
var QCRmx=MhWHD.FPhop
QCRmx.kgirD()
var HxZcJ=new WA_Dialog();
HxZcJ.KgiMh=KgiMh
HxZcJ.FvMwj=function(xAAjA)
{
return Translator.tr("form-label-"+xAAjA)
}
HxZcJ.onCustomKeypress=function(xAAjA)
{
if(xAAjA==13)
{
wa_timeout(Delegate.create(this,this.OAoBp),0);
}
return false;
}
HxZcJ.NcIMq=function()
{
if(this.KgiMh==xwgfI)
{
WA_displayDialogMarketCart()
}
else
{
gwIFm(xwgfI)
}
}
HxZcJ.SjDgt=function()
{
gtUAT()
}
HxZcJ.OAoBp=function()
{
var MhWHD=QZaSO();
var QCRmx=MhWHD.FPhop
if(QCRmx.iDkVL(this.KgiMh)==false) return;
QCRmx.kZPgQ()
if(this.KgiMh==xwgfI)
{
if(QCRmx.NgPUK==true)
{
gwIFm(eefdZ)
}
else
{
this.SjDgt()
}
}
else
{
this.SjDgt()
}
}
HxZcJ.dcFTc=function(xAAjA,CwTPL)
{
if(CwTPL==undefined) CwTPL=""
if(CwTPL)CwTPL=" size="+CwTPL
return "<input name='"+xAAjA+"' value=\""+QCRmx.JgCHD(xAAjA,this.KgiMh)+"\" type=text "+CwTPL+">"
}
HxZcJ.mPFlW=function(RjGSR)
{
return "<td width=150px align=right valign=top>"+Translator.tr(RjGSR)+" :</td>"
}
HxZcJ.tuvNj=function()
{
var MhWHD=QZaSO();
var QCRmx=MhWHD.FPhop 
this.addButton("< "+Translator.tr('Back'),this.NcIMq,[""],this)
this.addButton(Translator.tr('Continue')+" >",this.OAoBp,[""],this)
this.initializeWindow(600,600)
var CVZFE="form-label-"
var oGQMP=CONST_WA_GLOBAL_SETTINGS.list_form_fields 
var ABjUM=""
ABjUM+="<form id='wa-market-form' onSubmit='return false'>"
ABjUM+="<table border=0 width=100% cellspacing=5 style='font-family:Arial;font-size:15px;'>"
ABjUM+="<tr><td colspan=2 align=center style='font-size:18px;'>"
ABjUM+=Translator.tr((this.KgiMh==xwgfI)?"Fill Deliver information below":"Fill Billing information below")
ABjUM+="<br><br></td></tr>"
for(var n=0;n<oGQMP.length;n++)
{
var hCrVU=oGQMP[n]
if(hCrVU=="address")
{
ABjUM+="<tr>"+this.mPFlW("Address");
ABjUM+="<td>"
ABjUM+=this.dcFTc("address_1",30)
ABjUM+="</td></tr>"
ABjUM+="<tr><td></td><td>"
ABjUM+=this.dcFTc("address_2",30)
ABjUM+="</td></tr>"
ABjUM+="<tr>"+this.mPFlW("form-label-city");
ABjUM+="<td>"
ABjUM+=this.dcFTc("city")+"&nbsp;"+this.FvMwj("zip")+" : "+this.dcFTc("zip",10)
ABjUM+="</td></tr>" 
ABjUM+="<tr>"+this.mPFlW("form-label-country");
ABjUM+="<td>"
if(this.KgiMh==eefdZ)
{
ABjUM+="<select id='wa-select-form-country' onchange='WA_marketChangeFormCountry("+this.KgiMh+")'>"
var btdIX=new Array();
var sIkLZ=CONST_WA_COUNTRIES.codes
for(var YloGh=0;YloGh<sIkLZ.length;YloGh++)
{
var vHYUO=sIkLZ[YloGh]
btdIX.push({code:vHYUO,lab:Translator.country(vHYUO)})
}
btdIX.sort(vOhgH)
var WAiLd=QCRmx.fPTmc()
WAiLd=QCRmx.JgCHD('countryCode',this.KgiMh,WAiLd)
for(var YloGh=0;YloGh<btdIX.length;YloGh++)
{
var qDkOU=btdIX[YloGh]
var vHYUO=qDkOU.code
ABjUM+="<option "
if(WAiLd==vHYUO)ABjUM+="selected "
ABjUM+="value=\""+vHYUO+"\">"+Translator.country(vHYUO)+"</option>"
}
ABjUM+="</select>"
}
else
{
ABjUM+=Translator.country(MhWHD.FPhop.DNJvH);
}
ABjUM+="<br><span id='wa-market-state'>"
ABjUM+="<select id='wa-select-state'></select>"
ABjUM+="</span>" 
ABjUM+="</td></tr>"
}
else
{
ABjUM+="<tr>"+this.mPFlW("form-label-"+hCrVU);
ABjUM+="<td>"
ABjUM+=this.dcFTc(hCrVU,30) 
ABjUM+="</td></tr>"
}
}
if(this.KgiMh==xwgfI)
{
ABjUM+="<tr><td colspan=2 align=center >"
ABjUM+=Translator.tr("Billing adress is different")+" <input type=checkbox "
if(MhWHD.FPhop.NgPUK)ABjUM+="checked "
ABjUM+="onchange='WA_marketCheckBillingAdress(this)'>"
ABjUM+="</td></tr>"
}
ABjUM+="</table>"
ABjUM+="</form>"
this.writeContent(ABjUM)
WA_exec_callback_opera_compliant(this,this.OqsCK) 
}
HxZcJ.OqsCK=function()
{
WA_marketChangeFormCountry(this.KgiMh)
}
HxZcJ.tuvNj()
}
function hmDkS(KgiMh,TVHWg,Lkqto)
{
var MhWHD=QZaSO();
var QCRmx=MhWHD.FPhop
var wVxDb=QCRmx.JgCHD("stateCode",KgiMh) 
TVHWg.options.length=0
for(var n=0;n<Lkqto.length;n++)
{
var val=Lkqto[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==wVxDb)elOptNew.selected=true
try{
TVHWg.add(elOptNew,null);
}
catch(ex){
TVHWg.add(elOptNew);
}
}
}
function WA_marketChangeFormCountry(KgiMh)
{
var MhWHD=QZaSO();
var QCRmx=MhWHD.FPhop
var AiQTe=QCRmx.DNJvH
var TVHWg=document.getElementById("wa-select-form-country");
if(TVHWg) AiQTe=TVHWg.value;
html_SetDisplay("wa-market-state",(AiQTe=="US")||(AiQTe=="CA")||(AiQTe=="BR"))
var MkSvX=document.getElementById("wa-select-state");
if(MkSvX)
{
if(AiQTe=="US") hmDkS(KgiMh,MkSvX,["","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(AiQTe=="CA") hmDkS(KgiMh,MkSvX,["","Alberta","British Columbia","Manitoba","New Brunswick","Newfoundland and Labrador","Northwest Territories","Nova Scotia","Nunavut","Ontario","Prince Edward Isl.","Quebec","Saskatchewan","Yukon Territory"])
if(AiQTe=="BR") hmDkS(KgiMh,MkSvX,["","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(FHVmT)
{
var MhWHD=QZaSO();
var QCRmx=MhWHD.FPhop
QCRmx.NgPUK=FHVmT.checked
QCRmx.kZPgQ()
}
function gtUAT()
{
var MhWHD=QZaSO();
var LDpER=CONST_WA_GLOBAL_SETTINGS.currency_info 

var HxZcJ=new WA_Dialog();
HxZcJ.NcIMq=function()
{
if(MhWHD.FPhop.YmvPv=="paypal")
{
WA_displayDialogMarketCart();return;
}
if(MhWHD.FPhop.NgPUK)
gwIFm(eefdZ)
else
gwIFm(xwgfI)
}
HxZcJ.YrRwB=function(SFePo,riOiZ)
{
riOiZ=""+riOiZ
riOiZ=riOiZ.replace(/'/g,"&lsquo;")
return "<input type=hidden name='"+SFePo+"' value=\""+riOiZ+"\">"
}
HxZcJ.fgdMn=function()
{
var MhWHD=QZaSO();
var ABjUM=""
if(LDpER.charCodeAt(3)>=100) return""
ABjUM+="<form id='wa-http-sender' method=POST action='https://www.paypal.com/cgi-bin/webscr' target='_blank'>"
ABjUM+=this.YrRwB("cmd","_cart")
ABjUM+=this.YrRwB("business",CONST_WA_GLOBAL_SETTINGS.email_paypal_account)
ABjUM+=this.YrRwB("upload","1")
ABjUM+=this.YrRwB("charset","utf-8")
ABjUM+=this.YrRwB("no_note","0")
ABjUM+=this.YrRwB("currency_code",CONST_WA_GLOBAL_SETTINGS.currency_code)
ABjUM+=this.YrRwB("no_shipping","2")
var Ncled=MhWHD.ZiBtJ()
for(var i=0;i<Ncled.length;i++)
{
var info=Ncled[i];
var index=i+1;
var HrbPH=info.qWBCU();
if(MhWHD.IliqL())
{
var Uaopx=MhWHD.ENsdJ(MhWHD.PfSYV(HrbPH));
HrbPH=HrbPH-Uaopx;
}
ABjUM+=this.YrRwB("amount_"+index,""+HrbPH)
ABjUM+=this.YrRwB("quantity_"+index,info.hIMxs)
var aEYQn=0;
if(info.grTrb.length>0)
{
ABjUM+=this.YrRwB("on"+aEYQn+"_"+index,"ref")
ABjUM+=this.YrRwB("os"+aEYQn+"_"+index,info.grTrb)
aEYQn++;
}
var GQCTK=""
if(info.m_opt_vals)
{
for(var i_opt=0;i_opt<info.FoxFG.options.length;i_opt++)
{
var ZwrEv=info.FoxFG.options[i_opt]
if(ZwrEv)
{
var xjnNK=info.m_opt_vals[i_opt];
var ELFYm=ZwrEv.vals[xjnNK]
var rUAgE=ZwrEv.title;
if(rUAgE.length==0) rUAgE="opt"+(i_opt+1);
ABjUM+=this.YrRwB("on"+aEYQn+"_"+index,rUAgE)
ABjUM+=this.YrRwB("os"+aEYQn+"_"+index,ELFYm)
if(GQCTK.length>0)GQCTK=GQCTK+", "
GQCTK+=ELFYm
aEYQn++;
}
}
}
var wvwRA=info.exhEx;
if(GQCTK.length>0)wvwRA=wvwRA+"("+GQCTK+")"
ABjUM+=this.YrRwB("item_name_"+index,wvwRA) 
}
var MurTo=MhWHD.kvjfk()
if(MhWHD.IliqL())
{
MurTo=MurTo-MhWHD.ENsdJ(MhWHD.PfSYV(MurTo));
}
if(MhWHD.IliqL())
{
var eQLnO=MhWHD.WQuDB();
var XIeba=MhWHD.kvjfk()
var lDDoX=eQLnO+XIeba;
var eAeLF=MhWHD.ENsdJ(MhWHD.PfSYV(lDDoX));
var oarlt=lDDoX-eAeLF;
oarlt=oarlt-MurTo;
var LiGAE=0;
for(var i=0;i<Ncled.length;i++)
{
var info=Ncled[i];
var index=i+1;
var xuHXK=0;
var gTeIP=0;
var HrbPH=info.hIMxs*info.qWBCU();
var n0=MhWHD.QgjkE()/100;
var tax=HrbPH*(n0/(1+n0));
HrbPH=HrbPH-tax;
xuHXK=HrbPH;
var ANSmG=info.qWBCU();
var Uaopx=MhWHD.ENsdJ(MhWHD.PfSYV(ANSmG));
ANSmG=ANSmG-Uaopx;
gTeIP=info.hIMxs*ANSmG;
if(gTeIP>xuHXK)
{
ANSmG=info.m_price;
ANSmG=ANSmG-Uaopx;
var pbarT=ANSmG;
if((pbarT>0)&&(pbarT!=info.qWBCU()))
{
pbarT=pbarT-0.01;
}
ABjUM+=this.YrRwB("amount_"+index,pbarT) 
gTeIP=info.m_quantity*pbarT;
}
LiGAE+=gTeIP;
}
var SNRwi=MhWHD.ENsdJ(oarlt-LiGAE);
if(SNRwi>0)
{
var index=Ncled.length+1;
ABjUM+=this.YrRwB("item_name_"+index,Translator.tr("TVA correction"))
ABjUM+=this.YrRwB("quantity_"+index,1)
ABjUM+=this.YrRwB("amount_"+index,SNRwi)
}
ABjUM+=this.YrRwB("tax_cart",eAeLF)
}
else
{
ABjUM+=this.YrRwB("tax_cart",MhWHD.DQvCo())
}
ABjUM+=this.YrRwB("handling_cart",MurTo) 
ABjUM+="</form>"
return ABjUM;
}
HxZcJ.oGFYE=function()
{
var IhVuH=this.HOKil(xwgfI);
var ABjUM="";
if(IhVuH.length>0)
{
ABjUM+=""+Translator.tr("Shipping information")+":\n";
ABjUM+=IhVuH;
}
return ABjUM;
}
HxZcJ.pnLHK=function()
{
var IhVuH=this.HOKil(eefdZ);
var ABjUM="";
if(IhVuH.length>0)
{
ABjUM+=Translator.tr("Billing information")+":\n";
ABjUM+=IhVuH;
}
return ABjUM;
}
HxZcJ.HOKil=function(KgiMh)
{
var MhWHD=QZaSO();
var QCRmx=MhWHD.FPhop
var ABjUM="";
var ccTJT=new Array();
var oGQMP=MFJNI(CONST_WA_GLOBAL_SETTINGS.list_form_fields)
oGQMP.push("country")
oGQMP.push("state")
for(var i=0;i<oGQMP.length;i++)
{
var xKSfP=oGQMP[i];
ccTJT[xKSfP]=QCRmx.JgCHD(xKSfP,KgiMh)
}
if(ccTJT["firstname"])ABjUM+=ccTJT["firstname"]+"\n"
if(ccTJT["lastname"])ABjUM+=ccTJT["lastname"]+"\n"
if(ccTJT["company"])
{
ABjUM+=Translator.tr("form-label-company")+" : "+ccTJT["company"]+"\n"
}
if(ccTJT["fiscal_code"]) ABjUM+=Translator.tr("form-label-fiscal_code")+" : "+ccTJT["fiscal_code"]+"\n"
if(ccTJT["tva"]) ABjUM+=Translator.tr("form-label-tva")+" : "+ccTJT["tva"]+"\n"
if(ccTJT["address_1"]) ABjUM+=ccTJT["address_1"]+"\n"
if(ccTJT["address_2"]) ABjUM+=ccTJT["address_2"]+"\n"
if(ccTJT["zip"]) ABjUM+=ccTJT["zip"]+" "
if(ccTJT["city"]) ABjUM+=ccTJT["city"]+"\n"
if(ccTJT["country"])ABjUM+=Translator.country(ccTJT["country"])
if(ccTJT["state"]&&ccTJT["state"].length>0) ABjUM+=" "+ccTJT["state"];
ABjUM+="\n"
if(ccTJT["phone"]) ABjUM+=Translator.tr("form-label-phone")+" : "+ccTJT["phone"]+"\n"
if(ccTJT["fax"]) ABjUM+=Translator.tr("form-label-fax")+" : "+ccTJT["fax"]+"\n"
if(ccTJT["email"]) ABjUM+=ccTJT["email"]+"\n" 
if(ccTJT["comment"])
{
ABjUM+=Translator.tr("form-label-comment")+" : \n";
ABjUM+=ccTJT["comment"]+"\n"
}
return ABjUM;
}
HxZcJ.KEKLA=function()
{
var MhWHD=QZaSO();
var ABjUM="";
var Ncled=MhWHD.ZiBtJ();
ABjUM+="**************\n"
for(var i=0;i<Ncled.length;i++)
{
var QCRmx=Ncled[i];
var index=i+1;
var wvwRA=QCRmx.exhEx;
if(QCRmx.grTrb.length>0)
{
wvwRA+=" ["+QCRmx.grTrb+"]";
}
var GQCTK=""
if(QCRmx.m_opt_vals)
{
for(var i_opt=0;i_opt<QCRmx.FoxFG.options.length;i_opt++)
{
var ZwrEv=QCRmx.FoxFG.options[i_opt]
if(ZwrEv)
{
if(GQCTK.length>0)GQCTK=GQCTK+", "
var xjnNK=QCRmx.m_opt_vals[i_opt];
var ELFYm=ZwrEv.vals[xjnNK]
var rUAgE=ZwrEv.title;
if(rUAgE.length>0) GQCTK+=rUAgE+" : "
GQCTK+=ELFYm
}
}
}
if(GQCTK.length>0)wvwRA=wvwRA+"\n("+GQCTK+")"
ABjUM+=wvwRA;
ABjUM+="\n"
ABjUM+=Translator.tr("Price")+" : "+MhWHD.wYbQu(QCRmx.qWBCU())+"\n"
ABjUM+=Translator.tr("Quantity")+" : "+QCRmx.hIMxs+"\n"
ABjUM+=Translator.tr("Total")+" : "+MhWHD.wYbQu(QCRmx.qWBCU()*QCRmx.hIMxs);
ABjUM+="\n"
ABjUM+="**************\n"
}
var kWWvB=MhWHD.WQuDB()
var mjCWa=MhWHD.DQvCo()
var viWEe=MhWHD.kvjfk()
var MSXsZ=MhWHD.MkXhP()
var GIQcQ=MhWHD.XYWjH() 
ABjUM+=Translator.tr("Sub total")+" : "+MhWHD.wYbQu(kWWvB)+"\n";
if(CONST_WA_GLOBAL_SETTINGS.shipping_type!=APtMb)
{
ABjUM+=Translator.tr("Shipping amount")+" : "+MhWHD.wYbQu(viWEe)+"\n";
}
if(MhWHD.IliqL()||MhWHD.wuYvS())
{
if(MhWHD.IliqL())
{
ABjUM+=Translator.tr("Tax included");
}
if(MhWHD.wuYvS())
{
ABjUM+=Translator.tr("Extra Tax");
}
ABjUM+=" : ";
ABjUM+=MhWHD.wYbQu(mjCWa)+"\n";
}
if(GIQcQ>0)
{
ABjUM+=Translator.tr("Promotion")+" : - "+MhWHD.wYbQu(GIQcQ)+"\n";
}
ABjUM+=Translator.tr("Total")+" : "+MhWHD.wYbQu(MSXsZ)+"\n";
return ABjUM;
}
HxZcJ.bGFcE=function()
{
var MhWHD=QZaSO();
var ABjUM="";
var Ncled=MhWHD.ZiBtJ()
ABjUM+="<table class=wa-cart-global-table >"
ABjUM+="<tr class=wa-cart-title >"
ABjUM+="<td>&nbsp;</td>"
ABjUM+="<td>"+Translator.tr("Price")+"</td>"
ABjUM+="<td>"+Translator.tr("Quantity")+"</td>"
ABjUM+="<td>"+Translator.tr("Total")+"</td>"
ABjUM+="</tr>"
for(var i=0;i<Ncled.length;i++)
{
ABjUM+="<tr>"
var QCRmx=Ncled[i];
var index=i+1;
ABjUM+="<td>"
var wvwRA=QCRmx.exhEx;
if(QCRmx.grTrb.length>0)
{
wvwRA+=" ["+QCRmx.grTrb+"]";
}
wvwRA="<b>"+wvwRA+"</b>"
var GQCTK=""
if(QCRmx.m_opt_vals)
{
for(var i_opt=0;i_opt<QCRmx.FoxFG.options.length;i_opt++)
{
var ZwrEv=QCRmx.FoxFG.options[i_opt]
if(ZwrEv)
{
if(GQCTK.length>0)GQCTK=GQCTK+", "
var xjnNK=QCRmx.m_opt_vals[i_opt];
var ELFYm=ZwrEv.vals[xjnNK]
var rUAgE=ZwrEv.title;
if(rUAgE.length>0) GQCTK+=rUAgE+" : "
GQCTK+=ELFYm
}
}
}
if(GQCTK.length>0)wvwRA=wvwRA+"<br><span class=wa-cart-option >("+GQCTK+")</span>"
ABjUM+=wvwRA;
ABjUM+="</td>"
ABjUM+="<td>"+MhWHD.FxFeU(QCRmx.qWBCU())+"</td>"
ABjUM+="<td>"+QCRmx.hIMxs+"</td>"
ABjUM+="<td>"+MhWHD.FxFeU(QCRmx.qWBCU()*QCRmx.hIMxs)+"</td>"
ABjUM+="</tr>"
}
ABjUM+="<tr><td colspan=4>"
var kWWvB=MhWHD.WQuDB()
var mjCWa=MhWHD.DQvCo()
var viWEe=MhWHD.kvjfk()
var MSXsZ=MhWHD.MkXhP()
var GIQcQ=MhWHD.XYWjH() 
ABjUM+="<table class=wa-cart-table-total >"
ABjUM+="<tr><td align=right >"+Translator.tr("Sub total")+" : "+MhWHD.FxFeU(kWWvB)+"</td></tr>";
if(CONST_WA_GLOBAL_SETTINGS.shipping_type!=APtMb)
{
ABjUM+="<tr><td align=right>"+Translator.tr("Shipping amount")+" : "+MhWHD.FxFeU(viWEe)+"</td></tr>";
}
if(MhWHD.IliqL()||MhWHD.wuYvS())
{
if(MhWHD.IliqL())
{
ABjUM+="<tr><td align=left >"+Translator.tr("Tax included");
}
if(MhWHD.wuYvS())
{
ABjUM+="<tr><td align=right >"+Translator.tr("Extra Tax");
}
ABjUM+=" : ";
ABjUM+=MhWHD.FxFeU(mjCWa)+"</td></tr>";
}
if(GIQcQ>0)
{
ABjUM+="<tr><td align=right class=wa-cart-promo >"+Translator.tr("Promotion")+" : - "+MhWHD.FxFeU(GIQcQ)+"</td></tr>";
}
ABjUM+="<tr><td align=right class=wa-cart-total >"+Translator.tr("Total")+" : "+MhWHD.FxFeU(MSXsZ)+"</td></tr>";
ABjUM+="</table>" 
ABjUM+="</td></tr>"
ABjUM+="</table>"
ABjUM=ABjUM.replace(/\"/g,"'")
return ABjUM;
}
HxZcJ.TLrUV=function(riOiZ)
{
if((""+riOiZ).length==1)riOiZ="0"+riOiZ;
return riOiZ
}
HxZcJ.YnEwc=function()
{
var MhWHD=QZaSO();
var QCRmx=MhWHD.FPhop
var ABjUM=""
if(LDpER.charCodeAt(3)>=100) return""
if(SoZwT)
{
ABjUM+="<form id='wa-http-sender' method=POST action='"+SoZwT_URL+"crbst_market_print_form.php' target='_blank'>"
}
else
{
ABjUM+="<form id='wa-http-sender' method=POST action='crbst_market_print_form.php' target='_blank'>"
}
ABjUM+=this.YrRwB("type_payment",QCRmx.YmvPv)
ABjUM+=this.YrRwB("MAIL_TITLE_PREFIXE",Translator.tr("title email Order notification"))
ABjUM+=this.YrRwB("MAIN_TITLE",Translator.tr("PRINT_FORM_MAIN_TITLE"))
ABjUM+=this.YrRwB("PREFIXE_ORDER",Translator.tr("PRINT_FORM_PREFIXE_ORDER"))
var rWNKX=""
var bhxiA=new Date()
rWNKX+="wa-"+this.TLrUV(bhxiA.getYear()-100)+this.TLrUV(bhxiA.getMonth()+1)+this.TLrUV(bhxiA.getDate())
rWNKX+=bhxiA.getHours()+this.TLrUV(bhxiA.getMinutes())+this.TLrUV(bhxiA.getSeconds())
rWNKX+="-"+Math.round(Math.random()*100) 
ABjUM+=this.YrRwB("ID_ORDER",rWNKX)
ABjUM+=this.YrRwB("CARD_TITLE",Translator.tr("PRINT_FORM_CARD_TITLE"))
ABjUM+=this.YrRwB("LABEL_TYPE_PAYMENT",Translator.tr("PRINT_FORM_LABEL_TYPE_PAYMENT"))
ABjUM+=this.YrRwB("send_copy_email_to_buyer",(MhWHD.send_copy_email_to_buyer)?"1":"0") 

var ccTJT=new Array();
var oGQMP=MFJNI(CONST_WA_GLOBAL_SETTINGS.list_form_fields)
oGQMP.push("country")
oGQMP.push("state")
for(var i=0;i<oGQMP.length;i++)
{
var xKSfP=oGQMP[i];
ccTJT[xKSfP]=MhWHD.FPhop.JgCHD(xKSfP,xwgfI)
}
ABjUM+=this.YrRwB("form_first_name",ccTJT["firstname"]);
ABjUM+=this.YrRwB("form_last_name",ccTJT["lastname"]);
ABjUM+=this.YrRwB("form_address1",ccTJT["address_1"]);
ABjUM+=this.YrRwB("form_address2",ccTJT["address_2"]);
ABjUM+=this.YrRwB("form_city",ccTJT["address_2"]);
ABjUM+=this.YrRwB("form_zip",ccTJT["zip"]);
ABjUM+=this.YrRwB("form_state",ccTJT["state"]);
ABjUM+=this.YrRwB("form_country",ccTJT["country"]);
ABjUM+=this.YrRwB("form_company",ccTJT["company"]);
ABjUM+=this.YrRwB("form_fiscal_code",ccTJT["fiscal_code"]);
ABjUM+=this.YrRwB("form_tva",ccTJT["tva"]);
ABjUM+=this.YrRwB("form_phone",ccTJT["phone"]);
ABjUM+=this.YrRwB("form_fax",ccTJT["fax"]);
ABjUM+=this.YrRwB("CARD_TOTAL_PRICE",MhWHD.MkXhP());
ABjUM+=this.YrRwB("CARD_CURRENCY",CONST_WA_GLOBAL_SETTINGS.currency_code);
ABjUM+=this.YrRwB("CARD_LANG",Translator.m_lang);
ABjUM+=this.YrRwB("LABEL_PROCESS_ORDER",Translator.tr("PRINT_FORM_PROCESS_ORDER"));
ABjUM+=this.YrRwB("wa_promo_code",MhWHD.FPhop.hWnVf);
ABjUM+=this.YrRwB("email_buyer",QCRmx.JgCHD("email",xwgfI))
if(QCRmx.YmvPv=="custom")
{
ABjUM+=this.YrRwB("TYPE_PAYMENT",Translator.tr("PRINT_FORM_TYPE_CUSTOM"))
}
if(QCRmx.YmvPv=="check")
{
ABjUM+=this.YrRwB("TYPE_PAYMENT",Translator.tr("PRINT_FORM_TYPE_CHECK"))
ABjUM+=this.YrRwB("MESSAGE_CHECK",Translator.tr("PRINT_FORM_MESSAGE_CHECK"))
}
if(QCRmx.YmvPv=="wire")
{
ABjUM+=this.YrRwB("TYPE_PAYMENT",Translator.tr("PRINT_FORM_TYPE_WIRE"))
ABjUM+=this.YrRwB("MESSAGE_WIRE",Translator.tr("PRINT_FORM_MESSAGE_WIRE"))
}
if(QCRmx.YmvPv=="paypal")
{
ABjUM+=this.YrRwB("LABEL_PAYPAL_CART_TITLE",Translator.tr("PRINT_FORM_PAYPAL_CART_TITLE"));
ABjUM+=this.YrRwB("TYPE_PAYMENT","Paypal")
ABjUM+=this.YrRwB("MESSAGE_PAYPAL",Translator.tr("PRINT_FORM_MESSAGE_PAYPAL"))
}
ABjUM+=this.YrRwB("LABEL_PRINT",Translator.tr("PRINT_FORM_LABEL_PRINT"))
ABjUM+=this.YrRwB("card_html",this.bGFcE())
ABjUM+=this.YrRwB("card_plain_text",this.KEKLA())
ABjUM+=this.YrRwB("LABEL_SELLER_INFORMATION",Translator.tr("Seller information"))
ABjUM+=this.YrRwB("LABEL_BANK_ACCOUNT",Translator.tr("Bank account information"))
ABjUM+=this.YrRwB("LABEL_ADDRESS",Translator.tr("Address"))
ABjUM+=this.YrRwB("seller_address",CONST_WA_GLOBAL_SETTINGS.seller_address)
ABjUM+=this.YrRwB("bank_account_informations",CONST_WA_GLOBAL_SETTINGS.bank_account_informations)
ABjUM+=this.YrRwB("buyer_info_shipping",this.oGFYE())
var aKtjV=""
if(QCRmx.NgPUK)
{
aKtjV=this.pnLHK();
};
ABjUM+=this.YrRwB("buyer_info_billing",aKtjV)
ABjUM+="</form>"
return ABjUM;
}
HxZcJ.iEENY=function()
{
var MhWHD=QZaSO();
MhWHD.hAxOK()
this.closeWin()
}
HxZcJ.tuvNj=function()
{
var MhWHD=QZaSO();
var BnNti=true;
var QCRmx=MhWHD.FPhop 
if(QCRmx.YmvPv=="paypal")
if((MhWHD.tXMIo==true)&&(CONST_WA_GLOBAL_SETTINGS.list_promo_codes==false))
{
BnNti=true;
}
if((BnNti==false)&&(QCRmx.YmvPv=="paypal"))
{
this.addButton(Translator.tr('Clear cart'),this.iEENY,[""],this)
this.initializeWindow(400,200)
}
else
{
this.initializeWindow(400,150)
}
var ABjUM=""
if((BnNti==false)&&(QCRmx.YmvPv=="paypal"))
{
ABjUM+=this.fgdMn()
}
if(BnNti)
{
ABjUM+=this.YnEwc()
if((SoZwT==false)&&(document.webaca_is_preview))
{
WA_Dialog.alert(Translator.tr("Operation not allowed in preview mode"))
return
}
}
ABjUM+="<table border=0 style='width:100%;'><tr>";
ABjUM+="<td align=center style='"+this.cssText1()+"'>"
ABjUM+=Translator.tr("You have been redirected to the payment page")
if((BnNti==false)&&(QCRmx.YmvPv=="paypal"))
{
ABjUM+="<br><br>"
ABjUM+=Translator.tr("You can clear your cart")
}
ABjUM+="</td></tr></table>"
this.writeContent(ABjUM) 
if(LDpER.charCodeAt(3)>=100)
{
WA_Dialog.alert(Translator.tr("This cariboost edition can't support ebusiness features !'"))
return;
}
var ATXvM=document.getElementById("wa-http-sender")
ATXvM.submit()
if(BnNti)
{
MhWHD.hAxOK()
}
}
HxZcJ.tuvNj()
}

-->
