<!--

var DLPoG=0
var dJSav=1
var DcOQR=2
var GVcOu=0;
var dnneU=1;
var HZHIm=2;
var bSZcC=0
var ZkpoU=1
var NBUxa=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(gDNsK)
{
lcTSa().klLwv(gDNsK)
var TqimR=WA_Dialog.getCurrent();
TqimR.hsnoN()
}
function lcTSa()
{
if(document.wa_global_settings_market==undefined)document.wa_global_settings_market=new NJMet()
return document.wa_global_settings_market;
}
function YBqMc()
{
this.dKCNU=function()
{
return this.cHaMK+"-"+this.XuEtE_index
}
this.ZpbbP=function(PgfBL,GBfTN)
{
this.XuEtE=PgfBL.obj.market.info.folder.substring(13);
this.XuEtE_index=PgfBL.obj.index;
this.XuEtE_modif=PgfBL.obj.market.info.critical_id_modif
this.cHaMK=PgfBL.obj.market.id 

this.bfjlB=1;
this.bXpll=PgfBL.title;
this.FJsas=PgfBL.price;
this.TNJMR=PgfBL.weight;
this.eJYbP=PgfBL.code_product;
}
this.BTZrN=function(PgfBL,GBfTN)
{

this.bXpll=PgfBL.title;
this.FJsas=PgfBL.price;
this.TNJMR=PgfBL.weight;
this.eJYbP=PgfBL.code_product;
}
this.lslxT=function()
{
var s="";
s+=this.dKCNU();
if(this.m_opt_vals)
for(var i=0;i<this.m_opt_vals.length;i++)
{
var VLtib=this.m_opt_vals[i]
if(VLtib!=-1) s+="/"+VLtib;
}
return s;
}
this.ucoOW=function()
{
var val="";
val+="j="+this.XuEtE+",";
val+="i="+this.XuEtE_index+",";
val+="m="+this.XuEtE_modif+",";
val+="q="+this.bfjlB+",";
if(this.m_opt_vals)
{
for(var i=0;i<this.m_opt_vals.length;i++)
{
val+="o"+i+"=";
var nucMU=this.m_opt_vals[i]
if(nucMU>-1)
val+=nucMU
else
val+=""
val+=","
}
}
return val;
}
this.nCUDD=function(map,k)
{
var v=map[k];
if(v=="undefined") return "";
return v;
}
this.KKnEj=function(map)
{
this.XuEtE=this.nCUDD(map,"j");
if(this.XuEtE=="") return false;
this.XuEtE_index=this.nCUDD(map,"i");
this.XuEtE_modif=this.nCUDD(map,"m");
this.bfjlB=parseInt(map["q"]);
this.m_opt_vals=new Array();
for(var i=0;i<3;i++)
{
var VWFSG=parseInt(map["o"+i]);
if(isNaN(VWFSG))VWFSG=-1;
this.m_opt_vals.push(VWFSG)
}
return true;
}
this.FVvZu=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.dEhHL=function(YMmAF)
{
var Yvxgv=this.FVvZu(YMmAF)
return this.KKnEj(Yvxgv) 
}
this.OmtiD=function()
{
return URXOw(this.PgfBL,this.m_opt_vals)
}
}
function XaMhU(TYYcl,WjRdg)
{
var ALFmP=TYYcl[0]
var WNMdr=TYYcl[1]
var QjWFG=TYYcl[2]
if(ALFmP.length==0)
{
QjWFG.call(WNMdr)
return;
}
var js=ALFmP.pop()
WA_loadScript(js.src,XaMhU,[ALFmP,WNMdr,QjWFG]);
}
function WA_arrayContains(WPcVD,YMmAF)
{
for(var n=0;n<WPcVD.length;n++){if(WPcVD[n]==YMmAF)return true;}
return false;
}
function bkHcO(WPcVD)
{
var Yvxgv=new Array()
for(var n=0;n<WPcVD.length;n++)
{
var VaujC=WPcVD[n]
if(VaujC=="address") Yvxgv=Yvxgv.concat(["address_1","address_2","city","zip"])
else Yvxgv.push(VaujC)
}
return Yvxgv;
}
function tKZEU()
{
this.KJVIH=function()
{
if(this.ftZqx.length==0)return CONST_WA_GLOBAL_SETTINGS.default_selected_country;
return this.ftZqx;
}
this.gAxZM=function()
{
this.QEEhZ()
}
this.FVvZu=function(s)
{
var gRnia=new Array();
var tab=s.split(",");
for(var i=0;i<tab.length;i++)
{
var tab3=tab[i].split("=");
if(tab3.length==2)gRnia[tab3[0]]=tab3[1];
}
return gRnia;
}
this.ANltU=function(ejrpJ)
{
if(ejrpJ==undefined) return ""
return(ejrpJ==bSZcC)?"deliv-":"bill-"
}
this.LYvbR=function(TQnDe,ejrpJ,WvsZM)
{
if(!WvsZM)WvsZM=""
var eqVQf=this.ANltU(ejrpJ)
if(TQnDe=="country")
{
if(ejrpJ==bSZcC) return this.ftZqx
if(ejrpJ==ZkpoU) TQnDe="countryCode"
}
if(TQnDe=="state")
{
TQnDe="stateCode"
}
var VLtib=this.jZfRD[eqVQf+TQnDe]
if(!VLtib) return WvsZM
VLtib=VLtib.replace(/\"/g,"'")
return VLtib
}
this.SXhRB=function(VLtib)
{
if(VLtib==undefined)return ""
return VLtib
}
this.gGqRc=function(key,val)
{
if((val==null)||(val==undefined)) val="";
WA_SetCookie("crbst-card-"+key,val)
}
this.hgbrf=function(key)
{
var WNMdr=WA_GetCookie("crbst-card-"+key)
if(WNMdr=="null")WNMdr="";
return ""+WNMdr
}
this.EIWdn=function()
{
this.jZfRD=new Array()
var YMmAF=this.hgbrf("order-infos")
var Yvxgv=this.FVvZu(YMmAF)
for(var k1 in Yvxgv)
{
var VLtib=Yvxgv[k1]
if((k1.indexOf("deliv-")==0)||(k1.indexOf("bill-")==0))
this.jZfRD[k1]=unescape(VLtib)
}
this.ftZqx=this.SXhRB(Yvxgv["countryCode"])
this.magZt=this.SXhRB(Yvxgv["typePayment"])
this.fJRVA=(this.SXhRB(Yvxgv["differentBillingAddressChecked"])=="true")
this.HwGEu=(this.SXhRB(Yvxgv["salesConditionChecked"])=="true")
}
this.QEEhZ=function()
{
var YMmAF=""
for(var k1 in this.jZfRD)
{
var VLtib=this.jZfRD[k1]
YMmAF+=k1+"="+escape(VLtib)+","
}
var sAdmh=""
sAdmh+="countryCode="+escape(this.ftZqx)+","
sAdmh+="typePayment="+escape(this.magZt)+","
sAdmh+="differentBillingAddressChecked="+(this.fJRVA)+","
sAdmh+="salesConditionChecked="+(this.HwGEu)+","
YMmAF+=sAdmh 
this.gGqRc("order-infos",YMmAF)
}
this.AAaja=function(HBYBF)
{
if(trimString(HBYBF.value).length==0)
{
HBYBF.style.backgroundColor="#ff0000"
HBYBF.focus()
return false;;
}
HBYBF.style.backgroundColor=""
return true;
}
this.gUfiQ=function(ejrpJ)
{
var meYKa=bkHcO(CONST_WA_GLOBAL_SETTINGS.list_form_fields)
var EBltO=bkHcO(CONST_WA_GLOBAL_SETTINGS.list_mandatory_form_fields) 
var eJYwJ=this.jZfRD;
var eqVQf=this.ANltU(ejrpJ) 
var kaYGR=document.getElementById("wa-market-form")
for(var n=0;n<meYKa.length;n++)
{
var wHugU=meYKa[n]
var BXneU=kaYGR[wHugU]
var VLtib=trimString(BXneU.value)
if(wHugU!="address_2")
if(WA_arrayContains(EBltO,wHugU))
{
if(this.AAaja(BXneU)==false)return false;
}
eJYwJ[eqVQf+wHugU]=VLtib
}
var kDHDh=document.getElementById("wa-select-state");
var eeuOF=document.getElementById("wa-market-state");
if(kDHDh&&(eeuOF.style.display!="none"))
{
if(this.AAaja(kDHDh)==false)return false;
eJYwJ[eqVQf+"stateCode"]=kDHDh.value
}
else
{
eJYwJ[eqVQf+"stateCode"]=""
}
if(ejrpJ==ZkpoU)
{
var nEIqJ=document.getElementById("wa-select-form-country");
if(nEIqJ)
{
eJYwJ[eqVQf+"countryCode"]=nEIqJ.value
}
}
this.QEEhZ()
return true;
}
this.kSIhE=""
this.ftZqx=""
this.magZt=""
this.fJRVA=false;
this.HwGEu=false
this.EIWdn()
}
function NJMet()
{
this.wlCKP=new Array();
this.WNMdr_callback=false;
this.SSLpO=false;
this.AtFYm=false;
this.bDnNS=new tKZEU()
this.Qdoku=CONST_WA_GLOBAL_SETTINGS.use_native_paypal_cart;
this.vAjnf=function(WNMdr,QjWFG)
{
this.WNMdr_callback=WNMdr
this.SSLpO=QjWFG 
var jkneR=this.hgbrf("data")
this.nFvLU(jkneR) 
var ALFmP=new Array()
var WPcVD=this.wlCKP;
for(var i=0;i<WPcVD.length;i++)
{
var tDRUI=WPcVD[i];
var mphRe=Translator.m_lang_for_filename
if(mphRe.length>0)mphRe="_"+mphRe;
var OiSqc=tDRUI.XuEtE;
var n=OiSqc.indexOf("_")
if(n>-1)OiSqc=OiSqc.substring(n+1)
tDRUI.cHaMK="wa-id-"+OiSqc 
var WFcCR=wa_global_market.markets[tDRUI.cHaMK]
if(this.AtFYm==false)
if(!WFcCR)
{
var rtwYC="crbst_market_"+tDRUI.XuEtE+'/'
WA_declareMarket(tDRUI.cHaMK,rtwYC,tDRUI.XuEtE_modif) 
var NjtKC=rtwYC+'market-definition'+mphRe+'.js?v='+tDRUI.XuEtE_modif
ALFmP.push({id:OiSqc,src:NjtKC})
}
}
XaMhU([ALFmP,this,this.rkdRf],true)
}
this.AGQtX=function()
{
this.gGqRc("data","")
this.bDnNS.gGqRc("order-infos","")
this.bDnNS.EIWdn()
this.nFvLU("")
}
this.rkdRf=function()
{
this.AtFYm=true;
var WPcVD=this.wlCKP;
var RCepR=new Array();
for(var i=0;i<WPcVD.length;i++)
{
var tDRUI=WPcVD[i];
var OiSqc=tDRUI.cHaMK
var qGouk=wa_global_market.markets[OiSqc] 

if(qGouk.info)
{
var ZAmNr=qGouk.info.products 
var GBfTN=tDRUI.XuEtE_index
var PgfBL=ZAmNr[GBfTN]
tDRUI.PgfBL=PgfBL
tDRUI.BTZrN(tDRUI.PgfBL,GBfTN)
if((PgfBL.unavail==false)&&(tDRUI.XuEtE_modif==qGouk.info.critical_id_modif))
{
RCepR.push(tDRUI)
}
}
else
{
}
}
this.wlCKP=RCepR
this.Vauec() 

this.SSLpO.call(this.WNMdr_callback)
}
this.nFvLU=function(xJCaI)
{
var WPcVD=new Array();
var list_string_products=xJCaI.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 tDRUI=new YBqMc();
if(tDRUI.dEhHL(s_data))
{
WPcVD.push(tDRUI);
}
}
}
this.wlCKP=WPcVD;
var EtoSj=this.OJfGZ()
if(WA_getNumberMarketItemsInCart()!=EtoSj)
{
this.IecVL()
this.DtKTo()
}
}
this.weKBA=function()
{
var KMqBa=''
try{KMqBa=CONST_WA_GLOBAL_SETTINGS.currency_mnemonic}catch(e){}
return KMqBa
}
this.klLwv=function(gDNsK)
{
var list2=new Array();
var WPcVD=this.wlCKP
for(var i=0;i<WPcVD.length;i++)
{
var tDRUI=WPcVD[i];
if(i!=gDNsK)
{
list2.push(tDRUI);
}
}
this.wlCKP=list2;
this.Vauec()
}
this.addProductToShoppingCard=function(PgfBL,optionsValues)
{
if(this.SNlwR()==false)
{
WA_Dialog.alert(Translator.tr("You can't use shopping card Your browser doesnt accept cookies !"));
return false;
}
var WnqRx=PgfBL.obj
var WPcVD=this.XmdPr();
var n=WPcVD.length
var QKuNI=new YBqMc()
QKuNI.ZpbbP(PgfBL,n);
QKuNI.m_opt_vals=optionsValues
var b_match=false;
for(var i=0;i<WPcVD.length;i++)
{
var tDRUI=WPcVD[i];
if(tDRUI.lslxT()==QKuNI.lslxT())
{
b_match=true;
tDRUI.bfjlB++;
}
}
if(b_match==false)
{
var jkneR=this.hgbrf("data")
var jMWtM=QKuNI.ucoOW()
var DpBEa=jkneR.length+jMWtM.length 
if(DpBEa>4000)
{
WA_Dialog.alert(Translator.tr("Cookies cart contains max data !"));
return false;
}
WPcVD.push(QKuNI);
}
return true
}
this.HVRhf=function()
{
var WPcVD=this.wlCKP
var jkneR="";
for(var i=0;i<WPcVD.length;i++)
{
var info=WPcVD[i];
jkneR+=info.ucoOW()+";";
}
return jkneR;
}
this.OJfGZ=function()
{
var djVXV=0;
var WPcVD=this.wlCKP;
for(var i=0;i<WPcVD.length;i++)
{
var tDRUI=WPcVD[i];
djVXV+=tDRUI.bfjlB
}
return djVXV;
}
this.IecVL=function()
{
this.gGqRc("nb_items",this.OJfGZ())
}
this.Vauec=function()
{
var WPcVD=this.wlCKP
var jkneR=this.HVRhf()
this.gGqRc("data",jkneR)
this.IecVL()
this.DtKTo();
}
this.DtKTo=function()
{
WA_refreshNumberMarketItemsInCart()
}
this.XmdPr=function()
{
return this.wlCKP;
}
this.SNlwR=function()
{
this.gGqRc("watestcookies","test")
return(this.hgbrf("watestcookies")=="test");
}
this.gGqRc=function(key,val)
{
if((val==null)||(val==undefined)) val="";
WA_SetCookie("crbst-card-"+key,val)
}
this.hgbrf=function(key)
{
var WNMdr=WA_GetCookie("crbst-card-"+key)
if(WNMdr=="null")WNMdr="";
return ""+WNMdr
}
this.JgTvT=function(v)
{
return WA_formatPrice(v) 
}
this.FUJii=function(v)
{
return WA_basicFormatPrice(v)+" "+CONST_WA_GLOBAL_SETTINGS.currency_code;
}
this.IGKUi=function(ofanA)
{
return Math.round(ofanA*100)/100
}
this.mdPao=function()
{
var WPcVD=this.XmdPr()
var price=0;
for(var i=0;i<WPcVD.length;i++)
{
var tDRUI=WPcVD[i];
price+=(tDRUI.OmtiD()*tDRUI.bfjlB);
}
return price;
}
this.tvUaf=function()
{
var ofanA=this.mdPao()
var nruow=0;
var WPcVD=CONST_WA_GLOBAL_SETTINGS.list_promo_codes
for(var i=0;i<WPcVD.length;i++)
{
var BoQxa=WPcVD[i];
if(MD5(trimString(this.bDnNS.kSIhE.toUpperCase()))==BoQxa.c)
{
if(BoQxa.v.indexOf("%")>-1)
{
var nruow=parseFloat(BoQxa.v)/100;
return ofanA*nruow;
}
else
{
return parseFloat(BoQxa.v);
}
break;
}
}
return 0;
}
this.computeShippingForValue=function(val)
{
var ocVjK=CONST_WA_GLOBAL_SETTINGS.shipping_type
if(ocVjK==DLPoG)return 0;
var ship_val=0;
var XeNZp=CONST_WA_GLOBAL_SETTINGS.shipping_intervals
for(var i=0;i<XeNZp.length;i++)
{
var vjenK=XeNZp[i];
if(vjenK.v<val)ship_val=vjenK.p
}
return ship_val;
}
this.ceUhA=function(TEJui)
{
var Yvxgv=CONST_WA_GLOBAL_SETTINGS.gRnia_list_extra_shipping_by_country_code
if(Yvxgv==undefined)
{
Yvxgv=new Array()
CONST_WA_GLOBAL_SETTINGS.gRnia_list_extra_shipping_by_country_code=Yvxgv;
var lwRBb=CONST_WA_GLOBAL_SETTINGS.list_extra_shipping_by_country_code
for(var gDNsK in lwRBb)
{
var RxZfw=lwRBb[gDNsK];
var BxMoE=RxZfw.c
for(var cNuhs in BxMoE)
{
var rQHlx=BxMoE[cNuhs];Yvxgv[rQHlx]=RxZfw.p;
}
}
}
return Yvxgv[TEJui];
}
this.Knqen=function(TEJui)
{
var Yvxgv=CONST_WA_GLOBAL_SETTINGS.gRnia_list_tva_by_country_code
if(Yvxgv==undefined)
{
Yvxgv=new Array()
CONST_WA_GLOBAL_SETTINGS.gRnia_list_tva_by_country_code=Yvxgv;
var lwRBb=CONST_WA_GLOBAL_SETTINGS.list_tva_by_country_code
for(var gDNsK in lwRBb)
{
var RxZfw=lwRBb[gDNsK];
var BxMoE=RxZfw.c;
for(var cNuhs in BxMoE)
{
var rQHlx=BxMoE[cNuhs];Yvxgv[rQHlx]=RxZfw.p;
}
}
}
return Yvxgv[TEJui];
}
this.sHSdu=function()
{
var ocVjK=CONST_WA_GLOBAL_SETTINGS.shipping_type
var WPcVD=this.XmdPr()
var global_ref_for_shipping=0;
var sQEEQ=0;
var ftZqx=this.bDnNS.ftZqx;
if(ftZqx.length>0)
{
sQEEQ=this.ceUhA(ftZqx);
if(isNaN(sQEEQ)) sQEEQ=0;
}
for(var i=0;i<WPcVD.length;i++)
{
var tDRUI=WPcVD[i];
if(ocVjK==dJSav)
{
global_ref_for_shipping+=(tDRUI.bfjlB*tDRUI.OmtiD());
}
if(ocVjK==DcOQR)
{
global_ref_for_shipping+=(tDRUI.bfjlB*tDRUI.TNJMR);
}
}
return sQEEQ+this.IGKUi(this.computeShippingForValue(global_ref_for_shipping));
}
this.BdMpH=function()
{
return CONST_WA_GLOBAL_SETTINGS.tva_type==dnneU
}
this.eBbUV=function()
{
return CONST_WA_GLOBAL_SETTINGS.tva_type==HZHIm
}
this.LoVNk=function()
{
return CONST_WA_GLOBAL_SETTINGS.tva_type==GVcOu
}
this.nNlGQ=function()
{
if(this.LoVNk())return 0;
var tax=0;
var country_code=this.bDnNS.ftZqx;
if(country_code.length>0)
{
tax=this.Knqen(country_code);
if(isNaN(tax))tax=0;
}
return tax;
}
this.rkYnj=function(ofanA)
{
if(this.BdMpH())
{
var n0=this.nNlGQ()/100;
return ofanA*(n0/(1+n0));
}
if(this.eBbUV())
{
return ofanA*this.nNlGQ()/100;
}
return ofanA;
}
this.TUCel=function()
{
if(this.LoVNk())return 0;
var WPcVD=this.XmdPr()
var hHCus=0;
var YOwNP=0;
for(var i=0;i<WPcVD.length;i++)
{
var tDRUI=WPcVD[i];
hHCus+=(tDRUI.OmtiD()*tDRUI.bfjlB);
}
hHCus+=this.sHSdu();
YOwNP=this.IGKUi(this.rkYnj(hHCus));
return YOwNP;
}
this.MRYZd=function()
{
var ofanA=0;
ofanA+=this.mdPao()
if(this.eBbUV())ofanA+=this.TUCel()
ofanA+=this.sHSdu()
ofanA-=this.tvUaf()
return ofanA;
}
}
function ORplQ(WbCOJ,BWaBl)
{
if(WbCOJ.lab<BWaBl.lab) return-1;
if(WbCOJ.lab>BWaBl.lab) return 1;
return 0
}
function WA_marketWatchQuantity()
{
var TqimR=WA_Dialog.getCurrent()
TqimR.ZGlCP()
}
function WA_displayDialogMarketCart()
{
var TqimR=new WA_Dialog();
TqimR.siUpB=false;
TqimR.beMBq=function()
{
this.nBjia()
this.siUpB=setInterval("WA_marketWatchQuantity()",400)
}
TqimR.nBjia=function()
{
if(this.siUpB)clearInterval(this.siUpB)
}
TqimR.ZGlCP=function()
{
var BHVBg=lcTSa();
var FFabj=BHVBg.XmdPr();
for(var n=0;n<FFabj.length;n++)
{
var tDRUI=FFabj[n]
var ihtPN=document.getElementById("wa-cart-quantity-"+n)
var QJWUX=ihtPN.value
var ISYlg=parseInt(QJWUX)
if(isNaN(ISYlg))ISYlg=0;
if((QJWUX!='')&&(ISYlg+""!=QJWUX))
{
ihtPN.value=""+ISYlg
}
if(ISYlg!=tDRUI.bfjlB)
{
tDRUI.bfjlB=ISYlg
BHVBg.Vauec()
this.jrhnU()
}
}
var Bgmub=document.getElementById("wa-promo-code")
if(Bgmub)
{
if(Bgmub.value!=BHVBg.bDnNS.kSIhE)
{
BHVBg.bDnNS.kSIhE=Bgmub.value
this.jrhnU()
}
}
}
TqimR.onCustomKeypress=function(wTtqJ)
{
if(wTtqJ==13)
{
wa_timeout(Delegate.create(this,this.bjgNs),0);
}
return false;
}
TqimR.closeWin=function()
{
this.nBjia()
this.intern_closeWin()
}
TqimR.jrhnU=function()
{
var BHVBg=lcTSa();
var FFabj=BHVBg.XmdPr();
if(FFabj.length==0) return;
for(var n=0;n<FFabj.length;n++)
{
var tDRUI=FFabj[n]
var ELqfY=document.getElementById("wa-cart-total-"+n)
var ofanA=tDRUI.OmtiD() 
var jDWXo=tDRUI.bfjlB*ofanA
var YMmAF="<span style='"
YMmAF+=(jDWXo>0)?"color:"+WA_GLOBAL_COLOR_THEME.color_text+";font-weight:normal;":"color:#ff0000;font-weight:bold;"
YMmAF+="'>"
YMmAF+=BHVBg.JgTvT(jDWXo)
YMmAF+="</span>"
ELqfY.innerHTML=YMmAF
}
var JIrRK=BHVBg.mdPao()
var vOjmk=BHVBg.TUCel()
var eZaqp=BHVBg.sHSdu()
var SnIPS=BHVBg.MRYZd()
var kQnUx=BHVBg.tvUaf()
var PPDmi=""
var ELqfY=document.getElementById("wa-cart-amount-total")
PPDmi+=Translator.tr("Sub total")+" : "+BHVBg.JgTvT(JIrRK)
PPDmi+="<br>"
if(eZaqp>0)
{
PPDmi+="<span>"+Translator.tr("Shipping amount")+" : "+BHVBg.JgTvT(eZaqp)+"</span>";
PPDmi+="<br>"
}
if(BHVBg.BdMpH()||BHVBg.eBbUV())
{
if(BHVBg.BdMpH())
{
PPDmi+="<div style='width:100%;text-align:left;'>"
PPDmi+=Translator.tr("Tax included");
}
if(BHVBg.eBbUV())
{
PPDmi+="<div>"
PPDmi+=Translator.tr("Extra Tax");
}
PPDmi+=" : ";
PPDmi+=BHVBg.JgTvT(vOjmk)+"</div>";
}
if(kQnUx>0)
{
PPDmi+="<span>"+Translator.tr("Promotion")+" : - "+BHVBg.JgTvT(kQnUx)+"</span><br>";
}
PPDmi+="<span><b>"+Translator.tr("Total")+" : "+BHVBg.JgTvT(SnIPS)+"</b></span>";
ELqfY.innerHTML=PPDmi
}
TqimR.ZwsDI=function()
{
WA_displayDialogMarketCart()
}
TqimR.vQunh=function()
{
this.closeWin()
}
TqimR.bjgNs=function()
{
var BHVBg=lcTSa();
if(WA_getNumberMarketItemsInCart()==0)return;
var mVpft=document.getElementById("wa-market-select-country")
if(mVpft)
{
BHVBg.bDnNS.ftZqx=mVpft.value
}
if(BHVBg.bDnNS.ftZqx=="")
{
var mVpft=document.getElementById("wa-market-select-country")
if(mVpft)
{
mVpft.focus()
mVpft.style.backgroundColor="#ff0000"
return;
}
}
if(CONST_WA_GLOBAL_SETTINGS.link_sale_condition)
{
if(BHVBg.bDnNS.HwGEu!=true)
{
var IFwEI=document.getElementById("wa-sales-condition")
if(IFwEI)
{
IFwEI.focus()
var GNagw=document.getElementById("wa-sales-condition-label")
GNagw.style.backgroundColor="#ff0000"
return;
}
}
}
var bgAKf=CONST_WA_GLOBAL_SETTINGS.list_type_payment
if(bgAKf.length==1)
{
BHVBg.bDnNS.magZt=bgAKf[0]
}
var mVpft=document.getElementById("wa-market-select-payment")
if(mVpft)
{
BHVBg.bDnNS.magZt=mVpft.value
if(BHVBg.bDnNS.magZt=="")
{
mVpft.focus()
mVpft.style.backgroundColor="#ff0000"
return;
}
}
sRixK()
}
TqimR.hsnoN=function()
{
WA_exec_callback_opera_compliant(this,this.ZDmHm)
}
TqimR.ZDmHm=function()
{
var BHVBg=lcTSa();

var nEIqJ=document.getElementById("wa-market-select-country")
if(nEIqJ)
{
BHVBg.bDnNS.ftZqx=nEIqJ.value
}
BHVBg.bDnNS.gAxZM()
var mvHOG=html_getLayer("market-cart-content")
var vePFS=html_getLayer("wa-market-payment-form") 
var YMmAF=""
var FFabj=BHVBg.XmdPr();
html_SetVisibility(vePFS,(FFabj.length>0))
if(FFabj.length==0)
{
YMmAF+="<span style='font-family:Arial;font-size:16px;'>"
YMmAF+=Translator.tr("No articles in Card !")
YMmAF+="</span>"
}
else
{
var HnKFG="border:1px solid "+WA_GLOBAL_COLOR_THEME.color0+";font-weight:normal;"
var JZoCK="border:1px solid "+WA_GLOBAL_COLOR_THEME.color0+";color:#ff0000;font-weight:bold;"
var mBabm="color:#222222;font-size:12px;"
YMmAF+="<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+";'>"
YMmAF+="<thead style='font-size:13px;border:1px solid;'>"
YMmAF+="<tr>"
YMmAF+="<th  colspan=2 style='"+HnKFG+"'></th>" 
YMmAF+="<th style='"+HnKFG+"'  width=70px><b>"+Translator.tr("Price")+"</b></th>"
YMmAF+="<th style='"+HnKFG+"'  width=70px><b>"+Translator.tr("Quantity")+"</b></th>"
YMmAF+="<th style='"+HnKFG+"'  width=70px><b>"+Translator.tr("Total")+"</b></th>"
YMmAF+="<th style='"+HnKFG+"'  width=90px></th>"
YMmAF+="</tr>"
for(var n=0;n<FFabj.length;n++)
{
var tDRUI=FFabj[n]
YMmAF+="<tr>"
YMmAF+="<th style='"+HnKFG+"' >"
var qGouk=wa_global_market.markets[tDRUI.cHaMK]
var OugIt=new Size(30,30)
var oNCYF=OugIt
if(qGouk.info.design.crop_thumb==false)
{
oNCYF=tDRUI.PgfBL.size_thumb.clone()
oNCYF.scale(OugIt)
}
else
{
}
if(tDRUI.PgfBL.img_thumb.length>0)
YMmAF+="<img border=0 src='"+tDRUI.PgfBL.img_thumb+"' width="+oNCYF.width+"px height="+oNCYF.height+"px>"
YMmAF+="</th>"
YMmAF+="<th style='"+HnKFG+"text-align:left;padding:5px;background-color:"+WA_GLOBAL_COLOR_THEME.color1+";' >"
YMmAF+="<b>"+tDRUI.bXpll+"</b>"
if(tDRUI.eJYbP.length>0)
{
YMmAF+="<span style='"+mBabm+"'>";
YMmAF+=" ["+tDRUI.eJYbP+"]";
YMmAF+="</span>";
}
if(tDRUI.m_opt_vals)
{
YMmAF+="<br>"
YMmAF+="<span style='"+mBabm+"'>";
for(var i_opt=0;i_opt<tDRUI.PgfBL.options.length;i_opt++)
{
var Xujqf=tDRUI.PgfBL.options[i_opt]
if(Xujqf)
{
var nRGrK=tDRUI.m_opt_vals[i_opt];
var mNhFN=Xujqf.title;
if(mNhFN.length>0)
{
YMmAF+=mNhFN;
YMmAF+=":"
}
YMmAF+=Xujqf.vals[nRGrK];
YMmAF+=" "
}
}
YMmAF+="</span>";
}
YMmAF+="</th>"
var ofanA=tDRUI.OmtiD()
YMmAF+="<th style='"+HnKFG+"' >"+BHVBg.JgTvT(ofanA)+"</th>"
YMmAF+="<th style='"+HnKFG+"'  align=center><input type=text id='wa-cart-quantity-"+n+"' style='width:45px;' maxlength=3 value='"+tDRUI.bfjlB+"' type=text/></th>"
YMmAF+="<th style='"
var jDWXo=tDRUI.bfjlB*ofanA
YMmAF+=(jDWXo>0)?HnKFG:JZoCK;
YMmAF+="' ><span id='wa-cart-total-"+n+"'>"
YMmAF+=BHVBg.JgTvT(jDWXo)
YMmAF+="</span></th>"
YMmAF+="<th style='"+HnKFG+"' ><a href=\"javascript:WA_marketRemoveItem("+n+")\">"+Translator.tr("Remove card item")+"</a></th>"
YMmAF+="</tr>"
}
YMmAF+="<tr>"
YMmAF+="<th style='"+HnKFG+"text-align:right;padding:5px;' id='wa-cart-amount-total'  colspan=5>&nbsp;</th>"
YMmAF+="<th style='"+HnKFG+"' ></th>"
YMmAF+="</tr>"
YMmAF+="</thead>"
YMmAF+="</table>"
YMmAF+="<br>"
}
mvHOG.innerHTML=YMmAF
this.beMBq()
WA_exec_callback_opera_compliant(this,this.jrhnU) 
}
TqimR.pRPcP=function()
{
var BHVBg=lcTSa();
this.addButton(Translator.tr("Continue Shopping"),this.vQunh,[""],this)
this.addButton(Translator.tr("Checkout order"),this.bjgNs,[""],this)
this.initializeWindow(670,700)
var rsEJI="font-family:Arial;font-size:12px;color:#000000;"
var YMmAF=""
YMmAF+="<div id='market-cart-content' style='width:100%;"+rsEJI+"' align=center>" 
YMmAF+="</div>"
YMmAF+="<br>"
YMmAF+="<div style='width:100%;"+rsEJI+"' align=center id='wa-market-payment-form'>"
YMmAF+="<br>"
var TnGbQ=CONST_WA_GLOBAL_SETTINGS.list_favorite_country
var NpwxB=CONST_WA_GLOBAL_SETTINGS.list_country
var LKOvj=new Array()
for(var MmSna=0;MmSna<TnGbQ.length;MmSna++)
{
LKOvj[TnGbQ[MmSna]]=true
}
for(var MmSna=0;MmSna<NpwxB.length;MmSna++)
{
LKOvj[NpwxB[MmSna]]=true
}
var StGQt=0;
var XqpSZ=""
for(var c in LKOvj)
{
StGQt++;
XqpSZ=c
}
if(StGQt==1)
{
BHVBg.bDnNS.ftZqx=XqpSZ
}
if(StGQt>1)
{
YMmAF+="<span style='font-weight:bold;'>"
YMmAF+=Translator.tr("Please choose a country to deliver your order")
YMmAF+="</span>"
YMmAF+="<br>"
YMmAF+="<select onchange=\"WA_marketChangeCountry(this)\" id='wa-market-select-country'>"
if(CONST_WA_GLOBAL_SETTINGS.default_selected_country.length==0)
{
YMmAF+="<option value=\"\">...</option>"
}
var XaxlF=new Array()
for(var MmSna=0;MmSna<TnGbQ.length;MmSna++)
{
var kKgWv=TnGbQ[MmSna]
XaxlF.push({code:kKgWv,lab:Translator.country(kKgWv)})
}
for(var MmSna=0;MmSna<XaxlF.length;MmSna++)
{
var WNMdr=XaxlF[MmSna]
var kKgWv=WNMdr.code
YMmAF+="<option "
if(BHVBg.bDnNS.KJVIH()==kKgWv)YMmAF+="selected "
YMmAF+="value=\""+kKgWv+"\">"+Translator.country(kKgWv)+"</option>"
}
if((TnGbQ.length>0)&&(NpwxB.length>0))
{
YMmAF+="<option value=\"\">-----</option>"
}
var lFgJL=new Array()
for(var MmSna=0;MmSna<NpwxB.length;MmSna++)
{
var kKgWv=NpwxB[MmSna]
lFgJL.push({code:kKgWv,lab:Translator.country(kKgWv)})
}
if((TnGbQ.length==0)&&(NpwxB.length==0))
{
var WPcVD=CONST_WA_COUNTRIES.codes
for(var MmSna=0;MmSna<WPcVD.length;MmSna++)
{
var kKgWv=WPcVD[MmSna]
lFgJL.push({code:kKgWv,lab:Translator.country(kKgWv)})
}
}
lFgJL.sort(ORplQ)
for(var MmSna=0;MmSna<lFgJL.length;MmSna++)
{
var WNMdr=lFgJL[MmSna]
var kKgWv=WNMdr.code
YMmAF+="<option "
if(BHVBg.bDnNS.KJVIH()==kKgWv)YMmAF+="selected "
YMmAF+="value=\""+kKgWv+"\">"+Translator.country(kKgWv)+"</option>"
}
YMmAF+="</select>"
YMmAF+="<br>"
YMmAF+="<br>"
}
if(CONST_WA_GLOBAL_SETTINGS.link_sale_condition)
{
YMmAF+="<a "+WA_LinkToHref(CONST_WA_GLOBAL_SETTINGS.link_sale_condition)+" style='color:#0000ff'>"
YMmAF+=Translator.tr("Terms of sell")
YMmAF+="</a>"
YMmAF+="<br>" 
YMmAF+="<span id='wa-sales-condition-label'  style='font-weight:bold;'>"
YMmAF+=Translator.tr("label_market_accept_terms")
YMmAF+="</span>"
YMmAF+="<input id='wa-sales-condition' onchange=\"WA_marketChangeSalesCondition(this)\" "
YMmAF+=(BHVBg.bDnNS.HwGEu)?"checked ":""
YMmAF+="type='checkbox' value='1'/>" 
YMmAF+="<br>"
}
var bgAKf=CONST_WA_GLOBAL_SETTINGS.list_type_payment
if(bgAKf.length>1)
{
YMmAF+="<span style='font-weight:bold;'>"
YMmAF+=Translator.tr("Choose a type of payment")
YMmAF+="</span>"
YMmAF+="<br>"
YMmAF+="<select onchange=\"WA_marketChangeTypePayment(this)\" id='wa-market-select-payment'>"
if((bgAKf.length>1)||(bgAKf.length==0))
{
YMmAF+="<option value=\"\">...</option>"
}
for(var MmSna=0;MmSna<bgAKf.length;MmSna++)
{
var magZt=bgAKf[MmSna]
YMmAF+="<option "
if(BHVBg.bDnNS.magZt==magZt)YMmAF+="selected "
YMmAF+="value=\""+magZt+"\">"+Translator.tr("label_market_"+magZt)+"</option>" 
}
YMmAF+="</select>"
YMmAF+="<br>"
YMmAF+="<br>"
}
if(CONST_WA_GLOBAL_SETTINGS.list_promo_codes)
{
var WPcVD=CONST_WA_GLOBAL_SETTINGS.list_promo_codes
YMmAF+="<span id='wa-promo-code-label'  style='font-weight:bold;'>"
YMmAF+=Translator.tr("form-label-code_promo")
YMmAF+="</span><br>"
YMmAF+="<input id='wa-promo-code' onchange=\"WA_marketChangePromoCode(this)\" " 
YMmAF+=" value='"+BHVBg.bDnNS.kSIhE+"' "
YMmAF+="/>"
YMmAF+="<br>" 
}
YMmAF+="</div>"
this.writeContent(YMmAF)
var mvHOG=html_getLayer("market-cart-content")
mvHOG.innerHTML="<div width=100% align=center><img src='wa_loading.gif'></div>" 

BHVBg.vAjnf(this,this.hsnoN)
}
TqimR.pRPcP() 
}
function WA_marketChangeCountry(mVpft)
{
mVpft.style.backgroundColor=""
var TqimR=WA_Dialog.getCurrent()
TqimR.hsnoN()
}
function WA_marketChangeTypePayment(mVpft)
{
var BHVBg=lcTSa();
BHVBg.bDnNS.magZt=mVpft.value
BHVBg.bDnNS.gAxZM()
mVpft.style.backgroundColor=""
}
function WA_marketChangeSalesCondition(HBYBF)
{
var BHVBg=lcTSa();
BHVBg.bDnNS.HwGEu=HBYBF.checked
BHVBg.bDnNS.gAxZM() 
var GNagw=document.getElementById("wa-sales-condition-label")
GNagw.style.backgroundColor="" 
}
function WA_marketChangePromoCode(HBYBF)
{
var BHVBg=lcTSa();
BHVBg.bDnNS.kSIhE=HBYBF.value
BHVBg.bDnNS.gAxZM() 


}
function WA_LinkToHref(NHAnB)
{
var YMmAF=""
var nEqkB=NHAnB.url
var RrKLu=Translator.m_lang_for_filename
if(RrKLu.length>0)RrKLu="_"+RrKLu
nEqkB=nEqkB.replace(/@lng@/g,RrKLu)
YMmAF+="href=\""+nEqkB+"\" "
if(NHAnB.open==1)
{
YMmAF+="target="
YMmAF+="_blank"
}
return YMmAF;
}
function WA_displayDialogMarketProduct(OiSqc,gDNsK)
{
var WFcCR=wa_global_market.markets[OiSqc]
var fisYk=WFcCR.obj
var ZAmNr=fisYk.info.products
var PgfBL=ZAmNr[gDNsK] 

var TqimR=new WA_Dialog();

TqimR.PgfBL=PgfBL
TqimR.VMHxc=OiSqc
TqimR.ZwsDI=function()
{
WA_displayDialogMarketCart()
}
TqimR.OKuxu=function()
{
var BHVBg=lcTSa();
BHVBg.vAjnf(this,this.dAJFL) 
}
TqimR.dAJFL=function()
{
var PgfBL=this.PgfBL;
var BHVBg=lcTSa();
var mGSde=new Array();
var DDkgO=PgfBL.obj.id;
for(var i=0;i<3;i++)
{
var ZKnRV=-1;
var eqVQf=DDkgO+"-select-opt"
var mVpft=document.getElementById(eqVQf+i)
if(mVpft)
{
if(mVpft.value.length==0)
{
mVpft.style.backgroundColor="#ff0000";
mVpft.focus()
return;
}
ZKnRV=parseInt(mVpft.value)
}
mGSde.push(ZKnRV)
}
if(BHVBg.addProductToShoppingCard(PgfBL,mGSde))
{
BHVBg.Vauec()
WA_displayDialogMarketCart()
}
}
TqimR.pRPcP=function()
{
var OiSqc=this.VMHxc
var PgfBL=this.PgfBL
var YMmAF=""
this.addButton(Translator.tr("Go to my card"),this.ZwsDI,[""],this)
if(PgfBL.unavail==false)
{
this.addButton(Translator.tr("Add to card"),this.OKuxu,[""],this)
}
this.initializeWindow(670,this.idealHeight())
YMmAF+="<table border=0 width=100% cellpadding=4>"
YMmAF+="<tr>" 
if(PgfBL.img_big.length>0)
{
YMmAF+="<td width='100px' align=center valign=top>"
var oNCYF=PgfBL.size_thumb.clone() 
oNCYF.scale(new Size(200,200))
YMmAF+="<a href=\""+PgfBL.img_big+"\" target=_blank>"
YMmAF+="<img border=0 src=\""+PgfBL.img_big+"\" width='"+oNCYF.width+"px' height='"+oNCYF.height+"px'>"
YMmAF+="</a>"
YMmAF+="</td>"
}
var xgEiC="color:"+WA_GLOBAL_COLOR_THEME.color_text+";";
YMmAF+="<td valign=top style='font-family:Arial;'>"
YMmAF+="<span style='font-weight:bold;font-size:16px;"+xgEiC+"'>"
YMmAF+=PgfBL.title
YMmAF+="</span>"
YMmAF+="<br>"
if(PgfBL.sub_title.length>0)
{
YMmAF+="<span style='color:#333333;font-size:14px;'>"
YMmAF+=PgfBL.sub_title
YMmAF+="</span>"
YMmAF+="<br>"
}
YMmAF+="<br>"
YMmAF+="<table border=0 width=100% cellspacing=0 cellpadding=0><tr><td>"
YMmAF+="<span style='"+xgEiC+";font-size:14px;'>"
YMmAF+=Translator.tr("Price")+" : "
YMmAF+="</span>"
YMmAF+="<span style='"+xgEiC+";font-size:18px;font-weight:bold;' id='"+PgfBL.obj.id+"-price'>"
if(PgfBL.unavail)
{
YMmAF+=Translator.tr("Unavailable")
}
YMmAF+="</span>"
if(PgfBL.more_info)
{
YMmAF+="</td><td align=right>"
var NHAnB=PgfBL.more_info
var cCEjB=WA_LinkToHref(NHAnB)
YMmAF+="<a "+cCEjB+" style='font-family:Arial;text-decoration:underline;font-weight:bold;font-size:12px;color:0000ff;'>"+Translator.tr("More product info link")+"</a>"
}
YMmAF+="</td></tr></table>"
YMmAF+="<br>"
var sYNDX=PgfBL.obj.index
if(PgfBL.unavail==false)
if(PgfBL.options.length>0)
{
YMmAF+="<table border=0 cellspacing=0 cellpadding=0>"
for(var n=0;n<PgfBL.options.length;n++)
{
var Xujqf=PgfBL.options[n]
if(Xujqf)
{
YMmAF+="<tr><td align=right>"
YMmAF+="<span style='font-family:Arial;font-weight:bold;font-size:12px;"+xgEiC+"'>"
YMmAF+=Xujqf.title+" :&nbsp;"
YMmAF+="</span>"
YMmAF+="</td><td align=left>"
YMmAF+="<select id='"+PgfBL.obj.id+"-select-opt"+n+"' onchange=\"WA_market_changeCustomPrice('"+OiSqc+"',"+sYNDX+")\">"
YMmAF+="<option value=\"\">...</option>"
for(var MmSna=0;MmSna<Xujqf.vals.length;MmSna++)
{
var VLtib=Xujqf.vals[MmSna]
YMmAF+="<option value=\""+MmSna+"\">"+VLtib+"</option>"
}
YMmAF+="</select>"
YMmAF+="</td></tr>";
}
}
YMmAF+="</table>"
}
YMmAF+="</td>"
YMmAF+="</tr>"
YMmAF+="</table>"
if(PgfBL.description.length>0)
{
YMmAF+="<table border=0 width=100% cellpadding=4>"
YMmAF+="<tr><td colspan=2>"
YMmAF+="<span style='font-family:Arial;font-size:13px;"+xgEiC+"'>"
YMmAF+="<hr>"
YMmAF+=PgfBL.description
YMmAF+="</span>"
YMmAF+="</td></tr>"
YMmAF+="</table>"
}
this.writeContent(YMmAF)
WA_market_changeCustomPrice(OiSqc,sYNDX)
}
TqimR.displayWindowWithAutoResize(300,TqimR.pRPcP) 
}
function EsSSb(PgfBL,DDkgO)
{
var aHXge=new Array()
for(var i=0;i<3;i++)
{
var eqVQf=DDkgO+"-select-opt"
var mVpft=document.getElementById(eqVQf+i)
aHXge[i]=-1
if(mVpft)
{
mVpft.style.backgroundColor="";
var VLtib=parseInt(mVpft.value)
if(isNaN(VLtib)==false)
aHXge[i]=VLtib
}
}
return URXOw(PgfBL,aHXge)
}
function URXOw(PgfBL,aHXge)
{
if(PgfBL.unavail)return;
var xKImW=false;
for(var i=0;i<PgfBL.custom_prices.length;i++)
{
var EWIeh=PgfBL.custom_prices[i]
var iHPrT=true;
for(var n=0;n<3;n++)
{
if(EWIeh.tab[n]!=aHXge[n])iHPrT=false
}
if(iHPrT)
{
xKImW=EWIeh;
break;
}
}
var ofanA=PgfBL.price
if(xKImW)
{
ofanA=xKImW.pr
}
return ofanA;
}
function WA_market_changeCustomPrice(OiSqc,sYNDX)
{
var BHVBg=lcTSa();
var WFcCR=wa_global_market.markets[OiSqc]
var ZAmNr=WFcCR.info.products;
var PgfBL=ZAmNr[sYNDX]
if(PgfBL.unavail)return;
var DDkgO=PgfBL.obj.id
var ofanA=EsSSb(PgfBL,DDkgO)
var FUDDF=html_getLayer(DDkgO+"-price")
if(FUDDF)
{
FUDDF.innerHTML=BHVBg.JgTvT(ofanA)
}
}
function sRixK()
{
var BHVBg=lcTSa();
if(WA_getNumberMarketItemsInCart()==0)return;
var tDRUI=BHVBg.bDnNS
if((BHVBg.Qdoku)&&(tDRUI.magZt=="paypal"))
{
GlBdF();
return;
}
hqHfm(bSZcC)
}
function hqHfm(ejrpJ)
{
var BHVBg=lcTSa();
var tDRUI=BHVBg.bDnNS
tDRUI.EIWdn()
var TqimR=new WA_Dialog();
TqimR.ejrpJ=ejrpJ
TqimR.JmwtL=function(wTtqJ)
{
return Translator.tr("form-label-"+wTtqJ)
}
TqimR.onCustomKeypress=function(wTtqJ)
{
if(wTtqJ==13)
{
wa_timeout(Delegate.create(this,this.fYtem),0);
}
return false;
}
TqimR.FDTDu=function()
{
if(this.ejrpJ==bSZcC)
{
WA_displayDialogMarketCart()
}
else
{
hqHfm(bSZcC)
}
}
TqimR.iieCk=function()
{
GlBdF()
}
TqimR.fYtem=function()
{
var BHVBg=lcTSa();
var tDRUI=BHVBg.bDnNS
if(tDRUI.gUfiQ(this.ejrpJ)==false) return;
tDRUI.gAxZM()
if(this.ejrpJ==bSZcC)
{
if(tDRUI.fJRVA==true)
{
hqHfm(ZkpoU)
}
else
{
this.iieCk()
}
}
else
{
this.iieCk()
}
}
TqimR.qQbVd=function(wTtqJ,wOdqv)
{
if(wOdqv==undefined) wOdqv=""
if(wOdqv)wOdqv=" size="+wOdqv
return "<input name='"+wTtqJ+"' value=\""+tDRUI.LYvbR(wTtqJ,this.ejrpJ)+"\" type=text "+wOdqv+">"
}
TqimR.GYkJI=function(afXZl)
{
return "<td width=150px align=right valign=top>"+Translator.tr(afXZl)+" :</td>"
}
TqimR.pRPcP=function()
{
var BHVBg=lcTSa();
var tDRUI=BHVBg.bDnNS
this.addButton("< "+Translator.tr('Back'),this.FDTDu,[""],this)
this.addButton(Translator.tr('Continue')+" >",this.fYtem,[""],this)
this.initializeWindow(600,600)
var qLFZQ="form-label-"
var meYKa=CONST_WA_GLOBAL_SETTINGS.list_form_fields 
var YMmAF=""
YMmAF+="<form id='wa-market-form' onSubmit='return false'>"
YMmAF+="<table border=0 width=100% cellspacing=5 style='font-family:Arial;font-size:15px;'>"
YMmAF+="<tr><td colspan=2 align=center style='font-size:18px;'>"
YMmAF+=Translator.tr((this.ejrpJ==bSZcC)?"Fill Deliver information below":"Fill Billing information below")
YMmAF+="<br><br></td></tr>"
for(var n=0;n<meYKa.length;n++)
{
var BXneU=meYKa[n]
if(BXneU=="address")
{
YMmAF+="<tr>"+this.GYkJI("Address");
YMmAF+="<td>"
YMmAF+=this.qQbVd("address_1",30)
YMmAF+="</td></tr>"
YMmAF+="<tr><td></td><td>"
YMmAF+=this.qQbVd("address_2",30)
YMmAF+="</td></tr>"
YMmAF+="<tr>"+this.GYkJI("form-label-city");
YMmAF+="<td>"
YMmAF+=this.qQbVd("city")+"&nbsp;"+this.JmwtL("zip")+" : "+this.qQbVd("zip",10)
YMmAF+="</td></tr>" 
YMmAF+="<tr>"+this.GYkJI("form-label-country");
YMmAF+="<td>"
if(this.ejrpJ==ZkpoU)
{
YMmAF+="<select id='wa-select-form-country' onchange='WA_marketChangeFormCountry("+this.ejrpJ+")'>"
var lFgJL=new Array();
var WPcVD=CONST_WA_COUNTRIES.codes
for(var MmSna=0;MmSna<WPcVD.length;MmSna++)
{
var kKgWv=WPcVD[MmSna]
lFgJL.push({code:kKgWv,lab:Translator.country(kKgWv)})
}
lFgJL.sort(ORplQ)
var NoadH=tDRUI.KJVIH()
NoadH=tDRUI.LYvbR('countryCode',this.ejrpJ,NoadH)
for(var MmSna=0;MmSna<lFgJL.length;MmSna++)
{
var WNMdr=lFgJL[MmSna]
var kKgWv=WNMdr.code
YMmAF+="<option "
if(NoadH==kKgWv)YMmAF+="selected "
YMmAF+="value=\""+kKgWv+"\">"+Translator.country(kKgWv)+"</option>"
}
YMmAF+="</select>"
}
else
{
YMmAF+=Translator.country(BHVBg.bDnNS.ftZqx);
}
YMmAF+="<br><span id='wa-market-state'>"
YMmAF+="<select id='wa-select-state'></select>"
YMmAF+="</span>" 
YMmAF+="</td></tr>"
}
else
{
YMmAF+="<tr>"+this.GYkJI("form-label-"+BXneU);
YMmAF+="<td>"
YMmAF+=this.qQbVd(BXneU,30) 
YMmAF+="</td></tr>"
}
}
if(this.ejrpJ==bSZcC)
{
YMmAF+="<tr><td colspan=2 align=center >"
YMmAF+=Translator.tr("Billing adress is different")+" <input type=checkbox "
if(BHVBg.bDnNS.fJRVA)YMmAF+="checked "
YMmAF+="onchange='WA_marketCheckBillingAdress(this)'>"
YMmAF+="</td></tr>"
}
YMmAF+="</table>"
YMmAF+="</form>"
this.writeContent(YMmAF)
WA_exec_callback_opera_compliant(this,this.tYXZd) 
}
TqimR.tYXZd=function()
{
WA_marketChangeFormCountry(this.ejrpJ)
}
TqimR.pRPcP()
}
function rlFou(ejrpJ,mVpft,Yvxgv)
{
var BHVBg=lcTSa();
var tDRUI=BHVBg.bDnNS
var IjOFh=tDRUI.LYvbR("stateCode",ejrpJ) 
mVpft.options.length=0
for(var n=0;n<Yvxgv.length;n++)
{
var val=Yvxgv[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==IjOFh)elOptNew.selected=true
try{
mVpft.add(elOptNew,null);
}
catch(ex){
mVpft.add(elOptNew);
}
}
}
function WA_marketChangeFormCountry(ejrpJ)
{
var BHVBg=lcTSa();
var tDRUI=BHVBg.bDnNS
var TEJui=tDRUI.ftZqx
var mVpft=document.getElementById("wa-select-form-country");
if(mVpft) TEJui=mVpft.value;
html_SetDisplay("wa-market-state",(TEJui=="US")||(TEJui=="CA")||(TEJui=="BR"))
var kDHDh=document.getElementById("wa-select-state");
if(kDHDh)
{
if(TEJui=="US") rlFou(ejrpJ,kDHDh,["","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(TEJui=="CA") rlFou(ejrpJ,kDHDh,["","Alberta","British Columbia","Manitoba","New Brunswick","Newfoundland and Labrador","Northwest Territories","Nova Scotia","Nunavut","Ontario","Prince Edward Isl.","Quebec","Saskatchewan","Yukon Territory"])
if(TEJui=="BR") rlFou(ejrpJ,kDHDh,["","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(HBYBF)
{
var BHVBg=lcTSa();
var tDRUI=BHVBg.bDnNS
tDRUI.fJRVA=HBYBF.checked
tDRUI.gAxZM()
}
function GlBdF()
{
var BHVBg=lcTSa();
var tDRUI=BHVBg.bDnNS
var aQDlo=CONST_WA_GLOBAL_SETTINGS.currency_info 

var TqimR=new WA_Dialog();
TqimR.FDTDu=function()
{
if(this.tDRUI.magZt=="paypal")
{
WA_displayDialogMarketCart();return;
}
if(this.tDRUI.fJRVA)
hqHfm(ZkpoU)
else
hqHfm(bSZcC)
}
TqimR.xetgK=function(TQnDe,VLtib)
{
VLtib=""+VLtib
VLtib=VLtib.replace(/'/g,"&lsquo;")
return "<input type=hidden name='"+TQnDe+"' value=\""+VLtib+"\">"
}
TqimR.xTkmd=function()
{
var BHVBg=lcTSa();
var YMmAF=""
if(aQDlo.charCodeAt(3)>=100) return""
YMmAF+="<form id='wa-http-sender' method=POST action='https://www.paypal.com/cgi-bin/webscr' target='_blank'>"
YMmAF+=this.xetgK("cmd","_cart")
YMmAF+=this.xetgK("business",CONST_WA_GLOBAL_SETTINGS.email_paypal_account)
YMmAF+=this.xetgK("upload","1")
YMmAF+=this.xetgK("charset","utf-8")
YMmAF+=this.xetgK("no_note","0")
YMmAF+=this.xetgK("currency_code",CONST_WA_GLOBAL_SETTINGS.currency_code)
YMmAF+=this.xetgK("no_shipping","2")
var GjUTn=BHVBg.XmdPr()
for(var i=0;i<GjUTn.length;i++)
{
var info=GjUTn[i];
var index=i+1;
var cJWoM=info.OmtiD();
if(BHVBg.BdMpH())
{
var LbxAF=BHVBg.IGKUi(BHVBg.rkYnj(cJWoM));
cJWoM=cJWoM-LbxAF;
}
YMmAF+=this.xetgK("amount_"+index,""+cJWoM)
YMmAF+=this.xetgK("quantity_"+index,info.bfjlB)
var NVMIx=0;
if(info.eJYbP.length>0)
{
YMmAF+=this.xetgK("on"+NVMIx+"_"+index,"ref")
YMmAF+=this.xetgK("os"+NVMIx+"_"+index,info.eJYbP)
NVMIx++;
}
var ESLHa=""
if(info.m_opt_vals)
{
for(var i_opt=0;i_opt<info.PgfBL.options.length;i_opt++)
{
var Xujqf=info.PgfBL.options[i_opt]
if(Xujqf)
{
var nRGrK=info.m_opt_vals[i_opt];
var vRTvq=Xujqf.vals[nRGrK]
var mNhFN=Xujqf.title;
if(mNhFN.length==0) mNhFN="opt"+(i_opt+1);
YMmAF+=this.xetgK("on"+NVMIx+"_"+index,mNhFN)
YMmAF+=this.xetgK("os"+NVMIx+"_"+index,vRTvq)
if(ESLHa.length>0)ESLHa=ESLHa+", "
ESLHa+=vRTvq
NVMIx++;
}
}
}
var TCxQE=info.bXpll;
if(ESLHa.length>0)TCxQE=TCxQE+"("+ESLHa+")"
YMmAF+=this.xetgK("item_name_"+index,TCxQE) 
}
var HNsAn=BHVBg.sHSdu()
if(BHVBg.BdMpH())
{
HNsAn=HNsAn-BHVBg.IGKUi(BHVBg.rkYnj(HNsAn));
}
if(BHVBg.BdMpH())
{
var HEJYn=BHVBg.mdPao();
var fCQdq=BHVBg.sHSdu()
var hHCus=HEJYn+fCQdq;
var MALIu=BHVBg.IGKUi(BHVBg.rkYnj(hHCus));
var rjXxm=hHCus-MALIu;
rjXxm=rjXxm-HNsAn;
var dgqai=0;
for(var i=0;i<GjUTn.length;i++)
{
var info=GjUTn[i];
var index=i+1;
var eQChR=0;
var GcgLJ=0;
var cJWoM=info.bfjlB*info.OmtiD();
var n0=BHVBg.nNlGQ()/100;
var tax=cJWoM*(n0/(1+n0));
cJWoM=cJWoM-tax;
eQChR=cJWoM;
var fJUSE=info.OmtiD();
var LbxAF=BHVBg.IGKUi(BHVBg.rkYnj(fJUSE));
fJUSE=fJUSE-LbxAF;
GcgLJ=info.bfjlB*fJUSE;
if(GcgLJ>eQChR)
{
fJUSE=info.m_price;
fJUSE=fJUSE-LbxAF;
var jKcFp=fJUSE;
if((jKcFp>0)&&(jKcFp!=info.OmtiD()))
{
jKcFp=jKcFp-0.01;
}
YMmAF+=this.xetgK("amount_"+index,jKcFp) 
GcgLJ=info.m_quantity*jKcFp;
}
dgqai+=GcgLJ;
}
var lFqZP=BHVBg.IGKUi(rjXxm-dgqai);
if(lFqZP>0)
{
var index=GjUTn.length+1;
YMmAF+=this.xetgK("item_name_"+index,Translator.tr("TVA correction"))
YMmAF+=this.xetgK("quantity_"+index,1)
YMmAF+=this.xetgK("amount_"+index,lFqZP)
}
YMmAF+=this.xetgK("tax_cart",MALIu)
}
else
{
YMmAF+=this.xetgK("tax_cart",BHVBg.TUCel())
}
YMmAF+=this.xetgK("handling_cart",HNsAn) 
YMmAF+="</form>"
return YMmAF;
}
TqimR.BAxJj=function()
{
var IgTiN=this.aXJjW(bSZcC);
var YMmAF="";
if(IgTiN.length>0)
{
YMmAF+=""+Translator.tr("Shipping information")+":\n";
YMmAF+=IgTiN;
}
return YMmAF;
}
TqimR.lWoVl=function()
{
var IgTiN=this.aXJjW(ZkpoU);
var YMmAF="";
if(IgTiN.length>0)
{
YMmAF+=Translator.tr("Billing information")+":\n";
YMmAF+=IgTiN;
}
return YMmAF;
}
TqimR.aXJjW=function(ejrpJ)
{
var BHVBg=lcTSa();
var YMmAF="";
var Qurfv=new Array();
var meYKa=bkHcO(CONST_WA_GLOBAL_SETTINGS.list_form_fields)
meYKa.push("country")
meYKa.push("state")
for(var i=0;i<meYKa.length;i++)
{
var wHugU=meYKa[i];
Qurfv[wHugU]=this.tDRUI.LYvbR(wHugU,ejrpJ)
}
if(Qurfv["firstname"])YMmAF+=Qurfv["firstname"]+"\n"
if(Qurfv["lastname"])YMmAF+=Qurfv["lastname"]+"\n"
if(Qurfv["company"])
{
YMmAF+=Translator.tr("form-label-company")+" : "+Qurfv["company"]+"\n"
}
if(Qurfv["fiscal_code"]) YMmAF+=Translator.tr("form-label-fiscal_code")+" : "+Qurfv["fiscal_code"]+"\n"
if(Qurfv["tva"]) YMmAF+=Translator.tr("form-label-tva")+" : "+Qurfv["tva"]+"\n"
if(Qurfv["address_1"]) YMmAF+=Qurfv["address_1"]+"\n"
if(Qurfv["address_2"]) YMmAF+=Qurfv["address_2"]+"\n"
if(Qurfv["zip"]) YMmAF+=Qurfv["zip"]+" "
if(Qurfv["city"]) YMmAF+=Qurfv["city"]+"\n"
if(Qurfv["country"])YMmAF+=Translator.country(Qurfv["country"])
if(Qurfv["state"]&&Qurfv["state"].length>0) YMmAF+=" "+Qurfv["state"];
YMmAF+="\n"
if(Qurfv["phone"]) YMmAF+=Translator.tr("form-label-phone")+" : "+Qurfv["phone"]+"\n"
if(Qurfv["fax"]) YMmAF+=Translator.tr("form-label-fax")+" : "+Qurfv["fax"]+"\n"
if(Qurfv["email"]) YMmAF+=Qurfv["email"]+"\n" 
if(Qurfv["comment"])
{
YMmAF+=Translator.tr("form-label-comment")+" : \n";
YMmAF+=Qurfv["comment"]+"\n"
}
return YMmAF;
}
TqimR.jiNKS=function()
{
var BHVBg=lcTSa();
var YMmAF="";
var GjUTn=BHVBg.XmdPr();
YMmAF+="**************\n"
for(var i=0;i<GjUTn.length;i++)
{
var tDRUI=GjUTn[i];
var index=i+1;
var TCxQE=tDRUI.bXpll;
if(tDRUI.eJYbP.length>0)
{
TCxQE+=" ["+tDRUI.eJYbP+"]";
}
var ESLHa=""
if(tDRUI.m_opt_vals)
{
for(var i_opt=0;i_opt<tDRUI.PgfBL.options.length;i_opt++)
{
var Xujqf=tDRUI.PgfBL.options[i_opt]
if(Xujqf)
{
if(ESLHa.length>0)ESLHa=ESLHa+", "
var nRGrK=tDRUI.m_opt_vals[i_opt];
var vRTvq=Xujqf.vals[nRGrK]
var mNhFN=Xujqf.title;
if(mNhFN.length>0) ESLHa+=mNhFN+" : "
ESLHa+=vRTvq
}
}
}
if(ESLHa.length>0)TCxQE=TCxQE+"\n("+ESLHa+")"
YMmAF+=TCxQE;
YMmAF+="\n"
YMmAF+=Translator.tr("Price")+" : "+BHVBg.FUJii(tDRUI.OmtiD())+"\n"
YMmAF+=Translator.tr("Quantity")+" : "+tDRUI.bfjlB+"\n"
YMmAF+=Translator.tr("Total")+" : "+BHVBg.FUJii(tDRUI.OmtiD()*tDRUI.bfjlB);
YMmAF+="\n"
YMmAF+="**************\n"
}
var JIrRK=BHVBg.mdPao()
var vOjmk=BHVBg.TUCel()
var eZaqp=BHVBg.sHSdu()
var SnIPS=BHVBg.MRYZd()
var kQnUx=BHVBg.tvUaf() 
YMmAF+=Translator.tr("Sub total")+" : "+BHVBg.FUJii(JIrRK)+"\n";
if(CONST_WA_GLOBAL_SETTINGS.shipping_type!=DLPoG)
{
YMmAF+=Translator.tr("Shipping amount")+" : "+BHVBg.FUJii(eZaqp)+"\n";
}
if(BHVBg.BdMpH()||BHVBg.eBbUV())
{
if(BHVBg.BdMpH())
{
YMmAF+=Translator.tr("Tax included");
}
if(BHVBg.eBbUV())
{
YMmAF+=Translator.tr("Extra Tax");
}
YMmAF+=" : ";
YMmAF+=BHVBg.FUJii(vOjmk)+"\n";
}
if(kQnUx>0)
{
YMmAF+=Translator.tr("Promotion")+" : - "+BHVBg.FUJii(kQnUx)+"\n";
}
YMmAF+=Translator.tr("Total")+" : "+BHVBg.FUJii(SnIPS)+"\n";
return YMmAF;
}
TqimR.nfQYQ=function()
{
var BHVBg=lcTSa();
var YMmAF="";
var GjUTn=BHVBg.XmdPr()
YMmAF+="<table border=1 style=\"width:100%;text-align: left; margin-left: auto; margin-right: auto;\" cellpadding=2 cellspacing=2>"
YMmAF+="<tr class=\"crbst-table-title\">"
YMmAF+="<td>&nbsp;</td>"
YMmAF+="<td>"+Translator.tr("Price")+"</td>"
YMmAF+="<td>"+Translator.tr("Quantity")+"</td>"
YMmAF+="<td>"+Translator.tr("Total")+"</td>"
YMmAF+="</tr>"
for(var i=0;i<GjUTn.length;i++)
{
YMmAF+="<tr>"
var tDRUI=GjUTn[i];
var index=i+1;
YMmAF+="<td>"
var TCxQE=tDRUI.bXpll;
if(tDRUI.eJYbP.length>0)
{
TCxQE+=" ["+tDRUI.eJYbP+"]";
}
TCxQE="<b>"+TCxQE+"</b>"
var ESLHa=""
if(tDRUI.m_opt_vals)
{
for(var i_opt=0;i_opt<tDRUI.PgfBL.options.length;i_opt++)
{
var Xujqf=tDRUI.PgfBL.options[i_opt]
if(Xujqf)
{
if(ESLHa.length>0)ESLHa=ESLHa+", "
var nRGrK=tDRUI.m_opt_vals[i_opt];
var vRTvq=Xujqf.vals[nRGrK]
var mNhFN=Xujqf.title;
if(mNhFN.length>0) ESLHa+=mNhFN+" : "
ESLHa+=vRTvq
}
}
}
if(ESLHa.length>0)TCxQE=TCxQE+"<br><span style='font-size:10px;'>("+ESLHa+")</span>"
YMmAF+=TCxQE;
YMmAF+="</td>"
YMmAF+="<td>"+BHVBg.JgTvT(tDRUI.OmtiD())+"</td>"
YMmAF+="<td>"+tDRUI.bfjlB+"</td>"
YMmAF+="<td>"+BHVBg.JgTvT(tDRUI.OmtiD()*tDRUI.bfjlB)+"</td>"
YMmAF+="</tr>"
}
YMmAF+="<tr><td colspan=4>"
var JIrRK=BHVBg.mdPao()
var vOjmk=BHVBg.TUCel()
var eZaqp=BHVBg.sHSdu()
var SnIPS=BHVBg.MRYZd()
var kQnUx=BHVBg.tvUaf() 
YMmAF+="<table border=0 width=100%>"
YMmAF+="<tr><td align=right >"+Translator.tr("Sub total")+" : "+BHVBg.JgTvT(JIrRK)+"</td></tr>";
if(CONST_WA_GLOBAL_SETTINGS.shipping_type!=DLPoG)
{
YMmAF+="<tr><td align=right>"+Translator.tr("Shipping amount")+" : "+BHVBg.JgTvT(eZaqp)+"</td></tr>";
}
if(BHVBg.BdMpH()||BHVBg.eBbUV())
{
if(BHVBg.BdMpH())
{
YMmAF+="<tr><td align=left >"+Translator.tr("Tax included");
}
if(BHVBg.eBbUV())
{
YMmAF+="<tr><td align=right >"+Translator.tr("Extra Tax");
}
YMmAF+=" : ";
YMmAF+=BHVBg.JgTvT(vOjmk)+"</td></tr>";
}
if(kQnUx>0)
{
YMmAF+="<tr><td align=right >"+Translator.tr("Promotion")+" : - "+BHVBg.JgTvT(kQnUx)+"</td></tr>";
}
YMmAF+="<tr><td align=right class=\"crbst-card-total\">"+Translator.tr("Total")+" : "+BHVBg.JgTvT(SnIPS)+"</td></tr>";
YMmAF+="</table>" 
YMmAF+="</td></tr>"
YMmAF+="</table>"
YMmAF=YMmAF.replace(/\"/g,"'")
return YMmAF;
}
TqimR.qrdjN=function(VLtib)
{
if((""+VLtib).length==1)VLtib="0"+VLtib;
return VLtib
}
TqimR.psNpF=function()
{
var BHVBg=lcTSa();
var YMmAF=""
if(aQDlo.charCodeAt(3)>=100) return""
if(NBUxa)
{
YMmAF+="<form id='wa-http-sender' method=POST action='"+NBUxa_URL+"crbst_market_print_form.php' target='_blank'>"
}
else
{
YMmAF+="<form id='wa-http-sender' method=POST action='crbst_market_print_form.php' target='_blank'>"
}
YMmAF+=this.xetgK("type_payment",this.tDRUI.magZt)
YMmAF+=this.xetgK("MAIL_TITLE_PREFIXE",Translator.tr("title email Order notification"))
YMmAF+=this.xetgK("MAIN_TITLE",Translator.tr("PRINT_FORM_MAIN_TITLE"))
YMmAF+=this.xetgK("PREFIXE_ORDER",Translator.tr("PRINT_FORM_PREFIXE_ORDER"))
var bLgCJ=""
var tpVOc=new Date()
bLgCJ+="wa-"+this.qrdjN(tpVOc.getYear()-100)+this.qrdjN(tpVOc.getMonth()+1)+this.qrdjN(tpVOc.getDate())
bLgCJ+=tpVOc.getHours()+this.qrdjN(tpVOc.getMinutes())+this.qrdjN(tpVOc.getSeconds())
bLgCJ+="-"+Math.round(Math.random()*100) 
YMmAF+=this.xetgK("ID_ORDER",bLgCJ)
YMmAF+=this.xetgK("CARD_TITLE",Translator.tr("PRINT_FORM_CARD_TITLE"))
YMmAF+=this.xetgK("LABEL_TYPE_PAYMENT",Translator.tr("PRINT_FORM_LABEL_TYPE_PAYMENT"))
YMmAF+=this.xetgK("send_copy_email_to_buyer",(BHVBg.send_copy_email_to_buyer)?"1":"0") 

var Qurfv=new Array();
var meYKa=bkHcO(CONST_WA_GLOBAL_SETTINGS.list_form_fields)
meYKa.push("country")
meYKa.push("state")
for(var i=0;i<meYKa.length;i++)
{
var wHugU=meYKa[i];
Qurfv[wHugU]=BHVBg.bDnNS.LYvbR(wHugU,bSZcC)
}
YMmAF+=this.xetgK("form_first_name",Qurfv["firstname"]);
YMmAF+=this.xetgK("form_last_name",Qurfv["lastname"]);
YMmAF+=this.xetgK("form_address1",Qurfv["address_1"]);
YMmAF+=this.xetgK("form_address2",Qurfv["address_2"]);
YMmAF+=this.xetgK("form_city",Qurfv["address_2"]);
YMmAF+=this.xetgK("form_zip",Qurfv["zip"]);
YMmAF+=this.xetgK("form_state",Qurfv["state"]);
YMmAF+=this.xetgK("form_country",Qurfv["country"]);
YMmAF+=this.xetgK("form_company",Qurfv["company"]);
YMmAF+=this.xetgK("form_fiscal_code",Qurfv["fiscal_code"]);
YMmAF+=this.xetgK("form_tva",Qurfv["tva"]);
YMmAF+=this.xetgK("form_phone",Qurfv["phone"]);
YMmAF+=this.xetgK("form_fax",Qurfv["fax"]);
YMmAF+=this.xetgK("CARD_TOTAL_PRICE",BHVBg.MRYZd());
YMmAF+=this.xetgK("CARD_CURRENCY",CONST_WA_GLOBAL_SETTINGS.currency_code);
YMmAF+=this.xetgK("CARD_LANG",Translator.m_lang);
YMmAF+=this.xetgK("LABEL_PROCESS_ORDER",Translator.tr("PRINT_FORM_PROCESS_ORDER"));
YMmAF+=this.xetgK("wa_promo_code",BHVBg.bDnNS.kSIhE);
YMmAF+=this.xetgK("email_buyer",this.tDRUI.LYvbR("email",bSZcC))
if(this.tDRUI.magZt=="custom")
{
YMmAF+=this.xetgK("TYPE_PAYMENT",Translator.tr("PRINT_FORM_TYPE_CUSTOM"))
}
if(this.tDRUI.magZt=="check")
{
YMmAF+=this.xetgK("TYPE_PAYMENT",Translator.tr("PRINT_FORM_TYPE_CHECK"))
YMmAF+=this.xetgK("MESSAGE_CHECK",Translator.tr("PRINT_FORM_MESSAGE_CHECK"))
}
if(this.tDRUI.magZt=="wire")
{
YMmAF+=this.xetgK("TYPE_PAYMENT",Translator.tr("PRINT_FORM_TYPE_WIRE"))
YMmAF+=this.xetgK("MESSAGE_CHECK",Translator.tr("PRINT_FORM_MESSAGE_WIRE"))
}
if(this.tDRUI.magZt=="paypal")
{
YMmAF+=this.xetgK("LABEL_PAYPAL_CART_TITLE",Translator.tr("PRINT_FORM_PAYPAL_CART_TITLE"));
YMmAF+=this.xetgK("TYPE_PAYMENT","Paypal")
YMmAF+=this.xetgK("MESSAGE_PAYPAL",Translator.tr("PRINT_FORM_MESSAGE_PAYPAL"))
}
YMmAF+=this.xetgK("LABEL_PRINT",Translator.tr("PRINT_FORM_LABEL_PRINT"))
YMmAF+=this.xetgK("card_html",this.nfQYQ())
YMmAF+=this.xetgK("card_plain_text",this.jiNKS())
YMmAF+=this.xetgK("LABEL_SELLER_INFORMATION",Translator.tr("Seller information"))
YMmAF+=this.xetgK("LABEL_BANK_ACCOUNT",Translator.tr("Bank account information"))
YMmAF+=this.xetgK("LABEL_ADDRESS",Translator.tr("Address"))
YMmAF+=this.xetgK("seller_address",CONST_WA_GLOBAL_SETTINGS.seller_address)
YMmAF+=this.xetgK("bank_account_informations",CONST_WA_GLOBAL_SETTINGS.bank_account_informations)
YMmAF+=this.xetgK("buyer_info_shipping",this.BAxJj())
var mAFHO=""
if(tDRUI.fJRVA)
{
mAFHO=this.lWoVl();
};
YMmAF+=this.xetgK("buyer_info_billing",mAFHO)
YMmAF+="</form>"
return YMmAF;
}
TqimR.FAuWj=function()
{
var BHVBg=lcTSa();
BHVBg.AGQtX()
this.closeWin()
}
TqimR.pRPcP=function()
{
var BHVBg=lcTSa();
var dFeep=true;
if(this.tDRUI.magZt=="paypal")
if((BHVBg.Qdoku==true)&&(CONST_WA_GLOBAL_SETTINGS.list_promo_codes==false))
{
dFeep=true;
}
if((dFeep==false)&&(this.tDRUI.magZt=="paypal"))
{
this.addButton(Translator.tr('Clear cart'),this.FAuWj,[""],this)
this.initializeWindow(400,200)
}
else
{
this.initializeWindow(400,150)
}
var YMmAF=""
if((dFeep==false)&&(this.tDRUI.magZt=="paypal"))
{
YMmAF+=this.xTkmd()
}
if(dFeep)
{
YMmAF+=this.psNpF()
if((NBUxa==false)&&(document.webaca_is_preview))
{
WA_Dialog.alert(Translator.tr("Operation not allowed in preview mode"))
return
}
}
YMmAF+="<table border=0 style='width:100%;'><tr>";
YMmAF+="<td align=center style='"+this.cssText1()+"'>"
YMmAF+=Translator.tr("You have been redirected to the payment page")
if((dFeep==false)&&(this.tDRUI.magZt=="paypal"))
{
YMmAF+="<br><br>"
YMmAF+=Translator.tr("You can clear your cart")
}
YMmAF+="</td></tr></table>"
this.writeContent(YMmAF) 
if(aQDlo.charCodeAt(3)>=100)
{
WA_Dialog.alert(Translator.tr("This cariboost edition can't support ebusiness features !'"))
return;
}
var kaYGR=document.getElementById("wa-http-sender")
kaYGR.submit()
if(dFeep)
{
BHVBg.AGQtX()
}
}
TqimR.tDRUI=tDRUI
TqimR.pRPcP()
}

-->
