<!--

var nPJTw=0
var nvTZk=1
var SxWMg=2
var efoEe=0;
var WAtco=1;
var ILmHe=2;
var xsOBQ=0
var utKVY=1
var WOXAd=false 
function WA_marketRemoveItem(qaVaF)
{
vNvvC().Tfpco(qaVaF)
var vXCFB=WA_Dialog.getCurrent();
vXCFB.mIScM()
}
function vNvvC()
{
if(document.wa_global_settings_market==undefined)document.wa_global_settings_market=new pShqc()
return document.wa_global_settings_market;
}
function BEFSw()
{
this.KGCXB=function()
{
return this.FdunG+"-"+this.rODRv_index
}
this.RUqED=function(Fewbl,FnJVn)
{
this.rODRv=Fewbl.obj.market.info.folder.substring(13);
this.rODRv_index=Fewbl.obj.index;
this.rODRv_modif=Fewbl.obj.market.info.critical_id_modif
this.FdunG=Fewbl.obj.market.id 

this.qXwBm=1;
this.ZAVwM=Fewbl.title;
this.AhOMQ=Fewbl.price;
this.xBjlI=Fewbl.weight;
this.wGLYV=Fewbl.code_product;
}
this.PdRTc=function(Fewbl,FnJVn)
{

this.ZAVwM=Fewbl.title;
this.AhOMQ=Fewbl.price;
this.xBjlI=Fewbl.weight;
this.wGLYV=Fewbl.code_product;
}
this.iQQRr=function()
{
var s="";
s+=this.KGCXB();
if(this.m_opt_vals)
for(var i=0;i<this.m_opt_vals.length;i++)
{
var AEpnQ=this.m_opt_vals[i]
if(AEpnQ!=-1) s+="/"+AEpnQ;
}
return s;
}
this.aFmMu=function()
{
var val="";
val+="j="+this.rODRv+",";
val+="i="+this.rODRv_index+",";
val+="m="+this.rODRv_modif+",";
val+="q="+this.qXwBm+",";
if(this.m_opt_vals)
{
for(var i=0;i<this.m_opt_vals.length;i++)
{
val+="o"+i+"=";
var ufwdS=this.m_opt_vals[i]
if(ufwdS>-1)
val+=ufwdS
else
val+=""
val+=","
}
}
return val;
}
this.FcpjI=function(map,k)
{
var v=map[k];
if(v=="undefined") return "";
return v;
}
this.eVjYC=function(map)
{
this.rODRv=this.FcpjI(map,"j");
if(this.rODRv=="") return false;
this.rODRv_index=this.FcpjI(map,"i");
this.rODRv_modif=this.FcpjI(map,"m");
this.qXwBm=parseInt(map["q"]);
this.m_opt_vals=new Array();
for(var i=0;i<3;i++)
{
var HZLnY=parseInt(map["o"+i]);
if(isNaN(HZLnY))HZLnY=-1;
this.m_opt_vals.push(HZLnY)
}
return true;
}
this.kwXqH=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.lZBfi=function(ElVgm)
{
var XbWlv=this.kwXqH(ElVgm)
return this.eVjYC(XbWlv) 
}
this.EBttn=function()
{
return GhpcC(this.Fewbl,this.m_opt_vals)
}
}
function fMDGD(JKhni)
{
var tUPnx=JKhni[0]
var MHAJQ=JKhni[1]
var fQHgB=JKhni[2]
if(tUPnx.length==0)
{
fQHgB.call(MHAJQ)
return;
}
var js=tUPnx.pop()
WA_loadScript(js.src,fMDGD,[tUPnx,MHAJQ,fQHgB]);
}
function WA_arrayContains(BgMXa,ElVgm)
{
for(var n=0;n<BgMXa.length;n++){if(BgMXa[n]==ElVgm)return true;}
return false;
}
function JrPZQ(BgMXa)
{
var XbWlv=new Array()
for(var n=0;n<BgMXa.length;n++)
{
var Hiaod=BgMXa[n]
if(Hiaod=="address") XbWlv=XbWlv.concat(["address_1","address_2","city","zip"])
else XbWlv.push(Hiaod)
}
return XbWlv;
}
function SLYPW()
{
this.jcLuv=function()
{
if(this.wPUsY.length==0)return CONST_WA_GLOBAL_SETTINGS.default_selected_country;
return this.wPUsY;
}
this.CIgeb=function()
{
this.mXLZR()
}
this.kwXqH=function(s)
{
var rRnJk=new Array();
var tab=s.split(",");
for(var i=0;i<tab.length;i++)
{
var tab3=tab[i].split("=");
if(tab3.length==2)rRnJk[tab3[0]]=tab3[1];
}
return rRnJk;
}
this.rlRGI=function(hnqjF)
{
if(hnqjF==undefined) return ""
return(hnqjF==xsOBQ)?"deliv-":"bill-"
}
this.lsisY=function(tunXo,hnqjF,lnTwA)
{
if(!lnTwA)lnTwA=""
var jYAlK=this.rlRGI(hnqjF)
if(tunXo=="country")
{
if(hnqjF==xsOBQ) return this.wPUsY
if(hnqjF==utKVY) tunXo="countryCode"
}
if(tunXo=="state")
{
tunXo="stateCode"
}
var AEpnQ=this.MVhBd[jYAlK+tunXo]
if(!AEpnQ) return lnTwA
AEpnQ=AEpnQ.replace(/\"/g,"'")
return AEpnQ
}
this.FFnOm=function(AEpnQ)
{
if(AEpnQ==undefined)return ""
return AEpnQ
}
this.LDsDJ=function(key,val)
{
if((val==null)||(val==undefined)) val="";
WA_SetCookie("crbst-card-"+key,val)
}
this.AOgGR=function(key)
{
var MHAJQ=WA_GetCookie("crbst-card-"+key)
if(MHAJQ=="null")MHAJQ="";
return ""+MHAJQ
}
this.xIHGU=function()
{
this.MVhBd=new Array()
var ElVgm=this.AOgGR("order-infos")
var XbWlv=this.kwXqH(ElVgm)
for(var k1 in XbWlv)
{
var AEpnQ=XbWlv[k1]
if((k1.indexOf("deliv-")==0)||(k1.indexOf("bill-")==0))
this.MVhBd[k1]=unescape(AEpnQ)
}
this.wPUsY=this.FFnOm(XbWlv["countryCode"])
this.pZCXB=this.FFnOm(XbWlv["typePayment"])
this.WeCJG=(this.FFnOm(XbWlv["differentBillingAddressChecked"])=="true")
this.rUTXe=(this.FFnOm(XbWlv["salesConditionChecked"])=="true")
}
this.mXLZR=function()
{
var ElVgm=""
for(var k1 in this.MVhBd)
{
var AEpnQ=this.MVhBd[k1]
ElVgm+=k1+"="+escape(AEpnQ)+","
}
var OchPk=""
OchPk+="countryCode="+escape(this.wPUsY)+","
OchPk+="typePayment="+escape(this.pZCXB)+","
OchPk+="differentBillingAddressChecked="+(this.WeCJG)+","
OchPk+="salesConditionChecked="+(this.rUTXe)+","
ElVgm+=OchPk 
this.LDsDJ("order-infos",ElVgm)
}
this.brmhT=function(Fulhf)
{
if(trimString(Fulhf.value).length==0)
{
Fulhf.style.backgroundColor="#ff0000"
Fulhf.focus()
return false;;
}
Fulhf.style.backgroundColor=""
return true;
}
this.nisNn=function(hnqjF)
{
var ojLdJ=JrPZQ(CONST_WA_GLOBAL_SETTINGS.list_form_fields)
var iAXFE=JrPZQ(CONST_WA_GLOBAL_SETTINGS.list_mandatory_form_fields) 
var MQtDd=this.MVhBd;
var jYAlK=this.rlRGI(hnqjF) 
var gfbCM=document.getElementById("wa-market-form")
for(var n=0;n<ojLdJ.length;n++)
{
var QEGpS=ojLdJ[n]
var lUXFI=gfbCM[QEGpS]
var AEpnQ=trimString(lUXFI.value)
if(QEGpS!="address_2")
if(WA_arrayContains(iAXFE,QEGpS))
{
if(this.brmhT(lUXFI)==false)return false;
}
MQtDd[jYAlK+QEGpS]=AEpnQ
}
var fwSih=document.getElementById("wa-select-state");
var COmGc=document.getElementById("wa-market-state");
if(fwSih&&(COmGc.style.display!="none"))
{
if(this.brmhT(fwSih)==false)return false;
MQtDd[jYAlK+"stateCode"]=fwSih.value
}
else
{
MQtDd[jYAlK+"stateCode"]=""
}
if(hnqjF==utKVY)
{
var vFlVE=document.getElementById("wa-select-form-country");
if(vFlVE)
{
MQtDd[jYAlK+"countryCode"]=vFlVE.value
}
}
this.mXLZR()
return true;
}
this.wPUsY=""
this.pZCXB=""
this.WeCJG=false;
this.rUTXe=false
this.xIHGU()
}
function pShqc()
{
this.ltbfD=new Array();
this.MHAJQ_callback=false;
this.bFlQe=false;
this.EYMbu=false;
this.YPJlP=new SLYPW()
this.YgGbi=function(MHAJQ,fQHgB)
{
this.MHAJQ_callback=MHAJQ
this.bFlQe=fQHgB 
var aCQMD=this.AOgGR("data")
this.HYiJr(aCQMD) 
var tUPnx=new Array()
var BgMXa=this.ltbfD;
for(var i=0;i<BgMXa.length;i++)
{
var qEvVY=BgMXa[i];
var PBaKd=Translator.m_lang_for_filename
if(PBaKd.length>0)PBaKd="_"+PBaKd;
var FZEHr=qEvVY.rODRv;
var n=FZEHr.indexOf("_")
if(n>-1)FZEHr=FZEHr.substring(n+1)
qEvVY.FdunG="wa-id-"+FZEHr 
var aChkJ=wa_global_market.markets[qEvVY.FdunG]
if(this.EYMbu==false)
if(!aChkJ)
{
var FUTcF="crbst_market_"+qEvVY.rODRv+'/'
WA_declareMarket(qEvVY.FdunG,FUTcF,qEvVY.rODRv_modif) 
var rMRao=FUTcF+'market-definition'+PBaKd+'.js?v='+qEvVY.rODRv_modif
tUPnx.push({id:FZEHr,src:rMRao})
}
}
fMDGD([tUPnx,this,this.rojKO])
}
this.EbaaG=function()
{
this.LDsDJ("data","")
this.YPJlP.LDsDJ("order-infos","")
this.YPJlP.xIHGU()
this.HYiJr("")
}
this.rojKO=function()
{
this.EYMbu=true;
var BgMXa=this.ltbfD;
var ngaFa=new Array();
for(var i=0;i<BgMXa.length;i++)
{
var qEvVY=BgMXa[i];
var FZEHr=qEvVY.FdunG
var xWpsN=wa_global_market.markets[FZEHr] 
var EhvPY=xWpsN.info.products 
var FnJVn=qEvVY.rODRv_index
var Fewbl=EhvPY[FnJVn]
qEvVY.Fewbl=Fewbl
qEvVY.PdRTc(qEvVY.Fewbl,FnJVn)
if((Fewbl.unavail==false)&&(qEvVY.rODRv_modif==xWpsN.info.critical_id_modif))
{
ngaFa.push(qEvVY)
}
}
this.ltbfD=ngaFa
this.Njixx() 
this.bFlQe.call(this.MHAJQ_callback)
}
this.HYiJr=function(EAwZr)
{
var BgMXa=new Array();
var list_string_products=EAwZr.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 qEvVY=new BEFSw();
if(qEvVY.lZBfi(s_data))
{
BgMXa.push(qEvVY);
}
}
}
this.ltbfD=BgMXa;
var kWdKS=this.vcBXh()
if(WA_getNumberMarketItemsInCart()!=kWdKS)
{
this.Njixx()
this.rwfGX()
}
}
this.kJAdP=function()
{
var vwkla=''
try{vwkla=CONST_WA_GLOBAL_SETTINGS.currency_mnemonic}catch(e){}
return vwkla
}
this.Tfpco=function(qaVaF)
{
var list2=new Array();
var BgMXa=this.ltbfD
for(var i=0;i<BgMXa.length;i++)
{
var qEvVY=BgMXa[i];
if(i!=qaVaF)
{
list2.push(qEvVY);
}
}
this.ltbfD=list2;
this.RUZKV()
}
this.addProductToShoppingCard=function(Fewbl,optionsValues)
{
if(this.IKucl()==false)
{
WA_Dialog.alert(Translator.tr("You can't use shopping card Your browser doesnt accept cookies !"));
return false;
}
var BciwE=Fewbl.obj
var BgMXa=this.UmkhV();
var n=BgMXa.length
var mDmUS=new BEFSw()
mDmUS.RUqED(Fewbl,n);
mDmUS.m_opt_vals=optionsValues
var b_match=false;
for(var i=0;i<BgMXa.length;i++)
{
var qEvVY=BgMXa[i];
if(qEvVY.iQQRr()==mDmUS.iQQRr())
{
b_match=true;
qEvVY.qXwBm++;
}
}
if(b_match==false)
{
var aCQMD=this.AOgGR("data")
var CbXjk=mDmUS.aFmMu()
var sXOFs=aCQMD.length+CbXjk.length 
if(sXOFs>4000)
{
WA_Dialog.alert(Translator.tr("Cookies cart contains max data !"));
return false;
}
BgMXa.push(mDmUS);
}
return true
}
this.GIcoR=function()
{
var BgMXa=this.ltbfD
var aCQMD="";
for(var i=0;i<BgMXa.length;i++)
{
var info=BgMXa[i];
aCQMD+=info.aFmMu()+";";
}
return aCQMD;
}
this.vcBXh=function()
{
var DCFtW=0;
var BgMXa=this.ltbfD;
for(var i=0;i<BgMXa.length;i++)
{
var qEvVY=BgMXa[i];
DCFtW+=qEvVY.qXwBm
}
return DCFtW;
}
this.Njixx=function()
{
this.LDsDJ("nb_items",this.vcBXh())
}
this.RUZKV=function()
{
var BgMXa=this.ltbfD
var aCQMD=this.GIcoR()
this.LDsDJ("data",aCQMD)
this.Njixx()
this.rwfGX();
}
this.rwfGX=function()
{
WA_refreshNumberMarketItemsInCart()
}
this.UmkhV=function()
{
return this.ltbfD;
}
this.IKucl=function()
{
this.LDsDJ("watestcookies","test")
return(this.AOgGR("watestcookies")=="test");
}
this.LDsDJ=function(key,val)
{
if((val==null)||(val==undefined)) val="";
WA_SetCookie("crbst-card-"+key,val)
}
this.AOgGR=function(key)
{
var MHAJQ=WA_GetCookie("crbst-card-"+key)
if(MHAJQ=="null")MHAJQ="";
return ""+MHAJQ
}
this.qSJei=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.kJAdP()+result;
}
else
{
result=result+" "+this.kJAdP();
}
return result;
}
this.pukVj=function(lgxXi)
{
return Math.round(lgxXi*100)/100
}
this.NTjug=function()
{
var BgMXa=this.UmkhV()
var price=0;
for(var i=0;i<BgMXa.length;i++)
{
var qEvVY=BgMXa[i];
price+=(qEvVY.EBttn()*qEvVY.qXwBm);
}
return price;
}
this.computeShippingForValue=function(val)
{
var DFwAF=CONST_WA_GLOBAL_SETTINGS.shipping_type
if(DFwAF==nPJTw)return 0;
var ship_val=0;
var eJwQq=CONST_WA_GLOBAL_SETTINGS.shipping_intervals
for(var i=0;i<eJwQq.length;i++)
{
var qMnEY=eJwQq[i];
if(qMnEY.v<val)ship_val=qMnEY.p
}
return ship_val;
}
this.ERVNs=function(NWKdm)
{
var XbWlv=CONST_WA_GLOBAL_SETTINGS.rRnJk_list_extra_shipping_by_country_code
if(XbWlv==undefined)
{
XbWlv=new Array()
CONST_WA_GLOBAL_SETTINGS.rRnJk_list_extra_shipping_by_country_code=XbWlv;
var tvExK=CONST_WA_GLOBAL_SETTINGS.list_extra_shipping_by_country_code
for(var qaVaF in tvExK)
{
var gBfdN=tvExK[qaVaF];
var ENMgu=gBfdN.c
for(var YoVqD in ENMgu)
{
var QDIqY=ENMgu[YoVqD];XbWlv[QDIqY]=gBfdN.p;
}
}
}
return XbWlv[NWKdm];
}
this.DGVQd=function(NWKdm)
{
var XbWlv=CONST_WA_GLOBAL_SETTINGS.DCopl
if(XbWlv==undefined)
{
XbWlv=new Array()
CONST_WA_GLOBAL_SETTINGS.DCopl=XbWlv;
var tvExK=CONST_WA_GLOBAL_SETTINGS.list_tva_by_country_code
for(var qaVaF in tvExK)
{
var gBfdN=tvExK[qaVaF];
var ENMgu=gBfdN.c;
for(var YoVqD in ENMgu)
{
var QDIqY=ENMgu[YoVqD];XbWlv[QDIqY]=gBfdN.p;
}
}
}
return XbWlv[NWKdm];
}
this.hkkdw=function()
{
var DFwAF=CONST_WA_GLOBAL_SETTINGS.shipping_type
var BgMXa=this.UmkhV()
var global_ref_for_shipping=0;
var eijVe=0;
var wPUsY=this.YPJlP.wPUsY;
if(wPUsY.length>0)
{
eijVe=this.ERVNs(wPUsY);
if(isNaN(eijVe)) eijVe=0;
}
for(var i=0;i<BgMXa.length;i++)
{
var qEvVY=BgMXa[i];
if(DFwAF==nvTZk)
{
global_ref_for_shipping+=(qEvVY.qXwBm*qEvVY.EBttn());
}
if(DFwAF==SxWMg)
{
global_ref_for_shipping+=(qEvVY.qXwBm*qEvVY.xBjlI);
}
}
return eijVe+this.pukVj(this.computeShippingForValue(global_ref_for_shipping));
}
this.KQLrv=function()
{
return CONST_WA_GLOBAL_SETTINGS.tva_type==WAtco
}
this.xsPvg=function()
{
return CONST_WA_GLOBAL_SETTINGS.tva_type==ILmHe
}
this.kfOWv=function()
{
return CONST_WA_GLOBAL_SETTINGS.tva_type==efoEe
}
this.RWxKA=function()
{
if(this.kfOWv())return 0;
var tax=0;
var country_code=this.YPJlP.wPUsY;
if(country_code.length>0)
{
tax=this.DGVQd(country_code);
if(isNaN(tax))tax=0;
}
return tax;
}
this.computeTaxOfPrice=function(lgxXi)
{
if(this.KQLrv())
{
var n0=this.RWxKA()/100;
return lgxXi*(n0/(1+n0));
}
if(this.xsPvg())
{
return lgxXi*this.RWxKA()/100;
}
return lgxXi;
}
this.NguAW=function()
{
if(this.kfOWv())return 0;
var BgMXa=this.UmkhV()
var mGMgG=0;
var cHQmN=0;
for(var i=0;i<BgMXa.length;i++)
{
var qEvVY=BgMXa[i];
mGMgG+=(qEvVY.EBttn()*qEvVY.qXwBm);
}
mGMgG+=this.hkkdw();
cHQmN=this.pukVj(this.computeTaxOfPrice(mGMgG));
return cHQmN;
}
this.VvOht=function()
{
var lgxXi=0;
lgxXi+=this.NTjug()
if(this.xsPvg())lgxXi+=this.NguAW()
lgxXi+=this.hkkdw()
return lgxXi;
}
}
function nuulJ(WaxHR,ImksG)
{
if(WaxHR.lab<ImksG.lab) return-1;
if(WaxHR.lab>ImksG.lab) return 1;
return 0
}
function WA_marketWatchQuantity()
{
var vXCFB=WA_Dialog.getCurrent()
vXCFB.RMVaj()
}
function WA_displayDialogMarketCart()
{
var vXCFB=new WA_Dialog();
vXCFB.kbKhO=false;
vXCFB.anLeL=function()
{
this.pjqdZ()
this.kbKhO=setInterval("WA_marketWatchQuantity()",400)
}
vXCFB.pjqdZ=function()
{
if(this.kbKhO)clearInterval(this.kbKhO)
}
vXCFB.RMVaj=function()
{
var AqSlT=vNvvC();
var QNsZH=AqSlT.UmkhV();
for(var n=0;n<QNsZH.length;n++)
{
var qEvVY=QNsZH[n]
var eaHXw=document.getElementById("wa-cart-quantity-"+n)
var rVsWu=eaHXw.value
var lKesu=parseInt(rVsWu)
if(isNaN(lKesu))lKesu=0;
if((rVsWu!='')&&(lKesu+""!=rVsWu))
{
eaHXw.value=""+lKesu
}
if(lKesu!=qEvVY.qXwBm)
{
qEvVY.qXwBm=lKesu
AqSlT.RUZKV()
this.hJEmZ()
}
}
}
vXCFB.onCustomKeypress=function(RwtDp)
{
if(RwtDp==13)
{
wa_timeout(Delegate.create(this,this.CZrVe),0);
}
return false;
}
vXCFB.closeWin=function()
{
this.pjqdZ()
this.intern_closeWin()
}
vXCFB.hJEmZ=function()
{
var AqSlT=vNvvC();
var QNsZH=AqSlT.UmkhV();
if(QNsZH.length==0) return;
for(var n=0;n<QNsZH.length;n++)
{
var qEvVY=QNsZH[n]
var ujKjK=document.getElementById("wa-cart-total-"+n)
var lgxXi=qEvVY.EBttn() 
var jorjf=qEvVY.qXwBm*lgxXi
var ElVgm="<span style='"
ElVgm+=(jorjf>0)?"color:"+WA_GLOBAL_COLOR_THEME.color_text+";font-weight:normal;":"color:#ff0000;font-weight:bold;"
ElVgm+="'>"
ElVgm+=jorjf+" "+AqSlT.kJAdP()
ElVgm+="</span>"
ujKjK.innerHTML=ElVgm
}
var gREVh=AqSlT.NTjug()
var ZphDZ=AqSlT.NguAW()
var UhkRo=AqSlT.hkkdw()
var ROmeS=AqSlT.VvOht()
var SWIuQ=""
var ujKjK=document.getElementById("wa-cart-amount-total")
SWIuQ+=Translator.tr("Sub total")+" : "+AqSlT.qSJei(gREVh)
SWIuQ+="<br>"
if(UhkRo>0)
{
SWIuQ+="<span>"+Translator.tr("Shipping amount")+" : "+AqSlT.qSJei(UhkRo)+"</span>";
SWIuQ+="<br>"
}
if(AqSlT.KQLrv()||AqSlT.xsPvg())
{
if(AqSlT.KQLrv())
{
SWIuQ+="<div style='width:100%;text-align:left;'>"
SWIuQ+=Translator.tr("Tax included");
}
if(AqSlT.xsPvg())
{
SWIuQ+="<div>"
SWIuQ+=Translator.tr("Extra Tax");
}
SWIuQ+=" : ";
SWIuQ+=AqSlT.qSJei(ZphDZ)+"</div>";
}
SWIuQ+="<span><b>"+Translator.tr("Total")+" : "+AqSlT.qSJei(ROmeS)+"</b></span>";
ujKjK.innerHTML=SWIuQ
}
vXCFB.ucwka=function()
{
WA_displayDialogMarketCart()
}
vXCFB.BZEnj=function()
{
this.closeWin()
}
vXCFB.CZrVe=function()
{
var AqSlT=vNvvC();
if(WA_getNumberMarketItemsInCart()==0)return;
var rOYgF=document.getElementById("wa-market-select-country")
AqSlT.YPJlP.wPUsY=rOYgF.value
if(AqSlT.YPJlP.wPUsY=="")
{
var rOYgF=document.getElementById("wa-market-select-country")
if(rOYgF)
{
rOYgF.focus()
rOYgF.style.backgroundColor="#ff0000"
return;
}
}
if(CONST_WA_GLOBAL_SETTINGS.link_sale_condition)
{
if(AqSlT.YPJlP.rUTXe!=true)
{
var pvPli=document.getElementById("wa-sales-condition")
if(pvPli)
{
pvPli.focus()
var QhDSV=document.getElementById("wa-sales-condition-label")
QhDSV.style.backgroundColor="#ff0000"
return;
}
}
}
if(AqSlT.YPJlP.pZCXB=="")
{
var rOYgF=document.getElementById("wa-market-select-payment")
if(rOYgF)
{
}
rOYgF.focus()
rOYgF.style.backgroundColor="#ff0000"
return;
}
BQtCR()
}
vXCFB.mIScM=function()
{
WA_exec_callback_opera_compliant(this,this.MGdWe)
}
vXCFB.MGdWe=function()
{
var AqSlT=vNvvC();

var vFlVE=document.getElementById("wa-market-select-country")
AqSlT.YPJlP.wPUsY=vFlVE.value
AqSlT.YPJlP.CIgeb()
var LsYIc=html_getLayer("market-cart-content")
var GEtsa=html_getLayer("wa-market-payment-form") 
var ElVgm=""
var QNsZH=AqSlT.UmkhV();
html_SetVisibility(GEtsa,(QNsZH.length>0))
if(QNsZH.length==0)
{
ElVgm+="<span style='font-family:Arial;font-size:16px;'>"
ElVgm+=Translator.tr("No articles in Card !")
ElVgm+="</span>"
}
else
{
var YAdRM="border:1px solid "+WA_GLOBAL_COLOR_THEME.color0+";font-weight:normal;"
var lYncd="border:1px solid "+WA_GLOBAL_COLOR_THEME.color0+";color:#ff0000;font-weight:bold;"
var HRDHZ="color:#222222;font-size:12px;"
ElVgm+="<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+";'>"
ElVgm+="<thead style='font-size:13px;border:1px solid;'>"
ElVgm+="<tr>"
ElVgm+="<th  colspan=2 style='"+YAdRM+"'></th>" 
ElVgm+="<th style='"+YAdRM+"'  width=70px><b>"+Translator.tr("Price")+"</b></th>"
ElVgm+="<th style='"+YAdRM+"'  width=70px><b>"+Translator.tr("Quantity")+"</b></th>"
ElVgm+="<th style='"+YAdRM+"'  width=70px><b>"+Translator.tr("Total")+"</b></th>"
ElVgm+="<th style='"+YAdRM+"'  width=90px></th>"
ElVgm+="</tr>"
for(var n=0;n<QNsZH.length;n++)
{
var qEvVY=QNsZH[n]
ElVgm+="<tr>"
ElVgm+="<th style='"+YAdRM+"' >"
var xWpsN=wa_global_market.markets[qEvVY.FdunG]
var RZEtb=new Size(30,30)
var jHQWE=RZEtb
if(xWpsN.info.design.crop_thumb==false)
{
jHQWE=qEvVY.Fewbl.size_thumb.clone()
jHQWE.scale(RZEtb)
}
else
{
}
if(qEvVY.Fewbl.img_thumb.length>0)
ElVgm+="<img border=0 src='"+qEvVY.Fewbl.img_thumb+"' width="+jHQWE.width+"px height="+jHQWE.height+"px>"
ElVgm+="</th>"
ElVgm+="<th style='"+YAdRM+"text-align:left;padding:5px;background-color:"+WA_GLOBAL_COLOR_THEME.color1+";' >"
ElVgm+="<b>"+qEvVY.ZAVwM+"</b>"
if(qEvVY.wGLYV.length>0)
{
ElVgm+="<span style='"+HRDHZ+"'>";
ElVgm+=" ["+qEvVY.wGLYV+"]";
ElVgm+="</span>";
}
if(qEvVY.m_opt_vals)
{
ElVgm+="<br>"
ElVgm+="<span style='"+HRDHZ+"'>";
for(var i_opt=0;i_opt<qEvVY.Fewbl.options.length;i_opt++)
{
var ePcTf=qEvVY.Fewbl.options[i_opt]
if(ePcTf)
{
var dVqcg=qEvVY.m_opt_vals[i_opt];
var fqhmg=ePcTf.title;
if(fqhmg.length>0)
{
ElVgm+=fqhmg;
ElVgm+=":"
}
ElVgm+=ePcTf.vals[dVqcg];
ElVgm+=" "
}
}
ElVgm+="</span>";
}
ElVgm+="</th>"
var lgxXi=qEvVY.EBttn()
ElVgm+="<th style='"+YAdRM+"' >"+AqSlT.qSJei(lgxXi)+"</th>"
ElVgm+="<th style='"+YAdRM+"'  align=center><input type=text id='wa-cart-quantity-"+n+"' style='width:45px;' maxlength=3 value='"+qEvVY.qXwBm+"' type=text/></th>"
ElVgm+="<th style='"
var jorjf=qEvVY.qXwBm*lgxXi
ElVgm+=(jorjf>0)?YAdRM:lYncd;
ElVgm+="' ><span id='wa-cart-total-"+n+"'>"
ElVgm+=AqSlT.qSJei(jorjf)
ElVgm+="</span></th>"
ElVgm+="<th style='"+YAdRM+"' ><a href=\"javascript:WA_marketRemoveItem("+n+")\">"+Translator.tr("Remove card item")+"</a></th>"
ElVgm+="</tr>"
}
ElVgm+="<tr>"
ElVgm+="<th style='"+YAdRM+"text-align:right;padding:5px;' id='wa-cart-amount-total'  colspan=5>&nbsp;</th>"
ElVgm+="<th style='"+YAdRM+"' ></th>"
ElVgm+="</tr>"
ElVgm+="</thead>"
ElVgm+="</table>"
ElVgm+="<br>"
}
LsYIc.innerHTML=ElVgm
this.anLeL()
WA_exec_callback_opera_compliant(this,this.hJEmZ) 
}
vXCFB.dcVpL=function()
{
var AqSlT=vNvvC();
this.addButton(Translator.tr("Continue Shopping"),this.BZEnj,[""],this)
this.addButton(Translator.tr("Checkout order"),this.CZrVe,[""],this)
this.initializeWindow(670,700)
var qumKW="font-family:Arial;font-size:12px;color:#000000;"
var ElVgm=""
ElVgm+="<div id='market-cart-content' style='width:100%;"+qumKW+"' align=center>" 
ElVgm+="</div>"
ElVgm+="<br>"
ElVgm+="<div style='width:100%;"+qumKW+"' align=center id='wa-market-payment-form'>"
ElVgm+="<br>"
ElVgm+="<span style='font-weight:bold;'>"
ElVgm+=Translator.tr("Please choose a country to deliver your order")
ElVgm+="</span>"
ElVgm+="<br>"
ElVgm+="<select onchange=\"WA_marketChangeCountry(this)\" id='wa-market-select-country'>"
if(CONST_WA_GLOBAL_SETTINGS.default_selected_country.length==0)
{
ElVgm+="<option value=\"\">...</option>"
}
var ulAfx=CONST_WA_GLOBAL_SETTINGS.list_favorite_country
var KhxIk=CONST_WA_GLOBAL_SETTINGS.list_country 
var JebHV=new Array()
for(var akScx=0;akScx<ulAfx.length;akScx++)
{
var sjCNO=ulAfx[akScx]
JebHV.push({code:sjCNO,lab:Translator.country(sjCNO)})
}
for(var akScx=0;akScx<JebHV.length;akScx++)
{
var MHAJQ=JebHV[akScx]
var sjCNO=MHAJQ.code
ElVgm+="<option "
if(AqSlT.YPJlP.jcLuv()==sjCNO)ElVgm+="selected "
ElVgm+="value=\""+sjCNO+"\">"+Translator.country(sjCNO)+"</option>"
}
if((ulAfx.length>0)&&(KhxIk.length>0))
{
ElVgm+="<option value=\"\">-----</option>"
}
var TiWKd=new Array()
for(var akScx=0;akScx<KhxIk.length;akScx++)
{
var sjCNO=KhxIk[akScx]
TiWKd.push({code:sjCNO,lab:Translator.country(sjCNO)})
}
if((ulAfx.length==0)&&(KhxIk.length==0))
{
var BgMXa=CONST_WA_COUNTRIES.codes
for(var akScx=0;akScx<BgMXa.length;akScx++)
{
var sjCNO=BgMXa[akScx]
TiWKd.push({code:sjCNO,lab:Translator.country(sjCNO)})
}
}
TiWKd.sort(nuulJ)
for(var akScx=0;akScx<TiWKd.length;akScx++)
{
var MHAJQ=TiWKd[akScx]
var sjCNO=MHAJQ.code
ElVgm+="<option "
if(AqSlT.YPJlP.jcLuv()==sjCNO)ElVgm+="selected "
ElVgm+="value=\""+sjCNO+"\">"+Translator.country(sjCNO)+"</option>"
}
ElVgm+="</select>"
ElVgm+="<br>"
ElVgm+="<br>"
if(CONST_WA_GLOBAL_SETTINGS.link_sale_condition)
{
ElVgm+="<a "+WA_LinkToHref(CONST_WA_GLOBAL_SETTINGS.link_sale_condition)+" style='color:#0000ff'>"
ElVgm+=Translator.tr("Terms of sell")
ElVgm+="</a>"
ElVgm+="<br>" 
ElVgm+="<span id='wa-sales-condition-label'  style='font-weight:bold;'>"
ElVgm+=Translator.tr("label_market_accept_terms")
ElVgm+="</span>"
ElVgm+="<input id='wa-sales-condition' onchange=\"WA_marketChangeSalesCondition(this)\" "
ElVgm+=(AqSlT.YPJlP.rUTXe)?"checked ":""
ElVgm+="type='checkbox' value='1'/>" 
ElVgm+="<br>"
ElVgm+="<br>"
}
ElVgm+="<span style='font-weight:bold;'>"
ElVgm+=Translator.tr("Choose a type of payment")
ElVgm+="</span>"
ElVgm+="<br>"
ElVgm+="<select onchange=\"WA_marketChangeTypePayment(this)\" id='wa-market-select-payment'>"
ElVgm+="<option value=\"\">...</option>"
var RZtDH=CONST_WA_GLOBAL_SETTINGS.list_type_payment
for(var akScx=0;akScx<RZtDH.length;akScx++)
{
var pZCXB=RZtDH[akScx]
ElVgm+="<option "
if(AqSlT.YPJlP.pZCXB==pZCXB)ElVgm+="selected "
ElVgm+="value=\""+pZCXB+"\">"+Translator.tr("label_market_"+pZCXB)+"</option>"
}
ElVgm+="</select>"
ElVgm+="</div>"
this.writeContent(ElVgm)
var LsYIc=html_getLayer("market-cart-content")
LsYIc.innerHTML="<div width=100% align=center><img src='wa_loading.gif'></div>" 

AqSlT.YgGbi(this,this.mIScM)
}
vXCFB.dcVpL() 
}
function WA_marketChangeCountry(rOYgF)
{
rOYgF.style.backgroundColor=""
var vXCFB=WA_Dialog.getCurrent()
vXCFB.mIScM()
}
function WA_marketChangeTypePayment(rOYgF)
{
var AqSlT=vNvvC();
AqSlT.YPJlP.pZCXB=rOYgF.value
AqSlT.YPJlP.CIgeb()
rOYgF.style.backgroundColor=""
}
function WA_marketChangeSalesCondition(Fulhf)
{
var AqSlT=vNvvC();
AqSlT.YPJlP.rUTXe=Fulhf.checked
AqSlT.YPJlP.CIgeb() 
var QhDSV=document.getElementById("wa-sales-condition-label")
QhDSV.style.backgroundColor="" 
}
function WA_LinkToHref(eYnHO)
{
var ElVgm=""
var RUTcK=eYnHO.url
var vrGgk=Translator.m_lang_for_filename
if(vrGgk.length>0)vrGgk="_"+vrGgk
RUTcK=RUTcK.replace(/@lng@/g,vrGgk)
ElVgm+="href=\""+RUTcK+"\" "
if(eYnHO.open==1)
{
ElVgm+="target="
ElVgm+="_blank"
}
return ElVgm;
}
function WA_displayDialogMarketProduct(FZEHr,qaVaF)
{
var aChkJ=wa_global_market.markets[FZEHr]
var PXSgb=aChkJ.obj
var EhvPY=PXSgb.info.products
var Fewbl=EhvPY[qaVaF] 

var vXCFB=new WA_Dialog();

vXCFB.Fewbl=Fewbl
vXCFB.ZVqPU=FZEHr
vXCFB.ucwka=function()
{
WA_displayDialogMarketCart()
}
vXCFB.DWtKl=function()
{
var AqSlT=vNvvC();
AqSlT.YgGbi(this,this.MeMBP) 
}
vXCFB.MeMBP=function()
{
var Fewbl=this.Fewbl;
var AqSlT=vNvvC();
var uTOPQ=new Array();
var AOxQJ=Fewbl.obj.id;
for(var i=0;i<3;i++)
{
var fSgRR=-1;
var jYAlK=AOxQJ+"-select-opt"
var rOYgF=document.getElementById(jYAlK+i)
if(rOYgF)
{
if(rOYgF.value.length==0)
{
rOYgF.style.backgroundColor="#ff0000";
rOYgF.focus()
return;
}
fSgRR=parseInt(rOYgF.value)
}
uTOPQ.push(fSgRR)
}
if(AqSlT.addProductToShoppingCard(Fewbl,uTOPQ))
{
AqSlT.RUZKV()
WA_displayDialogMarketCart()
}
}
vXCFB.dcVpL=function()
{
var FZEHr=this.ZVqPU
var Fewbl=this.Fewbl
var ElVgm=""
this.addButton(Translator.tr("Go to my card"),this.ucwka,[""],this)
if(Fewbl.unavail==false)
{
this.addButton(Translator.tr("Add to card"),this.DWtKl,[""],this)
}
this.initializeWindow(670,this.idealHeight())
ElVgm+="<table border=0 width=100% cellpadding=4>"
ElVgm+="<tr>" 
if(Fewbl.img_big.length>0)
{
ElVgm+="<td width='100px' align=center valign=top>"
var jHQWE=Fewbl.size_thumb.clone() 
jHQWE.scale(new Size(200,200))
ElVgm+="<a href=\""+Fewbl.img_big+"\" target=_blank>"
ElVgm+="<img border=0 src=\""+Fewbl.img_big+"\" width='"+jHQWE.width+"px' height='"+jHQWE.height+"px'>"
ElVgm+="</a>"
ElVgm+="</td>"
}
var JYUcE="color:"+WA_GLOBAL_COLOR_THEME.color_text+";";
ElVgm+="<td valign=top style='font-family:Arial;'>"
ElVgm+="<span style='font-weight:bold;font-size:16px;"+JYUcE+"'>"
ElVgm+=Fewbl.title
ElVgm+="</span>"
ElVgm+="<br>"
if(Fewbl.sub_title.length>0)
{
ElVgm+="<span style='color:#333333;font-size:14px;'>"
ElVgm+=Fewbl.sub_title
ElVgm+="</span>"
ElVgm+="<br>"
}
ElVgm+="<br>"
ElVgm+="<table border=0 width=100% cellspacing=0 cellpadding=0><tr><td>"
ElVgm+="<span style='"+JYUcE+";font-size:14px;'>"
ElVgm+=Translator.tr("Price")+" : "
ElVgm+="</span>"
ElVgm+="<span style='"+JYUcE+";font-size:18px;font-weight:bold;' id='"+Fewbl.obj.id+"-price'>"
if(Fewbl.unavail)
{
ElVgm+=Translator.tr("Unavailable")
}
ElVgm+="</span>"
if(Fewbl.more_info)
{
ElVgm+="</td><td align=right>"
var eYnHO=Fewbl.more_info
var AFpqE=WA_LinkToHref(eYnHO)
ElVgm+="<a "+AFpqE+" style='font-family:Arial;text-decoration:underline;font-weight:bold;font-size:12px;color:0000ff;'>"+Translator.tr("More product info link")+"</a>"
}
ElVgm+="</td></tr></table>"
ElVgm+="<br>"
var uKtXc=Fewbl.obj.index
if(Fewbl.unavail==false)
if(Fewbl.options.length>0)
{
ElVgm+="<table border=0 cellspacing=0 cellpadding=0>"
for(var n=0;n<Fewbl.options.length;n++)
{
var ePcTf=Fewbl.options[n]
if(ePcTf)
{
ElVgm+="<tr><td align=right>"
ElVgm+="<span style='font-family:Arial;font-weight:bold;font-size:12px;"+JYUcE+"'>"
ElVgm+=ePcTf.title+" :&nbsp;"
ElVgm+="</span>"
ElVgm+="</td><td align=left>"
ElVgm+="<select id='"+Fewbl.obj.id+"-select-opt"+n+"' onchange=\"WA_market_changeCustomPrice('"+FZEHr+"',"+uKtXc+")\">"
ElVgm+="<option value=\"\">...</option>"
for(var akScx=0;akScx<ePcTf.vals.length;akScx++)
{
var AEpnQ=ePcTf.vals[akScx]
ElVgm+="<option value=\""+akScx+"\">"+AEpnQ+"</option>"
}
ElVgm+="</select>"
ElVgm+="</td></tr>";
}
}
ElVgm+="</table>"
}
ElVgm+="</td>"
ElVgm+="</tr>"
ElVgm+="</table>"
if(Fewbl.description.length>0)
{
ElVgm+="<table border=0 width=100% cellpadding=4>"
ElVgm+="<tr><td colspan=2>"
ElVgm+="<span style='font-family:Arial;font-size:13px;"+JYUcE+"'>"
ElVgm+="<hr>"
ElVgm+=Fewbl.description
ElVgm+="</span>"
ElVgm+="</td></tr>"
ElVgm+="</table>"
}
this.writeContent(ElVgm)
WA_market_changeCustomPrice(FZEHr,uKtXc)
}
vXCFB.displayWindowWithAutoResize(300,vXCFB.dcVpL) 
}
function psDWa(Fewbl,AOxQJ)
{
var XTdZD=new Array()
for(var i=0;i<3;i++)
{
var jYAlK=AOxQJ+"-select-opt"
var rOYgF=document.getElementById(jYAlK+i)
XTdZD[i]=-1
if(rOYgF)
{
rOYgF.style.backgroundColor="";
var AEpnQ=parseInt(rOYgF.value)
if(isNaN(AEpnQ)==false)
XTdZD[i]=AEpnQ
}
}
return GhpcC(Fewbl,XTdZD)
}
function GhpcC(Fewbl,XTdZD)
{
if(Fewbl.unavail)return;
var RfZQK=false;
for(var i=0;i<Fewbl.custom_prices.length;i++)
{
var kjoPu=Fewbl.custom_prices[i]
var DGakU=true;
for(var n=0;n<3;n++)
{
if(kjoPu.tab[n]!=XTdZD[n])DGakU=false
}
if(DGakU)
{
RfZQK=kjoPu;
break;
}
}
var lgxXi=Fewbl.price
if(RfZQK)
{
lgxXi=RfZQK.pr
}
return lgxXi;
}
function WA_market_changeCustomPrice(FZEHr,uKtXc)
{
var AqSlT=vNvvC();
var aChkJ=wa_global_market.markets[FZEHr]
var EhvPY=aChkJ.info.products;
var Fewbl=EhvPY[uKtXc]
if(Fewbl.unavail)return;
var AOxQJ=Fewbl.obj.id
var lgxXi=psDWa(Fewbl,AOxQJ)
var weGtP=html_getLayer(AOxQJ+"-price")
if(weGtP)
{
weGtP.innerHTML=AqSlT.qSJei(lgxXi)
}
}
function BQtCR()
{
var AqSlT=vNvvC();
if(WA_getNumberMarketItemsInCart()==0)return;
var qEvVY=AqSlT.YPJlP
if(qEvVY.pZCXB=="paypal")
{
XeDNq();
return;
}
JkkTB(xsOBQ)
}
function JkkTB(hnqjF)
{
var AqSlT=vNvvC();
var qEvVY=AqSlT.YPJlP
qEvVY.xIHGU()
var vXCFB=new WA_Dialog();
vXCFB.hnqjF=hnqjF
vXCFB.EkmVe=function(RwtDp)
{
return Translator.tr("form-label-"+RwtDp)
}
vXCFB.onCustomKeypress=function(RwtDp)
{
if(RwtDp==13)
{
wa_timeout(Delegate.create(this,this.peWaW),0);
}
return false;
}
vXCFB.fHAVk=function()
{


if(this.hnqjF==xsOBQ)
{
WA_displayDialogMarketCart()
}
else
{
JkkTB(xsOBQ)
}
}
vXCFB.OjiII=function()
{
XeDNq()
}
vXCFB.peWaW=function()
{
var AqSlT=vNvvC();
var qEvVY=AqSlT.YPJlP
if(qEvVY.nisNn(this.hnqjF)==false) return;
qEvVY.CIgeb()
if(this.hnqjF==xsOBQ)
{
if(qEvVY.WeCJG==true)
{
JkkTB(utKVY)
}
else
{
this.OjiII()
}
}
else
{
this.OjiII()
}
}
vXCFB.rEroM=function(RwtDp,dwKlO)
{
if(dwKlO==undefined) dwKlO=""
if(dwKlO)dwKlO=" size="+dwKlO
return "<input name='"+RwtDp+"' value=\""+qEvVY.lsisY(RwtDp,this.hnqjF)+"\" type=text "+dwKlO+">"
}
vXCFB.DIoZB=function(rGloh)
{
return "<td width=100px align=right valign=top>"+Translator.tr(rGloh)+" :</td>"
}
vXCFB.dcVpL=function()
{
var AqSlT=vNvvC();
var qEvVY=AqSlT.YPJlP
this.addButton("< "+Translator.tr('Back'),this.fHAVk,[""],this)
this.addButton(Translator.tr('Continue')+" >",this.peWaW,[""],this)
this.initializeWindow(550,600)
var UPuUY="form-label-"
var ojLdJ=CONST_WA_GLOBAL_SETTINGS.list_form_fields 
var ElVgm=""
ElVgm+="<form id='wa-market-form' onSubmit='return false'>"
ElVgm+="<table border=0 width=100% cellspacing=5 style='font-family:Arial;font-size:15px;'>"
ElVgm+="<tr><td colspan=2 align=center style='font-size:18px;'>"
ElVgm+=Translator.tr((this.hnqjF==xsOBQ)?"Fill Deliver information below":"Fill Billing information below")
ElVgm+="<br><br></td></tr>"
for(var n=0;n<ojLdJ.length;n++)
{
var lUXFI=ojLdJ[n]
if(lUXFI=="address")
{
ElVgm+="<tr>"+this.DIoZB("Address");
ElVgm+="<td>"
ElVgm+=this.rEroM("address_1",30)
ElVgm+="</td></tr>"
ElVgm+="<tr><td></td><td>"
ElVgm+=this.rEroM("address_2",30)
ElVgm+="</td></tr>"
ElVgm+="<tr>"+this.DIoZB("form-label-city");
ElVgm+="<td>"
ElVgm+=this.rEroM("city")+"&nbsp;"+this.EkmVe("zip")+" : "+this.rEroM("zip",10)
ElVgm+="</td></tr>"
ElVgm+="<tr>"+this.DIoZB("form-label-country");
ElVgm+="<td>"
if(this.hnqjF==utKVY)
{
ElVgm+="<select id='wa-select-form-country' onchange='WA_marketChangeFormCountry("+this.hnqjF+")'>"
var TiWKd=new Array();
var BgMXa=CONST_WA_COUNTRIES.codes
for(var akScx=0;akScx<BgMXa.length;akScx++)
{
var sjCNO=BgMXa[akScx]
TiWKd.push({code:sjCNO,lab:Translator.country(sjCNO)})
}
TiWKd.sort(nuulJ)
var pPaeT=qEvVY.jcLuv()
pPaeT=qEvVY.lsisY('countryCode',this.hnqjF,pPaeT)
for(var akScx=0;akScx<TiWKd.length;akScx++)
{
var MHAJQ=TiWKd[akScx]
var sjCNO=MHAJQ.code
ElVgm+="<option "
if(pPaeT==sjCNO)ElVgm+="selected "
ElVgm+="value=\""+sjCNO+"\">"+Translator.country(sjCNO)+"</option>"
}
ElVgm+="</select>"
}
else
{
ElVgm+=Translator.country(AqSlT.YPJlP.wPUsY);
}
ElVgm+="<br><span id='wa-market-state'>"
ElVgm+="<select id='wa-select-state'></select>"
ElVgm+="</span>" 
ElVgm+="</td></tr>"
}
else
{
ElVgm+="<tr>"+this.DIoZB("form-label-"+lUXFI);
ElVgm+="<td>"
ElVgm+=this.rEroM(lUXFI,30) 
ElVgm+="</td></tr>"
}
}
if(this.hnqjF==xsOBQ)
{
ElVgm+="<tr><td colspan=2 align=center >"
ElVgm+=Translator.tr("Billing adress is different")+" <input type=checkbox "
if(AqSlT.YPJlP.WeCJG)ElVgm+="checked "
ElVgm+="onchange='WA_marketCheckBillingAdress(this)'>"
ElVgm+="</td></tr>"
}
ElVgm+="</table>"
ElVgm+="</form>"
this.writeContent(ElVgm)
WA_exec_callback_opera_compliant(this,this.niFXs) 
}
vXCFB.niFXs=function()
{
WA_marketChangeFormCountry(this.hnqjF)
}
vXCFB.dcVpL()
}
function nGPcp(hnqjF,rOYgF,XbWlv)
{
var AqSlT=vNvvC();
var qEvVY=AqSlT.YPJlP
var ZxmOF=qEvVY.lsisY("stateCode",hnqjF) 
rOYgF.options.length=0
for(var n=0;n<XbWlv.length;n++)
{
var val=XbWlv[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==ZxmOF)elOptNew.selected=true
try{
rOYgF.add(elOptNew,null);
}
catch(ex){
rOYgF.add(elOptNew);
}
}
}
function WA_marketChangeFormCountry(hnqjF)
{
var AqSlT=vNvvC();
var qEvVY=AqSlT.YPJlP
var NWKdm=qEvVY.wPUsY
var rOYgF=document.getElementById("wa-select-form-country");
if(rOYgF) NWKdm=rOYgF.value;
html_SetDisplay("wa-market-state",(NWKdm=="US")||(NWKdm=="CA"))
var fwSih=document.getElementById("wa-select-state");
if(fwSih)
{
if(NWKdm=="US") nGPcp(hnqjF,fwSih,["","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(NWKdm=="CA") nGPcp(hnqjF,fwSih,["","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(Fulhf)
{
var AqSlT=vNvvC();
var qEvVY=AqSlT.YPJlP
qEvVY.WeCJG=Fulhf.checked
qEvVY.CIgeb()
}
function XeDNq()
{
var AqSlT=vNvvC();
var qEvVY=AqSlT.YPJlP
var PlISb=CONST_WA_GLOBAL_SETTINGS.currency_info 

var vXCFB=new WA_Dialog();
vXCFB.fHAVk=function()
{
if(this.qEvVY.pZCXB=="paypal")
{
WA_displayDialogMarketCart();return;
}
if(this.qEvVY.WeCJG)
JkkTB(utKVY)
else
JkkTB(xsOBQ)
}
vXCFB.cXLXt=function(tunXo,AEpnQ)
{
AEpnQ=""+AEpnQ
AEpnQ=AEpnQ.replace(/'/g,"&lsquo;")
return "<input type=hidden name='"+tunXo+"' value=\""+AEpnQ+"\">"
}
vXCFB.kACSb=function()
{
var ElVgm=""
if(PlISb.charCodeAt(3)>=100) return""
ElVgm+="<form id='wa-http-sender' method=POST action='https://www.paypal.com/cgi-bin/webscr' target='_blank'>"
ElVgm+=this.cXLXt("cmd","_cart")
ElVgm+=this.cXLXt("business",CONST_WA_GLOBAL_SETTINGS.email_paypal_account)
ElVgm+=this.cXLXt("upload","1")
ElVgm+=this.cXLXt("charset","utf-8")
ElVgm+=this.cXLXt("no_note","0")
ElVgm+=this.cXLXt("currency_code",CONST_WA_GLOBAL_SETTINGS.currency_code)
ElVgm+=this.cXLXt("no_shipping","2")
var vWTbZ=AqSlT.UmkhV()
for(var i=0;i<vWTbZ.length;i++)
{
var info=vWTbZ[i];
var index=i+1;
var CShaE=info.EBttn();
if(AqSlT.KQLrv())
{
var vIoTj=AqSlT.pukVj(AqSlT._computeTaxOfPrice(CShaE));
CShaE=CShaE-vIoTj;
}
ElVgm+=this.cXLXt("amount_"+index,""+CShaE)
ElVgm+=this.cXLXt("quantity_"+index,info.qXwBm)
var QVtZH=0;
if(info.wGLYV.length>0)
{
ElVgm+=this.cXLXt("on"+QVtZH+"_"+index,"ref")
ElVgm+=this.cXLXt("os"+QVtZH+"_"+index,info.wGLYV)
QVtZH++;
}
var MGdtT=""
if(info.m_opt_vals)
{
for(var i_opt=0;i_opt<info.Fewbl.options.length;i_opt++)
{
var ePcTf=info.Fewbl.options[i_opt]
if(ePcTf)
{
var dVqcg=info.m_opt_vals[i_opt];
var dGwHF=ePcTf.vals[dVqcg]
var fqhmg=ePcTf.title;
if(fqhmg.length==0) fqhmg="opt"+(i_opt+1);
ElVgm+=this.cXLXt("on"+QVtZH+"_"+index,fqhmg)
ElVgm+=this.cXLXt("os"+QVtZH+"_"+index,dGwHF)
if(MGdtT.length>0)MGdtT=MGdtT+", "
MGdtT+=dGwHF
QVtZH++;
}
}
}
var HQjsG=info.ZAVwM;
if(MGdtT.length>0)HQjsG=HQjsG+"("+MGdtT+")"
ElVgm+=this.cXLXt("item_name_"+index,HQjsG) 
}
var qoHUj=AqSlT.hkkdw()
if(AqSlT.KQLrv())
{
qoHUj=qoHUj-AqSlT.pukVj(AqSlT._computeTaxOfPrice(qoHUj));
}
if(AqSlT.KQLrv())
{
var rhDZW=AqSlT.NTjug();
var NITJB=AqSlT.hkkdw()
var mGMgG=rhDZW+NITJB;
var HXkMh=AqSlT.pukVj(AqSlT._computeTaxOfPrice(mGMgG));
var uNgbs=mGMgG-HXkMh;
uNgbs=uNgbs-qoHUj;
var jWsPN=0;
for(var i=0;i<vWTbZ.length;i++)
{
var info=vWTbZ[i];
var index=i+1;
var AgLSu=0;
var OqQaT=0;
var CShaE=info.qXwBm*info.EBttn();
var n0=AqSlT.RWxKA()/100;
var tax=CShaE*(n0/(1+n0));
CShaE=CShaE-tax;
AgLSu=CShaE;
var vvURw=info.EBttn();
var vIoTj=AqSlT.pukVj(AqSlT._computeTaxOfPrice(vvURw));
vvURw=vvURw-vIoTj;
OqQaT=info.qXwBm*vvURw;
if(OqQaT>AgLSu)
{
vvURw=info.m_price;
vvURw=vvURw-vIoTj;
var boncq=vvURw;
if((boncq>0)&&(boncq!=info.EBttn()))
{
boncq=boncq-0.01;
}
ElVgm+=this.cXLXt("amount_"+index,boncq) 
OqQaT=info.m_quantity*boncq;
}
jWsPN+=OqQaT;
}
var cXHsq=AqSlT.pukVj(uNgbs-jWsPN);
if(cXHsq>0)
{
var index=vWTbZ.length+1;
ElVgm+=this.cXLXt("item_name_"+index,Translator.tr("TVA correction"))
ElVgm+=this.cXLXt("quantity_"+index,1)
ElVgm+=this.cXLXt("amount_"+index,cXHsq)
}
ElVgm+=this.cXLXt("tax_cart",HXkMh)
}
else
{
ElVgm+=this.cXLXt("tax_cart",AqSlT.NguAW())
}
ElVgm+=this.cXLXt("handling_cart",qoHUj) 
ElVgm+="</form>"
return ElVgm;
}
vXCFB.iHYsi=function()
{
var CUZCu=this.mLuWS(xsOBQ);
var ElVgm="";
if(CUZCu.length>0)
{
ElVgm+=""+Translator.tr("Shipping information")+":\n";
ElVgm+=CUZCu;
}
return ElVgm;
}
vXCFB.owPDK=function()
{
var CUZCu=this.mLuWS(utKVY);
var ElVgm="";
if(CUZCu.length>0)
{
ElVgm+=Translator.tr("Billing information")+":\n";
ElVgm+=CUZCu;
}
return ElVgm;
}
vXCFB.mLuWS=function(hnqjF)
{
var AqSlT=vNvvC();
var ElVgm="";
var ZHTBi=new Array();
var ojLdJ=JrPZQ(CONST_WA_GLOBAL_SETTINGS.list_form_fields)
ojLdJ.push("country")
ojLdJ.push("state")
for(var i=0;i<ojLdJ.length;i++)
{
var QEGpS=ojLdJ[i];
ZHTBi[QEGpS]=this.qEvVY.lsisY(QEGpS,hnqjF)
}
if(ZHTBi["firstname"])ElVgm+=ZHTBi["firstname"]+"\n"
if(ZHTBi["lastname"])ElVgm+=ZHTBi["lastname"]+"\n"
if(ZHTBi["company"])
{
ElVgm+=Translator.tr("form-label-company")+" : "+ZHTBi["company"]+"\n"
}
if(ZHTBi["address_1"]) ElVgm+=ZHTBi["address_1"]+"\n"
if(ZHTBi["address_2"]) ElVgm+=ZHTBi["address_2"]+"\n"
if(ZHTBi["zip"]) ElVgm+=ZHTBi["zip"]+" "
if(ZHTBi["city"]) ElVgm+=ZHTBi["city"]+"\n"
if(ZHTBi["country"])ElVgm+=Translator.country(ZHTBi["country"])
if(ZHTBi["state"]&&ZHTBi["state"].length>0) ElVgm+=" "+ZHTBi["state"];
ElVgm+="\n"
if(ZHTBi["phone"]) ElVgm+=Translator.tr("form-label-phone")+" : "+ZHTBi["phone"]+"\n"
if(ZHTBi["fax"]) ElVgm+=Translator.tr("form-label-fax")+" : "+ZHTBi["fax"]+"\n"
if(ZHTBi["email"]) ElVgm+=ZHTBi["email"]+"\n"
if(ZHTBi["comment"])
{
ElVgm+=Translator.tr("form-label-comment")+" : \n";
ElVgm+=ZHTBi["comment"]+"\n"
}
return ElVgm;
}
vXCFB.hJFNi=function()
{
var AqSlT=vNvvC();
var ElVgm="";
var vWTbZ=AqSlT.UmkhV();
ElVgm+="**************\n"
for(var i=0;i<vWTbZ.length;i++)
{
var qEvVY=vWTbZ[i];
var index=i+1;
var HQjsG=qEvVY.ZAVwM;
if(qEvVY.wGLYV.length>0)
{
HQjsG+=" ["+qEvVY.wGLYV+"]";
}
var MGdtT=""
if(qEvVY.m_opt_vals)
{
for(var i_opt=0;i_opt<qEvVY.Fewbl.options.length;i_opt++)
{
var ePcTf=qEvVY.Fewbl.options[i_opt]
if(ePcTf)
{
if(MGdtT.length>0)MGdtT=MGdtT+", "
var dVqcg=qEvVY.m_opt_vals[i_opt];
var dGwHF=ePcTf.vals[dVqcg]
var fqhmg=ePcTf.title;
if(fqhmg.length>0) MGdtT+=fqhmg+" : "
MGdtT+=dGwHF
}
}
}
if(MGdtT.length>0)HQjsG=HQjsG+"\n("+MGdtT+")"
ElVgm+=HQjsG;
ElVgm+="\n"
ElVgm+=Translator.tr("Price")+" : "+AqSlT.qSJei(qEvVY.EBttn())+"\n"
ElVgm+=Translator.tr("Quantity")+" : "+qEvVY.qXwBm+"\n"
ElVgm+=Translator.tr("Total")+" : "+AqSlT.qSJei(qEvVY.EBttn()*qEvVY.qXwBm);
ElVgm+="\n"
ElVgm+="**************\n"
}
var gREVh=AqSlT.NTjug()
var ZphDZ=AqSlT.NguAW()
var UhkRo=AqSlT.hkkdw()
var ROmeS=AqSlT.VvOht() 
ElVgm+=Translator.tr("Sub total")+" : "+AqSlT.qSJei(gREVh)+"\n";
if(CONST_WA_GLOBAL_SETTINGS.shipping_type!=nPJTw)
{
ElVgm+=Translator.tr("Shipping amount")+" : "+AqSlT.qSJei(UhkRo)+"\n";
}
if(AqSlT.KQLrv()||AqSlT.xsPvg())
{
if(AqSlT.KQLrv())
{
ElVgm+=Translator.tr("Tax included");
}
if(AqSlT.xsPvg())
{
ElVgm+=Translator.tr("Extra Tax");
}
ElVgm+=" : ";
ElVgm+=AqSlT.qSJei(ZphDZ)+"\n";
}
ElVgm+=Translator.tr("Total")+" : "+AqSlT.qSJei(ROmeS)+"\n";
return ElVgm;
}
vXCFB.PjGfp=function()
{
var AqSlT=vNvvC();
var ElVgm="";
var vWTbZ=AqSlT.UmkhV()
ElVgm+="<table border=1 style=\"width:100%;text-align: left; margin-left: auto; margin-right: auto;\" cellpadding=2 cellspacing=2>"
ElVgm+="<tr class=\"crbst-table-title\">"
ElVgm+="<td>&nbsp;</td>"
ElVgm+="<td>"+Translator.tr("Price")+"</td>"
ElVgm+="<td>"+Translator.tr("Quantity")+"</td>"
ElVgm+="<td>"+Translator.tr("Total")+"</td>"
ElVgm+="</tr>"
for(var i=0;i<vWTbZ.length;i++)
{
ElVgm+="<tr>"
var qEvVY=vWTbZ[i];
var index=i+1;
ElVgm+="<td>"
var HQjsG=qEvVY.ZAVwM;
if(qEvVY.wGLYV.length>0)
{
HQjsG+=" ["+qEvVY.wGLYV+"]";
}
HQjsG="<b>"+HQjsG+"</b>"
var MGdtT=""
if(qEvVY.m_opt_vals)
{
for(var i_opt=0;i_opt<qEvVY.Fewbl.options.length;i_opt++)
{
var ePcTf=qEvVY.Fewbl.options[i_opt]
if(ePcTf)
{
if(MGdtT.length>0)MGdtT=MGdtT+", "
var dVqcg=qEvVY.m_opt_vals[i_opt];
var dGwHF=ePcTf.vals[dVqcg]
var fqhmg=ePcTf.title;
if(fqhmg.length>0) MGdtT+=fqhmg+" : "
MGdtT+=dGwHF
}
}
}
if(MGdtT.length>0)HQjsG=HQjsG+"<br><span style='font-size:10px;'>("+MGdtT+")</span>"
ElVgm+=HQjsG;
ElVgm+="</td>"
ElVgm+="<td>"+AqSlT.qSJei(qEvVY.EBttn())+"</td>"
ElVgm+="<td>"+qEvVY.qXwBm+"</td>"
ElVgm+="<td>"+AqSlT.qSJei(qEvVY.EBttn()*qEvVY.qXwBm)+"</td>"
ElVgm+="</tr>"
}
ElVgm+="<tr><td colspan=4>"
var gREVh=AqSlT.NTjug()
var ZphDZ=AqSlT.NguAW()
var UhkRo=AqSlT.hkkdw()
var ROmeS=AqSlT.VvOht() 
ElVgm+="<table border=0 width=100%>"
ElVgm+="<tr><td align=right >"+Translator.tr("Sub total")+" : "+AqSlT.qSJei(gREVh)+"</td></tr>";
if(CONST_WA_GLOBAL_SETTINGS.shipping_type!=nPJTw)
{
ElVgm+="<tr><td align=right>"+Translator.tr("Shipping amount")+" : "+AqSlT.qSJei(UhkRo)+"</td></tr>";
}
if(AqSlT.KQLrv()||AqSlT.xsPvg())
{
if(AqSlT.KQLrv())
{
ElVgm+="<tr><td align=left >"+Translator.tr("Tax included");
}
if(AqSlT.xsPvg())
{
ElVgm+="<tr><td align=right >"+Translator.tr("Extra Tax");
}
ElVgm+=" : ";
ElVgm+=AqSlT.qSJei(ZphDZ)+"</td></tr>";
}
ElVgm+="<tr><td align=right class=\"crbst-card-total\">"+Translator.tr("Total")+" : "+AqSlT.qSJei(ROmeS)+"</td></tr>";
ElVgm+="</table>" 
ElVgm+="</td></tr>"
ElVgm+="</table>"
ElVgm=ElVgm.replace(/\"/g,"'")
return ElVgm;
}
vXCFB.pQFva=function(AEpnQ)
{
if((""+AEpnQ).length==1)AEpnQ="0"+AEpnQ;
return AEpnQ
}
vXCFB.ZJdul=function()
{
var AqSlT=vNvvC();
var ElVgm=""
if(PlISb.charCodeAt(3)>=100) return""
if(WOXAd)
{
ElVgm+="<form id='wa-http-sender' method=POST action='"+WOXAd_URL+"crbst_market_print_form.php' target='_blank'>"
}
else
{
ElVgm+="<form id='wa-http-sender' method=POST action='crbst_market_print_form.php' target='_blank'>"
}
ElVgm+=this.cXLXt("type_payment",this.qEvVY.pZCXB)
ElVgm+=this.cXLXt("MAIL_TITLE_PREFIXE",Translator.tr("title email Order notification"))
ElVgm+=this.cXLXt("MAIN_TITLE",Translator.tr("PRINT_FORM_MAIN_TITLE"))
ElVgm+=this.cXLXt("PREFIXE_ORDER",Translator.tr("PRINT_FORM_PREFIXE_ORDER"))
var OqVZC=""
var RoXpW=new Date()
OqVZC+="wa-"+this.pQFva(RoXpW.getYear()-100)+this.pQFva(RoXpW.getMonth()+1)+this.pQFva(RoXpW.getDate())
OqVZC+=RoXpW.getHours()+this.pQFva(RoXpW.getMinutes())+this.pQFva(RoXpW.getSeconds())
OqVZC+="-"+Math.round(Math.random()*100) 
ElVgm+=this.cXLXt("ID_ORDER",OqVZC)
ElVgm+=this.cXLXt("CARD_TITLE",Translator.tr("PRINT_FORM_CARD_TITLE"))
ElVgm+=this.cXLXt("LABEL_TYPE_PAYMENT",Translator.tr("PRINT_FORM_LABEL_TYPE_PAYMENT"))
ElVgm+=this.cXLXt("send_copy_email_to_buyer",(AqSlT.send_copy_email_to_buyer)?"1":"0") 
ElVgm+=this.cXLXt("email_buyer",this.qEvVY.lsisY("email",xsOBQ))
if(this.qEvVY.pZCXB=="check")
{
ElVgm+=this.cXLXt("TYPE_PAYMENT",Translator.tr("PRINT_FORM_TYPE_CHECK"))
ElVgm+=this.cXLXt("MESSAGE_CHECK",Translator.tr("PRINT_FORM_MESSAGE_CHECK"))
}
if(this.qEvVY.pZCXB=="wire")
{
ElVgm+=this.cXLXt("TYPE_PAYMENT",Translator.tr("PRINT_FORM_TYPE_WIRE"))
ElVgm+=this.cXLXt("MESSAGE_CHECK",Translator.tr("PRINT_FORM_MESSAGE_WIRE"))
}
ElVgm+=this.cXLXt("LABEL_PRINT",Translator.tr("PRINT_FORM_LABEL_PRINT"))
ElVgm+=this.cXLXt("card_html",this.PjGfp())
ElVgm+=this.cXLXt("card_plain_text",this.hJFNi())
ElVgm+=this.cXLXt("LABEL_SELLER_INFORMATION",Translator.tr("Seller information"))
ElVgm+=this.cXLXt("LABEL_BANK_ACCOUNT",Translator.tr("Bank account information"))
ElVgm+=this.cXLXt("LABEL_ADDRESS",Translator.tr("Address"))
ElVgm+=this.cXLXt("seller_address",CONST_WA_GLOBAL_SETTINGS.seller_address)
ElVgm+=this.cXLXt("bank_account_informations",CONST_WA_GLOBAL_SETTINGS.bank_account_informations)
ElVgm+=this.cXLXt("buyer_info_shipping",this.iHYsi())
var Hfboa=""
if(qEvVY.WeCJG)
{
Hfboa=this.owPDK();
};
ElVgm+=this.cXLXt("buyer_info_billing",Hfboa)
ElVgm+="</form>"
return ElVgm;
}
vXCFB.oiPMX=function()
{
var AqSlT=vNvvC();
AqSlT.EbaaG()
this.closeWin()
}
vXCFB.dcVpL=function()
{
var AqSlT=vNvvC();
var HHmUa=((this.qEvVY.pZCXB=="check")||(this.qEvVY.pZCXB=="wire")) 
if(this.qEvVY.pZCXB=="paypal")
{
this.addButton(Translator.tr('Clear cart'),this.oiPMX,[""],this)
this.initializeWindow(400,200)
}
else
{
this.initializeWindow(400,150)
}
var ElVgm=""
if(this.qEvVY.pZCXB=="paypal")
{
ElVgm+=this.kACSb()
}
if(HHmUa)
{
ElVgm+=this.ZJdul()
if((WOXAd==false)&&(document.webaca_is_preview))
{
WA_Dialog.alert(Translator.tr("Operation not allowed in preview mode"))
return
}
}
ElVgm+="<table border=0 style='width:100%;'><tr>";
ElVgm+="<td align=center style='"+this.cssText1()+"'>"
ElVgm+=Translator.tr("You have been redirected to the payment page")
if(this.qEvVY.pZCXB=="paypal")
{
ElVgm+="<br><br>"
ElVgm+=Translator.tr("You can clear your cart")
}
ElVgm+="</td></tr></table>"
this.writeContent(ElVgm) 
if(PlISb.charCodeAt(3)>=100)
{
WA_Dialog.alert(Translator.tr("This cariboost edition can't support ebusiness features !'"))
return;
}
var gfbCM=document.getElementById("wa-http-sender")
gfbCM.submit()
if(HHmUa)
{
AqSlT.EbaaG()
}
}
vXCFB.qEvVY=qEvVY
vXCFB.dcVpL()
}

-->
