<!--

function wGGnX(svYjg)
{
document.wa_search_index_js_loaded=true;
var bJlol=svYjg[0]
qbJvs();
bJlol.nBfVN=false;
bJlol.NpgDN()
}
function WA_onClickSearch()
{
var bJlol=WA_Dialog.getCurrent()
if(!bJlol)return;
if(bJlol.nBfVN==true) return;
bJlol.NpgDN()
}
function Btqim(tYSZH)
{
var tYSZH_value=tYSZH.value
var DnSXT=tYSZH_value;
DnSXT=removeAccentsFromString(DnSXT);
DnSXT=trimString(DnSXT);
var JAOXg=[",",";","\\.","'",":","/","`","\\?"];
for(var c=0;c<JAOXg.length;c++)
{
var reg=new RegExp(JAOXg[c],"g");
DnSXT=DnSXT.replace(reg," ")
}
var mgHcH=DnSXT.toLowerCase().split(" ");
var YnmlH=new Array();
for(var i=0;i<mgHcH.length;i++)
{
var w=trimString(mgHcH[i]);
if((w!=undefined)&&(w.length>2))
{
YnmlH.push(w);
}
}
YnmlH=YnmlH.sort(gQtxL);
var HJAuM_search=new Array()
for(var i=0;i<YnmlH.length;i++)
{
var w=YnmlH[i];
var OXOTf=""
for(var i2=0;i2<w.length;i2++)
{
var KPtGj=w.charCodeAt(i2);
if((KPtGj>125)||(KPtGj==38)||(KPtGj=='<')||(KPtGj=='>')||(KPtGj=='"'))
{
OXOTf+="&#"+KPtGj+";"
}
else
{
OXOTf+=w.charAt(i2);
}
}
HJAuM_search.push(OXOTf);
}

var CnlRo=new Array();
for(var i=0;i<HJAuM_search.length;i++)
{
var bJlol=HJAuM_search[i];
var UgNKB=true;
for(var i2=i+1;i2<HJAuM_search.length;i2++)
{
var OXOTf=HJAuM_search[i2];
if(OXOTf.indexOf(bJlol)>-1)
{
UgNKB=false;
break;
}
}
if(UgNKB) CnlRo.push(bJlol);
}
return CnlRo;
}
function WA_openSearchDialog(tYSZH,pDblg)
{
var bJlol=new WA_Dialog();
bJlol.KQiGA=tYSZH
bJlol.iNNtw=function(tYSZH_value)
{
this.LVeTS='search-dialog-input'
this.NdldX='search-dialog-select-filter'
this.TuQhL_windows_title_result="wa-result-windows-title"
this.EpMjK="wa-result-windows"
var srZOo="font-family:Arial;"
var EqrGu=srZOo+"color:"+this.getColorTheme(3)+";font-weight:bold;font-size:12px;"
this.initializeWindow(600,700)
var Pnlac=""
Pnlac+="<table border=0 cellpadding=0 cellspacing=0  style='width:100%;'>";
Pnlac+="<tr><td align=left style='"+EqrGu+"'>"
Pnlac+="<input type=text results=0 placeholder='' id='"+this.LVeTS+"' >&nbsp;&nbsp;"
Pnlac+="<input type=button value='"+Translator.tr("Search")+"' onclick='WA_onClickSearch()'>"
Pnlac+="&nbsp;&nbsp;"
Pnlac+="<select id='"+this.NdldX+"' onchange='WA_onClickSearch()'>"
Pnlac+="<option value='-1'>"+Translator.tr("All results")+"</option>"
Pnlac+="<option value='0'>"+Translator.tr("Pages results")+"</option>"
Pnlac+="<option value='2'>"+Translator.tr("Photos results")+"</option>"
Pnlac+="<option value='1'>"+Translator.tr("Articles results")+"</option>"
Pnlac+="</select>"
Pnlac+="<br><br>"
Pnlac+="</td>"
Pnlac+="</tr>";
Pnlac+="</table>"
Pnlac+="<div id='"+this.TuQhL_windows_title_result+"' style='"
Pnlac+="font-family:Arial;color:#ffffff;text-align:right;font-size:13px;";
Pnlac+="height:20px;line-height:20px;width:100%;background-color:"+this.getColorTheme(0)+";"
Pnlac+="' ></div>"
Pnlac+="<div id='"+this.EpMjK+"' style='";
Pnlac+="position:relative;overflow:auto;"
Pnlac+="border-style:solid;border-width:1px;border-color:"+this.getColorTheme(0)+";"
Pnlac+="background-color:#ffffff;width:"+this.vNhSn()+"px;height:"+this.SPPrC()+"px;'></div>"
this.writeContent(Pnlac)
var tYSZH=document.getElementById(this.LVeTS);
tYSZH.value=tYSZH_value
}
bJlol.EMLTD=function(Pnlac)
{
var wdkkl_title=document.getElementById(this.TuQhL_windows_title_result);
if(wdkkl_title)
{
wdkkl_title.innerHTML=Pnlac+"&nbsp;"
}
}
bJlol.closeWin=function()
{
this.KQiGA.focus()
this.intern_closeWin()
}
bJlol.onCustomKeypress=function(ZboZi)
{
if(ZboZi==13)
{
this.NpgDN()
return true;
}
if(ZboZi!=27)
{
this.bLMDA("")
this.EMLTD("");
}
return false;
}
bJlol.vNhSn=function()
{
return this.m_content_lx-2;
}
bJlol.SPPrC=function()
{
return this.m_content_ly-80;
}
bJlol.customUpdate=function()
{
var wdkkl=document.getElementById(this.EpMjK);
if(wdkkl)
{
html_SetSize(this.EpMjK,this.vNhSn(),this.SPPrC());
}
}
bJlol.bLMDA=function(Pnlac)
{
var wdkkl=document.getElementById(this.EpMjK);
wdkkl.innerHTML=Pnlac
}
bJlol.NpgDN=function()
{
var lpnXj_filter=document.getElementById(this.NdldX);
var vhUdl=lpnXj_filter.value
var tYSZH=document.getElementById(this.LVeTS);
this.KQiGA.value=tYSZH.value
var HJAuM_query=Btqim(tYSZH)
var MuitA=mHSeH(HJAuM_query,vhUdl)
var Pnlac=""
var srZOo="font-family:Arial;";
var wApab="color:#0000ff;text-decoration:underline;font-size:15px;";
var NttSt="color:#000000;font-size:13px;";
var IkYXg="color:#006600;font-size:13px;";
var fGIcU="color:#990099;font-size:12px;";
var txfmG="color:#006600;font-size:11px;";
Pnlac+="<table border=0 cellpadding=0 cellspacing=3  style='"+srZOo+"width:90%;'>";
var l_image=40;
for(var i=0;i<MuitA.length;i++)
{
var JFCVZ=MuitA[i]
var XuHVs=JFCVZ.page_reference;
var cwjhI=XuHVs.ePBNP(HJAuM_query);
var desc=XuHVs.m_description;
var url=XuHVs.url(Translator.m_lang_for_filename)
var MGIbH=false;
if((XuHVs.m_img.length>0))
{
if(isNaN(XuHVs.m_img_lx))
{
MGIbH=new Size(l_image,l_image)
}
else
{
MGIbH=new Size(XuHVs.m_img_lx,XuHVs.m_img_ly)
if(MGIbH.scale(new Size(l_image,l_image))==false)
{
MGIbH=new Size(l_image,l_image)
}
}
}
Pnlac+="<tr valign=top>"
if(MGIbH)
{
Pnlac+="<td width="+l_image+"px  align=center>"
Pnlac+="<a href='"+url+"'><img hspace=0 vspace=3  border=0  width=\""+MGIbH.width+"\" height=\""+MGIbH.height+"\" src=\""+XuHVs.m_img+"\"></a>";
Pnlac+="</td>"
}
Pnlac+="<td"
if(!MGIbH)
{
Pnlac+=" colspan=2"
}
Pnlac+=">"
Pnlac+="<a style='"+wApab+"' href='"+url+"'>"+cwjhI+"</a>";
Pnlac+=" <span style='"+txfmG+"'>"+Translator.tr("Pertinence")+" : "+Math.round(JFCVZ.scoring)+"</span>";
Pnlac+="<br>";
if(desc.length>0)
{
Pnlac+="<span style='"+NttSt+"'>"+XuHVs.afEMJ(HJAuM_query)+"</span><br>";
}
Pnlac+="<a style='"+IkYXg+"' href='"+url+"'>"+url+"</a><br><br>";
Pnlac+="</td>"
Pnlac+="</tr>"
}
Pnlac+="</table>" 
this.bLMDA(Pnlac)
if(MuitA.length==0)
{
this.EMLTD(Translator.tr("No results"))
}
else
{
this.EMLTD(Translator.tr("Search result")+" : "+MuitA.length)
}
tYSZH.focus()
}
bJlol.iNNtw(tYSZH.value)
if(document.wa_search_index_js_loaded==true)
{
bJlol.NpgDN()
}
else
{
bJlol.nBfVN=true;
bJlol.EMLTD("Loading search index...")
bJlol.bLMDA("<div width=100% align=center><img src='wa_loading.gif'></div>")
WA_loadScript(pDblg,wGGnX,[bJlol])
}
}
function mHSeH(HJAuM_query,vhUdl)
{
var KGrcq=false;
var hBEfG=new Array()
var OpvPe=CONST_WA_SEARCH_INDEX.m_array_index
var sFuXk=CONST_WA_SEARCH_INDEX.m_array_page_infos 
var HJAuM_search=HJAuM_query
for(var i=0;i<HJAuM_search.length;i++)
{
var w=HJAuM_search[i];
if(w.length>0)
{
hBEfG=new Array();
for(var index in OpvPe)
{
var taxYl=index.indexOf(w);
if(taxYl!=-1)
{
var list_refs=OpvPe[index];
for(var index_page in list_refs)
{
var ref=list_refs[index_page];
var obj_result=hBEfG[index_page];
if(!obj_result)
{
hBEfG[index_page]=new Object();
obj_result=hBEfG[index_page];
obj_result.list_langs=new Array();
}
var MqfFP=obj_result.list_langs;
for(var lng in ref)
{
var qFRFm=parseInt(ref[lng]);
qFRFm*=OvtJp.FkrRc(w,index);
if(!MqfFP[lng])
{
MqfFP[lng]=qFRFm;
}
else
{
MqfFP[lng]+=qFRFm;
}
}
}
}
}
if(KGrcq)
{
var gmkna=new Array();
for(var index in hBEfG)
{
for(var index2 in KGrcq)
{
if(index2==index)
{
gmkna[index]=hBEfG[index];
break;
}
}
}
hBEfG=gmkna;
}
KGrcq=hBEfG;
}
}
var NUffF=new Array();
var key_lang_page=Translator.m_lang;
var RLSgO=0;
for(var index_page in hBEfG)
{
var list_lng=hBEfG[index_page].list_langs;
var key_lang_reference="";
var txMUX_score=0;
var i=0;
for(var lng in list_lng)
{
if(i==0)
{
key_lang_reference=lng;
txMUX_score+=list_lng[lng];
}
if(lng==key_lang_page)
{
txMUX_score+=list_lng[lng];
key_lang_reference=lng;
break;
}
i++;
}
if(key_lang_reference.length==0)
{
key_lang_reference="#";
}
if(sFuXk[index_page])
{
var XuHVs=sFuXk[index_page][key_lang_reference];
if(XuHVs&&((vhUdl<0)||(vhUdl==XuHVs.m_type)))
{
var JFCVZ=new Array();
JFCVZ.page_reference=XuHVs;
JFCVZ.index_page=index_page;
JFCVZ.scoring=txMUX_score+XuHVs.UVmIH(HJAuM_search);
JFCVZ.test_index=RLSgO;
NUffF.push(JFCVZ);
RLSgO++;
}
}
}
NUffF=NUffF.sort(aYUQm);
return NUffF;
}
function qbJvs()
{
if(CONST_WA_SEARCH_INDEX.initialized==true) return;
CONST_WA_SEARCH_INDEX.initialized=true
CONST_WA_SEARCH_INDEX.m_array_index=new Array()
CONST_WA_SEARCH_INDEX.m_array_page_infos=new Array() 
var OdLHT=CONST_WA_SEARCH_INDEX.index
for(var nEqSM=0;nEqSM<OdLHT.length;nEqSM+=2)
{
var IWljY=OdLHT[nEqSM]
var AOpsX=OdLHT[nEqSM+1]
var txMUX_list_2=new Array();
var txMUX_list=AOpsX.split(",");
for(var OdLHT_ref0 in txMUX_list)
{
var CfHwn="#";
var OdLHT_ref=txMUX_list[OdLHT_ref0]
var Pnlac_score="";
var rpAQa=OdLHT_ref.indexOf(":");
if(rpAQa!=-1)
{
Pnlac_score=OdLHT_ref.substring(rpAQa+1);
OdLHT_ref=OdLHT_ref.substring(0,rpAQa);
}
var IdcCt="";
var KpFPR_info=OdLHT_ref.indexOf("@");
if(KpFPR_info!=-1)
{
IdcCt=OdLHT_ref.substring(KpFPR_info+1);
OdLHT_ref=OdLHT_ref.substring(0,KpFPR_info);
}
var KpFPR=OdLHT_ref.indexOf("|");
if(KpFPR!=-1)
{
CfHwn=OdLHT_ref.substring(KpFPR+1);
OdLHT_ref=OdLHT_ref.substring(0,KpFPR);
}
var OdLHT_page=OdLHT_ref;
if(IdcCt.length>0)
{
OdLHT_page+="@"+IdcCt;
}
if(!txMUX_list_2[OdLHT_page])
{
txMUX_list_2[OdLHT_page]=new Array();
}
var MqfFP=txMUX_list_2[OdLHT_page];
if(!MqfFP[CfHwn])
{
MqfFP[CfHwn]=Pnlac_score;
}
}
var jiALf_index=CONST_WA_SEARCH_INDEX.m_array_index
if(!jiALf_index[IWljY])
{
jiALf_index[IWljY]=txMUX_list_2;
}
else
{
for(var CfHwn in txMUX_list_2)
{
jiALf_index[IWljY][CfHwn]=txMUX_list_2[CfHwn];
}
}
}
var ENDTD=CONST_WA_SEARCH_INDEX.page_info;
var EIECD=CONST_WA_SEARCH_INDEX.m_array_page_infos
for(var nEqSM=0;nEqSM<ENDTD.length;nEqSM++)
{
var ikCBf=ENDTD[nEqSM]
var txMUX=ikCBf.ref;
if(txMUX)
{
var XuHVs=new OvtJp();
XuHVs.m_ref=txMUX;
XuHVs.parseAttributes(ikCBf);
if(!EIECD[txMUX])
{
EIECD[txMUX]=new Array();
}
var LhFsU=XuHVs.m_lang;
if(LhFsU.length==0)
{
LhFsU="#";
}
EIECD[txMUX][LhFsU]=XuHVs;
}
}
}
function OvtJp()
{
this.m_ref="";
this.m_img=""
this.JqqXf=function(Pnlac)
{
if(Pnlac==undefined) return""
return Pnlac
}
this.parseAttributes=function(ikCBf)
{
this.m_lang=ikCBf.lng;
this.m_url=ikCBf.url;
this.m_title=this.JqqXf(ikCBf.title);
this.m_title2=this.JqqXf(ikCBf.title2);
this.m_description=this.JqqXf(ikCBf.desc);
this.m_description2=this.JqqXf(ikCBf.desc2);
this.m_keywords=this.JqqXf(ikCBf.k);
this.m_img=this.JqqXf(ikCBf.img);
var img_size=ikCBf.img_size;
if(!img_size)img_size=""
this.m_type=parseInt(ikCBf.type)
if(isNaN(this.m_type))
{
this.m_type=0;
}
if(img_size.length>0)
{
var list_size=img_size.split(",");
if(list_size.length==2)
{
this.m_img_lx=parseInt(list_size[0])
this.m_img_ly=parseInt(list_size[1])
}
}
}
this.UVmIH=function(HJAuM_search)
{
var res=0;
for(var i=0;i<HJAuM_search.length;i++)
{
var w=HJAuM_search[i];
if(w.length>1)
{
res+=25*OvtJp.FkrRc(w,this.m_title2);
res+=15*OvtJp.FkrRc(w,this.m_description2);
res+=30*OvtJp.FkrRc(w,this.m_keywords);
}
}
return res;
}
this.url=function(lng)
{
if(this.m_lang=="all")
{
if(lng.length==0)
{
return this.m_url.replace(/@lng@/g,"") 
}
else
{
return this.m_url.replace(/@lng@/g,"_"+lng)
}
}
return this.m_url;
}
this.formatStringWithQuery=function(s,HJAuM_search)
{
var title_ref=s;
var title2=removeAccentsFromString(title_ref.toLowerCase());
var result=title_ref;
var result2=title2;
for(var i=0;i<HJAuM_search.length;i++)
{
var w=trimString(HJAuM_search[i]);
var len_w=w.length;
if(len_w>1)
{
var nb=0;
var ind0=0;
var ind_search=0;
var ind=0;
do
{
ind=result2.indexOf(w,ind_search);
if(ind>-1)
{
var index_1=ind+len_w;
var s0=result.substring(ind0,ind);
var sw=result.substring(ind,ind+len_w);
var s1=result.substring(index_1);
var s2_0=result2.substring(ind0,ind);
var s2_1=result2.substring(index_1);
result=s0+"<b>"+sw+"</b>"+s1;
result2=s2_0+"<b>"+w+"</b>"+s2_1;
ind_search=index_1+7;
}
nb++;
}
while(ind>0);
}
}
return result;
}
this.title=function()
{
var title=this.m_title;
if(title.length==0)
{
title="Page "+this.m_ref+"(no title !)";
}
return title;
}
this.ePBNP=function(HJAuM_search)
{
return this.formatStringWithQuery(this.title(),HJAuM_search);
}
this.afEMJ=function(HJAuM_search)
{
return this.formatStringWithQuery(this.m_description,HJAuM_search);
}
}
OvtJp.FkrRc=function(OUViU,match_w)
{
var qFRFm=0;
if(OUViU==match_w)
{
qFRFm=6.2;
}
else
{
var ind=match_w.indexOf(OUViU);
if(ind==0)
{
qFRFm=5;
}
else
if(ind>0)
{
qFRFm=1;
}
}
return qFRFm;
}
function gQtxL(a,b)
{
if(a.length<b.length) return-1;
else
if(a.length>b.length) return 1;
return 0;
}
function aYUQm(a,b)
{
if(b.scoring<a.scoring) return-1;
else
if(b.scoring>a.scoring) return 1;
if(a.page_reference.m_type<b.page_reference.m_type) return-1;
else
if(a.page_reference.m_type>b.page_reference.m_type) return 1;
return 0;
}

-->
