<!--

var Oudbg=0
var RJVqh=1
var ELpdl=2
var OKKUK=0;
var WFsOK=1;
var lueDS=2;
var ShRvZ=0
var ApCkD=1
var qxNLL=false 
function WA_marketRemoveItem(aeXhP)
{
vEGnU().aHJlw(aeXhP)
var KBmHw=WA_Dialog.getCurrent();
KBmHw.GtkjL()
}
function vEGnU()
{
if(document.wa_global_settings_market==undefined)document.wa_global_settings_market=new GSAOL()
return document.wa_global_settings_market;
}
function hThoq()
{
this.jLAvD=function()
{
return this.bqVWg+"-"+this.DvEqs_index
}
this.uehIJ=function(avLiR,klejX)
{
this.DvEqs=avLiR.obj.market.info.folder.substring(13);
this.DvEqs_index=avLiR.obj.index;
this.DvEqs_modif=avLiR.obj.market.info.critical_id_modif
this.bqVWg=avLiR.obj.market.id 

this.NRAPX=1;
this.nduWn=avLiR.title;
this.XsJix=avLiR.price;
this.pNBVn=avLiR.weight;
this.muces=avLiR.code_product;
}
this.RcQnR=function(avLiR,klejX)
{

this.nduWn=avLiR.title;
this.XsJix=avLiR.price;
this.pNBVn=avLiR.weight;
this.muces=avLiR.code_product;
}
this.SZvTD=function()
{
var s="";
s+=this.jLAvD();
if(this.m_opt_vals)
for(var i=0;i<this.m_opt_vals.length;i++)
{
var Wrfck=this.m_opt_vals[i]
if(Wrfck!=-1) s+="/"+Wrfck;
}
return s;
}
this.NpVUg=function()
{
var val="";
val+="j="+this.DvEqs+",";
val+="i="+this.DvEqs_index+",";
val+="m="+this.DvEqs_modif+",";
val+="q="+this.NRAPX+",";
if(this.m_opt_vals)
{
for(var i=0;i<this.m_opt_vals.length;i++)
{
val+="o"+i+"=";
var ZjlHs=this.m_opt_vals[i]
if(ZjlHs>-1)
val+=ZjlHs
else
val+=""
val+=","
}
}
return val;
}
this.YjPXD=function(map,k)
{
var v=map[k];
if(v=="undefined") return "";
return v;
}
this.jqotA=function(map)
{
this.DvEqs=this.YjPXD(map,"j");
if(this.DvEqs=="") return false;
this.DvEqs_index=this.YjPXD(map,"i");
this.DvEqs_modif=this.YjPXD(map,"m");
this.NRAPX=parseInt(map["q"]);
this.m_opt_vals=new Array();
for(var i=0;i<3;i++)
{
var GETuj=parseInt(map["o"+i]);
if(isNaN(GETuj))GETuj=-1;
this.m_opt_vals.push(GETuj)
}
return true;
}
this.iwjlO=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.dHlsb=function(UPDKp)
{
var evxQu=this.iwjlO(UPDKp)
return this.jqotA(evxQu) 
}
this.YYVdP=function()
{
return oQoQu(this.avLiR,this.m_opt_vals)
}
}
function JLrvX(JSbhi,kIiwR)
{
var hUFmm=JSbhi[0]
var xtYJa=JSbhi[1]
var TgqcE=JSbhi[2]
if(hUFmm.length==0)
{
TgqcE.call(xtYJa)
return;
}
var js=hUFmm.pop()
WA_loadScript(js.src,JLrvX,[hUFmm,xtYJa,TgqcE]);
}
function WA_arrayContains(PtFmb,UPDKp)
{
for(var n=0;n<PtFmb.length;n++){if(PtFmb[n]==UPDKp)return true;}
return false;
}
function eAlrV(PtFmb)
{
var evxQu=new Array()
for(var n=0;n<PtFmb.length;n++)
{
var vrfdc=PtFmb[n]
if(vrfdc=="address") evxQu=evxQu.concat(["address_1","address_2","city","zip"])
else evxQu.push(vrfdc)
}
return evxQu;
}
function kqKbO()
{
this.ZiWQZ=function()
{
if(this.PEFBC.length==0)return CONST_WA_GLOBAL_SETTINGS.default_selected_country;
return this.PEFBC;
}
this.hAlgb=function()
{
this.TdHjP()
}
this.iwjlO=function(s)
{
var LSvUp=new Array();
var tab=s.split(",");
for(var i=0;i<tab.length;i++)
{
var tab3=tab[i].split("=");
if(tab3.length==2)LSvUp[tab3[0]]=tab3[1];
}
return LSvUp;
}
this.DQOso=function(ToIiA)
{
if(ToIiA==undefined) return ""
return(ToIiA==ShRvZ)?"deliv-":"bill-"
}
this.vRFLS=function(VcEvd,ToIiA,hTULS)
{
if(!hTULS)hTULS=""
var wtxti=this.DQOso(ToIiA)
if(VcEvd=="country")
{
if(ToIiA==ShRvZ) return this.PEFBC
if(ToIiA==ApCkD) VcEvd="countryCode"
}
if(VcEvd=="state")
{
VcEvd="stateCode"
}
var Wrfck=this.rriis[wtxti+VcEvd]
if(!Wrfck) return hTULS
Wrfck=Wrfck.replace(/\"/g,"'")
return Wrfck
}
this.IfwrU=function(Wrfck)
{
if(Wrfck==undefined)return ""
return Wrfck
}
this.shQKF=function(key,val)
{
if((val==null)||(val==undefined)) val="";
WA_SetCookie("crbst-card-"+key,val)
}
this.pYvnY=function(key)
{
var xtYJa=WA_GetCookie("crbst-card-"+key)
if(xtYJa=="null")xtYJa="";
return ""+xtYJa
}
this.ZXicp=function()
{
this.rriis=new Array()
var UPDKp=this.pYvnY("order-infos")
var evxQu=this.iwjlO(UPDKp)
for(var k1 in evxQu)
{
var Wrfck=evxQu[k1]
if((k1.indexOf("deliv-")==0)||(k1.indexOf("bill-")==0))
this.rriis[k1]=unescape(Wrfck)
}
this.PEFBC=this.IfwrU(evxQu["countryCode"])
this.eUOmb=this.IfwrU(evxQu["typePayment"])
this.ZZksR=(this.IfwrU(evxQu["differentBillingAddressChecked"])=="true")
this.duVSn=(this.IfwrU(evxQu["salesConditionChecked"])=="true")
}
this.TdHjP=function()
{
var UPDKp=""
for(var k1 in this.rriis)
{
var Wrfck=this.rriis[k1]
UPDKp+=k1+"="+escape(Wrfck)+","
}
var KiiYb=""
KiiYb+="countryCode="+escape(this.PEFBC)+","
KiiYb+="typePayment="+escape(this.eUOmb)+","
KiiYb+="differentBillingAddressChecked="+(this.ZZksR)+","
KiiYb+="salesConditionChecked="+(this.duVSn)+","
UPDKp+=KiiYb 
this.shQKF("order-infos",UPDKp)
}
this.PnexW=function(bEMMf)
{
if(trimString(bEMMf.value).length==0)
{
bEMMf.style.backgroundColor="#ff0000"
bEMMf.focus()
return false;;
}
bEMMf.style.backgroundColor=""
return true;
}
this.PoquY=function(ToIiA)
{
var aRBUh=eAlrV(CONST_WA_GLOBAL_SETTINGS.list_form_fields)
var SxjGH=eAlrV(CONST_WA_GLOBAL_SETTINGS.list_mandatory_form_fields) 
var EIQGq=this.rriis;
var wtxti=this.DQOso(ToIiA) 
var OGACI=document.getElementById("wa-market-form")
for(var n=0;n<aRBUh.length;n++)
{
var keIXs=aRBUh[n]
var fhDPU=OGACI[keIXs]
var Wrfck=trimString(fhDPU.value)
if(keIXs!="address_2")
if(WA_arrayContains(SxjGH,keIXs))
{
if(this.PnexW(fhDPU)==false)return false;
}
EIQGq[wtxti+keIXs]=Wrfck
}
var pTlmq=document.getElementById("wa-select-state");
var BKvaX=document.getElementById("wa-market-state");
if(pTlmq&&(BKvaX.style.display!="none"))
{
if(this.PnexW(pTlmq)==false)return false;
EIQGq[wtxti+"stateCode"]=pTlmq.value
}
else
{
EIQGq[wtxti+"stateCode"]=""
}
if(ToIiA==ApCkD)
{
var qMinQ=document.getElementById("wa-select-form-country");
if(qMinQ)
{
EIQGq[wtxti+"countryCode"]=qMinQ.value
}
}
this.TdHjP()
return true;
}
this.PEFBC=""
this.eUOmb=""
this.ZZksR=false;
this.duVSn=false
this.ZXicp()
}
function GSAOL()
{
this.SOgmJ=new Array();
this.xtYJa_callback=false;
this.TwxDq=false;
this.cFDkr=false;
this.GTsmM=new kqKbO()
this.LClCv=function(xtYJa,TgqcE)
{
this.xtYJa_callback=xtYJa
this.TwxDq=TgqcE 
var DuYfv=this.pYvnY("data")
this.PgNJg(DuYfv) 
var hUFmm=new Array()
var PtFmb=this.SOgmJ;
for(var i=0;i<PtFmb.length;i++)
{
var wLePG=PtFmb[i];
var pHUMh=Translator.m_lang_for_filename
if(pHUMh.length>0)pHUMh="_"+pHUMh;
var uSYUu=wLePG.DvEqs;
var n=uSYUu.indexOf("_")
if(n>-1)uSYUu=uSYUu.substring(n+1)
wLePG.bqVWg="wa-id-"+uSYUu 
var PnHkF=wa_global_market.markets[wLePG.bqVWg]
if(this.cFDkr==false)
if(!PnHkF)
{
var vWDVN="crbst_market_"+wLePG.DvEqs+'/'
WA_declareMarket(wLePG.bqVWg,vWDVN,wLePG.DvEqs_modif) 
var mObuR=vWDVN+'market-definition'+pHUMh+'.js?v='+wLePG.DvEqs_modif
hUFmm.push({id:uSYUu,src:mObuR})
}
}
JLrvX([hUFmm,this,this.vRCIs],true)
}
this.QkQZL=function()
{
this.shQKF("data","")
this.GTsmM.shQKF("order-infos","")
this.GTsmM.ZXicp()
this.PgNJg("")
}
this.vRCIs=function()
{
this.cFDkr=true;
var PtFmb=this.SOgmJ;
var HRvuu=new Array();
for(var i=0;i<PtFmb.length;i++)
{
var wLePG=PtFmb[i];
var uSYUu=wLePG.bqVWg
var oQOVO=wa_global_market.markets[uSYUu] 

if(oQOVO.info)
{
var DAHxv=oQOVO.info.products 
var klejX=wLePG.DvEqs_index
var avLiR=DAHxv[klejX]
wLePG.avLiR=avLiR
wLePG.RcQnR(wLePG.avLiR,klejX)
if((avLiR.unavail==false)&&(wLePG.DvEqs_modif==oQOVO.info.critical_id_modif))
{
HRvuu.push(wLePG)
}
}
else
{
}
}
this.SOgmJ=HRvuu
this.BulAP() 

this.TwxDq.call(this.xtYJa_callback)
}
this.PgNJg=function(GLXEB)
{
var PtFmb=new Array();
var list_string_products=GLXEB.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 wLePG=new hThoq();
if(wLePG.dHlsb(s_data))
{
PtFmb.push(wLePG);
}
}
}
this.SOgmJ=PtFmb;
var WwSrK=this.Slnlk()
if(WA_getNumberMarketItemsInCart()!=WwSrK)
{
this.RIEjo()
this.apMot()
}
}
this.PmmYO=function()
{
var Zhtad=''
try{Zhtad=CONST_WA_GLOBAL_SETTINGS.currency_mnemonic}catch(e){}
return Zhtad
}
this.aHJlw=function(aeXhP)
{
var list2=new Array();
var PtFmb=this.SOgmJ
for(var i=0;i<PtFmb.length;i++)
{
var wLePG=PtFmb[i];
if(i!=aeXhP)
{
list2.push(wLePG);
}
}
this.SOgmJ=list2;
this.BulAP()
}
this.addProductToShoppingCard=function(avLiR,optionsValues)
{
if(this.gEANn()==false)
{
WA_Dialog.alert(Translator.tr("You can't use shopping card Your browser doesnt accept cookies !"));
return false;
}
var YGbKc=avLiR.obj
var PtFmb=this.XhYVd();
var n=PtFmb.length
var USGMc=new hThoq()
USGMc.uehIJ(avLiR,n);
USGMc.m_opt_vals=optionsValues
var b_match=false;
for(var i=0;i<PtFmb.length;i++)
{
var wLePG=PtFmb[i];
if(wLePG.SZvTD()==USGMc.SZvTD())
{
b_match=true;
wLePG.NRAPX++;
}
}
if(b_match==false)
{
var DuYfv=this.pYvnY("data")
var wYiGO=USGMc.NpVUg()
var pSAoO=DuYfv.length+wYiGO.length 
if(pSAoO>4000)
{
WA_Dialog.alert(Translator.tr("Cookies cart contains max data !"));
return false;
}
PtFmb.push(USGMc);
}
return true
}
this.hllEm=function()
{
var PtFmb=this.SOgmJ
var DuYfv="";
for(var i=0;i<PtFmb.length;i++)
{
var info=PtFmb[i];
DuYfv+=info.NpVUg()+";";
}
return DuYfv;
}
this.Slnlk=function()
{
var ksRwO=0;
var PtFmb=this.SOgmJ;
for(var i=0;i<PtFmb.length;i++)
{
var wLePG=PtFmb[i];
ksRwO+=wLePG.NRAPX
}
return ksRwO;
}
this.RIEjo=function()
{
this.shQKF("nb_items",this.Slnlk())
}
this.BulAP=function()
{
var PtFmb=this.SOgmJ
var DuYfv=this.hllEm()
this.shQKF("data",DuYfv)
this.RIEjo()
this.apMot();
}
this.apMot=function()
{
WA_refreshNumberMarketItemsInCart()
}
this.XhYVd=function()
{
return this.SOgmJ;
}
this.gEANn=function()
{
this.shQKF("watestcookies","test")
return(this.pYvnY("watestcookies")=="test");
}
this.shQKF=function(key,val)
{
if((val==null)||(val==undefined)) val="";
WA_SetCookie("crbst-card-"+key,val)
}
this.pYvnY=function(key)
{
var xtYJa=WA_GetCookie("crbst-card-"+key)
if(xtYJa=="null")xtYJa="";
return ""+xtYJa
}
this.uLUiB=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.PmmYO()+result;
}
else
{
result=result+" "+this.PmmYO();
}
return result;
}
this.ZrXNn=function(pmNQG)
{
return Math.round(pmNQG*100)/100
}
this.RsvDf=function()
{
var PtFmb=this.XhYVd()
var price=0;
for(var i=0;i<PtFmb.length;i++)
{
var wLePG=PtFmb[i];
price+=(wLePG.YYVdP()*wLePG.NRAPX);
}
return price;
}
this.computeShippingForValue=function(val)
{
var askmm=CONST_WA_GLOBAL_SETTINGS.shipping_type
if(askmm==Oudbg)return 0;
var ship_val=0;
var kelar=CONST_WA_GLOBAL_SETTINGS.shipping_intervals
for(var i=0;i<kelar.length;i++)
{
var nofqg=kelar[i];
if(nofqg.v<val)ship_val=nofqg.p
}
return ship_val;
}
this.hOaZu=function(hbqsu)
{
var evxQu=CONST_WA_GLOBAL_SETTINGS.LSvUp_list_extra_shipping_by_country_code
if(evxQu==undefined)
{
evxQu=new Array()
CONST_WA_GLOBAL_SETTINGS.LSvUp_list_extra_shipping_by_country_code=evxQu;
var eSCZo=CONST_WA_GLOBAL_SETTINGS.list_extra_shipping_by_country_code
for(var aeXhP in eSCZo)
{
var ZXZkE=eSCZo[aeXhP];
var wVALW=ZXZkE.c
for(var gRGBM in wVALW)
{
var URosW=wVALW[gRGBM];evxQu[URosW]=ZXZkE.p;
}
}
}
return evxQu[hbqsu];
}
this.AkgNX=function(hbqsu)
{
var evxQu=CONST_WA_GLOBAL_SETTINGS.LSvUp_list_tva_by_country_code
if(evxQu==undefined)
{
evxQu=new Array()
CONST_WA_GLOBAL_SETTINGS.LSvUp_list_tva_by_country_code=evxQu;
var eSCZo=CONST_WA_GLOBAL_SETTINGS.list_tva_by_country_code
for(var aeXhP in eSCZo)
{
var ZXZkE=eSCZo[aeXhP];
var wVALW=ZXZkE.c;
for(var gRGBM in wVALW)
{
var URosW=wVALW[gRGBM];evxQu[URosW]=ZXZkE.p;
}
}
}
return evxQu[hbqsu];
}
this.LWYBB=function()
{
var askmm=CONST_WA_GLOBAL_SETTINGS.shipping_type
var PtFmb=this.XhYVd()
var global_ref_for_shipping=0;
var omBan=0;
var PEFBC=this.GTsmM.PEFBC;
if(PEFBC.length>0)
{
omBan=this.hOaZu(PEFBC);
if(isNaN(omBan)) omBan=0;
}
for(var i=0;i<PtFmb.length;i++)
{
var wLePG=PtFmb[i];
if(askmm==RJVqh)
{
global_ref_for_shipping+=(wLePG.NRAPX*wLePG.YYVdP());
}
if(askmm==ELpdl)
{
global_ref_for_shipping+=(wLePG.NRAPX*wLePG.pNBVn);
}
}
return omBan+this.ZrXNn(this.computeShippingForValue(global_ref_for_shipping));
}
this.lLNEd=function()
{
return CONST_WA_GLOBAL_SETTINGS.tva_type==WFsOK
}
this.MeRCf=function()
{
return CONST_WA_GLOBAL_SETTINGS.tva_type==lueDS
}
this.pQkWH=function()
{
return CONST_WA_GLOBAL_SETTINGS.tva_type==OKKUK
}
this.Ccoce=function()
{
if(this.pQkWH())return 0;
var tax=0;
var country_code=this.GTsmM.PEFBC;
if(country_code.length>0)
{
tax=this.AkgNX(country_code);
if(isNaN(tax))tax=0;
}
return tax;
}
this.wRPKL=function(pmNQG)
{
if(this.lLNEd())
{
var n0=this.Ccoce()/100;
return pmNQG*(n0/(1+n0));
}
if(this.MeRCf())
{
return pmNQG*this.Ccoce()/100;
}
return pmNQG;
}
this.VdwFG=function()
{
if(this.pQkWH())return 0;
var PtFmb=this.XhYVd()
var jhIrR=0;
var rMtvk=0;
for(var i=0;i<PtFmb.length;i++)
{
var wLePG=PtFmb[i];
jhIrR+=(wLePG.YYVdP()*wLePG.NRAPX);
}
jhIrR+=this.LWYBB();
rMtvk=this.ZrXNn(this.wRPKL(jhIrR));
return rMtvk;
}
this.dWjVC=function()
{
var pmNQG=0;
pmNQG+=this.RsvDf()
if(this.MeRCf())pmNQG+=this.VdwFG()
pmNQG+=this.LWYBB()
return pmNQG;
}
}
function lijTg(RGDUD,WACap)
{
if(RGDUD.lab<WACap.lab) return-1;
if(RGDUD.lab>WACap.lab) return 1;
return 0
}
function WA_marketWatchQuantity()
{
var KBmHw=WA_Dialog.getCurrent()
KBmHw.eeHcR()
}
function WA_displayDialogMarketCart()
{
var KBmHw=new WA_Dialog();
KBmHw.dnGmC=false;
KBmHw.JMIKG=function()
{
this.LfjvU()
this.dnGmC=setInterval("WA_marketWatchQuantity()",400)
}
KBmHw.LfjvU=function()
{
if(this.dnGmC)clearInterval(this.dnGmC)
}
KBmHw.eeHcR=function()
{
var aVUPW=vEGnU();
var bXlrJ=aVUPW.XhYVd();
for(var n=0;n<bXlrJ.length;n++)
{
var wLePG=bXlrJ[n]
var ZltrI=document.getElementById("wa-cart-quantity-"+n)
var crnCR=ZltrI.value
var pOuCT=parseInt(crnCR)
if(isNaN(pOuCT))pOuCT=0;
if((crnCR!='')&&(pOuCT+""!=crnCR))
{
ZltrI.value=""+pOuCT
}
if(pOuCT!=wLePG.NRAPX)
{
wLePG.NRAPX=pOuCT
aVUPW.BulAP()
this.BrUDY()
}
}
}
KBmHw.onCustomKeypress=function(nFZTG)
{
if(nFZTG==13)
{
wa_timeout(Delegate.create(this,this.KiTou),0);
}
return false;
}
KBmHw.closeWin=function()
{
this.LfjvU()
this.intern_closeWin()
}
KBmHw.BrUDY=function()
{
var aVUPW=vEGnU();
var bXlrJ=aVUPW.XhYVd();
if(bXlrJ.length==0) return;
for(var n=0;n<bXlrJ.length;n++)
{
var wLePG=bXlrJ[n]
var tTASa=document.getElementById("wa-cart-total-"+n)
var pmNQG=wLePG.YYVdP() 
var idHfk=wLePG.NRAPX*pmNQG
var UPDKp="<span style='"
UPDKp+=(idHfk>0)?"color:"+WA_GLOBAL_COLOR_THEME.color_text+";font-weight:normal;":"color:#ff0000;font-weight:bold;"
UPDKp+="'>"
UPDKp+=idHfk+" "+aVUPW.PmmYO()
UPDKp+="</span>"
tTASa.innerHTML=UPDKp
}
var CtjeU=aVUPW.RsvDf()
var nTwqE=aVUPW.VdwFG()
var hNeuT=aVUPW.LWYBB()
var ZrRdX=aVUPW.dWjVC()
var JYANV=""
var tTASa=document.getElementById("wa-cart-amount-total")
JYANV+=Translator.tr("Sub total")+" : "+aVUPW.uLUiB(CtjeU)
JYANV+="<br>"
if(hNeuT>0)
{
JYANV+="<span>"+Translator.tr("Shipping amount")+" : "+aVUPW.uLUiB(hNeuT)+"</span>";
JYANV+="<br>"
}
if(aVUPW.lLNEd()||aVUPW.MeRCf())
{
if(aVUPW.lLNEd())
{
JYANV+="<div style='width:100%;text-align:left;'>"
JYANV+=Translator.tr("Tax included");
}
if(aVUPW.MeRCf())
{
JYANV+="<div>"
JYANV+=Translator.tr("Extra Tax");
}
JYANV+=" : ";
JYANV+=aVUPW.uLUiB(nTwqE)+"</div>";
}
JYANV+="<span><b>"+Translator.tr("Total")+" : "+aVUPW.uLUiB(ZrRdX)+"</b></span>";
tTASa.innerHTML=JYANV
}
KBmHw.tNoIc=function()
{
WA_displayDialogMarketCart()
}
KBmHw.ovXCs=function()
{
this.closeWin()
}
KBmHw.KiTou=function()
{
var aVUPW=vEGnU();
if(WA_getNumberMarketItemsInCart()==0)return;
var gexja=document.getElementById("wa-market-select-country")
aVUPW.GTsmM.PEFBC=gexja.value
if(aVUPW.GTsmM.PEFBC=="")
{
var gexja=document.getElementById("wa-market-select-country")
if(gexja)
{
gexja.focus()
gexja.style.backgroundColor="#ff0000"
return;
}
}
if(CONST_WA_GLOBAL_SETTINGS.link_sale_condition)
{
if(aVUPW.GTsmM.duVSn!=true)
{
var CQBGs=document.getElementById("wa-sales-condition")
if(CQBGs)
{
CQBGs.focus()
var MDqSP=document.getElementById("wa-sales-condition-label")
MDqSP.style.backgroundColor="#ff0000"
return;
}
}
}
if(aVUPW.GTsmM.eUOmb=="")
{
var gexja=document.getElementById("wa-market-select-payment")
if(gexja)
{
}
gexja.focus()
gexja.style.backgroundColor="#ff0000"
return;
}
JbrJQ()
}
KBmHw.GtkjL=function()
{
WA_exec_callback_opera_compliant(this,this.NLJUW)
}
KBmHw.NLJUW=function()
{
var aVUPW=vEGnU();

var qMinQ=document.getElementById("wa-market-select-country")
aVUPW.GTsmM.PEFBC=qMinQ.value
aVUPW.GTsmM.hAlgb()
var OSKbw=html_getLayer("market-cart-content")
var gdETI=html_getLayer("wa-market-payment-form") 
var UPDKp=""
var bXlrJ=aVUPW.XhYVd();
html_SetVisibility(gdETI,(bXlrJ.length>0))
if(bXlrJ.length==0)
{
UPDKp+="<span style='font-family:Arial;font-size:16px;'>"
UPDKp+=Translator.tr("No articles in Card !")
UPDKp+="</span>"
}
else
{
var JaLVO="border:1px solid "+WA_GLOBAL_COLOR_THEME.color0+";font-weight:normal;"
var kcVuq="border:1px solid "+WA_GLOBAL_COLOR_THEME.color0+";color:#ff0000;font-weight:bold;"
var evMOV="color:#222222;font-size:12px;"
UPDKp+="<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+";'>"
UPDKp+="<thead style='font-size:13px;border:1px solid;'>"
UPDKp+="<tr>"
UPDKp+="<th  colspan=2 style='"+JaLVO+"'></th>" 
UPDKp+="<th style='"+JaLVO+"'  width=70px><b>"+Translator.tr("Price")+"</b></th>"
UPDKp+="<th style='"+JaLVO+"'  width=70px><b>"+Translator.tr("Quantity")+"</b></th>"
UPDKp+="<th style='"+JaLVO+"'  width=70px><b>"+Translator.tr("Total")+"</b></th>"
UPDKp+="<th style='"+JaLVO+"'  width=90px></th>"
UPDKp+="</tr>"
for(var n=0;n<bXlrJ.length;n++)
{
var wLePG=bXlrJ[n]
UPDKp+="<tr>"
UPDKp+="<th style='"+JaLVO+"' >"
var oQOVO=wa_global_market.markets[wLePG.bqVWg]
var KhctI=new Size(30,30)
var ZIxhF=KhctI
if(oQOVO.info.design.crop_thumb==false)
{
ZIxhF=wLePG.avLiR.size_thumb.clone()
ZIxhF.scale(KhctI)
}
else
{
}
if(wLePG.avLiR.img_thumb.length>0)
UPDKp+="<img border=0 src='"+wLePG.avLiR.img_thumb+"' width="+ZIxhF.width+"px height="+ZIxhF.height+"px>"
UPDKp+="</th>"
UPDKp+="<th style='"+JaLVO+"text-align:left;padding:5px;background-color:"+WA_GLOBAL_COLOR_THEME.color1+";' >"
UPDKp+="<b>"+wLePG.nduWn+"</b>"
if(wLePG.muces.length>0)
{
UPDKp+="<span style='"+evMOV+"'>";
UPDKp+=" ["+wLePG.muces+"]";
UPDKp+="</span>";
}
if(wLePG.m_opt_vals)
{
UPDKp+="<br>"
UPDKp+="<span style='"+evMOV+"'>";
for(var i_opt=0;i_opt<wLePG.avLiR.options.length;i_opt++)
{
var gSxKQ=wLePG.avLiR.options[i_opt]
if(gSxKQ)
{
var INCTB=wLePG.m_opt_vals[i_opt];
var gBcZG=gSxKQ.title;
if(gBcZG.length>0)
{
UPDKp+=gBcZG;
UPDKp+=":"
}
UPDKp+=gSxKQ.vals[INCTB];
UPDKp+=" "
}
}
UPDKp+="</span>";
}
UPDKp+="</th>"
var pmNQG=wLePG.YYVdP()
UPDKp+="<th style='"+JaLVO+"' >"+aVUPW.uLUiB(pmNQG)+"</th>"
UPDKp+="<th style='"+JaLVO+"'  align=center><input type=text id='wa-cart-quantity-"+n+"' style='width:45px;' maxlength=3 value='"+wLePG.NRAPX+"' type=text/></th>"
UPDKp+="<th style='"
var idHfk=wLePG.NRAPX*pmNQG
UPDKp+=(idHfk>0)?JaLVO:kcVuq;
UPDKp+="' ><span id='wa-cart-total-"+n+"'>"
UPDKp+=aVUPW.uLUiB(idHfk)
UPDKp+="</span></th>"
UPDKp+="<th style='"+JaLVO+"' ><a href=\"javascript:WA_marketRemoveItem("+n+")\">"+Translator.tr("Remove card item")+"</a></th>"
UPDKp+="</tr>"
}
UPDKp+="<tr>"
UPDKp+="<th style='"+JaLVO+"text-align:right;padding:5px;' id='wa-cart-amount-total'  colspan=5>&nbsp;</th>"
UPDKp+="<th style='"+JaLVO+"' ></th>"
UPDKp+="</tr>"
UPDKp+="</thead>"
UPDKp+="</table>"
UPDKp+="<br>"
}
OSKbw.innerHTML=UPDKp
this.JMIKG()
WA_exec_callback_opera_compliant(this,this.BrUDY) 
}
KBmHw.imCWD=function()
{
var aVUPW=vEGnU();
this.addButton(Translator.tr("Continue Shopping"),this.ovXCs,[""],this)
this.addButton(Translator.tr("Checkout order"),this.KiTou,[""],this)
this.initializeWindow(670,700)
var mkAjo="font-family:Arial;font-size:12px;color:#000000;"
var UPDKp=""
UPDKp+="<div id='market-cart-content' style='width:100%;"+mkAjo+"' align=center>" 
UPDKp+="</div>"
UPDKp+="<br>"
UPDKp+="<div style='width:100%;"+mkAjo+"' align=center id='wa-market-payment-form'>"
UPDKp+="<br>"
UPDKp+="<span style='font-weight:bold;'>"
UPDKp+=Translator.tr("Please choose a country to deliver your order")
UPDKp+="</span>"
UPDKp+="<br>"
UPDKp+="<select onchange=\"WA_marketChangeCountry(this)\" id='wa-market-select-country'>"
if(CONST_WA_GLOBAL_SETTINGS.default_selected_country.length==0)
{
UPDKp+="<option value=\"\">...</option>"
}
var HAkJm=CONST_WA_GLOBAL_SETTINGS.list_favorite_country
var AYuwj=CONST_WA_GLOBAL_SETTINGS.list_country 
var fLsqW=new Array()
for(var kmmHG=0;kmmHG<HAkJm.length;kmmHG++)
{
var fXZgL=HAkJm[kmmHG]
fLsqW.push({code:fXZgL,lab:Translator.country(fXZgL)})
}
for(var kmmHG=0;kmmHG<fLsqW.length;kmmHG++)
{
var xtYJa=fLsqW[kmmHG]
var fXZgL=xtYJa.code
UPDKp+="<option "
if(aVUPW.GTsmM.ZiWQZ()==fXZgL)UPDKp+="selected "
UPDKp+="value=\""+fXZgL+"\">"+Translator.country(fXZgL)+"</option>"
}
if((HAkJm.length>0)&&(AYuwj.length>0))
{
UPDKp+="<option value=\"\">-----</option>"
}
var UiqwP=new Array()
for(var kmmHG=0;kmmHG<AYuwj.length;kmmHG++)
{
var fXZgL=AYuwj[kmmHG]
UiqwP.push({code:fXZgL,lab:Translator.country(fXZgL)})
}
if((HAkJm.length==0)&&(AYuwj.length==0))
{
var PtFmb=CONST_WA_COUNTRIES.codes
for(var kmmHG=0;kmmHG<PtFmb.length;kmmHG++)
{
var fXZgL=PtFmb[kmmHG]
UiqwP.push({code:fXZgL,lab:Translator.country(fXZgL)})
}
}
UiqwP.sort(lijTg)
for(var kmmHG=0;kmmHG<UiqwP.length;kmmHG++)
{
var xtYJa=UiqwP[kmmHG]
var fXZgL=xtYJa.code
UPDKp+="<option "
if(aVUPW.GTsmM.ZiWQZ()==fXZgL)UPDKp+="selected "
UPDKp+="value=\""+fXZgL+"\">"+Translator.country(fXZgL)+"</option>"
}
UPDKp+="</select>"
UPDKp+="<br>"
UPDKp+="<br>"
if(CONST_WA_GLOBAL_SETTINGS.link_sale_condition)
{
UPDKp+="<a "+WA_LinkToHref(CONST_WA_GLOBAL_SETTINGS.link_sale_condition)+" style='color:#0000ff'>"
UPDKp+=Translator.tr("Terms of sell")
UPDKp+="</a>"
UPDKp+="<br>" 
UPDKp+="<span id='wa-sales-condition-label'  style='font-weight:bold;'>"
UPDKp+=Translator.tr("label_market_accept_terms")
UPDKp+="</span>"
UPDKp+="<input id='wa-sales-condition' onchange=\"WA_marketChangeSalesCondition(this)\" "
UPDKp+=(aVUPW.GTsmM.duVSn)?"checked ":""
UPDKp+="type='checkbox' value='1'/>" 
UPDKp+="<br>"
UPDKp+="<br>"
}
UPDKp+="<span style='font-weight:bold;'>"
UPDKp+=Translator.tr("Choose a type of payment")
UPDKp+="</span>"
UPDKp+="<br>"
UPDKp+="<select onchange=\"WA_marketChangeTypePayment(this)\" id='wa-market-select-payment'>"
UPDKp+="<option value=\"\">...</option>"
var qnoNC=CONST_WA_GLOBAL_SETTINGS.list_type_payment
for(var kmmHG=0;kmmHG<qnoNC.length;kmmHG++)
{
var eUOmb=qnoNC[kmmHG]
UPDKp+="<option "
if(aVUPW.GTsmM.eUOmb==eUOmb)UPDKp+="selected "
UPDKp+="value=\""+eUOmb+"\">"+Translator.tr("label_market_"+eUOmb)+"</option>"
}
UPDKp+="</select>"
UPDKp+="</div>"
this.writeContent(UPDKp)
var OSKbw=html_getLayer("market-cart-content")
OSKbw.innerHTML="<div width=100% align=center><img src='wa_loading.gif'></div>" 

aVUPW.LClCv(this,this.GtkjL)
}
KBmHw.imCWD() 
}
function WA_marketChangeCountry(gexja)
{
gexja.style.backgroundColor=""
var KBmHw=WA_Dialog.getCurrent()
KBmHw.GtkjL()
}
function WA_marketChangeTypePayment(gexja)
{
var aVUPW=vEGnU();
aVUPW.GTsmM.eUOmb=gexja.value
aVUPW.GTsmM.hAlgb()
gexja.style.backgroundColor=""
}
function WA_marketChangeSalesCondition(bEMMf)
{
var aVUPW=vEGnU();
aVUPW.GTsmM.duVSn=bEMMf.checked
aVUPW.GTsmM.hAlgb() 
var MDqSP=document.getElementById("wa-sales-condition-label")
MDqSP.style.backgroundColor="" 
}
function WA_LinkToHref(sfXTf)
{
var UPDKp=""
var GiDsM=sfXTf.url
var KAttv=Translator.m_lang_for_filename
if(KAttv.length>0)KAttv="_"+KAttv
GiDsM=GiDsM.replace(/@lng@/g,KAttv)
UPDKp+="href=\""+GiDsM+"\" "
if(sfXTf.open==1)
{
UPDKp+="target="
UPDKp+="_blank"
}
return UPDKp;
}
function WA_displayDialogMarketProduct(uSYUu,aeXhP)
{
var PnHkF=wa_global_market.markets[uSYUu]
var vVhta=PnHkF.obj
var DAHxv=vVhta.info.products
var avLiR=DAHxv[aeXhP] 

var KBmHw=new WA_Dialog();

KBmHw.avLiR=avLiR
KBmHw.EPPRF=uSYUu
KBmHw.tNoIc=function()
{
WA_displayDialogMarketCart()
}
KBmHw.xJpeY=function()
{
var aVUPW=vEGnU();
aVUPW.LClCv(this,this.JnZxS) 
}
KBmHw.JnZxS=function()
{
var avLiR=this.avLiR;
var aVUPW=vEGnU();
var YfNnB=new Array();
var hZxLl=avLiR.obj.id;
for(var i=0;i<3;i++)
{
var XVZpK=-1;
var wtxti=hZxLl+"-select-opt"
var gexja=document.getElementById(wtxti+i)
if(gexja)
{
if(gexja.value.length==0)
{
gexja.style.backgroundColor="#ff0000";
gexja.focus()
return;
}
XVZpK=parseInt(gexja.value)
}
YfNnB.push(XVZpK)
}
if(aVUPW.addProductToShoppingCard(avLiR,YfNnB))
{
aVUPW.BulAP()
WA_displayDialogMarketCart()
}
}
KBmHw.imCWD=function()
{
var uSYUu=this.EPPRF
var avLiR=this.avLiR
var UPDKp=""
this.addButton(Translator.tr("Go to my card"),this.tNoIc,[""],this)
if(avLiR.unavail==false)
{
this.addButton(Translator.tr("Add to card"),this.xJpeY,[""],this)
}
this.initializeWindow(670,this.idealHeight())
UPDKp+="<table border=0 width=100% cellpadding=4>"
UPDKp+="<tr>" 
if(avLiR.img_big.length>0)
{
UPDKp+="<td width='100px' align=center valign=top>"
var ZIxhF=avLiR.size_thumb.clone() 
ZIxhF.scale(new Size(200,200))
UPDKp+="<a href=\""+avLiR.img_big+"\" target=_blank>"
UPDKp+="<img border=0 src=\""+avLiR.img_big+"\" width='"+ZIxhF.width+"px' height='"+ZIxhF.height+"px'>"
UPDKp+="</a>"
UPDKp+="</td>"
}
var TPwTP="color:"+WA_GLOBAL_COLOR_THEME.color_text+";";
UPDKp+="<td valign=top style='font-family:Arial;'>"
UPDKp+="<span style='font-weight:bold;font-size:16px;"+TPwTP+"'>"
UPDKp+=avLiR.title
UPDKp+="</span>"
UPDKp+="<br>"
if(avLiR.sub_title.length>0)
{
UPDKp+="<span style='color:#333333;font-size:14px;'>"
UPDKp+=avLiR.sub_title
UPDKp+="</span>"
UPDKp+="<br>"
}
UPDKp+="<br>"
UPDKp+="<table border=0 width=100% cellspacing=0 cellpadding=0><tr><td>"
UPDKp+="<span style='"+TPwTP+";font-size:14px;'>"
UPDKp+=Translator.tr("Price")+" : "
UPDKp+="</span>"
UPDKp+="<span style='"+TPwTP+";font-size:18px;font-weight:bold;' id='"+avLiR.obj.id+"-price'>"
if(avLiR.unavail)
{
UPDKp+=Translator.tr("Unavailable")
}
UPDKp+="</span>"
if(avLiR.more_info)
{
UPDKp+="</td><td align=right>"
var sfXTf=avLiR.more_info
var dKwFG=WA_LinkToHref(sfXTf)
UPDKp+="<a "+dKwFG+" style='font-family:Arial;text-decoration:underline;font-weight:bold;font-size:12px;color:0000ff;'>"+Translator.tr("More product info link")+"</a>"
}
UPDKp+="</td></tr></table>"
UPDKp+="<br>"
var vOCrT=avLiR.obj.index
if(avLiR.unavail==false)
if(avLiR.options.length>0)
{
UPDKp+="<table border=0 cellspacing=0 cellpadding=0>"
for(var n=0;n<avLiR.options.length;n++)
{
var gSxKQ=avLiR.options[n]
if(gSxKQ)
{
UPDKp+="<tr><td align=right>"
UPDKp+="<span style='font-family:Arial;font-weight:bold;font-size:12px;"+TPwTP+"'>"
UPDKp+=gSxKQ.title+" :&nbsp;"
UPDKp+="</span>"
UPDKp+="</td><td align=left>"
UPDKp+="<select id='"+avLiR.obj.id+"-select-opt"+n+"' onchange=\"WA_market_changeCustomPrice('"+uSYUu+"',"+vOCrT+")\">"
UPDKp+="<option value=\"\">...</option>"
for(var kmmHG=0;kmmHG<gSxKQ.vals.length;kmmHG++)
{
var Wrfck=gSxKQ.vals[kmmHG]
UPDKp+="<option value=\""+kmmHG+"\">"+Wrfck+"</option>"
}
UPDKp+="</select>"
UPDKp+="</td></tr>";
}
}
UPDKp+="</table>"
}
UPDKp+="</td>"
UPDKp+="</tr>"
UPDKp+="</table>"
if(avLiR.description.length>0)
{
UPDKp+="<table border=0 width=100% cellpadding=4>"
UPDKp+="<tr><td colspan=2>"
UPDKp+="<span style='font-family:Arial;font-size:13px;"+TPwTP+"'>"
UPDKp+="<hr>"
UPDKp+=avLiR.description
UPDKp+="</span>"
UPDKp+="</td></tr>"
UPDKp+="</table>"
}
this.writeContent(UPDKp)
WA_market_changeCustomPrice(uSYUu,vOCrT)
}
KBmHw.displayWindowWithAutoResize(300,KBmHw.imCWD) 
}
function dZHwY(avLiR,hZxLl)
{
var HNsYO=new Array()
for(var i=0;i<3;i++)
{
var wtxti=hZxLl+"-select-opt"
var gexja=document.getElementById(wtxti+i)
HNsYO[i]=-1
if(gexja)
{
gexja.style.backgroundColor="";
var Wrfck=parseInt(gexja.value)
if(isNaN(Wrfck)==false)
HNsYO[i]=Wrfck
}
}
return oQoQu(avLiR,HNsYO)
}
function oQoQu(avLiR,HNsYO)
{
if(avLiR.unavail)return;
var MXbIU=false;
for(var i=0;i<avLiR.custom_prices.length;i++)
{
var DiFOc=avLiR.custom_prices[i]
var ROeTk=true;
for(var n=0;n<3;n++)
{
if(DiFOc.tab[n]!=HNsYO[n])ROeTk=false
}
if(ROeTk)
{
MXbIU=DiFOc;
break;
}
}
var pmNQG=avLiR.price
if(MXbIU)
{
pmNQG=MXbIU.pr
}
return pmNQG;
}
function WA_market_changeCustomPrice(uSYUu,vOCrT)
{
var aVUPW=vEGnU();
var PnHkF=wa_global_market.markets[uSYUu]
var DAHxv=PnHkF.info.products;
var avLiR=DAHxv[vOCrT]
if(avLiR.unavail)return;
var hZxLl=avLiR.obj.id
var pmNQG=dZHwY(avLiR,hZxLl)
var ahBxE=html_getLayer(hZxLl+"-price")
if(ahBxE)
{
ahBxE.innerHTML=aVUPW.uLUiB(pmNQG)
}
}
function JbrJQ()
{
var aVUPW=vEGnU();
if(WA_getNumberMarketItemsInCart()==0)return;
var wLePG=aVUPW.GTsmM
if(wLePG.eUOmb=="paypal")
{
rqISV();
return;
}
cxWig(ShRvZ)
}
function cxWig(ToIiA)
{
var aVUPW=vEGnU();
var wLePG=aVUPW.GTsmM
wLePG.ZXicp()
var KBmHw=new WA_Dialog();
KBmHw.ToIiA=ToIiA
KBmHw.NVNcS=function(nFZTG)
{
return Translator.tr("form-label-"+nFZTG)
}
KBmHw.onCustomKeypress=function(nFZTG)
{
if(nFZTG==13)
{
wa_timeout(Delegate.create(this,this.lGAQP),0);
}
return false;
}
KBmHw.tOTnC=function()
{


if(this.ToIiA==ShRvZ)
{
WA_displayDialogMarketCart()
}
else
{
cxWig(ShRvZ)
}
}
KBmHw.xBEfY=function()
{
rqISV()
}
KBmHw.lGAQP=function()
{
var aVUPW=vEGnU();
var wLePG=aVUPW.GTsmM
if(wLePG.PoquY(this.ToIiA)==false) return;
wLePG.hAlgb()
if(this.ToIiA==ShRvZ)
{
if(wLePG.ZZksR==true)
{
cxWig(ApCkD)
}
else
{
this.xBEfY()
}
}
else
{
this.xBEfY()
}
}
KBmHw.EiXoX=function(nFZTG,WtEXq)
{
if(WtEXq==undefined) WtEXq=""
if(WtEXq)WtEXq=" size="+WtEXq
return "<input name='"+nFZTG+"' value=\""+wLePG.vRFLS(nFZTG,this.ToIiA)+"\" type=text "+WtEXq+">"
}
KBmHw.gDnPs=function(iRZFL)
{
return "<td width=100px align=right valign=top>"+Translator.tr(iRZFL)+" :</td>"
}
KBmHw.imCWD=function()
{
var aVUPW=vEGnU();
var wLePG=aVUPW.GTsmM
this.addButton("< "+Translator.tr('Back'),this.tOTnC,[""],this)
this.addButton(Translator.tr('Continue')+" >",this.lGAQP,[""],this)
this.initializeWindow(550,600)
var FOkYs="form-label-"
var aRBUh=CONST_WA_GLOBAL_SETTINGS.list_form_fields 
var UPDKp=""
UPDKp+="<form id='wa-market-form' onSubmit='return false'>"
UPDKp+="<table border=0 width=100% cellspacing=5 style='font-family:Arial;font-size:15px;'>"
UPDKp+="<tr><td colspan=2 align=center style='font-size:18px;'>"
UPDKp+=Translator.tr((this.ToIiA==ShRvZ)?"Fill Deliver information below":"Fill Billing information below")
UPDKp+="<br><br></td></tr>"
for(var n=0;n<aRBUh.length;n++)
{
var fhDPU=aRBUh[n]
if(fhDPU=="address")
{
UPDKp+="<tr>"+this.gDnPs("Address");
UPDKp+="<td>"
UPDKp+=this.EiXoX("address_1",30)
UPDKp+="</td></tr>"
UPDKp+="<tr><td></td><td>"
UPDKp+=this.EiXoX("address_2",30)
UPDKp+="</td></tr>"
UPDKp+="<tr>"+this.gDnPs("form-label-city");
UPDKp+="<td>"
UPDKp+=this.EiXoX("city")+"&nbsp;"+this.NVNcS("zip")+" : "+this.EiXoX("zip",10)
UPDKp+="</td></tr>"
UPDKp+="<tr>"+this.gDnPs("form-label-country");
UPDKp+="<td>"
if(this.ToIiA==ApCkD)
{
UPDKp+="<select id='wa-select-form-country' onchange='WA_marketChangeFormCountry("+this.ToIiA+")'>"
var UiqwP=new Array();
var PtFmb=CONST_WA_COUNTRIES.codes
for(var kmmHG=0;kmmHG<PtFmb.length;kmmHG++)
{
var fXZgL=PtFmb[kmmHG]
UiqwP.push({code:fXZgL,lab:Translator.country(fXZgL)})
}
UiqwP.sort(lijTg)
var hhbfc=wLePG.ZiWQZ()
hhbfc=wLePG.vRFLS('countryCode',this.ToIiA,hhbfc)
for(var kmmHG=0;kmmHG<UiqwP.length;kmmHG++)
{
var xtYJa=UiqwP[kmmHG]
var fXZgL=xtYJa.code
UPDKp+="<option "
if(hhbfc==fXZgL)UPDKp+="selected "
UPDKp+="value=\""+fXZgL+"\">"+Translator.country(fXZgL)+"</option>"
}
UPDKp+="</select>"
}
else
{
UPDKp+=Translator.country(aVUPW.GTsmM.PEFBC);
}
UPDKp+="<br><span id='wa-market-state'>"
UPDKp+="<select id='wa-select-state'></select>"
UPDKp+="</span>" 
UPDKp+="</td></tr>"
}
else
{
UPDKp+="<tr>"+this.gDnPs("form-label-"+fhDPU);
UPDKp+="<td>"
UPDKp+=this.EiXoX(fhDPU,30) 
UPDKp+="</td></tr>"
}
}
if(this.ToIiA==ShRvZ)
{
UPDKp+="<tr><td colspan=2 align=center >"
UPDKp+=Translator.tr("Billing adress is different")+" <input type=checkbox "
if(aVUPW.GTsmM.ZZksR)UPDKp+="checked "
UPDKp+="onchange='WA_marketCheckBillingAdress(this)'>"
UPDKp+="</td></tr>"
}
UPDKp+="</table>"
UPDKp+="</form>"
this.writeContent(UPDKp)
WA_exec_callback_opera_compliant(this,this.RvLDE) 
}
KBmHw.RvLDE=function()
{
WA_marketChangeFormCountry(this.ToIiA)
}
KBmHw.imCWD()
}
function kObEG(ToIiA,gexja,evxQu)
{
var aVUPW=vEGnU();
var wLePG=aVUPW.GTsmM
var tUGdF=wLePG.vRFLS("stateCode",ToIiA) 
gexja.options.length=0
for(var n=0;n<evxQu.length;n++)
{
var val=evxQu[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==tUGdF)elOptNew.selected=true
try{
gexja.add(elOptNew,null);
}
catch(ex){
gexja.add(elOptNew);
}
}
}
function WA_marketChangeFormCountry(ToIiA)
{
var aVUPW=vEGnU();
var wLePG=aVUPW.GTsmM
var hbqsu=wLePG.PEFBC
var gexja=document.getElementById("wa-select-form-country");
if(gexja) hbqsu=gexja.value;
html_SetDisplay("wa-market-state",(hbqsu=="US")||(hbqsu=="CA"))
var pTlmq=document.getElementById("wa-select-state");
if(pTlmq)
{
if(hbqsu=="US") kObEG(ToIiA,pTlmq,["","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(hbqsu=="CA") kObEG(ToIiA,pTlmq,["","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(bEMMf)
{
var aVUPW=vEGnU();
var wLePG=aVUPW.GTsmM
wLePG.ZZksR=bEMMf.checked
wLePG.hAlgb()
}
function rqISV()
{
var aVUPW=vEGnU();
var wLePG=aVUPW.GTsmM
var vhMSG=CONST_WA_GLOBAL_SETTINGS.currency_info 

var KBmHw=new WA_Dialog();
KBmHw.tOTnC=function()
{
if(this.wLePG.eUOmb=="paypal")
{
WA_displayDialogMarketCart();return;
}
if(this.wLePG.ZZksR)
cxWig(ApCkD)
else
cxWig(ShRvZ)
}
KBmHw.vXPfe=function(VcEvd,Wrfck)
{
Wrfck=""+Wrfck
Wrfck=Wrfck.replace(/'/g,"&lsquo;")
return "<input type=hidden name='"+VcEvd+"' value=\""+Wrfck+"\">"
}
KBmHw.lZoWl=function()
{
var aVUPW=vEGnU();
var UPDKp=""
if(vhMSG.charCodeAt(3)>=100) return""
UPDKp+="<form id='wa-http-sender' method=POST action='https://www.paypal.com/cgi-bin/webscr' target='_blank'>"
UPDKp+=this.vXPfe("cmd","_cart")
UPDKp+=this.vXPfe("business",CONST_WA_GLOBAL_SETTINGS.email_paypal_account)
UPDKp+=this.vXPfe("upload","1")
UPDKp+=this.vXPfe("charset","utf-8")
UPDKp+=this.vXPfe("no_note","0")
UPDKp+=this.vXPfe("currency_code",CONST_WA_GLOBAL_SETTINGS.currency_code)
UPDKp+=this.vXPfe("no_shipping","2")
var ljZDa=aVUPW.XhYVd()
for(var i=0;i<ljZDa.length;i++)
{
var info=ljZDa[i];
var index=i+1;
var cUxaT=info.YYVdP();
if(aVUPW.lLNEd())
{
var oQivJ=aVUPW.ZrXNn(aVUPW.wRPKL(cUxaT));
cUxaT=cUxaT-oQivJ;
}
UPDKp+=this.vXPfe("amount_"+index,""+cUxaT)
UPDKp+=this.vXPfe("quantity_"+index,info.NRAPX)
var cQYst=0;
if(info.muces.length>0)
{
UPDKp+=this.vXPfe("on"+cQYst+"_"+index,"ref")
UPDKp+=this.vXPfe("os"+cQYst+"_"+index,info.muces)
cQYst++;
}
var elDcE=""
if(info.m_opt_vals)
{
for(var i_opt=0;i_opt<info.avLiR.options.length;i_opt++)
{
var gSxKQ=info.avLiR.options[i_opt]
if(gSxKQ)
{
var INCTB=info.m_opt_vals[i_opt];
var aIFdo=gSxKQ.vals[INCTB]
var gBcZG=gSxKQ.title;
if(gBcZG.length==0) gBcZG="opt"+(i_opt+1);
UPDKp+=this.vXPfe("on"+cQYst+"_"+index,gBcZG)
UPDKp+=this.vXPfe("os"+cQYst+"_"+index,aIFdo)
if(elDcE.length>0)elDcE=elDcE+", "
elDcE+=aIFdo
cQYst++;
}
}
}
var lYUTg=info.nduWn;
if(elDcE.length>0)lYUTg=lYUTg+"("+elDcE+")"
UPDKp+=this.vXPfe("item_name_"+index,lYUTg) 
}
var uGsxo=aVUPW.LWYBB()
if(aVUPW.lLNEd())
{
uGsxo=uGsxo-aVUPW.ZrXNn(aVUPW.wRPKL(uGsxo));
}
if(aVUPW.lLNEd())
{
var NWcoR=aVUPW.RsvDf();
var pqGjb=aVUPW.LWYBB()
var jhIrR=NWcoR+pqGjb;
var jPIuo=aVUPW.ZrXNn(aVUPW.wRPKL(jhIrR));
var ONhkq=jhIrR-jPIuo;
ONhkq=ONhkq-uGsxo;
var tEHCc=0;
for(var i=0;i<ljZDa.length;i++)
{
var info=ljZDa[i];
var index=i+1;
var vcqxt=0;
var kGnDZ=0;
var cUxaT=info.NRAPX*info.YYVdP();
var n0=aVUPW.Ccoce()/100;
var tax=cUxaT*(n0/(1+n0));
cUxaT=cUxaT-tax;
vcqxt=cUxaT;
var LKkdj=info.YYVdP();
var oQivJ=aVUPW.ZrXNn(aVUPW.wRPKL(LKkdj));
LKkdj=LKkdj-oQivJ;
kGnDZ=info.NRAPX*LKkdj;
if(kGnDZ>vcqxt)
{
LKkdj=info.m_price;
LKkdj=LKkdj-oQivJ;
var JvKbh=LKkdj;
if((JvKbh>0)&&(JvKbh!=info.YYVdP()))
{
JvKbh=JvKbh-0.01;
}
UPDKp+=this.vXPfe("amount_"+index,JvKbh) 
kGnDZ=info.m_quantity*JvKbh;
}
tEHCc+=kGnDZ;
}
var uilMv=aVUPW.ZrXNn(ONhkq-tEHCc);
if(uilMv>0)
{
var index=ljZDa.length+1;
UPDKp+=this.vXPfe("item_name_"+index,Translator.tr("TVA correction"))
UPDKp+=this.vXPfe("quantity_"+index,1)
UPDKp+=this.vXPfe("amount_"+index,uilMv)
}
UPDKp+=this.vXPfe("tax_cart",jPIuo)
}
else
{
UPDKp+=this.vXPfe("tax_cart",aVUPW.VdwFG())
}
UPDKp+=this.vXPfe("handling_cart",uGsxo) 
UPDKp+="</form>"
return UPDKp;
}
KBmHw.uiCUs=function()
{
var ARlgI=this.TGrBV(ShRvZ);
var UPDKp="";
if(ARlgI.length>0)
{
UPDKp+=""+Translator.tr("Shipping information")+":\n";
UPDKp+=ARlgI;
}
return UPDKp;
}
KBmHw.Qowge=function()
{
var ARlgI=this.TGrBV(ApCkD);
var UPDKp="";
if(ARlgI.length>0)
{
UPDKp+=Translator.tr("Billing information")+":\n";
UPDKp+=ARlgI;
}
return UPDKp;
}
KBmHw.TGrBV=function(ToIiA)
{
var aVUPW=vEGnU();
var UPDKp="";
var FfKFl=new Array();
var aRBUh=eAlrV(CONST_WA_GLOBAL_SETTINGS.list_form_fields)
aRBUh.push("country")
aRBUh.push("state")
for(var i=0;i<aRBUh.length;i++)
{
var keIXs=aRBUh[i];
FfKFl[keIXs]=this.wLePG.vRFLS(keIXs,ToIiA)
}
if(FfKFl["firstname"])UPDKp+=FfKFl["firstname"]+"\n"
if(FfKFl["lastname"])UPDKp+=FfKFl["lastname"]+"\n"
if(FfKFl["company"])
{
UPDKp+=Translator.tr("form-label-company")+" : "+FfKFl["company"]+"\n"
}
if(FfKFl["address_1"]) UPDKp+=FfKFl["address_1"]+"\n"
if(FfKFl["address_2"]) UPDKp+=FfKFl["address_2"]+"\n"
if(FfKFl["zip"]) UPDKp+=FfKFl["zip"]+" "
if(FfKFl["city"]) UPDKp+=FfKFl["city"]+"\n"
if(FfKFl["country"])UPDKp+=Translator.country(FfKFl["country"])
if(FfKFl["state"]&&FfKFl["state"].length>0) UPDKp+=" "+FfKFl["state"];
UPDKp+="\n"
if(FfKFl["phone"]) UPDKp+=Translator.tr("form-label-phone")+" : "+FfKFl["phone"]+"\n"
if(FfKFl["fax"]) UPDKp+=Translator.tr("form-label-fax")+" : "+FfKFl["fax"]+"\n"
if(FfKFl["email"]) UPDKp+=FfKFl["email"]+"\n"
if(FfKFl["comment"])
{
UPDKp+=Translator.tr("form-label-comment")+" : \n";
UPDKp+=FfKFl["comment"]+"\n"
}
return UPDKp;
}
KBmHw.RqhYf=function()
{
var aVUPW=vEGnU();
var UPDKp="";
var ljZDa=aVUPW.XhYVd();
UPDKp+="**************\n"
for(var i=0;i<ljZDa.length;i++)
{
var wLePG=ljZDa[i];
var index=i+1;
var lYUTg=wLePG.nduWn;
if(wLePG.muces.length>0)
{
lYUTg+=" ["+wLePG.muces+"]";
}
var elDcE=""
if(wLePG.m_opt_vals)
{
for(var i_opt=0;i_opt<wLePG.avLiR.options.length;i_opt++)
{
var gSxKQ=wLePG.avLiR.options[i_opt]
if(gSxKQ)
{
if(elDcE.length>0)elDcE=elDcE+", "
var INCTB=wLePG.m_opt_vals[i_opt];
var aIFdo=gSxKQ.vals[INCTB]
var gBcZG=gSxKQ.title;
if(gBcZG.length>0) elDcE+=gBcZG+" : "
elDcE+=aIFdo
}
}
}
if(elDcE.length>0)lYUTg=lYUTg+"\n("+elDcE+")"
UPDKp+=lYUTg;
UPDKp+="\n"
UPDKp+=Translator.tr("Price")+" : "+aVUPW.uLUiB(wLePG.YYVdP())+"\n"
UPDKp+=Translator.tr("Quantity")+" : "+wLePG.NRAPX+"\n"
UPDKp+=Translator.tr("Total")+" : "+aVUPW.uLUiB(wLePG.YYVdP()*wLePG.NRAPX);
UPDKp+="\n"
UPDKp+="**************\n"
}
var CtjeU=aVUPW.RsvDf()
var nTwqE=aVUPW.VdwFG()
var hNeuT=aVUPW.LWYBB()
var ZrRdX=aVUPW.dWjVC() 
UPDKp+=Translator.tr("Sub total")+" : "+aVUPW.uLUiB(CtjeU)+"\n";
if(CONST_WA_GLOBAL_SETTINGS.shipping_type!=Oudbg)
{
UPDKp+=Translator.tr("Shipping amount")+" : "+aVUPW.uLUiB(hNeuT)+"\n";
}
if(aVUPW.lLNEd()||aVUPW.MeRCf())
{
if(aVUPW.lLNEd())
{
UPDKp+=Translator.tr("Tax included");
}
if(aVUPW.MeRCf())
{
UPDKp+=Translator.tr("Extra Tax");
}
UPDKp+=" : ";
UPDKp+=aVUPW.uLUiB(nTwqE)+"\n";
}
UPDKp+=Translator.tr("Total")+" : "+aVUPW.uLUiB(ZrRdX)+"\n";
return UPDKp;
}
KBmHw.JsoNn=function()
{
var aVUPW=vEGnU();
var UPDKp="";
var ljZDa=aVUPW.XhYVd()
UPDKp+="<table border=1 style=\"width:100%;text-align: left; margin-left: auto; margin-right: auto;\" cellpadding=2 cellspacing=2>"
UPDKp+="<tr class=\"crbst-table-title\">"
UPDKp+="<td>&nbsp;</td>"
UPDKp+="<td>"+Translator.tr("Price")+"</td>"
UPDKp+="<td>"+Translator.tr("Quantity")+"</td>"
UPDKp+="<td>"+Translator.tr("Total")+"</td>"
UPDKp+="</tr>"
for(var i=0;i<ljZDa.length;i++)
{
UPDKp+="<tr>"
var wLePG=ljZDa[i];
var index=i+1;
UPDKp+="<td>"
var lYUTg=wLePG.nduWn;
if(wLePG.muces.length>0)
{
lYUTg+=" ["+wLePG.muces+"]";
}
lYUTg="<b>"+lYUTg+"</b>"
var elDcE=""
if(wLePG.m_opt_vals)
{
for(var i_opt=0;i_opt<wLePG.avLiR.options.length;i_opt++)
{
var gSxKQ=wLePG.avLiR.options[i_opt]
if(gSxKQ)
{
if(elDcE.length>0)elDcE=elDcE+", "
var INCTB=wLePG.m_opt_vals[i_opt];
var aIFdo=gSxKQ.vals[INCTB]
var gBcZG=gSxKQ.title;
if(gBcZG.length>0) elDcE+=gBcZG+" : "
elDcE+=aIFdo
}
}
}
if(elDcE.length>0)lYUTg=lYUTg+"<br><span style='font-size:10px;'>("+elDcE+")</span>"
UPDKp+=lYUTg;
UPDKp+="</td>"
UPDKp+="<td>"+aVUPW.uLUiB(wLePG.YYVdP())+"</td>"
UPDKp+="<td>"+wLePG.NRAPX+"</td>"
UPDKp+="<td>"+aVUPW.uLUiB(wLePG.YYVdP()*wLePG.NRAPX)+"</td>"
UPDKp+="</tr>"
}
UPDKp+="<tr><td colspan=4>"
var CtjeU=aVUPW.RsvDf()
var nTwqE=aVUPW.VdwFG()
var hNeuT=aVUPW.LWYBB()
var ZrRdX=aVUPW.dWjVC() 
UPDKp+="<table border=0 width=100%>"
UPDKp+="<tr><td align=right >"+Translator.tr("Sub total")+" : "+aVUPW.uLUiB(CtjeU)+"</td></tr>";
if(CONST_WA_GLOBAL_SETTINGS.shipping_type!=Oudbg)
{
UPDKp+="<tr><td align=right>"+Translator.tr("Shipping amount")+" : "+aVUPW.uLUiB(hNeuT)+"</td></tr>";
}
if(aVUPW.lLNEd()||aVUPW.MeRCf())
{
if(aVUPW.lLNEd())
{
UPDKp+="<tr><td align=left >"+Translator.tr("Tax included");
}
if(aVUPW.MeRCf())
{
UPDKp+="<tr><td align=right >"+Translator.tr("Extra Tax");
}
UPDKp+=" : ";
UPDKp+=aVUPW.uLUiB(nTwqE)+"</td></tr>";
}
UPDKp+="<tr><td align=right class=\"crbst-card-total\">"+Translator.tr("Total")+" : "+aVUPW.uLUiB(ZrRdX)+"</td></tr>";
UPDKp+="</table>" 
UPDKp+="</td></tr>"
UPDKp+="</table>"
UPDKp=UPDKp.replace(/\"/g,"'")
return UPDKp;
}
KBmHw.WhYiw=function(Wrfck)
{
if((""+Wrfck).length==1)Wrfck="0"+Wrfck;
return Wrfck
}
KBmHw.bDkvi=function()
{
var aVUPW=vEGnU();
var UPDKp=""
if(vhMSG.charCodeAt(3)>=100) return""
if(qxNLL)
{
UPDKp+="<form id='wa-http-sender' method=POST action='"+qxNLL_URL+"crbst_market_print_form.php' target='_blank'>"
}
else
{
UPDKp+="<form id='wa-http-sender' method=POST action='crbst_market_print_form.php' target='_blank'>"
}
UPDKp+=this.vXPfe("type_payment",this.wLePG.eUOmb)
UPDKp+=this.vXPfe("MAIL_TITLE_PREFIXE",Translator.tr("title email Order notification"))
UPDKp+=this.vXPfe("MAIN_TITLE",Translator.tr("PRINT_FORM_MAIN_TITLE"))
UPDKp+=this.vXPfe("PREFIXE_ORDER",Translator.tr("PRINT_FORM_PREFIXE_ORDER"))
var ofkmU=""
var hDvus=new Date()
ofkmU+="wa-"+this.WhYiw(hDvus.getYear()-100)+this.WhYiw(hDvus.getMonth()+1)+this.WhYiw(hDvus.getDate())
ofkmU+=hDvus.getHours()+this.WhYiw(hDvus.getMinutes())+this.WhYiw(hDvus.getSeconds())
ofkmU+="-"+Math.round(Math.random()*100) 
UPDKp+=this.vXPfe("ID_ORDER",ofkmU)
UPDKp+=this.vXPfe("CARD_TITLE",Translator.tr("PRINT_FORM_CARD_TITLE"))
UPDKp+=this.vXPfe("LABEL_TYPE_PAYMENT",Translator.tr("PRINT_FORM_LABEL_TYPE_PAYMENT"))
UPDKp+=this.vXPfe("send_copy_email_to_buyer",(aVUPW.send_copy_email_to_buyer)?"1":"0") 
UPDKp+=this.vXPfe("email_buyer",this.wLePG.vRFLS("email",ShRvZ))
if(this.wLePG.eUOmb=="check")
{
UPDKp+=this.vXPfe("TYPE_PAYMENT",Translator.tr("PRINT_FORM_TYPE_CHECK"))
UPDKp+=this.vXPfe("MESSAGE_CHECK",Translator.tr("PRINT_FORM_MESSAGE_CHECK"))
}
if(this.wLePG.eUOmb=="wire")
{
UPDKp+=this.vXPfe("TYPE_PAYMENT",Translator.tr("PRINT_FORM_TYPE_WIRE"))
UPDKp+=this.vXPfe("MESSAGE_CHECK",Translator.tr("PRINT_FORM_MESSAGE_WIRE"))
}
UPDKp+=this.vXPfe("LABEL_PRINT",Translator.tr("PRINT_FORM_LABEL_PRINT"))
UPDKp+=this.vXPfe("card_html",this.JsoNn())
UPDKp+=this.vXPfe("card_plain_text",this.RqhYf())
UPDKp+=this.vXPfe("LABEL_SELLER_INFORMATION",Translator.tr("Seller information"))
UPDKp+=this.vXPfe("LABEL_BANK_ACCOUNT",Translator.tr("Bank account information"))
UPDKp+=this.vXPfe("LABEL_ADDRESS",Translator.tr("Address"))
UPDKp+=this.vXPfe("seller_address",CONST_WA_GLOBAL_SETTINGS.seller_address)
UPDKp+=this.vXPfe("bank_account_informations",CONST_WA_GLOBAL_SETTINGS.bank_account_informations)
UPDKp+=this.vXPfe("buyer_info_shipping",this.uiCUs())
var wpMJA=""
if(wLePG.ZZksR)
{
wpMJA=this.Qowge();
};
UPDKp+=this.vXPfe("buyer_info_billing",wpMJA)
UPDKp+="</form>"
return UPDKp;
}
KBmHw.BFhqQ=function()
{
var aVUPW=vEGnU();
aVUPW.QkQZL()
this.closeWin()
}
KBmHw.imCWD=function()
{
var aVUPW=vEGnU();
var TCwCp=((this.wLePG.eUOmb=="check")||(this.wLePG.eUOmb=="wire")) 
if(this.wLePG.eUOmb=="paypal")
{
this.addButton(Translator.tr('Clear cart'),this.BFhqQ,[""],this)
this.initializeWindow(400,200)
}
else
{
this.initializeWindow(400,150)
}
var UPDKp=""
if(this.wLePG.eUOmb=="paypal")
{
UPDKp+=this.lZoWl()
}
if(TCwCp)
{
UPDKp+=this.bDkvi()
if((qxNLL==false)&&(document.webaca_is_preview))
{
WA_Dialog.alert(Translator.tr("Operation not allowed in preview mode"))
return
}
}
UPDKp+="<table border=0 style='width:100%;'><tr>";
UPDKp+="<td align=center style='"+this.cssText1()+"'>"
UPDKp+=Translator.tr("You have been redirected to the payment page")
if(this.wLePG.eUOmb=="paypal")
{
UPDKp+="<br><br>"
UPDKp+=Translator.tr("You can clear your cart")
}
UPDKp+="</td></tr></table>"
this.writeContent(UPDKp) 
if(vhMSG.charCodeAt(3)>=100)
{
WA_Dialog.alert(Translator.tr("This cariboost edition can't support ebusiness features !'"))
return;
}
var OGACI=document.getElementById("wa-http-sender")
OGACI.submit()
if(TCwCp)
{
aVUPW.QkQZL()
}
}
KBmHw.wLePG=wLePG
KBmHw.imCWD()
}

-->
