/* --- v1.2.05.05b --- */

var yB=[],IE,NS4; yB.ualc=navigator.userAgent.toLowerCase();

/*@cc_on
@if (@_jscript_version <= 3.01) IE=4
@elif (@_jscript_version <= 5.1) IE=5
@elif (@_jscript_version <= 5.5) IE=5.5
@elif (@_jscript_version <= 5.6) IE=6
@elif (@_jscript_version > 5.6) IE=7
@end @*/

//checks for different browsers
/* Based on browser sniffer v1.8 by Mark Wilton-Jones http://www.howtocreate.co.uk/jslibs/
   Please see http://www.howtocreate.co.uk/jslibs/termsOfUse.html for terms of use */

if(IE){yB[0]='ie'+IE}
else if(window.controllers=='[object XULControllers]'){yB[0]='gek'}
else if(document.all&&document.getElementById&&navigator.savePreferences&&(yB.ualc.indexOf('netfront')<0)&&navigator.appName!='Blazer'){yB[0]='es5'}
else if((yB.KDE=navigator.vendor=='KDE')||(document.childNodes&&(!document.all||navigator.accentColorName)&&!navigator.taintEnabled)){
	yB[0]='kde';
	yB.K=1;
	if (!yB.KDE && (/WebKit\/(\d+)/.exec(navigator.appVersion))) {yB.WK=RegExp.$1;yB[0]='saf'}
	yB.Kcss=yB.KDE || (yB.WK && yB.WK<500);
	}
else if(navigator.__ice_version){yB[0]='ice'}
else if(window.ScriptEngine&&ScriptEngine().indexOf('InScript')+1){if(document.createElement){yB[0]='ic3'}else{yB[0]='icb'}}
else if(yB.ualc.indexOf('hotjava')+1&&typeof(navigator.accentColorName)=='undefined'){yB[0]='hjv'}
else if(document.layers&&!document.classes){yB[0]='omn'}
else if(document.layers&&!navigator.mimeTypes['*']){yB[0]='esc'}
else if(document.layers){yB[0]='ns4';NS4=1}
else if((window.opera||(navigator.mimeTypes&&navigator.mimeTypes['...'/*application/x-opera-configuration*/]))&&document.childNodes){
	yB[0]='op7+';
	if (window.opera && opera.version) yB[0]='op'+opera.version();
	}
else if(yB.ualc.indexOf('opera')+1){yB[0]='opr'}
else if(navigator.appName.indexOf('WebTV')+1){yB[0]='wtv'}
else if(yB.ualc.indexOf('netgem')+1){yB[0]='nbx'}
else if(yB.ualc.indexOf('opentv')+1){yB[0]='otv'}
else if(yB.ualc.indexOf('ipanel')+1){yB[0]='ipn'}
else if(document.getElementById&&!document.childNodes){yB[0]='clu'}
else if(navigator.product=='Gecko'&&!navigator.savePreferences){yB[0]='gek?'}
else if(navigator.product&&navigator.product.indexOf('Hv')==0){yB[0]='hv3'}
else if(document.getElementById&&((yB.ualc.indexOf('netfront')+1)||navigator.appName=='Blazer'||navigator.product=='Gecko'||(navigator.appName.indexOf('PSP')+1)||(navigator.appName.indexOf('PLAYSTATION3')+1))){yB[0]='nf3'}
else if(document.getElementById){yB[0]='ie5?'}
else if(document.all&&navigator.appName!='Microsoft Pocket Internet Explorer'){yB[0]='ie4?'}
else if((yB.ualc.indexOf('msie')+1)&&window.ActiveXObject){yB[0]='pie'}
else {yB[0]='oth'}

/* ------ */


var BdEv=[];
function addEvent(e,type,fn) {
 if (type=='body') {BdEv[BdEv.length]=fn;return true;}
 if (e.addEventListener) {
	e.addEventListener(type,fn,false);
	return true;}
 else if (e.attachEvent) return e.attachEvent('on'+type,fn);
 return false;
}

(function(){

function bLoaded(c){
 for (var i=0,e;e=BdEv[i];i++) {try{e();}catch(e){}}
 BdEv=[]
}

addEvent(window,'load',bLoaded);
addEvent(window,'DOMContentLoaded',bLoaded);

// for IE
/*@cc_on
@if (@_win32)
document.write('<script id=__ie_onload defer src="//:"></script>');
var s=document.getElementById('__ie_onload');
if(s)s.onreadystatechange=function(){if(this.readyState=='complete')bLoaded()}
@end @*/

// for Safari/webkit/kde
if (yB.K)
 var _t_ = setInterval(function(){
   if (/loaded|complete/.test(document.readyState)) {clearInterval(_t_);bLoaded();}
   },10)

})();

var css;
function addStyle(n,rule) {
 if (!n || !rule) return
 if (!css) {
    css=document.styleSheets[0];
    if (!css){
	document.getElementsByTagName('head')[0].appendChild(document.createElement('style'))
	if (!css)css=document.styleSheets[0];
	}
    if(!css.rules) css.rules=css.cssRules;
    }
 var l=css.rules.length;
 if (css.insertRule) css.insertRule(n+' {'+rule+'}',l);
 else if (css.addRule) css.addRule(n,rule);
 else return;
 if (yB.Kcss) { // bug KDE Safari<v3
    css.rules[l].style.orphans='inherit';
    css.rules[l].style.orphans='';
    }
 return css.rules[l].style;
}

function cancelBub(e) {
 if(typeof e!='object') return;
 if(e.stopPropagation)e.stopPropagation();
 else e.cancelBubble=true;
}

function preventDef(e) {
 if(typeof e!='object') return;
 if(e.preventDefault)e.preventDefault();
 else e.returnValue=false;
}
	
function parse(s) {
 var r=[];
 if (s) for (var i=0,k,a=s.split(/[;,]/);i<a.length;i++) {k=a[i].split(':');if(k[0]=k[0].trim())r[k[0]]=k[1];}
 return r;
}

function setCookie(n,v,exp,path,dom,sec) {
 var expD;
 if (exp) {expD=new Date((new Date).valueOf()+(exp*86400000));}
 document.cookie=n+"="+v.replace(/;/g,'%3B')+
	(exp?";expires="+expD.toGMTString():"")+
	(path?";path="+path:"")+
	(dom?";domain="+dom:"")+
	(sec?";secure":"");
}

function getCookie(n){
 var ck=document.cookie.split(/; */),i,c,p=0;
 for (i=0;c=ck[i];i++) {
     c=c.split('=');
     if (c[0]==n) return unescape(c[1]);
     }
}

function delCookie(n,path,dom){
 if (getCookie(n)) setCookie(n,'',-1,path,dom);
}


(function(){

 // == Prototypes ==
 String.prototype.trim=function(){
  return this.replace(/^\s+|\s+$/g,'');
 }

 // IE5
 try{undefined}catch(e){var undefined}
 if(typeof decodeURIComponent=='undefined')decodeURIComponent=function(s){s=unescape(s);var S,M=[0,192,224,240,248],m,c,i,j,a,v;for(i=0;i<s.length;i++){c=s.charCodeAt(i);S=s.charAt(i);if(c&128)for(j=1;m=M[j+1];j++){if((c&m)==M[j]){a=c&(~m&255);for(k=1;k<=j;k++){v=s.charCodeAt(i+k);S+=s.charAt(i+k);if((v&192)==128)a=(a<<6)+(v&63);else throw(0);}s=s.replace(new RegExp(S),String.fromCharCode(a));i-=j-1;break;}}}return s;}


 // ==== Show/hide toggle ====
 var tHid=0,shK=[],shN=[],shC=[],shS=[],hHost;
 // IE
 /*@
 function hashHost(){
  for(var i=0,H=0,l=location.host;i<l.length;i++)H+=l.charCodeAt(i);
  return (H&0x3FF).toString(36);
 }
 hHost='/'+hashHost();
 @*/

 function prevSib(n){
  var e=n;
  while (n) {
    while (e=e.previousSibling) if(e.nodeType==1) return e;
    e=n=n.parentNode;
    }
  return;
 }

 function storeSH(){
  var S='',path=IE?location.pathname.replace(/[^\/]*$/,''):location.pathname,n=IE?'sh'+hHost+location.pathname:'sh';
  for (i in shN) shC[i]=shN[i]?1:0;
  for (i in shC) {if (shC[i]!=shK[i] && shK[i]!=undefined) S+=i+':'+(shC[i]>0?1:0)+',';}
  if (S) {if(S!=getCookie(n))setCookie(n,S,8,path);}
  else delCookie(n,path);
 }

 function loadSH(){
  var n=IE?'sh'+hHost+location.pathname:'sh';
  return parse(getCookie(n));
 }

 function toggle(E) {
  cancelBub(E||event);
  var e=this.div.style;
  if ((E==1) && !e.display) {return;}
  if ((E==-1) && e.display) {return;}
  e.display=e.display?'':'none';
  if(this.div.k)shN[this.div.id]=!e.display;
  this.style.visibility='hidden';
  this.style.visibility='';
  this.innerHTML=e.display?this.v0:this.v1;
  if (e.display) tHid++; else tHid--;
  return false;
 }

 var ids=[],allID;
 function ID(s){return document.getElementById(s)}
 // special Safari<v3
 if (yB.WK && yB.WK<500) ID=function(s) {
  if (!ids[s]) {
   ids[s]=[];
   if (!allID) {
      allID=[];
      var el=document.body.getElementsByTagName('*');
      for (var j=0;e=el[j];j++) if(e.id=='shh' || e.id=='shhd')allID.push(e);
      }
   for (var j=0,e;e=allID[j];j++) if(e.id==s)ids[s].push(e);
   }
  return ids[s].shift();
 }

 if (addEvent(window,'body',function(){
	var ckR=0;
	for (var e,i=0;e=ID('shh')||ID('shhd')||ID('shhs');i++) {
	  var sh=parse(e.getAttribute('sh'));
	  if (sh['ts']) { 
	     if (e.id!='shhs') {e.oid=e.id;e.id='shhs'; continue;}
	     e.id=e.oid;
	     }
	  var f=document.createElement('a'),d=e.id=='shhd';
	  if (sh['id']) {
	     if (!ckR) {ckR=1;shC=loadSH();addEvent(window,'unload',storeSH);}
	     e.id=sh['id'];
	     shK[e.id]=d?1:0;
	     e.k=1;
	     if (shC[e.id]!=undefined) {d=shC[e.id]>0?true:false;}
	     if (sh['s'] && d) shS[sh['s']]=true;
	     }
	  else e.id+=i;
	  if (sh['ts']) {d=shS[sh['ts']];}
	  if (!d) {e.style.display='none';tHid++;}
	  e.sht=f;f.div=e;
	  f.v0=sh['v0']||'[afficher]';f.v1=sh['v1']||'[masquer]';f.innerHTML=d?f.v1:f.v0;
	  f.href='javascript:;';f.onclick=toggle;
	  f.className=sh['tCl'] || "shht"+(sh['tClp']?' '+sh['tClp']:'');
	  var a=sh['a'],w=parseInt(sh['a0']) || -2;
	  if (a && (a=document.getElementById(a)));
	  else a=e;
	  
	  try {
	  if (w==-3) {
	     var n=prevSib(a);
	     if (n) {
		if (n.nodeName=='BR') n.parentNode.insertBefore(f,n);
		else n.appendChild(f);
		}
	     }
	  else if (w==-2) a.parentNode.insertBefore(f,a);
	  else if (w==-1) a.insertBefore(f,a.firstChild);
	  else if (w==1) a.appendChild(f);
	  else if (w==2) a.parentNode.insertBefore(f,a.nextSibling);
	  else if (w==3) a.parentNode.appendChild(f);
	  // prepend space _if no space_ (bug IE: double space)
	  e=f.previousSibling||f.parentNode.previousSibling;
	  while(e && e.nodeType!=3)e=e.lastChild;
	  if (e && !e.data.match(/\s$/)) f.parentNode.insertBefore(document.createTextNode(' '),f)
	  }catch(e){}
	  }
	}))
   document.write('<style type="text/css">#shh {display: none} .shht {-moz-outline:none;outline:none;}</style>');


 // ==== highlight search keywords ====

 function isVis(e) {
  while (tHid && (e=e.parentNode) && !(e.offsetWidth>0)) {
    if (e.sht) {e.sht.onclick(1);}
    }
 }

 function wildacct(s){
  return s.replace(new RegExp('(oe|\x9C|\x8C|'+String.fromCharCode(338,124,339)+')','gi'),'(oe\x01'+String.fromCharCode(339)+')').replace(/[aáàâä]/gi,'[aáàâä]').replace(/[eéèêë]/gi,'[eéèêë]').replace(/[iíìîï]/gi,'[iíìîï]').replace(/[oóòôö]/gi,'[oóòôö]').replace(/[uúùûü]/gi,'[uúùûü]').replace(/[cç]/gi,'[cç]').replace(/[nñ]/gi,'[nñ]').replace(/\\?[s$]/gi,'[s$]').replace(/[ '-]+/g,'[\\s  )(.,;:\'-]')
 }

 function unEsc(s) {
  if (s.search(/%20/)<0) s=s.replace(/\+/g,' ');
  try{return decodeURIComponent(s);}
  catch(e){return unescape(s);}
 }

 function HL(s){
  if (s==null || s.length==0) return;
  s=unEsc(s).replace(/(^|\W)(cache|site|link|(all)?inurl):[^ ]+/gi,'$1').trim();
  if (s.length==0) return;
  s=s.replace(/[*().,+:;!?-]/g,' ');
  s='"'+s.replace(/[""]/g,' ').split('').join('%01')+'" '+s
  var re,re0,re2,p=s.split('"'),p2=[],par=0;
  for (var i=0;i<p.length;i++) {
      if (!p[i]) par=1
      else if(par){
	p[i]=p[i].trim().replace(/ +/g,'%20');
	if (i>1) p2[p2.length]=p[i];
	par=0;}
      else par=1;
      }

  function R(a){return a.join(' ').trim().replace(/ +/g,'|').replace(/([\[\]$])/g,'\\$1').replace(/(%01)?%20(%01)?/g,' +').replace(/%01/g,' *')}
  s=wildacct(R(p).split('|').sort(function(a,b){return b.length-a.length}).join('|'));

  try{
   re0=new RegExp('('+s.split('|')[0].replace(/\x01/g,'|')+')','i');
   re=new RegExp('('+s.replace(/\x01/g,'|')+')','i');
   if (p2.length) re2=new RegExp('^('+wildacct(R(p2))+')$','i');
  }catch(e){return;}

  var M=null,pos,st,st0,stpn,st1,c=0,c0=0,c1=0,pn,pne,pnO=0;

  function searchInNode(n,re){
   var t=(new Date).valueOf();
   function nextNode(n) {
    var NN=n.firstChild||n.nextSibling;
    if (NN&&NN.nodeType==1 && (NN.tagName=='SCRIPT'||NN.tagName=='NOSCRIPT'||NN.tagName=='STYLE'))NN=NN.nextSibling;
    if (!NN) for (var p=n.parentNode;!NN && p;p=p.parentNode) {NN=p.nextSibling;}
    return NN;
   }
   
   while(n){

   if (n.nodeType==3) {
      if(M){
	var d=pos+M.length;
        pos=n.data.substr(d).search(re);
	if (pos>=0) pos+=d;
	M=null;
	}
      else pos=n.data.search(re);

      if(pos>=0){
	var cl='HL',m=0,M=RegExp.$1;
	if (M.length>1) {isVis(n);m=1;}
	if (m && M.search(re0)==0) {cl+=' HL0';c0++;m=-1;}
	else {
	 if (M.length>6 && re2 && M.search(re2)==0) {cl+=' HL1';c1++;}
	 if (pn>0 && (pos==0 || /^[\s  )(.,;:''-]*$/.test(n.data.substr(0,pos))) ) { 
	  cl+=' HLpn';
	  if(pne){pne.className+=' HLpn';pne=null;pnO++;}
	  pnO++;
	  m=1;
	  }
	 else pne=true;
	 }
	pn=m;
	if(m){
	  c++;
	  var mid=n.splitText(pos),e=document.createElement('SPAN');
	  mid.splitText(M.length);
	  n=mid.cloneNode(true);
	  if(pne)pne=e;
	  M=null;
	  e.className=cl;
	  e.appendChild(n);
	  mid.parentNode.replaceChild(e,mid);
	  }
	else if ((M.length+pos)>=n.data.length) M=null;
	}
      else if (pn && ! /^[\s  -]*$/.test(n.data)) pn=0;
      }
   else if (n.nodeName=='TR') pn=0;
   if (!M) n=nextNode(n);
   
   if (t+300<(new Date).valueOf()) {
      if (c && !st) setTimeout(function(){st=addStyle('.HL','background-color:yellow !important;color:black !important;')},0);
      setTimeout(function(){searchInNode(n,re)},0);
      return;
      }
   }

   if (c) {
      if (!st) st=addStyle('.HL','background-color:yellow !important;color:black !important;');
      if (c0 && c!=c0) st0=addStyle('.HL0','background-color:red !important;color:white !important;');
      if (pnO && pnO+c0!=c) stpn=addStyle('.HLpn','background-color:lightgreen !important;');
      if (c1 && c!=c1) st1=addStyle('.HL1','background-color: #CCFF66 !important;');
      setTimeout(function(){st.cssText='';if(st1)st1.cssText='';if(stpn)stpn.cssText='';if(st0)st0.cssText=''},50000);
      }
  }

  searchInNode(document.body,re);
  return c;
 }

 function SrchHL(){
  var r=document.referrer,i,a,s='',ra,Q=[];Q.s='';
  if (r.split('/')[2]==location.hostname) return;
  i=r.indexOf('?');
  if (i<0) return;
  ra=r.substr(i+1).split('&');
  for (i=0; a=ra[i]; i++) {
      a=a.split('=');
      if (a.length<=1 || !a[1]) continue;
      if (a[0]=='q' || a[0]=='query' || a[0]=='keywords' || a[0]=='p' || a[0]=='rdata') {Q[Q.length]=a[1]}
      else if (a[0]=='as_q'||a[0]=='as_oq') {Q.s+=' '+a[1]}
      else if (a[0]=='as_epq') {Q.s+=' "'+a[1]+'"'}
      }
  for (i in Q) {if(Q[i].length>s.length)s=Q[i];}
  if (s) HL(s);
 }

 addEvent(window,'body',function(){setTimeout(SrchHL,0)});

})()
