<!--

var HebxE=0
var HDlUH=1
var cLrEJ=2
var apZof=0;
var gicvm=1;
var fcaKH=2;
var Ubcmd=0
var gLHxD=1
var FjmNA=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(qMUUn)
{
nxZVW().FFfUp(qMUUn)
var BrNhm=WA_Dialog.getCurrent();
BrNhm.AtvPK()
}
function nxZVW()
{
if(document.wa_global_settings_market==undefined)document.wa_global_settings_market=new GQBhS()
return document.wa_global_settings_market;
}
function OuwSn()
{
this.OfqYJ=function()
{
return this.Nesws+"-"+this.GPvHN_index
}
this.AsGQE=function(umXgq,csoKX)
{
this.GPvHN=umXgq.obj.market.info.folder.substring(13);
this.GPvHN_index=umXgq.obj.index;
this.GPvHN_modif=umXgq.obj.market.info.critical_id_modif
this.Nesws=umXgq.obj.market.id
this.uEeCR=1;
this.cbMNX=umXgq.title;
this.suXPP=umXgq.price;
this.bGmOq=umXgq.weight;
this.vEERL=umXgq.code_product;
}
this.IVwIT=function(umXgq,csoKX)
{
this.cbMNX=umXgq.title;
this.suXPP=umXgq.price;
this.bGmOq=umXgq.weight;
this.vEERL=umXgq.code_product;
}
this.XYlLh=function()
{
var s="";
s+=this.OfqYJ();
if(this.m_opt_vals)
for(var i=0;i<this.m_opt_vals.length;i++)
{
var jiMFF=this.m_opt_vals[i]
if(jiMFF!=-1) s+="/"+jiMFF;
}
return s;
}
this.pwnNW=function()
{
var val="";
val+="j="+this.GPvHN+",";
val+="i="+this.GPvHN_index+",";
val+="m="+this.GPvHN_modif+",";
val+="q="+this.uEeCR+",";
if(this.m_opt_vals)
{
for(var i=0;i<this.m_opt_vals.length;i++)
{
val+="o"+i+"=";
var KhGPf=this.m_opt_vals[i]
if(KhGPf>-1)
val+=KhGPf
else
val+=""
val+=","
}
}
return val;
}
this.glqRf=function(map,k)
{
var v=map[k];
if(v=="undefined") return "";
return v;
}
this.nvBCw=function(map)
{
this.GPvHN=this.glqRf(map,"j");
if(this.GPvHN=="") return false;
this.GPvHN_index=this.glqRf(map,"i");
this.GPvHN_modif=this.glqRf(map,"m");
this.uEeCR=parseInt(map["q"]);
this.m_opt_vals=new Array();
for(var i=0;i<3;i++)
{
var iprcX=parseInt(map["o"+i]);
if(isNaN(iprcX))iprcX=-1;
this.m_opt_vals.push(iprcX)
}
return true;
}
this.fwIRG=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.AZcNp=function(QuixJ)
{
var ERVXD=this.fwIRG(QuixJ)
return this.nvBCw(ERVXD)
}
this.SvBHh=function()
{
return Hemvi(this.umXgq,this.m_opt_vals)
}
}
function KPXSs(rpajD,ECTas)
{
var GvaSb=rpajD[0]
var ukQer=rpajD[1]
var PSIIl=rpajD[2]
if(GvaSb.length==0)
{
PSIIl.call(ukQer)
return;
}
var js=GvaSb.pop()
WA_loadScript(js.src,KPXSs,[GvaSb,ukQer,PSIIl]);
}
function WA_arrayContains(FTIdS,QuixJ)
{
for(var n=0;n<FTIdS.length;n++){if(FTIdS[n]==QuixJ)return true;}
return false;
}
function hDUAV(FTIdS)
{
var ERVXD=new Array()
for(var n=0;n<FTIdS.length;n++)
{
var Xuvap=FTIdS[n]
if(Xuvap=="address") ERVXD=ERVXD.concat(["address_1","address_2","city","zip"])
else ERVXD.push(Xuvap)
}
return ERVXD;
}
function NSjrX()
{
this.ltLoV=function()
{
if(this.aWCap.length==0)return CONST_WA_GLOBAL_SETTINGS.default_selected_country;
return this.aWCap;
}
this.xdieb=function()
{
this.tAxdF()
}
this.fwIRG=function(s)
{
var QOUUI=new Array();
var tab=s.split(",");
for(var i=0;i<tab.length;i++)
{
var tab3=tab[i].split("=");
if(tab3.length==2)QOUUI[tab3[0]]=tab3[1];
}
return QOUUI;
}
this.LQTtU=function(NaXFP)
{
if(NaXFP==undefined) return ""
return(NaXFP==Ubcmd)?"deliv-":"bill-"
}
this.muchP=function(lxpFX,NaXFP,PqegE)
{
if(!PqegE)PqegE=""
var UMRvA=this.LQTtU(NaXFP)
if(lxpFX=="country")
{
if(NaXFP==Ubcmd) return this.aWCap
if(NaXFP==gLHxD) lxpFX="countryCode"
}
if(lxpFX=="state")
{
lxpFX="stateCode"
}
var jiMFF=this.koBAt[UMRvA+lxpFX]
if(!jiMFF) return PqegE
jiMFF=jiMFF.replace(/\"/g,"'")
return jiMFF
}
this.VlaFZ=function(jiMFF)
{
if(jiMFF==undefined)return ""
return jiMFF
}
this.cVVOV=function(key,val)
{
if((val==null)||(val==undefined)) val="";
WA_SetCookie("crbst-card-"+key,val)
}
this.TLDfs=function(key)
{
var ukQer=WA_GetCookie("crbst-card-"+key)
if(ukQer=="null")ukQer="";
return ""+ukQer
}
this.gBtxW=function()
{
this.koBAt=new Array()
var QuixJ=this.TLDfs("order-infos")
var ERVXD=this.fwIRG(QuixJ)
for(var k1 in ERVXD)
{
var jiMFF=ERVXD[k1]
if((k1.indexOf("deliv-")==0)||(k1.indexOf("bill-")==0))
this.koBAt[k1]=unescape(jiMFF)
}
this.aWCap=this.VlaFZ(ERVXD["countryCode"])
this.YsXLB=this.VlaFZ(ERVXD["typePayment"])
this.oqPXe=(this.VlaFZ(ERVXD["differentBillingAddressChecked"])=="true")
this.KWIbq=(this.VlaFZ(ERVXD["salesConditionChecked"])=="true")
}
this.tAxdF=function()
{
var QuixJ=""
for(var k1 in this.koBAt)
{
var jiMFF=this.koBAt[k1]
QuixJ+=k1+"="+escape(jiMFF)+","
}
var JFRdr=""
JFRdr+="countryCode="+escape(this.aWCap)+","
JFRdr+="typePayment="+escape(this.YsXLB)+","
JFRdr+="differentBillingAddressChecked="+(this.oqPXe)+","
JFRdr+="salesConditionChecked="+(this.KWIbq)+","
QuixJ+=JFRdr
this.cVVOV("order-infos",QuixJ)
}
this.tQJsn=function(pedhN)
{
if(trimString(pedhN.value).length==0)
{
pedhN.style.backgroundColor="#ff0000"
pedhN.focus()
return false;;
}
pedhN.style.backgroundColor=""
return true;
}
this.kLrLj=function(NaXFP)
{
var tKtSU=hDUAV(CONST_WA_GLOBAL_SETTINGS.list_form_fields)
var RcEqq=hDUAV(CONST_WA_GLOBAL_SETTINGS.list_mandatory_form_fields)
var LGlSK=this.koBAt;
var UMRvA=this.LQTtU(NaXFP)
var mDSBg=document.getElementById("wa-market-form")
for(var n=0;n<tKtSU.length;n++)
{
var DPGZT=tKtSU[n]
var fhNpl=mDSBg[DPGZT]
var jiMFF=trimString(fhNpl.value)
if(DPGZT!="address_2")
if(WA_arrayContains(RcEqq,DPGZT))
{
if(this.tQJsn(fhNpl)==false)return false;
}
LGlSK[UMRvA+DPGZT]=jiMFF
}
var PEhNK=document.getElementById("wa-select-state");
var aFrak=document.getElementById("wa-market-state");
if(PEhNK&&(aFrak.style.display!="none"))
{
if(this.tQJsn(PEhNK)==false)return false;
LGlSK[UMRvA+"stateCode"]=PEhNK.value
}
else
{
LGlSK[UMRvA+"stateCode"]=""
}
if(NaXFP==gLHxD)
{
var VOOCt=document.getElementById("wa-select-form-country");
if(VOOCt)
{
LGlSK[UMRvA+"countryCode"]=VOOCt.value
}
}
this.tAxdF()
return true;
}
this.GHZJG=""
this.aWCap=""
this.YsXLB=""
this.oqPXe=false;
this.KWIbq=false
this.gBtxW()
}
function GQBhS()
{
this.DhxaW=new Array();
this.ukQer_callback=false;
this.kguDx=false;
this.sjaBi=false;
this.QbIQM=new NSjrX()
this.soYCt=CONST_WA_GLOBAL_SETTINGS.use_native_paypal_cart;
this.XlgJB=function(ukQer,PSIIl)
{
this.ukQer_callback=ukQer
this.kguDx=PSIIl
var bKivX=this.TLDfs("data")
this.XXfQN(bKivX)
var GvaSb=new Array()
var FTIdS=this.DhxaW;
for(var i=0;i<FTIdS.length;i++)
{
var CQqhV=FTIdS[i];
var ocfZb=Translator.m_lang_for_filename
if(ocfZb.length>0)ocfZb="_"+ocfZb;
var oHUdu=CQqhV.GPvHN;
var n=oHUdu.indexOf("_")
if(n>-1)oHUdu=oHUdu.substring(n+1)
CQqhV.Nesws="wa-id-"+oHUdu
var ejVnW=wa_global_market.markets[CQqhV.Nesws]
if(this.sjaBi==false)
if(!ejVnW)
{
var BCKOp="crbst_market_"+CQqhV.GPvHN+'/'
WA_declareMarket(CQqhV.Nesws,BCKOp,CQqhV.GPvHN_modif)
var rIHUn=BCKOp+'market-definition'+ocfZb+'.js?v='+CQqhV.GPvHN_modif
GvaSb.push({id:oHUdu,src:rIHUn})
}
}
KPXSs([GvaSb,this,this.KFaCs],true)
}
this.sAmgB=function()
{
this.cVVOV("data","")
this.QbIQM.cVVOV("order-infos","")
this.QbIQM.gBtxW()
this.XXfQN("")
}
this.KFaCs=function()
{
this.sjaBi=true;
var FTIdS=this.DhxaW;
var DgRUf=new Array();
for(var i=0;i<FTIdS.length;i++)
{
var CQqhV=FTIdS[i];
var oHUdu=CQqhV.Nesws
var KKWTe=wa_global_market.markets[oHUdu]
if(KKWTe.info)
{
var MvFpL=KKWTe.info.products
var csoKX=CQqhV.GPvHN_index
var umXgq=MvFpL[csoKX]
CQqhV.umXgq=umXgq
CQqhV.IVwIT(CQqhV.umXgq,csoKX)
if((umXgq.unavail==false)&&(CQqhV.GPvHN_modif==KKWTe.info.critical_id_modif))
{
DgRUf.push(CQqhV)
}
}
else
{
}
}
this.DhxaW=DgRUf
this.Bmatu()
this.kguDx.call(this.ukQer_callback)
}
this.XXfQN=function(jqJjf)
{
var FTIdS=new Array();
var list_string_products=jqJjf.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 CQqhV=new OuwSn();
if(CQqhV.AZcNp(s_data))
{
FTIdS.push(CQqhV);
}
}
}
this.DhxaW=FTIdS;
var swMBP=this.Ggoji()
if(WA_getNumberMarketItemsInCart()!=swMBP)
{
this.GvJKt()
this.jNmbV()
}
}
this.fkTRK=function()
{
var NABTn=''
try{NABTn=CONST_WA_GLOBAL_SETTINGS.currency_mnemonic}catch(e){}
return NABTn
}
this.FFfUp=function(qMUUn)
{
var list2=new Array();
var FTIdS=this.DhxaW
for(var i=0;i<FTIdS.length;i++)
{
var CQqhV=FTIdS[i];
if(i!=qMUUn)
{
list2.push(CQqhV);
}
}
this.DhxaW=list2;
this.Bmatu()
}
this.addProductToShoppingCard=function(umXgq,optionsValues)
{
if(this.OYrjV()==false)
{
WA_Dialog.alert(Translator.tr("You can't use shopping card Your browser doesnt accept cookies !"));
return false;
}
var VHxEw=umXgq.obj
var FTIdS=this.xljCX();
var n=FTIdS.length
var oWMiI=new OuwSn()
oWMiI.AsGQE(umXgq,n);
oWMiI.m_opt_vals=optionsValues
var b_match=false;
for(var i=0;i<FTIdS.length;i++)
{
var CQqhV=FTIdS[i];
if(CQqhV.XYlLh()==oWMiI.XYlLh())
{
b_match=true;
CQqhV.uEeCR++;
}
}
if(b_match==false)
{
var bKivX=this.TLDfs("data")
var WBHCU=oWMiI.pwnNW()
var bveBr=bKivX.length+WBHCU.length
if(bveBr>4000)
{
WA_Dialog.alert(Translator.tr("Cookies cart contains max data !"));
return false;
}
FTIdS.push(oWMiI);
}
return true
}
this.MMfsd=function()
{
var FTIdS=this.DhxaW
var bKivX="";
for(var i=0;i<FTIdS.length;i++)
{
var info=FTIdS[i];
bKivX+=info.pwnNW()+";";
}
return bKivX;
}
this.Ggoji=function()
{
var Nrnof=0;
var FTIdS=this.DhxaW;
for(var i=0;i<FTIdS.length;i++)
{
var CQqhV=FTIdS[i];
Nrnof+=CQqhV.uEeCR
}
return Nrnof;
}
this.GvJKt=function()
{
this.cVVOV("nb_items",this.Ggoji())
}
this.Bmatu=function()
{
var FTIdS=this.DhxaW
var bKivX=this.MMfsd()
this.cVVOV("data",bKivX)
this.GvJKt()
this.jNmbV();
}
this.jNmbV=function()
{
WA_refreshNumberMarketItemsInCart()
}
this.xljCX=function()
{
return this.DhxaW;
}
this.OYrjV=function()
{
this.cVVOV("watestcookies","test")
return(this.TLDfs("watestcookies")=="test");
}
this.cVVOV=function(key,val)
{
if((val==null)||(val==undefined)) val="";
WA_SetCookie("crbst-card-"+key,val)
}
this.TLDfs=function(key)
{
var ukQer=WA_GetCookie("crbst-card-"+key)
if(ukQer=="null")ukQer="";
return ""+ukQer
}
this.kGRQR=function(v)
{
v=this.MMRfF(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.HAGIa=function(v)
{
var result=this.kGRQR(v);
if(CONST_WA_GLOBAL_SETTINGS.currency_code=="GBP")
{
result=this.fkTRK()+result;
}
else
{
result=result+" "+this.fkTRK();
}
return result;
}
this.VJSIH=function(v)
{
return this.kGRQR(v)+" "+CONST_WA_GLOBAL_SETTINGS.currency_code;
}
this.MMRfF=function(PFnBS)
{
return Math.round(PFnBS*100)/100
}
this.rneIa=function()
{
var FTIdS=this.xljCX()
var price=0;
for(var i=0;i<FTIdS.length;i++)
{
var CQqhV=FTIdS[i];
price+=(CQqhV.SvBHh()*CQqhV.uEeCR);
}
return price;
}
this.LlQYo=function()
{
var PFnBS=this.rneIa()
var SHbvi=0;
var FTIdS=CONST_WA_GLOBAL_SETTINGS.list_promo_codes
for(var i=0;i<FTIdS.length;i++)
{
var IPhDx=FTIdS[i];
if(MD5(trimString(this.QbIQM.GHZJG.toUpperCase()))==IPhDx.c)
{
SHbvi=IPhDx.v/100;
break;
}
}
return PFnBS*SHbvi;
}
this.computeShippingForValue=function(val)
{
var mtoHK=CONST_WA_GLOBAL_SETTINGS.shipping_type
if(mtoHK==HebxE)return 0;
var ship_val=0;
var XXwbm=CONST_WA_GLOBAL_SETTINGS.shipping_intervals
for(var i=0;i<XXwbm.length;i++)
{
var WErXd=XXwbm[i];
if(WErXd.v<val)ship_val=WErXd.p
}
return ship_val;
}
this.lRWhI=function(SQaLD)
{
var ERVXD=CONST_WA_GLOBAL_SETTINGS.QOUUI_list_extra_shipping_by_country_code
if(ERVXD==undefined)
{
ERVXD=new Array()
CONST_WA_GLOBAL_SETTINGS.QOUUI_list_extra_shipping_by_country_code=ERVXD;
var VJJdi=CONST_WA_GLOBAL_SETTINGS.list_extra_shipping_by_country_code
for(var qMUUn in VJJdi)
{
var MLEHh=VJJdi[qMUUn];
var JWdwS=MLEHh.c
for(var cPoHb in JWdwS)
{
var KOsvb=JWdwS[cPoHb];ERVXD[KOsvb]=MLEHh.p;
}
}
}
return ERVXD[SQaLD];
}
this.XhfLf=function(SQaLD)
{
var ERVXD=CONST_WA_GLOBAL_SETTINGS.QOUUI_list_tva_by_country_code
if(ERVXD==undefined)
{
ERVXD=new Array()
CONST_WA_GLOBAL_SETTINGS.QOUUI_list_tva_by_country_code=ERVXD;
var VJJdi=CONST_WA_GLOBAL_SETTINGS.list_tva_by_country_code
for(var qMUUn in VJJdi)
{
var MLEHh=VJJdi[qMUUn];
var JWdwS=MLEHh.c;
for(var cPoHb in JWdwS)
{
var KOsvb=JWdwS[cPoHb];ERVXD[KOsvb]=MLEHh.p;
}
}
}
return ERVXD[SQaLD];
}
this.RqsTi=function()
{
var mtoHK=CONST_WA_GLOBAL_SETTINGS.shipping_type
var FTIdS=this.xljCX()
var global_ref_for_shipping=0;
var dPHiM=0;
var aWCap=this.QbIQM.aWCap;
if(aWCap.length>0)
{
dPHiM=this.lRWhI(aWCap);
if(isNaN(dPHiM)) dPHiM=0;
}
for(var i=0;i<FTIdS.length;i++)
{
var CQqhV=FTIdS[i];
if(mtoHK==HDlUH)
{
global_ref_for_shipping+=(CQqhV.uEeCR*CQqhV.SvBHh());
}
if(mtoHK==cLrEJ)
{
global_ref_for_shipping+=(CQqhV.uEeCR*CQqhV.bGmOq);
}
}
return dPHiM+this.MMRfF(this.computeShippingForValue(global_ref_for_shipping));
}
this.XwxWG=function()
{
return CONST_WA_GLOBAL_SETTINGS.tva_type==gicvm
}
this.xkNJs=function()
{
return CONST_WA_GLOBAL_SETTINGS.tva_type==fcaKH
}
this.LUrSV=function()
{
return CONST_WA_GLOBAL_SETTINGS.tva_type==apZof
}
this.FnVAb=function()
{
if(this.LUrSV())return 0;
var tax=0;
var country_code=this.QbIQM.aWCap;
if(country_code.length>0)
{
tax=this.XhfLf(country_code);
if(isNaN(tax))tax=0;
}
return tax;
}
this.kCUku=function(PFnBS)
{
if(this.XwxWG())
{
var n0=this.FnVAb()/100;
return PFnBS*(n0/(1+n0));
}
if(this.xkNJs())
{
return PFnBS*this.FnVAb()/100;
}
return PFnBS;
}
this.UmLJr=function()
{
if(this.LUrSV())return 0;
var FTIdS=this.xljCX()
var ZgcSv=0;
var Qpncd=0;
for(var i=0;i<FTIdS.length;i++)
{
var CQqhV=FTIdS[i];
ZgcSv+=(CQqhV.SvBHh()*CQqhV.uEeCR);
}
ZgcSv+=this.RqsTi();
Qpncd=this.MMRfF(this.kCUku(ZgcSv));
return Qpncd;
}
this.piumP=function()
{
var PFnBS=0;
PFnBS+=this.rneIa()
if(this.xkNJs())PFnBS+=this.UmLJr()
PFnBS+=this.RqsTi()
PFnBS-=this.LlQYo()
return PFnBS;
}
}
function sIYqT(FXipY,xtGAY)
{
if(FXipY.lab<xtGAY.lab) return-1;
if(FXipY.lab>xtGAY.lab) return 1;
return 0
}
function WA_marketWatchQuantity()
{
var BrNhm=WA_Dialog.getCurrent()
BrNhm.sfIqs()
}
function WA_displayDialogMarketCart()
{
var BrNhm=new WA_Dialog();
BrNhm.jecRV=false;
BrNhm.uSVQJ=function()
{
this.jQAFt()
this.jecRV=setInterval("WA_marketWatchQuantity()",400)
}
BrNhm.jQAFt=function()
{
if(this.jecRV)clearInterval(this.jecRV)
}
BrNhm.sfIqs=function()
{
var AXcKx=nxZVW();
var UPaYd=AXcKx.xljCX();
for(var n=0;n<UPaYd.length;n++)
{
var CQqhV=UPaYd[n]
var XQtQx=document.getElementById("wa-cart-quantity-"+n)
var QOqKa=XQtQx.value
var FhJGu=parseInt(QOqKa)
if(isNaN(FhJGu))FhJGu=0;
if((QOqKa!='')&&(FhJGu+""!=QOqKa))
{
XQtQx.value=""+FhJGu
}
if(FhJGu!=CQqhV.uEeCR)
{
CQqhV.uEeCR=FhJGu
AXcKx.Bmatu()
this.JEIml()
}
}
var LSuCQ=document.getElementById("wa-promo-code")
if(LSuCQ)
{
if(LSuCQ.value!=CQqhV.GHZJG)
{
AXcKx.QbIQM.GHZJG=LSuCQ.value
this.JEIml()
}
}
}
BrNhm.onCustomKeypress=function(DFjOf)
{
if(DFjOf==13)
{
wa_timeout(Delegate.create(this,this.hHguR),0);
}
return false;
}
BrNhm.closeWin=function()
{
this.jQAFt()
this.intern_closeWin()
}
BrNhm.JEIml=function()
{
var AXcKx=nxZVW();
var UPaYd=AXcKx.xljCX();
if(UPaYd.length==0) return;
for(var n=0;n<UPaYd.length;n++)
{
var CQqhV=UPaYd[n]
var iEfCx=document.getElementById("wa-cart-total-"+n)
var PFnBS=CQqhV.SvBHh()
var seVPr=CQqhV.uEeCR*PFnBS
var QuixJ="<span style='"
QuixJ+=(seVPr>0)?"color:"+WA_GLOBAL_COLOR_THEME.color_text+";font-weight:normal;":"color:#ff0000;font-weight:bold;"
QuixJ+="'>"
QuixJ+=AXcKx.HAGIa(seVPr)
QuixJ+="</span>"
iEfCx.innerHTML=QuixJ
}
var eddLA=AXcKx.rneIa()
var dfjgj=AXcKx.UmLJr()
var UUMHt=AXcKx.RqsTi()
var JnRTl=AXcKx.piumP()
var aQKXf=AXcKx.LlQYo()
var NgSAG=""
var iEfCx=document.getElementById("wa-cart-amount-total")
NgSAG+=Translator.tr("Sub total")+" : "+AXcKx.HAGIa(eddLA)
NgSAG+="<br>"
if(UUMHt>0)
{
NgSAG+="<span>"+Translator.tr("Shipping amount")+" : "+AXcKx.HAGIa(UUMHt)+"</span>";
NgSAG+="<br>"
}
if(AXcKx.XwxWG()||AXcKx.xkNJs())
{
if(AXcKx.XwxWG())
{
NgSAG+="<div style='width:100%;text-align:left;'>"
NgSAG+=Translator.tr("Tax included");
}
if(AXcKx.xkNJs())
{
NgSAG+="<div>"
NgSAG+=Translator.tr("Extra Tax");
}
NgSAG+=" : ";
NgSAG+=AXcKx.HAGIa(dfjgj)+"</div>";
}
if(aQKXf>0)
{
NgSAG+="<span>"+Translator.tr("Promotion")+" : - "+AXcKx.HAGIa(aQKXf)+"</span><br>";
}
NgSAG+="<span><b>"+Translator.tr("Total")+" : "+AXcKx.HAGIa(JnRTl)+"</b></span>";
iEfCx.innerHTML=NgSAG
}
BrNhm.qbUaC=function()
{
WA_displayDialogMarketCart()
}
BrNhm.IIBlU=function()
{
this.closeWin()
}
BrNhm.hHguR=function()
{
var AXcKx=nxZVW();
if(WA_getNumberMarketItemsInCart()==0)return;
var UcCAd=document.getElementById("wa-market-select-country")
AXcKx.QbIQM.aWCap=UcCAd.value
if(AXcKx.QbIQM.aWCap=="")
{
var UcCAd=document.getElementById("wa-market-select-country")
if(UcCAd)
{
UcCAd.focus()
UcCAd.style.backgroundColor="#ff0000"
return;
}
}
if(CONST_WA_GLOBAL_SETTINGS.link_sale_condition)
{
if(AXcKx.QbIQM.KWIbq!=true)
{
var NiWHu=document.getElementById("wa-sales-condition")
if(NiWHu)
{
NiWHu.focus()
var HmieJ=document.getElementById("wa-sales-condition-label")
HmieJ.style.backgroundColor="#ff0000"
return;
}
}
}
if(AXcKx.QbIQM.YsXLB=="")
{
var UcCAd=document.getElementById("wa-market-select-payment")
if(UcCAd)
{
}
UcCAd.focus()
UcCAd.style.backgroundColor="#ff0000"
return;
}
WgjhQ()
}
BrNhm.AtvPK=function()
{
WA_exec_callback_opera_compliant(this,this.vpAhd)
}
BrNhm.vpAhd=function()
{
var AXcKx=nxZVW();
var VOOCt=document.getElementById("wa-market-select-country")
AXcKx.QbIQM.aWCap=VOOCt.value
AXcKx.QbIQM.xdieb()
var ubNnV=html_getLayer("market-cart-content")
var GRmJB=html_getLayer("wa-market-payment-form")
var QuixJ=""
var UPaYd=AXcKx.xljCX();
html_SetVisibility(GRmJB,(UPaYd.length>0))
if(UPaYd.length==0)
{
QuixJ+="<span style='font-family:Arial;font-size:16px;'>"
QuixJ+=Translator.tr("No articles in Card !")
QuixJ+="</span>"
}
else
{
var LlJUv="border:1px solid "+WA_GLOBAL_COLOR_THEME.color0+";font-weight:normal;"
var xPXnE="border:1px solid "+WA_GLOBAL_COLOR_THEME.color0+";color:#ff0000;font-weight:bold;"
var NrfCN="color:#222222;font-size:12px;"
QuixJ+="<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+";'>"
QuixJ+="<thead style='font-size:13px;border:1px solid;'>"
QuixJ+="<tr>"
QuixJ+="<th  colspan=2 style='"+LlJUv+"'></th>"
QuixJ+="<th style='"+LlJUv+"'  width=70px><b>"+Translator.tr("Price")+"</b></th>"
QuixJ+="<th style='"+LlJUv+"'  width=70px><b>"+Translator.tr("Quantity")+"</b></th>"
QuixJ+="<th style='"+LlJUv+"'  width=70px><b>"+Translator.tr("Total")+"</b></th>"
QuixJ+="<th style='"+LlJUv+"'  width=90px></th>"
QuixJ+="</tr>"
for(var n=0;n<UPaYd.length;n++)
{
var CQqhV=UPaYd[n]
QuixJ+="<tr>"
QuixJ+="<th style='"+LlJUv+"' >"
var KKWTe=wa_global_market.markets[CQqhV.Nesws]
var CEUaA=new Size(30,30)
var PMBMU=CEUaA
if(KKWTe.info.design.crop_thumb==false)
{
PMBMU=CQqhV.umXgq.size_thumb.clone()
PMBMU.scale(CEUaA)
}
else
{
}
if(CQqhV.umXgq.img_thumb.length>0)
QuixJ+="<img border=0 src='"+CQqhV.umXgq.img_thumb+"' width="+PMBMU.width+"px height="+PMBMU.height+"px>"
QuixJ+="</th>"
QuixJ+="<th style='"+LlJUv+"text-align:left;padding:5px;background-color:"+WA_GLOBAL_COLOR_THEME.color1+";' >"
QuixJ+="<b>"+CQqhV.cbMNX+"</b>"
if(CQqhV.vEERL.length>0)
{
QuixJ+="<span style='"+NrfCN+"'>";
QuixJ+=" ["+CQqhV.vEERL+"]";
QuixJ+="</span>";
}
if(CQqhV.m_opt_vals)
{
QuixJ+="<br>"
QuixJ+="<span style='"+NrfCN+"'>";
for(var i_opt=0;i_opt<CQqhV.umXgq.options.length;i_opt++)
{
var dTUOg=CQqhV.umXgq.options[i_opt]
if(dTUOg)
{
var Sfoej=CQqhV.m_opt_vals[i_opt];
var vFSuZ=dTUOg.title;
if(vFSuZ.length>0)
{
QuixJ+=vFSuZ;
QuixJ+=":"
}
QuixJ+=dTUOg.vals[Sfoej];
QuixJ+=" "
}
}
QuixJ+="</span>";
}
QuixJ+="</th>"
var PFnBS=CQqhV.SvBHh()
QuixJ+="<th style='"+LlJUv+"' >"+AXcKx.HAGIa(PFnBS)+"</th>"
QuixJ+="<th style='"+LlJUv+"'  align=center><input type=text id='wa-cart-quantity-"+n+"' style='width:45px;' maxlength=3 value='"+CQqhV.uEeCR+"' type=text/></th>"
QuixJ+="<th style='"
var seVPr=CQqhV.uEeCR*PFnBS
QuixJ+=(seVPr>0)?LlJUv:xPXnE;
QuixJ+="' ><span id='wa-cart-total-"+n+"'>"
QuixJ+=AXcKx.HAGIa(seVPr)
QuixJ+="</span></th>"
QuixJ+="<th style='"+LlJUv+"' ><a href=\"javascript:WA_marketRemoveItem("+n+")\">"+Translator.tr("Remove card item")+"</a></th>"
QuixJ+="</tr>"
}
QuixJ+="<tr>"
QuixJ+="<th style='"+LlJUv+"text-align:right;padding:5px;' id='wa-cart-amount-total'  colspan=5>&nbsp;</th>"
QuixJ+="<th style='"+LlJUv+"' ></th>"
QuixJ+="</tr>"
QuixJ+="</thead>"
QuixJ+="</table>"
QuixJ+="<br>"
}
ubNnV.innerHTML=QuixJ
this.uSVQJ()
WA_exec_callback_opera_compliant(this,this.JEIml)
}
BrNhm.cLRxA=function()
{
var AXcKx=nxZVW();
this.addButton(Translator.tr("Continue Shopping"),this.IIBlU,[""],this)
this.addButton(Translator.tr("Checkout order"),this.hHguR,[""],this)
this.initializeWindow(670,700)
var EhfQB="font-family:Arial;font-size:12px;color:#000000;"
var QuixJ=""
QuixJ+="<div id='market-cart-content' style='width:100%;"+EhfQB+"' align=center>"
QuixJ+="</div>"
QuixJ+="<br>"
QuixJ+="<div style='width:100%;"+EhfQB+"' align=center id='wa-market-payment-form'>"
QuixJ+="<br>"
QuixJ+="<span style='font-weight:bold;'>"
QuixJ+=Translator.tr("Please choose a country to deliver your order")
QuixJ+="</span>"
QuixJ+="<br>"
QuixJ+="<select onchange=\"WA_marketChangeCountry(this)\" id='wa-market-select-country'>"
if(CONST_WA_GLOBAL_SETTINGS.default_selected_country.length==0)
{
QuixJ+="<option value=\"\">...</option>"
}
var pbttD=CONST_WA_GLOBAL_SETTINGS.list_favorite_country
var RKiYk=CONST_WA_GLOBAL_SETTINGS.list_country
var GLQdJ=new Array()
for(var uUXeF=0;uUXeF<pbttD.length;uUXeF++)
{
var ASkON=pbttD[uUXeF]
GLQdJ.push({code:ASkON,lab:Translator.country(ASkON)})
}
for(var uUXeF=0;uUXeF<GLQdJ.length;uUXeF++)
{
var ukQer=GLQdJ[uUXeF]
var ASkON=ukQer.code
QuixJ+="<option "
if(AXcKx.QbIQM.ltLoV()==ASkON)QuixJ+="selected "
QuixJ+="value=\""+ASkON+"\">"+Translator.country(ASkON)+"</option>"
}
if((pbttD.length>0)&&(RKiYk.length>0))
{
QuixJ+="<option value=\"\">-----</option>"
}
var AHFdt=new Array()
for(var uUXeF=0;uUXeF<RKiYk.length;uUXeF++)
{
var ASkON=RKiYk[uUXeF]
AHFdt.push({code:ASkON,lab:Translator.country(ASkON)})
}
if((pbttD.length==0)&&(RKiYk.length==0))
{
var FTIdS=CONST_WA_COUNTRIES.codes
for(var uUXeF=0;uUXeF<FTIdS.length;uUXeF++)
{
var ASkON=FTIdS[uUXeF]
AHFdt.push({code:ASkON,lab:Translator.country(ASkON)})
}
}
AHFdt.sort(sIYqT)
for(var uUXeF=0;uUXeF<AHFdt.length;uUXeF++)
{
var ukQer=AHFdt[uUXeF]
var ASkON=ukQer.code
QuixJ+="<option "
if(AXcKx.QbIQM.ltLoV()==ASkON)QuixJ+="selected "
QuixJ+="value=\""+ASkON+"\">"+Translator.country(ASkON)+"</option>"
}
QuixJ+="</select>"
QuixJ+="<br>"
QuixJ+="<br>"
if(CONST_WA_GLOBAL_SETTINGS.link_sale_condition)
{
QuixJ+="<a "+WA_LinkToHref(CONST_WA_GLOBAL_SETTINGS.link_sale_condition)+" style='color:#0000ff'>"
QuixJ+=Translator.tr("Terms of sell")
QuixJ+="</a>"
QuixJ+="<br>"
QuixJ+="<span id='wa-sales-condition-label'  style='font-weight:bold;'>"
QuixJ+=Translator.tr("label_market_accept_terms")
QuixJ+="</span>"
QuixJ+="<input id='wa-sales-condition' onchange=\"WA_marketChangeSalesCondition(this)\" "
QuixJ+=(AXcKx.QbIQM.KWIbq)?"checked ":""
QuixJ+="type='checkbox' value='1'/>"
QuixJ+="<br>"
QuixJ+="<br>"
}
QuixJ+="<span style='font-weight:bold;'>"
QuixJ+=Translator.tr("Choose a type of payment")
QuixJ+="</span>"
QuixJ+="<br>"
QuixJ+="<select onchange=\"WA_marketChangeTypePayment(this)\" id='wa-market-select-payment'>"
var xTmdp=CONST_WA_GLOBAL_SETTINGS.list_type_payment
if((xTmdp.length>1)||(xTmdp.length==0))
{
QuixJ+="<option value=\"\">...</option>"
}
for(var uUXeF=0;uUXeF<xTmdp.length;uUXeF++)
{
var YsXLB=xTmdp[uUXeF]
QuixJ+="<option "
if(AXcKx.QbIQM.YsXLB==YsXLB)QuixJ+="selected "
QuixJ+="value=\""+YsXLB+"\">"+Translator.tr("label_market_"+YsXLB)+"</option>"
}
QuixJ+="</select>"
if(CONST_WA_GLOBAL_SETTINGS.list_promo_codes)
{
var FTIdS=CONST_WA_GLOBAL_SETTINGS.list_promo_codes
QuixJ+="<br>"
QuixJ+="<br>"
QuixJ+="<span id='wa-promo-code-label'  style='font-weight:bold;'>"
QuixJ+=Translator.tr("form-label-code_promo")
QuixJ+="</span><br>"
QuixJ+="<input id='wa-promo-code' onchange=\"WA_marketChangePromoCode(this)\" "
QuixJ+=" value='"+AXcKx.QbIQM.GHZJG+"' "
QuixJ+="/>"
QuixJ+="<br>"
}
QuixJ+="</div>"
this.writeContent(QuixJ)
var ubNnV=html_getLayer("market-cart-content")
ubNnV.innerHTML="<div width=100% align=center><img src='wa_loading.gif'></div>"
AXcKx.XlgJB(this,this.AtvPK)
}
BrNhm.cLRxA()
}
function WA_marketChangeCountry(UcCAd)
{
UcCAd.style.backgroundColor=""
var BrNhm=WA_Dialog.getCurrent()
BrNhm.AtvPK()
}
function WA_marketChangeTypePayment(UcCAd)
{
var AXcKx=nxZVW();
AXcKx.QbIQM.YsXLB=UcCAd.value
AXcKx.QbIQM.xdieb()
UcCAd.style.backgroundColor=""
}
function WA_marketChangeSalesCondition(pedhN)
{
var AXcKx=nxZVW();
AXcKx.QbIQM.KWIbq=pedhN.checked
AXcKx.QbIQM.xdieb()
var HmieJ=document.getElementById("wa-sales-condition-label")
HmieJ.style.backgroundColor=""
}
function WA_marketChangePromoCode(pedhN)
{
var AXcKx=nxZVW();
AXcKx.QbIQM.GHZJG=pedhN.value
AXcKx.QbIQM.xdieb()
}
function WA_LinkToHref(nmVvF)
{
var QuixJ=""
var TvCrm=nmVvF.url
var Zjlvh=Translator.m_lang_for_filename
if(Zjlvh.length>0)Zjlvh="_"+Zjlvh
TvCrm=TvCrm.replace(/@lng@/g,Zjlvh)
QuixJ+="href=\""+TvCrm+"\" "
if(nmVvF.open==1)
{
QuixJ+="target="
QuixJ+="_blank"
}
return QuixJ;
}
function WA_displayDialogMarketProduct(oHUdu,qMUUn)
{
var ejVnW=wa_global_market.markets[oHUdu]
var uSNVN=ejVnW.obj
var MvFpL=uSNVN.info.products
var umXgq=MvFpL[qMUUn]
var BrNhm=new WA_Dialog();
BrNhm.umXgq=umXgq
BrNhm.XnHpQ=oHUdu
BrNhm.qbUaC=function()
{
WA_displayDialogMarketCart()
}
BrNhm.crteG=function()
{
var AXcKx=nxZVW();
AXcKx.XlgJB(this,this.OVaua)
}
BrNhm.OVaua=function()
{
var umXgq=this.umXgq;
var AXcKx=nxZVW();
var FtlBB=new Array();
var UThpd=umXgq.obj.id;
for(var i=0;i<3;i++)
{
var hiZSU=-1;
var UMRvA=UThpd+"-select-opt"
var UcCAd=document.getElementById(UMRvA+i)
if(UcCAd)
{
if(UcCAd.value.length==0)
{
UcCAd.style.backgroundColor="#ff0000";
UcCAd.focus()
return;
}
hiZSU=parseInt(UcCAd.value)
}
FtlBB.push(hiZSU)
}
if(AXcKx.addProductToShoppingCard(umXgq,FtlBB))
{
AXcKx.Bmatu()
WA_displayDialogMarketCart()
}
}
BrNhm.cLRxA=function()
{
var oHUdu=this.XnHpQ
var umXgq=this.umXgq
var QuixJ=""
this.addButton(Translator.tr("Go to my card"),this.qbUaC,[""],this)
if(umXgq.unavail==false)
{
this.addButton(Translator.tr("Add to card"),this.crteG,[""],this)
}
this.initializeWindow(670,this.idealHeight())
QuixJ+="<table border=0 width=100% cellpadding=4>"
QuixJ+="<tr>"
if(umXgq.img_big.length>0)
{
QuixJ+="<td width='100px' align=center valign=top>"
var PMBMU=umXgq.size_thumb.clone()
PMBMU.scale(new Size(200,200))
QuixJ+="<a href=\""+umXgq.img_big+"\" target=_blank>"
QuixJ+="<img border=0 src=\""+umXgq.img_big+"\" width='"+PMBMU.width+"px' height='"+PMBMU.height+"px'>"
QuixJ+="</a>"
QuixJ+="</td>"
}
var PSihl="color:"+WA_GLOBAL_COLOR_THEME.color_text+";";
QuixJ+="<td valign=top style='font-family:Arial;'>"
QuixJ+="<span style='font-weight:bold;font-size:16px;"+PSihl+"'>"
QuixJ+=umXgq.title
QuixJ+="</span>"
QuixJ+="<br>"
if(umXgq.sub_title.length>0)
{
QuixJ+="<span style='color:#333333;font-size:14px;'>"
QuixJ+=umXgq.sub_title
QuixJ+="</span>"
QuixJ+="<br>"
}
QuixJ+="<br>"
QuixJ+="<table border=0 width=100% cellspacing=0 cellpadding=0><tr><td>"
QuixJ+="<span style='"+PSihl+";font-size:14px;'>"
QuixJ+=Translator.tr("Price")+" : "
QuixJ+="</span>"
QuixJ+="<span style='"+PSihl+";font-size:18px;font-weight:bold;' id='"+umXgq.obj.id+"-price'>"
if(umXgq.unavail)
{
QuixJ+=Translator.tr("Unavailable")
}
QuixJ+="</span>"
if(umXgq.more_info)
{
QuixJ+="</td><td align=right>"
var nmVvF=umXgq.more_info
var ITFJp=WA_LinkToHref(nmVvF)
QuixJ+="<a "+ITFJp+" style='font-family:Arial;text-decoration:underline;font-weight:bold;font-size:12px;color:0000ff;'>"+Translator.tr("More product info link")+"</a>"
}
QuixJ+="</td></tr></table>"
QuixJ+="<br>"
var RIeFG=umXgq.obj.index
if(umXgq.unavail==false)
if(umXgq.options.length>0)
{
QuixJ+="<table border=0 cellspacing=0 cellpadding=0>"
for(var n=0;n<umXgq.options.length;n++)
{
var dTUOg=umXgq.options[n]
if(dTUOg)
{
QuixJ+="<tr><td align=right>"
QuixJ+="<span style='font-family:Arial;font-weight:bold;font-size:12px;"+PSihl+"'>"
QuixJ+=dTUOg.title+" :&nbsp;"
QuixJ+="</span>"
QuixJ+="</td><td align=left>"
QuixJ+="<select id='"+umXgq.obj.id+"-select-opt"+n+"' onchange=\"WA_market_changeCustomPrice('"+oHUdu+"',"+RIeFG+")\">"
QuixJ+="<option value=\"\">...</option>"
for(var uUXeF=0;uUXeF<dTUOg.vals.length;uUXeF++)
{
var jiMFF=dTUOg.vals[uUXeF]
QuixJ+="<option value=\""+uUXeF+"\">"+jiMFF+"</option>"
}
QuixJ+="</select>"
QuixJ+="</td></tr>";
}
}
QuixJ+="</table>"
}
QuixJ+="</td>"
QuixJ+="</tr>"
QuixJ+="</table>"
if(umXgq.description.length>0)
{
QuixJ+="<table border=0 width=100% cellpadding=4>"
QuixJ+="<tr><td colspan=2>"
QuixJ+="<span style='font-family:Arial;font-size:13px;"+PSihl+"'>"
QuixJ+="<hr>"
QuixJ+=umXgq.description
QuixJ+="</span>"
QuixJ+="</td></tr>"
QuixJ+="</table>"
}
this.writeContent(QuixJ)
WA_market_changeCustomPrice(oHUdu,RIeFG)
}
BrNhm.displayWindowWithAutoResize(300,BrNhm.cLRxA)
}
function iCXmN(umXgq,UThpd)
{
var fgtBl=new Array()
for(var i=0;i<3;i++)
{
var UMRvA=UThpd+"-select-opt"
var UcCAd=document.getElementById(UMRvA+i)
fgtBl[i]=-1
if(UcCAd)
{
UcCAd.style.backgroundColor="";
var jiMFF=parseInt(UcCAd.value)
if(isNaN(jiMFF)==false)
fgtBl[i]=jiMFF
}
}
return Hemvi(umXgq,fgtBl)
}
function Hemvi(umXgq,fgtBl)
{
if(umXgq.unavail)return;
var SJRlJ=false;
for(var i=0;i<umXgq.custom_prices.length;i++)
{
var OYMip=umXgq.custom_prices[i]
var LnNxV=true;
for(var n=0;n<3;n++)
{
if(OYMip.tab[n]!=fgtBl[n])LnNxV=false
}
if(LnNxV)
{
SJRlJ=OYMip;
break;
}
}
var PFnBS=umXgq.price
if(SJRlJ)
{
PFnBS=SJRlJ.pr
}
return PFnBS;
}
function WA_market_changeCustomPrice(oHUdu,RIeFG)
{
var AXcKx=nxZVW();
var ejVnW=wa_global_market.markets[oHUdu]
var MvFpL=ejVnW.info.products;
var umXgq=MvFpL[RIeFG]
if(umXgq.unavail)return;
var UThpd=umXgq.obj.id
var PFnBS=iCXmN(umXgq,UThpd)
var dHZbn=html_getLayer(UThpd+"-price")
if(dHZbn)
{
dHZbn.innerHTML=AXcKx.HAGIa(PFnBS)
}
}
function WgjhQ()
{
var AXcKx=nxZVW();
if(WA_getNumberMarketItemsInCart()==0)return;
var CQqhV=AXcKx.QbIQM
if((AXcKx.soYCt)&&(CQqhV.YsXLB=="paypal"))
{
EBnld();
return;
}
HhKUN(Ubcmd)
}
function HhKUN(NaXFP)
{
var AXcKx=nxZVW();
var CQqhV=AXcKx.QbIQM
CQqhV.gBtxW()
var BrNhm=new WA_Dialog();
BrNhm.NaXFP=NaXFP
BrNhm.sCwGV=function(DFjOf)
{
return Translator.tr("form-label-"+DFjOf)
}
BrNhm.onCustomKeypress=function(DFjOf)
{
if(DFjOf==13)
{
wa_timeout(Delegate.create(this,this.aQlSF),0);
}
return false;
}
BrNhm.LUMla=function()
{
if(this.NaXFP==Ubcmd)
{
WA_displayDialogMarketCart()
}
else
{
HhKUN(Ubcmd)
}
}
BrNhm.WPJQd=function()
{
EBnld()
}
BrNhm.aQlSF=function()
{
var AXcKx=nxZVW();
var CQqhV=AXcKx.QbIQM
if(CQqhV.kLrLj(this.NaXFP)==false) return;
CQqhV.xdieb()
if(this.NaXFP==Ubcmd)
{
if(CQqhV.oqPXe==true)
{
HhKUN(gLHxD)
}
else
{
this.WPJQd()
}
}
else
{
this.WPJQd()
}
}
BrNhm.Gfqgs=function(DFjOf,ANusr)
{
if(ANusr==undefined) ANusr=""
if(ANusr)ANusr=" size="+ANusr
return "<input name='"+DFjOf+"' value=\""+CQqhV.muchP(DFjOf,this.NaXFP)+"\" type=text "+ANusr+">"
}
BrNhm.ugVBG=function(SXmPS)
{
return "<td width=150px align=right valign=top>"+Translator.tr(SXmPS)+" :</td>"
}
BrNhm.cLRxA=function()
{
var AXcKx=nxZVW();
var CQqhV=AXcKx.QbIQM
this.addButton("< "+Translator.tr('Back'),this.LUMla,[""],this)
this.addButton(Translator.tr('Continue')+" >",this.aQlSF,[""],this)
this.initializeWindow(600,600)
var eVejx="form-label-"
var tKtSU=CONST_WA_GLOBAL_SETTINGS.list_form_fields
var QuixJ=""
QuixJ+="<form id='wa-market-form' onSubmit='return false'>"
QuixJ+="<table border=0 width=100% cellspacing=5 style='font-family:Arial;font-size:15px;'>"
QuixJ+="<tr><td colspan=2 align=center style='font-size:18px;'>"
QuixJ+=Translator.tr((this.NaXFP==Ubcmd)?"Fill Deliver information below":"Fill Billing information below")
QuixJ+="<br><br></td></tr>"
for(var n=0;n<tKtSU.length;n++)
{
var fhNpl=tKtSU[n]
if(fhNpl=="address")
{
QuixJ+="<tr>"+this.ugVBG("Address");
QuixJ+="<td>"
QuixJ+=this.Gfqgs("address_1",30)
QuixJ+="</td></tr>"
QuixJ+="<tr><td></td><td>"
QuixJ+=this.Gfqgs("address_2",30)
QuixJ+="</td></tr>"
QuixJ+="<tr>"+this.ugVBG("form-label-city");
QuixJ+="<td>"
QuixJ+=this.Gfqgs("city")+"&nbsp;"+this.sCwGV("zip")+" : "+this.Gfqgs("zip",10)
QuixJ+="</td></tr>"
QuixJ+="<tr>"+this.ugVBG("form-label-country");
QuixJ+="<td>"
if(this.NaXFP==gLHxD)
{
QuixJ+="<select id='wa-select-form-country' onchange='WA_marketChangeFormCountry("+this.NaXFP+")'>"
var AHFdt=new Array();
var FTIdS=CONST_WA_COUNTRIES.codes
for(var uUXeF=0;uUXeF<FTIdS.length;uUXeF++)
{
var ASkON=FTIdS[uUXeF]
AHFdt.push({code:ASkON,lab:Translator.country(ASkON)})
}
AHFdt.sort(sIYqT)
var eWJfs=CQqhV.ltLoV()
eWJfs=CQqhV.muchP('countryCode',this.NaXFP,eWJfs)
for(var uUXeF=0;uUXeF<AHFdt.length;uUXeF++)
{
var ukQer=AHFdt[uUXeF]
var ASkON=ukQer.code
QuixJ+="<option "
if(eWJfs==ASkON)QuixJ+="selected "
QuixJ+="value=\""+ASkON+"\">"+Translator.country(ASkON)+"</option>"
}
QuixJ+="</select>"
}
else
{
QuixJ+=Translator.country(AXcKx.QbIQM.aWCap);
}
QuixJ+="<br><span id='wa-market-state'>"
QuixJ+="<select id='wa-select-state'></select>"
QuixJ+="</span>"
QuixJ+="</td></tr>"
}
else
{
QuixJ+="<tr>"+this.ugVBG("form-label-"+fhNpl);
QuixJ+="<td>"
QuixJ+=this.Gfqgs(fhNpl,30)
QuixJ+="</td></tr>"
}
}
if(this.NaXFP==Ubcmd)
{
QuixJ+="<tr><td colspan=2 align=center >"
QuixJ+=Translator.tr("Billing adress is different")+" <input type=checkbox "
if(AXcKx.QbIQM.oqPXe)QuixJ+="checked "
QuixJ+="onchange='WA_marketCheckBillingAdress(this)'>"
QuixJ+="</td></tr>"
}
QuixJ+="</table>"
QuixJ+="</form>"
this.writeContent(QuixJ)
WA_exec_callback_opera_compliant(this,this.vIevA)
}
BrNhm.vIevA=function()
{
WA_marketChangeFormCountry(this.NaXFP)
}
BrNhm.cLRxA()
}
function TBWVf(NaXFP,UcCAd,ERVXD)
{
var AXcKx=nxZVW();
var CQqhV=AXcKx.QbIQM
var wVaIN=CQqhV.muchP("stateCode",NaXFP)
UcCAd.options.length=0
for(var n=0;n<ERVXD.length;n++)
{
var val=ERVXD[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==wVaIN)elOptNew.selected=true
try{
UcCAd.add(elOptNew,null);
}
catch(ex){
UcCAd.add(elOptNew);
}
}
}
function WA_marketChangeFormCountry(NaXFP)
{
var AXcKx=nxZVW();
var CQqhV=AXcKx.QbIQM
var SQaLD=CQqhV.aWCap
var UcCAd=document.getElementById("wa-select-form-country");
if(UcCAd) SQaLD=UcCAd.value;
html_SetDisplay("wa-market-state",(SQaLD=="US")||(SQaLD=="CA"))
var PEhNK=document.getElementById("wa-select-state");
if(PEhNK)
{
if(SQaLD=="US") TBWVf(NaXFP,PEhNK,["","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(SQaLD=="CA") TBWVf(NaXFP,PEhNK,["","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(pedhN)
{
var AXcKx=nxZVW();
var CQqhV=AXcKx.QbIQM
CQqhV.oqPXe=pedhN.checked
CQqhV.xdieb()
}
function EBnld()
{
var AXcKx=nxZVW();
var CQqhV=AXcKx.QbIQM
var qOxSc=CONST_WA_GLOBAL_SETTINGS.currency_info
var BrNhm=new WA_Dialog();
BrNhm.LUMla=function()
{
if(this.CQqhV.YsXLB=="paypal")
{
WA_displayDialogMarketCart();return;
}
if(this.CQqhV.oqPXe)
HhKUN(gLHxD)
else
HhKUN(Ubcmd)
}
BrNhm.KZDOa=function(lxpFX,jiMFF)
{
jiMFF=""+jiMFF
jiMFF=jiMFF.replace(/'/g,"&lsquo;")
return "<input type=hidden name='"+lxpFX+"' value=\""+jiMFF+"\">"
}
BrNhm.WeHKk=function()
{
var AXcKx=nxZVW();
var QuixJ=""
if(qOxSc.charCodeAt(3)>=100) return""
QuixJ+="<form id='wa-http-sender' method=POST action='https://www.paypal.com/cgi-bin/webscr' target='_blank'>"
QuixJ+=this.KZDOa("cmd","_cart")
QuixJ+=this.KZDOa("business",CONST_WA_GLOBAL_SETTINGS.email_paypal_account)
QuixJ+=this.KZDOa("upload","1")
QuixJ+=this.KZDOa("charset","utf-8")
QuixJ+=this.KZDOa("no_note","0")
QuixJ+=this.KZDOa("currency_code",CONST_WA_GLOBAL_SETTINGS.currency_code)
QuixJ+=this.KZDOa("no_shipping","2")
var tNmaP=AXcKx.xljCX()
for(var i=0;i<tNmaP.length;i++)
{
var info=tNmaP[i];
var index=i+1;
var OKSkJ=info.SvBHh();
if(AXcKx.XwxWG())
{
var rsYlj=AXcKx.MMRfF(AXcKx.kCUku(OKSkJ));
OKSkJ=OKSkJ-rsYlj;
}
QuixJ+=this.KZDOa("amount_"+index,""+OKSkJ)
QuixJ+=this.KZDOa("quantity_"+index,info.uEeCR)
var CSfir=0;
if(info.vEERL.length>0)
{
QuixJ+=this.KZDOa("on"+CSfir+"_"+index,"ref")
QuixJ+=this.KZDOa("os"+CSfir+"_"+index,info.vEERL)
CSfir++;
}
var XsVpu=""
if(info.m_opt_vals)
{
for(var i_opt=0;i_opt<info.umXgq.options.length;i_opt++)
{
var dTUOg=info.umXgq.options[i_opt]
if(dTUOg)
{
var Sfoej=info.m_opt_vals[i_opt];
var AbcDf=dTUOg.vals[Sfoej]
var vFSuZ=dTUOg.title;
if(vFSuZ.length==0) vFSuZ="opt"+(i_opt+1);
QuixJ+=this.KZDOa("on"+CSfir+"_"+index,vFSuZ)
QuixJ+=this.KZDOa("os"+CSfir+"_"+index,AbcDf)
if(XsVpu.length>0)XsVpu=XsVpu+", "
XsVpu+=AbcDf
CSfir++;
}
}
}
var CCtXA=info.cbMNX;
if(XsVpu.length>0)CCtXA=CCtXA+"("+XsVpu+")"
QuixJ+=this.KZDOa("item_name_"+index,CCtXA)
}
var niVWG=AXcKx.RqsTi()
if(AXcKx.XwxWG())
{
niVWG=niVWG-AXcKx.MMRfF(AXcKx.kCUku(niVWG));
}
if(AXcKx.XwxWG())
{
var PnSdi=AXcKx.rneIa();
var cQUIF=AXcKx.RqsTi()
var ZgcSv=PnSdi+cQUIF;
var PdTZG=AXcKx.MMRfF(AXcKx.kCUku(ZgcSv));
var npdKA=ZgcSv-PdTZG;
npdKA=npdKA-niVWG;
var ILtET=0;
for(var i=0;i<tNmaP.length;i++)
{
var info=tNmaP[i];
var index=i+1;
var jcgOC=0;
var ThvKC=0;
var OKSkJ=info.uEeCR*info.SvBHh();
var n0=AXcKx.FnVAb()/100;
var tax=OKSkJ*(n0/(1+n0));
OKSkJ=OKSkJ-tax;
jcgOC=OKSkJ;
var ZZHFo=info.SvBHh();
var rsYlj=AXcKx.MMRfF(AXcKx.kCUku(ZZHFo));
ZZHFo=ZZHFo-rsYlj;
ThvKC=info.uEeCR*ZZHFo;
if(ThvKC>jcgOC)
{
ZZHFo=info.m_price;
ZZHFo=ZZHFo-rsYlj;
var vINAd=ZZHFo;
if((vINAd>0)&&(vINAd!=info.SvBHh()))
{
vINAd=vINAd-0.01;
}
QuixJ+=this.KZDOa("amount_"+index,vINAd)
ThvKC=info.m_quantity*vINAd;
}
ILtET+=ThvKC;
}
var QxIQC=AXcKx.MMRfF(npdKA-ILtET);
if(QxIQC>0)
{
var index=tNmaP.length+1;
QuixJ+=this.KZDOa("item_name_"+index,Translator.tr("TVA correction"))
QuixJ+=this.KZDOa("quantity_"+index,1)
QuixJ+=this.KZDOa("amount_"+index,QxIQC)
}
QuixJ+=this.KZDOa("tax_cart",PdTZG)
}
else
{
QuixJ+=this.KZDOa("tax_cart",AXcKx.UmLJr())
}
QuixJ+=this.KZDOa("handling_cart",niVWG)
QuixJ+="</form>"
return QuixJ;
}
BrNhm.spYPq=function()
{
var GVSvp=this.bNNmR(Ubcmd);
var QuixJ="";
if(GVSvp.length>0)
{
QuixJ+=""+Translator.tr("Shipping information")+":\n";
QuixJ+=GVSvp;
}
return QuixJ;
}
BrNhm.uFsTT=function()
{
var GVSvp=this.bNNmR(gLHxD);
var QuixJ="";
if(GVSvp.length>0)
{
QuixJ+=Translator.tr("Billing information")+":\n";
QuixJ+=GVSvp;
}
return QuixJ;
}
BrNhm.bNNmR=function(NaXFP)
{
var AXcKx=nxZVW();
var QuixJ="";
var IXNPJ=new Array();
var tKtSU=hDUAV(CONST_WA_GLOBAL_SETTINGS.list_form_fields)
tKtSU.push("country")
tKtSU.push("state")
for(var i=0;i<tKtSU.length;i++)
{
var DPGZT=tKtSU[i];
IXNPJ[DPGZT]=this.CQqhV.muchP(DPGZT,NaXFP)
}
if(IXNPJ["firstname"])QuixJ+=IXNPJ["firstname"]+"\n"
if(IXNPJ["lastname"])QuixJ+=IXNPJ["lastname"]+"\n"
if(IXNPJ["company"])
{
QuixJ+=Translator.tr("form-label-company")+" : "+IXNPJ["company"]+"\n"
}
if(IXNPJ["fiscal_code"]) QuixJ+=Translator.tr("form-label-fiscal_code")+" : "+IXNPJ["fiscal_code"]+"\n"
if(IXNPJ["tva"]) QuixJ+=Translator.tr("form-label-tva")+" : "+IXNPJ["tva"]+"\n"
if(IXNPJ["address_1"]) QuixJ+=IXNPJ["address_1"]+"\n"
if(IXNPJ["address_2"]) QuixJ+=IXNPJ["address_2"]+"\n"
if(IXNPJ["zip"]) QuixJ+=IXNPJ["zip"]+" "
if(IXNPJ["city"]) QuixJ+=IXNPJ["city"]+"\n"
if(IXNPJ["country"])QuixJ+=Translator.country(IXNPJ["country"])
if(IXNPJ["state"]&&IXNPJ["state"].length>0) QuixJ+=" "+IXNPJ["state"];
QuixJ+="\n"
if(IXNPJ["phone"]) QuixJ+=Translator.tr("form-label-phone")+" : "+IXNPJ["phone"]+"\n"
if(IXNPJ["fax"]) QuixJ+=Translator.tr("form-label-fax")+" : "+IXNPJ["fax"]+"\n"
if(IXNPJ["email"]) QuixJ+=IXNPJ["email"]+"\n"
if(IXNPJ["comment"])
{
QuixJ+=Translator.tr("form-label-comment")+" : \n";
QuixJ+=IXNPJ["comment"]+"\n"
}
return QuixJ;
}
BrNhm.GLfRv=function()
{
var AXcKx=nxZVW();
var QuixJ="";
var tNmaP=AXcKx.xljCX();
QuixJ+="**************\n"
for(var i=0;i<tNmaP.length;i++)
{
var CQqhV=tNmaP[i];
var index=i+1;
var CCtXA=CQqhV.cbMNX;
if(CQqhV.vEERL.length>0)
{
CCtXA+=" ["+CQqhV.vEERL+"]";
}
var XsVpu=""
if(CQqhV.m_opt_vals)
{
for(var i_opt=0;i_opt<CQqhV.umXgq.options.length;i_opt++)
{
var dTUOg=CQqhV.umXgq.options[i_opt]
if(dTUOg)
{
if(XsVpu.length>0)XsVpu=XsVpu+", "
var Sfoej=CQqhV.m_opt_vals[i_opt];
var AbcDf=dTUOg.vals[Sfoej]
var vFSuZ=dTUOg.title;
if(vFSuZ.length>0) XsVpu+=vFSuZ+" : "
XsVpu+=AbcDf
}
}
}
if(XsVpu.length>0)CCtXA=CCtXA+"\n("+XsVpu+")"
QuixJ+=CCtXA;
QuixJ+="\n"
QuixJ+=Translator.tr("Price")+" : "+AXcKx.VJSIH(CQqhV.SvBHh())+"\n"
QuixJ+=Translator.tr("Quantity")+" : "+CQqhV.uEeCR+"\n"
QuixJ+=Translator.tr("Total")+" : "+AXcKx.VJSIH(CQqhV.SvBHh()*CQqhV.uEeCR);
QuixJ+="\n"
QuixJ+="**************\n"
}
var eddLA=AXcKx.rneIa()
var dfjgj=AXcKx.UmLJr()
var UUMHt=AXcKx.RqsTi()
var JnRTl=AXcKx.piumP()
var aQKXf=AXcKx.LlQYo()
QuixJ+=Translator.tr("Sub total")+" : "+AXcKx.VJSIH(eddLA)+"\n";
if(CONST_WA_GLOBAL_SETTINGS.shipping_type!=HebxE)
{
QuixJ+=Translator.tr("Shipping amount")+" : "+AXcKx.VJSIH(UUMHt)+"\n";
}
if(AXcKx.XwxWG()||AXcKx.xkNJs())
{
if(AXcKx.XwxWG())
{
QuixJ+=Translator.tr("Tax included");
}
if(AXcKx.xkNJs())
{
QuixJ+=Translator.tr("Extra Tax");
}
QuixJ+=" : ";
QuixJ+=AXcKx.VJSIH(dfjgj)+"\n";
}
if(aQKXf>0)
{
QuixJ+=Translator.tr("Promotion")+" : - "+AXcKx.VJSIH(aQKXf)+"\n";
}
QuixJ+=Translator.tr("Total")+" : "+AXcKx.VJSIH(JnRTl)+"\n";
return QuixJ;
}
BrNhm.Vmbkc=function()
{
var AXcKx=nxZVW();
var QuixJ="";
var tNmaP=AXcKx.xljCX()
QuixJ+="<table border=1 style=\"width:100%;text-align: left; margin-left: auto; margin-right: auto;\" cellpadding=2 cellspacing=2>"
QuixJ+="<tr class=\"crbst-table-title\">"
QuixJ+="<td>&nbsp;</td>"
QuixJ+="<td>"+Translator.tr("Price")+"</td>"
QuixJ+="<td>"+Translator.tr("Quantity")+"</td>"
QuixJ+="<td>"+Translator.tr("Total")+"</td>"
QuixJ+="</tr>"
for(var i=0;i<tNmaP.length;i++)
{
QuixJ+="<tr>"
var CQqhV=tNmaP[i];
var index=i+1;
QuixJ+="<td>"
var CCtXA=CQqhV.cbMNX;
if(CQqhV.vEERL.length>0)
{
CCtXA+=" ["+CQqhV.vEERL+"]";
}
CCtXA="<b>"+CCtXA+"</b>"
var XsVpu=""
if(CQqhV.m_opt_vals)
{
for(var i_opt=0;i_opt<CQqhV.umXgq.options.length;i_opt++)
{
var dTUOg=CQqhV.umXgq.options[i_opt]
if(dTUOg)
{
if(XsVpu.length>0)XsVpu=XsVpu+", "
var Sfoej=CQqhV.m_opt_vals[i_opt];
var AbcDf=dTUOg.vals[Sfoej]
var vFSuZ=dTUOg.title;
if(vFSuZ.length>0) XsVpu+=vFSuZ+" : "
XsVpu+=AbcDf
}
}
}
if(XsVpu.length>0)CCtXA=CCtXA+"<br><span style='font-size:10px;'>("+XsVpu+")</span>"
QuixJ+=CCtXA;
QuixJ+="</td>"
QuixJ+="<td>"+AXcKx.HAGIa(CQqhV.SvBHh())+"</td>"
QuixJ+="<td>"+CQqhV.uEeCR+"</td>"
QuixJ+="<td>"+AXcKx.HAGIa(CQqhV.SvBHh()*CQqhV.uEeCR)+"</td>"
QuixJ+="</tr>"
}
QuixJ+="<tr><td colspan=4>"
var eddLA=AXcKx.rneIa()
var dfjgj=AXcKx.UmLJr()
var UUMHt=AXcKx.RqsTi()
var JnRTl=AXcKx.piumP()
var aQKXf=AXcKx.LlQYo()
QuixJ+="<table border=0 width=100%>"
QuixJ+="<tr><td align=right >"+Translator.tr("Sub total")+" : "+AXcKx.HAGIa(eddLA)+"</td></tr>";
if(CONST_WA_GLOBAL_SETTINGS.shipping_type!=HebxE)
{
QuixJ+="<tr><td align=right>"+Translator.tr("Shipping amount")+" : "+AXcKx.HAGIa(UUMHt)+"</td></tr>";
}
if(AXcKx.XwxWG()||AXcKx.xkNJs())
{
if(AXcKx.XwxWG())
{
QuixJ+="<tr><td align=left >"+Translator.tr("Tax included");
}
if(AXcKx.xkNJs())
{
QuixJ+="<tr><td align=right >"+Translator.tr("Extra Tax");
}
QuixJ+=" : ";
QuixJ+=AXcKx.HAGIa(dfjgj)+"</td></tr>";
}
if(aQKXf>0)
{
QuixJ+="<tr><td align=right >"+Translator.tr("Promotion")+" : - "+AXcKx.HAGIa(aQKXf)+"</td></tr>";
}
QuixJ+="<tr><td align=right class=\"crbst-card-total\">"+Translator.tr("Total")+" : "+AXcKx.HAGIa(JnRTl)+"</td></tr>";
QuixJ+="</table>"
QuixJ+="</td></tr>"
QuixJ+="</table>"
QuixJ=QuixJ.replace(/\"/g,"'")
return QuixJ;
}
BrNhm.OBggh=function(jiMFF)
{
if((""+jiMFF).length==1)jiMFF="0"+jiMFF;
return jiMFF
}
BrNhm.pNovN=function()
{
var AXcKx=nxZVW();
var QuixJ=""
if(qOxSc.charCodeAt(3)>=100) return""
if(FjmNA)
{
QuixJ+="<form id='wa-http-sender' method=POST action='"+FjmNA_URL+"crbst_market_print_form.php' target='_blank'>"
}
else
{
QuixJ+="<form id='wa-http-sender' method=POST action='crbst_market_print_form.php' target='_blank'>"
}
QuixJ+=this.KZDOa("type_payment",this.CQqhV.YsXLB)
QuixJ+=this.KZDOa("MAIL_TITLE_PREFIXE",Translator.tr("title email Order notification"))
QuixJ+=this.KZDOa("MAIN_TITLE",Translator.tr("PRINT_FORM_MAIN_TITLE"))
QuixJ+=this.KZDOa("PREFIXE_ORDER",Translator.tr("PRINT_FORM_PREFIXE_ORDER"))
var aQFdQ=""
var AOaGa=new Date()
aQFdQ+="wa-"+this.OBggh(AOaGa.getYear()-100)+this.OBggh(AOaGa.getMonth()+1)+this.OBggh(AOaGa.getDate())
aQFdQ+=AOaGa.getHours()+this.OBggh(AOaGa.getMinutes())+this.OBggh(AOaGa.getSeconds())
aQFdQ+="-"+Math.round(Math.random()*100)
QuixJ+=this.KZDOa("ID_ORDER",aQFdQ)
QuixJ+=this.KZDOa("CARD_TITLE",Translator.tr("PRINT_FORM_CARD_TITLE"))
QuixJ+=this.KZDOa("LABEL_TYPE_PAYMENT",Translator.tr("PRINT_FORM_LABEL_TYPE_PAYMENT"))
QuixJ+=this.KZDOa("send_copy_email_to_buyer",(AXcKx.send_copy_email_to_buyer)?"1":"0")
var IXNPJ=new Array();
var tKtSU=hDUAV(CONST_WA_GLOBAL_SETTINGS.list_form_fields)
tKtSU.push("country")
tKtSU.push("state")
for(var i=0;i<tKtSU.length;i++)
{
var DPGZT=tKtSU[i];
IXNPJ[DPGZT]=AXcKx.QbIQM.muchP(DPGZT,Ubcmd)
}
QuixJ+=this.KZDOa("form_first_name",IXNPJ["firstname"]);
QuixJ+=this.KZDOa("form_last_name",IXNPJ["lastname"]);
QuixJ+=this.KZDOa("form_address1",IXNPJ["address_1"]);
QuixJ+=this.KZDOa("form_address2",IXNPJ["address_2"]);
QuixJ+=this.KZDOa("form_city",IXNPJ["address_2"]);
QuixJ+=this.KZDOa("form_zip",IXNPJ["zip"]);
QuixJ+=this.KZDOa("form_state",IXNPJ["state"]);
QuixJ+=this.KZDOa("form_country",IXNPJ["country"]);
QuixJ+=this.KZDOa("form_company",IXNPJ["company"]);
QuixJ+=this.KZDOa("form_fiscal_code",IXNPJ["fiscal_code"]);
QuixJ+=this.KZDOa("form_tva",IXNPJ["tva"]);
QuixJ+=this.KZDOa("form_phone",IXNPJ["phone"]);
QuixJ+=this.KZDOa("form_fax",IXNPJ["fax"]);
QuixJ+=this.KZDOa("CARD_TOTAL_PRICE",AXcKx.piumP());
QuixJ+=this.KZDOa("CARD_CURRENCY",CONST_WA_GLOBAL_SETTINGS.currency_code);
QuixJ+=this.KZDOa("CARD_LANG",Translator.m_lang);
QuixJ+=this.KZDOa("LABEL_PROCESS_ORDER",Translator.tr("PRINT_FORM_PROCESS_ORDER"));
QuixJ+=this.KZDOa("email_buyer",this.CQqhV.muchP("email",Ubcmd))
if(this.CQqhV.YsXLB=="check")
{
QuixJ+=this.KZDOa("TYPE_PAYMENT",Translator.tr("PRINT_FORM_TYPE_CHECK"))
QuixJ+=this.KZDOa("MESSAGE_CHECK",Translator.tr("PRINT_FORM_MESSAGE_CHECK"))
}
if(this.CQqhV.YsXLB=="wire")
{
QuixJ+=this.KZDOa("TYPE_PAYMENT",Translator.tr("PRINT_FORM_TYPE_WIRE"))
QuixJ+=this.KZDOa("MESSAGE_CHECK",Translator.tr("PRINT_FORM_MESSAGE_WIRE"))
}
if(this.CQqhV.YsXLB=="paypal")
{
QuixJ+=this.KZDOa("LABEL_PAYPAL_CART_TITLE",Translator.tr("PRINT_FORM_PAYPAL_CART_TITLE"));
QuixJ+=this.KZDOa("TYPE_PAYMENT","Paypal")
QuixJ+=this.KZDOa("MESSAGE_PAYPAL",Translator.tr("PRINT_FORM_MESSAGE_PAYPAL"))
}
QuixJ+=this.KZDOa("LABEL_PRINT",Translator.tr("PRINT_FORM_LABEL_PRINT"))
QuixJ+=this.KZDOa("card_html",this.Vmbkc())
QuixJ+=this.KZDOa("card_plain_text",this.GLfRv())
QuixJ+=this.KZDOa("LABEL_SELLER_INFORMATION",Translator.tr("Seller information"))
QuixJ+=this.KZDOa("LABEL_BANK_ACCOUNT",Translator.tr("Bank account information"))
QuixJ+=this.KZDOa("LABEL_ADDRESS",Translator.tr("Address"))
QuixJ+=this.KZDOa("seller_address",CONST_WA_GLOBAL_SETTINGS.seller_address)
QuixJ+=this.KZDOa("bank_account_informations",CONST_WA_GLOBAL_SETTINGS.bank_account_informations)
QuixJ+=this.KZDOa("buyer_info_shipping",this.spYPq())
var WmJWE=""
if(CQqhV.oqPXe)
{
WmJWE=this.uFsTT();
};
QuixJ+=this.KZDOa("buyer_info_billing",WmJWE)
QuixJ+="</form>"
return QuixJ;
}
BrNhm.GQBjF=function()
{
var AXcKx=nxZVW();
AXcKx.sAmgB()
this.closeWin()
}
BrNhm.cLRxA=function()
{
var AXcKx=nxZVW();
var BqiKY=true;
if(this.CQqhV.YsXLB=="paypal")
if((AXcKx.soYCt==true)&&(CONST_WA_GLOBAL_SETTINGS.list_promo_codes==false))
{
BqiKY=true;
}
if((BqiKY==false)&&(this.CQqhV.YsXLB=="paypal"))
{
this.addButton(Translator.tr('Clear cart'),this.GQBjF,[""],this)
this.initializeWindow(400,200)
}
else
{
this.initializeWindow(400,150)
}
var QuixJ=""
if((BqiKY==false)&&(this.CQqhV.YsXLB=="paypal"))
{
QuixJ+=this.WeHKk()
}
if(BqiKY)
{
QuixJ+=this.pNovN()
if((FjmNA==false)&&(document.webaca_is_preview))
{
WA_Dialog.alert(Translator.tr("Operation not allowed in preview mode"))
return
}
}
QuixJ+="<table border=0 style='width:100%;'><tr>";
QuixJ+="<td align=center style='"+this.cssText1()+"'>"
QuixJ+=Translator.tr("You have been redirected to the payment page")
if((BqiKY==false)&&(this.CQqhV.YsXLB=="paypal"))
{
QuixJ+="<br><br>"
QuixJ+=Translator.tr("You can clear your cart")
}
QuixJ+="</td></tr></table>"
this.writeContent(QuixJ)
if(qOxSc.charCodeAt(3)>=100)
{
WA_Dialog.alert(Translator.tr("This cariboost edition can't support ebusiness features !'"))
return;
}
var mDSBg=document.getElementById("wa-http-sender")
mDSBg.submit()
if(BqiKY)
{
AXcKx.sAmgB()
}
}
BrNhm.CQqhV=CQqhV
BrNhm.cLRxA()
}

-->
