<!--

var DWLic=0
var iJOrc=1
var ihvUu=2
var CCKHX=0;
var WAKwX=1;
var RjZJX=2;
var WaBKw=0
var NHYfZ=1
var Wcejx=false 
function MD5(string){
function RotateLeft(lValue,iShiftBits){
return(lValue<<iShiftBits)|(lValue>>>(32-iShiftBits));
}
function AddUnsigned(lX,lY){
var lX4,lY4,lX8,lY8,lResult;
lX8=(lX&0x80000000);
lY8=(lY&0x80000000);
lX4=(lX&0x40000000);
lY4=(lY&0x40000000);
lResult=(lX&0x3FFFFFFF)+(lY&0x3FFFFFFF);
if(lX4&lY4){
return(lResult^0x80000000^lX8^lY8);
}
if(lX4|lY4){
if(lResult&0x40000000){
return(lResult^0xC0000000^lX8^lY8);
}else{
return(lResult^0x40000000^lX8^lY8);
}
}else{
return(lResult^lX8^lY8);
}
}
function F(x,y,z){return(x&y)|((~x)&z);}
function G(x,y,z){return(x&z)|(y&(~z));}
function H(x,y,z){return(x^y^z);}
function I(x,y,z){return(y^(x|(~z)));}
function FF(a,b,c,d,x,s,ac){
a=AddUnsigned(a,AddUnsigned(AddUnsigned(F(b,c,d),x),ac));
return AddUnsigned(RotateLeft(a,s),b);
};
function GG(a,b,c,d,x,s,ac){
a=AddUnsigned(a,AddUnsigned(AddUnsigned(G(b,c,d),x),ac));
return AddUnsigned(RotateLeft(a,s),b);
};
function HH(a,b,c,d,x,s,ac){
a=AddUnsigned(a,AddUnsigned(AddUnsigned(H(b,c,d),x),ac));
return AddUnsigned(RotateLeft(a,s),b);
};
function II(a,b,c,d,x,s,ac){
a=AddUnsigned(a,AddUnsigned(AddUnsigned(I(b,c,d),x),ac));
return AddUnsigned(RotateLeft(a,s),b);
};
function ConvertToWordArray(string){
var lWordCount;
var lMessageLength=string.length;
var lNumberOfWords_temp1=lMessageLength+8;
var lNumberOfWords_temp2=(lNumberOfWords_temp1-(lNumberOfWords_temp1%64))/64;
var lNumberOfWords=(lNumberOfWords_temp2+1)*16;
var lWordArray=Array(lNumberOfWords-1);
var lBytePosition=0;
var lByteCount=0;
while(lByteCount<lMessageLength){
lWordCount=(lByteCount-(lByteCount%4))/4;
lBytePosition=(lByteCount%4)*8;
lWordArray[lWordCount]=(lWordArray[lWordCount]|(string.charCodeAt(lByteCount)<<lBytePosition));
lByteCount++;
}
lWordCount=(lByteCount-(lByteCount%4))/4;
lBytePosition=(lByteCount%4)*8;
lWordArray[lWordCount]=lWordArray[lWordCount]|(0x80<<lBytePosition);
lWordArray[lNumberOfWords-2]=lMessageLength<<3;
lWordArray[lNumberOfWords-1]=lMessageLength>>>29;
return lWordArray;
};
function WordToHex(lValue){
var WordToHexValue="",WordToHexValue_temp="",lByte,lCount;
for(lCount=0;lCount<=3;lCount++){
lByte=(lValue>>>(lCount*8))&255;
WordToHexValue_temp="0"+lByte.toString(16);
WordToHexValue=WordToHexValue+WordToHexValue_temp.substr(WordToHexValue_temp.length-2,2);
}
return WordToHexValue;
};
function Utf8Encode(string){
string=string.replace(/\r\n/g,"\n");
var utftext="";
for(var n=0;n<string.length;n++){
var c=string.charCodeAt(n);
if(c<128){
utftext+=String.fromCharCode(c);
}
else if((c>127)&&(c<2048)){
utftext+=String.fromCharCode((c>>6)|192);
utftext+=String.fromCharCode((c&63)|128);
}
else{
utftext+=String.fromCharCode((c>>12)|224);
utftext+=String.fromCharCode(((c>>6)&63)|128);
utftext+=String.fromCharCode((c&63)|128);
}
}
return utftext;
};
var x=Array();
var k,AA,BB,CC,DD,a,b,c,d;
var S11=7,S12=12,S13=17,S14=22;
var S21=5,S22=9,S23=14,S24=20;
var S31=4,S32=11,S33=16,S34=23;
var S41=6,S42=10,S43=15,S44=21;
string=Utf8Encode(string);
x=ConvertToWordArray(string);
a=0x67452301;b=0xEFCDAB89;c=0x98BADCFE;d=0x10325476;
for(k=0;k<x.length;k+=16){
AA=a;BB=b;CC=c;DD=d;
a=FF(a,b,c,d,x[k+0],S11,0xD76AA478);
d=FF(d,a,b,c,x[k+1],S12,0xE8C7B756);
c=FF(c,d,a,b,x[k+2],S13,0x242070DB);
b=FF(b,c,d,a,x[k+3],S14,0xC1BDCEEE);
a=FF(a,b,c,d,x[k+4],S11,0xF57C0FAF);
d=FF(d,a,b,c,x[k+5],S12,0x4787C62A);
c=FF(c,d,a,b,x[k+6],S13,0xA8304613);
b=FF(b,c,d,a,x[k+7],S14,0xFD469501);
a=FF(a,b,c,d,x[k+8],S11,0x698098D8);
d=FF(d,a,b,c,x[k+9],S12,0x8B44F7AF);
c=FF(c,d,a,b,x[k+10],S13,0xFFFF5BB1);
b=FF(b,c,d,a,x[k+11],S14,0x895CD7BE);
a=FF(a,b,c,d,x[k+12],S11,0x6B901122);
d=FF(d,a,b,c,x[k+13],S12,0xFD987193);
c=FF(c,d,a,b,x[k+14],S13,0xA679438E);
b=FF(b,c,d,a,x[k+15],S14,0x49B40821);
a=GG(a,b,c,d,x[k+1],S21,0xF61E2562);
d=GG(d,a,b,c,x[k+6],S22,0xC040B340);
c=GG(c,d,a,b,x[k+11],S23,0x265E5A51);
b=GG(b,c,d,a,x[k+0],S24,0xE9B6C7AA);
a=GG(a,b,c,d,x[k+5],S21,0xD62F105D);
d=GG(d,a,b,c,x[k+10],S22,0x2441453);
c=GG(c,d,a,b,x[k+15],S23,0xD8A1E681);
b=GG(b,c,d,a,x[k+4],S24,0xE7D3FBC8);
a=GG(a,b,c,d,x[k+9],S21,0x21E1CDE6);
d=GG(d,a,b,c,x[k+14],S22,0xC33707D6);
c=GG(c,d,a,b,x[k+3],S23,0xF4D50D87);
b=GG(b,c,d,a,x[k+8],S24,0x455A14ED);
a=GG(a,b,c,d,x[k+13],S21,0xA9E3E905);
d=GG(d,a,b,c,x[k+2],S22,0xFCEFA3F8);
c=GG(c,d,a,b,x[k+7],S23,0x676F02D9);
b=GG(b,c,d,a,x[k+12],S24,0x8D2A4C8A);
a=HH(a,b,c,d,x[k+5],S31,0xFFFA3942);
d=HH(d,a,b,c,x[k+8],S32,0x8771F681);
c=HH(c,d,a,b,x[k+11],S33,0x6D9D6122);
b=HH(b,c,d,a,x[k+14],S34,0xFDE5380C);
a=HH(a,b,c,d,x[k+1],S31,0xA4BEEA44);
d=HH(d,a,b,c,x[k+4],S32,0x4BDECFA9);
c=HH(c,d,a,b,x[k+7],S33,0xF6BB4B60);
b=HH(b,c,d,a,x[k+10],S34,0xBEBFBC70);
a=HH(a,b,c,d,x[k+13],S31,0x289B7EC6);
d=HH(d,a,b,c,x[k+0],S32,0xEAA127FA);
c=HH(c,d,a,b,x[k+3],S33,0xD4EF3085);
b=HH(b,c,d,a,x[k+6],S34,0x4881D05);
a=HH(a,b,c,d,x[k+9],S31,0xD9D4D039);
d=HH(d,a,b,c,x[k+12],S32,0xE6DB99E5);
c=HH(c,d,a,b,x[k+15],S33,0x1FA27CF8);
b=HH(b,c,d,a,x[k+2],S34,0xC4AC5665);
a=II(a,b,c,d,x[k+0],S41,0xF4292244);
d=II(d,a,b,c,x[k+7],S42,0x432AFF97);
c=II(c,d,a,b,x[k+14],S43,0xAB9423A7);
b=II(b,c,d,a,x[k+5],S44,0xFC93A039);
a=II(a,b,c,d,x[k+12],S41,0x655B59C3);
d=II(d,a,b,c,x[k+3],S42,0x8F0CCC92);
c=II(c,d,a,b,x[k+10],S43,0xFFEFF47D);
b=II(b,c,d,a,x[k+1],S44,0x85845DD1);
a=II(a,b,c,d,x[k+8],S41,0x6FA87E4F);
d=II(d,a,b,c,x[k+15],S42,0xFE2CE6E0);
c=II(c,d,a,b,x[k+6],S43,0xA3014314);
b=II(b,c,d,a,x[k+13],S44,0x4E0811A1);
a=II(a,b,c,d,x[k+4],S41,0xF7537E82);
d=II(d,a,b,c,x[k+11],S42,0xBD3AF235);
c=II(c,d,a,b,x[k+2],S43,0x2AD7D2BB);
b=II(b,c,d,a,x[k+9],S44,0xEB86D391);
a=AddUnsigned(a,AA);
b=AddUnsigned(b,BB);
c=AddUnsigned(c,CC);
d=AddUnsigned(d,DD);
}
var temp=WordToHex(a)+WordToHex(b)+WordToHex(c)+WordToHex(d);
return temp.toLowerCase();
}
function WA_marketRemoveItem(OrlXg)
{
qVMCO().XnjVF(OrlXg)
var xjgMY=WA_Dialog.getCurrent();
xjgMY.boHXN()
}
function qVMCO()
{
if(document.wa_global_settings_market==undefined)document.wa_global_settings_market=new XmqWk()
return document.wa_global_settings_market;
}
function oRWOV()
{
this.FoYwO=function()
{
return this.iSJak+"-"+this.odlif_index
}
this.Zdbwu=function(NdUkr,HdYDI)
{
this.odlif=NdUkr.obj.market.info.folder.substring(13);
this.odlif_index=NdUkr.obj.index;
this.odlif_modif=NdUkr.obj.market.info.critical_id_modif
this.iSJak=NdUkr.obj.market.id 

this.fdFQj=1;
this.Nubbg=NdUkr.title;
this.kDLVN=NdUkr.price;
this.hMJoD=NdUkr.weight;
this.NWNYl=NdUkr.code_product;
}
this.TpkYF=function(NdUkr,HdYDI)
{

this.Nubbg=NdUkr.title;
this.kDLVN=NdUkr.price;
this.hMJoD=NdUkr.weight;
this.NWNYl=NdUkr.code_product;
}
this.pnPxS=function()
{
var s="";
s+=this.FoYwO();
if(this.m_opt_vals)
for(var i=0;i<this.m_opt_vals.length;i++)
{
var SDpFp=this.m_opt_vals[i]
if(SDpFp!=-1) s+="/"+SDpFp;
}
return s;
}
this.nZFoC=function()
{
var val="";
val+="j="+this.odlif+",";
val+="i="+this.odlif_index+",";
val+="m="+this.odlif_modif+",";
val+="q="+this.fdFQj+",";
if(this.m_opt_vals)
{
for(var i=0;i<this.m_opt_vals.length;i++)
{
val+="o"+i+"=";
var MJYpQ=this.m_opt_vals[i]
if(MJYpQ>-1)
val+=MJYpQ
else
val+=""
val+=","
}
}
return val;
}
this.AigrH=function(map,k)
{
var v=map[k];
if(v=="undefined") return "";
return v;
}
this.PaEdE=function(map)
{
this.odlif=this.AigrH(map,"j");
if(this.odlif=="") return false;
this.odlif_index=this.AigrH(map,"i");
this.odlif_modif=this.AigrH(map,"m");
this.fdFQj=parseInt(map["q"]);
this.m_opt_vals=new Array();
for(var i=0;i<3;i++)
{
var EBVcf=parseInt(map["o"+i]);
if(isNaN(EBVcf))EBVcf=-1;
this.m_opt_vals.push(EBVcf)
}
return true;
}
this.MUJwR=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.WmKfE=function(gnivr)
{
var tuZUS=this.MUJwR(gnivr)
return this.PaEdE(tuZUS) 
}
this.ShSef=function()
{
return YgbVO(this.NdUkr,this.m_opt_vals)
}
}
function SXHMe(TXYSR,EVaYI)
{
var diWHH=TXYSR[0]
var RTXge=TXYSR[1]
var HCLKH=TXYSR[2]
if(diWHH.length==0)
{
HCLKH.call(RTXge)
return;
}
var js=diWHH.pop()
WA_loadScript(js.src,SXHMe,[diWHH,RTXge,HCLKH]);
}
function WA_arrayContains(WwkSM,gnivr)
{
for(var n=0;n<WwkSM.length;n++){if(WwkSM[n]==gnivr)return true;}
return false;
}
function JftQQ(WwkSM)
{
var tuZUS=new Array()
for(var n=0;n<WwkSM.length;n++)
{
var LXjHi=WwkSM[n]
if(LXjHi=="address") tuZUS=tuZUS.concat(["address_1","address_2","city","zip"])
else tuZUS.push(LXjHi)
}
return tuZUS;
}
function bATSu()
{
this.EXfAq=function()
{
if(this.wljZL.length==0)return CONST_WA_GLOBAL_SETTINGS.default_selected_country;
return this.wljZL;
}
this.dewNs=function()
{
this.dsLii()
}
this.MUJwR=function(s)
{
var UEPmZ=new Array();
var tab=s.split(",");
for(var i=0;i<tab.length;i++)
{
var tab3=tab[i].split("=");
if(tab3.length==2)UEPmZ[tab3[0]]=tab3[1];
}
return UEPmZ;
}
this.FqWXZ=function(CAlDX)
{
if(CAlDX==undefined) return ""
return(CAlDX==WaBKw)?"deliv-":"bill-"
}
this.vXpmC=function(XJnxl,CAlDX,ajTVY)
{
if(!ajTVY)ajTVY=""
var IIWum=this.FqWXZ(CAlDX)
if(XJnxl=="country")
{
if(CAlDX==WaBKw) return this.wljZL
if(CAlDX==NHYfZ) XJnxl="countryCode"
}
if(XJnxl=="state")
{
XJnxl="stateCode"
}
var SDpFp=this.uTIPk[IIWum+XJnxl]
if(!SDpFp) return ajTVY
SDpFp=SDpFp.replace(/\"/g,"'")
return SDpFp
}
this.IPSjA=function(SDpFp)
{
if(SDpFp==undefined)return ""
return SDpFp
}
this.ibuJf=function(key,val)
{
if((val==null)||(val==undefined)) val="";
WA_SetCookie("crbst-card-"+key,val)
}
this.ODeZP=function(key)
{
var RTXge=WA_GetCookie("crbst-card-"+key)
if(RTXge=="null")RTXge="";
return ""+RTXge
}
this.VdXoc=function()
{
this.uTIPk=new Array()
var gnivr=this.ODeZP("order-infos")
var tuZUS=this.MUJwR(gnivr)
for(var k1 in tuZUS)
{
var SDpFp=tuZUS[k1]
if((k1.indexOf("deliv-")==0)||(k1.indexOf("bill-")==0))
this.uTIPk[k1]=unescape(SDpFp)
}
this.wljZL=this.IPSjA(tuZUS["countryCode"])
if(this.cmoDW.length==0)
{
this.cmoDW=this.IPSjA(tuZUS["typePayment"])
}
this.tpQSs=(this.IPSjA(tuZUS["differentBillingAddressChecked"])=="true")
this.JOlpM=(this.IPSjA(tuZUS["salesConditionChecked"])=="true")
}
this.dsLii=function()
{
var gnivr=""
for(var k1 in this.uTIPk)
{
var SDpFp=this.uTIPk[k1]
gnivr+=k1+"="+escape(SDpFp)+","
}
var sVOJA=""
sVOJA+="countryCode="+escape(this.wljZL)+","
sVOJA+="typePayment="+escape(this.cmoDW)+","
sVOJA+="differentBillingAddressChecked="+(this.tpQSs)+","
sVOJA+="salesConditionChecked="+(this.JOlpM)+","
gnivr+=sVOJA 
this.ibuJf("order-infos",gnivr)
}
this.efBJh=function(dlkRa)
{
if(trimString(dlkRa.value).length==0)
{
dlkRa.style.backgroundColor="#ff0000"
dlkRa.focus()
return false;;
}
dlkRa.style.backgroundColor=""
return true;
}
this.iUrrh=function(CAlDX)
{
var OYssT=JftQQ(CONST_WA_GLOBAL_SETTINGS.list_form_fields)
var MpWRd=JftQQ(CONST_WA_GLOBAL_SETTINGS.list_mandatory_form_fields) 
var JirDi=this.uTIPk;
var IIWum=this.FqWXZ(CAlDX) 
var fcgHa=document.getElementById("wa-market-form")
for(var n=0;n<OYssT.length;n++)
{
var vOodT=OYssT[n]
var bvhEG=fcgHa[vOodT]
var SDpFp=trimString(bvhEG.value)
if(vOodT!="address_2")
if(WA_arrayContains(MpWRd,vOodT))
{
if(this.efBJh(bvhEG)==false)return false;
}
JirDi[IIWum+vOodT]=SDpFp
}
var JVujb=document.getElementById("wa-select-state");
var inPiV=document.getElementById("wa-market-state");
if(JVujb&&(inPiV.style.display!="none"))
{
if(this.efBJh(JVujb)==false)return false;
JirDi[IIWum+"stateCode"]=JVujb.value
}
else
{
JirDi[IIWum+"stateCode"]=""
}
if(CAlDX==NHYfZ)
{
var BSXkS=document.getElementById("wa-select-form-country");
if(BSXkS)
{
JirDi[IIWum+"countryCode"]=BSXkS.value
}
}
this.dsLii()
return true;
}
this.RBTSk=""
this.wljZL=""
this.cmoDW=""
this.tpQSs=false;
this.JOlpM=false
this.VdXoc()
}
function XmqWk()
{
this.xHolT=new Array();
this.RTXge_callback=false;
this.jveJU=false;
this.Curfo=false;
this.LfKNd=new bATSu()
this.NJvpI=CONST_WA_GLOBAL_SETTINGS.use_native_paypal_cart;
this.bipAa=function(RTXge,HCLKH)
{
this.RTXge_callback=RTXge
this.jveJU=HCLKH 
var bRRDq=this.ODeZP("data")
this.cFeTe(bRRDq) 
var diWHH=new Array()
var WwkSM=this.xHolT;
for(var i=0;i<WwkSM.length;i++)
{
var rZvZu=WwkSM[i];
var WjtHr=Translator.m_lang_for_filename
if(WjtHr.length>0)WjtHr="_"+WjtHr;
var nkesO=rZvZu.odlif;
var n=nkesO.indexOf("_")
if(n>-1)nkesO=nkesO.substring(n+1)
rZvZu.iSJak="wa-id-"+nkesO 
var vamlP=wa_global_market.markets[rZvZu.iSJak]
if(this.Curfo==false)
if(!vamlP)
{
var UpRVM="crbst_market_"+rZvZu.odlif+'/'
WA_declareMarket(rZvZu.iSJak,UpRVM,rZvZu.odlif_modif) 
var IMpYB=UpRVM+'market-definition'+WjtHr+'.js?v='+rZvZu.odlif_modif
diWHH.push({id:nkesO,src:IMpYB})
}
}
SXHMe([diWHH,this,this.rOPIg],true)
}
this.ZUsLG=function()
{
this.ibuJf("data","")
this.LfKNd.ibuJf("order-infos","")
this.LfKNd.VdXoc()
this.cFeTe("")
}
this.rOPIg=function()
{
this.Curfo=true;
var WwkSM=this.xHolT;
var DTrwn=new Array();
for(var i=0;i<WwkSM.length;i++)
{
var rZvZu=WwkSM[i];
var nkesO=rZvZu.iSJak
var KTVfd=wa_global_market.markets[nkesO] 

if(KTVfd.info)
{
var IvWVn=KTVfd.info.products 
var HdYDI=rZvZu.odlif_index
var NdUkr=IvWVn[HdYDI]
rZvZu.NdUkr=NdUkr
rZvZu.TpkYF(rZvZu.NdUkr,HdYDI)
if((NdUkr.unavail==false)&&(rZvZu.odlif_modif==KTVfd.info.critical_id_modif))
{
DTrwn.push(rZvZu)
}
}
else
{
}
}
this.xHolT=DTrwn
this.bVkji() 

this.jveJU.call(this.RTXge_callback)
}
this.cFeTe=function(IttGf)
{
var WwkSM=new Array();
var list_string_products=IttGf.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 rZvZu=new oRWOV();
if(rZvZu.WmKfE(s_data))
{
WwkSM.push(rZvZu);
}
}
}
this.xHolT=WwkSM;
var telfa=this.fZkfR()
if(WA_getNumberMarketItemsInCart()!=telfa)
{
this.MpmmC()
this.BUnLH()
}
}
this.wiQMO=function()
{
var txFrG=''
try{txFrG=CONST_WA_GLOBAL_SETTINGS.currency_mnemonic}catch(e){}
return txFrG
}
this.XnjVF=function(OrlXg)
{
var list2=new Array();
var WwkSM=this.xHolT
for(var i=0;i<WwkSM.length;i++)
{
var rZvZu=WwkSM[i];
if(i!=OrlXg)
{
list2.push(rZvZu);
}
}
this.xHolT=list2;
this.bVkji()
}
this.addProductToShoppingCard=function(NdUkr,optionsValues)
{
if(this.SrARq()==false)
{
WA_Dialog.alert(Translator.tr("You can't use shopping card Your browser doesnt accept cookies !"));
return false;
}
var TZkMd=NdUkr.obj
var WwkSM=this.jvPOu();
var n=WwkSM.length
var mbRDb=new oRWOV()
mbRDb.Zdbwu(NdUkr,n);
mbRDb.m_opt_vals=optionsValues
var b_match=false;
for(var i=0;i<WwkSM.length;i++)
{
var rZvZu=WwkSM[i];
if(rZvZu.pnPxS()==mbRDb.pnPxS())
{
b_match=true;
rZvZu.fdFQj++;
}
}
if(b_match==false)
{
var bRRDq=this.ODeZP("data")
var hbsRP=mbRDb.nZFoC()
var bvuBP=bRRDq.length+hbsRP.length 
if(bvuBP>4000)
{
WA_Dialog.alert(Translator.tr("Cookies cart contains max data !"));
return false;
}
WwkSM.push(mbRDb);
}
return true
}
this.CALAG=function()
{
var WwkSM=this.xHolT
var bRRDq="";
for(var i=0;i<WwkSM.length;i++)
{
var info=WwkSM[i];
bRRDq+=info.nZFoC()+";";
}
return bRRDq;
}
this.fZkfR=function()
{
var JCWkO=0;
var WwkSM=this.xHolT;
for(var i=0;i<WwkSM.length;i++)
{
var rZvZu=WwkSM[i];
JCWkO+=rZvZu.fdFQj
}
return JCWkO;
}
this.MpmmC=function()
{
this.ibuJf("nb_items",this.fZkfR())
}
this.bVkji=function()
{
var WwkSM=this.xHolT
var bRRDq=this.CALAG()
this.ibuJf("data",bRRDq)
this.MpmmC()
this.BUnLH();
}
this.BUnLH=function()
{
WA_refreshNumberMarketItemsInCart()
}
this.jvPOu=function()
{
return this.xHolT;
}
this.SrARq=function()
{
this.ibuJf("watestcookies","test")
return(this.ODeZP("watestcookies")=="test");
}
this.ibuJf=function(key,val)
{
if((val==null)||(val==undefined)) val="";
WA_SetCookie("crbst-card-"+key,val)
}
this.ODeZP=function(key)
{
var RTXge=WA_GetCookie("crbst-card-"+key)
if(RTXge=="null")RTXge="";
return ""+RTXge
}
this.pbora=function(v)
{
return WA_formatPrice(v)
}
this.uOWfq=function(v)
{
return WA_basicFormatPrice(v)+" "+CONST_WA_GLOBAL_SETTINGS.currency_code;
}
this.YfvVg=function(wHjGZ)
{
return Math.round(wHjGZ*100)/100
}
this.MUFOv=function()
{
var WwkSM=this.jvPOu()
var price=0;
for(var i=0;i<WwkSM.length;i++)
{
var rZvZu=WwkSM[i];
price+=(rZvZu.ShSef()*rZvZu.fdFQj);
}
return price;
}
this.BhSRu=function()
{
var wHjGZ=this.MUFOv()
var xAPIJ=0;
var WwkSM=CONST_WA_GLOBAL_SETTINGS.list_promo_codes
for(var i=0;i<WwkSM.length;i++)
{
var tjcMs=WwkSM[i];
if(MD5(trimString(this.LfKNd.RBTSk.toUpperCase()))==tjcMs.c)
{
if(tjcMs.v.indexOf("%")>-1)
{
var xAPIJ=parseFloat(tjcMs.v)/100;
return wHjGZ*xAPIJ;
}
else
{
return parseFloat(tjcMs.v);
}
break;
}
}
return 0;
}
this.computeShippingForValue=function(val)
{
var jPquI=CONST_WA_GLOBAL_SETTINGS.shipping_type
if(jPquI==DWLic)return 0;
var ship_val=0;
var FDatq=CONST_WA_GLOBAL_SETTINGS.shipping_intervals
for(var i=0;i<FDatq.length;i++)
{
var ewtXF=FDatq[i];
if(ewtXF.v<val)ship_val=ewtXF.p
}
return ship_val;
}
this.omkUM=function(uVOIF)
{
var tuZUS=CONST_WA_GLOBAL_SETTINGS.UEPmZ_list_extra_shipping_by_country_code
if(tuZUS==undefined)
{
tuZUS=new Array()
CONST_WA_GLOBAL_SETTINGS.UEPmZ_list_extra_shipping_by_country_code=tuZUS;
var qkieX=CONST_WA_GLOBAL_SETTINGS.list_extra_shipping_by_country_code
for(var OrlXg in qkieX)
{
var fXIhF=qkieX[OrlXg];
var GrFNx=fXIhF.c
for(var NScGZ in GrFNx)
{
var RNKOF=GrFNx[NScGZ];tuZUS[RNKOF]=fXIhF.p;
}
}
}
return tuZUS[uVOIF];
}
this.oHZws=function(uVOIF)
{
var tuZUS=CONST_WA_GLOBAL_SETTINGS.UEPmZ_list_tva_by_country_code
if(tuZUS==undefined)
{
tuZUS=new Array()
CONST_WA_GLOBAL_SETTINGS.UEPmZ_list_tva_by_country_code=tuZUS;
var qkieX=CONST_WA_GLOBAL_SETTINGS.list_tva_by_country_code
for(var OrlXg in qkieX)
{
var fXIhF=qkieX[OrlXg];
var GrFNx=fXIhF.c;
for(var NScGZ in GrFNx)
{
var RNKOF=GrFNx[NScGZ];tuZUS[RNKOF]=fXIhF.p;
}
}
}
return tuZUS[uVOIF];
}
this.PLMiC=function()
{
var jPquI=CONST_WA_GLOBAL_SETTINGS.shipping_type
var WwkSM=this.jvPOu()
var global_ref_for_shipping=0;
var xYdhY=0;
var wljZL=this.LfKNd.wljZL;
if(wljZL.length>0)
{
xYdhY=this.omkUM(wljZL);
if(isNaN(xYdhY)) xYdhY=0;
}
for(var i=0;i<WwkSM.length;i++)
{
var rZvZu=WwkSM[i];
if(jPquI==iJOrc)
{
global_ref_for_shipping+=(rZvZu.fdFQj*rZvZu.ShSef());
}
if(jPquI==ihvUu)
{
global_ref_for_shipping+=(rZvZu.fdFQj*rZvZu.hMJoD);
}
}
global_ref_for_shipping-=this.BhSRu()
return xYdhY+this.YfvVg(this.computeShippingForValue(global_ref_for_shipping));
}
this.vJVjm=function()
{
return CONST_WA_GLOBAL_SETTINGS.tva_type==WAKwX
}
this.tNPkJ=function()
{
return CONST_WA_GLOBAL_SETTINGS.tva_type==RjZJX
}
this.kGGNW=function()
{
return CONST_WA_GLOBAL_SETTINGS.tva_type==CCKHX
}
this.VZwMR=function()
{
if(this.kGGNW())return 0;
var tax=0;
var country_code=this.LfKNd.wljZL;
if(country_code.length>0)
{
tax=this.oHZws(country_code);
if(isNaN(tax))tax=0;
}
return tax;
}
this.fWshP=function(wHjGZ)
{
if(this.vJVjm())
{
var n0=this.VZwMR()/100;
return wHjGZ*(n0/(1+n0));
}
if(this.tNPkJ())
{
return wHjGZ*this.VZwMR()/100;
}
return wHjGZ;
}
this.HcMCT=function()
{
if(this.kGGNW())return 0;
var WwkSM=this.jvPOu()
var uOCLG=0;
var Bpvlj=0;
for(var i=0;i<WwkSM.length;i++)
{
var rZvZu=WwkSM[i];
uOCLG+=(rZvZu.ShSef()*rZvZu.fdFQj);
}
uOCLG+=this.PLMiC();
Bpvlj=this.YfvVg(this.fWshP(uOCLG));
return Bpvlj;
}
this.tpJBg=function()
{
var wHjGZ=0;
wHjGZ+=this.MUFOv()
if(this.tNPkJ())wHjGZ+=this.HcMCT()
wHjGZ+=this.PLMiC()
wHjGZ-=this.BhSRu()
return wHjGZ;
}
}
function mdHam(oNmmf,BTbHe)
{
if(oNmmf.lab<BTbHe.lab) return-1;
if(oNmmf.lab>BTbHe.lab) return 1;
return 0
}
function WA_marketWatchQuantity()
{
var xjgMY=WA_Dialog.getCurrent()
xjgMY.KWQnJ()
}
function WA_displayDialogMarketCart()
{
var xjgMY=new WA_Dialog();
xjgMY.alwQD=false;
xjgMY.WkaSR=function()
{
this.AGSGa()
this.alwQD=setInterval("WA_marketWatchQuantity()",400)
}
xjgMY.AGSGa=function()
{
if(this.alwQD)clearInterval(this.alwQD)
}
xjgMY.KWQnJ=function()
{
var BVLEL=qVMCO();
var WMKPd=BVLEL.jvPOu();
for(var n=0;n<WMKPd.length;n++)
{
var rZvZu=WMKPd[n]
var PHsUk=document.getElementById("wa-cart-quantity-"+n)
var wrdjj=PHsUk.value
var gNRBq=parseInt(wrdjj)
if(isNaN(gNRBq))gNRBq=0;
if((wrdjj!='')&&(gNRBq+""!=wrdjj))
{
PHsUk.value=""+gNRBq
}
if(gNRBq!=rZvZu.fdFQj)
{
rZvZu.fdFQj=gNRBq
BVLEL.bVkji()
this.bLtqY()
}
}
var HRrSo=document.getElementById("wa-promo-code")
if(HRrSo)
{
if(HRrSo.value!=BVLEL.LfKNd.RBTSk)
{
BVLEL.LfKNd.RBTSk=HRrSo.value
this.bLtqY()
}
}
}
xjgMY.onCustomKeypress=function(ZBVBo)
{
if(ZBVBo==13)
{
wa_timeout(Delegate.create(this,this.JRZHY),0);
}
return false;
}
xjgMY.closeWin=function()
{
this.AGSGa()
this.intern_closeWin()
}
xjgMY.bLtqY=function()
{
var BVLEL=qVMCO();
var WMKPd=BVLEL.jvPOu();
if(WMKPd.length==0) return;
for(var n=0;n<WMKPd.length;n++)
{
var rZvZu=WMKPd[n]
var pHDEZ=document.getElementById("wa-cart-total-"+n)
var wHjGZ=rZvZu.ShSef() 
var Gplqp=rZvZu.fdFQj*wHjGZ
var gnivr="<span style='"
gnivr+=(Gplqp>0)?"color:"+WA_GLOBAL_COLOR_THEME.color_text+";font-weight:normal;":"color:#ff0000;font-weight:bold;"
gnivr+="'>"
gnivr+=BVLEL.pbora(Gplqp)
gnivr+="</span>"
pHDEZ.innerHTML=gnivr
}
var gLrxZ=BVLEL.MUFOv()
var RpwqS=BVLEL.HcMCT()
var ZmXJu=BVLEL.PLMiC()
var FMPve=BVLEL.tpJBg()
var DBjCV=BVLEL.BhSRu()
var FNZIv=""
var pHDEZ=document.getElementById("wa-cart-amount-total")
FNZIv+=Translator.tr("Sub total")+" : "+BVLEL.pbora(gLrxZ)
FNZIv+="<br>"
if(ZmXJu>0)
{
FNZIv+="<span>"+Translator.tr("Shipping amount")+" : "+BVLEL.pbora(ZmXJu)+"</span>";
FNZIv+="<br>"
}
if(BVLEL.vJVjm()||BVLEL.tNPkJ())
{
if(BVLEL.vJVjm())
{
FNZIv+="<div style='width:100%;text-align:left;'>"
FNZIv+=Translator.tr("Tax included");
}
if(BVLEL.tNPkJ())
{
FNZIv+="<div>"
FNZIv+=Translator.tr("Extra Tax");
}
FNZIv+=" : ";
FNZIv+=BVLEL.pbora(RpwqS)+"</div>";
}
if(DBjCV>0)
{
FNZIv+="<span>"+Translator.tr("Promotion")+" : - "+BVLEL.pbora(DBjCV)+"</span><br>";
}
FNZIv+="<span><b>"+Translator.tr("Total")+" : "+BVLEL.pbora(FMPve)+"</b></span>";
pHDEZ.innerHTML=FNZIv
}
xjgMY.dSdPa=function()
{
WA_displayDialogMarketCart()
}
xjgMY.qfMYw=function()
{
this.closeWin()
}
xjgMY.JRZHY=function()
{
var BVLEL=qVMCO();
if(WA_getNumberMarketItemsInCart()==0)return;
var aWfbQ=document.getElementById("wa-market-select-country")
if(aWfbQ)
{
BVLEL.LfKNd.wljZL=aWfbQ.value
}
if(BVLEL.LfKNd.wljZL=="")
{
var aWfbQ=document.getElementById("wa-market-select-country")
if(aWfbQ)
{
aWfbQ.focus()
aWfbQ.style.backgroundColor="#ff0000"
return;
}
}
if(CONST_WA_GLOBAL_SETTINGS.link_sale_condition)
{
if(BVLEL.LfKNd.JOlpM!=true)
{
var HYwlH=document.getElementById("wa-sales-condition")
if(HYwlH)
{
HYwlH.focus()
var vDJGZ=document.getElementById("wa-sales-condition-label")
vDJGZ.style.backgroundColor="#ff0000"
return;
}
}
}
var FMXnS=CONST_WA_GLOBAL_SETTINGS.list_type_payment
if(FMXnS.length==1)
{
BVLEL.LfKNd.cmoDW=FMXnS[0]
}
var aWfbQ=document.getElementById("wa-market-select-payment")
if(aWfbQ)
{
BVLEL.LfKNd.cmoDW=aWfbQ.value
if(BVLEL.LfKNd.cmoDW=="")
{
aWfbQ.focus()
aWfbQ.style.backgroundColor="#ff0000"
return;
}
}
PYHmk()
}
xjgMY.boHXN=function()
{
WA_exec_callback_opera_compliant(this,this.pxssW)
}
xjgMY.pxssW=function()
{
var BVLEL=qVMCO();

var BSXkS=document.getElementById("wa-market-select-country")
if(BSXkS)
{
BVLEL.LfKNd.wljZL=BSXkS.value
}
BVLEL.LfKNd.dewNs()
var WjvtO=html_getLayer("market-cart-content")
var reLOu=html_getLayer("wa-market-payment-form") 
var gnivr=""
var WMKPd=BVLEL.jvPOu();
html_SetVisibility(reLOu,(WMKPd.length>0))
if(WMKPd.length==0)
{
gnivr+="<span style='font-family:Arial;font-size:16px;'>"
gnivr+=Translator.tr("No articles in Card !")
gnivr+="</span>"
}
else
{
var mItFb="border:1px solid "+WA_GLOBAL_COLOR_THEME.color0+";font-weight:normal;"
var OqeBf=new RGBColor(WA_GLOBAL_COLOR_THEME.color0);
var HePlw=OqeBf.toHsl();
OqeBf.fromHsl(HePlw[0],HePlw[1],HePlw[2]+0.2)
var SNttY="border:1px solid "+WA_GLOBAL_COLOR_THEME.color0+";font-weight:normal;color:"+WA_GLOBAL_COLOR_THEME.color_text+";background-color:"+OqeBf.toRGB()+";"
var bfnbW="border:1px solid "+WA_GLOBAL_COLOR_THEME.color0+";color:#ff0000;font-weight:bold;"
var VIDLv="color:#222222;font-size:12px;"
gnivr+="<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+";'>"
gnivr+="<thead style='font-size:13px;border:1px solid;'>"
gnivr+="<tr>"
gnivr+="<th  colspan=2 style='"+SNttY+"'></th>"
gnivr+="<th style='"+SNttY+"'  width=70px><b>"+Translator.tr("Price")+"</b></th>"
gnivr+="<th style='"+SNttY+"'  width=70px><b>"+Translator.tr("Quantity")+"</b></th>"
gnivr+="<th style='"+SNttY+"'  width=70px><b>"+Translator.tr("Total")+"</b></th>"
gnivr+="<th style='"+SNttY+"'  width=90px></th>"
gnivr+="</tr>"
var XTUhP=new RGBColor(WA_GLOBAL_COLOR_THEME.color2);
var VjhfM=XTUhP.toHsl();
XTUhP.fromHsl(VjhfM[0],VjhfM[1],VjhfM[2]-0.1) 
for(var n=0;n<WMKPd.length;n++)
{
var UFqsN="";
if(n%2==0)
{
UFqsN="background-color:"+XTUhP.toRGB()+";"
}
var CEKaB=mItFb+UFqsN;
var rZvZu=WMKPd[n]
gnivr+="<tr>"
gnivr+="<th style='"+CEKaB+"' >"
var KTVfd=wa_global_market.markets[rZvZu.iSJak]
var IjHnD=new Size(30,30)
var cojFD=IjHnD
if(KTVfd.info.design.crop_thumb==false)
{
cojFD=rZvZu.NdUkr.size_thumb.clone()
cojFD.scale(IjHnD)
}
else
{
}
if(rZvZu.NdUkr.img_thumb.length>0)
gnivr+="<img border=0 src='"+rZvZu.NdUkr.img_thumb+"' width="+cojFD.width+"px height="+cojFD.height+"px>"
gnivr+="</th>" 
gnivr+="<th style='"+CEKaB+"text-align:left;padding:5px;' >"
gnivr+="<b>"+rZvZu.Nubbg+"</b>"
if(rZvZu.NWNYl.length>0)
{
gnivr+="<span style='"+VIDLv+"'>";
gnivr+=" ["+rZvZu.NWNYl+"]";
gnivr+="</span>";
}
if(rZvZu.m_opt_vals)
{
gnivr+="<br>"
gnivr+="<span style='"+VIDLv+"'>";
for(var i_opt=0;i_opt<rZvZu.NdUkr.options.length;i_opt++)
{
var FesVa=rZvZu.NdUkr.options[i_opt]
if(FesVa)
{
var Euxiv=rZvZu.m_opt_vals[i_opt];
var rvZde=FesVa.title;
if(rvZde.length>0)
{
gnivr+=rvZde;
gnivr+=":"
}
gnivr+=FesVa.vals[Euxiv];
gnivr+=" "
}
}
gnivr+="</span>";
}
gnivr+="</th>"
var wHjGZ=rZvZu.ShSef()
gnivr+="<th style='"+CEKaB+"' >"+BVLEL.pbora(wHjGZ)+"</th>"
gnivr+="<th style='"+CEKaB+"'  align=center><input type=text id='wa-cart-quantity-"+n+"' style='width:45px;' maxlength=3 value='"+rZvZu.fdFQj+"' type=text/></th>"
gnivr+="<th style='"
var Gplqp=rZvZu.fdFQj*wHjGZ
gnivr+=(Gplqp>0)?CEKaB:(bfnbW+UFqsN);
gnivr+="' ><span id='wa-cart-total-"+n+"'>"
gnivr+=BVLEL.pbora(Gplqp)
gnivr+="</span></th>"
gnivr+="<th style='"+CEKaB+"' ><a href=\"javascript:WA_marketRemoveItem("+n+")\">"+Translator.tr("Remove card item")+"</a></th>"
gnivr+="</tr>"
}
gnivr+="<tr>"
gnivr+="<th style='"+mItFb+"text-align:right;padding:5px;' id='wa-cart-amount-total'  colspan=5>&nbsp;</th>"
gnivr+="<th style='"+mItFb+"' ></th>"
gnivr+="</tr>"
gnivr+="</thead>"
gnivr+="</table>"
gnivr+="<br>"
}
WjvtO.innerHTML=gnivr
this.WkaSR()
WA_exec_callback_opera_compliant(this,this.bLtqY) 
}
xjgMY.lkeio=function()
{
var BVLEL=qVMCO();
this.addButton(Translator.tr("Continue Shopping"),this.qfMYw,[""],this)
this.addButton(Translator.tr("Checkout order"),this.JRZHY,[""],this)
this.initializeWindow(670,700)
var mSYlC="font-family:Arial;font-size:12px;color:#000000;"
var gnivr=""
gnivr+="<div id='market-cart-content' style='width:100%;"+mSYlC+"' align=center>" 
gnivr+="</div>"
gnivr+="<br>"
gnivr+="<div style='width:100%;"+mSYlC+"' align=center id='wa-market-payment-form'>" 
var qGCoe=CONST_WA_GLOBAL_SETTINGS.list_favorite_country
var uSkKC=CONST_WA_GLOBAL_SETTINGS.list_country
var cILFB=new Array()
for(var OaNbH=0;OaNbH<qGCoe.length;OaNbH++)
{
cILFB[qGCoe[OaNbH]]=true
}
for(var OaNbH=0;OaNbH<uSkKC.length;OaNbH++)
{
cILFB[uSkKC[OaNbH]]=true
}
var bcbYo=0;
var jQKuJ=""
for(var c in cILFB)
{
bcbYo++;
jQKuJ=c
}
if(bcbYo>1)
{
gnivr+="<span style='font-weight:bold;'>"
gnivr+=Translator.tr("Please choose a country to deliver your order")
gnivr+="</span>"
gnivr+="<br>"
gnivr+="<select onchange=\"WA_marketChangeCountry(this)\" id='wa-market-select-country'>"
if(CONST_WA_GLOBAL_SETTINGS.default_selected_country.length==0)
{
gnivr+="<option value=\"\">...</option>"
}
var SoOvY=new Array()
for(var OaNbH=0;OaNbH<qGCoe.length;OaNbH++)
{
var PwCHa=qGCoe[OaNbH]
SoOvY.push({code:PwCHa,lab:Translator.country(PwCHa)})
}
for(var OaNbH=0;OaNbH<SoOvY.length;OaNbH++)
{
var RTXge=SoOvY[OaNbH]
var PwCHa=RTXge.code
gnivr+="<option "
if(BVLEL.LfKNd.EXfAq()==PwCHa)gnivr+="selected "
gnivr+="value=\""+PwCHa+"\">"+Translator.country(PwCHa)+"</option>"
}
if((qGCoe.length>0)&&(uSkKC.length>0))
{
gnivr+="<option value=\"\">-----</option>"
}
var ilsTH=new Array()
for(var OaNbH=0;OaNbH<uSkKC.length;OaNbH++)
{
var PwCHa=uSkKC[OaNbH]
ilsTH.push({code:PwCHa,lab:Translator.country(PwCHa)})
}
if((qGCoe.length==0)&&(uSkKC.length==0))
{
var WwkSM=CONST_WA_COUNTRIES.codes
for(var OaNbH=0;OaNbH<WwkSM.length;OaNbH++)
{
var PwCHa=WwkSM[OaNbH]
ilsTH.push({code:PwCHa,lab:Translator.country(PwCHa)})
}
}
ilsTH.sort(mdHam)
for(var OaNbH=0;OaNbH<ilsTH.length;OaNbH++)
{
var RTXge=ilsTH[OaNbH]
var PwCHa=RTXge.code
gnivr+="<option "
if(BVLEL.LfKNd.EXfAq()==PwCHa)gnivr+="selected "
gnivr+="value=\""+PwCHa+"\">"+Translator.country(PwCHa)+"</option>"
}
gnivr+="</select>"
gnivr+="<br>"
gnivr+="<br>"
}
var FMXnS=CONST_WA_GLOBAL_SETTINGS.list_type_payment
if(FMXnS.length>1)
{
gnivr+="<span style='font-weight:bold;'>"
gnivr+=Translator.tr("Choose a type of payment")
gnivr+="</span>"
gnivr+="<br>"
gnivr+="<select onchange=\"WA_marketChangeTypePayment(this)\" id='wa-market-select-payment'>"
if((FMXnS.length>1)||(FMXnS.length==0))
{
gnivr+="<option value=\"\">...</option>"
}
for(var OaNbH=0;OaNbH<FMXnS.length;OaNbH++)
{
var cmoDW=FMXnS[OaNbH]
gnivr+="<option "
if(BVLEL.LfKNd.cmoDW==cmoDW)gnivr+="selected "
gnivr+="value=\""+cmoDW+"\">"+Translator.tr("label_market_"+cmoDW)+"</option>"
}
gnivr+="</select>"
gnivr+="<br>"
gnivr+="<br>"
}
if(CONST_WA_GLOBAL_SETTINGS.list_promo_codes)
{
var WwkSM=CONST_WA_GLOBAL_SETTINGS.list_promo_codes
gnivr+="<span id='wa-promo-code-label'  style='font-weight:bold;'>"
gnivr+=Translator.tr("form-label-code_promo")
gnivr+="</span><br>"
gnivr+="<input id='wa-promo-code' onchange=\"WA_marketChangePromoCode(this)\" " 
gnivr+=" value='"+BVLEL.LfKNd.RBTSk+"' "
gnivr+="/>"
gnivr+="<br>"
gnivr+="<br>"
}
if(CONST_WA_GLOBAL_SETTINGS.link_sale_condition)
{
gnivr+="<a "+WA_LinkToHref(CONST_WA_GLOBAL_SETTINGS.link_sale_condition)+" style='color:#0000ff'>"
gnivr+=Translator.tr("Terms of sell")
gnivr+="</a>"
gnivr+="<br>" 
gnivr+="<span id='wa-sales-condition-label'  style='font-weight:bold;'>"
gnivr+=Translator.tr("label_market_accept_terms")
gnivr+="</span>"
gnivr+="<input id='wa-sales-condition' onchange=\"WA_marketChangeSalesCondition(this)\" "
gnivr+=(BVLEL.LfKNd.JOlpM)?"checked ":""
gnivr+="type='checkbox' value='1'/>" 
gnivr+="<br>"
gnivr+="<br>" 
}
if((bcbYo==1)||(FMXnS.length==1))
{
gnivr+="<hr width=80%>"
gnivr+="<br>"
if(bcbYo==1)
{
BVLEL.LfKNd.wljZL=jQKuJ
gnivr+="<span style='font-weight:bold;'>"
gnivr+=Translator.tr("form-label-country")+" : "+Translator.country(BVLEL.LfKNd.wljZL)
gnivr+="</span>"
gnivr+="<br>"
gnivr+="<br>"
}
if(FMXnS.length==1)
{
var cmoDW=FMXnS[0]
gnivr+="<span style='font-weight:bold;'>"
gnivr+=Translator.tr("PRINT_FORM_LABEL_TYPE_PAYMENT")+" : "+Translator.tr("label_market_"+cmoDW)
gnivr+="</span>"
gnivr+="<br>"
gnivr+="<br>"
}
}
gnivr+="</div>"
this.writeContent(gnivr)
var WjvtO=html_getLayer("market-cart-content")
WjvtO.innerHTML="<div width=100% align=center><img src='wa_loading.gif'></div>" 

BVLEL.bipAa(this,this.boHXN)
}
xjgMY.lkeio() 
}
function WA_marketChangeCountry(aWfbQ)
{
aWfbQ.style.backgroundColor=""
var xjgMY=WA_Dialog.getCurrent()
xjgMY.boHXN()
}
function WA_marketChangeTypePayment(aWfbQ)
{
var BVLEL=qVMCO();
BVLEL.LfKNd.cmoDW=aWfbQ.value
BVLEL.LfKNd.dewNs()
aWfbQ.style.backgroundColor=""
}
function WA_marketChangeSalesCondition(dlkRa)
{
var BVLEL=qVMCO();
BVLEL.LfKNd.JOlpM=dlkRa.checked
BVLEL.LfKNd.dewNs() 
var vDJGZ=document.getElementById("wa-sales-condition-label")
vDJGZ.style.backgroundColor="" 
}
function WA_marketChangePromoCode(dlkRa)
{
var BVLEL=qVMCO();
BVLEL.LfKNd.RBTSk=dlkRa.value
BVLEL.LfKNd.dewNs() 


}
function WA_LinkToHref(jqpec)
{
var gnivr=""
var KGfAf=jqpec.url
var frVvH=Translator.m_lang_for_filename
if(frVvH.length>0)frVvH="_"+frVvH
KGfAf=KGfAf.replace(/@lng@/g,frVvH)
gnivr+="href=\""+KGfAf+"\" "
if(jqpec.open==1)
{
gnivr+="target="
gnivr+="_blank"
}
return gnivr;
}
function WA_displayDialogMarketProduct(nkesO,OrlXg)
{
var vamlP=wa_global_market.markets[nkesO]
var lbHFc=vamlP.obj
var IvWVn=lbHFc.info.products
var NdUkr=IvWVn[OrlXg] 

var xjgMY=new WA_Dialog();

xjgMY.NdUkr=NdUkr
xjgMY.WVGMR=nkesO
xjgMY.dSdPa=function()
{
WA_displayDialogMarketCart()
}
xjgMY.uPpMb=function()
{
var BVLEL=qVMCO();
BVLEL.bipAa(this,this.ugQUj) 
}
xjgMY.ugQUj=function()
{
var NdUkr=this.NdUkr;
var BVLEL=qVMCO();
var CfHDK=new Array();
var CVkUs=NdUkr.obj.id;
for(var i=0;i<3;i++)
{
var tMtfW=-1;
var IIWum=CVkUs+"-select-opt"
var aWfbQ=document.getElementById(IIWum+i)
if(aWfbQ)
{
if(aWfbQ.value.length==0)
{
aWfbQ.style.backgroundColor="#ff0000";
aWfbQ.focus()
return;
}
tMtfW=parseInt(aWfbQ.value)
}
CfHDK.push(tMtfW)
}
if(BVLEL.addProductToShoppingCard(NdUkr,CfHDK))
{
BVLEL.bVkji()
WA_displayDialogMarketCart()
}
}
xjgMY.lkeio=function()
{
var nkesO=this.WVGMR
var NdUkr=this.NdUkr
var gnivr=""
this.addButton(Translator.tr("Go to my card"),this.dSdPa,[""],this)
if(NdUkr.unavail==false)
{
this.addButton(Translator.tr("Add to card"),this.uPpMb,[""],this)
}
this.initializeWindow(670,this.idealHeight())
gnivr+="<table border=0 width=100% cellpadding=4>"
gnivr+="<tr>" 
if(NdUkr.img_big.length>0)
{
gnivr+="<td width='100px' align=center valign=top>"
var cojFD=NdUkr.size_thumb.clone() 
cojFD.scale(new Size(200,200))
gnivr+="<a href=\""+NdUkr.img_big+"\" target=_blank>"
gnivr+="<img border=0 src=\""+NdUkr.img_big+"\" width='"+cojFD.width+"px' height='"+cojFD.height+"px'>"
gnivr+="</a>"
gnivr+="</td>"
}
var fJClI="color:"+WA_GLOBAL_COLOR_THEME.color_text+";";
gnivr+="<td valign=top style='font-family:Arial;'>"
gnivr+="<span style='font-weight:bold;font-size:16px;"+fJClI+"'>"
gnivr+=NdUkr.title
gnivr+="</span>"
gnivr+="<br>"
if(NdUkr.sub_title.length>0)
{
gnivr+="<span style='color:#333333;font-size:14px;'>"
gnivr+=NdUkr.sub_title
gnivr+="</span>"
gnivr+="<br>"
}
gnivr+="<br>"
gnivr+="<table border=0 width=100% cellspacing=0 cellpadding=0><tr><td>"
gnivr+="<span style='"+fJClI+";font-size:14px;'>"
gnivr+=Translator.tr("Price")+" : "
gnivr+="</span>"
gnivr+="<span style='"+fJClI+";font-size:18px;font-weight:bold;' id='"+NdUkr.obj.id+"-price'>"
if(NdUkr.unavail)
{
gnivr+=Translator.tr("Unavailable")
}
gnivr+="</span>"
if(NdUkr.more_info)
{
gnivr+="</td><td align=right>"
var jqpec=NdUkr.more_info
var vxkuZ=WA_LinkToHref(jqpec)
gnivr+="<a "+vxkuZ+" style='font-family:Arial;text-decoration:underline;font-weight:bold;font-size:12px;color:0000ff;'>"+Translator.tr("More product info link")+"</a>"
}
gnivr+="</td></tr></table>"
gnivr+="<br>"
var sCiwP=NdUkr.obj.index
if(NdUkr.unavail==false)
if(NdUkr.options.length>0)
{
gnivr+="<table border=0 cellspacing=0 cellpadding=0>"
for(var n=0;n<NdUkr.options.length;n++)
{
var FesVa=NdUkr.options[n]
if(FesVa)
{
gnivr+="<tr><td align=right>"
gnivr+="<span style='font-family:Arial;font-weight:bold;font-size:12px;"+fJClI+"'>"
gnivr+=FesVa.title+" :&nbsp;"
gnivr+="</span>"
gnivr+="</td><td align=left>"
gnivr+="<select id='"+NdUkr.obj.id+"-select-opt"+n+"' onchange=\"WA_market_changeCustomPrice('"+nkesO+"',"+sCiwP+")\">"
gnivr+="<option value=\"\">...</option>"
for(var OaNbH=0;OaNbH<FesVa.vals.length;OaNbH++)
{
var SDpFp=FesVa.vals[OaNbH]
gnivr+="<option value=\""+OaNbH+"\">"+SDpFp+"</option>"
}
gnivr+="</select>"
gnivr+="</td></tr>";
}
}
gnivr+="</table>"
}
gnivr+="</td>"
gnivr+="</tr>"
gnivr+="</table>"
if(NdUkr.description.length>0)
{
gnivr+="<table border=0 width=100% cellpadding=4>"
gnivr+="<tr><td colspan=2>"
gnivr+="<span style='font-family:Arial;font-size:13px;"+fJClI+"'>"
gnivr+="<hr>"
gnivr+=NdUkr.description
gnivr+="</span>"
gnivr+="</td></tr>"
gnivr+="</table>"
}
this.writeContent(gnivr)
WA_market_changeCustomPrice(nkesO,sCiwP)
}
xjgMY.displayWindowWithAutoResize(300,xjgMY.lkeio) 
}
function BUQak(NdUkr,CVkUs)
{
var rJWfD=new Array()
for(var i=0;i<3;i++)
{
var IIWum=CVkUs+"-select-opt"
var aWfbQ=document.getElementById(IIWum+i)
rJWfD[i]=-1
if(aWfbQ)
{
aWfbQ.style.backgroundColor="";
var SDpFp=parseInt(aWfbQ.value)
if(isNaN(SDpFp)==false)
rJWfD[i]=SDpFp
}
}
return YgbVO(NdUkr,rJWfD)
}
function YgbVO(NdUkr,rJWfD)
{
if(NdUkr.unavail)return;
var wxSKM=false;
for(var i=0;i<NdUkr.custom_prices.length;i++)
{
var sfOhE=NdUkr.custom_prices[i]
var LoXFx=true;
for(var n=0;n<3;n++)
{
if(sfOhE.tab[n]!=rJWfD[n])LoXFx=false
}
if(LoXFx)
{
wxSKM=sfOhE;
break;
}
}
var wHjGZ=NdUkr.price
if(wxSKM)
{
wHjGZ=wxSKM.pr
}
return wHjGZ;
}
function WA_market_changeCustomPrice(nkesO,sCiwP)
{
var BVLEL=qVMCO();
var vamlP=wa_global_market.markets[nkesO]
var IvWVn=vamlP.info.products;
var NdUkr=IvWVn[sCiwP]
if(NdUkr.unavail)return;
var CVkUs=NdUkr.obj.id
var wHjGZ=BUQak(NdUkr,CVkUs)
var SJORf=html_getLayer(CVkUs+"-price")
if(SJORf)
{
SJORf.innerHTML=BVLEL.pbora(wHjGZ)
}
}
function PYHmk()
{
var BVLEL=qVMCO();
if(WA_getNumberMarketItemsInCart()==0)return;
var rZvZu=BVLEL.LfKNd
if((BVLEL.NJvpI)&&(rZvZu.cmoDW=="paypal"))
{
HsKhS();
return;
}
sqsbp(WaBKw)
}
function sqsbp(CAlDX)
{
var BVLEL=qVMCO();
var rZvZu=BVLEL.LfKNd
rZvZu.VdXoc()
var xjgMY=new WA_Dialog();
xjgMY.CAlDX=CAlDX
xjgMY.UpckX=function(ZBVBo)
{
return Translator.tr("form-label-"+ZBVBo)
}
xjgMY.onCustomKeypress=function(ZBVBo)
{
if(ZBVBo==13)
{
wa_timeout(Delegate.create(this,this.bDaOf),0);
}
return false;
}
xjgMY.fbYDD=function()
{
if(this.CAlDX==WaBKw)
{
WA_displayDialogMarketCart()
}
else
{
sqsbp(WaBKw)
}
}
xjgMY.mpUrg=function()
{
HsKhS()
}
xjgMY.bDaOf=function()
{
var BVLEL=qVMCO();
var rZvZu=BVLEL.LfKNd
if(rZvZu.iUrrh(this.CAlDX)==false) return;
rZvZu.dewNs()
if(this.CAlDX==WaBKw)
{
if(rZvZu.tpQSs==true)
{
sqsbp(NHYfZ)
}
else
{
this.mpUrg()
}
}
else
{
this.mpUrg()
}
}
xjgMY.VxHsm=function(ZBVBo,qrbiw)
{
if(qrbiw==undefined) qrbiw=""
if(qrbiw)qrbiw=" size="+qrbiw
return "<input name='"+ZBVBo+"' value=\""+rZvZu.vXpmC(ZBVBo,this.CAlDX)+"\" type=text "+qrbiw+">"
}
xjgMY.HSTvi=function(nwaSo)
{
return "<td width=150px align=right valign=top>"+Translator.tr(nwaSo)+" :</td>"
}
xjgMY.lkeio=function()
{
var BVLEL=qVMCO();
var rZvZu=BVLEL.LfKNd 
this.addButton("< "+Translator.tr('Back'),this.fbYDD,[""],this)
this.addButton(Translator.tr('Continue')+" >",this.bDaOf,[""],this)
this.initializeWindow(600,600)
var UJTcn="form-label-"
var OYssT=CONST_WA_GLOBAL_SETTINGS.list_form_fields 
var gnivr=""
gnivr+="<form id='wa-market-form' onSubmit='return false'>"
gnivr+="<table border=0 width=100% cellspacing=5 style='font-family:Arial;font-size:15px;'>"
gnivr+="<tr><td colspan=2 align=center style='font-size:18px;'>"
gnivr+=Translator.tr((this.CAlDX==WaBKw)?"Fill Deliver information below":"Fill Billing information below")
gnivr+="<br><br></td></tr>"
for(var n=0;n<OYssT.length;n++)
{
var bvhEG=OYssT[n]
if(bvhEG=="address")
{
gnivr+="<tr>"+this.HSTvi("Address");
gnivr+="<td>"
gnivr+=this.VxHsm("address_1",30)
gnivr+="</td></tr>"
gnivr+="<tr><td></td><td>"
gnivr+=this.VxHsm("address_2",30)
gnivr+="</td></tr>"
gnivr+="<tr>"+this.HSTvi("form-label-city");
gnivr+="<td>"
gnivr+=this.VxHsm("city")+"&nbsp;"+this.UpckX("zip")+" : "+this.VxHsm("zip",10)
gnivr+="</td></tr>" 
gnivr+="<tr>"+this.HSTvi("form-label-country");
gnivr+="<td>"
if(this.CAlDX==NHYfZ)
{
gnivr+="<select id='wa-select-form-country' onchange='WA_marketChangeFormCountry("+this.CAlDX+")'>"
var ilsTH=new Array();
var WwkSM=CONST_WA_COUNTRIES.codes
for(var OaNbH=0;OaNbH<WwkSM.length;OaNbH++)
{
var PwCHa=WwkSM[OaNbH]
ilsTH.push({code:PwCHa,lab:Translator.country(PwCHa)})
}
ilsTH.sort(mdHam)
var adFdh=rZvZu.EXfAq()
adFdh=rZvZu.vXpmC('countryCode',this.CAlDX,adFdh)
for(var OaNbH=0;OaNbH<ilsTH.length;OaNbH++)
{
var RTXge=ilsTH[OaNbH]
var PwCHa=RTXge.code
gnivr+="<option "
if(adFdh==PwCHa)gnivr+="selected "
gnivr+="value=\""+PwCHa+"\">"+Translator.country(PwCHa)+"</option>"
}
gnivr+="</select>"
}
else
{
gnivr+=Translator.country(BVLEL.LfKNd.wljZL);
}
gnivr+="<br><span id='wa-market-state'>"
gnivr+="<select id='wa-select-state'></select>"
gnivr+="</span>" 
gnivr+="</td></tr>"
}
else
{
gnivr+="<tr>"+this.HSTvi("form-label-"+bvhEG);
gnivr+="<td>"
gnivr+=this.VxHsm(bvhEG,30) 
gnivr+="</td></tr>"
}
}
if(this.CAlDX==WaBKw)
{
gnivr+="<tr><td colspan=2 align=center >"
gnivr+=Translator.tr("Billing adress is different")+" <input type=checkbox "
if(BVLEL.LfKNd.tpQSs)gnivr+="checked "
gnivr+="onchange='WA_marketCheckBillingAdress(this)'>"
gnivr+="</td></tr>"
}
gnivr+="</table>"
gnivr+="</form>"
this.writeContent(gnivr)
WA_exec_callback_opera_compliant(this,this.fbsLg) 
}
xjgMY.fbsLg=function()
{
WA_marketChangeFormCountry(this.CAlDX)
}
xjgMY.lkeio()
}
function xJBPi(CAlDX,aWfbQ,tuZUS)
{
var BVLEL=qVMCO();
var rZvZu=BVLEL.LfKNd
var pYuKU=rZvZu.vXpmC("stateCode",CAlDX) 
aWfbQ.options.length=0
for(var n=0;n<tuZUS.length;n++)
{
var val=tuZUS[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==pYuKU)elOptNew.selected=true
try{
aWfbQ.add(elOptNew,null);
}
catch(ex){
aWfbQ.add(elOptNew);
}
}
}
function WA_marketChangeFormCountry(CAlDX)
{
var BVLEL=qVMCO();
var rZvZu=BVLEL.LfKNd
var uVOIF=rZvZu.wljZL
var aWfbQ=document.getElementById("wa-select-form-country");
if(aWfbQ) uVOIF=aWfbQ.value;
html_SetDisplay("wa-market-state",(uVOIF=="US")||(uVOIF=="CA")||(uVOIF=="BR"))
var JVujb=document.getElementById("wa-select-state");
if(JVujb)
{
if(uVOIF=="US") xJBPi(CAlDX,JVujb,["","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(uVOIF=="CA") xJBPi(CAlDX,JVujb,["","Alberta","British Columbia","Manitoba","New Brunswick","Newfoundland and Labrador","Northwest Territories","Nova Scotia","Nunavut","Ontario","Prince Edward Isl.","Quebec","Saskatchewan","Yukon Territory"])
if(uVOIF=="BR") xJBPi(CAlDX,JVujb,["","Acre(AC)","Alagoas(AL)","Amapá(AP)","Amazonas(AM)","Bahia(BA)","Ceará(CE)","Espírito Santo(ES)","Goiás(GO)","Maranhão(MA)","Mato Grosso(MT)","Mato Grosso do Sul(MS)","Minas Gerais(MG)","Pará(PA)","Paraíba(PB)","Paraná(PR)","Pernambouc(PE)","Piauí(PI)","Rio de Janeiro(RJ)","Rio Grande do Norte(RN)","Rio Grande do Sul(RS)","Rondônia(RO)","Roraima(RR)","Santa Catarina(SC)","São Paulo(SP)","Sergipe(SE)","Tocantins(TO)","District fédéral(DF)"])
}
}
function WA_marketCheckBillingAdress(dlkRa)
{
var BVLEL=qVMCO();
var rZvZu=BVLEL.LfKNd
rZvZu.tpQSs=dlkRa.checked
rZvZu.dewNs()
}
function HsKhS()
{
var BVLEL=qVMCO();
var CDGmd=CONST_WA_GLOBAL_SETTINGS.currency_info 

var xjgMY=new WA_Dialog();
xjgMY.fbYDD=function()
{
if(BVLEL.LfKNd.cmoDW=="paypal")
{
WA_displayDialogMarketCart();return;
}
if(BVLEL.LfKNd.tpQSs)
sqsbp(NHYfZ)
else
sqsbp(WaBKw)
}
xjgMY.KrRRi=function(XJnxl,SDpFp)
{
SDpFp=""+SDpFp
SDpFp=SDpFp.replace(/'/g,"&lsquo;")
return "<input type=hidden name='"+XJnxl+"' value=\""+SDpFp+"\">"
}
xjgMY.wLKom=function()
{
var BVLEL=qVMCO();
var gnivr=""
if(CDGmd.charCodeAt(3)>=100) return""
gnivr+="<form id='wa-http-sender' method=POST action='https://www.paypal.com/cgi-bin/webscr' target='_blank'>"
gnivr+=this.KrRRi("cmd","_cart")
gnivr+=this.KrRRi("business",CONST_WA_GLOBAL_SETTINGS.email_paypal_account)
gnivr+=this.KrRRi("upload","1")
gnivr+=this.KrRRi("charset","utf-8")
gnivr+=this.KrRRi("no_note","0")
gnivr+=this.KrRRi("currency_code",CONST_WA_GLOBAL_SETTINGS.currency_code)
gnivr+=this.KrRRi("no_shipping","2")
var oaJSA=BVLEL.jvPOu()
for(var i=0;i<oaJSA.length;i++)
{
var info=oaJSA[i];
var index=i+1;
var vKDNV=info.ShSef();
if(BVLEL.vJVjm())
{
var tsqGN=BVLEL.YfvVg(BVLEL.fWshP(vKDNV));
vKDNV=vKDNV-tsqGN;
}
gnivr+=this.KrRRi("amount_"+index,""+vKDNV)
gnivr+=this.KrRRi("quantity_"+index,info.fdFQj)
var bOAuX=0;
if(info.NWNYl.length>0)
{
gnivr+=this.KrRRi("on"+bOAuX+"_"+index,"ref")
gnivr+=this.KrRRi("os"+bOAuX+"_"+index,info.NWNYl)
bOAuX++;
}
var rtTTg=""
if(info.m_opt_vals)
{
for(var i_opt=0;i_opt<info.NdUkr.options.length;i_opt++)
{
var FesVa=info.NdUkr.options[i_opt]
if(FesVa)
{
var Euxiv=info.m_opt_vals[i_opt];
var BZnSM=FesVa.vals[Euxiv]
var rvZde=FesVa.title;
if(rvZde.length==0) rvZde="opt"+(i_opt+1);
gnivr+=this.KrRRi("on"+bOAuX+"_"+index,rvZde)
gnivr+=this.KrRRi("os"+bOAuX+"_"+index,BZnSM)
if(rtTTg.length>0)rtTTg=rtTTg+", "
rtTTg+=BZnSM
bOAuX++;
}
}
}
var OwZZa=info.Nubbg;
if(rtTTg.length>0)OwZZa=OwZZa+"("+rtTTg+")"
gnivr+=this.KrRRi("item_name_"+index,OwZZa) 
}
var gZUtn=BVLEL.PLMiC()
if(BVLEL.vJVjm())
{
gZUtn=gZUtn-BVLEL.YfvVg(BVLEL.fWshP(gZUtn));
}
if(BVLEL.vJVjm())
{
var qrueR=BVLEL.MUFOv();
var fkZxn=BVLEL.PLMiC()
var uOCLG=qrueR+fkZxn;
var CKtwE=BVLEL.YfvVg(BVLEL.fWshP(uOCLG));
var SvGkj=uOCLG-CKtwE;
SvGkj=SvGkj-gZUtn;
var jObpW=0;
for(var i=0;i<oaJSA.length;i++)
{
var info=oaJSA[i];
var index=i+1;
var MLfMN=0;
var LnHBd=0;
var vKDNV=info.fdFQj*info.ShSef();
var n0=BVLEL.VZwMR()/100;
var tax=vKDNV*(n0/(1+n0));
vKDNV=vKDNV-tax;
MLfMN=vKDNV;
var XmPhe=info.ShSef();
var tsqGN=BVLEL.YfvVg(BVLEL.fWshP(XmPhe));
XmPhe=XmPhe-tsqGN;
LnHBd=info.fdFQj*XmPhe;
if(LnHBd>MLfMN)
{
XmPhe=info.m_price;
XmPhe=XmPhe-tsqGN;
var JbDIB=XmPhe;
if((JbDIB>0)&&(JbDIB!=info.ShSef()))
{
JbDIB=JbDIB-0.01;
}
gnivr+=this.KrRRi("amount_"+index,JbDIB) 
LnHBd=info.m_quantity*JbDIB;
}
jObpW+=LnHBd;
}
var jrCuU=BVLEL.YfvVg(SvGkj-jObpW);
if(jrCuU>0)
{
var index=oaJSA.length+1;
gnivr+=this.KrRRi("item_name_"+index,Translator.tr("TVA correction"))
gnivr+=this.KrRRi("quantity_"+index,1)
gnivr+=this.KrRRi("amount_"+index,jrCuU)
}
gnivr+=this.KrRRi("tax_cart",CKtwE)
}
else
{
gnivr+=this.KrRRi("tax_cart",BVLEL.HcMCT())
}
gnivr+=this.KrRRi("handling_cart",gZUtn) 
gnivr+="</form>"
return gnivr;
}
xjgMY.TFfad=function()
{
var tavFe=this.NgaxR(WaBKw);
var gnivr="";
if(tavFe.length>0)
{
gnivr+=""+Translator.tr("Shipping information")+":\n";
gnivr+=tavFe;
}
return gnivr;
}
xjgMY.jDXpb=function()
{
var tavFe=this.NgaxR(NHYfZ);
var gnivr="";
if(tavFe.length>0)
{
gnivr+=Translator.tr("Billing information")+":\n";
gnivr+=tavFe;
}
return gnivr;
}
xjgMY.NgaxR=function(CAlDX)
{
var BVLEL=qVMCO();
var rZvZu=BVLEL.LfKNd
var gnivr="";
var AlsXS=new Array();
var OYssT=JftQQ(CONST_WA_GLOBAL_SETTINGS.list_form_fields)
OYssT.push("country")
OYssT.push("state")
for(var i=0;i<OYssT.length;i++)
{
var vOodT=OYssT[i];
AlsXS[vOodT]=rZvZu.vXpmC(vOodT,CAlDX)
}
if(AlsXS["firstname"])gnivr+=AlsXS["firstname"]+"\n"
if(AlsXS["lastname"])gnivr+=AlsXS["lastname"]+"\n"
if(AlsXS["company"])
{
gnivr+=Translator.tr("form-label-company")+" : "+AlsXS["company"]+"\n"
}
if(AlsXS["fiscal_code"]) gnivr+=Translator.tr("form-label-fiscal_code")+" : "+AlsXS["fiscal_code"]+"\n"
if(AlsXS["tva"]) gnivr+=Translator.tr("form-label-tva")+" : "+AlsXS["tva"]+"\n"
if(AlsXS["address_1"]) gnivr+=AlsXS["address_1"]+"\n"
if(AlsXS["address_2"]) gnivr+=AlsXS["address_2"]+"\n"
if(AlsXS["zip"]) gnivr+=AlsXS["zip"]+" "
if(AlsXS["city"]) gnivr+=AlsXS["city"]+"\n"
if(AlsXS["country"])gnivr+=Translator.country(AlsXS["country"])
if(AlsXS["state"]&&AlsXS["state"].length>0) gnivr+=" "+AlsXS["state"];
gnivr+="\n"
if(AlsXS["phone"]) gnivr+=Translator.tr("form-label-phone")+" : "+AlsXS["phone"]+"\n"
if(AlsXS["fax"]) gnivr+=Translator.tr("form-label-fax")+" : "+AlsXS["fax"]+"\n"
if(AlsXS["email"]) gnivr+=AlsXS["email"]+"\n" 
if(AlsXS["comment"])
{
gnivr+=Translator.tr("form-label-comment")+" : \n";
gnivr+=AlsXS["comment"]+"\n"
}
return gnivr;
}
xjgMY.PbYCC=function()
{
var BVLEL=qVMCO();
var gnivr="";
var oaJSA=BVLEL.jvPOu();
gnivr+="**************\n"
for(var i=0;i<oaJSA.length;i++)
{
var rZvZu=oaJSA[i];
var index=i+1;
var OwZZa=rZvZu.Nubbg;
if(rZvZu.NWNYl.length>0)
{
OwZZa+=" ["+rZvZu.NWNYl+"]";
}
var rtTTg=""
if(rZvZu.m_opt_vals)
{
for(var i_opt=0;i_opt<rZvZu.NdUkr.options.length;i_opt++)
{
var FesVa=rZvZu.NdUkr.options[i_opt]
if(FesVa)
{
if(rtTTg.length>0)rtTTg=rtTTg+", "
var Euxiv=rZvZu.m_opt_vals[i_opt];
var BZnSM=FesVa.vals[Euxiv]
var rvZde=FesVa.title;
if(rvZde.length>0) rtTTg+=rvZde+" : "
rtTTg+=BZnSM
}
}
}
if(rtTTg.length>0)OwZZa=OwZZa+"\n("+rtTTg+")"
gnivr+=OwZZa;
gnivr+="\n"
gnivr+=Translator.tr("Price")+" : "+BVLEL.uOWfq(rZvZu.ShSef())+"\n"
gnivr+=Translator.tr("Quantity")+" : "+rZvZu.fdFQj+"\n"
gnivr+=Translator.tr("Total")+" : "+BVLEL.uOWfq(rZvZu.ShSef()*rZvZu.fdFQj);
gnivr+="\n"
gnivr+="**************\n"
}
var gLrxZ=BVLEL.MUFOv()
var RpwqS=BVLEL.HcMCT()
var ZmXJu=BVLEL.PLMiC()
var FMPve=BVLEL.tpJBg()
var DBjCV=BVLEL.BhSRu() 
gnivr+=Translator.tr("Sub total")+" : "+BVLEL.uOWfq(gLrxZ)+"\n";
if(CONST_WA_GLOBAL_SETTINGS.shipping_type!=DWLic)
{
gnivr+=Translator.tr("Shipping amount")+" : "+BVLEL.uOWfq(ZmXJu)+"\n";
}
if(BVLEL.vJVjm()||BVLEL.tNPkJ())
{
if(BVLEL.vJVjm())
{
gnivr+=Translator.tr("Tax included");
}
if(BVLEL.tNPkJ())
{
gnivr+=Translator.tr("Extra Tax");
}
gnivr+=" : ";
gnivr+=BVLEL.uOWfq(RpwqS)+"\n";
}
if(DBjCV>0)
{
gnivr+=Translator.tr("Promotion")+" : - "+BVLEL.uOWfq(DBjCV)+"\n";
}
gnivr+=Translator.tr("Total")+" : "+BVLEL.uOWfq(FMPve)+"\n";
return gnivr;
}
xjgMY.ZWaNg=function()
{
var BVLEL=qVMCO();
var gnivr="";
var oaJSA=BVLEL.jvPOu()
gnivr+="<table class=wa-cart-global-table >"
gnivr+="<tr class=wa-cart-title >"
gnivr+="<td>&nbsp;</td>"
gnivr+="<td>"+Translator.tr("Price")+"</td>"
gnivr+="<td>"+Translator.tr("Quantity")+"</td>"
gnivr+="<td>"+Translator.tr("Total")+"</td>"
gnivr+="</tr>"
for(var i=0;i<oaJSA.length;i++)
{
gnivr+="<tr>"
var rZvZu=oaJSA[i];
var index=i+1;
gnivr+="<td>"
var OwZZa=rZvZu.Nubbg;
if(rZvZu.NWNYl.length>0)
{
OwZZa+=" ["+rZvZu.NWNYl+"]";
}
OwZZa="<b>"+OwZZa+"</b>"
var rtTTg=""
if(rZvZu.m_opt_vals)
{
for(var i_opt=0;i_opt<rZvZu.NdUkr.options.length;i_opt++)
{
var FesVa=rZvZu.NdUkr.options[i_opt]
if(FesVa)
{
if(rtTTg.length>0)rtTTg=rtTTg+", "
var Euxiv=rZvZu.m_opt_vals[i_opt];
var BZnSM=FesVa.vals[Euxiv]
var rvZde=FesVa.title;
if(rvZde.length>0) rtTTg+=rvZde+" : "
rtTTg+=BZnSM
}
}
}
if(rtTTg.length>0)OwZZa=OwZZa+"<br><span class=wa-cart-option >("+rtTTg+")</span>"
gnivr+=OwZZa;
gnivr+="</td>"
gnivr+="<td>"+BVLEL.pbora(rZvZu.ShSef())+"</td>"
gnivr+="<td>"+rZvZu.fdFQj+"</td>"
gnivr+="<td>"+BVLEL.pbora(rZvZu.ShSef()*rZvZu.fdFQj)+"</td>"
gnivr+="</tr>"
}
gnivr+="<tr><td colspan=4>"
var gLrxZ=BVLEL.MUFOv()
var RpwqS=BVLEL.HcMCT()
var ZmXJu=BVLEL.PLMiC()
var FMPve=BVLEL.tpJBg()
var DBjCV=BVLEL.BhSRu() 
gnivr+="<table class=wa-cart-table-total >"
gnivr+="<tr><td align=right >"+Translator.tr("Sub total")+" : "+BVLEL.pbora(gLrxZ)+"</td></tr>";
if(CONST_WA_GLOBAL_SETTINGS.shipping_type!=DWLic)
{
gnivr+="<tr><td align=right>"+Translator.tr("Shipping amount")+" : "+BVLEL.pbora(ZmXJu)+"</td></tr>";
}
if(BVLEL.vJVjm()||BVLEL.tNPkJ())
{
if(BVLEL.vJVjm())
{
gnivr+="<tr><td align=left >"+Translator.tr("Tax included");
}
if(BVLEL.tNPkJ())
{
gnivr+="<tr><td align=right >"+Translator.tr("Extra Tax");
}
gnivr+=" : ";
gnivr+=BVLEL.pbora(RpwqS)+"</td></tr>";
}
if(DBjCV>0)
{
gnivr+="<tr><td align=right class=wa-cart-promo >"+Translator.tr("Promotion")+" : - "+BVLEL.pbora(DBjCV)+"</td></tr>";
}
gnivr+="<tr><td align=right class=wa-cart-total >"+Translator.tr("Total")+" : "+BVLEL.pbora(FMPve)+"</td></tr>";
gnivr+="</table>" 
gnivr+="</td></tr>"
gnivr+="</table>"
gnivr=gnivr.replace(/\"/g,"'")
return gnivr;
}
xjgMY.HQaSL=function(SDpFp)
{
if((""+SDpFp).length==1)SDpFp="0"+SDpFp;
return SDpFp
}
xjgMY.TUlRX=function()
{
var BVLEL=qVMCO();
var rZvZu=BVLEL.LfKNd
var gnivr=""
if(CDGmd.charCodeAt(3)>=100) return""
if(Wcejx)
{
gnivr+="<form id='wa-http-sender' method=POST action='"+Wcejx_URL+"crbst_market_print_form.php' target='_blank'>"
}
else
{
gnivr+="<form id='wa-http-sender' method=POST action='crbst_market_print_form.php' target='_blank'>"
}
gnivr+=this.KrRRi("type_payment",rZvZu.cmoDW)
gnivr+=this.KrRRi("MAIL_TITLE_PREFIXE",Translator.tr("title email Order notification"))
gnivr+=this.KrRRi("MAIN_TITLE",Translator.tr("PRINT_FORM_MAIN_TITLE"))
gnivr+=this.KrRRi("PREFIXE_ORDER",Translator.tr("PRINT_FORM_PREFIXE_ORDER"))
var aijDx=""
var CXPoK=new Date()
aijDx+="wa-"+this.HQaSL(CXPoK.getYear()-100)+this.HQaSL(CXPoK.getMonth()+1)+this.HQaSL(CXPoK.getDate())
aijDx+=CXPoK.getHours()+this.HQaSL(CXPoK.getMinutes())+this.HQaSL(CXPoK.getSeconds())
aijDx+="-"+Math.round(Math.random()*100) 
gnivr+=this.KrRRi("ID_ORDER",aijDx)
gnivr+=this.KrRRi("CARD_TITLE",Translator.tr("PRINT_FORM_CARD_TITLE"))
gnivr+=this.KrRRi("LABEL_TYPE_PAYMENT",Translator.tr("PRINT_FORM_LABEL_TYPE_PAYMENT"))
gnivr+=this.KrRRi("send_copy_email_to_buyer",(BVLEL.send_copy_email_to_buyer)?"1":"0") 

var AlsXS=new Array();
var OYssT=JftQQ(CONST_WA_GLOBAL_SETTINGS.list_form_fields)
OYssT.push("country")
OYssT.push("state")
for(var i=0;i<OYssT.length;i++)
{
var vOodT=OYssT[i];
AlsXS[vOodT]=BVLEL.LfKNd.vXpmC(vOodT,WaBKw)
}
gnivr+=this.KrRRi("form_first_name",AlsXS["firstname"]);
gnivr+=this.KrRRi("form_last_name",AlsXS["lastname"]);
gnivr+=this.KrRRi("form_address1",AlsXS["address_1"]);
gnivr+=this.KrRRi("form_address2",AlsXS["address_2"]);
gnivr+=this.KrRRi("form_city",AlsXS["address_2"]);
gnivr+=this.KrRRi("form_zip",AlsXS["zip"]);
gnivr+=this.KrRRi("form_state",AlsXS["state"]);
gnivr+=this.KrRRi("form_country",AlsXS["country"]);
gnivr+=this.KrRRi("form_company",AlsXS["company"]);
gnivr+=this.KrRRi("form_fiscal_code",AlsXS["fiscal_code"]);
gnivr+=this.KrRRi("form_tva",AlsXS["tva"]);
gnivr+=this.KrRRi("form_phone",AlsXS["phone"]);
gnivr+=this.KrRRi("form_fax",AlsXS["fax"]);
gnivr+=this.KrRRi("CARD_TOTAL_PRICE",BVLEL.tpJBg());
gnivr+=this.KrRRi("CARD_CURRENCY",CONST_WA_GLOBAL_SETTINGS.currency_code);
gnivr+=this.KrRRi("CARD_LANG",Translator.m_lang);
gnivr+=this.KrRRi("LABEL_PROCESS_ORDER",Translator.tr("PRINT_FORM_PROCESS_ORDER"));
gnivr+=this.KrRRi("wa_promo_code",BVLEL.LfKNd.RBTSk);
gnivr+=this.KrRRi("email_buyer",rZvZu.vXpmC("email",WaBKw))
if(rZvZu.cmoDW=="custom")
{
gnivr+=this.KrRRi("TYPE_PAYMENT",Translator.tr("PRINT_FORM_TYPE_CUSTOM"))
}
if(rZvZu.cmoDW=="check")
{
gnivr+=this.KrRRi("TYPE_PAYMENT",Translator.tr("PRINT_FORM_TYPE_CHECK"))
gnivr+=this.KrRRi("MESSAGE_CHECK",Translator.tr("PRINT_FORM_MESSAGE_CHECK"))
}
if(rZvZu.cmoDW=="wire")
{
gnivr+=this.KrRRi("TYPE_PAYMENT",Translator.tr("PRINT_FORM_TYPE_WIRE"))
gnivr+=this.KrRRi("MESSAGE_WIRE",Translator.tr("PRINT_FORM_MESSAGE_WIRE"))
}
if(rZvZu.cmoDW=="paypal")
{
gnivr+=this.KrRRi("LABEL_PAYPAL_CART_TITLE",Translator.tr("PRINT_FORM_PAYPAL_CART_TITLE"));
gnivr+=this.KrRRi("TYPE_PAYMENT","Paypal")
gnivr+=this.KrRRi("MESSAGE_PAYPAL",Translator.tr("PRINT_FORM_MESSAGE_PAYPAL"))
}
gnivr+=this.KrRRi("LABEL_PRINT",Translator.tr("PRINT_FORM_LABEL_PRINT"))
gnivr+=this.KrRRi("card_html",this.ZWaNg())
gnivr+=this.KrRRi("card_plain_text",this.PbYCC())
gnivr+=this.KrRRi("LABEL_SELLER_INFORMATION",Translator.tr("Seller information"))
gnivr+=this.KrRRi("LABEL_BANK_ACCOUNT",Translator.tr("Bank account information"))
gnivr+=this.KrRRi("LABEL_ADDRESS",Translator.tr("Address"))
gnivr+=this.KrRRi("seller_address",CONST_WA_GLOBAL_SETTINGS.seller_address)
gnivr+=this.KrRRi("bank_account_informations",CONST_WA_GLOBAL_SETTINGS.bank_account_informations)
gnivr+=this.KrRRi("buyer_info_shipping",this.TFfad())
var fWXpS=""
if(rZvZu.tpQSs)
{
fWXpS=this.jDXpb();
};
gnivr+=this.KrRRi("buyer_info_billing",fWXpS)
gnivr+="</form>"
return gnivr;
}
xjgMY.hllrc=function()
{
var BVLEL=qVMCO();
BVLEL.ZUsLG()
this.closeWin()
}
xjgMY.lkeio=function()
{
var BVLEL=qVMCO();
var TdfDL=true;
var rZvZu=BVLEL.LfKNd 
if(rZvZu.cmoDW=="paypal")
if((BVLEL.NJvpI==true)&&(CONST_WA_GLOBAL_SETTINGS.list_promo_codes==false))
{
TdfDL=true;
}
if((TdfDL==false)&&(rZvZu.cmoDW=="paypal"))
{
this.addButton(Translator.tr('Clear cart'),this.hllrc,[""],this)
this.initializeWindow(400,200)
}
else
{
this.initializeWindow(400,150)
}
var gnivr=""
if((TdfDL==false)&&(rZvZu.cmoDW=="paypal"))
{
gnivr+=this.wLKom()
}
if(TdfDL)
{
gnivr+=this.TUlRX()
if((Wcejx==false)&&(document.webaca_is_preview))
{
WA_Dialog.alert(Translator.tr("Operation not allowed in preview mode"))
return
}
}
gnivr+="<table border=0 style='width:100%;'><tr>";
gnivr+="<td align=center style='"+this.cssText1()+"'>"
gnivr+=Translator.tr("You have been redirected to the payment page")
if((TdfDL==false)&&(rZvZu.cmoDW=="paypal"))
{
gnivr+="<br><br>"
gnivr+=Translator.tr("You can clear your cart")
}
gnivr+="</td></tr></table>"
this.writeContent(gnivr) 
if(CDGmd.charCodeAt(3)>=100)
{
WA_Dialog.alert(Translator.tr("This cariboost edition can't support ebusiness features !'"))
return;
}
var fcgHa=document.getElementById("wa-http-sender")
fcgHa.submit()
if(TdfDL)
{
BVLEL.ZUsLG()
}
}
xjgMY.lkeio()
}

-->
