<!--

function jZgNJ(GrZOX)
{
document.wa_search_index_js_loaded=true;
var lmDOt=GrZOX[0]
uuEvn();
lmDOt.ZTjBi=false;
lmDOt.ROPWi()
}
function WA_onClickSearch()
{
var lmDOt=WA_Dialog.getCurrent()
if(!lmDOt)return;
if(lmDOt.ZTjBi==true) return;
lmDOt.ROPWi()
}
function iWWOW(EgcaV)
{
var EgcaV_value=EgcaV.value
var TKOAW=EgcaV_value;
TKOAW=removeAccentsFromString(TKOAW);
TKOAW=trimString(TKOAW);
var sTUQL_separator=[",",";","\\.","'",":","/","`","\\?"];
for(var c=0;c<sTUQL_separator.length;c++)
{
var reg=new RegExp(sTUQL_separator[c],"g");
TKOAW=TKOAW.replace(reg," ")
}
var KohPM=TKOAW.toLowerCase().split(" ");
var sTUQL_search=new Array();
for(var i=0;i<KohPM.length;i++)
{
var w=trimString(KohPM[i]);
if((w!=undefined)&&(w.length>1))
{
sTUQL_search.push(w);
}
}
sTUQL_search=sTUQL_search.sort(GkAtN);
var sTUQL_search_for_formating=new Array();
for(var i=0;i<sTUQL_search.length;i++)
{
var lmDOt=sTUQL_search[i];
var eLLMb_valid=true;
for(var i2=i+1;i2<sTUQL_search.length;i2++)
{
var rMiAW=sTUQL_search[i2];
if(rMiAW.indexOf(lmDOt)>-1)
{
eLLMb_valid=false;
break;
}
}
if(eLLMb_valid) sTUQL_search_for_formating.push(lmDOt);
}
return sTUQL_search_for_formating;
}
function WA_openSearchDialog(EgcaV,IHvBS)
{
var lmDOt=new WA_Dialog();
lmDOt.xbIaf=EgcaV
lmDOt.EEAsT=function(EgcaV_value)
{
this.BhkbB='search-dialog-input'
this.XjqJk_select_filter='search-dialog-select-filter'
this.EnJvf="wa-result-windows-title"
this.JHqWo="wa-result-windows"
var wmNFq="font-family:Arial;"
var eYFfq=wmNFq+"color:"+this.getColorTheme(3)+";font-weight:bold;font-size:12px;"
this.initializeWindow(600,700)
var mBKWx=""
mBKWx+="<table border=0 cellpadding=0 cellspacing=0  style='width:100%;'>";
mBKWx+="<tr><td align=left style='"+eYFfq+"'>"
mBKWx+="<input type=text results=0 placeholder='' id='"+this.BhkbB+"' >&nbsp;&nbsp;"
mBKWx+="<input type=button value='"+Translator.tr("Search")+"' onclick='WA_onClickSearch()'>"
mBKWx+="&nbsp;&nbsp;"
mBKWx+="<select id='"+this.XjqJk_select_filter+"' onchange='WA_onClickSearch()'>"
mBKWx+="<option value='-1'>"+Translator.tr("All results")+"</option>"
mBKWx+="<option value='0'>"+Translator.tr("Pages results")+"</option>"
mBKWx+="<option value='2'>"+Translator.tr("Photos results")+"</option>"
mBKWx+="<option value='1'>"+Translator.tr("Articles results")+"</option>"
mBKWx+="</select>"
mBKWx+="<br><br>"
mBKWx+="</td>"
mBKWx+="</tr>";
mBKWx+="</table>"
mBKWx+="<div id='"+this.EnJvf+"' style='"
mBKWx+="font-family:Arial;color:#ffffff;text-align:right;font-size:13px;";
mBKWx+="height:20px;line-height:20px;width:100%;background-color:"+this.getColorTheme(0)+";"
mBKWx+="' ></div>"
mBKWx+="<div id='"+this.JHqWo+"' style='";
mBKWx+="position:relative;overflow:auto;"
mBKWx+="border-style:solid;border-width:1px;border-color:"+this.getColorTheme(0)+";"
mBKWx+="background-color:#ffffff;width:"+this.DnatI()+"px;height:"+this.MdwgH()+"px;'></div>"
this.writeContent(mBKWx)
var EgcaV=document.getElementById(this.BhkbB);
EgcaV.value=EgcaV_value
}
lmDOt.WIkYa=function(mBKWx)
{
var IrshU=document.getElementById(this.EnJvf);
if(IrshU)
{
IrshU.innerHTML=mBKWx+"&nbsp;"
}
}
lmDOt.closeWin=function()
{
this.xbIaf.focus()
this.intern_closeWin()
}
lmDOt.onCustomKeypress=function(sTJxK)
{
if(sTJxK==13)
{
this.ROPWi()
return true;
}
if(sTJxK!=27)
{
this.moroo("")
this.WIkYa("");
}
return false;
}
lmDOt.DnatI=function()
{
return this.m_content_lx-2;
}
lmDOt.MdwgH=function()
{
return this.m_content_ly-80;
}
lmDOt.customUpdate=function()
{
var VkiSj=document.getElementById(this.JHqWo);
if(VkiSj)
{
html_SetSize(this.JHqWo,this.DnatI(),this.MdwgH());
}
}
lmDOt.moroo=function(mBKWx)
{
var VkiSj=document.getElementById(this.JHqWo);
VkiSj.innerHTML=mBKWx
}
lmDOt.ROPWi=function()
{
var OCmfK=document.getElementById(this.XjqJk_select_filter);
var GZRxc=OCmfK.value
var EgcaV=document.getElementById(this.BhkbB);
this.xbIaf.value=EgcaV.value
var sTUQL_query=iWWOW(EgcaV)
var sTUQL_results=ICJUo(sTUQL_query,GZRxc)
var mBKWx=""
var wmNFq="font-family:Arial;";
var eZXKu="color:#0000ff;text-decoration:underline;font-size:15px;";
var WmhLj="color:#000000;font-size:13px;";
var MhnnR="color:#006600;font-size:13px;";
var KjRsT="color:#990099;font-size:12px;";
var AWLjJ="color:#006600;font-size:11px;";
mBKWx+="<table border=0 cellpadding=0 cellspacing=3  style='"+wmNFq+"width:90%;'>";
var l_image=40;
for(var i=0;i<sTUQL_results.length;i++)
{
var WcvMV=sTUQL_results[i]
var jRSWE=WcvMV.page_reference;
var xSZpc=jRSWE.ugOnL(sTUQL_query);
var desc=jRSWE.m_description;
var url=jRSWE.url(Translator.m_lang_for_filename)
var OECqK=false;
if((jRSWE.m_img.length>0))
{
if(isNaN(jRSWE.m_img_lx))
{
OECqK=new Size(l_image,l_image)
}
else
{
OECqK=new Size(jRSWE.m_img_lx,jRSWE.m_img_ly)
if(OECqK.scale(new Size(l_image,l_image))==false)
{
OECqK=new Size(l_image,l_image)
}
}
}
mBKWx+="<tr valign=top>"
if(OECqK)
{
mBKWx+="<td width="+l_image+"px  align=center>"
mBKWx+="<a href='"+url+"'><img hspace=0 vspace=3  border=0  width=\""+OECqK.width+"\" height=\""+OECqK.height+"\" src=\""+jRSWE.m_img+"\"></a>";
mBKWx+="</td>"
}
mBKWx+="<td"
if(!OECqK)
{
mBKWx+=" colspan=2"
}
mBKWx+=">"
mBKWx+="<a style='"+eZXKu+"' href='"+url+"'>"+xSZpc+"</a>";
mBKWx+=" <span style='"+AWLjJ+"'>"+Translator.tr("Pertinence")+" : "+WcvMV.scoring+"</span>";
mBKWx+="<br>";
if(desc.length>0)
{
mBKWx+="<span style='"+WmhLj+"'>"+jRSWE.Nhqag(sTUQL_query)+"</span><br>";
}
mBKWx+="<a style='"+MhnnR+"' href='"+url+"'>"+url+"</a><br><br>";
mBKWx+="</td>"
mBKWx+="</tr>"
}
mBKWx+="</table>" 
this.moroo(mBKWx)
if(sTUQL_results.length==0)
{
this.WIkYa(Translator.tr("No results"))
}
else
{
this.WIkYa(Translator.tr("Search result")+" : "+sTUQL_results.length)
}
EgcaV.focus()
}
lmDOt.EEAsT(EgcaV.value)
if(document.wa_search_index_js_loaded==true)
{
lmDOt.ROPWi()
}
else
{
lmDOt.ZTjBi=true;
lmDOt.WIkYa("Loading search index...")
lmDOt.moroo("<div width=100% align=center><img src='wa_loading.gif'></div>")
WA_loadScript(IHvBS,jZgNJ,[lmDOt])
}
}
function ICJUo(sTUQL_query,GZRxc)
{
var sTUQL_result2=false;
var sTUQL_result=new Array()
var SehOQ=CONST_WA_SEARCH_INDEX.m_array_index
var XtjcH=CONST_WA_SEARCH_INDEX.m_array_page_infos 
var sTUQL_search=sTUQL_query
for(var i=0;i<sTUQL_search.length;i++)
{
var w=sTUQL_search[i];
if(w.length>0)
{
sTUQL_result=new Array();
for(var index in SehOQ)
{
var bRYPK=index.indexOf(w);
if(bRYPK!=-1)
{
var list_refs=SehOQ[index];
for(var index_page in list_refs)
{
var ref=list_refs[index_page];
var obj_result=sTUQL_result[index_page];
if(!obj_result)
{
sTUQL_result[index_page]=new Object();
obj_result=sTUQL_result[index_page];
obj_result.list_langs=new Array();
}
var Vhico=obj_result.list_langs;
for(var lng in ref)
{
var ZhLCd=parseInt(ref[lng]);
ZhLCd*=LfOdC.eugOK(w,index);
if(!Vhico[lng])
{
Vhico[lng]=ZhLCd;
}
else
{
Vhico[lng]+=ZhLCd;
}
}
}
}
}
if(sTUQL_result2)
{
var sTUQL_result3=new Array();
for(var index in sTUQL_result)
{
for(var index2 in sTUQL_result2)
{
if(index2==index)
{
sTUQL_result3[index]=sTUQL_result[index];
break;
}
}
}
sTUQL_result=sTUQL_result3;
}
sTUQL_result2=sTUQL_result;
}
}
var sTUQL_final_result=new Array();
var key_lang_page=Translator.m_lang;
var CVetx_result=0;
for(var index_page in sTUQL_result)
{
var list_lng=sTUQL_result[index_page].list_langs;
var key_lang_reference="";
var GNuco_score=0;
var i=0;
for(var lng in list_lng)
{
if(i==0)
{
key_lang_reference=lng;
GNuco_score+=list_lng[lng];
}
if(lng==key_lang_page)
{
GNuco_score+=list_lng[lng];
key_lang_reference=lng;
break;
}
i++;
}
if(key_lang_reference.length==0)
{
key_lang_reference="#";
}
var jRSWE=XtjcH[index_page][key_lang_reference];
if(jRSWE&&((GZRxc<0)||(GZRxc==jRSWE.m_type)))
{
var WcvMV=new Array();
WcvMV.page_reference=jRSWE;
WcvMV.index_page=index_page;
WcvMV.scoring=GNuco_score+jRSWE.hlDeK(sTUQL_search);
WcvMV.test_index=CVetx_result;
sTUQL_final_result.push(WcvMV);
CVetx_result++;
}
}
sTUQL_final_result=sTUQL_final_result.sort(dHxqe);
return sTUQL_final_result;
}
function uuEvn()
{
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 ZSDjW=CONST_WA_SEARCH_INDEX.index
for(var bIrLH=0;bIrLH<ZSDjW.length;bIrLH+=2)
{
var nLAVX=ZSDjW[bIrLH]
var UVVvT=ZSDjW[bIrLH+1]
var Ntwhl_2=new Array();
var Ntwhl=UVVvT.split(",");
for(var ZSDjW_ref0 in Ntwhl)
{
var mQfGm="#";
var ZSDjW_ref=Ntwhl[ZSDjW_ref0]
var YnOHn="";
var ltlms_score=ZSDjW_ref.indexOf(":");
if(ltlms_score!=-1)
{
YnOHn=ZSDjW_ref.substring(ltlms_score+1);
ZSDjW_ref=ZSDjW_ref.substring(0,ltlms_score);
}
var mBKWx_infos="";
var LwSsN=ZSDjW_ref.indexOf("@");
if(LwSsN!=-1)
{
mBKWx_infos=ZSDjW_ref.substring(LwSsN+1);
ZSDjW_ref=ZSDjW_ref.substring(0,LwSsN);
}
var ltlms=ZSDjW_ref.indexOf("|");
if(ltlms!=-1)
{
mQfGm=ZSDjW_ref.substring(ltlms+1);
ZSDjW_ref=ZSDjW_ref.substring(0,ltlms);
}
var ZSDjW_page=ZSDjW_ref;
if(mBKWx_infos.length>0)
{
ZSDjW_page+="@"+mBKWx_infos;
}
if(!Ntwhl_2[ZSDjW_page])
{
Ntwhl_2[ZSDjW_page]=new Array();
}
var Vhico=Ntwhl_2[ZSDjW_page];
if(!Vhico[mQfGm])
{
Vhico[mQfGm]=YnOHn;
}
}
var OsVQX_index=CONST_WA_SEARCH_INDEX.m_array_index
if(!OsVQX_index[nLAVX])
{
OsVQX_index[nLAVX]=Ntwhl_2;
}
else
{
for(var mQfGm in Ntwhl_2)
{
OsVQX_index[nLAVX][mQfGm]=Ntwhl_2[mQfGm];
}
}
}
var sTUQL_page_infos=CONST_WA_SEARCH_INDEX.page_info;
var OsVQX_page_infos=CONST_WA_SEARCH_INDEX.m_array_page_infos
for(var bIrLH=0;bIrLH<sTUQL_page_infos.length;bIrLH++)
{
var xJHls=sTUQL_page_infos[bIrLH]
var GNuco=xJHls.ref;
if(GNuco)
{
var jRSWE=new LfOdC();
jRSWE.m_ref=GNuco;
jRSWE.parseAttributes(xJHls);
if(!OsVQX_page_infos[GNuco])
{
OsVQX_page_infos[GNuco]=new Array();
}
var TVdfQ=jRSWE.m_lang;
if(TVdfQ.length==0)
{
TVdfQ="#";
}
OsVQX_page_infos[GNuco][TVdfQ]=jRSWE;
}
}
}
function LfOdC()
{
this.m_ref="";
this.m_img=""
this.bvpYS=function(mBKWx)
{
if(mBKWx==undefined) return""
return mBKWx
}
this.parseAttributes=function(xJHls)
{
this.m_lang=xJHls.lng;
this.m_url=xJHls.url;
this.m_title=this.bvpYS(xJHls.title);
this.m_title2=this.bvpYS(xJHls.title2);
this.m_description=this.bvpYS(xJHls.desc);
this.m_description2=this.bvpYS(xJHls.desc2);
this.m_keywords=this.bvpYS(xJHls.k);
this.m_img=this.bvpYS(xJHls.img);
var img_size=xJHls.img_size;
if(!img_size)img_size=""
this.m_type=parseInt(xJHls.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.hlDeK=function(sTUQL_search)
{
var res=0;
for(var i=0;i<sTUQL_search.length;i++)
{
var w=sTUQL_search[i];
if(w.length>1)
{
res+=25*LfOdC.eugOK(w,this.m_title2);
res+=15*LfOdC.eugOK(w,this.m_description2);
res+=30*LfOdC.eugOK(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,sTUQL_search)
{
var title_ref=s;
var title2=removeAccentsFromString(title_ref.toLowerCase());
var result=title_ref;
var result2=title2;
for(var i=0;i<sTUQL_search.length;i++)
{
var w=trimString(sTUQL_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.ugOnL=function(sTUQL_search)
{
return this.formatStringWithQuery(this.title(),sTUQL_search);
}
this.Nhqag=function(sTUQL_search)
{
return this.formatStringWithQuery(this.m_description,sTUQL_search);
}
}
LfOdC.eugOK=function(DpTgu,match_w)
{
var ZhLCd=0;
if(DpTgu==match_w)
{
ZhLCd=6.2;
}
else
{
var ind=match_w.indexOf(DpTgu);
if(ind==0)
{
ZhLCd=5;
}
else
if(ind>0)
{
ZhLCd=1;
}
}
return ZhLCd;
}
function GkAtN(a,b)
{
if(a.length<b.length) return-1;
else
if(a.length>b.length) return 1;
return 0;
}
function dHxqe(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;
}

-->
