<!--

var kJhes=0
var nDZvE=1
var bSSkC=2
var JthgP=0;
var ueqvX=1;
var euhWQ=2;
var vbxLM=0
var PLRKj=1
var sdVIw=false 
function WA_marketRemoveItem(VYPPg)
{
aZcfx().EAUZP(VYPPg)
var XCbnV=WA_Dialog.getCurrent();
XCbnV.gKwRH()
}
function aZcfx()
{
if(document.wa_global_settings_market==undefined)document.wa_global_settings_market=new NdSPq()
return document.wa_global_settings_market;
}
function tkwGS()
{
this.FTuQj=function()
{
return this.ZoUVL+"-"+this.ZCtHf_index
}
this.xmFfd=function(aTkiW,dbCKf)
{
this.ZCtHf=aTkiW.obj.market.info.folder.substring(13);
this.ZCtHf_index=aTkiW.obj.index;
this.ZCtHf_modif=aTkiW.obj.market.info.critical_id_modif
this.ZoUVL=aTkiW.obj.market.id 

this.wJbDg=1;
this.tpQEB=aTkiW.title;
this.YKjNQ=aTkiW.price;
this.MxXsO=aTkiW.weight;
this.HwCQW=aTkiW.code_product;
}
this.AIZuO=function(aTkiW,dbCKf)
{

this.tpQEB=aTkiW.title;
this.YKjNQ=aTkiW.price;
this.MxXsO=aTkiW.weight;
this.HwCQW=aTkiW.code_product;
}
this.ngTOI=function()
{
var s="";
s+=this.FTuQj();
if(this.m_opt_vals)
for(var i=0;i<this.m_opt_vals.length;i++)
{
var UvvPj=this.m_opt_vals[i]
if(UvvPj!=-1) s+="/"+UvvPj;
}
return s;
}
this.PqMCH=function()
{
var val="";
val+="j="+this.ZCtHf+",";
val+="i="+this.ZCtHf_index+",";
val+="m="+this.ZCtHf_modif+",";
val+="q="+this.wJbDg+",";
if(this.m_opt_vals)
{
for(var i=0;i<this.m_opt_vals.length;i++)
{
val+="o"+i+"=";
var rVlDH=this.m_opt_vals[i]
if(rVlDH>-1)
val+=rVlDH
else
val+=""
val+=","
}
}
return val;
}
this.vfMef=function(map,k)
{
var v=map[k];
if(v=="undefined") return "";
return v;
}
this.Hjuol=function(map)
{
this.ZCtHf=this.vfMef(map,"j");
if(this.ZCtHf=="") return false;
this.ZCtHf_index=this.vfMef(map,"i");
this.ZCtHf_modif=this.vfMef(map,"m");
this.wJbDg=parseInt(map["q"]);
this.m_opt_vals=new Array();
for(var i=0;i<3;i++)
{
var tHHnp=parseInt(map["o"+i]);
if(isNaN(tHHnp))tHHnp=-1;
this.m_opt_vals.push(tHHnp)
}
return true;
}
this.aDgju=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.wGPfQ=function(ChMSt)
{
var XapsY=this.aDgju(ChMSt)
return this.Hjuol(XapsY) 
}
this.QDZII=function()
{
return wfGma(this.aTkiW,this.m_opt_vals)
}
}
function rbTLX(RENic)
{
var hWQQl=RENic[0]
var aWpcH=RENic[1]
var tscmE=RENic[2]
if(hWQQl.length==0)
{
tscmE.call(aWpcH)
return;
}
var js=hWQQl.pop()
WA_loadScript(js.src,rbTLX,[hWQQl,aWpcH,tscmE]);
}
function WA_arrayContains(ivaZo,ChMSt)
{
for(var n=0;n<ivaZo.length;n++){if(ivaZo[n]==ChMSt)return true;}
return false;
}
function YfFxM(ivaZo)
{
var XapsY=new Array()
for(var n=0;n<ivaZo.length;n++)
{
var jCioW=ivaZo[n]
if(jCioW=="address") XapsY=XapsY.concat(["address_1","address_2","city","zip"])
else XapsY.push(jCioW)
}
return XapsY;
}
function SmjhD()
{
this.sKnME=function()
{
if(this.gkjfC.length==0)return CONST_WA_GLOBAL_SETTINGS.default_selected_country;
return this.gkjfC;
}
this.hWmXX=function()
{
this.GdjfR()
}
this.aDgju=function(s)
{
var GBmXp=new Array();
var tab=s.split(",");
for(var i=0;i<tab.length;i++)
{
var tab3=tab[i].split("=");
if(tab3.length==2)GBmXp[tab3[0]]=tab3[1];
}
return GBmXp;
}
this.DnCGD=function(XifaI)
{
if(XifaI==undefined) return ""
return(XifaI==vbxLM)?"deliv-":"bill-"
}
this.TnpxS=function(BmAOt,XifaI,FBcwM)
{
if(!FBcwM)FBcwM=""
var gsPxC=this.DnCGD(XifaI)
if(BmAOt=="country")
{
if(XifaI==vbxLM) return this.gkjfC
if(XifaI==PLRKj) BmAOt="countryCode"
}
if(BmAOt=="state")
{
BmAOt="stateCode"
}
var UvvPj=this.Yodsa[gsPxC+BmAOt]
if(!UvvPj) return FBcwM
UvvPj=UvvPj.replace(/\"/g,"'")
return UvvPj
}
this.hrLpP=function(UvvPj)
{
if(UvvPj==undefined)return ""
return UvvPj
}
this.BBjBQ=function(key,val)
{
if((val==null)||(val==undefined)) val="";
WA_SetCookie("crbst-card-"+key,val)
}
this.BgIel=function(key)
{
var aWpcH=WA_GetCookie("crbst-card-"+key)
if(aWpcH=="null")aWpcH="";
return ""+aWpcH
}
this.nTuqU=function()
{
this.Yodsa=new Array()
var ChMSt=this.BgIel("order-infos")
var XapsY=this.aDgju(ChMSt)
for(var k1 in XapsY)
{
var UvvPj=XapsY[k1]
if((k1.indexOf("deliv-")==0)||(k1.indexOf("bill-")==0))
this.Yodsa[k1]=unescape(UvvPj)
}
this.gkjfC=this.hrLpP(XapsY["countryCode"])
this.jaDMs=this.hrLpP(XapsY["typePayment"])
this.kdbkq=(this.hrLpP(XapsY["differentBillingAddressChecked"])=="true")
this.LKJLb=(this.hrLpP(XapsY["salesConditionChecked"])=="true")
}
this.GdjfR=function()
{
var ChMSt=""
for(var k1 in this.Yodsa)
{
var UvvPj=this.Yodsa[k1]
ChMSt+=k1+"="+escape(UvvPj)+","
}
var rQsLb=""
rQsLb+="countryCode="+escape(this.gkjfC)+","
rQsLb+="typePayment="+escape(this.jaDMs)+","
rQsLb+="differentBillingAddressChecked="+(this.kdbkq)+","
rQsLb+="salesConditionChecked="+(this.LKJLb)+","
ChMSt+=rQsLb 
this.BBjBQ("order-infos",ChMSt)
}
this.aoucP=function(EOvAJ)
{
if(trimString(EOvAJ.value).length==0)
{
EOvAJ.style.backgroundColor="#ff0000"
EOvAJ.focus()
return false;;
}
EOvAJ.style.backgroundColor=""
return true;
}
this.WvZJS=function(XifaI)
{
var MxYks=YfFxM(CONST_WA_GLOBAL_SETTINGS.list_form_fields)
var txqwb=YfFxM(CONST_WA_GLOBAL_SETTINGS.list_mandatory_form_fields) 
var EqvcT=this.Yodsa;
var gsPxC=this.DnCGD(XifaI) 
var pZmiO=document.getElementById("wa-market-form")
for(var n=0;n<MxYks.length;n++)
{
var DaYDv=MxYks[n]
var xFBqJ=pZmiO[DaYDv]
var UvvPj=trimString(xFBqJ.value)
if(DaYDv!="address_2")
if(WA_arrayContains(txqwb,DaYDv))
{
if(this.aoucP(xFBqJ)==false)return false;
}
EqvcT[gsPxC+DaYDv]=UvvPj
}
var jSqQm=document.getElementById("wa-select-state");
var bWlQU=document.getElementById("wa-market-state");
if(jSqQm&&(bWlQU.style.display!="none"))
{
if(this.aoucP(jSqQm)==false)return false;
EqvcT[gsPxC+"stateCode"]=jSqQm.value
}
else
{
EqvcT[gsPxC+"stateCode"]=""
}
if(XifaI==PLRKj)
{
var lNaQv=document.getElementById("wa-select-form-country");
if(lNaQv)
{
EqvcT[gsPxC+"countryCode"]=lNaQv.value
}
}
this.GdjfR()
return true;
}
this.gkjfC=""
this.jaDMs=""
this.kdbkq=false;
this.LKJLb=false
this.nTuqU()
}
function NdSPq()
{
this.RjYGV=new Array();
this.aWpcH_callback=false;
this.atYsM=false;
this.mYMdC=false;
this.cSCfN=new SmjhD()
this.oiNKU=function(aWpcH,tscmE)
{
this.aWpcH_callback=aWpcH
this.atYsM=tscmE 
var FQmsD=this.BgIel("data")
this.tGpYC(FQmsD) 
var hWQQl=new Array()
var ivaZo=this.RjYGV;
for(var i=0;i<ivaZo.length;i++)
{
var bFocr=ivaZo[i];
var Fswmr=Translator.m_lang_for_filename
if(Fswmr.length>0)Fswmr="_"+Fswmr;
var oCuMY=bFocr.ZCtHf;
var n=oCuMY.indexOf("_")
if(n>-1)oCuMY=oCuMY.substring(n+1)
bFocr.ZoUVL="wa-id-"+oCuMY 
var nFnZb=wa_global_market.markets[bFocr.ZoUVL]
if(this.mYMdC==false)
if(!nFnZb)
{
var aSCEJ="crbst_market_"+bFocr.ZCtHf+'/'
WA_declareMarket(bFocr.ZoUVL,aSCEJ,bFocr.ZCtHf_modif) 
var Thpgc=aSCEJ+'market-definition'+Fswmr+'.js?v='+bFocr.ZCtHf_modif
hWQQl.push({id:oCuMY,src:Thpgc})
}
}
rbTLX([hWQQl,this,this.InXSd])
}
this.ksswv=function()
{
this.BBjBQ("data","")
this.cSCfN.BBjBQ("order-infos","")
this.cSCfN.nTuqU()
this.tGpYC("")
}
this.InXSd=function()
{
this.mYMdC=true;
var ivaZo=this.RjYGV;
var ZoLEt=new Array();
for(var i=0;i<ivaZo.length;i++)
{
var bFocr=ivaZo[i];
var oCuMY=bFocr.ZoUVL
var xIrcu=wa_global_market.markets[oCuMY] 
var AvtjW=xIrcu.info.products 
var dbCKf=bFocr.ZCtHf_index
var aTkiW=AvtjW[dbCKf]
bFocr.aTkiW=aTkiW
bFocr.AIZuO(bFocr.aTkiW,dbCKf)
if((aTkiW.unavail==false)&&(bFocr.ZCtHf_modif==xIrcu.info.critical_id_modif))
{
ZoLEt.push(bFocr)
}
}
this.RjYGV=ZoLEt
this.onXZO() 
this.atYsM.call(this.aWpcH_callback)
}
this.tGpYC=function(NTowt)
{
var ivaZo=new Array();
var list_string_products=NTowt.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 bFocr=new tkwGS();
if(bFocr.wGPfQ(s_data))
{
ivaZo.push(bFocr);
}
}
}
this.RjYGV=ivaZo;
var PKJjY=this.WETCT()
if(WA_getNumberMarketItemsInCart()!=PKJjY)
{
this.onXZO()
this.YONEF()
}
}
this.NnjeO=function()
{
var sJLeV=''
try{sJLeV=CONST_WA_GLOBAL_SETTINGS.currency_mnemonic}catch(e){}
return sJLeV
}
this.EAUZP=function(VYPPg)
{
var list2=new Array();
var ivaZo=this.RjYGV
for(var i=0;i<ivaZo.length;i++)
{
var bFocr=ivaZo[i];
if(i!=VYPPg)
{
list2.push(bFocr);
}
}
this.RjYGV=list2;
this.mYxII()
}
this.addProductToShoppingCard=function(aTkiW,optionsValues)
{
if(this.flEOY()==false)
{
WA_Dialog.alert(Translator.tr("You can't use shopping card Your browser doesnt accept cookies !"));
return false;
}
var teRPe=aTkiW.obj
var ivaZo=this.gXonE();
var n=ivaZo.length
var VYpcf=new tkwGS()
VYpcf.xmFfd(aTkiW,n);
VYpcf.m_opt_vals=optionsValues
var b_match=false;
for(var i=0;i<ivaZo.length;i++)
{
var bFocr=ivaZo[i];
if(bFocr.ngTOI()==VYpcf.ngTOI())
{
b_match=true;
bFocr.wJbDg++;
}
}
if(b_match==false)
{
var FQmsD=this.BgIel("data")
var ONaQZ=VYpcf.PqMCH()
var ZxWTa=FQmsD.length+ONaQZ.length 
if(ZxWTa>4000)
{
WA_Dialog.alert(Translator.tr("Cookies cart contains max data !"));
return false;
}
ivaZo.push(VYpcf);
}
return true
}
this.KbGGg=function()
{
var ivaZo=this.RjYGV
var FQmsD="";
for(var i=0;i<ivaZo.length;i++)
{
var info=ivaZo[i];
FQmsD+=info.PqMCH()+";";
}
return FQmsD;
}
this.WETCT=function()
{
var knucN=0;
var ivaZo=this.RjYGV;
for(var i=0;i<ivaZo.length;i++)
{
var bFocr=ivaZo[i];
knucN+=bFocr.wJbDg
}
return knucN;
}
this.onXZO=function()
{
this.BBjBQ("nb_items",this.WETCT())
}
this.mYxII=function()
{
var ivaZo=this.RjYGV
var FQmsD=this.KbGGg()
this.BBjBQ("data",FQmsD)
this.onXZO()
this.YONEF();
}
this.YONEF=function()
{
WA_refreshNumberMarketItemsInCart()
}
this.gXonE=function()
{
return this.RjYGV;
}
this.flEOY=function()
{
this.BBjBQ("watestcookies","test")
return(this.BgIel("watestcookies")=="test");
}
this.BBjBQ=function(key,val)
{
if((val==null)||(val==undefined)) val="";
WA_SetCookie("crbst-card-"+key,val)
}
this.BgIel=function(key)
{
var aWpcH=WA_GetCookie("crbst-card-"+key)
if(aWpcH=="null")aWpcH="";
return ""+aWpcH
}
this.jDLWm=function(v)
{
var result="";
if(Math.ceil(v)==v)result=""+v;
else
{
var s=v+"";
var n=s.indexOf(".");
if(n==-1)n=s.indexOf(",");
if(n>-1)
{
s=s+"00";
s=s.substring(0,n+3);
}
result=s;
}
if(CONST_WA_GLOBAL_SETTINGS.currency_code=="GBP")
{
result=this.NnjeO()+result;
}
else
{
result=result+" "+this.NnjeO();
}
return result;
}
this.wCsHI=function(HsCdX)
{
return Math.round(HsCdX*100)/100
}
this.qdxKx=function()
{
var ivaZo=this.gXonE()
var price=0;
for(var i=0;i<ivaZo.length;i++)
{
var bFocr=ivaZo[i];
price+=(bFocr.QDZII()*bFocr.wJbDg);
}
return price;
}
this.computeShippingForValue=function(val)
{
var vaLCb=CONST_WA_GLOBAL_SETTINGS.shipping_type
if(vaLCb==kJhes)return 0;
var ship_val=0;
var WcAmQ=CONST_WA_GLOBAL_SETTINGS.shipping_intervals
for(var i=0;i<WcAmQ.length;i++)
{
var vTPwN=WcAmQ[i];
if(vTPwN.v<val)ship_val=vTPwN.p
}
return ship_val;
}
this.TCiSZ=function(NWlgR)
{
var XapsY=CONST_WA_GLOBAL_SETTINGS.GBmXp_list_extra_shipping_by_country_code
if(XapsY==undefined)
{
XapsY=new Array()
CONST_WA_GLOBAL_SETTINGS.GBmXp_list_extra_shipping_by_country_code=XapsY;
var etToO=CONST_WA_GLOBAL_SETTINGS.list_extra_shipping_by_country_code
for(var VYPPg in etToO)
{
var hWIcc=etToO[VYPPg];
var UgJvh=hWIcc.c
for(var rlPTB in UgJvh)
{
var IVdoa=UgJvh[rlPTB];XapsY[IVdoa]=hWIcc.p;
}
}
}
return XapsY[NWlgR];
}
this.iMVDj=function(NWlgR)
{
var XapsY=CONST_WA_GLOBAL_SETTINGS.GfRaW
if(XapsY==undefined)
{
XapsY=new Array()
CONST_WA_GLOBAL_SETTINGS.GfRaW=XapsY;
var etToO=CONST_WA_GLOBAL_SETTINGS.list_tva_by_country_code
for(var VYPPg in etToO)
{
var hWIcc=etToO[VYPPg];
var UgJvh=hWIcc.c;
for(var rlPTB in UgJvh)
{
var IVdoa=UgJvh[rlPTB];XapsY[IVdoa]=hWIcc.p;
}
}
}
return XapsY[NWlgR];
}
this.iwltK=function()
{
var vaLCb=CONST_WA_GLOBAL_SETTINGS.shipping_type
var ivaZo=this.gXonE()
var global_ref_for_shipping=0;
var fHMhQ=0;
var gkjfC=this.cSCfN.gkjfC;
if(gkjfC.length>0)
{
fHMhQ=this.TCiSZ(gkjfC);
if(isNaN(fHMhQ)) fHMhQ=0;
}
for(var i=0;i<ivaZo.length;i++)
{
var bFocr=ivaZo[i];
if(vaLCb==nDZvE)
{
global_ref_for_shipping+=(bFocr.wJbDg*bFocr.QDZII());
}
if(vaLCb==bSSkC)
{
global_ref_for_shipping+=(bFocr.wJbDg*bFocr.MxXsO);
}
}
return fHMhQ+this.wCsHI(this.computeShippingForValue(global_ref_for_shipping));
}
this.MkinS=function()
{
return CONST_WA_GLOBAL_SETTINGS.tva_type==ueqvX
}
this.ujkhb=function()
{
return CONST_WA_GLOBAL_SETTINGS.tva_type==euhWQ
}
this.XVwDg=function()
{
return CONST_WA_GLOBAL_SETTINGS.tva_type==JthgP
}
this.HpaKY=function()
{
if(this.XVwDg())return 0;
var tax=0;
var country_code=this.cSCfN.gkjfC;
if(country_code.length>0)
{
tax=this.iMVDj(country_code);
if(isNaN(tax))tax=0;
}
return tax;
}
this.computeTaxOfPrice=function(HsCdX)
{
if(this.MkinS())
{
var n0=this.HpaKY()/100;
return HsCdX*(n0/(1+n0));
}
if(this.ujkhb())
{
return HsCdX*this.HpaKY()/100;
}
return HsCdX;
}
this.NCYZw=function()
{
if(this.XVwDg())return 0;
var ivaZo=this.gXonE()
var QHIGC=0;
var IVCZP=0;
for(var i=0;i<ivaZo.length;i++)
{
var bFocr=ivaZo[i];
QHIGC+=(bFocr.QDZII()*bFocr.wJbDg);
}
QHIGC+=this.iwltK();
IVCZP=this.wCsHI(this.computeTaxOfPrice(QHIGC));
return IVCZP;
}
this.UmcQp=function()
{
var HsCdX=0;
HsCdX+=this.qdxKx()
if(this.ujkhb())HsCdX+=this.NCYZw()
HsCdX+=this.iwltK()
return HsCdX;
}
}
function YPVvq(rqCFg,nuZaV)
{
if(rqCFg.lab<nuZaV.lab) return-1;
if(rqCFg.lab>nuZaV.lab) return 1;
return 0
}
function WA_marketWatchQuantity()
{
var XCbnV=WA_Dialog.getCurrent()
XCbnV.iOCjT()
}
function WA_displayDialogMarketCart()
{
var XCbnV=new WA_Dialog();
XCbnV.rrcwX=false;
XCbnV.kclUS=function()
{
this.DPbtW()
this.rrcwX=setInterval("WA_marketWatchQuantity()",400)
}
XCbnV.DPbtW=function()
{
if(this.rrcwX)clearInterval(this.rrcwX)
}
XCbnV.iOCjT=function()
{
var qWVRL=aZcfx();
var MKISP=qWVRL.gXonE();
for(var n=0;n<MKISP.length;n++)
{
var bFocr=MKISP[n]
var bpFpI=document.getElementById("wa-cart-quantity-"+n)
var UeKxn=bpFpI.value
var fvoLL=parseInt(UeKxn)
if(isNaN(fvoLL))fvoLL=0;
if((UeKxn!='')&&(fvoLL+""!=UeKxn))
{
bpFpI.value=""+fvoLL
}
if(fvoLL!=bFocr.wJbDg)
{
bFocr.wJbDg=fvoLL
qWVRL.mYxII()
this.PZwtE()
}
}
}
XCbnV.onCustomKeypress=function(lvsbt)
{
if(lvsbt==13)
{
wa_timeout(Delegate.create(this,this.ZQlPh),0);
}
return false;
}
XCbnV.closeWin=function()
{
this.DPbtW()
this.intern_closeWin()
}
XCbnV.PZwtE=function()
{
var qWVRL=aZcfx();
var MKISP=qWVRL.gXonE();
if(MKISP.length==0) return;
for(var n=0;n<MKISP.length;n++)
{
var bFocr=MKISP[n]
var EQaEb=document.getElementById("wa-cart-total-"+n)
var HsCdX=bFocr.QDZII() 
var IZPjl=bFocr.wJbDg*HsCdX
var ChMSt="<span style='"
ChMSt+=(IZPjl>0)?"color:"+WA_GLOBAL_COLOR_THEME.color_text+";font-weight:normal;":"color:#ff0000;font-weight:bold;"
ChMSt+="'>"
ChMSt+=IZPjl+" "+qWVRL.NnjeO()
ChMSt+="</span>"
EQaEb.innerHTML=ChMSt
}
var saKWP=qWVRL.qdxKx()
var MBuAb=qWVRL.NCYZw()
var ltggc=qWVRL.iwltK()
var BNBIu=qWVRL.UmcQp()
var DmPwA=""
var EQaEb=document.getElementById("wa-cart-amount-total")
DmPwA+=Translator.tr("Sub total")+" : "+qWVRL.jDLWm(saKWP)
DmPwA+="<br>"
if(ltggc>0)
{
DmPwA+="<span>"+Translator.tr("Shipping amount")+" : "+qWVRL.jDLWm(ltggc)+"</span>";
DmPwA+="<br>"
}
if(qWVRL.MkinS()||qWVRL.ujkhb())
{
if(qWVRL.MkinS())
{
DmPwA+="<div style='width:100%;text-align:left;'>"
DmPwA+=Translator.tr("Tax included");
}
if(qWVRL.ujkhb())
{
DmPwA+="<div>"
DmPwA+=Translator.tr("Extra Tax");
}
DmPwA+=" : ";
DmPwA+=qWVRL.jDLWm(MBuAb)+"</div>";
}
DmPwA+="<span><b>"+Translator.tr("Total")+" : "+qWVRL.jDLWm(BNBIu)+"</b></span>";
EQaEb.innerHTML=DmPwA
}
XCbnV.EDItl=function()
{
WA_displayDialogMarketCart()
}
XCbnV.ZmYvD=function()
{
this.closeWin()
}
XCbnV.ZQlPh=function()
{
var qWVRL=aZcfx();
var qjwMg=document.getElementById("wa-market-select-country")
qWVRL.cSCfN.gkjfC=qjwMg.value
if(qWVRL.cSCfN.gkjfC=="")
{
var qjwMg=document.getElementById("wa-market-select-country")
qjwMg.focus()
qjwMg.style.backgroundColor="#ff0000"
return;
}
if(CONST_WA_GLOBAL_SETTINGS.link_sale_condition)
{
if(qWVRL.cSCfN.LKJLb!=true)
{
var YADAv=document.getElementById("wa-sales-condition")
YADAv.focus()
var csmsX=document.getElementById("wa-sales-condition-label")
csmsX.style.backgroundColor="#ff0000"
return;
}
}
if(qWVRL.cSCfN.jaDMs=="")
{
var qjwMg=document.getElementById("wa-market-select-payment")
qjwMg.focus()
qjwMg.style.backgroundColor="#ff0000"
return;
}
LHjsO()
}
XCbnV.gKwRH=function()
{
WA_exec_callback_opera_compliant(this,this.LlMXu)
}
XCbnV.LlMXu=function()
{
var qWVRL=aZcfx();

var lNaQv=document.getElementById("wa-market-select-country")
qWVRL.cSCfN.gkjfC=lNaQv.value
qWVRL.cSCfN.hWmXX()
var dmQGw=html_getLayer("market-cart-content")
var YXWUS=html_getLayer("wa-market-payment-form") 
var ChMSt=""
var MKISP=qWVRL.gXonE();
html_SetVisibility(YXWUS,(MKISP.length>0))
if(MKISP.length==0)
{
ChMSt+="<span style='font-family:Arial;font-size:16px;'>"
ChMSt+=Translator.tr("No articles in Card !")
ChMSt+="</span>"
}
else
{
var CDhqU="border:1px solid "+WA_GLOBAL_COLOR_THEME.color0+";font-weight:normal;"
var SYIFQ="border:1px solid "+WA_GLOBAL_COLOR_THEME.color0+";color:#ff0000;font-weight:bold;"
var kVvVC="color:#222222;font-size:12px;"
ChMSt+="<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+";'>"
ChMSt+="<thead style='font-size:13px;border:1px solid;'>"
ChMSt+="<tr>"
ChMSt+="<th  colspan=2 style='"+CDhqU+"'></th>" 
ChMSt+="<th style='"+CDhqU+"'  width=70px><b>"+Translator.tr("Price")+"</b></th>"
ChMSt+="<th style='"+CDhqU+"'  width=70px><b>"+Translator.tr("Quantity")+"</b></th>"
ChMSt+="<th style='"+CDhqU+"'  width=70px><b>"+Translator.tr("Total")+"</b></th>"
ChMSt+="<th style='"+CDhqU+"'  width=90px></th>"
ChMSt+="</tr>"
for(var n=0;n<MKISP.length;n++)
{
var bFocr=MKISP[n]
ChMSt+="<tr>"
ChMSt+="<th style='"+CDhqU+"' >"
var xIrcu=wa_global_market.markets[bFocr.ZoUVL]
var tdKVr=new Size(30,30)
var fVBwl=tdKVr
if(xIrcu.info.design.crop_thumb==false)
{
fVBwl=bFocr.aTkiW.size_thumb.clone()
fVBwl.scale(tdKVr)
}
else
{
}
if(bFocr.aTkiW.img_thumb.length>0)
ChMSt+="<img border=0 src='"+bFocr.aTkiW.img_thumb+"' width="+fVBwl.width+"px height="+fVBwl.height+"px>"
ChMSt+="</th>"
ChMSt+="<th style='"+CDhqU+"text-align:left;padding:5px;background-color:"+WA_GLOBAL_COLOR_THEME.color1+";' >"
ChMSt+="<b>"+bFocr.tpQEB+"</b>"
if(bFocr.HwCQW.length>0)
{
ChMSt+="<span style='"+kVvVC+"'>";
ChMSt+=" ["+bFocr.HwCQW+"]";
ChMSt+="</span>";
}
if(bFocr.m_opt_vals)
{
ChMSt+="<br>"
ChMSt+="<span style='"+kVvVC+"'>";
for(var i_opt=0;i_opt<bFocr.aTkiW.options.length;i_opt++)
{
var hOmsH=bFocr.aTkiW.options[i_opt]
if(hOmsH)
{
var kbagl=bFocr.m_opt_vals[i_opt];
var JSMEW=hOmsH.title;
if(JSMEW.length>0)
{
ChMSt+=JSMEW;
ChMSt+=":"
}
ChMSt+=hOmsH.vals[kbagl];
ChMSt+=" "
}
}
ChMSt+="</span>";
}
ChMSt+="</th>"
var HsCdX=bFocr.QDZII()
ChMSt+="<th style='"+CDhqU+"' >"+qWVRL.jDLWm(HsCdX)+"</th>"
ChMSt+="<th style='"+CDhqU+"'  align=center><input type=text id='wa-cart-quantity-"+n+"' style='width:45px;' maxlength=3 value='"+bFocr.wJbDg+"' type=text/></th>"
ChMSt+="<th style='"
var IZPjl=bFocr.wJbDg*HsCdX
ChMSt+=(IZPjl>0)?CDhqU:SYIFQ;
ChMSt+="' ><span id='wa-cart-total-"+n+"'>"
ChMSt+=qWVRL.jDLWm(IZPjl)
ChMSt+="</span></th>"
ChMSt+="<th style='"+CDhqU+"' ><a href=\"javascript:WA_marketRemoveItem("+n+")\">"+Translator.tr("Remove card item")+"</a></th>"
ChMSt+="</tr>"
}
ChMSt+="<tr>"
ChMSt+="<th style='"+CDhqU+"text-align:right;padding:5px;' id='wa-cart-amount-total'  colspan=5>&nbsp;</th>"
ChMSt+="<th style='"+CDhqU+"' ></th>"
ChMSt+="</tr>"
ChMSt+="</thead>"
ChMSt+="</table>"
ChMSt+="<br>"
}
dmQGw.innerHTML=ChMSt
this.kclUS()
WA_exec_callback_opera_compliant(this,this.PZwtE) 
}
XCbnV.DTSdV=function()
{
var qWVRL=aZcfx();
this.addButton(Translator.tr("Continue Shopping"),this.ZmYvD,[""],this)
this.addButton(Translator.tr("Checkout order"),this.ZQlPh,[""],this)
this.initializeWindow(670,700)
var eukPZ="font-family:Arial;font-size:12px;color:#000000;"
var ChMSt=""
ChMSt+="<div id='market-cart-content' style='width:100%;"+eukPZ+"' align=center>" 
ChMSt+="</div>"
ChMSt+="<br>"
ChMSt+="<div style='width:100%;"+eukPZ+"' align=center id='wa-market-payment-form'>"
ChMSt+="<br>"
ChMSt+="<span style='font-weight:bold;'>"
ChMSt+=Translator.tr("Please choose a country to deliver your order")
ChMSt+="</span>"
ChMSt+="<br>"
ChMSt+="<select onchange=\"WA_marketChangeCountry(this)\" id='wa-market-select-country'>"
if(CONST_WA_GLOBAL_SETTINGS.default_selected_country.length==0)
{
ChMSt+="<option value=\"\">...</option>"
}
var YjJmD=CONST_WA_GLOBAL_SETTINGS.list_favorite_country
var JuSse=CONST_WA_GLOBAL_SETTINGS.list_country 
var uvnit=new Array()
for(var fPPxw=0;fPPxw<YjJmD.length;fPPxw++)
{
var nIxSl=YjJmD[fPPxw]
uvnit.push({code:nIxSl,lab:Translator.country(nIxSl)})
}
for(var fPPxw=0;fPPxw<uvnit.length;fPPxw++)
{
var aWpcH=uvnit[fPPxw]
var nIxSl=aWpcH.code
ChMSt+="<option "
if(qWVRL.cSCfN.sKnME()==nIxSl)ChMSt+="selected "
ChMSt+="value=\""+nIxSl+"\">"+Translator.country(nIxSl)+"</option>"
}
if((YjJmD.length>0)&&(JuSse.length>0))
{
ChMSt+="<option value=\"\">-----</option>"
}
var Dtwpi=new Array()
for(var fPPxw=0;fPPxw<JuSse.length;fPPxw++)
{
var nIxSl=JuSse[fPPxw]
Dtwpi.push({code:nIxSl,lab:Translator.country(nIxSl)})
}
if((YjJmD.length==0)&&(JuSse.length==0))
{
var ivaZo=CONST_WA_COUNTRIES.codes
for(var fPPxw=0;fPPxw<ivaZo.length;fPPxw++)
{
var nIxSl=ivaZo[fPPxw]
Dtwpi.push({code:nIxSl,lab:Translator.country(nIxSl)})
}
}
Dtwpi.sort(YPVvq)
for(var fPPxw=0;fPPxw<Dtwpi.length;fPPxw++)
{
var aWpcH=Dtwpi[fPPxw]
var nIxSl=aWpcH.code
ChMSt+="<option "
if(qWVRL.cSCfN.sKnME()==nIxSl)ChMSt+="selected "
ChMSt+="value=\""+nIxSl+"\">"+Translator.country(nIxSl)+"</option>"
}
ChMSt+="</select>"
ChMSt+="<br>"
ChMSt+="<br>"
if(CONST_WA_GLOBAL_SETTINGS.link_sale_condition)
{
ChMSt+="<a "+WA_LinkToHref(CONST_WA_GLOBAL_SETTINGS.link_sale_condition)+" style='color:#0000ff'>"
ChMSt+=Translator.tr("Terms of sell")
ChMSt+="</a>"
ChMSt+="<br>" 
ChMSt+="<span id='wa-sales-condition-label'  style='font-weight:bold;'>"
ChMSt+=Translator.tr("label_market_accept_terms")
ChMSt+="</span>"
ChMSt+="<input id='wa-sales-condition' onchange=\"WA_marketChangeSalesCondition(this)\" "
ChMSt+=(qWVRL.cSCfN.LKJLb)?"checked ":""
ChMSt+="type='checkbox' value='1'/>" 
ChMSt+="<br>"
ChMSt+="<br>"
}
ChMSt+="<span style='font-weight:bold;'>"
ChMSt+=Translator.tr("Choose a type of payment")
ChMSt+="</span>"
ChMSt+="<br>"
ChMSt+="<select onchange=\"WA_marketChangeTypePayment(this)\" id='wa-market-select-payment'>"
ChMSt+="<option value=\"\">...</option>"
var vvNiG=CONST_WA_GLOBAL_SETTINGS.list_type_payment
for(var fPPxw=0;fPPxw<vvNiG.length;fPPxw++)
{
var jaDMs=vvNiG[fPPxw]
ChMSt+="<option "
if(qWVRL.cSCfN.jaDMs==jaDMs)ChMSt+="selected "
ChMSt+="value=\""+jaDMs+"\">"+Translator.tr("label_market_"+jaDMs)+"</option>"
}
ChMSt+="</select>"
ChMSt+="</div>"
this.writeContent(ChMSt)
var dmQGw=html_getLayer("market-cart-content")
dmQGw.innerHTML="<div width=100% align=center><img src='wa_loading.gif'></div>" 

qWVRL.oiNKU(this,this.gKwRH)
}
XCbnV.DTSdV() 
}
function WA_marketChangeCountry(qjwMg)
{
qjwMg.style.backgroundColor=""
var XCbnV=WA_Dialog.getCurrent()
XCbnV.gKwRH()
}
function WA_marketChangeTypePayment(qjwMg)
{
var qWVRL=aZcfx();
qWVRL.cSCfN.jaDMs=qjwMg.value
qWVRL.cSCfN.hWmXX()
qjwMg.style.backgroundColor=""
}
function WA_marketChangeSalesCondition(EOvAJ)
{
var qWVRL=aZcfx();
qWVRL.cSCfN.LKJLb=EOvAJ.checked
qWVRL.cSCfN.hWmXX() 
var csmsX=document.getElementById("wa-sales-condition-label")
csmsX.style.backgroundColor="" 
}
function WA_LinkToHref(wtLqo)
{
var ChMSt=""
var hBENh=wtLqo.url
var iAMfe=Translator.m_lang_for_filename
if(iAMfe.length>0)iAMfe="_"+iAMfe
hBENh=hBENh.replace(/@lng@/g,iAMfe)
ChMSt+="href=\""+hBENh+"\" "
if(wtLqo.open==1)
{
ChMSt+="target="
ChMSt+="_blank"
}
return ChMSt;
}
function WA_displayDialogMarketProduct(oCuMY,VYPPg)
{
var nFnZb=wa_global_market.markets[oCuMY]
var XUlVs=nFnZb.obj
var AvtjW=XUlVs.info.products
var aTkiW=AvtjW[VYPPg] 

var XCbnV=new WA_Dialog();

XCbnV.aTkiW=aTkiW
XCbnV.iDkQq=oCuMY
XCbnV.EDItl=function()
{
WA_displayDialogMarketCart()
}
XCbnV.VSkrO=function()
{
var qWVRL=aZcfx();
qWVRL.oiNKU(this,this.jXaNx) 
}
XCbnV.jXaNx=function()
{
var aTkiW=this.aTkiW;
var qWVRL=aZcfx();
var ElQmg=new Array();
var pjHrt=aTkiW.obj.id;
for(var i=0;i<3;i++)
{
var ugARH=-1;
var gsPxC=pjHrt+"-select-opt"
var qjwMg=document.getElementById(gsPxC+i)
if(qjwMg)
{
if(qjwMg.value.length==0)
{
qjwMg.style.backgroundColor="#ff0000";
qjwMg.focus()
return;
}
ugARH=parseInt(qjwMg.value)
}
ElQmg.push(ugARH)
}
if(qWVRL.addProductToShoppingCard(aTkiW,ElQmg))
{
qWVRL.mYxII()
WA_displayDialogMarketCart()
}
}
XCbnV.DTSdV=function()
{
var oCuMY=this.iDkQq
var aTkiW=this.aTkiW
var ChMSt=""
this.addButton(Translator.tr("Go to my card"),this.EDItl,[""],this)
if(aTkiW.unavail==false)
{
this.addButton(Translator.tr("Add to card"),this.VSkrO,[""],this)
}
this.initializeWindow(670,this.idealHeight())
ChMSt+="<table border=0 width=100% cellpadding=4>"
ChMSt+="<tr>" 
if(aTkiW.img_big.length>0)
{
ChMSt+="<td width='100px' align=center valign=top>"
var fVBwl=aTkiW.size_thumb.clone() 
fVBwl.scale(new Size(200,200))
ChMSt+="<a href=\""+aTkiW.img_big+"\" target=_blank>"
ChMSt+="<img border=0 src=\""+aTkiW.img_big+"\" width='"+fVBwl.width+"px' height='"+fVBwl.height+"px'>"
ChMSt+="</a>"
ChMSt+="</td>"
}
var TQhmN="color:"+WA_GLOBAL_COLOR_THEME.color_text+";";
ChMSt+="<td valign=top style='font-family:Arial;'>"
ChMSt+="<span style='font-weight:bold;font-size:16px;"+TQhmN+"'>"
ChMSt+=aTkiW.title
ChMSt+="</span>"
ChMSt+="<br>"
if(aTkiW.sub_title.length>0)
{
ChMSt+="<span style='color:#333333;font-size:14px;'>"
ChMSt+=aTkiW.sub_title
ChMSt+="</span>"
ChMSt+="<br>"
}
ChMSt+="<br>"
ChMSt+="<table border=0 width=100% cellspacing=0 cellpadding=0><tr><td>"
ChMSt+="<span style='"+TQhmN+";font-size:14px;'>"
ChMSt+=Translator.tr("Price")+" : "
ChMSt+="</span>"
ChMSt+="<span style='"+TQhmN+";font-size:18px;font-weight:bold;' id='"+aTkiW.obj.id+"-price'>"
if(aTkiW.unavail)
{
ChMSt+=Translator.tr("Unavailable")
}
ChMSt+="</span>"
if(aTkiW.more_info)
{
ChMSt+="</td><td align=right>"
var wtLqo=aTkiW.more_info
var VZDOx=WA_LinkToHref(wtLqo)
ChMSt+="<a "+VZDOx+" style='font-family:Arial;text-decoration:underline;font-weight:bold;font-size:12px;color:0000ff;'>"+Translator.tr("More product info link")+"</a>"
}
ChMSt+="</td></tr></table>"
ChMSt+="<br>"
var axGpi=aTkiW.obj.index
if(aTkiW.unavail==false)
if(aTkiW.options.length>0)
{
ChMSt+="<table border=0 cellspacing=0 cellpadding=0>"
for(var n=0;n<aTkiW.options.length;n++)
{
var hOmsH=aTkiW.options[n]
if(hOmsH)
{
ChMSt+="<tr><td align=right>"
ChMSt+="<span style='font-family:Arial;font-weight:bold;font-size:12px;"+TQhmN+"'>"
ChMSt+=hOmsH.title+" :&nbsp;"
ChMSt+="</span>"
ChMSt+="</td><td align=left>"
ChMSt+="<select id='"+aTkiW.obj.id+"-select-opt"+n+"' onchange=\"WA_market_changeCustomPrice('"+oCuMY+"',"+axGpi+")\">"
ChMSt+="<option value=\"\">...</option>"
for(var fPPxw=0;fPPxw<hOmsH.vals.length;fPPxw++)
{
var UvvPj=hOmsH.vals[fPPxw]
ChMSt+="<option value=\""+fPPxw+"\">"+UvvPj+"</option>"
}
ChMSt+="</select>"
ChMSt+="</td></tr>";
}
}
ChMSt+="</table>"
}
ChMSt+="</td>"
ChMSt+="</tr>"
ChMSt+="</table>"
if(aTkiW.description.length>0)
{
ChMSt+="<table border=0 width=100% cellpadding=4>"
ChMSt+="<tr><td colspan=2>"
ChMSt+="<span style='font-family:Arial;font-size:13px;"+TQhmN+"'>"
ChMSt+="<hr>"
ChMSt+=aTkiW.description
ChMSt+="</span>"
ChMSt+="</td></tr>"
ChMSt+="</table>"
}
this.writeContent(ChMSt)
WA_market_changeCustomPrice(oCuMY,axGpi)
}
XCbnV.displayWindowWithAutoResize(300,XCbnV.DTSdV) 
}
function cqKPE(aTkiW,pjHrt)
{
var jxSQx=new Array()
for(var i=0;i<3;i++)
{
var gsPxC=pjHrt+"-select-opt"
var qjwMg=document.getElementById(gsPxC+i)
jxSQx[i]=-1
if(qjwMg)
{
qjwMg.style.backgroundColor="";
var UvvPj=parseInt(qjwMg.value)
if(isNaN(UvvPj)==false)
jxSQx[i]=UvvPj
}
}
return wfGma(aTkiW,jxSQx)
}
function wfGma(aTkiW,jxSQx)
{
if(aTkiW.unavail)return;
var fgjYZ=false;
for(var i=0;i<aTkiW.custom_prices.length;i++)
{
var wonxd=aTkiW.custom_prices[i]
var wIugA=true;
for(var n=0;n<3;n++)
{
if(wonxd.tab[n]!=jxSQx[n])wIugA=false
}
if(wIugA)
{
fgjYZ=wonxd;
break;
}
}
var HsCdX=aTkiW.price
if(fgjYZ)
{
HsCdX=fgjYZ.pr
}
return HsCdX;
}
function WA_market_changeCustomPrice(oCuMY,axGpi)
{
var qWVRL=aZcfx();
var nFnZb=wa_global_market.markets[oCuMY]
var AvtjW=nFnZb.info.products;
var aTkiW=AvtjW[axGpi]
if(aTkiW.unavail)return;
var pjHrt=aTkiW.obj.id
var HsCdX=cqKPE(aTkiW,pjHrt)
var vOVFU=html_getLayer(pjHrt+"-price")
if(vOVFU)
{
vOVFU.innerHTML=qWVRL.jDLWm(HsCdX)
}
}
function LHjsO()
{
var qWVRL=aZcfx();
var bFocr=qWVRL.cSCfN
if(bFocr.jaDMs=="paypal")
{
RbAeJ();
return;
}
NFALQ(vbxLM)
}
function NFALQ(XifaI)
{
var qWVRL=aZcfx();
var bFocr=qWVRL.cSCfN
bFocr.nTuqU()
var XCbnV=new WA_Dialog();
XCbnV.XifaI=XifaI
XCbnV.JdSoR=function(lvsbt)
{
return Translator.tr("form-label-"+lvsbt)
}
XCbnV.onCustomKeypress=function(lvsbt)
{
if(lvsbt==13)
{
wa_timeout(Delegate.create(this,this.IOkHX),0);
}
return false;
}
XCbnV.XOkOO=function()
{


if(this.XifaI==vbxLM)
{
WA_displayDialogMarketCart()
}
else
{
NFALQ(vbxLM)
}
}
XCbnV.SQlfR=function()
{
RbAeJ()
}
XCbnV.IOkHX=function()
{
var qWVRL=aZcfx();
var bFocr=qWVRL.cSCfN
if(bFocr.WvZJS(this.XifaI)==false) return;
bFocr.hWmXX()
if(this.XifaI==vbxLM)
{
if(bFocr.kdbkq==true)
{
NFALQ(PLRKj)
}
else
{
this.SQlfR()
}
}
else
{
this.SQlfR()
}
}
XCbnV.pDCkd=function(lvsbt,fYHke)
{
if(fYHke==undefined) fYHke=""
if(fYHke)fYHke=" size="+fYHke
return "<input name='"+lvsbt+"' value=\""+bFocr.TnpxS(lvsbt,this.XifaI)+"\" type=text "+fYHke+">"
}
XCbnV.Mnvow=function(CQoOm)
{
return "<td width=100px align=right valign=top>"+Translator.tr(CQoOm)+" :</td>"
}
XCbnV.DTSdV=function()
{
var qWVRL=aZcfx();
var bFocr=qWVRL.cSCfN
this.addButton("< "+Translator.tr('Back'),this.XOkOO,[""],this)
this.addButton(Translator.tr('Continue')+" >",this.IOkHX,[""],this)
this.initializeWindow(550,600)
var GoIUk="form-label-"
var MxYks=CONST_WA_GLOBAL_SETTINGS.list_form_fields 
var ChMSt=""
ChMSt+="<form id='wa-market-form' onSubmit='return false'>"
ChMSt+="<table border=0 width=100% cellspacing=5 style='font-family:Arial;font-size:15px;'>"
ChMSt+="<tr><td colspan=2 align=center style='font-size:18px;'>"
ChMSt+=Translator.tr((this.XifaI==vbxLM)?"Fill Deliver information below":"Fill Billing information below")
ChMSt+="<br><br></td></tr>"
for(var n=0;n<MxYks.length;n++)
{
var xFBqJ=MxYks[n]
if(xFBqJ=="address")
{
ChMSt+="<tr>"+this.Mnvow("Address");
ChMSt+="<td>"
ChMSt+=this.pDCkd("address_1",30)
ChMSt+="</td></tr>"
ChMSt+="<tr><td></td><td>"
ChMSt+=this.pDCkd("address_2",30)
ChMSt+="</td></tr>"
ChMSt+="<tr>"+this.Mnvow("form-label-city");
ChMSt+="<td>"
ChMSt+=this.pDCkd("city")+"&nbsp;"+this.JdSoR("zip")+" : "+this.pDCkd("zip",10)
ChMSt+="</td></tr>"
ChMSt+="<tr>"+this.Mnvow("form-label-country");
ChMSt+="<td>"
if(this.XifaI==PLRKj)
{
ChMSt+="<select id='wa-select-form-country' onchange='WA_marketChangeFormCountry("+this.XifaI+")'>"
var Dtwpi=new Array();
var ivaZo=CONST_WA_COUNTRIES.codes
for(var fPPxw=0;fPPxw<ivaZo.length;fPPxw++)
{
var nIxSl=ivaZo[fPPxw]
Dtwpi.push({code:nIxSl,lab:Translator.country(nIxSl)})
}
Dtwpi.sort(YPVvq)
var QctKu=bFocr.sKnME()
QctKu=bFocr.TnpxS('countryCode',this.XifaI,QctKu)
for(var fPPxw=0;fPPxw<Dtwpi.length;fPPxw++)
{
var aWpcH=Dtwpi[fPPxw]
var nIxSl=aWpcH.code
ChMSt+="<option "
if(QctKu==nIxSl)ChMSt+="selected "
ChMSt+="value=\""+nIxSl+"\">"+Translator.country(nIxSl)+"</option>"
}
ChMSt+="</select>"
}
else
{
ChMSt+=Translator.country(qWVRL.cSCfN.gkjfC);
}
ChMSt+="<br><span id='wa-market-state'>"
ChMSt+="<select id='wa-select-state'></select>"
ChMSt+="</span>" 
ChMSt+="</td></tr>"
}
else
{
ChMSt+="<tr>"+this.Mnvow("form-label-"+xFBqJ);
ChMSt+="<td>"
ChMSt+=this.pDCkd(xFBqJ,30) 
ChMSt+="</td></tr>"
}
}
if(this.XifaI==vbxLM)
{
ChMSt+="<tr><td colspan=2 align=center >"
ChMSt+=Translator.tr("Billing adress is different")+" <input type=checkbox "
if(qWVRL.cSCfN.kdbkq)ChMSt+="checked "
ChMSt+="onchange='WA_marketCheckBillingAdress(this)'>"
ChMSt+="</td></tr>"
}
ChMSt+="</table>"
ChMSt+="</form>"
this.writeContent(ChMSt)
WA_exec_callback_opera_compliant(this,this.chsPQ) 
}
XCbnV.chsPQ=function()
{
WA_marketChangeFormCountry(this.XifaI)
}
XCbnV.DTSdV()
}
function WrspH(XifaI,qjwMg,XapsY)
{
var qWVRL=aZcfx();
var bFocr=qWVRL.cSCfN
var PDKFS=bFocr.TnpxS("stateCode",XifaI) 
qjwMg.options.length=0
for(var n=0;n<XapsY.length;n++)
{
var val=XapsY[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==PDKFS)elOptNew.selected=true
try{
qjwMg.add(elOptNew,null);
}
catch(ex){
qjwMg.add(elOptNew);
}
}
}
function WA_marketChangeFormCountry(XifaI)
{
var qWVRL=aZcfx();
var bFocr=qWVRL.cSCfN
var NWlgR=bFocr.gkjfC
var qjwMg=document.getElementById("wa-select-form-country");
if(qjwMg) NWlgR=qjwMg.value;
html_SetDisplay("wa-market-state",(NWlgR=="US")||(NWlgR=="CA"))
var jSqQm=document.getElementById("wa-select-state");
if(jSqQm)
{
if(NWlgR=="US") WrspH(XifaI,jSqQm,["","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(NWlgR=="CA") WrspH(XifaI,jSqQm,["","Alberta","British Columbia","Manitoba","New Brunswick","Newfoundland and Labrador","Northwest Territories","Nova Scotia","Nunavut","Ontario","Prince Edward Isl.","Quebec","Saskatchewan","Yukon Territory"])
}
}
function WA_marketCheckBillingAdress(EOvAJ)
{
var qWVRL=aZcfx();
var bFocr=qWVRL.cSCfN
bFocr.kdbkq=EOvAJ.checked
bFocr.hWmXX()
}
function RbAeJ()
{
var qWVRL=aZcfx();
var bFocr=qWVRL.cSCfN
var cwhFd=CONST_WA_GLOBAL_SETTINGS.currency_info 

var XCbnV=new WA_Dialog();
XCbnV.XOkOO=function()
{
if(this.bFocr.jaDMs=="paypal")
{
WA_displayDialogMarketCart();return;
}
if(this.bFocr.kdbkq)
NFALQ(PLRKj)
else
NFALQ(vbxLM)
}
XCbnV.ReFdd=function(BmAOt,UvvPj)
{
UvvPj=""+UvvPj
UvvPj=UvvPj.replace(/'/g,"&lsquo;")
return "<input type=hidden name='"+BmAOt+"' value=\""+UvvPj+"\">"
}
XCbnV.foVKU=function()
{
var ChMSt=""
if(cwhFd.charCodeAt(3)>=100) return""
ChMSt+="<form id='wa-http-sender' method=POST action='https://www.paypal.com/cgi-bin/webscr' target='_blank'>"
ChMSt+=this.ReFdd("cmd","_cart")
ChMSt+=this.ReFdd("business",CONST_WA_GLOBAL_SETTINGS.email_paypal_account)
ChMSt+=this.ReFdd("upload","1")
ChMSt+=this.ReFdd("charset","utf-8")
ChMSt+=this.ReFdd("no_note","0")
ChMSt+=this.ReFdd("currency_code",CONST_WA_GLOBAL_SETTINGS.currency_code)
ChMSt+=this.ReFdd("no_shipping","2")
var NoQAk=qWVRL.gXonE()
for(var i=0;i<NoQAk.length;i++)
{
var info=NoQAk[i];
var index=i+1;
var pVlGl=info.QDZII();
if(qWVRL.MkinS())
{
var faYnH=qWVRL.wCsHI(qWVRL._computeTaxOfPrice(pVlGl));
pVlGl=pVlGl-faYnH;
}
ChMSt+=this.ReFdd("amount_"+index,""+pVlGl)
ChMSt+=this.ReFdd("quantity_"+index,info.wJbDg)
var qfBhq=0;
if(info.HwCQW.length>0)
{
ChMSt+=this.ReFdd("on"+qfBhq+"_"+index,"ref")
ChMSt+=this.ReFdd("os"+qfBhq+"_"+index,info.HwCQW)
qfBhq++;
}
var cvuqo=""
if(info.m_opt_vals)
{
for(var i_opt=0;i_opt<info.aTkiW.options.length;i_opt++)
{
var hOmsH=info.aTkiW.options[i_opt]
if(hOmsH)
{
var kbagl=info.m_opt_vals[i_opt];
var Idetn=hOmsH.vals[kbagl]
var JSMEW=hOmsH.title;
if(JSMEW.length==0) JSMEW="opt"+(i_opt+1);
ChMSt+=this.ReFdd("on"+qfBhq+"_"+index,JSMEW)
ChMSt+=this.ReFdd("os"+qfBhq+"_"+index,Idetn)
if(cvuqo.length>0)cvuqo=cvuqo+", "
cvuqo+=Idetn
qfBhq++;
}
}
}
var UJrJZ=info.tpQEB;
if(cvuqo.length>0)UJrJZ=UJrJZ+"("+cvuqo+")"
ChMSt+=this.ReFdd("item_name_"+index,UJrJZ) 
}
var luEYk=qWVRL.iwltK()
if(qWVRL.MkinS())
{
luEYk=luEYk-qWVRL.wCsHI(qWVRL._computeTaxOfPrice(luEYk));
}
if(qWVRL.MkinS())
{
var EaLUv=qWVRL.qdxKx();
var TGQMv=qWVRL.iwltK()
var QHIGC=EaLUv+TGQMv;
var YbTbp=qWVRL.wCsHI(qWVRL._computeTaxOfPrice(QHIGC));
var QgmBT=QHIGC-YbTbp;
QgmBT=QgmBT-luEYk;
var GONnW=0;
for(var i=0;i<NoQAk.length;i++)
{
var info=NoQAk[i];
var index=i+1;
var gsfbV=0;
var KMNlk=0;
var pVlGl=info.wJbDg*info.QDZII();
var n0=qWVRL.HpaKY()/100;
var tax=pVlGl*(n0/(1+n0));
pVlGl=pVlGl-tax;
gsfbV=pVlGl;
var Guofi=info.QDZII();
var faYnH=qWVRL.wCsHI(qWVRL._computeTaxOfPrice(Guofi));
Guofi=Guofi-faYnH;
KMNlk=info.wJbDg*Guofi;
if(KMNlk>gsfbV)
{
Guofi=info.m_price;
Guofi=Guofi-faYnH;
var qaTAr=Guofi;
if((qaTAr>0)&&(qaTAr!=info.QDZII()))
{
qaTAr=qaTAr-0.01;
}
ChMSt+=this.ReFdd("amount_"+index,qaTAr) 
KMNlk=info.m_quantity*qaTAr;
}
GONnW+=KMNlk;
}
var SiFPm=qWVRL.wCsHI(QgmBT-GONnW);
if(SiFPm>0)
{
var index=NoQAk.length+1;
ChMSt+=this.ReFdd("item_name_"+index,Translator.tr("TVA correction"))
ChMSt+=this.ReFdd("quantity_"+index,1)
ChMSt+=this.ReFdd("amount_"+index,SiFPm)
}
ChMSt+=this.ReFdd("tax_cart",YbTbp)
}
else
{
ChMSt+=this.ReFdd("tax_cart",qWVRL.NCYZw())
}
ChMSt+=this.ReFdd("handling_cart",luEYk) 
ChMSt+="</form>"
return ChMSt;
}
XCbnV.TSoev=function()
{
var MZVvw=this.NifgZ(vbxLM);
var ChMSt="";
if(MZVvw.length>0)
{
ChMSt+=""+Translator.tr("Shipping information")+":\n";
ChMSt+=MZVvw;
}
return ChMSt;
}
XCbnV.fgudZ=function()
{
var MZVvw=this.NifgZ(PLRKj);
var ChMSt="";
if(MZVvw.length>0)
{
ChMSt+=Translator.tr("Billing information")+":\n";
ChMSt+=MZVvw;
}
return ChMSt;
}
XCbnV.NifgZ=function(XifaI)
{
var qWVRL=aZcfx();
var ChMSt="";
var MrnOc=new Array();
var MxYks=YfFxM(CONST_WA_GLOBAL_SETTINGS.list_form_fields)
MxYks.push("country")
MxYks.push("state")
for(var i=0;i<MxYks.length;i++)
{
var DaYDv=MxYks[i];
MrnOc[DaYDv]=this.bFocr.TnpxS(DaYDv,XifaI)
}
if(MrnOc["firstname"])ChMSt+=MrnOc["firstname"]+"\n"
if(MrnOc["lastname"])ChMSt+=MrnOc["lastname"]+"\n"
if(MrnOc["company"])
{
ChMSt+=Translator.tr("form-label-company")+" : "+MrnOc["company"]+"\n"
}
if(MrnOc["address_1"]) ChMSt+=MrnOc["address_1"]+"\n"
if(MrnOc["address_2"]) ChMSt+=MrnOc["address_2"]+"\n"
if(MrnOc["zip"]) ChMSt+=MrnOc["zip"]+" "
if(MrnOc["city"]) ChMSt+=MrnOc["city"]+"\n"
if(MrnOc["country"])ChMSt+=Translator.country(MrnOc["country"])
if(MrnOc["state"]&&MrnOc["state"].length>0) ChMSt+=" "+MrnOc["state"];
ChMSt+="\n"
if(MrnOc["phone"]) ChMSt+=Translator.tr("form-label-phone")+" : "+MrnOc["phone"]+"\n"
if(MrnOc["fax"]) ChMSt+=Translator.tr("form-label-fax")+" : "+MrnOc["fax"]+"\n"
if(MrnOc["email"]) ChMSt+=MrnOc["email"]+"\n"
if(MrnOc["comment"])
{
ChMSt+=Translator.tr("form-label-comment")+" : \n";
ChMSt+=MrnOc["comment"]+"\n"
}
return ChMSt;
}
XCbnV.Agruq=function()
{
var qWVRL=aZcfx();
var ChMSt="";
var NoQAk=qWVRL.gXonE();
ChMSt+="**************\n"
for(var i=0;i<NoQAk.length;i++)
{
var bFocr=NoQAk[i];
var index=i+1;
var UJrJZ=bFocr.tpQEB;
if(bFocr.HwCQW.length>0)
{
UJrJZ+=" ["+bFocr.HwCQW+"]";
}
var cvuqo=""
if(bFocr.m_opt_vals)
{
for(var i_opt=0;i_opt<bFocr.aTkiW.options.length;i_opt++)
{
var hOmsH=bFocr.aTkiW.options[i_opt]
if(hOmsH)
{
if(cvuqo.length>0)cvuqo=cvuqo+", "
var kbagl=bFocr.m_opt_vals[i_opt];
var Idetn=hOmsH.vals[kbagl]
var JSMEW=hOmsH.title;
if(JSMEW.length>0) cvuqo+=JSMEW+" : "
cvuqo+=Idetn
}
}
}
if(cvuqo.length>0)UJrJZ=UJrJZ+"\n("+cvuqo+")"
ChMSt+=UJrJZ;
ChMSt+="\n"
ChMSt+=Translator.tr("Price")+" : "+qWVRL.jDLWm(bFocr.QDZII())+"\n"
ChMSt+=Translator.tr("Quantity")+" : "+bFocr.wJbDg+"\n"
ChMSt+=Translator.tr("Total")+" : "+qWVRL.jDLWm(bFocr.QDZII()*bFocr.wJbDg);
ChMSt+="\n"
ChMSt+="**************\n"
}
var saKWP=qWVRL.qdxKx()
var MBuAb=qWVRL.NCYZw()
var ltggc=qWVRL.iwltK()
var BNBIu=qWVRL.UmcQp() 
ChMSt+=Translator.tr("Sub total")+" : "+qWVRL.jDLWm(saKWP)+"\n";
if(CONST_WA_GLOBAL_SETTINGS.shipping_type!=kJhes)
{
ChMSt+=Translator.tr("Shipping amount")+" : "+qWVRL.jDLWm(ltggc)+"\n";
}
if(qWVRL.MkinS()||qWVRL.ujkhb())
{
if(qWVRL.MkinS())
{
ChMSt+=Translator.tr("Tax included");
}
if(qWVRL.ujkhb())
{
ChMSt+=Translator.tr("Extra Tax");
}
ChMSt+=" : ";
ChMSt+=qWVRL.jDLWm(MBuAb)+"\n";
}
ChMSt+=Translator.tr("Total")+" : "+qWVRL.jDLWm(BNBIu)+"\n";
return ChMSt;
}
XCbnV.kGxqF=function()
{
var qWVRL=aZcfx();
var ChMSt="";
var NoQAk=qWVRL.gXonE()
ChMSt+="<table border=1 style=\"width:100%;text-align: left; margin-left: auto; margin-right: auto;\" cellpadding=2 cellspacing=2>"
ChMSt+="<tr class=\"crbst-table-title\">"
ChMSt+="<td>&nbsp;</td>"
ChMSt+="<td>"+Translator.tr("Price")+"</td>"
ChMSt+="<td>"+Translator.tr("Quantity")+"</td>"
ChMSt+="<td>"+Translator.tr("Total")+"</td>"
ChMSt+="</tr>"
for(var i=0;i<NoQAk.length;i++)
{
ChMSt+="<tr>"
var bFocr=NoQAk[i];
var index=i+1;
ChMSt+="<td>"
var UJrJZ=bFocr.tpQEB;
if(bFocr.HwCQW.length>0)
{
UJrJZ+=" ["+bFocr.HwCQW+"]";
}
UJrJZ="<b>"+UJrJZ+"</b>"
var cvuqo=""
if(bFocr.m_opt_vals)
{
for(var i_opt=0;i_opt<bFocr.aTkiW.options.length;i_opt++)
{
var hOmsH=bFocr.aTkiW.options[i_opt]
if(hOmsH)
{
if(cvuqo.length>0)cvuqo=cvuqo+", "
var kbagl=bFocr.m_opt_vals[i_opt];
var Idetn=hOmsH.vals[kbagl]
var JSMEW=hOmsH.title;
if(JSMEW.length>0) cvuqo+=JSMEW+" : "
cvuqo+=Idetn
}
}
}
if(cvuqo.length>0)UJrJZ=UJrJZ+"<br><span style='font-size:10px;'>("+cvuqo+")</span>"
ChMSt+=UJrJZ;
ChMSt+="</td>"
ChMSt+="<td>"+qWVRL.jDLWm(bFocr.QDZII())+"</td>"
ChMSt+="<td>"+bFocr.wJbDg+"</td>"
ChMSt+="<td>"+qWVRL.jDLWm(bFocr.QDZII()*bFocr.wJbDg)+"</td>"
ChMSt+="</tr>"
}
ChMSt+="<tr><td colspan=4>"
var saKWP=qWVRL.qdxKx()
var MBuAb=qWVRL.NCYZw()
var ltggc=qWVRL.iwltK()
var BNBIu=qWVRL.UmcQp() 
ChMSt+="<table border=0 width=100%>"
ChMSt+="<tr><td align=right >"+Translator.tr("Sub total")+" : "+qWVRL.jDLWm(saKWP)+"</td></tr>";
if(CONST_WA_GLOBAL_SETTINGS.shipping_type!=kJhes)
{
ChMSt+="<tr><td align=right>"+Translator.tr("Shipping amount")+" : "+qWVRL.jDLWm(ltggc)+"</td></tr>";
}
if(qWVRL.MkinS()||qWVRL.ujkhb())
{
if(qWVRL.MkinS())
{
ChMSt+="<tr><td align=left >"+Translator.tr("Tax included");
}
if(qWVRL.ujkhb())
{
ChMSt+="<tr><td align=right >"+Translator.tr("Extra Tax");
}
ChMSt+=" : ";
ChMSt+=qWVRL.jDLWm(MBuAb)+"</td></tr>";
}
ChMSt+="<tr><td align=right class=\"crbst-card-total\">"+Translator.tr("Total")+" : "+qWVRL.jDLWm(BNBIu)+"</td></tr>";
ChMSt+="</table>" 
ChMSt+="</td></tr>"
ChMSt+="</table>"
ChMSt=ChMSt.replace(/\"/g,"'")
return ChMSt;
}
XCbnV.fOCge=function(UvvPj)
{
if((""+UvvPj).length==1)UvvPj="0"+UvvPj;
return UvvPj
}
XCbnV.MQuJG=function()
{
var qWVRL=aZcfx();
var ChMSt=""
if(cwhFd.charCodeAt(3)>=100) return""
if(sdVIw)
{
ChMSt+="<form id='wa-http-sender' method=POST action='"+sdVIw_URL+"crbst_market_print_form.php' target='_blank'>"
}
else
{
ChMSt+="<form id='wa-http-sender' method=POST action='crbst_market_print_form.php' target='_blank'>"
}
ChMSt+=this.ReFdd("type_payment",this.bFocr.jaDMs)
ChMSt+=this.ReFdd("MAIL_TITLE_PREFIXE",Translator.tr("title email Order notification"))
ChMSt+=this.ReFdd("MAIN_TITLE",Translator.tr("PRINT_FORM_MAIN_TITLE"))
ChMSt+=this.ReFdd("PREFIXE_ORDER",Translator.tr("PRINT_FORM_PREFIXE_ORDER"))
var GdCni=""
var MUKMQ=new Date()
GdCni+="wa-"+this.fOCge(MUKMQ.getYear()-100)+this.fOCge(MUKMQ.getMonth()+1)+this.fOCge(MUKMQ.getDate())
GdCni+=MUKMQ.getHours()+this.fOCge(MUKMQ.getMinutes())+this.fOCge(MUKMQ.getSeconds())
GdCni+="-"+Math.round(Math.random()*100) 
ChMSt+=this.ReFdd("ID_ORDER",GdCni)
ChMSt+=this.ReFdd("CARD_TITLE",Translator.tr("PRINT_FORM_CARD_TITLE"))
ChMSt+=this.ReFdd("LABEL_TYPE_PAYMENT",Translator.tr("PRINT_FORM_LABEL_TYPE_PAYMENT"))
ChMSt+=this.ReFdd("send_copy_email_to_buyer",(qWVRL.send_copy_email_to_buyer)?"1":"0") 
ChMSt+=this.ReFdd("email_buyer",this.bFocr.TnpxS("email",vbxLM))
if(this.bFocr.jaDMs=="check")
{
ChMSt+=this.ReFdd("TYPE_PAYMENT",Translator.tr("PRINT_FORM_TYPE_CHECK"))
ChMSt+=this.ReFdd("MESSAGE_CHECK",Translator.tr("PRINT_FORM_MESSAGE_CHECK"))
}
if(this.bFocr.jaDMs=="wire")
{
ChMSt+=this.ReFdd("TYPE_PAYMENT",Translator.tr("PRINT_FORM_TYPE_WIRE"))
ChMSt+=this.ReFdd("MESSAGE_CHECK",Translator.tr("PRINT_FORM_MESSAGE_WIRE"))
}
ChMSt+=this.ReFdd("LABEL_PRINT",Translator.tr("PRINT_FORM_LABEL_PRINT"))
ChMSt+=this.ReFdd("card_html",this.kGxqF())
ChMSt+=this.ReFdd("card_plain_text",this.Agruq())
ChMSt+=this.ReFdd("LABEL_SELLER_INFORMATION",Translator.tr("Seller information"))
ChMSt+=this.ReFdd("LABEL_BANK_ACCOUNT",Translator.tr("Bank account information"))
ChMSt+=this.ReFdd("LABEL_ADDRESS",Translator.tr("Address"))
ChMSt+=this.ReFdd("seller_address",CONST_WA_GLOBAL_SETTINGS.seller_address)
ChMSt+=this.ReFdd("bank_account_informations",CONST_WA_GLOBAL_SETTINGS.bank_account_informations)
ChMSt+=this.ReFdd("buyer_info_shipping",this.TSoev())
var GMZgJ=""
if(bFocr.kdbkq)
{
GMZgJ=this.fgudZ();
};
ChMSt+=this.ReFdd("buyer_info_billing",GMZgJ)
ChMSt+="</form>"
return ChMSt;
}
XCbnV.HaFAq=function()
{
var qWVRL=aZcfx();
qWVRL.ksswv()
this.closeWin()
}
XCbnV.DTSdV=function()
{
var qWVRL=aZcfx();
var vxHeU=((this.bFocr.jaDMs=="check")||(this.bFocr.jaDMs=="wire")) 
if(this.bFocr.jaDMs=="paypal")
{
this.addButton(Translator.tr('Clear cart'),this.HaFAq,[""],this)
this.initializeWindow(400,200)
}
else
{
this.initializeWindow(400,150)
}
var ChMSt=""
if(this.bFocr.jaDMs=="paypal")
{
ChMSt+=this.foVKU()
}
if(vxHeU)
{
ChMSt+=this.MQuJG()
if((sdVIw==false)&&(document.webaca_is_preview))
{
WA_Dialog.alert(Translator.tr("Operation not allowed in preview mode"))
return
}
}
ChMSt+="<table border=0 style='width:100%;'><tr>";
ChMSt+="<td align=center style='"+this.cssText1()+"'>"
ChMSt+=Translator.tr("You have been redirected to the payment page")
if(this.bFocr.jaDMs=="paypal")
{
ChMSt+="<br><br>"
ChMSt+=Translator.tr("You can clear your cart")
}
ChMSt+="</td></tr></table>"
this.writeContent(ChMSt) 
if(cwhFd.charCodeAt(3)>=100)
{
WA_Dialog.alert(Translator.tr("This cariboost edition can't support ebusiness features !'"))
return;
}
var pZmiO=document.getElementById("wa-http-sender")
pZmiO.submit()
if(vxHeU)
{
qWVRL.ksswv()
}
}
XCbnV.bFocr=bFocr
XCbnV.DTSdV()
}

-->
