<!--

function ckuTG(svYjg)
{
var DHHoI=svYjg[0]
var RDinB=wa_global_market.markets[DHHoI]
var LVONK=new TcCNA(RDinB)
RDinB.obj=LVONK
LVONK.aveQh()
var oHNda=document.wa_global_query_info
if(oHNda)
{
var bBMaW="wa-id-"+DHHoI;
if(bBMaW==oHNda.m_unid)
{
WA_showMarketProduct(DHHoI,oHNda.m_index_item)
return;
}
}
}
function WA_loadMarket()
{
for(var ZboZi in wa_global_market.markets)
{
var LVONK=wa_global_market.markets[ZboZi]
if(LVONK)
{
var uFYZD=Translator.m_lang_for_filename
if(uFYZD.length>0)uFYZD="_"+uFYZD;
WA_loadScript(LVONK.src_folder+'/market-definition'+uFYZD+'.js?v='+LVONK.id_modif,ckuTG,[ZboZi]);
}
}
WA_refreshNumberMarketItemsInCart()
}
function WA_basicFormatPrice(v)
{
v=Math.round(v*100)/100
var result="";
var nGqgT=".";
var s=v+"";
s=s.replace(/,/g,".")
var n=s.indexOf(".");
if(n>-1)
{
s=s+"00";
s=s.substring(0,n+3);
}
else
{
s+=nGqgT+"00"
}
s=s.replace(/\./g,CONST_WA_GLOBAL_SETTINGS.currency_decimal_symbol)
result=s;
return result;
}
function WA_formatPrice(v)
{
var Urtmg=CONST_WA_GLOBAL_SETTINGS.currency_mnemonic 
var result=WA_basicFormatPrice(v);
if((CONST_WA_GLOBAL_SETTINGS.currency_code=="GBP")||(CONST_WA_GLOBAL_SETTINGS.currency_code=="USD"))
{
result=Urtmg+result;
}
else
if(CONST_WA_GLOBAL_SETTINGS.currency_code=="BRL")
{
result=Urtmg+" "+result;
}
else
if(CONST_WA_GLOBAL_SETTINGS.currency_code=="F CFA")
{

if(Math.floor(v)==v)
{
result=""+v;
}
result=result+" "+Urtmg;
}
else
{
result=result+" "+Urtmg;
}
return result;
}
function Oikce(c,ax,ay,bx,by,dashLength){
var dx=ax-bx;
var dy=ay-by;
var angle=Math.atan2(dy,dx)/(Math.PI/180)+90;
if(angle>180) angle-=360;
c.moveTo(ax,ay);
for(var i=0;i*dashLength<Math.sqrt(dx*dx+dy*dy);i++){
var cx=ax-(i*dashLength)*Math.sin(angle*(Math.PI/180));
var cy=ay+(i*dashLength)*Math.cos(angle*(Math.PI/180));
if(i%2==0){c.lineTo(cx,cy);
}else{
c.moveTo(cx,cy);
}
}
}
function KUfsT(LVONK,HAWod,OdLHT,DHHoI)
{
this.MJwXi=function()
{
var Pnlac=""
var wGaSC=false;
var LAlNO=this.market.info.folder;

var WfSQG="WA_showMarketProduct('"+LAlNO+"',"+OdLHT+")"
wGaSC=new WA_GraphicElement(this.DHHoI+"-sep",60,false)
wGaSC.iDVtQ=this.iDVtQ
wGaSC.draw=function()
{
var iDVtQ=this.iDVtQ
var TDRBl=iDVtQ.prod_global_separator_pt1
var FDukA=iDVtQ.prod_global_separator_pt2
var qbWSj=document.getElementById(this.canvasId())
var dEXtW=qbWSj.getContext('2d');
dEXtW.strokeStyle=iDVtQ.prod_global_separator_col
Oikce(dEXtW,TDRBl.x-0.5,TDRBl.y+0.5,FDukA.x-0.5,FDukA.y+0.5,2)
dEXtW.stroke()
}
wGaSC.setOnClick(WfSQG);
var AOpsX=this.iDVtQ.r_prod_inner.clone()
AOpsX.translate(this.WxExj.x,this.WxExj.y)
wGaSC.setRect(AOpsX.x,AOpsX.y,AOpsX.width+1,AOpsX.height+1)
Pnlac+=wGaSC.toHtml()
this.hsoiB.push(wGaSC) 

wGaSC=new WA_GraphicElement(this.DHHoI+"-zone0",10,false)
wGaSC.iDVtQ=this.iDVtQ
wGaSC.draw=function()
{
var iDVtQ=this.iDVtQ
WA_bg(this.canvasId(),this.rect().width,this.rect().height,iDVtQ.prod_global_corner,1,iDVtQ.prod_global_border_col,[iDVtQ.prod_global_gradient],this.shadow())
}
var AOpsX=this.iDVtQ.r_prod_inner.clone()
AOpsX.translate(this.WxExj.x,this.WxExj.y)
wGaSC.setRect(AOpsX.x,AOpsX.y,AOpsX.width+1,AOpsX.height+1)
Pnlac+=wGaSC.toHtml()
this.hsoiB.push(wGaSC)
if(this.iDVtQ.lay_rect_desc.isValid())
{


wGaSC=new WA_GraphicElement(this.DHHoI+"-zone1",25,false)
wGaSC.iDVtQ=this.iDVtQ
wGaSC.draw=function()
{
var iDVtQ=this.iDVtQ
WA_bg(this.canvasId(),this.rect().width,this.rect().height,iDVtQ.prod_desc_corner,1,iDVtQ.prod_desc_border_col,[iDVtQ.prod_desc_gradient],this.shadow())
}
AOpsX=this.iDVtQ.lay_rect_desc.clone()
AOpsX.translate(this.WxExj.x,this.WxExj.y)
wGaSC.setRect(AOpsX.x,AOpsX.y,AOpsX.width+1,AOpsX.height+1)
Pnlac+=wGaSC.toHtml()
this.hsoiB.push(wGaSC) 
AOpsX=this.iDVtQ.lay_rect_desc_inner.clone()
AOpsX.translate(this.WxExj.x,this.WxExj.y)
Pnlac+="<div style=\"position:absolute;z-index:50;";
Pnlac+="left:"+AOpsX.x+"px;top:"+AOpsX.y+"px;";
Pnlac+="cursor:pointer;";
Pnlac+="width:"+AOpsX.width+"px;"
Pnlac+="height:"+AOpsX.height+"px;";
Pnlac+="font-family:"+this.iDVtQ.prod_desc_font_family+";"
Pnlac+="font-size:"+this.iDVtQ.prod_desc_font_size+"px;"
Pnlac+="color:"+this.iDVtQ.prod_desc_col+";"
Pnlac+="margin:3px;"
Pnlac+="padding:0px;"
Pnlac+="\" ";
Pnlac+=">";
Pnlac+="<div style=\"";
Pnlac+="font-weight:bold;"
Pnlac+="\">";
Pnlac+=this.HAWod.title
Pnlac+="</div>";
Pnlac+="<div style=\"";
Pnlac+="\">";
Pnlac+=this.HAWod.sub_title
Pnlac+="</div>";
Pnlac+="</div>";
}
if(this.iDVtQ.lay_rect_price.isValid())
{

wGaSC=new WA_GraphicElement(this.DHHoI+"-zone2",25,false)
wGaSC.iDVtQ=this.iDVtQ
wGaSC.draw=function()
{
var iDVtQ=this.iDVtQ
WA_bg(this.canvasId(),this.rect().width,this.rect().height,iDVtQ.prod_price_corner,1,iDVtQ.prod_price_border_col,[iDVtQ.prod_price_gradient],this.shadow())
}
AOpsX=this.iDVtQ.lay_rect_price.clone()
AOpsX.translate(this.WxExj.x,this.WxExj.y) 
wGaSC.setRect(AOpsX.x+1,AOpsX.y+1,AOpsX.width,AOpsX.height)
Pnlac+=wGaSC.toHtml()
this.hsoiB.push(wGaSC)
Pnlac+="<div style=\"position:absolute;z-index:50;";
Pnlac+="left:"+AOpsX.x+"px;top:"+AOpsX.y+"px;";
Pnlac+="width:"+AOpsX.width+"px;";
Pnlac+="height:"+AOpsX.height+"px;";
Pnlac+="line-height:"+AOpsX.height+"px;";
Pnlac+="font-family:"+this.iDVtQ.prod_desc_font_family+";"
Pnlac+="font-size:"+this.iDVtQ.prod_price_font_size+"px;"
Pnlac+="color:"+this.iDVtQ.prod_price_col+";"
Pnlac+="text-align:center;"
Pnlac+="\">";
if(this.HAWod.unavail)
{
Pnlac+="/" 
}
else
{
Pnlac+=WA_formatPrice(this.HAWod.price)
}
Pnlac+="</div>";
}
if(this.iDVtQ.lay_rect_img.isValid())
{

wGaSC=new WA_GraphicElement(this.DHHoI+"-zone3",25,this.iDVtQ.img_has_shadow)
wGaSC.iDVtQ=this.iDVtQ
wGaSC.HAWod=this.HAWod
wGaSC.draw=function()
{
var iDVtQ=this.iDVtQ
var HAWod=this.HAWod
if(HAWod.img_thumb.length>0)
{
if(this.shadow())
{
WA_bg(this.canvasId(),this.VHXOD_thumb.width,this.VHXOD_thumb.height,0,0,'',["#000000"],this.shadow(),0,1.0,false)
}
}
else
{
WA_bg(this.canvasId(),this.rect().width,this.rect().height,0,0,'',["rgba(60,60,60,0.2)"],false)
}
}
AOpsX=this.iDVtQ.lay_rect_img.clone()
AOpsX.translate(this.WxExj.x,this.WxExj.y)
if(this.HAWod.img_thumb.length>0)
{
var gPIGs=new Size(AOpsX.width+1,AOpsX.height+1)
wGaSC.VHXOD_thumb=this.HAWod.size_thumb.clone()
if(this.iDVtQ.crop_thumb)
{
wGaSC.VHXOD_thumb=gPIGs
}
else
{
wGaSC.VHXOD_thumb.scale(gPIGs,true)
}
var KBHmV=Math.round((AOpsX.width-wGaSC.VHXOD_thumb.width)/2);
var qaEjm=Math.round((AOpsX.height-wGaSC.VHXOD_thumb.height)/2);
AOpsX.translate(KBHmV,qaEjm)
wGaSC.setRect(AOpsX.x,AOpsX.y,wGaSC.VHXOD_thumb.width,wGaSC.VHXOD_thumb.height)
}
else
{
wGaSC.setRect(AOpsX.x,AOpsX.y,AOpsX.width+1,AOpsX.height+1)
}
if(this.HAWod.img_thumb.length>0)
{
Pnlac+="<div style=\"position:absolute;z-index:100;";
Pnlac+="left:"+AOpsX.x+"px;top:"+AOpsX.y+"px;\" >";
Pnlac+="<a href=\"javascript:"+WfSQG+"\" >";
Pnlac+="<img border=0 src='"+this.HAWod.img_thumb+"' width='"+wGaSC.VHXOD_thumb.width+"px' height='"+wGaSC.VHXOD_thumb.height+"px'>"
Pnlac+="</a>"
Pnlac+="</div>"
}
Pnlac+=wGaSC.toHtml()
this.hsoiB.push(wGaSC)
}
return Pnlac;
}
this.TSMlI=function()
{
for(var i=0;i<this.hsoiB.length;i++)
{
var wGaSC=this.hsoiB[i]
wGaSC.registerDynamicCanvas()
}
}
this.DHHoI=DHHoI;
this.id=DHHoI;
this.index=OdLHT
this.HAWod=HAWod;
this.market=LVONK;
this.iDVtQ=LVONK.iDVtQ
this.hsoiB=new Array()
}
function TcCNA(INcCn)
{
this.aveQh=function()
{
var VsHUU="market-main-"+this.DHHoI
var dLrdr=html_getLayer(VsHUU)
var sKlja=this.XuHVs.products
var Jujdh=0;
var qqIDL=0;
var Pnlac=""
var vSIIE=0;
var BZwpc=0;
var LaIpd=this.iDVtQ.r_prod 
for(var i=0;i<sKlja.length;i++)
{
var HAWod=sKlja[i]
var uKiGH=new KUfsT(this,HAWod,i,this.DHHoI+"prod"+i)
HAWod.obj=uKiGH
uKiGH.WxExj=new Point(Jujdh,qqIDL)
Pnlac+=uKiGH.MJwXi()
BZwpc++;
if(BZwpc==this.iDVtQ.cols)
{
BZwpc=0;
vSIIE++;
qqIDL+=LaIpd.height
Jujdh=0;
}
else
{
Jujdh+=LaIpd.width
}
}
dLrdr.innerHTML=Pnlac
WA_exec_callback_opera_compliant(this,this.uxSnK)
}
this.uxSnK=function()
{
var sKlja=this.XuHVs.products
for(var i=0;i<sKlja.length;i++)
{
var HAWod=sKlja[i]
HAWod.obj.TSMlI()
}
}
this.struct=INcCn;
this.INcCn=INcCn;
this.DHHoI=INcCn.id;
this.id=INcCn.id;
this.XuHVs=INcCn.info
this.info=INcCn.info
this.iDVtQ=INcCn.info.design
}
function WA_loadScriptDlgMarket(hAAPe,DHHoI,nEqSM)
{
if(document.wa_dlg_market_js_loaded==true)
{
wdoAw([hAAPe,DHHoI,nEqSM])
return;
}
WA_Dialog.progress();
WA_loadScript('wa_dlg_emarket.js?v='+urlAntiCacheForPreview()+wa_global_market.id_modif_dlg_js,wdoAw,[hAAPe,DHHoI,nEqSM]);
}
function WA_showMarketCart()
{
WA_loadScriptDlgMarket("show_cart")
}
function WA_showMarketProduct(DHHoI,nEqSM)
{
WA_loadScriptDlgMarket("show_prod",DHHoI,nEqSM)
}
function wdoAw(svYjg)
{
document.wa_dlg_market_js_loaded=true;
var hAAPe=svYjg[0];
if(hAAPe=="show_cart") WA_displayDialogMarketCart()
if(hAAPe=="show_prod") WA_displayDialogMarketProduct(svYjg[1],svYjg[2])
}
function WA_getNumberMarketItemsInCart()
{
var TAGPt=parseInt(WA_GetCookie("crbst-card-nb_items"))
if(isNaN(TAGPt)) return 0;
return TAGPt;
}
function OuMdP(hAAPe,DXpYN)
{
var dLrdr=html_getLayer(hAAPe)
if(dLrdr)
{
if(!DXpYN)DXpYN=Translator.tr("My card\u0020(%) article(s)");
var ZjEbb=DXpYN
ZjEbb=ZjEbb.replace(/%/g,WA_getNumberMarketItemsInCart())
dLrdr.innerHTML=ZjEbb
}
}
function WA_refreshNumberMarketItemsInCart()
{
for(var hAAPe in document.wa_global_button_market_declaration)
{
var DXpYN=document.wa_global_button_market_declaration[hAAPe]
if(hAAPe.indexOf("market-cart-link")==0)
{
OuMdP(hAAPe,DXpYN)
}
else
{
var kcWBo=html_getLayer(hAAPe+"-div0"+"-text")
if(!kcWBo)kcWBo=hAAPe+"-div0"
var SrCnX=html_getLayer(hAAPe+"-div1"+"-text")
if(!SrCnX)SrCnX=hAAPe+"-div1"
OuMdP(kcWBo,DXpYN)
OuMdP(SrCnX,DXpYN)
}
}
}

-->
