var NGmesSearchEmpty="Please, fill at least one field in.";

function contextUrl(url)
{
	var d1 = ".francetelecom.fr" ;
	var s1 = "http://" ;
	var d2 = ".francetelecom.com" ;
	var s2 = "http://" ;
	var d3 = "intranet.ftgroup" ;

	var tokenPos = -1;

	if ( ( self.location.href.indexOf( s2 ) >= 0 ) && ( self.location.href.indexOf( d2 ) >= 0) )
	{
		if ( url.indexOf( d3 ) >= 0 )
		{
			tokenPos = url.indexOf( d3 ) + d3.length ;
			url = url.substr(tokenPos);
		}
		else
		{
			tokenPos = url.indexOf( d2 ) + d2.length ;
			url = url.substr(tokenPos);
		}
	}	
	self.location = url ;
}

function goToFamille(code)
{
	var prefixe = "rh_mce_" ;
	var suffixe = "_fr" ;
	var pagessfam = "";
	var codefam = code.substring(0,4).toLowerCase() ;
	var codessfam = code.substring(0,5).toUpperCase() ;
	if ( ( codefam.indexOf( "cus3" ) == 0 ) || ( codefam.indexOf( "cus5" ) == 0 ) )
		pagessfam = codessfam + ".htm" ;
	self.location = "../" + prefixe + codefam + suffixe + "/" + pagessfam ;
}

function isStats()
{
	var d = ".francetelecom." ;
	var d2 = ".ftgroup" ;
	if ( ( self.location.host.indexOf( d ) >= 0 ) || ( self.location.host.indexOf( d2 ) >= 0 ) )
		return true;
	else 
		return false ;
}

function openExtWindow( dest, h, w, n )
{
	var hauteur,largeur ;
	if ( !h )
		hauteur = 500 ;
	else
		hauteur = h ;
	if ( !w )
		largeur = 640 ;
	else
		largeur = w ;
	if ( !n )
		nom = 'fenetre' ;
	else
		nom = n ;
	var _w = window.open( dest, nom, 'toolbar=yes,location=no,directories=no,status=yes,menubar=yes,scrollbars=yes,resizable=yes,copyhistory=no,width='+largeur+',height='+hauteur ) ;
	_w.focus() ;	
}

function quitter()
{
  if ( ( top.opener ) && ( history.length <= 1 ) )
  {
      top.close();
  }
  else
  {
      history.back();
  }
}


function getKey( keyStroke ) 
{
    var navigatorName = navigator.appName ;
	var eventChooser = ( navigatorName == "Netscape" ) ? keyStroke.which : event.keyCode ;
	var currLetter = String.fromCharCode( eventChooser ).toLowerCase() ;
	if ( currIndex != -1 )
	{
		if ( currLetter == wordList[currIndex].charAt( currLetterList[currIndex] ) ) 
		{
			currLetterList[currIndex]++ ;
			if ( currLetterList[currIndex] == wordList[currIndex].length && urlList[currIndex] != "" )
				window.location = urlList[currIndex] ;
			return ;
		}
		else
		{
			currLetterList[currIndex] = 0 ;
			currIndex = -1 ;
		}
	}
	var nbw = currLetterList.length ;
	for ( var i = 0 ; i < nbw ; i++ )
	{
		if ( currLetter == wordList[i].charAt( currLetterList[i] ) ) 
		{
			currIndex = i ;
			currLetterList[i]++ ;
			if ( currLetterList[i] == wordList[i].length && urlList[i] != "" )
				openExtWindow( urlList[i], 400, 680,"backoffice");
			return ;
		}
	}
}

function getCookieVal (offset) 
{
  var endstr = document.cookie.indexOf (";", offset);
  if (endstr == -1)
    endstr = document.cookie.length;
  return unescape(document.cookie.substring(offset, endstr));
}

function FixCookieDate (date) 
{
  var base = new Date(0);
  var skew = base.getTime();
  if (skew > 0)
    date.setTime (date.getTime() - skew);
}

function GetCookie (name) 
{
  var arg = name + "=";
  var alen = arg.length;
  var clen = document.cookie.length;
  var i = 0;
  while (i < clen) {
    var j = i + alen;
    if (document.cookie.substring(i, j) == arg)
      return getCookieVal (j);
    i = document.cookie.indexOf(" ", i) + 1;
    if (i == 0) break; 
  }
  return null;
}

function SetCookie (name,value,expires,path,domain,secure) 
{
  document.cookie = name + "=" + escape (value) +
    ((expires) ? "; expires=" + expires.toGMTString() : "") +
    ((path) ? "; path=" + path : "") +
    ((domain) ? "; domain=" + domain : "") +
    ((secure) ? "; secure" : "");
}

function DeleteCookie (name,path,domain) 
{
  if (GetCookie(name)) 
  {
   	document.cookie = name + "=" +
      ((path) ? "; path=" + path : "") +
      ((domain) ? "; domain=" + domain : "") +
      "; expires=Thu, 01-Jan-70 00:00:01 GMT";
  }
}


ForEver=new Date(2100,11,11);
var zepath = "/"; 
var zedomain = "" ;

function AddSite(NomSite,URLSite,IDSite)
 {

	Paire = new Array;
	if (GetCookie("MYLINKS")) Cookie=GetCookie("MYLINKS"); else Cookie="";
	if (Cookie.indexOf(IDSite)>0 && Cookie != "") 
	{
		SiteArray=Cookie.split("&");
		Cookie="";
		for (var i=0; i<SiteArray.length; i++)
		{
			Paire[i]=SiteArray[i].split("=");
			if (Paire[i][2]==IDSite) SiteArray[i]=escape(NomSite)+"="+escape(URLSite)+"="+escape(IDSite);
			if (i>0) Cookie+="&";
			Cookie+=SiteArray[i]
		}
	}
	else
	{
		var CookieTemp = "" ;
		if( Cookie == "" )
			SiteArray="";
		else
		{
			SiteArray = Cookie.split("&");
			var CookieLength = SiteArray.length ;
			if( CookieLength >=6 ) 
			{
				for (var i=0; i<5; i++)
				{
					CookieTemp = CookieTemp + SiteArray[i];
					if( i < 4 ) CookieTemp = CookieTemp + "&";
				}
			}
			else
			{
				for (var i=0; i<CookieLength; i++)
				{
					CookieTemp = CookieTemp + SiteArray[i];
					if( i < CookieLength - 1 ) CookieTemp = CookieTemp + "&";
				}	
			}
		}
		CookieTemp = escape(NomSite)+"="+escape(URLSite)+"="+escape(IDSite)+"&" + CookieTemp;
		Cookie = CookieTemp ;
	}
	SetCookie ("MYLINKS",Cookie,ForEver, zepath, zedomain);
}


function writeCookie()
{
	for( i=1; i<= 5; i++ )
	{
			var cocher = eval("document.sitePerso.mylinks" + i + ".checked");
			if( eval("document.sitePerso.mylinks" + i + ".checked == true"))
			{
				nomSite = eval("document.sitePerso.fnom" + i + ".value");
				urlSite = eval("document.sitePerso.furl" + i + ".value");
				idSite  = eval("document.sitePerso.id" + i + ".value");
				AddSite( nomSite, urlSite, idSite);
			}
	}
	document.sitePerso.submit();
}

function readCookie(num)
{

	var nom = "";
	var checkbox;
	if( GetCookie("MYLINKS")!= null)
	{

		Cookie=GetCookie("MYLINKS");
		SiteArray=Cookie.split("&");
		if( num < SiteArray.length )
		{
			Paire=SiteArray[num].split("=");
			nom = unescape (Paire[0]);
			document.write(nom);
		}
	}
}

function AfficheSitePerso( num )
{
	Paire = new Array;
	var idCherche = "1000" + num;
	var checkbox, idLue;
	var trouve = false ;
	if( GetCookie("MYLINKS")!= null)
	{
		Cookie=GetCookie("MYLINKS");
		SiteArray=Cookie.split("&");
		for (var i=0; i<SiteArray.length; i++)
		{
			Paire[i]=SiteArray[i].split("=");
			idLue= Paire[i][2];
			if( idLue ==idCherche )
			{
				var fieldurl = "furl" + num;
  				var fieldname = "fnom" + num;
				document.write('<TD width="50" valign="top">');
            	document.write('<INPUT type="checkbox" name="mylinks'+ num+'" value="0" checked>');
            	document.write('</TD>');
            	document.write('<TD width="51%" valign="top">');
 				document.write('<INPUT type="text" name="' + fieldurl +'" value="' + unescape(Paire[i][1]) + '" size="16" >');
				document.write('</TD>');
           		document.write('<TD width="50%" valign="middle">');
				document.write('<INPUT type="text" name="'+ fieldname +'" size="16" value="' + unescape(Paire[i][0]) + '">');
				document.write(' </TD>');
				document.write('<INPUT type="hidden" name="id' + num +'" value="1000' + num + '">');
				trouve = true;
			}

		}

	}
	if(trouve == false)
	{

		document.write('<TD width="50" valign="top">');
        document.write(' <INPUT type="checkbox" name="mylinks'+ num+'" value="0">');
        document.write(' </TD>');
        document.write('<TD width="51%" valign="top">');
 		document.write('<INPUT type="text" name="furl'+num+'" size="16" value="">');
        document.write(' </TD>');
		document.write('<TD width="50%" valign="middle">');		
		document.write('<INPUT type="text" name="fnom'+num+'" size="16" value="">');
        document.write(' </TD>');
		document.write('<INPUT type="hidden" name="id' + num +'" value="1000'+ num +'">');  

	}
}

function RemoveSite(num) 
{
	Paire = new Array;
	if (GetCookie("MYLINKS")) Cookie=GetCookie("MYLINKS"); else Cookie="";
	if (Cookie!= "") {
		SiteArray=Cookie.split("&");
		Cookie="";
		for (var i=0; i<SiteArray.length; i++){
			if (i== (num-1)) {
			}
			else {
				if (Cookie.length != 0 ) 
					Cookie+="&";			
				Cookie+=SiteArray[i];
			}
			SetCookie ("MYLINKS",Cookie,ForEver, zepath, zedomain);
		}
	}
}

function ErazeSite()
{
	for( i=1; i<= 6; i++ )
	{
			var cocher = eval("document.effaceSite.eraze" + i + ".checked");
			if( eval("document.effaceSite.eraze" + i + ".checked == true")) RemoveSite( i);
	}
	document.effaceSite.submit();
}

function AfficheSitesIndex()
{
	Paire = new Array;
	if( GetCookie("MYLINKS")== null) InitCookie();
	Cookie=GetCookie("MYLINKS");
	SiteArray=Cookie.split("&");
	for (var i=0; i<SiteArray.length; i++)
	{
		if( SiteArray[i].length != 0 )
		{
			Paire[i]=SiteArray[i].split("=");
			document.write('<A HREF="'+unescape(Paire[i][1])+'" target="MyLinks"><FONT color="#333399" size="1">'+unescape(Paire[i][0])+'</FONT></A>&nbsp;<FONT color="#CC0000" size="1">&nbsp;|  </FONT>');
		}
	}
}

function InitPopupYear(p,y2)
{
	var d = new Date();
	var y = d.getFullYear();
	if (y < 2003) y=2004;
	var l = y-y2;
	for (var i = 0; i<= l; i++)
	{
		var newoption = new Option(y2+i, y2+i, false, false);
		p.options[i+1] = newoption;
	}
	p.options[0].selected = true;
}

function getBuildSearchQueryValue (field)
{
	if (field)
	{
	  if (field.type.indexOf('select') < 0 )
   		{
  			return ((field.value == "") ? null : eval(field.value));
   		}
   		else 
   		{
   			return ((field.options[field.options.selectedIndex].value == "") ? null : eval(field.options[field.options.selectedIndex].value));
    	}
   	}
   	else 
   	return (false);
}

function searchkey(mykey)
{
	if ( document.search_news && document.search_news.fulltextscope )
	{
		if ( document.search_news.query ) document.search_news.query.value = "" ;
		document.search_news.fulltext.value = mykey ;
		document.search_news.fulltextscope.value = "ACTIVITY,KEYWORDS,COMPANY" ;
		BuildSearchQuery (document.search_news)
	}
}


function BuildSearchQuery (f)
{
	var prompt = "" ;
	var flag = 0;
	var cadre='"';
	if ( f.fulltext && ( f.fulltext.value.indexOf('"') > -1) ) cadre="";
	if ( f.fulltext && ( f.fulltext.value.length > 0 ) )
	{
		if (f.fulltextscope && ( f.fulltextscope.value.length > 0 ))
		{
			tmpFtsArray = f.fulltextscope.value.split(",") ;
			f.query.value += "( " ;
			for (var i=0; i<tmpFtsArray.length; i++)
			{
				if ( i > 0 ) f.query.value += " OR " ;
				f.query.value  += ( "( " + tmpFtsArray[i]  + ":" + cadre+f.fulltext.value+cadre + " )" ) ;
			}
			f.query.value += " )" ;
		}
		else
		{
				 f.query.value = '(('+f.fulltext.value+') OR (title:'+cadre+f.fulltext.value+cadre+') OR (description:'+cadre+f.fulltext.value+cadre+'))';

		}
	}
	else f.query.value = "";
	if ( f.fields && f.fields.value )
	{
		tmpArray = f.fields.value.split(",");
		defaultArray = "" ;
		if ( f.fieldsdefault && f.fieldsdefault.value ) 
			defaultArray = f.fieldsdefault.value.split(",");
		for (var i=0; i<tmpArray.length; i++)
		{
			
          	var name = tmpArray[i];
          	var isWildcard = true ;
          	if ( name.indexOf("*") == 0 )
          		name = name.substr( 1 ) ;
          	else
          		isWildcard = false ;
         	var n = eval( "f." + name ) ;
			var ndefault = defaultArray[i] ;
			var value = "" ;
			if (n)
          	{
				if (n.type.indexOf("select") > -1 )
           		{
            		if (n.options[n.options.selectedIndex].value.length > 0 )
            			{
            			value = n.options[n.options.selectedIndex].value ;
            			prompt =  n.options[n.options.selectedIndex].text ;
            			}
            	}
            	else
            	{
            		if ( n.value.length > 0 )
            			{           			
            				value = n.value ;
            				if ( n.type == "text" ) prompt =  n.value ;
            				else prompt = "" ;
            			}
            	}
            	if ( value != "" && value != ndefault )
            	{
            		if (f.query.value.length > 0 ) f.query.value += " AND ";
           	    	if ( isWildcard )f.query.value += (name + ':' + value + '* OR ') + (name + ':"' + value + '"');  
           	    	else f.query.value += (name + ':"' + value + '"');
           	    	if ( f.prompt && ( prompt.length > 0)  )
           	    	{ 
	            		if (f.prompt.value.length > 0 ) f.prompt.value += " + " ;
           	    			f.prompt.value += prompt ;
           	    	}
				}
			}
		}
   }
   if (f.from && f.fromyear && f.frommonth && f.fromday)
   {
   		flag=1;	
    	if ((m = getBuildSearchQueryValue(f.frommonth)) && (y = getBuildSearchQueryValue(f.fromyear)) && (d = getBuildSearchQueryValue(f.fromday)))
		f.from.value = y + ((m < 10) ? "-0" : "-") + m.toString() + ((d < 10) ? "-0" : "-") + d.toString();
   }
   if (f.to && f.toyear && f.tomonth && f.today)
   {	
   		flag=1;	
    	if ((m = getBuildSearchQueryValue(f.tomonth)) && (y = getBuildSearchQueryValue(f.toyear)) && (d = getBuildSearchQueryValue(f.today)))
		f.to.value = y + ((m < 10) ? "-0" : "-") + m.toString() + ((d < 10) ? "-0" : "-") + d.toString();
   }
   if ((f.more) && (f.more.value.length >0))
   {
	  	if (f.query.value.length > 0 ) f.query.value += " AND ";
    	f.query.value += f.more.value;
   }
   if ( f.prompt && f.fulltext && ( f.fulltext.value.length > 0)  )
   { 
	    if (f.fulltext.value.length > 0 ) f.prompt.value += " + " ;
        f.prompt.value += f.fulltext.value ;
   }
   if ((f.query.value.length > 0) || (flag=1 >0))
   {
         f.submit();
   }
   else
   {
   		  alert(NGmesSearchEmpty);
   }
}

function LMBuildMenu(t, ImgInterface, ImgChaine)
{
	var m = new Array();
	var n = t.length;
	var NextSequence = SequenceCourante;
	var IndexSequenceCourante = -1;
	var PageVisible = false;
	var p = false;
	var i = 0;
	var HTMLmenu = '<table width="100%" border="0" cellspacing="0" cellpadding="0">';

	for (i = (n-1); i>=0; i--)
	{		
		if (t[i].ID == PageCourante) PageVisible = true;
		if (t[i].ID == SequenceCourante) IndexSequenceCourante = i;
		if (t[i].ID == NextSequence)
		{
			t[i].Status = 2;
			if (t[i].IDparent == "") break;
			else NextSequence = t[i].IDparent;
		}
	}

	for (i = 0; i<n; i++)
	{
		m[t[i].ID] = i;
		p = (t[m[t[i].IDparent]] ? t[m[t[i].IDparent]] : false);
		
		if (t[i].ID == PageCourante) t[i].Status = 3;
		else if (t[i].IDparent == SequenceCourante) t[i].Status = 1;
							
		if (!PageVisible && t[IndexSequenceCourante]) t[IndexSequenceCourante].Status = 3;
		if ((t[i].Status <= 0)  && (t[i].IDparent == "")) t[i].Status = 1;
		if ((t[i].Status <= 0) && p && (p.Status > 1)) t[i].Status = 1;
		if (t[i].IDparent != "" && p) t[i].Level = p.Level + 1;
		if (t[i].Status > 0)
		{
			HTMLmenu += LMPrintItem (t[i].Level,t[i].Text, t[i].Href, t[i].Status, ImgInterface, ImgChaine);
		}
	}
	
	HTMLmenu += '</table>';
	document.writeln(HTMLmenu);
}



function LMPrintItem (ItemLevel, ItemText, ItemHref, ItemStatus, ImgInterface, ImgChaine)
{
	var ll = 0;
	var TextSpan = LMMaxLevels - ItemLevel;		
	if (TextSpan < 1) TextSpan = 1;
	var HTMLItem = '';
	
	HTMLItem += ('<tr>');
	while ( ll < ItemLevel) 
	{
		HTMLItem += ('<td valign="top" width="13"><img border="0" height="13" width="13" src="'+ImgInterface+'/dot.gif"></td>');
		ll++;
	}
    HTMLItem += ('<td colspan="'+(TextSpan+1)+'" background="'+ImgChaine+'/ligne_1.gif"><img src="'+ImgInterface+'/dot.gif" width="1" height="10"></td>');
	HTMLItem += ('</tr>');

	ll = 0;
	HTMLItem += ('<tr>');
	while ( ll < ItemLevel) 
	{
		HTMLItem += ('<td valign="top" width="13"><img border="0" height="13" width="13" src="'+ImgInterface+'/dot.gif"></td>');
		ll++;
	}
	if (ItemStatus == 2) HTMLItem += ('<td valign="top" width="13"><a class="ns" href="'+ItemHref+'"><img border="0" height="13" width="13" src="'+ImgChaine+'/marge_fleche_b.gif"></td><td valign="top" width="100%" colspan="'+TextSpan+'"><a class="ns" href="'+ItemHref+'"><font color="'+ChaineColor2+'" size="2" face="Arial, Helvetica, sans-serif">'+ItemText+'</font></a></td>');
	else if (ItemStatus == 3) HTMLItem += ('<td valign="top" width="13"><a class="ns" href="'+ItemHref+'"><img border="0" height="13" width="13" src="'+ImgChaine+'/marge_carre.gif"></td><td valign="top" width="100%" colspan="'+TextSpan+'"><a class="ns" href="'+ItemHref+'"><font color="'+ChaineColor2+'" size="2" face="Arial, Helvetica, sans-serif"><strong>'+ItemText+'</strong></font></a></td>');
	else HTMLItem += ('<td valign="top" width="13"><a class="ns" href="'+ItemHref+'"><img border="0" height="13" width="13" src="'+ImgChaine+'/marge_fleche.gif"></td><td valign="top" width="100%" colspan="'+TextSpan+'"><a class="ns" href="'+ItemHref+'"><font color="'+ChaineColor1+'" size="2" face="Arial, Helvetica, sans-serif">'+ItemText+'</font></a></td>');
	
	HTMLItem += ('</tr>');
	
	return HTMLItem;

}

function ShLayer(i,h,w)
{
	if (!w) w=300;
	if (!(gE(i))) BuildLayer(i,h,w);
	sE(gE(i));
}

function HiLayer(i)
{
	if (gE(i)) hE(gE(i));
}

function BuildLayer(i,h,w)
{
	if (!w) w=300;
	var c = "";
	if (document.layers) 
	{
		c = ('<layer onMouseOver="sE(gE(');
		c += ('\''+i+'\'');
		c += ('))" onMouseOut="hE(gE(');	
		c += ('\''+i+'\'');
		c += ('))" bgcolor="#FFFFFF">');
		c += ('<table width="'+w+'" cellspacing="0" cellpadding="0" bgcolor="#FFFFFF"><tr><td>');
		c += h;	
		c += ('</tr></td></table>');
		c += ('</layer>');
		cE(i);
		var o = gE(i);
		hE(o);
		sX(o,10);
		sY(o,10);
		sZ(o,1000);
		wH(o, c);
	}
	else
	{
		c = ('<div id="');
		c += i;
		c += ('" style="position: absolute; left: ');
		c += '10';
		c += ('px; top: ');
		c += '10';;
		c += ('px; visibility: hidden; z-index: 1000;"');
		c += ('onMouseOver="sE(gE(');
		c += ("'"+i+"'");
		c += ('))" onMouseOut="hE(gE(');
		c += ("'"+i+"'");
		c += ('))">');
		c += ('<table width="'+w+'" cellspacing="0" cellpadding="0" bgcolor="#FFFFFF"><tr><td>');
		c += h;	
		c += ('</tr></td></table>');
		c += ('</div>');
	
		if (document.all)
			document.body.insertAdjacentHTML('beforeEnd',c);		
		else			
			document.body.innerHTML += c;
	}
}

function setComboValue ( combo, val )
{
	for ( var i = 0 ; i < combo.length ; i++ )
	{
		if ( combo[i].value == val ) combo[i].selected = true ;
	}
}

// 1k DHTML API - standards version
d=document;l=d.layers;op=navigator.userAgent.indexOf('Opera')!=-1;px='px';ie=navigator.userAgent.toLowerCase().indexOf('msie')!=-1;
function gE(e,f){if(l){f=(f)?f:self;var V=f.document.layers;if(V[e])return V[e];for(var W=0;W<V.length;)var t=gE(e,V[W++]);return t;}if(d.all)return d.all[e];return d.getElementById(e);}
function sE(e){l?e.visibility='show':e.style.visibility='visible';}
function hE(e){l?e.visibility='hide':e.style.visibility='hidden';}
function sZ(e,z){l?e.zIndex=z:e.style.zIndex=z;}
function sX(e,x){l?e.left=x:op?e.style.pixelLeft=x:e.style.left=x+px;}
function sY(e,y){l?e.top=y:op?e.style.pixelTop=y:e.style.top=y+px;}
function sW(e,w){l?e.clip.width=w:op?e.style.pixelWidth=w:e.style.width=w+px;}
function sH(e,h){l?e.clip.height=h:op?e.style.pixelHeight=h:e.style.height=h+px;}
function sC(e,t,r,b,x){l?(X=e.clip,X.top=t,X.right=r,X.bottom=b,X.left=x):e.style.clip='rect('+t+px+' '+r+px+' '+b+px+' '+x+px+')';}
function wH(e,h){if(l){Y=e.document;Y.open();Y.write(h);Y.close();}if(e.innerHTML)e.innerHTML=h;}
function cE(i){if(l){d.layers[i]=new Layer(0);eval("document."+i+"=d.layers[i]");}else{if(typeof d.createElement!='undefined'){X="<div id='"+i+"' style=\"position:absolute\">&nbsp;</div>";Y=d.createElement("DIV");if(Y){Y.innerHTML=X;d.body.appendChild(Y);}else if(typeof d.body.insertAdjacentHTML!='undefined')d.body.insertAdjacentHTML("BeforeEnd",X);}}}
function cM(i){if(l){d.layers[i]=new Layer(0);eval("document."+i+"=d.layers[i]");}else{if(typeof d.createElement!='undefined'){X="<div id='"+i+"' style=\"position:absolute\" onMouseOver='sE(gE("+i+")) onMouseOut='sE(gE("+i+"))' >&nbsp;</div>";Y=d.createElement("DIV");if(Y){Y.innerHTML=X;d.body.appendChild(Y);}else if(typeof d.body.insertAdjacentHTML!='undefined')d.body.insertAdjacentHTML("BeforeEnd",X);}}}
function isE(e){if(l){var V=self.document.layers;if(V[e]) return true;}if(d.all) return true;if(d.getElementById(e)) return true;return false}
function ww(){return(ie?document.body.clientWidth:window.innerWidth)}
function hh(){return(ie?document.body.clientHeight:window.innerHeight)}
function gX(e){return calculateOffsetLeft(e)}
function gY(e){return calculateOffsetTop(e)}
function gW(e){return (op?e.style.pixelWidth:e.offsetWidth)}
function gH(e){return (op?e.style.pixelHeight:e.offsetHeight)}


function calculateOffsetLeft(r){
  return calculateOffset(r,"offsetLeft")
}
// calcule le dˇcalage vertical
function calculateOffsetTop(r){
  return calculateOffset(r,"offsetTop")
}
function calculateOffset(r,attr){
  var kb=0;
  while(r){
    kb+=r[attr];
    r=r.offsetParent
  }
  return kb
}


// scroll utils
var iebody = ( ( document.compatMode && document.compatMode != "BackCompat") ? document.documentElement : document.body ) ;
function gdsocleft() { return ( document.all? iebody.scrollLeft : pageXOffset ) }
function gdsoctop() { return ( document.all? iebody.scrollTop : pageYOffset ) }

//alpha
function setOpacity(e,value) {
	e.style.opacity = value/10;
	e.style.filter = 'alpha(opacity=' + value*10 + ')';
}

// onload add & init

var onload_actions = new Array();

function onload_handler()
{
	for(i=0;i<onload_actions.length;i++)
		eval(onload_actions[i]);
}

function onload_add_action(f)
{
	onload_actions[onload_actions.length] = f;
}

//on resize add

var onresize_actions = new Array();

function onresize_handler()
{
	for(i=0;i<onresize_actions.length;i++)
		eval(onresize_actions[i]);
}

function onresize_add_action(f)
{
	onresize_actions[onresize_actions.length] = f;
}

// Onglets

function Onglets() {
	this.settings = new Array();
};

Onglets.prototype.init = function(settings) {
	this.settings = settings;
};

Onglets.prototype.getParam = function(name, default_value) {
	var value = null;

	value = (typeof(this.settings[name]) == "undefined") ? default_value : this.settings[name];

	// Fix bool values
	if (value == "true" || value == "false")
		return (value == "true");

	return value;
};

Onglets.prototype.Show = function(tab_id, panel_id) {
	var panelElm = document.getElementById(panel_id);
	var panelContainerElm = panelElm ? panelElm.parentNode : null;
	var tabElm = document.getElementById(tab_id);
	var tabContainerElm = tabElm ? tabElm.parentNode : null;
	var selectionClass = this.getParam('selection_class', 'current');

	if (tabElm && tabContainerElm) {
		var nodes = tabContainerElm.childNodes;

		for (var i=0; i<nodes.length; i++) {
			if (nodes[i].nodeName == "LI")
				nodes[i].className = '';
		}

		tabElm.className = 'current';
	}

	if (panelElm && panelContainerElm) {
		var nodes = panelContainerElm.childNodes;

		for (var i=0; i<nodes.length; i++) {
			if (nodes[i].nodeName == "DIV")
				nodes[i].className = 'panel';
		}

		panelElm.className = 'current';
	}
};

Onglets.prototype.getAnchor = function() {
	var pos, url = document.location.href;

	if ((pos = url.lastIndexOf('#')) != -1)
		return url.substring(pos + 1);

	return "";
};

var Onglets = new Onglets();

function expandDiv(whichEl,etat,top,left)
{
	theLayer = gE( whichEl ).style ;
	if ( theLayer )
	{
		if (etat == null) theLayer.display = (theLayer.display == "none" ) ? "" : "none" ;
		else theLayer.display = etat ;
	}
	if ( top ) sY( gE( whichEl ),eval( gdsoctop() + top ) );
	if ( left ) sX( gE( whichEl ),eval( gdsocleft() + left ) );
}


var isHandilogActivated = false ;

// multiple level menu


function mladdevents(){
	if(window.mlrunShim == true){
		var Iframe = document.createElement("iframe");
		Iframe.setAttribute("src","about:blank");
		Iframe.setAttribute("scrolling","no");
		Iframe.setAttribute("frameBorder","0");
		Iframe.style.zIndex = "2";
		Iframe.style.filter = 'alpha(opacity=0)';
	}
	var effects_a = new Array();
	var divs = document.getElementsByTagName('div');
	for(var j=0;j<divs.length;j++){
		if(divs[j].className.indexOf('mlmenu') != -1){
			var lis = divs[j].getElementsByTagName('li');
			for(var i =0;i<lis.length;i++){
				lis[i].onmouseover = mlover;
				lis[i].onmouseout = mloutSetTimeout;
				if(window.mlrunShim == true){
					lis[i].appendChild(Iframe.cloneNode(false));
				}
				if(lis[i].getElementsByTagName('ul').length > 0){
					lis[i].className += 'haschild';
					if(divs[j].className.indexOf('arrow') != -1){
						if(divs[j].className.indexOf('vertical') != -1 || lis[i].parentNode.parentNode.nodeName != 'DIV'){
							lis[i].getElementsByTagName('a')[0].innerHTML += '<span class="vert">&rarr;</span>';
						}
						else{
							lis[i].getElementsByTagName('a')[0].innerHTML += '<span class="horiz">&darr;</span>';
						}
					}
					else if(divs[j].className.indexOf('plus') != -1){
						lis[i].getElementsByTagName('a')[0].innerHTML += '<span class="plus">+</span>';
					}
				}
				else{
					if(divs[j].className.indexOf('arrow') != -1){
						//This accounts for a wierd IE-specific bug in horizontal menus. CSS will set visibility: hidden;. This keeps the menu level(in IE)
						lis[i].getElementsByTagName('a')[0].innerHTML += '<span class="noshow">&darr;</span>';
					}
				}
				var uls = lis[i].getElementsByTagName('ul');
				for(var k=0;k<uls.length;k++){
					var found = 'no';
					for(var z=0;z<effects_a.length;z++){
						if(effects_a[z] == uls[k]){
							found = 'yes';
						}
					}
					if(found == 'no'){
						effects_a[effects_a.length] = uls[k];
						uls[k].style.zIndex = '100';
						mlEffectLoad(uls[k]);
					}
				}
			}
		}
	}
}
function mloutSetTimeout(e){
	if(!e){
		var the_e = window.event;
	}
	else{
		var the_e = e;
	}
	var reltg = (the_e.relatedTarget) ? the_e.relatedTarget : the_e.toElement;
	if(reltg){
		var under = ancestor(reltg,this);
		if(under === false && reltg != this){
			window.mlLast = this;
			var parent = this.parentNode;
			while(parent.parentNode && parent.className.indexOf('mlmenu') == -1){
				parent = parent.parentNode;
			}
			if(parent.className.indexOf('delay') != -1){
				window.mlTimeout = setTimeout(function(){mlout()},1500);
			}
			else{
				mlout();
			}
		}
	}
}
function mlout(){
if(window.mlLast==null)return false;
	var uls = window.mlLast.getElementsByTagName('ul');
	var sib;
	for(var i=0;i<uls.length;i++){
		mlEffectOut(uls[i]);
		if(window.mlrunShim == true){
			sib = uls[i];							
			while(sib.nextSibling && sib.nodeName != 'IFRAME'){
					sib = sib.nextSibling
			}
			sib.style.display = 'none';
		}
	}
	window.lastover = null;
}
function mlover(e){
	if(!e){
		var the_e = window.event;
	}
	else{
		var the_e = e;
	}
	the_e.cancelBubble = true;
	if(the_e.stopPropagation){
		the_e.stopPropagation();
	}
	clearTimeout(window.mlTimeout);
	if(window.mlLast && window.mlLast != this && ancestor(this,window.mlLast) == false){
		mlout();
	}
	else{
		window.mlLast = null;
	}
	var reltg = (the_e.relatedTarget) ? the_e.relatedTarget : the_e.fromElement;
	var ob = this.getElementsByTagName('ul');
	var under = ancestor(reltg,this);
	if(ob[0] && under == false){
		if(window.lastover != ob[0]){
			if(window.mlrunShim == true){
				var sib = ob[0];
				while(sib.nextSibling && sib.nodeName != 'IFRAME'){
					sib = sib.nextSibling
				}
				ob[0].style.display = 'block';
				sib.style.top = ob[0].offsetTop+'px';
				sib.style.left = ob[0].offsetLeft-2+'px';
				sib.style.width = ob[0].offsetWidth+'px';
				sib.style.height = ob[0].offsetHeight-2+'px';
				sib.style.border = '1px solid red';
				sib.style.display = 'block';
			}
			mlEffectOver(ob[0],this);
			window.lastover = ob[0];
		}
	}
}
function mlSetOpacity(ob,level){
	if(ob){
		//level is between 0 and 10
		//need to convert to decimal for standard
		var standard = level/10;
		//need to convert to 0-100 scale for IE filter
		var ie = level*10;
		ob.style.opacity = standard;
		ob.style.filter = "alpha(opacity="+ie+")"
	}
}
function mlIncreaseOpacity(ob){
		var current = ob.style.opacity;
		if(lastob == ob && lastop == current){
			//mlout has not interfered
			current = current *10;
			var upone = current +1;
			mlSetOpacity(ob,upone);
			lastob = ob;
			lastop = upone/10;
		}
}
function mlIncreaseHeight(ob){
	var current = parseInt(ob.style.height);
	var newh = current + 1;
	ob.style.height = newh+'px';
}
function mlIncreaseWidth(ob){
	var current = parseInt(ob.style.width);
	var newh = current + 1;
	ob.style.width = newh+'px';
}
function mlBlink(ob){
	var newb = '1px solid red';
	var old = '';
	if(ob.style.border==old){
		ob.style.border=newb;
	}
	else{
		ob.style.border=old;
		ob.style.borderTop = '1px solid';
	}
}
function mlShake(ob){
	var newp = '5px';
	var old = '';
	if(ob.style.paddingLeft==old){
		ob.style.paddingLeft=newp;
	}
	else{
		ob.style.paddingLeft=old;
	}
}
function mlEffectOver(ob,parent){
	switch(ob.className){
		case 'fade':
			ob.style.display = 'block';
			if(ob.style.opacity == 0){
				lastob = ob
				lastop = 0;
				for(var i = 1;i<=10;i++){
					setTimeout(function(){mlIncreaseOpacity(ob)},i*50);
				}
				setTimeout(function(){ob.style.filter = ''},500);
			}
			break;
		case 'blink':
			ob.style.display = 'block';
			for(var i=0;i<10;i++){
				setTimeout(function(){mlBlink(ob)},i*50);
			}
			break;
		case 'shake':
			ob.style.display = 'block';
			for(var i=0;i<10;i++){
				setTimeout(function(){mlShake(ob)},i*50);
			}
			break;
		case 'blindv':
			ob.style.display = 'block';
			if(ob.offsetHeight){
				var height = ob.offsetHeight
				ob.style.height = '0px';
				ob.style.overflow = 'hidden';
				for(var i=0;i<height;i++){
					setTimeout(function(){mlIncreaseHeight(ob)},i*3);
				}
				setTimeout(function(){ob.style.overflow='visible';},height*3)
			}
			break;
		case 'blindh':
			ob.style.display = 'block';
			if(ob.offsetWidth){
				var width = ob.offsetWidth;
				ob.style.width = '0px';
				ob.style.overflow = 'hidden';
				for(var i=0;i<width;i++){
					setTimeout(function(){mlIncreaseWidth(ob)},i*3);
				}
				setTimeout(function(){ob.style.overflow='visible';},width*3)
			}
			break;
		default:
			ob.style.display = 'block';
			break;
	}
}
function mlEffectOut(ob){
	switch(ob.className){
		case 'fade':
			mlSetOpacity(ob,0);
			ob.style.display = 'none';
			break;
		case 'blink':
			ob.style.border = '';
			ob.style.display = 'none';
			break;
		case 'shake':
			ob.style.paddingLeft = '';
			ob.style.display = 'none';
			break;
		default:
			ob.style.display = 'none';
			break;
	}
}
function mlEffectLoad(ob){
	var parent = ob.parentNode;
	while(parent.parentNode && parent.className.indexOf('mlmenu') == -1){
		parent = parent.parentNode;
	}
	if(parent.className.indexOf('fade') != -1){
			ob.style.display = 'none';
			ob.className = 'fade';
			mlSetOpacity(ob,0);
	}
	else if(parent.className.indexOf('blink') != -1){
		ob.className = 'blink';
		ob.style.display = 'none';
	}
	else if(parent.className.indexOf('shake') != -1){
		ob.className = 'shake';
		ob.style.display = 'none';
	}
	else if(parent.className.indexOf('blindv') != -1){
		ob.className = 'blindv';
		ob.style.display = 'none';
	}
	else if(parent.className.indexOf('blindh') != -1){
		ob.className = 'blindh';
		ob.style.display = 'none';
	}
	else{
		ob.className = 'none';
		ob.style.display = 'none';
	}
}
function ancestor(child, parent){
	if(child==null)return false;//Saves checking elsewhere
	//This is a fix for a Firefox bug *gasp*
	//Aparantly causes a bug in Opera!
	//I see no choice but a browser detect. *sigh* I didn't want to have to do this.
	if(navigator.userAgent.indexOf('Gecko') != -1 && navigator.userAgent.indexOf('Opera') == -1){
		//This should only be run by Gecko based browsers. this code should be fine in everything but Opera so forge away browsers.
		var allc = parent.getElementsByTagName('*');
		for(var i= 0;i<allc.length;i++){
			if(allc[i] == child){
				return true;
			}
		}
	}
	else{
		//http://www.dynamicdrive.com/forums/showthread.php?t=12341 Thanks Twey!
		for(; child.parentNode; child = child.parentNode){
			if(child.parentNode === parent) return true;
		}
	}
	return false;
}

onload_add_action('mladdevents()');


/**
 * SWFObject v1.5: Flash Player detection and embed - http://blog.deconcept.com/swfobject/
 *
 * SWFObject is (c) 2007 Geoff Stearns and is released under the MIT License:
 * http://www.opensource.org/licenses/mit-license.php
 *
 */
if(typeof deconcept=="undefined"){var deconcept=new Object();}if(typeof deconcept.util=="undefined"){deconcept.util=new Object();}if(typeof deconcept.SWFObjectUtil=="undefined"){deconcept.SWFObjectUtil=new Object();}deconcept.SWFObject=function(_1,id,w,h,_5,c,_7,_8,_9,_a){if(!document.getElementById){return;}this.DETECT_KEY=_a?_a:"detectflash";this.skipDetect=deconcept.util.getRequestParameter(this.DETECT_KEY);this.params=new Object();this.variables=new Object();this.attributes=new Array();if(_1){this.setAttribute("swf",_1);}if(id){this.setAttribute("id",id);}if(w){this.setAttribute("width",w);}if(h){this.setAttribute("height",h);}if(_5){this.setAttribute("version",new deconcept.PlayerVersion(_5.toString().split(".")));}this.installedVer=deconcept.SWFObjectUtil.getPlayerVersion();if(!window.opera&&document.all&&this.installedVer.major>7){deconcept.SWFObject.doPrepUnload=true;}if(c){this.addParam("bgcolor",c);}var q=_7?_7:"high";this.addParam("quality",q);this.setAttribute("useExpressInstall",false);this.setAttribute("doExpressInstall",false);var _c=(_8)?_8:window.location;this.setAttribute("xiRedirectUrl",_c);this.setAttribute("redirectUrl","");if(_9){this.setAttribute("redirectUrl",_9);}};deconcept.SWFObject.prototype={useExpressInstall:function(_d){this.xiSWFPath=!_d?"expressinstall.swf":_d;this.setAttribute("useExpressInstall",true);},setAttribute:function(_e,_f){this.attributes[_e]=_f;},getAttribute:function(_10){return this.attributes[_10];},addParam:function(_11,_12){this.params[_11]=_12;},getParams:function(){return this.params;},addVariable:function(_13,_14){this.variables[_13]=_14;},getVariable:function(_15){return this.variables[_15];},getVariables:function(){return this.variables;},getVariablePairs:function(){var _16=new Array();var key;var _18=this.getVariables();for(key in _18){_16[_16.length]=key+"="+_18[key];}return _16;},getSWFHTML:function(){var _19="";if(navigator.plugins&&navigator.mimeTypes&&navigator.mimeTypes.length){if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","PlugIn");this.setAttribute("swf",this.xiSWFPath);}_19="<embed type=\"application/x-shockwave-flash\" src=\""+this.getAttribute("swf")+"\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\" style=\""+this.getAttribute("style")+"\"";_19+=" id=\""+this.getAttribute("id")+"\" name=\""+this.getAttribute("id")+"\" ";var _1a=this.getParams();for(var key in _1a){_19+=[key]+"=\""+_1a[key]+"\" ";}var _1c=this.getVariablePairs().join("&");if(_1c.length>0){_19+="flashvars=\""+_1c+"\"";}_19+="/>";}else{if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","ActiveX");this.setAttribute("swf",this.xiSWFPath);}_19="<object id=\""+this.getAttribute("id")+"\" classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\" style=\""+this.getAttribute("style")+"\">";_19+="<param name=\"movie\" value=\""+this.getAttribute("swf")+"\" />";var _1d=this.getParams();for(var key in _1d){_19+="<param name=\""+key+"\" value=\""+_1d[key]+"\" />";}var _1f=this.getVariablePairs().join("&");if(_1f.length>0){_19+="<param name=\"flashvars\" value=\""+_1f+"\" />";}_19+="</object>";}return _19;},write:function(_20){if(this.getAttribute("useExpressInstall")){var _21=new deconcept.PlayerVersion([6,0,65]);if(this.installedVer.versionIsValid(_21)&&!this.installedVer.versionIsValid(this.getAttribute("version"))){this.setAttribute("doExpressInstall",true);this.addVariable("MMredirectURL",escape(this.getAttribute("xiRedirectUrl")));document.title=document.title.slice(0,47)+" - Flash Player Installation";this.addVariable("MMdoctitle",document.title);}}if(this.skipDetect||this.getAttribute("doExpressInstall")||this.installedVer.versionIsValid(this.getAttribute("version"))){var n=(typeof _20=="string")?document.getElementById(_20):_20;n.innerHTML=this.getSWFHTML();return true;}else{if(this.getAttribute("redirectUrl")!=""){document.location.replace(this.getAttribute("redirectUrl"));}}return false;}};deconcept.SWFObjectUtil.getPlayerVersion=function(){var _23=new deconcept.PlayerVersion([0,0,0]);if(navigator.plugins&&navigator.mimeTypes.length){var x=navigator.plugins["Shockwave Flash"];if(x&&x.description){_23=new deconcept.PlayerVersion(x.description.replace(/([a-zA-Z]|\s)+/,"").replace(/(\s+r|\s+b[0-9]+)/,".").split("."));}}else{if(navigator.userAgent&&navigator.userAgent.indexOf("Windows CE")>=0){var axo=1;var _26=3;while(axo){try{_26++;axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+_26);_23=new deconcept.PlayerVersion([_26,0,0]);}catch(e){axo=null;}}}else{try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");}catch(e){try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");_23=new deconcept.PlayerVersion([6,0,21]);axo.AllowScriptAccess="always";}catch(e){if(_23.major==6){return _23;}}try{axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");}catch(e){}}if(axo!=null){_23=new deconcept.PlayerVersion(axo.GetVariable("$version").split(" ")[1].split(","));}}}return _23;};deconcept.PlayerVersion=function(_29){this.major=_29[0]!=null?parseInt(_29[0]):0;this.minor=_29[1]!=null?parseInt(_29[1]):0;this.rev=_29[2]!=null?parseInt(_29[2]):0;};deconcept.PlayerVersion.prototype.versionIsValid=function(fv){if(this.major<fv.major){return false;}if(this.major>fv.major){return true;}if(this.minor<fv.minor){return false;}if(this.minor>fv.minor){return true;}if(this.rev<fv.rev){return false;}return true;};deconcept.util={getRequestParameter:function(_2b){var q=document.location.search||document.location.hash;if(_2b==null){return q;}if(q){var _2d=q.substring(1).split("&");for(var i=0;i<_2d.length;i++){if(_2d[i].substring(0,_2d[i].indexOf("="))==_2b){return _2d[i].substring((_2d[i].indexOf("=")+1));}}}return "";}};deconcept.SWFObjectUtil.cleanupSWFs=function(){var _2f=document.getElementsByTagName("OBJECT");for(var i=_2f.length-1;i>=0;i--){_2f[i].style.display="none";for(var x in _2f[i]){if(typeof _2f[i][x]=="function"){_2f[i][x]=function(){};}}}};if(deconcept.SWFObject.doPrepUnload){if(!deconcept.unloadSet){deconcept.SWFObjectUtil.prepUnload=function(){__flash_unloadHandler=function(){};__flash_savedUnloadHandler=function(){};window.attachEvent("onunload",deconcept.SWFObjectUtil.cleanupSWFs);};window.attachEvent("onbeforeunload",deconcept.SWFObjectUtil.prepUnload);deconcept.unloadSet=true;}}if(!document.getElementById&&document.all){document.getElementById=function(id){return document.all[id];};}var getQueryParamValue=deconcept.util.getRequestParameter;var FlashObject=deconcept.SWFObject;var SWFObject=deconcept.SWFObject;

function detectQT(){
	if (navigator.plugins) {
		for (i=0; i < navigator.plugins.length; i++ ) {
			if (navigator.plugins[i].name.indexOf("QuickTime") >= 0)
				return true ;
		}
	}
	return false;
}

function createPlayer(ext, file, image, width, height) {
	if ( ext == "mp4" && detectQT() )
	{
		document.write('<embed src="' + file + '" width="' + width + '" height="' + height + '">');
	}
	else
	{
		document.write('<p id="player1"><a href="http://www.macromedia.com/go/getflashplayer">Flash Player n&eacute;cessaire</a></p>');
		document.write('<sc'+'ript language="javascript" type="text/javascript">');
		document.write('var s1 = new SWFObject("../../../../jscript/plugins/flash/player.swf", "single", ' + width + ', ' + height + ', "10");');
		document.write('s1.addParam("allowfullscreen","true");');
		document.write('s1.addVariable("file","' + file + '");');
		document.write('s1.addVariable("image","' + image + '");');
		document.write('s1.addVariable("width","' + width + '");');
		document.write('s1.addVariable("height","' + height + '");');
		document.write('s1.write("player1");');
		document.write('</sc'+'ript>');
	}
}
