//TRBshowBanner=((TRBsection==TRBchannel+"_Accueil")||(TRBsection.indexOf("Bourse_")==0)||(TRBsection.indexOf("Dossiers_")==0)||(TRBsection.indexOf("AW_")==0)||(TRBsection=="AWA")||(TRBsection=="APA")||(TRBsection.indexOf("Archives_Resultats")==0)||(TRBchannel=="Depeches")||(TRBsection.indexOf("AP_")==0)||(TRBsection.indexOf("APG_")==0)||(TRBsection.indexOf("Tour-de-France")!=-1))?1:0;
//TRBhideSky=((TRBsection.indexOf("AW_")==0)||(TRBsection.indexOf("AP_")==0)||(TRBsection.indexOf("APG_")==0)||(TRBsection=="APA")||(TRBsection=="AWA")||((TRBsection.indexOf("Bourse_")==0)&&(TRBsection.indexOf("_Fiche")>0)))?1:0;

function TRBinit(){
//TRBshowClock();
}

function TRBrecursiveDelete(object){
var failed;
for(obj in object){
failed=0;
try{
delete window[obj];
}catch(e){
failed=1;
}
if(failed==0){
try{
TRBrecursiveDelete(window[obj]);
}catch(e){
}
}
}
}

function TRBbeforeUnLoad(){
if(window.XMLHttpRequest)
TRBrecursiveDelete(window.XMLHttpRequest);
if(window.ActiveXObject)
TRBrecursiveDelete(window.ActiveXObject);
}

if(window.addEventListener){
window.addEventListener("load",TRBinit,false);
window.addEventListener("beforeunload",TRBbeforeUnLoad,false);
}else if(window.attachEvent){
window.attachEvent("onload",TRBinit);
window.attachEvent("onbeforeunload",TRBbeforeUnLoad);
}else{
window.onload=TRBinit;
window.onbeforeunload=TRBbeforeUnLoad;
}

sas_pageid='2167/15060';
TRBnoIFrameBanner=1;
TRBbanner=596;
isMinNS4=(navigator.appName.indexOf("Netscape")>=0&&parseFloat(navigator.appVersion)>=4)?1:0;
isMinNS6=(document.getElementById&&!document.all)?1:0;
isMinIE4=(document.all)?1:0;
isMinIE5=(isMinIE4 && navigator.appVersion.indexOf("MSIE 5.")>= 0||isMinIE4&&navigator.appVersion.indexOf("MSIE 6.")>=0)?1:0;
isMinIE6=(isMinIE5&&navigator.appVersion.indexOf("MSIE 5.5")>=0||isMinIE5&&navigator.appVersion.indexOf("MSIE 6.")>=0)?1:0;

now=new Date();nowDate=now.getDate();nowMonth=now.getMonth();nowYear=now.getYear();nowDay=now.getDay();nowMinutes=now.getMinutes();if(nowMinutes<10)nowMinutes="0"+nowMinutes;nowHours=now.getHours();if(nowYear<100){nowYear+=2000}else{if(nowYear<1900)nowYear+=1900}
ordval=now.getTime();

function TRBsupprDoublons(tabInit,param){
	tabNew=new Array();
	for(i=0;i<tabInit.length;i++){
		if(trim(tabInit[i])!=""){
			tmpTabIniti=trim(TRBnoAccent(tabInit[i]).toUpperCase());
			tabNew.push(trim(tabInit[i]));
			for(j=i+1;j<tabInit.length;j++){
				if(trim(tabInit[j])!="" && ((param && tmpTabIniti==trim(TRBnoAccent(tabInit[j]).toUpperCase())) || trim(tabInit[i].toUpperCase())==trim(tabInit[j].toUpperCase())))
					tabInit[j]="";
			}
		}
	}
	return tabNew;
}

function trim(str){
	return str.replace(/(^\s*)|(\s*$)/g,'');
}

function trimCR(str){
	return str.replace(/[\n\r]/g,"");
}

function addElement(parentElement,tag){
	var nouvelElement=document.createElement(tag);
	parentElement.appendChild(nouvelElement);
	return nouvelElement;
}

function TRBnoAccent(str){
	tmp=str.replace(/[àâä]/gi,"a");
	tmp=tmp.replace(/[éèêë]/gi,"e");
	tmp=tmp.replace(/[îï]/gi,"i");
	tmp=tmp.replace(/[ôö]/gi,"o");
	tmp=tmp.replace(/[ùûü]/gi,"u");
	tmp=tmp.replace("ç","c");
	return tmp;
}

function TRBverifEmail(str){
	var reg=/^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]{2,}[.][a-zA-Z]{2,3}$/;
	return(reg.exec(str)!=null);
}

function TRBverifAlphaNum(str) {
	var reg=/^[a-zA-Z0-9]+$/;
	return(reg.exec(str)!=null);
}

function TRBverifCodeSecu(str) {
	var reg=/^[a-fA-F0-9]{4,4}$/;
	return(reg.exec(str)!=null);
}

function TRBverifDate(str){
	str=trim(str);
	if(str=="") return false;
	var listeElemDate=(str).split("/");
	if((listeElemDate.length != 3)||isNaN(parseInt(listeElemDate[0]))||isNaN(parseInt(listeElemDate[1]))||isNaN(parseInt(listeElemDate[2]))) return false;
	var checkDate=new Date(eval(listeElemDate[2]),eval(listeElemDate[1])-1,eval(listeElemDate[0]));
	var checkAnnee=checkDate.getYear();
	if(checkAnnee<100)checkAnnee=checkAnnee+1900;	return((checkDate.getDate()==eval(listeElemDate[0]))&&(checkDate.getMonth()==eval(listeElemDate[1])-1)&&(checkAnnee==eval(listeElemDate[2])));
}

function TRBconcatDate(str){
	str=trim(str)+" ";
	yyyy=str.substring(str.indexOf("/")+1,str.length);
	yyyy=parseInt(yyyy.substring(yyyy.indexOf("/")+1,yyyy.indexOf(" ")),10);
	if(yyyy<70)
		yyyy+=2000;
	else if(yyyy<200)
		yyyy+=1900;
	mm=str.substring(str.indexOf("/")+1,str.length);
	mm=parseInt(mm.substring(mm.indexOf("/"),-1),10);
	if(mm<10)mm="0"+mm;
	dd=parseInt(str.substring(str.indexOf("/"),-1),10);
	if(dd<10)dd="0"+dd;
	return(yyyy+''+mm+''+dd+'');
}

function TRBpayant(a,b){
	tmp=(a=='1')?'<span class=SansSouligne> <img src="/v6/img/payant.gif"></span>':'';
	if(b){return(tmp)}else{document.write(tmp)}
}

function TRBshowTime(jour){
jour=trim(jour)+" ";
while(jour.indexOf(" ")<jour.indexOf(":") && jour.indexOf(" ")!=-1){
jour=jour.substring(jour.indexOf(" ")+1,jour.length);
}
jour=jour.substring(jour.indexOf(" "),-1)+":";
tmpheures=jour.substring(jour.indexOf(":"),-1);
tmpminutes=jour.substring(jour.indexOf(":")+1,jour.length);
tmpminutes=tmpminutes.substring(tmpminutes.indexOf(":"),-1);
return(tmpheures+":"+tmpminutes);
}

function TRBshowDate(jour,f){
if((jour==null)||(jour=='')){
  dd=nowDate;
  mm=nowMonth;
  yy=nowYear;
}else{
  if(jour.length==7)jour="0"+jour;
  dd=parseInt(jour.substring(0,2),10);
  mm=jour.substring(3,5);
  mm-=1;
  yy=jour.substring(6,10);
}
if((f=='txtcompact')||(f=='txt')){
  if(yy<50){
    yy=parseInt(yy,10)+2000;
  }else{
    if(yy<1000)
      yy=parseInt(yy,10)+1900;
  }
  dateJour=new Date(yy,mm,dd);
  ddd=dateJour.getDay();
  if(dd==1)dd+='er';
  if(ddd=='0')ddd=(f=='txtcompact')?'Dim':'Dimanche';
  if(ddd=='1')ddd=(f=='txtcompact')?'Lun':'Lundi';
  if(ddd=='2')ddd=(f=='txtcompact')?'Mar':'Mardi';
  if(ddd=='3')ddd=(f=='txtcompact')?'Mer':'Mercredi';
  if(ddd=='4')ddd=(f=='txtcompact')?'Jeu':'Jeudi';
  if(ddd=='5')ddd=(f=='txtcompact')?'Ven':'Vendredi';
  if(ddd=='6')ddd=(f=='txtcompact')?'Sam':'Samedi';
  if(mm=='0')mm=(f=='txtcompact')?'Janv':'Janvier';
  if(mm=='1')mm=(f=='txtcompact')?'Fév':'Février';
  if(mm=='2')mm='Mars';
  if(mm=='3')mm='Avril';
  if(mm=='4')mm=(f=='txtcompact')?'Mai':'Mai';
  if(mm=='5')mm='Juin';
  if(mm=='6')mm=(f=='txtcompact')?'Juil':'Juillet';
  if(mm=='7')mm='Août';
  if(mm=='8')mm=(f=='txtcompact')?'Sept':'Septembre';
  if(mm=='9')mm=(f=='txtcompact')?'Oct':'Octobre';
  if(mm=='10')mm=(f=='txtcompact')?'Nov':'Novembre';
  if(mm=='11')mm=(f=='txtcompact')?'Déc':'Décembre';
  return(ddd+' '+dd+' '+mm+' '+yy);
}else{
  mm+=1;
  if(dd<10)dd='0'+dd;
  if(mm<10)mm='0'+mm;
  if(yy<10)yy='0'+yy;
  if(yy>99)yy=yy.substring(yy.length,yy.length-2);
  return(dd+'\057'+mm+'\057'+yy);
}
}

function TRBshowClock(){
if(document.getElementById("TRBHeure")!=null){
TRBJour=new Date();
TRBJour=new Date(TRBJour.valueOf()+TRBHeureDelta);
var dd=TRBJour.getDate();
var mm=TRBJour.getMonth()+1;
var yy=TRBJour.getYear();
var hh=TRBJour.getHours();
var min=TRBJour.getMinutes();
if(dd<=9)dd="0"+dd;
if(mm<=9)mm="0"+mm;
if(yy<=9)yy="0"+yy;
if(min<=9)min="0"+min;
var jourTexte=TRBshowDate(dd+'-'+mm+'-'+yy,'txt');
var heureTexte=hh+':'+min;
document.getElementById("TRBHeure").innerHTML=jourTexte+' - '+heureTexte+((TRBNomPrenom!='')?" - <a href=\"/Abonnement.nsf/TribAccountResume?OpenForm\">Bonjour "+TRBNomPrenom+"</a>":"");
setTimeout("TRBshowClock()",1000);
if(document.getElementById("TRBHeure2")!=null){
document.getElementById("TRBHeure2").innerHTML=heureTexte
}
}
}

function TRBhidePopUp(u){
document.getElementById(u+"PopUp").style.visibility="hidden";
return false;
}

function TRBdoPopUp(e,u,f){
u+="PopUp";
puObj=document.getElementById(u);
w=parseInt(puObj.style.width,10);
if(isMinNS6){
		 tmpL=(e.clientX<100)?50:e.clientX-70;
		 if(tmpL+w>780)tmpL=780-w;
		 tmpT=(e.clientY+150>window.innerHeight)?window.innerHeight-150:e.clientY+20;
		 puObj.style.top=window.pageYOffset+tmpT;
}
else{
		 tmpL=(event.clientX<100)?50:event.clientX-70;
		 if(tmpL+w>780)tmpL=780-w;
		 tmpT=(event.clientY+150>document.body.clientHeight)?document.body.clientHeight-150:e.clientY+20;
		 puObj.style.top=document.body.scrollTop+tmpT;
}
puObj.style.left=tmpL;
puObj.style.visibility='visible';
puObj.style.zIndex=999;
if(f!=null)document.forms[f].elements[0].focus();
return false;
}

function getImage(name){return (document.getElementById)?document.getElementById(name):document.all[name]}
function getImagePageLeft(img){var x,obj;x=0;obj=img;if(img!=null){while(obj.offsetParent!=null){x+=obj.offsetLeft;obj=obj.offsetParent}x+=obj.offsetLeft;return x}else{return(-1)}}
function getImagePageTop(img){var y,obj;y=0;obj=img;if(img!=null){while(obj.offsetParent!=null){y+=obj.offsetTop;obj=obj.offsetParent}y+=obj.offsetTop;return y}else{return(-1)}}

function TRBnewWindow(u,w,h,f,s){
s=s?(',toolbar=no,status=no,directories=no,location=no'+((s==2)?',menubar=no':',menubar=yes')):',menubar=yes,toolbar=yes,status=yes,directories=yes,location=yes';
if(f)u='/Home.nsf/(DSMLookupFrameset)/Redirect?OpenDocument&style='+f+'&url='+escape(u);
var newwin=window.open(u,'LaTribunePopUp','width='+(w?w:640)+',height='+(h?h:480)+',scrollbars=yes,resizable=yes'+s);
if(newwin!=null){newwin.focus()}else{self.location=u}
}

function TRBopenInfog(u,w,h,r,s){
w=(w>165)?w+10:165;
h+=50;
u=escape(u);
TRBnewWindow('/Home.nsf/(DSMLookupHTML)/RedirectFichier?OpenDocument&Fichier='+u+'&Rub='+r+'&Section='+s,w,h,1,1);
}

function TRBsessionCookie(u,v){
query=self.location.href;
domain=(query.indexOf(".latribune.fr")!=-1)?" domain=latribune.fr":"";
document.cookie=u+"="+v+"; path=/;"+domain;
}

function TRBgetCookie(u){
v=document.cookie+";";
pos=v.indexOf(u+"=");
if(pos!=-1){
v=v.substring(pos+1+u.length,v.length);
return v.substring(v.indexOf(";"),-1);
}else{
return null;
}
}

function TRBaleatoire(nbchiffres) {
	if(nbchiffres==null || nbchiffres==0)nbchiffres=1;
	alea=Math.random();
	alea=alea*Math.pow(10,nbchiffres);
	aleatoire=Math.floor(alea);
	alea=alea-aleatoire;
	return aleatoire;
}
function TRBshowHome(a){
if(TRBsection!="Accueil_Accueil"){
tmpImg=document.getElementById("TRBicoAccueil");
if(a)
tmpImg.src="/v6/img/header/accueilon.gif";
else
tmpImg.src="/v6/img/header/accueiloff.gif";
}
}

//Drop Down Tab Menu- Author: Dynamic Drive (http://www.dynamicdrive.com)
//Created/ updated: October 23rd, 06'

var tabdropdown={
disappeardelay: 250, //set delay in miliseconds before menu disappears onmouseout
disablemenuclick: false, //when user clicks on a menu item with a drop down menu, disable menu item's link?
downsymbol: '', //HTML "symbol" to use to indicate this is a dropdown menu item. Enter ('') to disable.

dropmenuobj: null, ie: document.all, firefox: document.getElementById&&!document.all, previousmenuitem:null,

getposOffset:function(what, offsettype){
var totaloffset=(offsettype=="left")? what.offsetLeft : what.offsetTop;
var parentEl=what.offsetParent;
while (parentEl!=null){
totaloffset=(offsettype=="left")? totaloffset+parentEl.offsetLeft : totaloffset+parentEl.offsetTop;
parentEl=parentEl.offsetParent;
}
return totaloffset;
},

showhide:function(obj, e, obj2){ //obj refers to drop down menu, obj2 refers to tab menu item mouse is currently over
if (this.ie || this.firefox)
this.dropmenuobj.style.left=this.dropmenuobj.style.top="-500px"
if (e.type=="click" && obj.visibility==hidden || e.type=="mouseover"){
if (obj2.parentNode.className.indexOf("Default")==-1) //if tab isn't a default selected one
obj2.parentNode.className="Selected"
obj.visibility="visible"
}
else if (e.type=="click")
obj.visibility="hidden"
},

iecompattest:function(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
},

clearbrowseredge:function(obj, whichedge){
var edgeoffset=0
if (whichedge=="rightedge"){
var windowedge=this.ie && !window.opera? this.iecompattest().scrollLeft+this.iecompattest().clientWidth-15 : window.pageXOffset+window.innerWidth-15
this.dropmenuobj.contentmeasure=this.dropmenuobj.offsetWidth
if (windowedge-this.dropmenuobj.x < this.dropmenuobj.contentmeasure)  //move menu to the left?
edgeoffset=this.dropmenuobj.contentmeasure-obj.offsetWidth-17
}
else{
var topedge=this.ie && !window.opera? this.iecompattest().scrollTop : window.pageYOffset
var windowedge=this.ie && !window.opera? this.iecompattest().scrollTop+this.iecompattest().clientHeight-15 : window.pageYOffset+window.innerHeight-18
this.dropmenuobj.contentmeasure=this.dropmenuobj.offsetHeight
if (windowedge-this.dropmenuobj.y < this.dropmenuobj.contentmeasure){ //move up?
edgeoffset=this.dropmenuobj.contentmeasure+obj.offsetHeight
if ((this.dropmenuobj.y-topedge)<this.dropmenuobj.contentmeasure) //up no good either?
edgeoffset=this.dropmenuobj.y+obj.offsetHeight-topedge
}
this.dropmenuobj.style.borderTopWidth=(edgeoffset==0)? 0 : "1px" //Add 1px top border to menu if dropping up
}
return edgeoffset
},

dropit:function(obj, e, dropmenuID){
if (this.dropmenuobj!=null){ //hide previous menu
this.dropmenuobj.style.visibility="hidden" //hide menu
if (this.previousmenuitem!=null && this.previousmenuitem!=obj){
if (this.previousmenuitem.parentNode.className.indexOf("Default")==-1) //If the tab isn't a default selected one
this.previousmenuitem.parentNode.className=""
tabdropdown.togglehiddenobj(this.previousmenuitem, 'visible')
}
}
this.clearhidemenu()
if (this.ie||this.firefox){
obj.onmouseout=function(){tabdropdown.delayhidemenu(obj)}
obj.onclick=function(){return !tabdropdown.disablemenuclick} //disable main menu item link onclick?
this.dropmenuobj=document.getElementById(dropmenuID)
this.dropmenuobj.onmouseover=function(){tabdropdown.clearhidemenu()}
this.dropmenuobj.onmouseout=function(e){tabdropdown.dynamichide(e, obj)}
this.dropmenuobj.onclick=function(){tabdropdown.delayhidemenu(obj)}
this.showhide(this.dropmenuobj.style, e, obj)
this.dropmenuobj.x=this.getposOffset(obj, "left")+((this.dropmenuobj.id!='TRBSousMenu10EditionsJournal')?(-7):3);
this.dropmenuobj.y=this.getposOffset(obj, "top")+((this.dropmenuobj.id!='TRBSousMenu10EditionsJournal')?7:2);
if(this.firefox){
this.dropmenuobj.x=this.dropmenuobj.x-1;
this.dropmenuobj.y=this.dropmenuobj.y-2;
}
this.dropmenuobj.style.left=this.dropmenuobj.x-this.clearbrowseredge(obj, "rightedge")+"px"
this.dropmenuobj.style.top=this.dropmenuobj.y-this.clearbrowseredge(obj, "bottomedge")+obj.offsetHeight+"px"
this.previousmenuitem=obj //remember main menu item mouse moved out from (and into current menu item)
tabdropdown.togglehiddenobj(obj, "hidden") //Hide (form) object drop down menu overlaps, if any
}
},

togglehiddenobj:function(obj2, visible){
var revvalue=obj2.getAttribute("rev")
if (typeof revvalue=="string" && revvalue.length>0 && document.getElementById(revvalue)!=null)
document.getElementById(revvalue).style.visibility=visible;
/*
colIframes=document.getElementsByTagName("iframe");
for(i=0;i<colIframes.length;i++)
colIframes[i].style.visibility=visible;
colObjects=document.getElementsByTagName("object");
for(i=0;i<colObjects.length;i++)
colObjects[i].style.visibility=visible;
*/
},

contains_firefox:function(a, b) {
while (b.parentNode)
if ((b = b.parentNode) == a)
return true;
return false;
},

dynamichide:function(e, obj2){ //obj2 refers to tab menu item mouse is currently over
var evtobj=window.event? window.event : e
if (this.ie&&!this.dropmenuobj.contains(evtobj.toElement))
this.delayhidemenu(obj2)
else if (this.firefox&&e.currentTarget!= evtobj.relatedTarget&& !this.contains_firefox(evtobj.currentTarget, evtobj.relatedTarget))
this.delayhidemenu(obj2)
},

delayhidemenu:function(obj2){
this.delayhide=setTimeout(function(){tabdropdown.dropmenuobj.style.visibility='hidden'; if (obj2.parentNode.className.indexOf('Default')==-1) obj2.parentNode.className=''; tabdropdown.togglehiddenobj(obj2, 'visible')},this.disappeardelay) //hide menu
},

clearhidemenu:function(){
if (this.delayhide!="undefined")
clearTimeout(this.delayhide)
},

initializetabmenu:function(menuid, opt_selectedmenuitem){
var menuitems=document.getElementById(menuid).getElementsByTagName("a")
for (var i=0; i<menuitems.length; i++){
if (menuitems[i].parentNode.id=="TRBMenu"+opt_selectedmenuitem)
menuitems[i].parentNode.className+=" Selected Default"
if (menuitems[i].getAttribute("rel")){
var relvalue=menuitems[i].getAttribute("rel")
menuitems[i].onmouseover=function(e){
var event=typeof e!="undefined"? e : window.event
tabdropdown.dropit(this, event, this.getAttribute("rel"))
}
if (tabdropdown.downsymbol!="")
menuitems[i].innerHTML+=tabdropdown.downsymbol //Add symbol HTML to menu item's.
}
}
}

}
function TRBinitMenu(){
if(TRBchannel!="Accueil"){
tmpMenu=document.getElementById("TRBMenuDeroulant");
tmpCol=tmpMenu.getElementsByTagName("li");
for(iLI=0;iLI<tmpCol.length;iLI++){
if(tmpCol[iLI].id=="TRBMenu"+TRBchannel){
tmpCol[iLI].className+=" Selected Default";
}
}
}
}

function TRBdoMenu(elem,a){
pElem=elem.parentNode;
if(pElem!=null){
if(pElem.className.indexOf(" Default")==-1){
if(a){
pElemId=pElem.id;
if(pElemId.indexOf("TRBMenu")==0){
pElem.className="Selected";
}
}else{
pElem.className=null;
}
}
}
}
var TRBRequeteAjax=new Object();

TRBRequeteAjax.send=function(url,methode,fonctionTraitement,donnees,urlencoded){
var req;
if(window.XMLHttpRequest){
req=new XMLHttpRequest();
//if(req.overrideMimeType)req.overrideMimeType("text/xml");
}else if(window.ActiveXObject){
try{
req=new ActiveXObject("Msxml2.XMLHTTP");
}
catch(e){
try{
req=new ActiveXObject("Microsoft.XMLHTTP");
}
catch(e){}
}
}
var chgtEtat=function(){
if(req.readyState==4){
if(req.status<400){
if(methode=="POST"){
fonctionTraitement(req);
delete fonctionTraitement;
}else{
fonctionTraitement(req,donnees);
delete fonctionTraitement;
}
}else if(typeof req=="undefined" || typeof req.status=="undefined"){
delete fonctionTraitement;
}else if(req.status == 401){
fonctionTraitement(req);
delete fonctionTraitement;
}else if(req.status == 404){
}else{
delete fonctionTraitement;
}
}
delete req;
};
function doRequete(){
if(url.indexOf("?")!=-1){
url+="&TRBRandomize="+new Date().getTime();
}else{
url+="?TRBRandomize="+new Date().getTime();
}
if(methode=="POST"){
req.open("POST",url,true);
if(urlencoded) req.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
req.onreadystatechange=chgtEtat;
req.send(donnees);
}else{
req.open("GET",url,true);
req.onreadystatechange=chgtEtat;
req.send(null);
}
};
doRequete();
return req;
}

TRBRequeteAjax.appelGET=function(url,fonctionLecture,args) {
return TRBRequeteAjax.send(url,"GET",fonctionLecture,args);
}
TRBRequeteAjax.appelPOST=function(url,donnees,fonctionLecture) {
TRBRequeteAjax.send(url,"POST",fonctionLecture,donnees,true);
}
TRBRequeteAjax.appelPOSTEncoded=function(url,donnees,fonctionLecture){
TRBRequeteAjax.send(url,"POST",fonctionLecture,donnees,false);
}
function TRBdoGSMenuSearch(){
	tmp=" "+document.TRBGSMenuSearch.TRBGSMenuSearchQuery.value;
	TRBlisteNewQuery=new Array;
	if(tmp!=""){
		nbKW=0;
		tmp=tmp.split(" de ").join(" ¤ ");
		tmp=tmp.split(" des ").join(" ¤ ");
		tmp=tmp.split(" du ").join(" ¤ ");
		tmp=tmp.split(" d'").join(" ¤ ");
		tmp=tmp.split(" un ").join(" ¤ ");
		tmp=tmp.split(" une ").join(" ¤ ");
		tmp=tmp.split(" le ").join(" ¤ ");
		tmp=tmp.split(" la ").join(" ¤ ");
		tmp=tmp.split(" les ").join(" ¤ ");
		tmp=tmp.split(" l'").join(" ¤ ");
		tmp=tmp.split(" à ").join(" ¤ ");
		tmp=tmp.split(" aux ").join(" ¤ ");
		tmp=tmp.split(" par ").join(" ¤ ");
		tmp=tmp.split(" et ").join(" ¤ ");
		tmp=tmp.split(" avec ").join(" ¤ ");
		tmp=tmp.split(" sans ").join(" ¤ ");
		tmp=tmp.split(" sur ").join(" ¤ ");
		tmp=tmp.split(" sous ").join(" ¤ ");
		tmp=tmp.split(" chez ").join(" ¤ ");
		tmp=tmp.split(" dans ").join(" ¤ ");
		tmp=tmp.split(" pour ").join(" ¤ ");
		tmp=tmp.split(",").join(" ¤ ");
		tmp=tmp.split(":").join(" ¤ ");
		tmp=tmp.split("¤ ¤").join("¤  ¤");
		tmp=tmp.split(" ¤ ");
		for(i=0;i<tmp.length;i++)
			if(trim(tmp[i])!=''){
				TRBlisteNewQuery[nbKW]="(%22"+escape(trim(tmp[i]))+"%22)";
				nbKW++;
			}
		if(TRBlisteNewQuery.join("")!=""){
			tmpDateSearch=new Date();
			tmpDate=tmpDateSearch.getDate()+"/"+(tmpDateSearch.getMonth()+1)+"/";
			tmpYearSearch="0"+tmpDateSearch.getYear();
			tmpYearSearch=2000+parseInt(tmpYearSearch.substring(tmpYearSearch.length-2,tmpYearSearch.length),10);
			self.location="/Articles.nsf/Recherche?ReadForm&Query="+TRBlisteNewQuery.join("%20AND%20");
		}
	}
}
function ATOSvalideMoteur(){
if(document.MoteurGeneral.search.value.length<2){
alert("Merci de saisir au moins 2 caractères");
document.MoteurGeneral.search.focus();
return;
}
document.MoteurGeneral.submit();
}
function TRBaddBanner(){
//if(TRBshowBanner)
SmartAdServer(sas_pageid,TRBbanner,"");
}

function TRBscriptPubFinPage(){

}

TRBnoIFrameBanner=0;
sas_tmstp=Math.round(Math.random()*10000000000);sas_masterflag=1;
function SmartAdServer(sas_pageid,sas_formatid,sas_target,bgcolor){

if(sas_formatid){
if(sas_masterflag==1){sas_masterflag=0;sas_master='M'}else{sas_master='S'}
n=sas_formatid;
sas_w=300;sas_h=250;
if(n==128){sas_w=728;sas_h=90}
if(n==145){sas_w=120;sas_h=60}
if(n==186){sas_w=120;sas_h=90}
if(n==187 || n==900){sas_w=300;sas_h=250}
if(n==209){sas_w=160;sas_h=600}
if(n==142){sas_w=120;sas_h=600;n=209}
if(n==228){sas_w=105;sas_h=14}
if(n==273){sas_w=88;sas_h=31}
if(n==599){sas_w=468;sas_h=60}
if(n==596 || n==597){sas_w=1000;sas_h=90}
if(n==598){sas_w=300;sas_h=250}
if(n==722){sas_w=260;sas_h=260}
if(n==1336){sas_w=468;sas_h=250}
if(TRBnoIFrameBanner && (n==596 || n==187)){

document.write('<SCR'+'IPT SRC="http://www.smartadserver.com/call/pubj/'+sas_pageid+'\057'+sas_formatid+'\057'+sas_master+'\057'+sas_tmstp+'\057'+escape(sas_target)+'?"></SCR'+'IPT>');


}else{
document.write('<IFRAME SRC="http://www.smartadserver.com/call/pubif/'+sas_pageid+'\057'+sas_formatid+'\057'+sas_master+'\057'+sas_tmstp+'\057'+escape(sas_target)+'?" width='+sas_w+' height='+sas_h+' marginwidth=0 marginheight=0 hspace=0 vspace=0 frameborder=0 scrolling=no'+((bgcolor!=null)?' style="background-color:'+bgcolor+'"':'')+'>');
document.write('<scr'+'ipt language=Javascr'+'ipt>\ndocument.write\(\'<SCR\'+\'IPT SRC="http://www.smartadserver.com/call/pubj/'+sas_pageid+'\057'+sas_formatid+'\057'+sas_master+'\057'+sas_tmstp+'\057'+escape(sas_target)+'?"></SCR\'+\'IPT>\'\)\;\n</scr'+'ipt>');
document.write('</IFRAME>');
}
}

}

function TRBshowRSSURL(e,u){
document.RecupRSS.URLRSS.value=u;
TRBdoPopUp(e,'TRBRSS','RecupRSS');
document.RecupRSS.URLRSS.select();
}

function TRBaddMaPageRSS(){
if(document.RecupRSS.URLRSS.value!="")
self.location.href="/Tribune/EditionPerso.nsf/Page?ReadForm&URL="+escape(document.RecupRSS.URLRSS.value);
}
function TRBdoIdentification(){
	domain=(query.indexOf(".latribune.fr")!=-1)?" domain=latribune.fr":"";
	date_key=new Date();
	date_key.setTime(date_key.getTime()+(8*3600*1000));
	date_exp=new Date();
	date_exp.setTime(date_exp.getTime()+(365*24*3600*1000));
		 document.cookie="Identifiant="+document.TRBIdentificationHeader.Username.value+"; expires="+date_exp.toGMTString()+"; path=/;"+domain;
	 		 document.cookie="MotDePasse="+document.TRBIdentificationHeader.Password.value+"; expires="+date_exp.toGMTString()+"; path=/;"+domain;
		document.cookie="Key="+document.TRBIdentificationHeader.Username.value+"_XXX_"+TRBuserKey+"; expires="+date_key.toGMTString()+"; path=/;"+domain;
	tmp=document.TRBIdentificationHeader.RedirectTo.value+"&";
	if(tmp.indexOf('&User=')!=-1){
		tmpUser=tmp.substring(tmp.indexOf('&User=')+6,tmp.length);
		tmpUser=tmpUser.substring(tmpUser.indexOf('&'),-1);
		 if(tmpUser=='')document.TRBIdentificationHeader.RedirectTo.value=tmp.substring(tmp.indexOf('&User=')+6,-1)+document.TRBIdentificationHeader.Username.value+tmp.substring(tmp.indexOf('&User=')+6,tmp.length);
	}
	if(tmp.toLowerCase().indexOf('/abonnement.nsf/login?readform')==-1){
		document.TRBIdentificationHeader.RedirectTo.value='/Abonnement.nsf/Login?ReadForm&RedirectTo='+escape(document.TRBIdentificationHeader.RedirectTo.value);
	}
	document.TRBIdentificationHeader.submit();
}
var TRBiframeids=new Array();

var iframehide="no";

var getFFVersion=navigator.userAgent.substring(navigator.userAgent.indexOf("Firefox")).split("/")[1];
var FFextraHeight=getFFVersion>=0.1?19:0;

function TRBaddIFrame(frameid,a){
TRBiframeids[TRBiframeids.length]=frameid;
if(FFextraHeight==0 && a)document.write('<img src="http://www.latribune.fr/v5/img/blank.gif" height='+a+'><br>');
}

function TRBresizeCaller(){
var dyniframe=new Array();
for(i=0;i<TRBiframeids.length;i++){
if(document.getElementById)TRBresizeIframe(TRBiframeids[i]);
if((document.all || document.getElementById) && iframehide=="no"){
var tempobj=document.all?document.all[TRBiframeids[i]]:document.getElementById(TRBiframeids[i]);
tempobj.style.display="block";
}
}
}

function TRBresizeIframe(frameid){
var currentfr=document.getElementById(frameid);
if(currentfr && !window.opera){
currentfr.style.display="block";
if(currentfr.contentDocument && currentfr.contentDocument.body.offsetHeight)
currentfr.height = currentfr.contentDocument.body.offsetHeight+FFextraHeight;
else if(currentfr.Document && currentfr.Document.body.scrollHeight)
currentfr.height = currentfr.Document.body.scrollHeight;
if(currentfr.addEventListener)
currentfr.addEventListener("load",TRBreadjustIframe,false);
else if(currentfr.attachEvent){
currentfr.detachEvent("onload",TRBreadjustIframe);
currentfr.attachEvent("onload",TRBreadjustIframe);
}
}
}

function TRBreadjustIframe(loadevt){
var crossevt=(window.event)?event:loadevt;
var iframeroot=(crossevt.currentTarget)?crossevt.currentTarget:crossevt.srcElement;
if(iframeroot)TRBresizeIframe(iframeroot.id);
}

function TRBloadintoIframe(iframeid, url){
if(document.getElementById)document.getElementById(iframeid).src=url;
}

if (window.addEventListener)
window.addEventListener("load",TRBresizeCaller,false);
else if(window.attachEvent)
window.attachEvent("onload",TRBresizeCaller);
else
window.onload=TRBresizeCaller;
function showDate(jour,f){return TRBshowDate(jour,f);}

var popupIMG;
function openPopupImage(url) {
	new Ajax.Request('/ajax/getImageInfo.php', {
					method: 'post',
					parameters: { imageURL: url },
					onSuccess: function(transport) {
									popupIMG = window.open(url, 'popupIMG', transport.responseText);
								}
		});

	return false;
}

function verif() {
	var alerte = '';
	var reg = new RegExp(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,})+$/);

	if(document.form_comment.formPseudo.value.length==0)
	    alerte += "- Pseudo\n";

	if(document.form_comment.formTextArea.value.length==0)
	    alerte += "- Commentaire\n";

	if(document.getElementById('CHKfollowMail').checked==true)
	{
		if (reg.test(document.form_comment.Mail.value) != true)
			alerte += "- E-mail\n";
	}

	if(alerte.length!=0) {
	    window.alert("Veuillez vérifier les informations suivantes :\n"+alerte);
	    return false;
	} else {

    var params = {};
    params['message'] = 'a commenté cet article sur LaTribune.fr :'+'\n'+ document.form_comment.formTextArea.value;
    params['link'] = document.location.href; /* un lien à partager */
    params['name'] = document.form_comment.titre_article.value;
    params['picture'] = '';
    params['description'] = '';
    params['url'] = ''; /* like !*/

    verif_fb(params);


		if(document.getElementById('CHKfollowMail').checked==true)
		{
			//envoie avec suivi par mail
			new Ajax.Request('/ajax/postCommentandMail.php', {
					method: 'post',
					parameters: { PageID: document.form_comment.PageID.value,
								  ID_Parent: '',
								  Facebook_Id: document.form_comment.Facebook_Id.value,
								  formPseudo: document.form_comment.formPseudo.value,
								  titre_article: document.form_comment.titre_article.value,
								  titre_rubrique: document.form_comment.titre_rubrique.value,
								  url: document.form_comment.url.value,
								  mail: document.form_comment.Mail.value,
								  formTextArea: document.form_comment.formTextArea.value },
					onSuccess: function(transport) {
								alert('Votre commentaire est soumis à validation.\nLa Tribune vous remercie de votre confiance.');
								//document.form_comment.formPseudo.value = '';
								document.form_comment.formTextArea.value = '';
								//window.location.reload();
								}
				});
		}
		else
		{
				//envoie sans suivi par mail
				new Ajax.Request('/ajax/postComment.php', {
							method: 'post',
							parameters: { PageID: document.form_comment.PageID.value,
										  Facebook_Id: document.form_comment.Facebook_Id.value,
										  formPseudo: document.form_comment.formPseudo.value,
										  titre_article: document.form_comment.titre_article.value,
										  titre_rubrique: document.form_comment.titre_rubrique.value,
										  url: document.form_comment.url.value,
										  formTextArea: document.form_comment.formTextArea.value },
							onSuccess: function(transport) {
										alert('Votre commentaire est soumis à validation.\nLa Tribune vous remercie de votre confiance.');
										//document.form_comment.formPseudo.value = '';
										document.form_comment.formTextArea.value = '';
										//window.location.reload();
										}
				});

		}


	}
}

function verif_fb(params){
    var publish = {
      method: 'stream.publish',
      auto_publish: false,
      message: params['message'],
      attachment: {
        name: params['name'],
        href: params['link'],
        description: params['description']
      }
    };

	if (typeof(FB) != 'undefined')
		FB.getLoginStatus(function(response) {
		  if (response.session) {
			FB.ui(publish,function(response) {
			  if (!response || response.error) {
				var msg = response ? response.error.type+' - '+response.error.message : '';
				alert('Error occured: '+msg);
				} else {
				alert('Message posté sur votre mur');
				}
			  }
			);
		 }});

}
