<!--

var lDSCY=0;
var aFUhi=1;
var WkFvM=2;
var EpqCp=0;
var gtRpJ=1;
var pGwWj=2;
var wbjDC=0;
var BDkwu=1;
var XApaL=false;
var jxgCe=[["Alabama","AL"],["Alaska","AL"],["Arizona","AZ"],["Arkansas","AR"],["California","CA"],["Colorado","CO"],["Connecticut","CT"],["District of columbia","DC"],["Delaware","DE"],["Florida","FL"],["Georgia","GA"],["Hawaii","HI"],["Idaho","ID"],["Illinois","IL"],["Indiana","IN"],["Iowa","IA"],["Kansas","KS"],["Kentucky","KY"],["Louisiana","LA"],["Maine","ME"],["Maryland","MD"],["Massachusetts","MA"],["Michigan","MI"],["Minnesota","MN"],["Mississippi","MS"],["Missouri","MO"],["Montana","MT"],["Nebraska","NE"],["Nevada","NV"],["New Hampshire","NH"],["New Jersey","NJ"],["New Mexico","NM"],["New York","NY"],["North Carolina","NC"],["North Dakota","ND"],["Ohio","OH"],["Oklahoma","OK"],["Oregon","OR"],["Pennsylvania","PA"],["Rhode Island","RI"],["South Carolina","SC"],["South Dakota","SD"],["Tennessee","TN"],["Texas","TX"],["Utah","UT"],["Vermont","VT"],["Virginia","VA"],["Washington","WA"],["West Virginia","WV"],["Wisconsin","WI"],["Wyoming","WY"]];
var FNYGG=[["Alberta","AL"],["British Columbia","BC"],["Manitoba","MB"],["New Brunswick","NB"],["Newfoundland and Labrador","NF"],["Northwest Territories","NT"],["Nova Scotia","NS"],["Nunavut","NU"],["Ontario","ON"],["Prince Edward Isl.","PE"],["Quebec","QC"],["Saskatchewan","SK"],["Yukon Territory","YU"]];
var bjwhA=[["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 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(nEqSM)
{
fQTiU().USQLc(nEqSM)
var bJlol=WA_Dialog.getCurrent();
bJlol.dtiNI()
}
function fQTiU()
{
if(document.wa_global_settings_market==undefined)document.wa_global_settings_market=new XAKbv()
return document.wa_global_settings_market;
}
function wKRNb()
{
this.msMiU=function()
{
return this.QetdV+"-"+this.Gerqq_index
}
this.etpRo=function(HAWod,OdLHT)
{
var joPkJ="crbst_market_";
this.Gerqq=HAWod.obj.market.info.folder.substring(joPkJ.length);
this.Gerqq_index=HAWod.obj.index;
this.Gerqq_modif=HAWod.obj.market.info.critical_id_modif
this.QetdV=HAWod.obj.market.info.folder
this.GfoqX=1;
this.kjVmq=HAWod.title;
this.qdhAR=HAWod.price;
this.wxntT=HAWod.weight;
this.PJuCa=HAWod.code_product;
}
this.NwFnH=function(HAWod,OdLHT)
{
this.kjVmq=HAWod.title;
this.qdhAR=HAWod.price;
this.wxntT=HAWod.weight;
this.PJuCa=HAWod.code_product;
}
this.wkNOi=function()
{
var s="";
s+=this.msMiU();
if(this.m_opt_vals)
for(var i=0;i<this.m_opt_vals.length;i++)
{
var qWHwG=this.m_opt_vals[i]
if(qWHwG!=-1) s+="/"+qWHwG;
}
return s;
}
this.DOwoV=function()
{
var val="";
val+="j="+this.Gerqq+",";
val+="i="+this.Gerqq_index+",";
val+="m="+this.Gerqq_modif+",";
val+="q="+this.GfoqX+",";
if(this.m_opt_vals)
{
for(var i=0;i<this.m_opt_vals.length;i++)
{
val+="o"+i+"=";
var oZJtj=this.m_opt_vals[i]
if(oZJtj>-1)
val+=oZJtj
else
val+=""
val+=","
}
}
return val;
}
this.HgCJo=function(map,k)
{
var v=map[k];
if(v=="undefined") return "";
return v;
}
this.RZXSY=function(map)
{
this.Gerqq=this.HgCJo(map,"j");
if(this.Gerqq=="") return false;
this.Gerqq_index=this.HgCJo(map,"i");
this.Gerqq_modif=this.HgCJo(map,"m");
this.GfoqX=parseInt(map["q"]);
this.m_opt_vals=new Array();
for(var i=0;i<3;i++)
{
var LwcJD_val=parseInt(map["o"+i]);
if(isNaN(LwcJD_val))LwcJD_val=-1;
this.m_opt_vals.push(LwcJD_val);
}
return true;
}
this.NucIb=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.nrjXf=function(Pnlac)
{
var YTiqa=this.NucIb(Pnlac);
return this.RZXSY(YTiqa);
}
this.RbEPv=function()
{
return gllvc(this.HAWod,this.m_opt_vals);
}
}
function AMfEd(jMxKf)
{
var Pnlac="";
if(jMxKf=="custom")
{
jMxKf="credit_card";
}
if(jMxKf.indexOf("custom_script_")>-1)
{
var s_custom=jMxKf;
s_custom=s_custom.replace(/custom_script_/g,"");
var EoJZx=wa_evaluate(s_custom);
var IdSaW=CONST_WA_GLOBAL_SETTINGS.custom_script_labels[EoJZx];
var YBlTK="label_market_type_payment_"+IdSaW;
var esecD=Translator.tr(YBlTK);
if((esecD!=YBlTK)&&(esecD!="@"+YBlTK))
{
Pnlac=""+esecD;
}
else
{
Pnlac=""+IdSaW;
}
}
else
{
Pnlac="label_market_type_payment_"+jMxKf;
var esecD=Translator.tr(Pnlac);
if(Pnlac!=esecD)
{
Pnlac=esecD;
}
}
return Pnlac;
}
function GNaTt(aVKhA,DxVcZ)
{
var tNlqD=aVKhA[0];
var TAGPt=aVKhA[1];
var UqKso=aVKhA[2];
if(tNlqD.length==0)
{
UqKso.call(TAGPt);
return;
}
var js=tNlqD.pop();
WA_loadScript(js.src,GNaTt,[tNlqD,TAGPt,UqKso]);
}
function WA_arrayContains(HJAuM,Pnlac)
{
for(var n=0;n<HJAuM.length;n++){if(HJAuM[n]==Pnlac)return true;};
return false;
}
function onwDh(HJAuM)
{
var YTiqa=new Array();
for(var n=0;n<HJAuM.length;n++)
{
var Soonp=HJAuM[n];
if(Soonp=="address") YTiqa=YTiqa.concat(["address_1","address_2","city","zip"]);
else YTiqa.push(Soonp);
}
return YTiqa;
}
function ZBZLQ()
{
this.Zitox=function()
{
if(this.SxSvM.length==0)return CONST_WA_GLOBAL_SETTINGS.default_selected_country;
return this.SxSvM;
}
this.RYdID=function()
{
this.mAqcd();
}
this.NucIb=function(s)
{
var jiALf=new Array();
var tab=s.split(",");
for(var i=0;i<tab.length;i++)
{
var tab3=tab[i].split("=");
if(tab3.length==2)jiALf[tab3[0]]=tab3[1];
}
return jiALf;
}
this.meNqf=function(HkUiG)
{
if(HkUiG==undefined) return ""
return(HkUiG==wbjDC)?"deliv-":"bill-"
}
this.YGBaP=function(TuQhL,HkUiG,abxIv)
{
if(!abxIv)abxIv=""
var EBHVU=this.meNqf(HkUiG)
if(TuQhL=="country")
{
if(HkUiG==wbjDC) return this.SxSvM
if(HkUiG==BDkwu) TuQhL="countryCode"
}
if(TuQhL=="state")
{
TuQhL="stateCode"
}
var qWHwG=this.EXGKW[EBHVU+TuQhL]
if(!qWHwG) return abxIv
qWHwG=qWHwG.replace(/\"/g,"'")
return qWHwG
}
this.SWGuA=function(qWHwG)
{
if(qWHwG==undefined)return ""
return qWHwG
}
this.LWeUX=function(key,val)
{
if((val==null)||(val==undefined)) val="";
WA_SetCookie("crbst-card-"+key,val)
}
this.mpftN=function(key)
{
var TAGPt=WA_GetCookie("crbst-card-"+key)
if(TAGPt=="null")TAGPt="";
return ""+TAGPt
}
this.iRTxx=function()
{
this.EXGKW=new Array()
var Pnlac=this.mpftN("order-infos")
var YTiqa=this.NucIb(Pnlac)
for(var k1 in YTiqa)
{
var qWHwG=YTiqa[k1]
if((k1.indexOf("deliv-")==0)||(k1.indexOf("bill-")==0))
this.EXGKW[k1]=unescape(qWHwG)
}
this.SxSvM=this.SWGuA(YTiqa["countryCode"])
if(this.qIUpW.length==0)
{
this.qIUpW=this.SWGuA(YTiqa["typePayment"])
}
this.fsFkD=(this.SWGuA(YTiqa["differentBillingAddressChecked"])=="true")
this.mtYeF=(this.SWGuA(YTiqa["salesConditionChecked"])=="true")
}
this.mAqcd=function()
{
var Pnlac=""
for(var k1 in this.EXGKW)
{
var qWHwG=this.EXGKW[k1]
Pnlac+=k1+"="+escape(qWHwG)+","
}
var esecD=""
esecD+="countryCode="+escape(this.SxSvM)+","
esecD+="typePayment="+escape(this.qIUpW)+","
esecD+="differentBillingAddressChecked="+(this.fsFkD)+","
esecD+="salesConditionChecked="+(this.mtYeF)+","
Pnlac+=esecD 
this.LWeUX("order-infos",Pnlac)
}
this.ormwO=function(tYSZH)
{
if(trimString(tYSZH.value).length==0)
{
tYSZH.style.backgroundColor="#ff0000"
tYSZH.focus()
return false;;
}
tYSZH.style.backgroundColor=""
return true;
}
this.KIueS=function(HkUiG)
{
var WbDIH=onwDh(CONST_WA_GLOBAL_SETTINGS.list_form_fields)
var WAxpv=onwDh(CONST_WA_GLOBAL_SETTINGS.list_mandatory_form_fields) 
var vQVtc=this.EXGKW;
var EBHVU=this.meNqf(HkUiG) 
var UhCaV=document.getElementById("wa-market-form")
for(var n=0;n<WbDIH.length;n++)
{
var TDjOT=WbDIH[n]
var OpxxQ=UhCaV[TDjOT]
if(OpxxQ!=undefined)
{
var qWHwG=trimString(OpxxQ.value)
if(TDjOT!="address_2")
if(WA_arrayContains(WAxpv,TDjOT))
{
if(this.ormwO(OpxxQ)==false)return false;
}
vQVtc[EBHVU+TDjOT]=qWHwG
}
}
var ceSMb=document.getElementById("wa-select-state");
var OuqRe=document.getElementById("wa-market-state");
if(ceSMb&&(OuqRe.style.display!="none"))
{
if(this.ormwO(ceSMb)==false)return false;
vQVtc[EBHVU+"stateCode"]=ceSMb.value
}
else
{
vQVtc[EBHVU+"stateCode"]=""
}
if(HkUiG==BDkwu)
{
var diQxu=document.getElementById("wa-select-form-country");
if(diQxu)
{
vQVtc[EBHVU+"countryCode"]=diQxu.value
}
}
this.mAqcd()
return true;
}
this.dadhC=""
this.SxSvM=""
this.qIUpW=""
this.fsFkD=false;
this.mtYeF=false
this.iRTxx()
}
function XAKbv()
{
this.KNAbs=new Array();
this.TAGPt_callback=false;
this.SrMwG=false;
this.wZTDg=false;
this.TeGxh=new ZBZLQ()
this.YWlSR=CONST_WA_GLOBAL_SETTINGS.use_native_paypal_cart;
this.NSqpa=function(TAGPt,UqKso)
{
this.TAGPt_callback=TAGPt;
this.SrMwG=UqKso;
var oFTVM=this.mpftN("data");
this.WtxRf(oFTVM);
var tNlqD=new Array();
var HJAuM=this.KNAbs;
for(var i=0;i<HJAuM.length;i++)
{
var XuHVs=HJAuM[i];
var uFYZD=Translator.m_lang_for_filename;
if(uFYZD.length>0)uFYZD="_"+uFYZD;
var DHHoI=XuHVs.Gerqq;
var n=DHHoI.indexOf("_");
if(n>-1)DHHoI=DHHoI.substring(n+1);
var eDawU="wa-id-"+DHHoI;
XuHVs.tweLV="wa-id-"+DHHoI;
var QetdV="crbst_market_"+XuHVs.Gerqq;
XuHVs.QetdV=QetdV;
var kWcbt=wa_global_market.markets[QetdV];
if(this.wZTDg==false)
if(!kWcbt)
{
WA_declareMarket(eDawU,QetdV,XuHVs.Gerqq_modif);
var CEgAf=QetdV+"/"+'market-definition'+uFYZD+'.js?v='+XuHVs.Gerqq_modif;
tNlqD.push({id:DHHoI,src:CEgAf});
}
}
GNaTt([tNlqD,this,this.DLDnH],true);
}
this.jCdnP=function()
{
this.LWeUX("data","")
this.TeGxh.LWeUX("order-infos","")
this.TeGxh.iRTxx()
this.WtxRf("")
}
this.DLDnH=function()
{
this.wZTDg=true;
var HJAuM=this.KNAbs;
var CwOVZ=new Array();
for(var i=0;i<HJAuM.length;i++)
{
var XuHVs=HJAuM[i];
var RDinB=wa_global_market.markets[XuHVs.QetdV]
if(RDinB.info)
{
var sKlja=RDinB.info.products 
var OdLHT=XuHVs.Gerqq_index
var HAWod=sKlja[OdLHT]
XuHVs.HAWod=HAWod
XuHVs.NwFnH(XuHVs.HAWod,OdLHT)
if((HAWod.unavail==false)&&(XuHVs.Gerqq_modif==RDinB.info.critical_id_modif))
{
CwOVZ.push(XuHVs)
}
}
else
{
}
}
this.KNAbs=CwOVZ
this.Wsqfb() 
this.SrMwG.call(this.TAGPt_callback)
}
this.WtxRf=function(aDAGb)
{
var HJAuM=new Array();
var list_string_products=aDAGb.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 XuHVs=new wKRNb();
if(XuHVs.nrjXf(s_data))
{
HJAuM.push(XuHVs);
}
}
}
this.KNAbs=HJAuM;
var DxXec=this.vaCjg()
if(WA_getNumberMarketItemsInCart()!=DxXec)
{
this.eaNAo()
this.olDdc()
}
}
this.geWut=function()
{
var Urtmg=''
try{Urtmg=CONST_WA_GLOBAL_SETTINGS.currency_mnemonic}catch(e){}
return Urtmg
}
this.USQLc=function(nEqSM)
{
var list2=new Array();
var HJAuM=this.KNAbs
for(var i=0;i<HJAuM.length;i++)
{
var XuHVs=HJAuM[i];
if(i!=nEqSM)
{
list2.push(XuHVs);
}
}
this.KNAbs=list2;
this.Wsqfb()
}
this.addProductToShoppingCard=function(HAWod,optionsValues)
{
if(this.Sfkgh()==false)
{
WA_Dialog.alert(Translator.tr("You can't use shopping card Your browser doesnt accept cookies !"));
return false;
}
var uKiGH=HAWod.obj
var HJAuM=this.ewqqL();
var n=HJAuM.length
var QmZvR=new wKRNb()
QmZvR.etpRo(HAWod,n);
QmZvR.m_opt_vals=optionsValues
var b_match=false;
for(var i=0;i<HJAuM.length;i++)
{
var XuHVs=HJAuM[i];
if(XuHVs.wkNOi()==QmZvR.wkNOi())
{
b_match=true;
XuHVs.GfoqX++;
}
}
if(b_match==false)
{
var oFTVM=this.mpftN("data")
var YkqcN=QmZvR.DOwoV()
var jJIXf=oFTVM.length+YkqcN.length 
if(jJIXf>4000)
{
WA_Dialog.alert(Translator.tr("Cookies cart contains max data !"));
return false;
}
HJAuM.push(QmZvR);
}
return true
}
this.gAqsl=function()
{
var HJAuM=this.KNAbs
var oFTVM="";
for(var i=0;i<HJAuM.length;i++)
{
var info=HJAuM[i];
oFTVM+=info.DOwoV()+";";
}
return oFTVM;
}
this.vaCjg=function()
{
var OWxHG=0;
var HJAuM=this.KNAbs;
for(var i=0;i<HJAuM.length;i++)
{
var XuHVs=HJAuM[i];
OWxHG+=XuHVs.GfoqX
}
return OWxHG;
}
this.eaNAo=function()
{
this.LWeUX("nb_items",this.vaCjg())
}
this.Wsqfb=function()
{
var HJAuM=this.KNAbs
var oFTVM=this.gAqsl()
this.LWeUX("data",oFTVM)
this.eaNAo()
this.olDdc();
}
this.olDdc=function()
{
WA_refreshNumberMarketItemsInCart()
}
this.ewqqL=function()
{
return this.KNAbs;
}
this.Sfkgh=function()
{
this.LWeUX("watestcookies","test")
return(this.mpftN("watestcookies")=="test");
}
this.LWeUX=function(key,val)
{
if((val==null)||(val==undefined)) val="";
WA_SetCookie("crbst-card-"+key,val)
}
this.mpftN=function(key)
{
var TAGPt=WA_GetCookie("crbst-card-"+key)
if(TAGPt=="null")TAGPt="";
return ""+TAGPt
}
this.vJjpi=function(v)
{
return WA_formatPrice(v)
}
this.nwEcw=function(v)
{
return WA_basicFormatPrice(v)+" "+CONST_WA_GLOBAL_SETTINGS.currency_code;
}
this.ecWrL=function(KuYZe)
{
return Math.round(KuYZe*100)/100
}
this.vUeLi=function()
{
var KuYZe=this.UlHXc()
var umAFv=0;
var HJAuM=CONST_WA_GLOBAL_SETTINGS.list_promo_codes
for(var i=0;i<HJAuM.length;i++)
{
var jIurf=HJAuM[i];
if(MD5(trimString(this.TeGxh.dadhC.toUpperCase()))==jIurf.c)
{
var sFnBj=0;
if(jIurf.v.indexOf("%")>-1)
{
var umAFv=parseFloat(jIurf.v)/100;
sFnBj=KuYZe*umAFv;
}
else
{
sFnBj=parseFloat(jIurf.v);
}
sFnBj=Math.min(KuYZe,sFnBj)
return sFnBj;;
}
}
return 0;
}
this.awGEn=function(dOZQk)
{
var PqvIT=0;
var IdRRr=CONST_WA_GLOBAL_SETTINGS.shipping_type
if(IdRRr==lDSCY)return PqvIT;
var Hpjep=CONST_WA_GLOBAL_SETTINGS.shipping_intervals
for(var i=0;i<Hpjep.length;i++)
{
var oGlLY=Hpjep[i];
if(oGlLY.v<dOZQk)PqvIT=oGlLY.p
}
return PqvIT;
}
this.ZXIek=function(KPtGj,dOZQk)
{
var YTiqa=CONST_WA_GLOBAL_SETTINGS.jiALf_list_extra_shipping_by_country_code
if(YTiqa==undefined)
{
YTiqa=new Array()
CONST_WA_GLOBAL_SETTINGS.jiALf_list_extra_shipping_by_country_code=YTiqa;
var GqPND=CONST_WA_GLOBAL_SETTINGS.list_extra_shipping_by_country_code
for(var nEqSM in GqPND)
{
var IVejg=GqPND[nEqSM];
var WBRJB=IVejg.c
for(var TUMoI in WBRJB)
{
var Skhji=WBRJB[TUMoI];YTiqa[Skhji]=IVejg.p;
}
}
}
var Hpjep=YTiqa[KPtGj]
if(Hpjep==undefined) return 0;
var extra_val=0;
for(var i=0;i<Hpjep.length;i++)
{
var oGlLY=Hpjep[i];
if(oGlLY.v<dOZQk)extra_val=oGlLY.p
}
if(isNaN(extra_val)) extra_val=0;
return extra_val;
}
this.HtbtB=function(KPtGj)
{
var YTiqa=CONST_WA_GLOBAL_SETTINGS.jiALf_list_tva_by_country_code
if(YTiqa==undefined)
{
YTiqa=new Array()
CONST_WA_GLOBAL_SETTINGS.jiALf_list_tva_by_country_code=YTiqa;
var GqPND=CONST_WA_GLOBAL_SETTINGS.list_tva_by_country_code
for(var nEqSM in GqPND)
{
var IVejg=GqPND[nEqSM];
var WBRJB=IVejg.c;
for(var TUMoI in WBRJB)
{
var Skhji=WBRJB[TUMoI];YTiqa[Skhji]=IVejg.p;
}
}
}
return YTiqa[KPtGj];
}
this.Hmqig=function()
{
var IdRRr=CONST_WA_GLOBAL_SETTINGS.shipping_type
var HJAuM=this.ewqqL()
var NehpG=0;
for(var i=0;i<HJAuM.length;i++)
{
var XuHVs=HJAuM[i];
if(IdRRr==WkFvM)
{
NehpG+=(XuHVs.GfoqX*XuHVs.wxntT);
}
else
{
NehpG+=(XuHVs.GfoqX*XuHVs.RbEPv());
}
}


var SxSvM=this.TeGxh.SxSvM;
var nELtw=0;
nELtw+=this.awGEn(NehpG);
nELtw+=this.ZXIek(SxSvM,NehpG);
return this.ecWrL(nELtw);
}
this.NtCVU=function()
{
return CONST_WA_GLOBAL_SETTINGS.tva_type==gtRpJ
}
this.EZYJR=function()
{
return CONST_WA_GLOBAL_SETTINGS.tva_type==pGwWj
}
this.gooLX=function()
{
return CONST_WA_GLOBAL_SETTINGS.tva_type==EpqCp
}
this.BFBcs=function()
{
if(this.gooLX())return 0;
var tax=0;
var country_code=this.TeGxh.SxSvM;
if(country_code.length>0)
{
tax=this.HtbtB(country_code);
if(isNaN(tax))tax=0;
}
return tax;
}
this.SsWNv=function(KuYZe)
{
if(this.NtCVU())
{
var n0=this.BFBcs()/100;
return KuYZe*(n0/(1+n0));
}
if(this.EZYJR())
{
return KuYZe*this.BFBcs()/100;
}
return KuYZe;
}
this.UlHXc=function()
{
var HJAuM=this.ewqqL()
var price=0;
for(var i=0;i<HJAuM.length;i++)
{
var XuHVs=HJAuM[i];
price+=(XuHVs.RbEPv()*XuHVs.GfoqX);
}
return price;
}
this.ePXiB=function()
{
if(this.gooLX())return 0;
var XnWKC=0;
var ZqOCL=0;
XnWKC+=this.UlHXc(),
XnWKC-=this.vUeLi();
XnWKC+=this.Hmqig();
ZqOCL=this.ecWrL(this.SsWNv(XnWKC));
return ZqOCL;
}
this.BrYLT=function()
{
var KuYZe=0;
KuYZe+=this.UlHXc()
if(this.EZYJR())KuYZe+=this.ePXiB()
KuYZe+=this.Hmqig()
KuYZe-=this.vUeLi()
return this.ecWrL(KuYZe);
}
}
function cSlNO(tHate,IFtoP)
{
if(tHate.lab<IFtoP.lab) return-1;
if(tHate.lab>IFtoP.lab) return 1;
return 0
}
function WA_marketWatchQuantity()
{
var bJlol=WA_Dialog.getCurrent()
bJlol.mAwQN()
}
function WA_displayDialogMarketCart()
{
var bJlol=new WA_Dialog();
bJlol.oShCl=false;
bJlol.PGlaR=function()
{
this.fJDxI()
this.oShCl=setInterval("WA_marketWatchQuantity()",400)
}
bJlol.fJDxI=function()
{
if(this.oShCl)clearInterval(this.oShCl)
}
bJlol.mAwQN=function()
{
var PbwrV=fQTiU();
var AQoHW=PbwrV.ewqqL();
for(var n=0;n<AQoHW.length;n++)
{
var XuHVs=AQoHW[n]
var ExnSS=document.getElementById("wa-cart-quantity-"+n)
var fTpYd=ExnSS.value
var qMRPk=parseInt(fTpYd)
if(isNaN(qMRPk))qMRPk=0;
if((fTpYd!='')&&(qMRPk+""!=fTpYd))
{
ExnSS.value=""+qMRPk
}
if(qMRPk!=XuHVs.GfoqX)
{
XuHVs.GfoqX=qMRPk
PbwrV.Wsqfb()
this.NQxEo()
}
}
var cMPdr=document.getElementById("wa-promo-code")
if(cMPdr)
{
if(cMPdr.value!=PbwrV.TeGxh.dadhC)
{
PbwrV.TeGxh.dadhC=cMPdr.value
this.NQxEo()
}
}
}
bJlol.onCustomKeypress=function(ZboZi)
{
if(ZboZi==13)
{
wa_timeout(Delegate.create(this,this.DosBl),0);
}
return false;
}
bJlol.closeWin=function()
{
this.fJDxI()
this.intern_closeWin()
}
bJlol.NQxEo=function()
{
var PbwrV=fQTiU();
var AQoHW=PbwrV.ewqqL();
if(AQoHW.length==0) return;
for(var n=0;n<AQoHW.length;n++)
{
var XuHVs=AQoHW[n]
var ffMMP=document.getElementById("wa-cart-total-"+n)
var KuYZe=XuHVs.RbEPv() 
var GEBNM=XuHVs.GfoqX*KuYZe
var Pnlac="<span style='"
Pnlac+=(GEBNM>0)?"color:"+WA_GLOBAL_COLOR_THEME.color_text+";font-weight:normal;":"color:#ff0000;font-weight:bold;"
Pnlac+="'>"
Pnlac+=PbwrV.vJjpi(GEBNM)
Pnlac+="</span>"
ffMMP.innerHTML=Pnlac
}
var SWXEg=PbwrV.UlHXc()
var lshNM=PbwrV.ePXiB()
var QCJpd=PbwrV.Hmqig()
var YRcIH=PbwrV.BrYLT()
var PFiHG=PbwrV.vUeLi()
var mxbda=""
var ffMMP=document.getElementById("wa-cart-amount-total")
mxbda+=Translator.tr("Sub total")+" : "+PbwrV.vJjpi(SWXEg)
mxbda+="<br>"
if(QCJpd>0)
{
mxbda+="<span>"+Translator.tr("Shipping amount")+" : "+PbwrV.vJjpi(QCJpd)+"</span>";
mxbda+="<br>"
}
if(PbwrV.NtCVU()||PbwrV.EZYJR())
{
if(PbwrV.NtCVU())
{
mxbda+="<div style='width:100%;text-align:left;'>"
mxbda+=Translator.tr("Tax included");
}
if(PbwrV.EZYJR())
{
mxbda+="<div>"
mxbda+=Translator.tr("Extra Tax");
}
mxbda+=" : ";
mxbda+=PbwrV.vJjpi(lshNM)+"</div>";
}
if(PFiHG>0)
{
mxbda+="<span>"+Translator.tr("Promotion")+" : - "+PbwrV.vJjpi(PFiHG)+"</span><br>";
}
mxbda+="<span><b>"+Translator.tr("Total")+" : "+PbwrV.vJjpi(YRcIH)+"</b></span>";
ffMMP.innerHTML=mxbda
}
bJlol.jpEZD=function()
{
WA_displayDialogMarketCart()
}
bJlol.fnbjT=function()
{
this.closeWin()
}
bJlol.DosBl=function()
{
var PbwrV=fQTiU();
if(WA_getNumberMarketItemsInCart()==0)return;
var lpnXj=document.getElementById("wa-market-select-country")
if(lpnXj)
{
PbwrV.TeGxh.SxSvM=lpnXj.value
}
if(PbwrV.TeGxh.SxSvM=="")
{
var lpnXj=document.getElementById("wa-market-select-country")
if(lpnXj)
{
lpnXj.focus()
lpnXj.style.backgroundColor="#ff0000"
return;
}
}
if(CONST_WA_GLOBAL_SETTINGS.link_sale_condition)
{
if(PbwrV.TeGxh.mtYeF!=true)
{
var LTbRw=document.getElementById("wa-sales-condition")
if(LTbRw)
{
LTbRw.focus()
var dKCiU=document.getElementById("wa-sales-condition-label")
dKCiU.style.backgroundColor="#ff0000"
return;
}
}
}
var Gkgma=CONST_WA_GLOBAL_SETTINGS.list_type_payment
if(Gkgma.length==1)
{
PbwrV.TeGxh.qIUpW=Gkgma[0]
}
var lpnXj=document.getElementById("wa-market-select-payment")
if(lpnXj)
{
PbwrV.TeGxh.qIUpW=lpnXj.value
if(PbwrV.TeGxh.qIUpW=="")
{
lpnXj.focus()
lpnXj.style.backgroundColor="#ff0000"
return;
}
}
oxZvU()
}
bJlol.dtiNI=function()
{
WA_exec_callback_opera_compliant(this,this.fYUkS)
}
bJlol.fYUkS=function()
{
var PbwrV=fQTiU();

var diQxu=document.getElementById("wa-market-select-country")
if(diQxu)
{
PbwrV.TeGxh.SxSvM=diQxu.value
}
PbwrV.TeGxh.RYdID()
var JFtVS=html_getLayer("market-cart-content")
var pFQsO=html_getLayer("wa-market-payment-form") 
var Pnlac=""
var AQoHW=PbwrV.ewqqL();
html_SetVisibility(pFQsO,(AQoHW.length>0))
if(AQoHW.length==0)
{
Pnlac+="<span style='font-family:Arial;font-size:16px;'>"
Pnlac+=Translator.tr("No articles in Card !")
Pnlac+="</span>"
}
else
{
var wTpJG="border:1px solid "+WA_GLOBAL_COLOR_THEME.color0+";font-weight:normal;"
var ToPuf=new RGBColor(WA_GLOBAL_COLOR_THEME.color0);
var xgoka=ToPuf.toHsl();
ToPuf.fromHsl(xgoka[0],xgoka[1],xgoka[2]+0.2)
var UCVde="border:1px solid "+WA_GLOBAL_COLOR_THEME.color0+";font-weight:normal;color:"+WA_GLOBAL_COLOR_THEME.color_text+";background-color:"+ToPuf.toRGB()+";"
var OukUL="border:1px solid "+WA_GLOBAL_COLOR_THEME.color0+";color:#ff0000;font-weight:bold;"
var hjaXe="color:#222222;font-size:12px;"
Pnlac+="<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+";'>"
Pnlac+="<thead style='font-size:13px;border:1px solid;'>"
Pnlac+="<tr>"
Pnlac+="<th  colspan=2 style='"+UCVde+"'></th>"
Pnlac+="<th style='"+UCVde+"'  width=70px><b>"+Translator.tr("Price")+"</b></th>"
Pnlac+="<th style='"+UCVde+"'  width=70px><b>"+Translator.tr("Quantity")+"</b></th>"
Pnlac+="<th style='"+UCVde+"'  width=70px><b>"+Translator.tr("Total")+"</b></th>"
Pnlac+="<th style='"+UCVde+"'  width=90px></th>"
Pnlac+="</tr>"
var wDxUV=new RGBColor(WA_GLOBAL_COLOR_THEME.color2);
var JZVPa=wDxUV.toHsl();
wDxUV.fromHsl(JZVPa[0],JZVPa[1],JZVPa[2]-0.1) 
for(var n=0;n<AQoHW.length;n++)
{
var UxnhG="";
if(n%2==0)
{
UxnhG="background-color:"+wDxUV.toRGB()+";"
}
var ftxfh=wTpJG+UxnhG;
var XuHVs=AQoHW[n]
Pnlac+="<tr>"
Pnlac+="<th style='"+ftxfh+"' >" 
var RDinB=wa_global_market.markets[XuHVs.QetdV]
var iaLNG=new Size(30,30)
var AcUMo=iaLNG
if(RDinB.info.design.crop_thumb==false)
{
AcUMo=XuHVs.HAWod.size_thumb.clone()
AcUMo.scale(iaLNG)
}
else
{
}
if(XuHVs.HAWod.img_thumb.length>0)
Pnlac+="<img border=0 src='"+XuHVs.HAWod.img_thumb+"' width="+AcUMo.width+"px height="+AcUMo.height+"px>"
Pnlac+="</th>" 
Pnlac+="<th style='"+ftxfh+"text-align:left;padding:5px;' >"
Pnlac+="<b>"+XuHVs.kjVmq+"</b>"
if(XuHVs.PJuCa.length>0)
{
Pnlac+="<span style='"+hjaXe+"'>";
Pnlac+=" ["+XuHVs.PJuCa+"]";
Pnlac+="</span>";
}
if(XuHVs.m_opt_vals)
{
Pnlac+="<br>"
Pnlac+="<span style='"+hjaXe+"'>";
for(var i_opt=0;i_opt<XuHVs.HAWod.options.length;i_opt++)
{
var LwcJD=XuHVs.HAWod.options[i_opt]
if(LwcJD)
{
var GVqZs=XuHVs.m_opt_vals[i_opt];
var JXfeO=LwcJD.title;
if(JXfeO.length>0)
{
Pnlac+=JXfeO;
Pnlac+=":"
}
Pnlac+=LwcJD.vals[GVqZs];
Pnlac+=" "
}
}
Pnlac+="</span>";
}
Pnlac+="</th>"
var KuYZe=XuHVs.RbEPv()
Pnlac+="<th style='"+ftxfh+"' >"+PbwrV.vJjpi(KuYZe)+"</th>"
Pnlac+="<th style='"+ftxfh+"'  align=center><input type=text id='wa-cart-quantity-"+n+"' style='width:45px;' maxlength=3 value='"+XuHVs.GfoqX+"' type=text/></th>"
Pnlac+="<th style='"
var GEBNM=XuHVs.GfoqX*KuYZe
Pnlac+=(GEBNM>0)?ftxfh:(OukUL+UxnhG);
Pnlac+="' ><span id='wa-cart-total-"+n+"'>"
Pnlac+=PbwrV.vJjpi(GEBNM)
Pnlac+="</span></th>"
Pnlac+="<th style='"+ftxfh+"' ><a href=\"javascript:WA_marketRemoveItem("+n+")\">"+Translator.tr("Remove card item")+"</a></th>"
Pnlac+="</tr>"
}
Pnlac+="<tr>"
Pnlac+="<th style='"+wTpJG+"text-align:right;padding:5px;' id='wa-cart-amount-total'  colspan=5>&nbsp;</th>"
Pnlac+="<th style='"+wTpJG+"' ></th>"
Pnlac+="</tr>"
Pnlac+="</thead>"
Pnlac+="</table>"
Pnlac+="<br>"
}
JFtVS.innerHTML=Pnlac
this.PGlaR()
WA_exec_callback_opera_compliant(this,this.NQxEo) 
}
bJlol.wXqXk=function()
{
var PbwrV=fQTiU();
this.addButton(Translator.tr("Continue Shopping"),this.fnbjT,[""],this)
this.addButton(Translator.tr("Checkout order"),this.DosBl,[""],this)
this.initializeWindow(670,700)
var mEHCj="font-family:Arial;font-size:12px;color:#000000;"
var Pnlac=""
Pnlac+="<div id='market-cart-content' style='width:100%;"+mEHCj+"' align=center>" 
Pnlac+="</div>"
Pnlac+="<br>"
Pnlac+="<div style='width:100%;"+mEHCj+"' align=center id='wa-market-payment-form'>" 
var vrFfm=CONST_WA_GLOBAL_SETTINGS.list_favorite_country
var HAVIS=CONST_WA_GLOBAL_SETTINGS.list_country
var LeStm=new Array()
for(var KAFNZ=0;KAFNZ<vrFfm.length;KAFNZ++)
{
LeStm[vrFfm[KAFNZ]]=true
}
for(var KAFNZ=0;KAFNZ<HAVIS.length;KAFNZ++)
{
LeStm[HAVIS[KAFNZ]]=true
}
var DOxvu=0;
var HbBqr=""
for(var c in LeStm)
{
DOxvu++;
HbBqr=c
}
if(DOxvu>1)
{
Pnlac+="<span style='font-weight:bold;'>"
Pnlac+=Translator.tr("Please choose a country to deliver your order")
Pnlac+="</span>"
Pnlac+="<br>"
Pnlac+="<select onchange=\"WA_marketChangeCountry(this)\" id='wa-market-select-country'>"
if(CONST_WA_GLOBAL_SETTINGS.default_selected_country.length==0)
{
Pnlac+="<option value=\"\">...</option>"
}
var uRGUT=new Array()
for(var KAFNZ=0;KAFNZ<vrFfm.length;KAFNZ++)
{
var RQwvu=vrFfm[KAFNZ]
uRGUT.push({code:RQwvu,lab:Translator.country(RQwvu)})
}
for(var KAFNZ=0;KAFNZ<uRGUT.length;KAFNZ++)
{
var TAGPt=uRGUT[KAFNZ]
var RQwvu=TAGPt.code
Pnlac+="<option "
if(PbwrV.TeGxh.Zitox()==RQwvu)Pnlac+="selected "
Pnlac+="value=\""+RQwvu+"\">"+Translator.country(RQwvu)+"</option>"
}
if((vrFfm.length>0)&&(HAVIS.length>0))
{
Pnlac+="<option value=\"\">-----</option>"
}
var Zvtnt=new Array()
for(var KAFNZ=0;KAFNZ<HAVIS.length;KAFNZ++)
{
var RQwvu=HAVIS[KAFNZ]
Zvtnt.push({code:RQwvu,lab:Translator.country(RQwvu)})
}
if((vrFfm.length==0)&&(HAVIS.length==0))
{
var HJAuM=CONST_WA_COUNTRIES.codes
for(var KAFNZ=0;KAFNZ<HJAuM.length;KAFNZ++)
{
var RQwvu=HJAuM[KAFNZ]
Zvtnt.push({code:RQwvu,lab:Translator.country(RQwvu)})
}
}
Zvtnt.sort(cSlNO)
for(var KAFNZ=0;KAFNZ<Zvtnt.length;KAFNZ++)
{
var TAGPt=Zvtnt[KAFNZ]
var RQwvu=TAGPt.code
Pnlac+="<option "
if(PbwrV.TeGxh.Zitox()==RQwvu)Pnlac+="selected "
Pnlac+="value=\""+RQwvu+"\">"+Translator.country(RQwvu)+"</option>"
}
Pnlac+="</select>"
Pnlac+="<br>"
Pnlac+="<br>"
}
var Gkgma=CONST_WA_GLOBAL_SETTINGS.list_type_payment
if(Gkgma.length>1)
{
Pnlac+="<span style='font-weight:bold;'>"
Pnlac+=Translator.tr("Choose a type of payment")
Pnlac+="</span>"
Pnlac+="<br>"
Pnlac+="<select onchange=\"WA_marketChangeTypePayment(this)\" id='wa-market-select-payment'>"
if((Gkgma.length>1)||(Gkgma.length==0))
{
Pnlac+="<option value=\"\">...</option>"
}
for(var KAFNZ=0;KAFNZ<Gkgma.length;KAFNZ++)
{
var qIUpW=Gkgma[KAFNZ]
Pnlac+="<option "
if(PbwrV.TeGxh.qIUpW==qIUpW)Pnlac+="selected " 
Pnlac+="value=\""+qIUpW+"\">"+AMfEd(qIUpW)+"</option>"
}
Pnlac+="</select>"
Pnlac+="<br>"
Pnlac+="<br>"
}
if(CONST_WA_GLOBAL_SETTINGS.list_promo_codes)
{
var HJAuM=CONST_WA_GLOBAL_SETTINGS.list_promo_codes
Pnlac+="<span id='wa-promo-code-label'  style='font-weight:bold;'>"
Pnlac+=Translator.tr("form-label-code_promo")
Pnlac+="</span><br>"
Pnlac+="<input id='wa-promo-code' onchange=\"WA_marketChangePromoCode(this)\" " 
Pnlac+=" value='"+PbwrV.TeGxh.dadhC+"' "
Pnlac+="/>"
Pnlac+="<br>"
Pnlac+="<br>"
}
if(CONST_WA_GLOBAL_SETTINGS.link_sale_condition)
{
Pnlac+="<a "+WA_LinkToHref(CONST_WA_GLOBAL_SETTINGS.link_sale_condition)+" style='color:#0000ff'>"
Pnlac+=Translator.tr("Terms of sell")
Pnlac+="</a>"
Pnlac+="<br>" 
Pnlac+="<span id='wa-sales-condition-label'  style='font-weight:bold;'>"
Pnlac+=Translator.tr("label_market_accept_terms")
Pnlac+="</span>"
Pnlac+="<input id='wa-sales-condition' onchange=\"WA_marketChangeSalesCondition(this)\" "
Pnlac+=(PbwrV.TeGxh.mtYeF)?"checked ":""
Pnlac+="type='checkbox' value='1'/>" 
Pnlac+="<br>"
Pnlac+="<br>" 
}
if((DOxvu==1)||(Gkgma.length==1))
{
Pnlac+="<hr width=80%>"
Pnlac+="<br>"
if(DOxvu==1)
{
PbwrV.TeGxh.SxSvM=HbBqr
Pnlac+="<span style='font-weight:bold;'>"
Pnlac+=Translator.tr("form-label-country")+" : "+Translator.country(PbwrV.TeGxh.SxSvM)
Pnlac+="</span>"
Pnlac+="<br>"
Pnlac+="<br>"
}
if(Gkgma.length==1)
{
var qIUpW=Gkgma[0]
Pnlac+="<span style='font-weight:bold;'>"
Pnlac+=Translator.tr("PRINT_FORM_LABEL_TYPE_PAYMENT")+" : "+AMfEd(qIUpW)
Pnlac+="</span>"
Pnlac+="<br>"
Pnlac+="<br>"
}
}
Pnlac+="</div>"
this.writeContent(Pnlac)
var JFtVS=html_getLayer("market-cart-content")
JFtVS.innerHTML="<div width=100% align=center><img src='wa_loading.gif'></div>" 

PbwrV.NSqpa(this,this.dtiNI)
}
bJlol.wXqXk() 
}
function WA_marketChangeCountry(lpnXj)
{
lpnXj.style.backgroundColor=""
var bJlol=WA_Dialog.getCurrent()
bJlol.dtiNI()
}
function WA_marketChangeTypePayment(lpnXj)
{
var PbwrV=fQTiU();
PbwrV.TeGxh.qIUpW=lpnXj.value
PbwrV.TeGxh.RYdID()
lpnXj.style.backgroundColor=""
}
function WA_marketChangeSalesCondition(tYSZH)
{
var PbwrV=fQTiU();
PbwrV.TeGxh.mtYeF=tYSZH.checked
PbwrV.TeGxh.RYdID() 
var dKCiU=document.getElementById("wa-sales-condition-label")
dKCiU.style.backgroundColor="" 
}
function WA_marketChangePromoCode(tYSZH)
{
var PbwrV=fQTiU();
PbwrV.TeGxh.dadhC=tYSZH.value
PbwrV.TeGxh.RYdID() 


}
function WA_LinkToHref(IEcAg)
{
var Pnlac=""
var iGuAq=IEcAg.url
var CfHwn=Translator.m_lang_for_filename
if(CfHwn.length>0)CfHwn="_"+CfHwn
iGuAq=iGuAq.replace(/@lng@/g,CfHwn)
Pnlac+="href=\""+iGuAq+"\" "
if(IEcAg.open==1)
{
Pnlac+="target="
Pnlac+="_blank"
}
return Pnlac;
}
function WA_displayDialogMarketProduct(DHHoI,nEqSM)
{
var kWcbt=wa_global_market.markets[DHHoI]
var LVONK=kWcbt.obj
var sKlja=LVONK.info.products
var HAWod=sKlja[nEqSM] 

var bJlol=new WA_Dialog();

bJlol.HAWod=HAWod
bJlol.BIdVV=DHHoI
bJlol.jpEZD=function()
{
WA_displayDialogMarketCart()
}
bJlol.hsbeo=function()
{
var PbwrV=fQTiU();
PbwrV.NSqpa(this,this.aUaBj) 
}
bJlol.aUaBj=function()
{
var HAWod=this.HAWod;
var PbwrV=fQTiU();
var pnXpK=new Array();
var giXhg=HAWod.obj.id;
for(var i=0;i<3;i++)
{
var ZRUtI=-1;
var EBHVU=giXhg+"-select-opt"
var lpnXj=document.getElementById(EBHVU+i)
if(lpnXj)
{
if(lpnXj.value.length==0)
{
lpnXj.style.backgroundColor="#ff0000";
lpnXj.focus()
return;
}
ZRUtI=parseInt(lpnXj.value)
}
pnXpK.push(ZRUtI)
}
if(PbwrV.addProductToShoppingCard(HAWod,pnXpK))
{
PbwrV.Wsqfb()
WA_displayDialogMarketCart()
}
}
bJlol.wXqXk=function()
{
var DHHoI=this.BIdVV
var HAWod=this.HAWod
var Pnlac=""
this.addButton(Translator.tr("Go to my card"),this.jpEZD,[""],this)
if(HAWod.unavail==false)
{
this.addButton(Translator.tr("Add to card"),this.hsbeo,[""],this)
}
this.initializeWindow(670,this.idealHeight())
Pnlac+="<table border=0 width=100% cellpadding=4>"
Pnlac+="<tr>" 
if(HAWod.img_big.length>0)
{
Pnlac+="<td width='100px' align=center valign=top>"
var AcUMo=HAWod.size_thumb.clone() 
AcUMo.scale(new Size(200,200))
Pnlac+="<a href=\""+HAWod.img_big+"\" target=_blank>"
Pnlac+="<img border=0 src=\""+HAWod.img_big+"\" width='"+AcUMo.width+"px' height='"+AcUMo.height+"px'>"
Pnlac+="</a>"
Pnlac+="</td>"
}
var waslm="color:"+WA_GLOBAL_COLOR_THEME.color_text+";";
Pnlac+="<td valign=top style='font-family:Arial;'>"
Pnlac+="<span style='font-weight:bold;font-size:16px;"+waslm+"'>"
Pnlac+=HAWod.title
Pnlac+="</span>"
Pnlac+="<br>"
if(HAWod.sub_title.length>0)
{
Pnlac+="<span style='color:#333333;font-size:14px;'>"
Pnlac+=HAWod.sub_title
Pnlac+="</span>"
Pnlac+="<br>"
}
Pnlac+="<br>"
Pnlac+="<table border=0 width=100% cellspacing=0 cellpadding=0><tr><td>"
Pnlac+="<span style='"+waslm+";font-size:14px;'>"
Pnlac+=Translator.tr("Price")+" : "
Pnlac+="</span>"
Pnlac+="<span style='"+waslm+";font-size:18px;font-weight:bold;' id='"+HAWod.obj.id+"-price'>"
if(HAWod.unavail)
{
Pnlac+=Translator.tr("Unavailable")
}
Pnlac+="</span>"
if(HAWod.more_info)
{
Pnlac+="</td><td align=right>"
var IEcAg=HAWod.more_info
var icRLl=WA_LinkToHref(IEcAg)
Pnlac+="<a "+icRLl+" style='font-family:Arial;text-decoration:underline;font-weight:bold;font-size:12px;color:0000ff;'>"+Translator.tr("More product info link")+"</a>"
}
Pnlac+="</td></tr></table>"
Pnlac+="<br>"
var SwjFf=HAWod.obj.index
if(HAWod.unavail==false)
if(HAWod.options.length>0)
{
Pnlac+="<table border=0 cellspacing=0 cellpadding=0>"
for(var n=0;n<HAWod.options.length;n++)
{
var LwcJD=HAWod.options[n]
if(LwcJD)
{
Pnlac+="<tr><td align=right>"
Pnlac+="<span style='font-family:Arial;font-weight:bold;font-size:12px;"+waslm+"'>"
Pnlac+=LwcJD.title+" :&nbsp;"
Pnlac+="</span>"
Pnlac+="</td><td align=left>"
Pnlac+="<select id='"+HAWod.obj.id+"-select-opt"+n+"' onchange=\"WA_market_changeCustomPrice('"+DHHoI+"',"+SwjFf+")\">"
Pnlac+="<option value=\"\">...</option>"
for(var KAFNZ=0;KAFNZ<LwcJD.vals.length;KAFNZ++)
{
var qWHwG=LwcJD.vals[KAFNZ]
Pnlac+="<option value=\""+KAFNZ+"\">"+qWHwG+"</option>"
}
Pnlac+="</select>"
Pnlac+="</td></tr>";
}
}
Pnlac+="</table>"
}
Pnlac+="</td>"
Pnlac+="</tr>"
Pnlac+="</table>"
if(HAWod.description.length>0)
{
Pnlac+="<table border=0 width=100% cellpadding=4>"
Pnlac+="<tr><td colspan=2>"
Pnlac+="<span style='font-family:Arial;font-size:13px;"+waslm+"'>"
Pnlac+="<hr>"
Pnlac+=HAWod.description
Pnlac+="</span>"
Pnlac+="</td></tr>"
Pnlac+="</table>"
}
this.writeContent(Pnlac)
WA_market_changeCustomPrice(DHHoI,SwjFf)
}
bJlol.displayWindowWithAutoResize(300,bJlol.wXqXk) 
}
function sWMuM(HAWod,giXhg)
{
var tkHOW=new Array()
for(var i=0;i<3;i++)
{
var EBHVU=giXhg+"-select-opt"
var lpnXj=document.getElementById(EBHVU+i)
tkHOW[i]=-1
if(lpnXj)
{
lpnXj.style.backgroundColor="";
var qWHwG=parseInt(lpnXj.value)
if(isNaN(qWHwG)==false)
tkHOW[i]=qWHwG
}
}
return gllvc(HAWod,tkHOW)
}
function gllvc(HAWod,tkHOW)
{
if(HAWod.unavail)return;
var GTcuH=false;
for(var i=0;i<HAWod.custom_prices.length;i++)
{
var SHYiF=HAWod.custom_prices[i]
var GUgiK=true;
for(var n=0;n<3;n++)
{
if(SHYiF.tab[n]!=tkHOW[n])GUgiK=false
}
if(GUgiK)
{
GTcuH=SHYiF;
break;
}
}
var KuYZe=HAWod.price
if(GTcuH)
{
KuYZe=GTcuH.pr
}
return KuYZe;
}
function WA_market_changeCustomPrice(DHHoI,SwjFf)
{
var PbwrV=fQTiU();
var kWcbt=wa_global_market.markets[DHHoI]
var sKlja=kWcbt.info.products;
var HAWod=sKlja[SwjFf]
if(HAWod.unavail)return;
var giXhg=HAWod.obj.id
var KuYZe=sWMuM(HAWod,giXhg)
var dLrdr=html_getLayer(giXhg+"-price")
if(dLrdr)
{
dLrdr.innerHTML=PbwrV.vJjpi(KuYZe)
}
}
function oxZvU()
{
var PbwrV=fQTiU();
if(WA_getNumberMarketItemsInCart()==0)return;
var XuHVs=PbwrV.TeGxh
if((PbwrV.YWlSR)&&(XuHVs.qIUpW=="paypal"))
{
EgSEQ();
return;
}
pesTp(wbjDC)
}
function pesTp(HkUiG)
{
var PbwrV=fQTiU();
var XuHVs=PbwrV.TeGxh
XuHVs.iRTxx()
var bJlol=new WA_Dialog();
bJlol.HkUiG=HkUiG
bJlol.paBZs=function(ZboZi)
{
return Translator.tr("form-label-"+ZboZi)
}
bJlol.onCustomKeypress=function(ZboZi)
{
if(ZboZi==13)
{
wa_timeout(Delegate.create(this,this.DUVxQ),0);
}
return false;
}
bJlol.BhjbT=function()
{
if(this.HkUiG==wbjDC)
{
WA_displayDialogMarketCart()
}
else
{
pesTp(wbjDC)
}
}
bJlol.JsBNB=function()
{
EgSEQ()
}
bJlol.DUVxQ=function()
{
var PbwrV=fQTiU();
var XuHVs=PbwrV.TeGxh
if(XuHVs.KIueS(this.HkUiG)==false) return;
XuHVs.RYdID()
if(this.HkUiG==wbjDC)
{
if(XuHVs.fsFkD==true)
{
pesTp(BDkwu)
}
else
{
this.JsBNB()
}
}
else
{
this.JsBNB()
}
}
bJlol.jRdVm=function(ZboZi,VHXOD)
{
if(VHXOD==undefined) VHXOD=""
if(VHXOD)VHXOD=" size="+VHXOD
return "<input name='"+ZboZi+"' value=\""+XuHVs.YGBaP(ZboZi,this.HkUiG)+"\" type=text "+VHXOD+">"
}
bJlol.QpeFe=function(vNpsC)
{
return "<td width=150px align=right valign=top>"+Translator.tr(vNpsC)+" :</td>"
}
bJlol.wXqXk=function()
{
var PbwrV=fQTiU();
var XuHVs=PbwrV.TeGxh 
this.addButton("< "+Translator.tr('Back'),this.BhjbT,[""],this)
this.addButton(Translator.tr('Continue')+" >",this.DUVxQ,[""],this)
this.initializeWindow(600,600)
var ZBpVe="form-label-"
var WbDIH=CONST_WA_GLOBAL_SETTINGS.list_form_fields 
var Pnlac=""
Pnlac+="<form id='wa-market-form' onSubmit='return false'>"
Pnlac+="<table border=0 width=100% cellspacing=5 style='font-family:Arial;font-size:15px;'>"
Pnlac+="<tr><td colspan=2 align=center style='font-size:18px;'>"
Pnlac+=Translator.tr((this.HkUiG==wbjDC)?"Fill Deliver information below":"Fill Billing information below")
Pnlac+="<br><br></td></tr>"
for(var n=0;n<WbDIH.length;n++)
{
var OpxxQ=WbDIH[n]
var ormwO=true;
if((OpxxQ=="email")&&(this.HkUiG==BDkwu))
{
ormwO=false;
}
if((OpxxQ=="phone")&&(this.HkUiG==BDkwu))
{
ormwO=false;
}
if(ormwO)
{
if(OpxxQ=="address")
{
Pnlac+="<tr>"+this.QpeFe("Address");
Pnlac+="<td>"
Pnlac+=this.jRdVm("address_1",30)
Pnlac+="</td></tr>"
Pnlac+="<tr><td></td><td>"
Pnlac+=this.jRdVm("address_2",30)
Pnlac+="</td></tr>"
Pnlac+="<tr>"+this.QpeFe("form-label-city");
Pnlac+="<td>"
Pnlac+=this.jRdVm("city")+"&nbsp;"+this.paBZs("zip")+" : "+this.jRdVm("zip",10)
Pnlac+="</td></tr>" 
Pnlac+="<tr>"+this.QpeFe("form-label-country");
Pnlac+="<td>"
if(this.HkUiG==BDkwu)
{
Pnlac+="<select id='wa-select-form-country' onchange='WA_marketChangeFormCountry("+this.HkUiG+")'>"
var Zvtnt=new Array();
var HJAuM=CONST_WA_COUNTRIES.codes
for(var KAFNZ=0;KAFNZ<HJAuM.length;KAFNZ++)
{
var RQwvu=HJAuM[KAFNZ]
Zvtnt.push({code:RQwvu,lab:Translator.country(RQwvu)})
}
Zvtnt.sort(cSlNO)
var oYHNJ=XuHVs.Zitox()
oYHNJ=XuHVs.YGBaP('countryCode',this.HkUiG,oYHNJ)
for(var KAFNZ=0;KAFNZ<Zvtnt.length;KAFNZ++)
{
var TAGPt=Zvtnt[KAFNZ]
var RQwvu=TAGPt.code
Pnlac+="<option "
if(oYHNJ==RQwvu)Pnlac+="selected "
Pnlac+="value=\""+RQwvu+"\">"+Translator.country(RQwvu)+"</option>"
}
Pnlac+="</select>"
}
else
{
Pnlac+=Translator.country(PbwrV.TeGxh.SxSvM);
}
Pnlac+="<br><span id='wa-market-state'>"
Pnlac+="<select id='wa-select-state'></select>"
Pnlac+="</span>" 
Pnlac+="</td></tr>"
}
else
{
Pnlac+="<tr>"+this.QpeFe("form-label-"+OpxxQ);
Pnlac+="<td>"
Pnlac+=this.jRdVm(OpxxQ,30) 
Pnlac+="</td></tr>"
}
}
}
if(this.HkUiG==wbjDC)
{
Pnlac+="<tr><td colspan=2 align=center >"
Pnlac+=Translator.tr("Billing adress is different")+" <input type=checkbox "
if(PbwrV.TeGxh.fsFkD)Pnlac+="checked "
Pnlac+="onchange='WA_marketCheckBillingAdress(this)'>"
Pnlac+="</td></tr>"
}
Pnlac+="</table>"
Pnlac+="</form>"
this.writeContent(Pnlac)
WA_exec_callback_opera_compliant(this,this.TgxAO) 
}
bJlol.TgxAO=function()
{
WA_marketChangeFormCountry(this.HkUiG)
}
bJlol.wXqXk()
}
function hIXOW(HkUiG,lpnXj,YTiqa)
{
var PbwrV=fQTiU();
var XuHVs=PbwrV.TeGxh
var XDPoo=XuHVs.YGBaP("stateCode",HkUiG) 
lpnXj.options.length=0
for(var n=0;n<YTiqa.length;n++)
{
var uBXsx=YTiqa[n]
var val=uBXsx[1]
var elOptNew=document.createElement('option');
elOptNew.value=val;
if(val.length==0)val="--- "+Translator.tr("form-label-state")+" ---"
elOptNew.text=uBXsx[0];
if(elOptNew.value==XDPoo)elOptNew.selected=true
try{
lpnXj.add(elOptNew,null);
}
catch(ex){
lpnXj.add(elOptNew);
}
}
}
function WA_stateLabel(RQwvu,uBXsx)
{
var arrayState=null;
if(RQwvu=="US")arrayState=jxgCe;
if(RQwvu=="CA")arrayState=FNYGG;
if(RQwvu=="BR")arrayState=bjwhA;
if(arrayState!=null)
{
for(var i=0;i<arrayState.length;i++)
{
var IVejg=arrayState[i];
if(IVejg[1]==uBXsx) return IVejg[0];
}
}
return uBXsx;
}
function WA_marketChangeFormCountry(HkUiG)
{
var PbwrV=fQTiU();
var XuHVs=PbwrV.TeGxh
var KPtGj=XuHVs.SxSvM
var lpnXj=document.getElementById("wa-select-form-country");
if(lpnXj) KPtGj=lpnXj.value;
html_SetDisplay("wa-market-state",(KPtGj=="US")||(KPtGj=="CA")||(KPtGj=="BR"))
var ceSMb=document.getElementById("wa-select-state");
if(ceSMb)
{
var arrayState=null;
if(KPtGj=="US")arrayState=jxgCe;
if(KPtGj=="CA")arrayState=FNYGG;
if(KPtGj=="BR")arrayState=bjwhA;
if(arrayState!=null)
{
var MSZcm=[["",""]];
arrayState=MSZcm.concat(arrayState);
hIXOW(HkUiG,ceSMb,arrayState);
}
}
}
function WA_marketCheckBillingAdress(tYSZH)
{
var PbwrV=fQTiU();
var XuHVs=PbwrV.TeGxh
XuHVs.fsFkD=tYSZH.checked
XuHVs.RYdID()
}
function EgSEQ()
{
var PbwrV=fQTiU();


var bJlol=new WA_Dialog();
bJlol.BhjbT=function()
{
if(PbwrV.TeGxh.qIUpW=="paypal")
{
WA_displayDialogMarketCart();return;
}
if(PbwrV.TeGxh.fsFkD)
pesTp(BDkwu)
else
pesTp(wbjDC)
}
bJlol.VpMNB=function(TuQhL,qWHwG)
{
qWHwG=""+qWHwG
qWHwG=qWHwG.replace(/'/g,"&lsquo;")
return "<input type=hidden name='"+TuQhL+"' value=\""+qWHwG+"\">"
}
bJlol.XuZSG=function()
{
var PbwrV=fQTiU();
var Pnlac=""
var iiwBs=CONST_WA_GLOBAL_SETTINGS.currency_info;
if(iiwBs.charCodeAt(3)>=100) return"";
Pnlac+="<form id='wa-http-sender' accept-charset='UTF-8' method=POST action='https://www.paypal.com/cgi-bin/webscr' target='_blank'>";
Pnlac+=this.VpMNB("cmd","_cart");
Pnlac+=this.VpMNB("business",CONST_WA_GLOBAL_SETTINGS.email_paypal_account);
Pnlac+=this.VpMNB("upload","1");
Pnlac+=this.VpMNB("charset","utf-8");
Pnlac+=this.VpMNB("no_note","0");
Pnlac+=this.VpMNB("currency_code",CONST_WA_GLOBAL_SETTINGS.currency_code);
Pnlac+=this.VpMNB("no_shipping","2");
Pnlac+=this.VpMNB("address_override","1");
var KtqoE=PbwrV.ewqqL()
for(var i=0;i<KtqoE.length;i++)
{
var info=KtqoE[i];
var index=i+1;
var ngUpn=info.RbEPv();
if(PbwrV.NtCVU())
{
var dgNrN=PbwrV.ecWrL(PbwrV.SsWNv(ngUpn));
ngUpn=ngUpn-dgNrN;
}
Pnlac+=this.VpMNB("amount_"+index,""+ngUpn)
Pnlac+=this.VpMNB("quantity_"+index,info.GfoqX)
var pwnrn=0;
if(info.PJuCa.length>0)
{
Pnlac+=this.VpMNB("on"+pwnrn+"_"+index,"ref")
Pnlac+=this.VpMNB("os"+pwnrn+"_"+index,info.PJuCa)
pwnrn++;
}
var tlcSk=""
if(info.m_opt_vals)
{
for(var i_opt=0;i_opt<info.HAWod.options.length;i_opt++)
{
var LwcJD=info.HAWod.options[i_opt]
if(LwcJD)
{
var GVqZs=info.m_opt_vals[i_opt];
var WZCBb=LwcJD.vals[GVqZs]
var JXfeO=LwcJD.title;
if(JXfeO.length==0) JXfeO="opt"+(i_opt+1);
Pnlac+=this.VpMNB("on"+pwnrn+"_"+index,JXfeO)
Pnlac+=this.VpMNB("os"+pwnrn+"_"+index,WZCBb)
if(tlcSk.length>0)tlcSk=tlcSk+", "
tlcSk+=WZCBb
pwnrn++;
}
}
}
var xCoQr=info.kjVmq;
if(tlcSk.length>0)xCoQr=xCoQr+"("+tlcSk+")"
Pnlac+=this.VpMNB("item_name_"+index,xCoQr) 
}
var nELtw=PbwrV.Hmqig()
if(PbwrV.NtCVU())
{
nELtw=nELtw-PbwrV.ecWrL(PbwrV.SsWNv(nELtw));
}
if(PbwrV.NtCVU())
{
var gKQSG=PbwrV.UlHXc();
var DcDwd=PbwrV.Hmqig()
var XnWKC=gKQSG+DcDwd;
var EcHAd=PbwrV.ecWrL(PbwrV.SsWNv(XnWKC));
var oXbTb=XnWKC-EcHAd;
oXbTb=oXbTb-nELtw;
var KJhRe=0;
for(var i=0;i<KtqoE.length;i++)
{
var info=KtqoE[i];
var index=i+1;
var kixto=0;
var DCDeM=0;
var ngUpn=info.GfoqX*info.RbEPv();
var n0=PbwrV.BFBcs()/100;
var tax=ngUpn*(n0/(1+n0));
ngUpn=ngUpn-tax;
kixto=ngUpn;
var YvKUt=info.RbEPv();
var dgNrN=PbwrV.ecWrL(PbwrV.SsWNv(YvKUt));
YvKUt=YvKUt-dgNrN;
DCDeM=info.GfoqX*YvKUt;
if(DCDeM>kixto)
{
YvKUt=info.RbEPv();
YvKUt=YvKUt-dgNrN;
var DehhF=YvKUt;
if((DehhF>0)&&(DehhF!=info.RbEPv()))
{
DehhF=DehhF-0.01;
}
Pnlac+=this.VpMNB("amount_"+index,PbwrV.ecWrL(DehhF)) 
DCDeM=info.GfoqX*DehhF;
}
KJhRe+=DCDeM;
}
var CsPFd=PbwrV.ecWrL(oXbTb-KJhRe);
if(CsPFd>0)
{
var index=KtqoE.length+1;
Pnlac+=this.VpMNB("item_name_"+index,Translator.tr("TVA correction"))
Pnlac+=this.VpMNB("quantity_"+index,1)
Pnlac+=this.VpMNB("amount_"+index,PbwrV.ecWrL(CsPFd))
}
Pnlac+=this.VpMNB("tax_cart",EcHAd)
}
else
{
Pnlac+=this.VpMNB("tax_cart",PbwrV.ePXiB())
}
Pnlac+=this.VpMNB("handling_cart",nELtw) 
Pnlac+="</form>"
return Pnlac;
}
bJlol.dqYmp=function()
{
var jpXjg=this.TRfhO(wbjDC);
var Pnlac="";
if(jpXjg.length>0)
{
Pnlac+=""+Translator.tr("Shipping information")+":\n";
Pnlac+=jpXjg;
}
return Pnlac;
}
bJlol.OqcjK=function()
{
var jpXjg=this.TRfhO(BDkwu);
var Pnlac="";
if(jpXjg.length>0)
{
Pnlac+=Translator.tr("Billing information")+":\n";
Pnlac+=jpXjg;
}
return Pnlac;
}
bJlol.TRfhO=function(HkUiG)
{
var PbwrV=fQTiU();
var XuHVs=PbwrV.TeGxh
var Pnlac="";
var slEtG=new Array();
var WbDIH=onwDh(CONST_WA_GLOBAL_SETTINGS.list_form_fields)
WbDIH.push("country")
WbDIH.push("state")
for(var i=0;i<WbDIH.length;i++)
{
var TDjOT=WbDIH[i];
slEtG[TDjOT]=XuHVs.YGBaP(TDjOT,HkUiG)
}
if(slEtG["firstname"])Pnlac+=slEtG["firstname"]+"\n"
if(slEtG["lastname"])Pnlac+=slEtG["lastname"]+"\n"
if(slEtG["company"])
{
Pnlac+=Translator.tr("form-label-company")+" : "+slEtG["company"]+"\n"
}
if(slEtG["fiscal_code"]) Pnlac+=Translator.tr("form-label-fiscal_code")+" : "+slEtG["fiscal_code"]+"\n"
if(slEtG["tva"]) Pnlac+=Translator.tr("form-label-tva")+" : "+slEtG["tva"]+"\n"
if(slEtG["address_1"]) Pnlac+=slEtG["address_1"]+"\n"
if(slEtG["address_2"]) Pnlac+=slEtG["address_2"]+"\n"
if(slEtG["zip"]) Pnlac+=slEtG["zip"]+" "
if(slEtG["city"]) Pnlac+=slEtG["city"]+"\n"
if(slEtG["country"])Pnlac+=Translator.country(slEtG["country"])
if(slEtG["state"]&&slEtG["state"].length>0) Pnlac+=" "+WA_stateLabel(slEtG["country"],slEtG["state"]);
Pnlac+="\n"
if(slEtG["phone"]) Pnlac+=Translator.tr("form-label-phone")+" : "+slEtG["phone"]+"\n"
if(slEtG["mobile_phone"]) Pnlac+=Translator.tr("form-label-mobile_phone")+" : "+slEtG["mobile_phone"]+"\n"
if(slEtG["fax"]) Pnlac+=Translator.tr("form-label-fax")+" : "+slEtG["fax"]+"\n"
if(slEtG["email"]) Pnlac+=slEtG["email"]+"\n" 
if(slEtG["comment"])
{
Pnlac+=Translator.tr("form-label-comment")+" : \n";
Pnlac+=slEtG["comment"]+"\n"
}
return Pnlac;
}
bJlol.blfDd=function()
{
var PbwrV=fQTiU();
var Pnlac="";
var KtqoE=PbwrV.ewqqL();
Pnlac+="**************\n"
for(var i=0;i<KtqoE.length;i++)
{
var XuHVs=KtqoE[i];
var index=i+1;
var xCoQr=XuHVs.kjVmq;
if(XuHVs.PJuCa.length>0)
{
xCoQr+=" ["+XuHVs.PJuCa+"]";
}
var tlcSk=""
if(XuHVs.m_opt_vals)
{
for(var i_opt=0;i_opt<XuHVs.HAWod.options.length;i_opt++)
{
var LwcJD=XuHVs.HAWod.options[i_opt]
if(LwcJD)
{
if(tlcSk.length>0)tlcSk=tlcSk+", "
var GVqZs=XuHVs.m_opt_vals[i_opt];
var WZCBb=LwcJD.vals[GVqZs]
var JXfeO=LwcJD.title;
if(JXfeO.length>0) tlcSk+=JXfeO+" : "
tlcSk+=WZCBb
}
}
}
if(tlcSk.length>0)xCoQr=xCoQr+"\n("+tlcSk+")"
Pnlac+=xCoQr;
Pnlac+="\n"
Pnlac+=Translator.tr("Price")+" : "+PbwrV.nwEcw(XuHVs.RbEPv())+"\n"
Pnlac+=Translator.tr("Quantity")+" : "+XuHVs.GfoqX+"\n"
Pnlac+=Translator.tr("Total")+" : "+PbwrV.nwEcw(XuHVs.RbEPv()*XuHVs.GfoqX);
Pnlac+="\n"
Pnlac+="**************\n"
}
var SWXEg=PbwrV.UlHXc()
var lshNM=PbwrV.ePXiB()
var QCJpd=PbwrV.Hmqig()
var YRcIH=PbwrV.BrYLT()
var PFiHG=PbwrV.vUeLi() 
Pnlac+=Translator.tr("Sub total")+" : "+PbwrV.nwEcw(SWXEg)+"\n";
if(CONST_WA_GLOBAL_SETTINGS.shipping_type!=lDSCY)
{
Pnlac+=Translator.tr("Shipping amount")+" : "+PbwrV.nwEcw(QCJpd)+"\n";
}
if(PbwrV.NtCVU()||PbwrV.EZYJR())
{
if(PbwrV.NtCVU())
{
Pnlac+=Translator.tr("Tax included");
}
if(PbwrV.EZYJR())
{
Pnlac+=Translator.tr("Extra Tax");
}
Pnlac+=" : ";
Pnlac+=PbwrV.nwEcw(lshNM)+"\n";
}
if(PFiHG>0)
{
Pnlac+=Translator.tr("Promotion")+" : - "+PbwrV.nwEcw(PFiHG)+"\n";
}
Pnlac+=Translator.tr("Total")+" : "+PbwrV.nwEcw(YRcIH)+"\n";
return Pnlac;
}
bJlol.ArhUV=function()
{
var PbwrV=fQTiU();
var Pnlac="";
var KtqoE=PbwrV.ewqqL();
Pnlac+="<table class=wa-cart-global-table >";
Pnlac+="<tr class=wa-cart-title >";
Pnlac+="<td>&nbsp;</td>";
Pnlac+="<td>"+Translator.tr("Price")+"</td>";
Pnlac+="<td>"+Translator.tr("Quantity")+"</td>";
Pnlac+="<td>"+Translator.tr("Total")+"</td>";
Pnlac+="</tr>"
for(var i=0;i<KtqoE.length;i++)
{
Pnlac+="<tr>";
var XuHVs=KtqoE[i];
var index=i+1;
Pnlac+="<td>";
var xCoQr=XuHVs.kjVmq;
if(XuHVs.PJuCa.length>0)
{
xCoQr+=" ["+XuHVs.PJuCa+"]";
}
xCoQr="<b>"+xCoQr+"</b>";
var tlcSk="";
if(XuHVs.m_opt_vals)
{
for(var i_opt=0;i_opt<XuHVs.HAWod.options.length;i_opt++)
{
var LwcJD=XuHVs.HAWod.options[i_opt];
if(LwcJD)
{
if(tlcSk.length>0)tlcSk=tlcSk+", ";
var GVqZs=XuHVs.m_opt_vals[i_opt];;
var WZCBb=LwcJD.vals[GVqZs];
var JXfeO=LwcJD.title;;
if(JXfeO.length>0) tlcSk+=JXfeO+" : ";
tlcSk+=WZCBb;
}
}
}
if(tlcSk.length>0)xCoQr=xCoQr+"<br><span class=wa-cart-option >("+tlcSk+")</span>";
Pnlac+=xCoQr;;
Pnlac+="</td>";
Pnlac+="<td>"+PbwrV.vJjpi(XuHVs.RbEPv())+"</td>";
Pnlac+="<td>"+XuHVs.GfoqX+"</td>";
Pnlac+="<td>"+PbwrV.vJjpi(XuHVs.RbEPv()*XuHVs.GfoqX)+"</td>";
Pnlac+="</tr>";
}
Pnlac+="<tr><td colspan=4>";
var SWXEg=PbwrV.UlHXc();
var lshNM=PbwrV.ePXiB();
var QCJpd=PbwrV.Hmqig();
var YRcIH=PbwrV.BrYLT();
var PFiHG=PbwrV.vUeLi();
Pnlac+="<table class=wa-cart-table-total >";
Pnlac+="<tr><td align=right >"+Translator.tr("Sub total")+" : "+PbwrV.vJjpi(SWXEg)+"</td></tr>";
if(CONST_WA_GLOBAL_SETTINGS.shipping_type!=lDSCY)
{
Pnlac+="<tr><td align=right>"+Translator.tr("Shipping amount")+" : "+PbwrV.vJjpi(QCJpd)+"</td></tr>";
}
if(PbwrV.NtCVU()||PbwrV.EZYJR())
{
if(PbwrV.NtCVU())
{
Pnlac+="<tr><td align=left >"+Translator.tr("Tax included");
}
if(PbwrV.EZYJR())
{
Pnlac+="<tr><td align=right >"+Translator.tr("Extra Tax");
}
Pnlac+=" : ";
Pnlac+=PbwrV.vJjpi(lshNM)+"</td></tr>";
}
if(PFiHG>0)
{
Pnlac+="<tr><td align=right class=wa-cart-promo >"+Translator.tr("Promotion")+" : - "+PbwrV.vJjpi(PFiHG)+"</td></tr>";
}
Pnlac+="<tr><td align=right class=wa-cart-total >"+Translator.tr("Total")+" : "+PbwrV.vJjpi(YRcIH)+"</td></tr>";
Pnlac+="</table>";
Pnlac+="</td></tr>";
Pnlac+="</table>";
Pnlac=Pnlac.replace(/\"/g,"'");
return Pnlac;
}
bJlol.DXpmf=function(qWHwG)
{
if((""+qWHwG).length==1)qWHwG="0"+qWHwG;
return qWHwG;
}
bJlol.PtQNA=function(TDjOT)
{
var PbwrV=fQTiU();
return PbwrV.TeGxh.YGBaP(TDjOT,wbjDC);
}
bJlol.suLLJ=function(TDjOT)
{
var PbwrV=fQTiU();
var XuHVs=PbwrV.TeGxh;
if(XuHVs.fsFkD)
{
return PbwrV.TeGxh.YGBaP(TDjOT,wbjDC);
}
return PbwrV.TeGxh.YGBaP(TDjOT,wbjDC);
}
bJlol.iwbFG=function()
{
var PbwrV=fQTiU();
var XuHVs=PbwrV.TeGxh;
var iiwBs=CONST_WA_GLOBAL_SETTINGS.currency_info;
var Pnlac=""
if(iiwBs.charCodeAt(3)>=100) return"";
if(XApaL)
{
Pnlac+="<form id='wa-http-sender' accept-charset='UTF-8' method=POST action='"+XApaL_URL+"crbst_market_print_form.php' target='_blank'>";
}
else
{
Pnlac+="<form id='wa-http-sender' accept-charset='UTF-8' method=POST action='crbst_market_print_form.php' target='_blank'>";
}
Pnlac+=this.VpMNB("type_payment",XuHVs.qIUpW);
Pnlac+=this.VpMNB("MAIL_TITLE_PREFIXE",Translator.tr("title email Order notification"));
Pnlac+=this.VpMNB("MAIN_TITLE",Translator.tr("PRINT_FORM_MAIN_TITLE"));
Pnlac+=this.VpMNB("PREFIXE_ORDER",Translator.tr("PRINT_FORM_PREFIXE_ORDER"));
var UfYvE="";
var FIUsS=new Date();
UfYvE+="wa-"+this.DXpmf(FIUsS.getYear()-100)+this.DXpmf(FIUsS.getMonth()+1)+this.DXpmf(FIUsS.getDate());
UfYvE+=FIUsS.getHours()+this.DXpmf(FIUsS.getMinutes())+this.DXpmf(FIUsS.getSeconds());
UfYvE+="-"+Math.round(Math.random()*100);
Pnlac+=this.VpMNB("ID_ORDER",UfYvE);
Pnlac+=this.VpMNB("CARD_TITLE",Translator.tr("PRINT_FORM_CARD_TITLE"));
Pnlac+=this.VpMNB("LABEL_TYPE_PAYMENT",Translator.tr("PRINT_FORM_LABEL_TYPE_PAYMENT"));
Pnlac+=this.VpMNB("send_copy_email_to_buyer",(CONST_WA_GLOBAL_SETTINGS.send_copy_email_to_buyer)?"1":"0");
var slEtG=new Array();
var WbDIH=onwDh(CONST_WA_GLOBAL_SETTINGS.list_form_fields);
WbDIH.push("country")
WbDIH.push("state")
for(var i=0;i<WbDIH.length;i++)
{
var TDjOT=WbDIH[i];
slEtG[TDjOT]=PbwrV.TeGxh.YGBaP(TDjOT,wbjDC);
}
if(XuHVs.qIUpW=="paypal")
{
Pnlac+=this.VpMNB("form_first_name",this.suLLJ("firstname"));
Pnlac+=this.VpMNB("form_last_name",this.suLLJ("lastname"));
Pnlac+=this.VpMNB("form_address1",this.suLLJ("address_1"));
Pnlac+=this.VpMNB("form_address2",this.suLLJ("address_2"));
Pnlac+=this.VpMNB("form_city",this.suLLJ("city"));
Pnlac+=this.VpMNB("form_zip",this.suLLJ("zip"));
Pnlac+=this.VpMNB("form_state",this.suLLJ("state"));
Pnlac+=this.VpMNB("form_country",this.suLLJ("country"));
Pnlac+=this.VpMNB("form_company",this.suLLJ("company"));
Pnlac+=this.VpMNB("form_fiscal_code",this.suLLJ("fiscal_code"));
Pnlac+=this.VpMNB("form_tva",this.suLLJ("tva"));
Pnlac+=this.VpMNB("form_phone",this.suLLJ("phone"));
Pnlac+=this.VpMNB("form_mobile_phone",this.suLLJ("mobile_phone"));
Pnlac+=this.VpMNB("form_fax",this.suLLJ("fax"));
}
else
{
Pnlac+=this.VpMNB("form_first_name",slEtG["firstname"]);
Pnlac+=this.VpMNB("form_last_name",slEtG["lastname"]);
Pnlac+=this.VpMNB("form_address1",slEtG["address_1"]);
Pnlac+=this.VpMNB("form_address2",slEtG["address_2"]);
Pnlac+=this.VpMNB("form_city",slEtG["city"]);
Pnlac+=this.VpMNB("form_zip",slEtG["zip"]);
Pnlac+=this.VpMNB("form_state",slEtG["state"]);
Pnlac+=this.VpMNB("form_country",slEtG["country"]);
Pnlac+=this.VpMNB("form_company",slEtG["company"]);
Pnlac+=this.VpMNB("form_fiscal_code",slEtG["fiscal_code"]);
Pnlac+=this.VpMNB("form_tva",slEtG["tva"]);
Pnlac+=this.VpMNB("form_phone",slEtG["phone"]);
Pnlac+=this.VpMNB("form_mobile_phone",slEtG["mobile_phone"]);
Pnlac+=this.VpMNB("form_fax",slEtG["fax"]);
}
Pnlac+=this.VpMNB("CARD_TOTAL_PRICE",PbwrV.BrYLT());
Pnlac+=this.VpMNB("CARD_CURRENCY",CONST_WA_GLOBAL_SETTINGS.currency_code);
Pnlac+=this.VpMNB("CARD_LANG",Translator.m_lang);
Pnlac+=this.VpMNB("LABEL_PROCESS_ORDER",Translator.tr("PRINT_FORM_PROCESS_ORDER"));
Pnlac+=this.VpMNB("wa_promo_code",PbwrV.TeGxh.dadhC);

Pnlac+=this.VpMNB("email_buyer",XuHVs.YGBaP("email",wbjDC));
var WgZSn=AMfEd(XuHVs.qIUpW);
Pnlac+=this.VpMNB("TYPE_PAYMENT",WgZSn);
if(XuHVs.qIUpW=="check")
{
Pnlac+=this.VpMNB("MESSAGE_CHECK",Translator.tr("PRINT_FORM_MESSAGE_CHECK"));
}
if(XuHVs.qIUpW=="wire")
{
Pnlac+=this.VpMNB("MESSAGE_WIRE",Translator.tr("PRINT_FORM_MESSAGE_WIRE"));
}
if(XuHVs.qIUpW=="paypal")
{
Pnlac+=this.VpMNB("LABEL_PAYPAL_CART_TITLE",Translator.tr("PRINT_FORM_PAYPAL_CART_TITLE"));;
Pnlac+=this.VpMNB("MESSAGE_PAYPAL",Translator.tr("PRINT_FORM_MESSAGE_PAYPAL"));
}
Pnlac+=this.VpMNB("LABEL_PRINT",Translator.tr("PRINT_FORM_LABEL_PRINT"));
Pnlac+=this.VpMNB("card_html",this.ArhUV());
Pnlac+=this.VpMNB("card_plain_text",this.blfDd());
Pnlac+=this.VpMNB("LABEL_SELLER_INFORMATION",Translator.tr("Seller information"));
Pnlac+=this.VpMNB("LABEL_BANK_ACCOUNT",Translator.tr("Bank account information"));
Pnlac+=this.VpMNB("LABEL_ADDRESS",Translator.tr("Address"));
Pnlac+=this.VpMNB("seller_address",CONST_WA_GLOBAL_SETTINGS.seller_address);
Pnlac+=this.VpMNB("bank_account_informations",CONST_WA_GLOBAL_SETTINGS.bank_account_informations);
Pnlac+=this.VpMNB("buyer_info_shipping",this.dqYmp());
var ghGNk="";
if(XuHVs.fsFkD)
{
ghGNk=this.OqcjK();;
};
Pnlac+=this.VpMNB("buyer_info_billing",ghGNk);
Pnlac+="</form>";
return Pnlac;
}
bJlol.KJkPq=function()
{
var PbwrV=fQTiU();
PbwrV.jCdnP();
this.closeWin();
}
bJlol.wXqXk=function()
{
var iiwBs=CONST_WA_GLOBAL_SETTINGS.currency_info;
var PbwrV=fQTiU();
var XXwRe=true;
var XuHVs=PbwrV.TeGxh;
if(XuHVs.qIUpW=="paypal")
{
if(PbwrV.YWlSR==true)
{
XXwRe=false;
}
if((PbwrV.YWlSR==true)&&(CONST_WA_GLOBAL_SETTINGS.list_promo_codes!=false))
{
XXwRe=true;
}
}
if((XXwRe==false)&&(XuHVs.qIUpW=="paypal"))
{
this.addButton(Translator.tr('Clear cart'),this.KJkPq,[""],this);
this.initializeWindow(400,200);
}
else
{
this.initializeWindow(400,150);
}
var Pnlac=""
if((XXwRe==false)&&(XuHVs.qIUpW=="paypal"))
{
Pnlac+=this.XuZSG();
}
if(XXwRe)
{
Pnlac+=this.iwbFG();
if((XApaL==false)&&(document.webaca_is_preview))
{
WA_Dialog.alert(Translator.tr("Operation not allowed in preview mode"));
return;
}
}
Pnlac+="<table border=0 style='width:100%;'><tr>";;
Pnlac+="<td align=center style='"+this.cssText1()+"'>";
Pnlac+=Translator.tr("You have been redirected to the payment page");
if((XXwRe==false)&&(XuHVs.qIUpW=="paypal"))
{
Pnlac+="<br><br>";
Pnlac+=Translator.tr("You can clear your cart");
}
Pnlac+="</td></tr></table>";
this.writeContent(Pnlac);
if(iiwBs.charCodeAt(3)>=100)
{
WA_Dialog.alert(Translator.tr("This cariboost edition can't support ebusiness features !'"));
return;
}
var UhCaV=document.getElementById("wa-http-sender");;
UhCaV.submit();
if(XXwRe)
{
PbwrV.jCdnP();
}
}
bJlol.wXqXk();
}

-->
