<!--

var jvtgU=0
var PiAJi=1
var fIdqI=2
var VwvMK=0;
var tIrjF=1;
var KOmpA=2;
var sJgFK=0
var aYSiN=1
var REkSC=false 
function WA_marketRemoveItem(vmdJt)
{
xmpVH().GQIeu(vmdJt)
var SqLcO=WA_Dialog.getCurrent();
SqLcO.DxipC()
}
function xmpVH()
{
if(document.wa_global_settings_market==undefined)document.wa_global_settings_market=new XlNVC()
return document.wa_global_settings_market;
}
function bkqXa()
{
this.OSLHp=function()
{
return this.vtEPS+"-"+this.MjslD_index
}
this.bjWhh=function(GfaJU,asEjs)
{
this.MjslD=GfaJU.obj.market.info.folder.substring(13);
this.MjslD_index=GfaJU.obj.index;
this.MjslD_modif=GfaJU.obj.market.info.critical_id_modif
this.vtEPS=GfaJU.obj.market.id 

this.IcpjO=1;
this.ZUbSX=GfaJU.title;
this.NCceR=GfaJU.price;
this.grDoG=GfaJU.weight;
this.QRZbR=GfaJU.code_product;
}
this.JJtZp=function(GfaJU,asEjs)
{

this.ZUbSX=GfaJU.title;
this.NCceR=GfaJU.price;
this.grDoG=GfaJU.weight;
this.QRZbR=GfaJU.code_product;
}
this.AGPUL=function()
{
var s="";
s+=this.OSLHp();
if(this.m_opt_vals)
for(var i=0;i<this.m_opt_vals.length;i++)
{
var YKetZ=this.m_opt_vals[i]
if(YKetZ!=-1) s+="/"+YKetZ;
}
return s;
}
this.eILuI=function()
{
var val="";
val+="j="+this.MjslD+",";
val+="i="+this.MjslD_index+",";
val+="m="+this.MjslD_modif+",";
val+="q="+this.IcpjO+",";
if(this.m_opt_vals)
{
for(var i=0;i<this.m_opt_vals.length;i++)
{
val+="o"+i+"=";
var CiBhI=this.m_opt_vals[i]
if(CiBhI>-1)
val+=CiBhI
else
val+=""
val+=","
}
}
return val;
}
this.LnCko=function(map,k)
{
var v=map[k];
if(v=="undefined") return "";
return v;
}
this.bPcKL=function(map)
{
this.MjslD=this.LnCko(map,"j");
if(this.MjslD=="") return false;
this.MjslD_index=this.LnCko(map,"i");
this.MjslD_modif=this.LnCko(map,"m");
this.IcpjO=parseInt(map["q"]);
this.m_opt_vals=new Array();
for(var i=0;i<3;i++)
{
var cRcDt=parseInt(map["o"+i]);
if(isNaN(cRcDt))cRcDt=-1;
this.m_opt_vals.push(cRcDt)
}
return true;
}
this.QUMKR=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.kKJQq=function(nZpTf)
{
var PXZMO=this.QUMKR(nZpTf)
return this.bPcKL(PXZMO) 
}
this.HPYWp=function()
{
return oNukS(this.GfaJU,this.m_opt_vals)
}
}
function dDdoP(xBvfW,SfDLw)
{
var IppHq=xBvfW[0]
var tmGGQ=xBvfW[1]
var hGtFU=xBvfW[2]
if(IppHq.length==0)
{
hGtFU.call(tmGGQ)
return;
}
var js=IppHq.pop()
WA_loadScript(js.src,dDdoP,[IppHq,tmGGQ,hGtFU]);
}
function WA_arrayContains(cEeNc,nZpTf)
{
for(var n=0;n<cEeNc.length;n++){if(cEeNc[n]==nZpTf)return true;}
return false;
}
function YFJql(cEeNc)
{
var PXZMO=new Array()
for(var n=0;n<cEeNc.length;n++)
{
var urcGh=cEeNc[n]
if(urcGh=="address") PXZMO=PXZMO.concat(["address_1","address_2","city","zip"])
else PXZMO.push(urcGh)
}
return PXZMO;
}
function UMoHb()
{
this.YbjIQ=function()
{
if(this.NJGnp.length==0)return CONST_WA_GLOBAL_SETTINGS.default_selected_country;
return this.NJGnp;
}
this.DejrR=function()
{
this.uvxWA()
}
this.QUMKR=function(s)
{
var iPnGt=new Array();
var tab=s.split(",");
for(var i=0;i<tab.length;i++)
{
var tab3=tab[i].split("=");
if(tab3.length==2)iPnGt[tab3[0]]=tab3[1];
}
return iPnGt;
}
this.LdqAa=function(WFSII)
{
if(WFSII==undefined) return ""
return(WFSII==sJgFK)?"deliv-":"bill-"
}
this.dfWEk=function(FSSMX,WFSII,PNVdD)
{
if(!PNVdD)PNVdD=""
var hGSAX=this.LdqAa(WFSII)
if(FSSMX=="country")
{
if(WFSII==sJgFK) return this.NJGnp
if(WFSII==aYSiN) FSSMX="countryCode"
}
if(FSSMX=="state")
{
FSSMX="stateCode"
}
var YKetZ=this.QeEEY[hGSAX+FSSMX]
if(!YKetZ) return PNVdD
YKetZ=YKetZ.replace(/\"/g,"'")
return YKetZ
}
this.KriWv=function(YKetZ)
{
if(YKetZ==undefined)return ""
return YKetZ
}
this.QYvPs=function(key,val)
{
if((val==null)||(val==undefined)) val="";
WA_SetCookie("crbst-card-"+key,val)
}
this.UppKp=function(key)
{
var tmGGQ=WA_GetCookie("crbst-card-"+key)
if(tmGGQ=="null")tmGGQ="";
return ""+tmGGQ
}
this.smBHm=function()
{
this.QeEEY=new Array()
var nZpTf=this.UppKp("order-infos")
var PXZMO=this.QUMKR(nZpTf)
for(var k1 in PXZMO)
{
var YKetZ=PXZMO[k1]
if((k1.indexOf("deliv-")==0)||(k1.indexOf("bill-")==0))
this.QeEEY[k1]=unescape(YKetZ)
}
this.NJGnp=this.KriWv(PXZMO["countryCode"])
this.bqvFa=this.KriWv(PXZMO["typePayment"])
this.nxVIf=(this.KriWv(PXZMO["differentBillingAddressChecked"])=="true")
this.ICLAv=(this.KriWv(PXZMO["salesConditionChecked"])=="true")
}
this.uvxWA=function()
{
var nZpTf=""
for(var k1 in this.QeEEY)
{
var YKetZ=this.QeEEY[k1]
nZpTf+=k1+"="+escape(YKetZ)+","
}
var NmWTL=""
NmWTL+="countryCode="+escape(this.NJGnp)+","
NmWTL+="typePayment="+escape(this.bqvFa)+","
NmWTL+="differentBillingAddressChecked="+(this.nxVIf)+","
NmWTL+="salesConditionChecked="+(this.ICLAv)+","
nZpTf+=NmWTL 
this.QYvPs("order-infos",nZpTf)
}
this.XZCWW=function(kPXHC)
{
if(trimString(kPXHC.value).length==0)
{
kPXHC.style.backgroundColor="#ff0000"
kPXHC.focus()
return false;;
}
kPXHC.style.backgroundColor=""
return true;
}
this.CYdBc=function(WFSII)
{
var wRnte=YFJql(CONST_WA_GLOBAL_SETTINGS.list_form_fields)
var CQdoH=YFJql(CONST_WA_GLOBAL_SETTINGS.list_mandatory_form_fields) 
var bdoNe=this.QeEEY;
var hGSAX=this.LdqAa(WFSII) 
var bnDlX=document.getElementById("wa-market-form")
for(var n=0;n<wRnte.length;n++)
{
var omOau=wRnte[n]
var rZwRY=bnDlX[omOau]
var YKetZ=trimString(rZwRY.value)
if(omOau!="address_2")
if(WA_arrayContains(CQdoH,omOau))
{
if(this.XZCWW(rZwRY)==false)return false;
}
bdoNe[hGSAX+omOau]=YKetZ
}
var joNqk=document.getElementById("wa-select-state");
var hrKIH=document.getElementById("wa-market-state");
if(joNqk&&(hrKIH.style.display!="none"))
{
if(this.XZCWW(joNqk)==false)return false;
bdoNe[hGSAX+"stateCode"]=joNqk.value
}
else
{
bdoNe[hGSAX+"stateCode"]=""
}
if(WFSII==aYSiN)
{
var iBFLj=document.getElementById("wa-select-form-country");
if(iBFLj)
{
bdoNe[hGSAX+"countryCode"]=iBFLj.value
}
}
this.uvxWA()
return true;
}
this.NJGnp=""
this.bqvFa=""
this.nxVIf=false;
this.ICLAv=false
this.smBHm()
}
function XlNVC()
{
this.sTNEO=new Array();
this.tmGGQ_callback=false;
this.HGBUs=false;
this.MaDpQ=false;
this.XwFIC=new UMoHb()
this.WbnkD=function(tmGGQ,hGtFU)
{
this.tmGGQ_callback=tmGGQ
this.HGBUs=hGtFU 
var BRZYx=this.UppKp("data")
this.xEFWL(BRZYx) 
var IppHq=new Array()
var cEeNc=this.sTNEO;
for(var i=0;i<cEeNc.length;i++)
{
var dQfNF=cEeNc[i];
var nBhqt=Translator.m_lang_for_filename
if(nBhqt.length>0)nBhqt="_"+nBhqt;
var RLJFV=dQfNF.MjslD;
var n=RLJFV.indexOf("_")
if(n>-1)RLJFV=RLJFV.substring(n+1)
dQfNF.vtEPS="wa-id-"+RLJFV 
var hjRDG=wa_global_market.markets[dQfNF.vtEPS]
if(this.MaDpQ==false)
if(!hjRDG)
{
var wobhJ="crbst_market_"+dQfNF.MjslD+'/'
WA_declareMarket(dQfNF.vtEPS,wobhJ,dQfNF.MjslD_modif) 
var pUrRj=wobhJ+'market-definition'+nBhqt+'.js?v='+dQfNF.MjslD_modif
IppHq.push({id:RLJFV,src:pUrRj})
}
}
dDdoP([IppHq,this,this.KSJxG],true)
}
this.jjbfP=function()
{
this.QYvPs("data","")
this.XwFIC.QYvPs("order-infos","")
this.XwFIC.smBHm()
this.xEFWL("")
}
this.KSJxG=function()
{
this.MaDpQ=true;
var cEeNc=this.sTNEO;
var vUUXs=new Array();
for(var i=0;i<cEeNc.length;i++)
{
var dQfNF=cEeNc[i];
var RLJFV=dQfNF.vtEPS
var lqwhh=wa_global_market.markets[RLJFV] 

if(lqwhh.info)
{
var UmDJh=lqwhh.info.products 
var asEjs=dQfNF.MjslD_index
var GfaJU=UmDJh[asEjs]
dQfNF.GfaJU=GfaJU
dQfNF.JJtZp(dQfNF.GfaJU,asEjs)
if((GfaJU.unavail==false)&&(dQfNF.MjslD_modif==lqwhh.info.critical_id_modif))
{
vUUXs.push(dQfNF)
}
}
else
{
}
}
this.sTNEO=vUUXs
this.XlEpY() 

this.HGBUs.call(this.tmGGQ_callback)
}
this.xEFWL=function(SrQex)
{
var cEeNc=new Array();
var list_string_products=SrQex.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 dQfNF=new bkqXa();
if(dQfNF.kKJQq(s_data))
{
cEeNc.push(dQfNF);
}
}
}
this.sTNEO=cEeNc;
var TFsbs=this.ArraG()
if(WA_getNumberMarketItemsInCart()!=TFsbs)
{
this.pctmQ()
this.UwjQt()
}
}
this.bdkRo=function()
{
var jCTGE=''
try{jCTGE=CONST_WA_GLOBAL_SETTINGS.currency_mnemonic}catch(e){}
return jCTGE
}
this.GQIeu=function(vmdJt)
{
var list2=new Array();
var cEeNc=this.sTNEO
for(var i=0;i<cEeNc.length;i++)
{
var dQfNF=cEeNc[i];
if(i!=vmdJt)
{
list2.push(dQfNF);
}
}
this.sTNEO=list2;
this.XlEpY()
}
this.addProductToShoppingCard=function(GfaJU,optionsValues)
{
if(this.xJGNx()==false)
{
WA_Dialog.alert(Translator.tr("You can't use shopping card Your browser doesnt accept cookies !"));
return false;
}
var KTqKL=GfaJU.obj
var cEeNc=this.KpEbm();
var n=cEeNc.length
var iIHPa=new bkqXa()
iIHPa.bjWhh(GfaJU,n);
iIHPa.m_opt_vals=optionsValues
var b_match=false;
for(var i=0;i<cEeNc.length;i++)
{
var dQfNF=cEeNc[i];
if(dQfNF.AGPUL()==iIHPa.AGPUL())
{
b_match=true;
dQfNF.IcpjO++;
}
}
if(b_match==false)
{
var BRZYx=this.UppKp("data")
var JGdxl=iIHPa.eILuI()
var fllUi=BRZYx.length+JGdxl.length 
if(fllUi>4000)
{
WA_Dialog.alert(Translator.tr("Cookies cart contains max data !"));
return false;
}
cEeNc.push(iIHPa);
}
return true
}
this.jkgAm=function()
{
var cEeNc=this.sTNEO
var BRZYx="";
for(var i=0;i<cEeNc.length;i++)
{
var info=cEeNc[i];
BRZYx+=info.eILuI()+";";
}
return BRZYx;
}
this.ArraG=function()
{
var FOJHH=0;
var cEeNc=this.sTNEO;
for(var i=0;i<cEeNc.length;i++)
{
var dQfNF=cEeNc[i];
FOJHH+=dQfNF.IcpjO
}
return FOJHH;
}
this.pctmQ=function()
{
this.QYvPs("nb_items",this.ArraG())
}
this.XlEpY=function()
{
var cEeNc=this.sTNEO
var BRZYx=this.jkgAm()
this.QYvPs("data",BRZYx)
this.pctmQ()
this.UwjQt();
}
this.UwjQt=function()
{
WA_refreshNumberMarketItemsInCart()
}
this.KpEbm=function()
{
return this.sTNEO;
}
this.xJGNx=function()
{
this.QYvPs("watestcookies","test")
return(this.UppKp("watestcookies")=="test");
}
this.QYvPs=function(key,val)
{
if((val==null)||(val==undefined)) val="";
WA_SetCookie("crbst-card-"+key,val)
}
this.UppKp=function(key)
{
var tmGGQ=WA_GetCookie("crbst-card-"+key)
if(tmGGQ=="null")tmGGQ="";
return ""+tmGGQ
}
this.vPYxu=function(v)
{
v=this.Svwjv(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;
}
return result;
}
this.oHkig=function(v)
{
var result=this.vPYxu(v);
if(CONST_WA_GLOBAL_SETTINGS.currency_code=="GBP")
{
result=this.bdkRo()+result;
}
else
{
result=result+" "+this.bdkRo();
}
return result;
}
this.pivOd=function(v)
{
return this.vPYxu(v)+" "+CONST_WA_GLOBAL_SETTINGS.currency_code;
}
this.Svwjv=function(IAbcG)
{
return Math.round(IAbcG*100)/100
}
this.kXmrD=function()
{
var cEeNc=this.KpEbm()
var price=0;
for(var i=0;i<cEeNc.length;i++)
{
var dQfNF=cEeNc[i];
price+=(dQfNF.HPYWp()*dQfNF.IcpjO);
}
return price;
}
this.computeShippingForValue=function(val)
{
var awSRr=CONST_WA_GLOBAL_SETTINGS.shipping_type
if(awSRr==jvtgU)return 0;
var ship_val=0;
var HhgRj=CONST_WA_GLOBAL_SETTINGS.shipping_intervals
for(var i=0;i<HhgRj.length;i++)
{
var KOYxs=HhgRj[i];
if(KOYxs.v<val)ship_val=KOYxs.p
}
return ship_val;
}
this.KNWuu=function(JlJxG)
{
var PXZMO=CONST_WA_GLOBAL_SETTINGS.iPnGt_list_extra_shipping_by_country_code
if(PXZMO==undefined)
{
PXZMO=new Array()
CONST_WA_GLOBAL_SETTINGS.iPnGt_list_extra_shipping_by_country_code=PXZMO;
var qkQBA=CONST_WA_GLOBAL_SETTINGS.list_extra_shipping_by_country_code
for(var vmdJt in qkQBA)
{
var HaXTg=qkQBA[vmdJt];
var TVqIP=HaXTg.c
for(var Ftawn in TVqIP)
{
var tDRuZ=TVqIP[Ftawn];PXZMO[tDRuZ]=HaXTg.p;
}
}
}
return PXZMO[JlJxG];
}
this.pZlpu=function(JlJxG)
{
var PXZMO=CONST_WA_GLOBAL_SETTINGS.iPnGt_list_tva_by_country_code
if(PXZMO==undefined)
{
PXZMO=new Array()
CONST_WA_GLOBAL_SETTINGS.iPnGt_list_tva_by_country_code=PXZMO;
var qkQBA=CONST_WA_GLOBAL_SETTINGS.list_tva_by_country_code
for(var vmdJt in qkQBA)
{
var HaXTg=qkQBA[vmdJt];
var TVqIP=HaXTg.c;
for(var Ftawn in TVqIP)
{
var tDRuZ=TVqIP[Ftawn];PXZMO[tDRuZ]=HaXTg.p;
}
}
}
return PXZMO[JlJxG];
}
this.BjDlo=function()
{
var awSRr=CONST_WA_GLOBAL_SETTINGS.shipping_type
var cEeNc=this.KpEbm()
var global_ref_for_shipping=0;
var rtHUZ=0;
var NJGnp=this.XwFIC.NJGnp;
if(NJGnp.length>0)
{
rtHUZ=this.KNWuu(NJGnp);
if(isNaN(rtHUZ)) rtHUZ=0;
}
for(var i=0;i<cEeNc.length;i++)
{
var dQfNF=cEeNc[i];
if(awSRr==PiAJi)
{
global_ref_for_shipping+=(dQfNF.IcpjO*dQfNF.HPYWp());
}
if(awSRr==fIdqI)
{
global_ref_for_shipping+=(dQfNF.IcpjO*dQfNF.grDoG);
}
}
return rtHUZ+this.Svwjv(this.computeShippingForValue(global_ref_for_shipping));
}
this.XmCWw=function()
{
return CONST_WA_GLOBAL_SETTINGS.tva_type==tIrjF
}
this.mTTue=function()
{
return CONST_WA_GLOBAL_SETTINGS.tva_type==KOmpA
}
this.jEBPp=function()
{
return CONST_WA_GLOBAL_SETTINGS.tva_type==VwvMK
}
this.YUKaa=function()
{
if(this.jEBPp())return 0;
var tax=0;
var country_code=this.XwFIC.NJGnp;
if(country_code.length>0)
{
tax=this.pZlpu(country_code);
if(isNaN(tax))tax=0;
}
return tax;
}
this.jNCXa=function(IAbcG)
{
if(this.XmCWw())
{
var n0=this.YUKaa()/100;
return IAbcG*(n0/(1+n0));
}
if(this.mTTue())
{
return IAbcG*this.YUKaa()/100;
}
return IAbcG;
}
this.dTpsv=function()
{
if(this.jEBPp())return 0;
var cEeNc=this.KpEbm()
var xhiwn=0;
var qFggK=0;
for(var i=0;i<cEeNc.length;i++)
{
var dQfNF=cEeNc[i];
xhiwn+=(dQfNF.HPYWp()*dQfNF.IcpjO);
}
xhiwn+=this.BjDlo();
qFggK=this.Svwjv(this.jNCXa(xhiwn));
return qFggK;
}
this.MvwbH=function()
{
var IAbcG=0;
IAbcG+=this.kXmrD()
if(this.mTTue())IAbcG+=this.dTpsv()
IAbcG+=this.BjDlo()
return IAbcG;
}
}
function tmISx(FORcV,RHhBZ)
{
if(FORcV.lab<RHhBZ.lab) return-1;
if(FORcV.lab>RHhBZ.lab) return 1;
return 0
}
function WA_marketWatchQuantity()
{
var SqLcO=WA_Dialog.getCurrent()
SqLcO.fgIBt()
}
function WA_displayDialogMarketCart()
{
var SqLcO=new WA_Dialog();
SqLcO.durNS=false;
SqLcO.CUUcc=function()
{
this.DERTl()
this.durNS=setInterval("WA_marketWatchQuantity()",400)
}
SqLcO.DERTl=function()
{
if(this.durNS)clearInterval(this.durNS)
}
SqLcO.fgIBt=function()
{
var JCsHN=xmpVH();
var EhHBY=JCsHN.KpEbm();
for(var n=0;n<EhHBY.length;n++)
{
var dQfNF=EhHBY[n]
var aJDIr=document.getElementById("wa-cart-quantity-"+n)
var NLfCh=aJDIr.value
var MbFdC=parseInt(NLfCh)
if(isNaN(MbFdC))MbFdC=0;
if((NLfCh!='')&&(MbFdC+""!=NLfCh))
{
aJDIr.value=""+MbFdC
}
if(MbFdC!=dQfNF.IcpjO)
{
dQfNF.IcpjO=MbFdC
JCsHN.XlEpY()
this.hTLou()
}
}
}
SqLcO.onCustomKeypress=function(cnBOm)
{
if(cnBOm==13)
{
wa_timeout(Delegate.create(this,this.TOqsw),0);
}
return false;
}
SqLcO.closeWin=function()
{
this.DERTl()
this.intern_closeWin()
}
SqLcO.hTLou=function()
{
var JCsHN=xmpVH();
var EhHBY=JCsHN.KpEbm();
if(EhHBY.length==0) return;
for(var n=0;n<EhHBY.length;n++)
{
var dQfNF=EhHBY[n]
var HAhrM=document.getElementById("wa-cart-total-"+n)
var IAbcG=dQfNF.HPYWp() 
var xilpB=dQfNF.IcpjO*IAbcG
var nZpTf="<span style='"
nZpTf+=(xilpB>0)?"color:"+WA_GLOBAL_COLOR_THEME.color_text+";font-weight:normal;":"color:#ff0000;font-weight:bold;"
nZpTf+="'>"
nZpTf+=JCsHN.oHkig(xilpB)
nZpTf+="</span>"
HAhrM.innerHTML=nZpTf
}
var lwgWc=JCsHN.kXmrD()
var KXPHI=JCsHN.dTpsv()
var NDKEJ=JCsHN.BjDlo()
var AlEBd=JCsHN.MvwbH()
var ZKnIG=""
var HAhrM=document.getElementById("wa-cart-amount-total")
ZKnIG+=Translator.tr("Sub total")+" : "+JCsHN.oHkig(lwgWc)
ZKnIG+="<br>"
if(NDKEJ>0)
{
ZKnIG+="<span>"+Translator.tr("Shipping amount")+" : "+JCsHN.oHkig(NDKEJ)+"</span>";
ZKnIG+="<br>"
}
if(JCsHN.XmCWw()||JCsHN.mTTue())
{
if(JCsHN.XmCWw())
{
ZKnIG+="<div style='width:100%;text-align:left;'>"
ZKnIG+=Translator.tr("Tax included");
}
if(JCsHN.mTTue())
{
ZKnIG+="<div>"
ZKnIG+=Translator.tr("Extra Tax");
}
ZKnIG+=" : ";
ZKnIG+=JCsHN.oHkig(KXPHI)+"</div>";
}
ZKnIG+="<span><b>"+Translator.tr("Total")+" : "+JCsHN.oHkig(AlEBd)+"</b></span>";
HAhrM.innerHTML=ZKnIG
}
SqLcO.Pangk=function()
{
WA_displayDialogMarketCart()
}
SqLcO.LKCmY=function()
{
this.closeWin()
}
SqLcO.TOqsw=function()
{
var JCsHN=xmpVH();
if(WA_getNumberMarketItemsInCart()==0)return;
var cZAUv=document.getElementById("wa-market-select-country")
JCsHN.XwFIC.NJGnp=cZAUv.value
if(JCsHN.XwFIC.NJGnp=="")
{
var cZAUv=document.getElementById("wa-market-select-country")
if(cZAUv)
{
cZAUv.focus()
cZAUv.style.backgroundColor="#ff0000"
return;
}
}
if(CONST_WA_GLOBAL_SETTINGS.link_sale_condition)
{
if(JCsHN.XwFIC.ICLAv!=true)
{
var RfEdI=document.getElementById("wa-sales-condition")
if(RfEdI)
{
RfEdI.focus()
var FlLAq=document.getElementById("wa-sales-condition-label")
FlLAq.style.backgroundColor="#ff0000"
return;
}
}
}
if(JCsHN.XwFIC.bqvFa=="")
{
var cZAUv=document.getElementById("wa-market-select-payment")
if(cZAUv)
{
}
cZAUv.focus()
cZAUv.style.backgroundColor="#ff0000"
return;
}
EgAZL()
}
SqLcO.DxipC=function()
{
WA_exec_callback_opera_compliant(this,this.AwGRb)
}
SqLcO.AwGRb=function()
{
var JCsHN=xmpVH();

var iBFLj=document.getElementById("wa-market-select-country")
JCsHN.XwFIC.NJGnp=iBFLj.value
JCsHN.XwFIC.DejrR()
var doChr=html_getLayer("market-cart-content")
var xViUh=html_getLayer("wa-market-payment-form") 
var nZpTf=""
var EhHBY=JCsHN.KpEbm();
html_SetVisibility(xViUh,(EhHBY.length>0))
if(EhHBY.length==0)
{
nZpTf+="<span style='font-family:Arial;font-size:16px;'>"
nZpTf+=Translator.tr("No articles in Card !")
nZpTf+="</span>"
}
else
{
var fmseU="border:1px solid "+WA_GLOBAL_COLOR_THEME.color0+";font-weight:normal;"
var kcvDi="border:1px solid "+WA_GLOBAL_COLOR_THEME.color0+";color:#ff0000;font-weight:bold;"
var DwesO="color:#222222;font-size:12px;"
nZpTf+="<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+";'>"
nZpTf+="<thead style='font-size:13px;border:1px solid;'>"
nZpTf+="<tr>"
nZpTf+="<th  colspan=2 style='"+fmseU+"'></th>" 
nZpTf+="<th style='"+fmseU+"'  width=70px><b>"+Translator.tr("Price")+"</b></th>"
nZpTf+="<th style='"+fmseU+"'  width=70px><b>"+Translator.tr("Quantity")+"</b></th>"
nZpTf+="<th style='"+fmseU+"'  width=70px><b>"+Translator.tr("Total")+"</b></th>"
nZpTf+="<th style='"+fmseU+"'  width=90px></th>"
nZpTf+="</tr>"
for(var n=0;n<EhHBY.length;n++)
{
var dQfNF=EhHBY[n]
nZpTf+="<tr>"
nZpTf+="<th style='"+fmseU+"' >"
var lqwhh=wa_global_market.markets[dQfNF.vtEPS]
var oUKuE=new Size(30,30)
var BsanL=oUKuE
if(lqwhh.info.design.crop_thumb==false)
{
BsanL=dQfNF.GfaJU.size_thumb.clone()
BsanL.scale(oUKuE)
}
else
{
}
if(dQfNF.GfaJU.img_thumb.length>0)
nZpTf+="<img border=0 src='"+dQfNF.GfaJU.img_thumb+"' width="+BsanL.width+"px height="+BsanL.height+"px>"
nZpTf+="</th>"
nZpTf+="<th style='"+fmseU+"text-align:left;padding:5px;background-color:"+WA_GLOBAL_COLOR_THEME.color1+";' >"
nZpTf+="<b>"+dQfNF.ZUbSX+"</b>"
if(dQfNF.QRZbR.length>0)
{
nZpTf+="<span style='"+DwesO+"'>";
nZpTf+=" ["+dQfNF.QRZbR+"]";
nZpTf+="</span>";
}
if(dQfNF.m_opt_vals)
{
nZpTf+="<br>"
nZpTf+="<span style='"+DwesO+"'>";
for(var i_opt=0;i_opt<dQfNF.GfaJU.options.length;i_opt++)
{
var DJFVf=dQfNF.GfaJU.options[i_opt]
if(DJFVf)
{
var OHalt=dQfNF.m_opt_vals[i_opt];
var YclbQ=DJFVf.title;
if(YclbQ.length>0)
{
nZpTf+=YclbQ;
nZpTf+=":"
}
nZpTf+=DJFVf.vals[OHalt];
nZpTf+=" "
}
}
nZpTf+="</span>";
}
nZpTf+="</th>"
var IAbcG=dQfNF.HPYWp()
nZpTf+="<th style='"+fmseU+"' >"+JCsHN.oHkig(IAbcG)+"</th>"
nZpTf+="<th style='"+fmseU+"'  align=center><input type=text id='wa-cart-quantity-"+n+"' style='width:45px;' maxlength=3 value='"+dQfNF.IcpjO+"' type=text/></th>"
nZpTf+="<th style='"
var xilpB=dQfNF.IcpjO*IAbcG
nZpTf+=(xilpB>0)?fmseU:kcvDi;
nZpTf+="' ><span id='wa-cart-total-"+n+"'>"
nZpTf+=JCsHN.oHkig(xilpB)
nZpTf+="</span></th>"
nZpTf+="<th style='"+fmseU+"' ><a href=\"javascript:WA_marketRemoveItem("+n+")\">"+Translator.tr("Remove card item")+"</a></th>"
nZpTf+="</tr>"
}
nZpTf+="<tr>"
nZpTf+="<th style='"+fmseU+"text-align:right;padding:5px;' id='wa-cart-amount-total'  colspan=5>&nbsp;</th>"
nZpTf+="<th style='"+fmseU+"' ></th>"
nZpTf+="</tr>"
nZpTf+="</thead>"
nZpTf+="</table>"
nZpTf+="<br>"
}
doChr.innerHTML=nZpTf
this.CUUcc()
WA_exec_callback_opera_compliant(this,this.hTLou) 
}
SqLcO.wgpMk=function()
{
var JCsHN=xmpVH();
this.addButton(Translator.tr("Continue Shopping"),this.LKCmY,[""],this)
this.addButton(Translator.tr("Checkout order"),this.TOqsw,[""],this)
this.initializeWindow(670,700)
var RYehb="font-family:Arial;font-size:12px;color:#000000;"
var nZpTf=""
nZpTf+="<div id='market-cart-content' style='width:100%;"+RYehb+"' align=center>" 
nZpTf+="</div>"
nZpTf+="<br>"
nZpTf+="<div style='width:100%;"+RYehb+"' align=center id='wa-market-payment-form'>"
nZpTf+="<br>"
nZpTf+="<span style='font-weight:bold;'>"
nZpTf+=Translator.tr("Please choose a country to deliver your order")
nZpTf+="</span>"
nZpTf+="<br>"
nZpTf+="<select onchange=\"WA_marketChangeCountry(this)\" id='wa-market-select-country'>"
if(CONST_WA_GLOBAL_SETTINGS.default_selected_country.length==0)
{
nZpTf+="<option value=\"\">...</option>"
}
var RTuXN=CONST_WA_GLOBAL_SETTINGS.list_favorite_country
var taPTQ=CONST_WA_GLOBAL_SETTINGS.list_country 
var rYVsL=new Array()
for(var QhhQe=0;QhhQe<RTuXN.length;QhhQe++)
{
var wOAJW=RTuXN[QhhQe]
rYVsL.push({code:wOAJW,lab:Translator.country(wOAJW)})
}
for(var QhhQe=0;QhhQe<rYVsL.length;QhhQe++)
{
var tmGGQ=rYVsL[QhhQe]
var wOAJW=tmGGQ.code
nZpTf+="<option "
if(JCsHN.XwFIC.YbjIQ()==wOAJW)nZpTf+="selected "
nZpTf+="value=\""+wOAJW+"\">"+Translator.country(wOAJW)+"</option>"
}
if((RTuXN.length>0)&&(taPTQ.length>0))
{
nZpTf+="<option value=\"\">-----</option>"
}
var MLLjk=new Array()
for(var QhhQe=0;QhhQe<taPTQ.length;QhhQe++)
{
var wOAJW=taPTQ[QhhQe]
MLLjk.push({code:wOAJW,lab:Translator.country(wOAJW)})
}
if((RTuXN.length==0)&&(taPTQ.length==0))
{
var cEeNc=CONST_WA_COUNTRIES.codes
for(var QhhQe=0;QhhQe<cEeNc.length;QhhQe++)
{
var wOAJW=cEeNc[QhhQe]
MLLjk.push({code:wOAJW,lab:Translator.country(wOAJW)})
}
}
MLLjk.sort(tmISx)
for(var QhhQe=0;QhhQe<MLLjk.length;QhhQe++)
{
var tmGGQ=MLLjk[QhhQe]
var wOAJW=tmGGQ.code
nZpTf+="<option "
if(JCsHN.XwFIC.YbjIQ()==wOAJW)nZpTf+="selected "
nZpTf+="value=\""+wOAJW+"\">"+Translator.country(wOAJW)+"</option>"
}
nZpTf+="</select>"
nZpTf+="<br>"
nZpTf+="<br>"
if(CONST_WA_GLOBAL_SETTINGS.link_sale_condition)
{
nZpTf+="<a "+WA_LinkToHref(CONST_WA_GLOBAL_SETTINGS.link_sale_condition)+" style='color:#0000ff'>"
nZpTf+=Translator.tr("Terms of sell")
nZpTf+="</a>"
nZpTf+="<br>" 
nZpTf+="<span id='wa-sales-condition-label'  style='font-weight:bold;'>"
nZpTf+=Translator.tr("label_market_accept_terms")
nZpTf+="</span>"
nZpTf+="<input id='wa-sales-condition' onchange=\"WA_marketChangeSalesCondition(this)\" "
nZpTf+=(JCsHN.XwFIC.ICLAv)?"checked ":""
nZpTf+="type='checkbox' value='1'/>" 
nZpTf+="<br>"
nZpTf+="<br>"
}
nZpTf+="<span style='font-weight:bold;'>"
nZpTf+=Translator.tr("Choose a type of payment")
nZpTf+="</span>"
nZpTf+="<br>"
nZpTf+="<select onchange=\"WA_marketChangeTypePayment(this)\" id='wa-market-select-payment'>"
nZpTf+="<option value=\"\">...</option>"
var dKhBc=CONST_WA_GLOBAL_SETTINGS.list_type_payment
for(var QhhQe=0;QhhQe<dKhBc.length;QhhQe++)
{
var bqvFa=dKhBc[QhhQe]
nZpTf+="<option "
if(JCsHN.XwFIC.bqvFa==bqvFa)nZpTf+="selected "
nZpTf+="value=\""+bqvFa+"\">"+Translator.tr("label_market_"+bqvFa)+"</option>"
}
nZpTf+="</select>"
nZpTf+="</div>"
this.writeContent(nZpTf)
var doChr=html_getLayer("market-cart-content")
doChr.innerHTML="<div width=100% align=center><img src='wa_loading.gif'></div>" 

JCsHN.WbnkD(this,this.DxipC)
}
SqLcO.wgpMk() 
}
function WA_marketChangeCountry(cZAUv)
{
cZAUv.style.backgroundColor=""
var SqLcO=WA_Dialog.getCurrent()
SqLcO.DxipC()
}
function WA_marketChangeTypePayment(cZAUv)
{
var JCsHN=xmpVH();
JCsHN.XwFIC.bqvFa=cZAUv.value
JCsHN.XwFIC.DejrR()
cZAUv.style.backgroundColor=""
}
function WA_marketChangeSalesCondition(kPXHC)
{
var JCsHN=xmpVH();
JCsHN.XwFIC.ICLAv=kPXHC.checked
JCsHN.XwFIC.DejrR() 
var FlLAq=document.getElementById("wa-sales-condition-label")
FlLAq.style.backgroundColor="" 
}
function WA_LinkToHref(bgkgR)
{
var nZpTf=""
var mAhTw=bgkgR.url
var AODVN=Translator.m_lang_for_filename
if(AODVN.length>0)AODVN="_"+AODVN
mAhTw=mAhTw.replace(/@lng@/g,AODVN)
nZpTf+="href=\""+mAhTw+"\" "
if(bgkgR.open==1)
{
nZpTf+="target="
nZpTf+="_blank"
}
return nZpTf;
}
function WA_displayDialogMarketProduct(RLJFV,vmdJt)
{
var hjRDG=wa_global_market.markets[RLJFV]
var jbMuS=hjRDG.obj
var UmDJh=jbMuS.info.products
var GfaJU=UmDJh[vmdJt] 

var SqLcO=new WA_Dialog();

SqLcO.GfaJU=GfaJU
SqLcO.mEgBB=RLJFV
SqLcO.Pangk=function()
{
WA_displayDialogMarketCart()
}
SqLcO.THueX=function()
{
var JCsHN=xmpVH();
JCsHN.WbnkD(this,this.VinDm) 
}
SqLcO.VinDm=function()
{
var GfaJU=this.GfaJU;
var JCsHN=xmpVH();
var DISgg=new Array();
var uCPjj=GfaJU.obj.id;
for(var i=0;i<3;i++)
{
var IFbqJ=-1;
var hGSAX=uCPjj+"-select-opt"
var cZAUv=document.getElementById(hGSAX+i)
if(cZAUv)
{
if(cZAUv.value.length==0)
{
cZAUv.style.backgroundColor="#ff0000";
cZAUv.focus()
return;
}
IFbqJ=parseInt(cZAUv.value)
}
DISgg.push(IFbqJ)
}
if(JCsHN.addProductToShoppingCard(GfaJU,DISgg))
{
JCsHN.XlEpY()
WA_displayDialogMarketCart()
}
}
SqLcO.wgpMk=function()
{
var RLJFV=this.mEgBB
var GfaJU=this.GfaJU
var nZpTf=""
this.addButton(Translator.tr("Go to my card"),this.Pangk,[""],this)
if(GfaJU.unavail==false)
{
this.addButton(Translator.tr("Add to card"),this.THueX,[""],this)
}
this.initializeWindow(670,this.idealHeight())
nZpTf+="<table border=0 width=100% cellpadding=4>"
nZpTf+="<tr>" 
if(GfaJU.img_big.length>0)
{
nZpTf+="<td width='100px' align=center valign=top>"
var BsanL=GfaJU.size_thumb.clone() 
BsanL.scale(new Size(200,200))
nZpTf+="<a href=\""+GfaJU.img_big+"\" target=_blank>"
nZpTf+="<img border=0 src=\""+GfaJU.img_big+"\" width='"+BsanL.width+"px' height='"+BsanL.height+"px'>"
nZpTf+="</a>"
nZpTf+="</td>"
}
var iRerZ="color:"+WA_GLOBAL_COLOR_THEME.color_text+";";
nZpTf+="<td valign=top style='font-family:Arial;'>"
nZpTf+="<span style='font-weight:bold;font-size:16px;"+iRerZ+"'>"
nZpTf+=GfaJU.title
nZpTf+="</span>"
nZpTf+="<br>"
if(GfaJU.sub_title.length>0)
{
nZpTf+="<span style='color:#333333;font-size:14px;'>"
nZpTf+=GfaJU.sub_title
nZpTf+="</span>"
nZpTf+="<br>"
}
nZpTf+="<br>"
nZpTf+="<table border=0 width=100% cellspacing=0 cellpadding=0><tr><td>"
nZpTf+="<span style='"+iRerZ+";font-size:14px;'>"
nZpTf+=Translator.tr("Price")+" : "
nZpTf+="</span>"
nZpTf+="<span style='"+iRerZ+";font-size:18px;font-weight:bold;' id='"+GfaJU.obj.id+"-price'>"
if(GfaJU.unavail)
{
nZpTf+=Translator.tr("Unavailable")
}
nZpTf+="</span>"
if(GfaJU.more_info)
{
nZpTf+="</td><td align=right>"
var bgkgR=GfaJU.more_info
var JYuIf=WA_LinkToHref(bgkgR)
nZpTf+="<a "+JYuIf+" style='font-family:Arial;text-decoration:underline;font-weight:bold;font-size:12px;color:0000ff;'>"+Translator.tr("More product info link")+"</a>"
}
nZpTf+="</td></tr></table>"
nZpTf+="<br>"
var BCFZD=GfaJU.obj.index
if(GfaJU.unavail==false)
if(GfaJU.options.length>0)
{
nZpTf+="<table border=0 cellspacing=0 cellpadding=0>"
for(var n=0;n<GfaJU.options.length;n++)
{
var DJFVf=GfaJU.options[n]
if(DJFVf)
{
nZpTf+="<tr><td align=right>"
nZpTf+="<span style='font-family:Arial;font-weight:bold;font-size:12px;"+iRerZ+"'>"
nZpTf+=DJFVf.title+" :&nbsp;"
nZpTf+="</span>"
nZpTf+="</td><td align=left>"
nZpTf+="<select id='"+GfaJU.obj.id+"-select-opt"+n+"' onchange=\"WA_market_changeCustomPrice('"+RLJFV+"',"+BCFZD+")\">"
nZpTf+="<option value=\"\">...</option>"
for(var QhhQe=0;QhhQe<DJFVf.vals.length;QhhQe++)
{
var YKetZ=DJFVf.vals[QhhQe]
nZpTf+="<option value=\""+QhhQe+"\">"+YKetZ+"</option>"
}
nZpTf+="</select>"
nZpTf+="</td></tr>";
}
}
nZpTf+="</table>"
}
nZpTf+="</td>"
nZpTf+="</tr>"
nZpTf+="</table>"
if(GfaJU.description.length>0)
{
nZpTf+="<table border=0 width=100% cellpadding=4>"
nZpTf+="<tr><td colspan=2>"
nZpTf+="<span style='font-family:Arial;font-size:13px;"+iRerZ+"'>"
nZpTf+="<hr>"
nZpTf+=GfaJU.description
nZpTf+="</span>"
nZpTf+="</td></tr>"
nZpTf+="</table>"
}
this.writeContent(nZpTf)
WA_market_changeCustomPrice(RLJFV,BCFZD)
}
SqLcO.displayWindowWithAutoResize(300,SqLcO.wgpMk) 
}
function JPDUo(GfaJU,uCPjj)
{
var KXeMh=new Array()
for(var i=0;i<3;i++)
{
var hGSAX=uCPjj+"-select-opt"
var cZAUv=document.getElementById(hGSAX+i)
KXeMh[i]=-1
if(cZAUv)
{
cZAUv.style.backgroundColor="";
var YKetZ=parseInt(cZAUv.value)
if(isNaN(YKetZ)==false)
KXeMh[i]=YKetZ
}
}
return oNukS(GfaJU,KXeMh)
}
function oNukS(GfaJU,KXeMh)
{
if(GfaJU.unavail)return;
var dsSTU=false;
for(var i=0;i<GfaJU.custom_prices.length;i++)
{
var UguSO=GfaJU.custom_prices[i]
var kPwnd=true;
for(var n=0;n<3;n++)
{
if(UguSO.tab[n]!=KXeMh[n])kPwnd=false
}
if(kPwnd)
{
dsSTU=UguSO;
break;
}
}
var IAbcG=GfaJU.price
if(dsSTU)
{
IAbcG=dsSTU.pr
}
return IAbcG;
}
function WA_market_changeCustomPrice(RLJFV,BCFZD)
{
var JCsHN=xmpVH();
var hjRDG=wa_global_market.markets[RLJFV]
var UmDJh=hjRDG.info.products;
var GfaJU=UmDJh[BCFZD]
if(GfaJU.unavail)return;
var uCPjj=GfaJU.obj.id
var IAbcG=JPDUo(GfaJU,uCPjj)
var eFtqB=html_getLayer(uCPjj+"-price")
if(eFtqB)
{
eFtqB.innerHTML=JCsHN.oHkig(IAbcG)
}
}
function EgAZL()
{
var JCsHN=xmpVH();
if(WA_getNumberMarketItemsInCart()==0)return;
var dQfNF=JCsHN.XwFIC
if(dQfNF.bqvFa=="paypal")
{
KnTVb();
return;
}
aOqvr(sJgFK)
}
function aOqvr(WFSII)
{
var JCsHN=xmpVH();
var dQfNF=JCsHN.XwFIC
dQfNF.smBHm()
var SqLcO=new WA_Dialog();
SqLcO.WFSII=WFSII
SqLcO.nhgwT=function(cnBOm)
{
return Translator.tr("form-label-"+cnBOm)
}
SqLcO.onCustomKeypress=function(cnBOm)
{
if(cnBOm==13)
{
wa_timeout(Delegate.create(this,this.NOfVr),0);
}
return false;
}
SqLcO.jaTLu=function()
{


if(this.WFSII==sJgFK)
{
WA_displayDialogMarketCart()
}
else
{
aOqvr(sJgFK)
}
}
SqLcO.kmPwn=function()
{
KnTVb()
}
SqLcO.NOfVr=function()
{
var JCsHN=xmpVH();
var dQfNF=JCsHN.XwFIC
if(dQfNF.CYdBc(this.WFSII)==false) return;
dQfNF.DejrR()
if(this.WFSII==sJgFK)
{
if(dQfNF.nxVIf==true)
{
aOqvr(aYSiN)
}
else
{
this.kmPwn()
}
}
else
{
this.kmPwn()
}
}
SqLcO.PZiSw=function(cnBOm,cukxP)
{
if(cukxP==undefined) cukxP=""
if(cukxP)cukxP=" size="+cukxP
return "<input name='"+cnBOm+"' value=\""+dQfNF.dfWEk(cnBOm,this.WFSII)+"\" type=text "+cukxP+">"
}
SqLcO.CSPEY=function(xIOMM)
{
return "<td width=100px align=right valign=top>"+Translator.tr(xIOMM)+" :</td>"
}
SqLcO.wgpMk=function()
{
var JCsHN=xmpVH();
var dQfNF=JCsHN.XwFIC
this.addButton("< "+Translator.tr('Back'),this.jaTLu,[""],this)
this.addButton(Translator.tr('Continue')+" >",this.NOfVr,[""],this)
this.initializeWindow(550,600)
var oxdIR="form-label-"
var wRnte=CONST_WA_GLOBAL_SETTINGS.list_form_fields 
var nZpTf=""
nZpTf+="<form id='wa-market-form' onSubmit='return false'>"
nZpTf+="<table border=0 width=100% cellspacing=5 style='font-family:Arial;font-size:15px;'>"
nZpTf+="<tr><td colspan=2 align=center style='font-size:18px;'>"
nZpTf+=Translator.tr((this.WFSII==sJgFK)?"Fill Deliver information below":"Fill Billing information below")
nZpTf+="<br><br></td></tr>"
for(var n=0;n<wRnte.length;n++)
{
var rZwRY=wRnte[n]
if(rZwRY=="address")
{
nZpTf+="<tr>"+this.CSPEY("Address");
nZpTf+="<td>"
nZpTf+=this.PZiSw("address_1",30)
nZpTf+="</td></tr>"
nZpTf+="<tr><td></td><td>"
nZpTf+=this.PZiSw("address_2",30)
nZpTf+="</td></tr>"
nZpTf+="<tr>"+this.CSPEY("form-label-city");
nZpTf+="<td>"
nZpTf+=this.PZiSw("city")+"&nbsp;"+this.nhgwT("zip")+" : "+this.PZiSw("zip",10)
nZpTf+="</td></tr>"
nZpTf+="<tr>"+this.CSPEY("form-label-country");
nZpTf+="<td>"
if(this.WFSII==aYSiN)
{
nZpTf+="<select id='wa-select-form-country' onchange='WA_marketChangeFormCountry("+this.WFSII+")'>"
var MLLjk=new Array();
var cEeNc=CONST_WA_COUNTRIES.codes
for(var QhhQe=0;QhhQe<cEeNc.length;QhhQe++)
{
var wOAJW=cEeNc[QhhQe]
MLLjk.push({code:wOAJW,lab:Translator.country(wOAJW)})
}
MLLjk.sort(tmISx)
var dEZbk=dQfNF.YbjIQ()
dEZbk=dQfNF.dfWEk('countryCode',this.WFSII,dEZbk)
for(var QhhQe=0;QhhQe<MLLjk.length;QhhQe++)
{
var tmGGQ=MLLjk[QhhQe]
var wOAJW=tmGGQ.code
nZpTf+="<option "
if(dEZbk==wOAJW)nZpTf+="selected "
nZpTf+="value=\""+wOAJW+"\">"+Translator.country(wOAJW)+"</option>"
}
nZpTf+="</select>"
}
else
{
nZpTf+=Translator.country(JCsHN.XwFIC.NJGnp);
}
nZpTf+="<br><span id='wa-market-state'>"
nZpTf+="<select id='wa-select-state'></select>"
nZpTf+="</span>" 
nZpTf+="</td></tr>"
}
else
{
nZpTf+="<tr>"+this.CSPEY("form-label-"+rZwRY);
nZpTf+="<td>"
nZpTf+=this.PZiSw(rZwRY,30) 
nZpTf+="</td></tr>"
}
}
if(this.WFSII==sJgFK)
{
nZpTf+="<tr><td colspan=2 align=center >"
nZpTf+=Translator.tr("Billing adress is different")+" <input type=checkbox "
if(JCsHN.XwFIC.nxVIf)nZpTf+="checked "
nZpTf+="onchange='WA_marketCheckBillingAdress(this)'>"
nZpTf+="</td></tr>"
}
nZpTf+="</table>"
nZpTf+="</form>"
this.writeContent(nZpTf)
WA_exec_callback_opera_compliant(this,this.pbKPH) 
}
SqLcO.pbKPH=function()
{
WA_marketChangeFormCountry(this.WFSII)
}
SqLcO.wgpMk()
}
function LMGTS(WFSII,cZAUv,PXZMO)
{
var JCsHN=xmpVH();
var dQfNF=JCsHN.XwFIC
var hkFFF=dQfNF.dfWEk("stateCode",WFSII) 
cZAUv.options.length=0
for(var n=0;n<PXZMO.length;n++)
{
var val=PXZMO[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==hkFFF)elOptNew.selected=true
try{
cZAUv.add(elOptNew,null);
}
catch(ex){
cZAUv.add(elOptNew);
}
}
}
function WA_marketChangeFormCountry(WFSII)
{
var JCsHN=xmpVH();
var dQfNF=JCsHN.XwFIC
var JlJxG=dQfNF.NJGnp
var cZAUv=document.getElementById("wa-select-form-country");
if(cZAUv) JlJxG=cZAUv.value;
html_SetDisplay("wa-market-state",(JlJxG=="US")||(JlJxG=="CA"))
var joNqk=document.getElementById("wa-select-state");
if(joNqk)
{
if(JlJxG=="US") LMGTS(WFSII,joNqk,["","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(JlJxG=="CA") LMGTS(WFSII,joNqk,["","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(kPXHC)
{
var JCsHN=xmpVH();
var dQfNF=JCsHN.XwFIC
dQfNF.nxVIf=kPXHC.checked
dQfNF.DejrR()
}
function KnTVb()
{
var JCsHN=xmpVH();
var dQfNF=JCsHN.XwFIC
var NKfRK=CONST_WA_GLOBAL_SETTINGS.currency_info 

var SqLcO=new WA_Dialog();
SqLcO.jaTLu=function()
{
if(this.dQfNF.bqvFa=="paypal")
{
WA_displayDialogMarketCart();return;
}
if(this.dQfNF.nxVIf)
aOqvr(aYSiN)
else
aOqvr(sJgFK)
}
SqLcO.mvdkL=function(FSSMX,YKetZ)
{
YKetZ=""+YKetZ
YKetZ=YKetZ.replace(/'/g,"&lsquo;")
return "<input type=hidden name='"+FSSMX+"' value=\""+YKetZ+"\">"
}
SqLcO.MlTmK=function()
{
var JCsHN=xmpVH();
var nZpTf=""
if(NKfRK.charCodeAt(3)>=100) return""
nZpTf+="<form id='wa-http-sender' method=POST action='https://www.paypal.com/cgi-bin/webscr' target='_blank'>"
nZpTf+=this.mvdkL("cmd","_cart")
nZpTf+=this.mvdkL("business",CONST_WA_GLOBAL_SETTINGS.email_paypal_account)
nZpTf+=this.mvdkL("upload","1")
nZpTf+=this.mvdkL("charset","utf-8")
nZpTf+=this.mvdkL("no_note","0")
nZpTf+=this.mvdkL("currency_code",CONST_WA_GLOBAL_SETTINGS.currency_code)
nZpTf+=this.mvdkL("no_shipping","2")
var tiXdL=JCsHN.KpEbm()
for(var i=0;i<tiXdL.length;i++)
{
var info=tiXdL[i];
var index=i+1;
var Ullvm=info.HPYWp();
if(JCsHN.XmCWw())
{
var WroZv=JCsHN.Svwjv(JCsHN.jNCXa(Ullvm));
Ullvm=Ullvm-WroZv;
}
nZpTf+=this.mvdkL("amount_"+index,""+Ullvm)
nZpTf+=this.mvdkL("quantity_"+index,info.IcpjO)
var YUrXs=0;
if(info.QRZbR.length>0)
{
nZpTf+=this.mvdkL("on"+YUrXs+"_"+index,"ref")
nZpTf+=this.mvdkL("os"+YUrXs+"_"+index,info.QRZbR)
YUrXs++;
}
var XMKxi=""
if(info.m_opt_vals)
{
for(var i_opt=0;i_opt<info.GfaJU.options.length;i_opt++)
{
var DJFVf=info.GfaJU.options[i_opt]
if(DJFVf)
{
var OHalt=info.m_opt_vals[i_opt];
var fhgmL=DJFVf.vals[OHalt]
var YclbQ=DJFVf.title;
if(YclbQ.length==0) YclbQ="opt"+(i_opt+1);
nZpTf+=this.mvdkL("on"+YUrXs+"_"+index,YclbQ)
nZpTf+=this.mvdkL("os"+YUrXs+"_"+index,fhgmL)
if(XMKxi.length>0)XMKxi=XMKxi+", "
XMKxi+=fhgmL
YUrXs++;
}
}
}
var cHYSh=info.ZUbSX;
if(XMKxi.length>0)cHYSh=cHYSh+"("+XMKxi+")"
nZpTf+=this.mvdkL("item_name_"+index,cHYSh) 
}
var ClAUa=JCsHN.BjDlo()
if(JCsHN.XmCWw())
{
ClAUa=ClAUa-JCsHN.Svwjv(JCsHN.jNCXa(ClAUa));
}
if(JCsHN.XmCWw())
{
var UMTTZ=JCsHN.kXmrD();
var rlvXA=JCsHN.BjDlo()
var xhiwn=UMTTZ+rlvXA;
var vAMYg=JCsHN.Svwjv(JCsHN.jNCXa(xhiwn));
var nAUOP=xhiwn-vAMYg;
nAUOP=nAUOP-ClAUa;
var BAdGi=0;
for(var i=0;i<tiXdL.length;i++)
{
var info=tiXdL[i];
var index=i+1;
var GlSPE=0;
var uTlKB=0;
var Ullvm=info.IcpjO*info.HPYWp();
var n0=JCsHN.YUKaa()/100;
var tax=Ullvm*(n0/(1+n0));
Ullvm=Ullvm-tax;
GlSPE=Ullvm;
var UDJxR=info.HPYWp();
var WroZv=JCsHN.Svwjv(JCsHN.jNCXa(UDJxR));
UDJxR=UDJxR-WroZv;
uTlKB=info.IcpjO*UDJxR;
if(uTlKB>GlSPE)
{
UDJxR=info.m_price;
UDJxR=UDJxR-WroZv;
var AdbSQ=UDJxR;
if((AdbSQ>0)&&(AdbSQ!=info.HPYWp()))
{
AdbSQ=AdbSQ-0.01;
}
nZpTf+=this.mvdkL("amount_"+index,AdbSQ) 
uTlKB=info.m_quantity*AdbSQ;
}
BAdGi+=uTlKB;
}
var jeLqO=JCsHN.Svwjv(nAUOP-BAdGi);
if(jeLqO>0)
{
var index=tiXdL.length+1;
nZpTf+=this.mvdkL("item_name_"+index,Translator.tr("TVA correction"))
nZpTf+=this.mvdkL("quantity_"+index,1)
nZpTf+=this.mvdkL("amount_"+index,jeLqO)
}
nZpTf+=this.mvdkL("tax_cart",vAMYg)
}
else
{
nZpTf+=this.mvdkL("tax_cart",JCsHN.dTpsv())
}
nZpTf+=this.mvdkL("handling_cart",ClAUa) 
nZpTf+="</form>"
return nZpTf;
}
SqLcO.SwEAm=function()
{
var tPgFd=this.qIsVO(sJgFK);
var nZpTf="";
if(tPgFd.length>0)
{
nZpTf+=""+Translator.tr("Shipping information")+":\n";
nZpTf+=tPgFd;
}
return nZpTf;
}
SqLcO.tqOsD=function()
{
var tPgFd=this.qIsVO(aYSiN);
var nZpTf="";
if(tPgFd.length>0)
{
nZpTf+=Translator.tr("Billing information")+":\n";
nZpTf+=tPgFd;
}
return nZpTf;
}
SqLcO.qIsVO=function(WFSII)
{
var JCsHN=xmpVH();
var nZpTf="";
var GAAQA=new Array();
var wRnte=YFJql(CONST_WA_GLOBAL_SETTINGS.list_form_fields)
wRnte.push("country")
wRnte.push("state")
for(var i=0;i<wRnte.length;i++)
{
var omOau=wRnte[i];
GAAQA[omOau]=this.dQfNF.dfWEk(omOau,WFSII)
}
if(GAAQA["firstname"])nZpTf+=GAAQA["firstname"]+"\n"
if(GAAQA["lastname"])nZpTf+=GAAQA["lastname"]+"\n"
if(GAAQA["company"])
{
nZpTf+=Translator.tr("form-label-company")+" : "+GAAQA["company"]+"\n"
}
if(GAAQA["fiscal_code"]) nZpTf+=Translator.tr("form-label-fiscal_code")+" : "+GAAQA["fiscal_code"]+"\n"
if(GAAQA["tva"]) nZpTf+=Translator.tr("form-label-tva")+" : "+GAAQA["tva"]+"\n"
if(GAAQA["address_1"]) nZpTf+=GAAQA["address_1"]+"\n"
if(GAAQA["address_2"]) nZpTf+=GAAQA["address_2"]+"\n"
if(GAAQA["zip"]) nZpTf+=GAAQA["zip"]+" "
if(GAAQA["city"]) nZpTf+=GAAQA["city"]+"\n"
if(GAAQA["country"])nZpTf+=Translator.country(GAAQA["country"])
if(GAAQA["state"]&&GAAQA["state"].length>0) nZpTf+=" "+GAAQA["state"];
nZpTf+="\n"
if(GAAQA["phone"]) nZpTf+=Translator.tr("form-label-phone")+" : "+GAAQA["phone"]+"\n"
if(GAAQA["fax"]) nZpTf+=Translator.tr("form-label-fax")+" : "+GAAQA["fax"]+"\n"
if(GAAQA["email"]) nZpTf+=GAAQA["email"]+"\n"
if(GAAQA["code_promo"]) nZpTf+=Translator.tr("form-label-code_promo")+" : "+GAAQA["code_promo"]+"\n"
if(GAAQA["comment"])
{
nZpTf+=Translator.tr("form-label-comment")+" : \n";
nZpTf+=GAAQA["comment"]+"\n"
}
return nZpTf;
}
SqLcO.PLNlC=function()
{
var JCsHN=xmpVH();
var nZpTf="";
var tiXdL=JCsHN.KpEbm();
nZpTf+="**************\n"
for(var i=0;i<tiXdL.length;i++)
{
var dQfNF=tiXdL[i];
var index=i+1;
var cHYSh=dQfNF.ZUbSX;
if(dQfNF.QRZbR.length>0)
{
cHYSh+=" ["+dQfNF.QRZbR+"]";
}
var XMKxi=""
if(dQfNF.m_opt_vals)
{
for(var i_opt=0;i_opt<dQfNF.GfaJU.options.length;i_opt++)
{
var DJFVf=dQfNF.GfaJU.options[i_opt]
if(DJFVf)
{
if(XMKxi.length>0)XMKxi=XMKxi+", "
var OHalt=dQfNF.m_opt_vals[i_opt];
var fhgmL=DJFVf.vals[OHalt]
var YclbQ=DJFVf.title;
if(YclbQ.length>0) XMKxi+=YclbQ+" : "
XMKxi+=fhgmL
}
}
}
if(XMKxi.length>0)cHYSh=cHYSh+"\n("+XMKxi+")"
nZpTf+=cHYSh;
nZpTf+="\n"
nZpTf+=Translator.tr("Price")+" : "+JCsHN.pivOd(dQfNF.HPYWp())+"\n"
nZpTf+=Translator.tr("Quantity")+" : "+dQfNF.IcpjO+"\n"
nZpTf+=Translator.tr("Total")+" : "+JCsHN.pivOd(dQfNF.HPYWp()*dQfNF.IcpjO);
nZpTf+="\n"
nZpTf+="**************\n"
}
var lwgWc=JCsHN.kXmrD()
var KXPHI=JCsHN.dTpsv()
var NDKEJ=JCsHN.BjDlo()
var AlEBd=JCsHN.MvwbH() 
nZpTf+=Translator.tr("Sub total")+" : "+JCsHN.pivOd(lwgWc)+"\n";
if(CONST_WA_GLOBAL_SETTINGS.shipping_type!=jvtgU)
{
nZpTf+=Translator.tr("Shipping amount")+" : "+JCsHN.pivOd(NDKEJ)+"\n";
}
if(JCsHN.XmCWw()||JCsHN.mTTue())
{
if(JCsHN.XmCWw())
{
nZpTf+=Translator.tr("Tax included");
}
if(JCsHN.mTTue())
{
nZpTf+=Translator.tr("Extra Tax");
}
nZpTf+=" : ";
nZpTf+=JCsHN.pivOd(KXPHI)+"\n";
}
nZpTf+=Translator.tr("Total")+" : "+JCsHN.pivOd(AlEBd)+"\n";
return nZpTf;
}
SqLcO.NSGPe=function()
{
var JCsHN=xmpVH();
var nZpTf="";
var tiXdL=JCsHN.KpEbm()
nZpTf+="<table border=1 style=\"width:100%;text-align: left; margin-left: auto; margin-right: auto;\" cellpadding=2 cellspacing=2>"
nZpTf+="<tr class=\"crbst-table-title\">"
nZpTf+="<td>&nbsp;</td>"
nZpTf+="<td>"+Translator.tr("Price")+"</td>"
nZpTf+="<td>"+Translator.tr("Quantity")+"</td>"
nZpTf+="<td>"+Translator.tr("Total")+"</td>"
nZpTf+="</tr>"
for(var i=0;i<tiXdL.length;i++)
{
nZpTf+="<tr>"
var dQfNF=tiXdL[i];
var index=i+1;
nZpTf+="<td>"
var cHYSh=dQfNF.ZUbSX;
if(dQfNF.QRZbR.length>0)
{
cHYSh+=" ["+dQfNF.QRZbR+"]";
}
cHYSh="<b>"+cHYSh+"</b>"
var XMKxi=""
if(dQfNF.m_opt_vals)
{
for(var i_opt=0;i_opt<dQfNF.GfaJU.options.length;i_opt++)
{
var DJFVf=dQfNF.GfaJU.options[i_opt]
if(DJFVf)
{
if(XMKxi.length>0)XMKxi=XMKxi+", "
var OHalt=dQfNF.m_opt_vals[i_opt];
var fhgmL=DJFVf.vals[OHalt]
var YclbQ=DJFVf.title;
if(YclbQ.length>0) XMKxi+=YclbQ+" : "
XMKxi+=fhgmL
}
}
}
if(XMKxi.length>0)cHYSh=cHYSh+"<br><span style='font-size:10px;'>("+XMKxi+")</span>"
nZpTf+=cHYSh;
nZpTf+="</td>"
nZpTf+="<td>"+JCsHN.oHkig(dQfNF.HPYWp())+"</td>"
nZpTf+="<td>"+dQfNF.IcpjO+"</td>"
nZpTf+="<td>"+JCsHN.oHkig(dQfNF.HPYWp()*dQfNF.IcpjO)+"</td>"
nZpTf+="</tr>"
}
nZpTf+="<tr><td colspan=4>"
var lwgWc=JCsHN.kXmrD()
var KXPHI=JCsHN.dTpsv()
var NDKEJ=JCsHN.BjDlo()
var AlEBd=JCsHN.MvwbH() 
nZpTf+="<table border=0 width=100%>"
nZpTf+="<tr><td align=right >"+Translator.tr("Sub total")+" : "+JCsHN.oHkig(lwgWc)+"</td></tr>";
if(CONST_WA_GLOBAL_SETTINGS.shipping_type!=jvtgU)
{
nZpTf+="<tr><td align=right>"+Translator.tr("Shipping amount")+" : "+JCsHN.oHkig(NDKEJ)+"</td></tr>";
}
if(JCsHN.XmCWw()||JCsHN.mTTue())
{
if(JCsHN.XmCWw())
{
nZpTf+="<tr><td align=left >"+Translator.tr("Tax included");
}
if(JCsHN.mTTue())
{
nZpTf+="<tr><td align=right >"+Translator.tr("Extra Tax");
}
nZpTf+=" : ";
nZpTf+=JCsHN.oHkig(KXPHI)+"</td></tr>";
}
nZpTf+="<tr><td align=right class=\"crbst-card-total\">"+Translator.tr("Total")+" : "+JCsHN.oHkig(AlEBd)+"</td></tr>";
nZpTf+="</table>" 
nZpTf+="</td></tr>"
nZpTf+="</table>"
nZpTf=nZpTf.replace(/\"/g,"'")
return nZpTf;
}
SqLcO.broRo=function(YKetZ)
{
if((""+YKetZ).length==1)YKetZ="0"+YKetZ;
return YKetZ
}
SqLcO.olWsx=function()
{
var JCsHN=xmpVH();
var nZpTf=""
if(NKfRK.charCodeAt(3)>=100) return""
if(REkSC)
{
nZpTf+="<form id='wa-http-sender' method=POST action='"+UpdJY+"crbst_market_print_form.php' target='_blank'>"
}
else
{
nZpTf+="<form id='wa-http-sender' method=POST action='crbst_market_print_form.php' target='_blank'>"
}
nZpTf+=this.mvdkL("type_payment",this.dQfNF.bqvFa)
nZpTf+=this.mvdkL("MAIL_TITLE_PREFIXE",Translator.tr("title email Order notification"))
nZpTf+=this.mvdkL("MAIN_TITLE",Translator.tr("PRINT_FORM_MAIN_TITLE"))
nZpTf+=this.mvdkL("PREFIXE_ORDER",Translator.tr("PRINT_FORM_PREFIXE_ORDER"))
var DINSe=""
var EwrNF=new Date()
DINSe+="wa-"+this.broRo(EwrNF.getYear()-100)+this.broRo(EwrNF.getMonth()+1)+this.broRo(EwrNF.getDate())
DINSe+=EwrNF.getHours()+this.broRo(EwrNF.getMinutes())+this.broRo(EwrNF.getSeconds())
DINSe+="-"+Math.round(Math.random()*100) 
nZpTf+=this.mvdkL("ID_ORDER",DINSe)
nZpTf+=this.mvdkL("CARD_TITLE",Translator.tr("PRINT_FORM_CARD_TITLE"))
nZpTf+=this.mvdkL("LABEL_TYPE_PAYMENT",Translator.tr("PRINT_FORM_LABEL_TYPE_PAYMENT"))
nZpTf+=this.mvdkL("send_copy_email_to_buyer",(JCsHN.send_copy_email_to_buyer)?"1":"0") 
nZpTf+=this.mvdkL("email_buyer",this.dQfNF.dfWEk("email",sJgFK))
if(this.dQfNF.bqvFa=="check")
{
nZpTf+=this.mvdkL("TYPE_PAYMENT",Translator.tr("PRINT_FORM_TYPE_CHECK"))
nZpTf+=this.mvdkL("MESSAGE_CHECK",Translator.tr("PRINT_FORM_MESSAGE_CHECK"))
}
if(this.dQfNF.bqvFa=="wire")
{
nZpTf+=this.mvdkL("TYPE_PAYMENT",Translator.tr("PRINT_FORM_TYPE_WIRE"))
nZpTf+=this.mvdkL("MESSAGE_CHECK",Translator.tr("PRINT_FORM_MESSAGE_WIRE"))
}
nZpTf+=this.mvdkL("LABEL_PRINT",Translator.tr("PRINT_FORM_LABEL_PRINT"))
nZpTf+=this.mvdkL("card_html",this.NSGPe())
nZpTf+=this.mvdkL("card_plain_text",this.PLNlC())
nZpTf+=this.mvdkL("LABEL_SELLER_INFORMATION",Translator.tr("Seller information"))
nZpTf+=this.mvdkL("LABEL_BANK_ACCOUNT",Translator.tr("Bank account information"))
nZpTf+=this.mvdkL("LABEL_ADDRESS",Translator.tr("Address"))
nZpTf+=this.mvdkL("seller_address",CONST_WA_GLOBAL_SETTINGS.seller_address)
nZpTf+=this.mvdkL("bank_account_informations",CONST_WA_GLOBAL_SETTINGS.bank_account_informations)
nZpTf+=this.mvdkL("buyer_info_shipping",this.SwEAm())
var heFaI=""
if(dQfNF.nxVIf)
{
heFaI=this.tqOsD();
};
nZpTf+=this.mvdkL("buyer_info_billing",heFaI)
nZpTf+="</form>"
return nZpTf;
}
SqLcO.CehoE=function()
{
var JCsHN=xmpVH();
JCsHN.jjbfP()
this.closeWin()
}
SqLcO.wgpMk=function()
{
var JCsHN=xmpVH();
var JptAl=((this.dQfNF.bqvFa=="check")||(this.dQfNF.bqvFa=="wire")) 
if(this.dQfNF.bqvFa=="paypal")
{
this.addButton(Translator.tr('Clear cart'),this.CehoE,[""],this)
this.initializeWindow(400,200)
}
else
{
this.initializeWindow(400,150)
}
var nZpTf=""
if(this.dQfNF.bqvFa=="paypal")
{
nZpTf+=this.MlTmK()
}
if(JptAl)
{
nZpTf+=this.olWsx()
if((REkSC==false)&&(document.webaca_is_preview))
{
WA_Dialog.alert(Translator.tr("Operation not allowed in preview mode"))
return
}
}
nZpTf+="<table border=0 style='width:100%;'><tr>";
nZpTf+="<td align=center style='"+this.cssText1()+"'>"
nZpTf+=Translator.tr("You have been redirected to the payment page")
if(this.dQfNF.bqvFa=="paypal")
{
nZpTf+="<br><br>"
nZpTf+=Translator.tr("You can clear your cart")
}
nZpTf+="</td></tr></table>"
this.writeContent(nZpTf) 
if(NKfRK.charCodeAt(3)>=100)
{
WA_Dialog.alert(Translator.tr("This cariboost edition can't support ebusiness features !'"))
return;
}
var bnDlX=document.getElementById("wa-http-sender")
bnDlX.submit()
if(JptAl)
{
JCsHN.jjbfP()
}
}
SqLcO.dQfNF=dQfNF
SqLcO.wgpMk()
}

-->
