




function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function ImgRestore(doc) { //v3.0
			var titreList = doc.getElementsByTagName("img");
			titreList[0].width="135";
			titreList[0].height="80";
			titreList[0].style.margin="0px 0 0 0px";
}

function swapImage(doc) { //v3.0
			var titreList = doc.getElementsByTagName("img");
			titreList[0].width="145";
			titreList[0].height="86";
			titreList[0].style.margin="0px 0 0 -5px";
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}



function Vas_y(x) {
form=document.getElementById(x);
x=form.select.options[form.select.options.selectedIndex].value;
 if(x == "rien") {
   return;
 }
 else {
 window.open(x);
 }
}


function initTrafic() {
	
$('morph_center').style.overflow="hidden";
$('bt_trafic').innerHTML="<a href='javascript:stop_trafic()'>Pause</a>";
for (i=0; i<traficLoaded; i++){ 
   $('trafic_'+i).style.display="none";
   } ;
$('trafic_'+traficCurrent).style.display="block";

decl= setTimeout ( "showTrafic()", 3000 );
}

function showTrafic() {

$('morph_center').morph('height:0px', {duration:1.5, afterFinish:function() { show_trafic(); } });


}


function show_trafic() {
	
$('morph_center').morph('height:36px',{ queue: 'end' });

$('trafic_'+traficCurrent).style.display="none";

if (traficCurrent<traficLoaded-1)
    traficCurrent++;
else
	traficCurrent=0;

$('trafic_'+traficCurrent).style.display="block";

decl= setTimeout ( "showTrafic()", 5000 );
}


function stop_trafic() {
	
clearTimeout(decl);

$('bt_trafic').innerHTML="<a href='javascript:go_trafic()'>Lecture</a>";
}

function go_trafic() {
	
decl= setTimeout ( "showTrafic()", 2000 );
$('bt_trafic').innerHTML="<a href='javascript:stop_trafic()'>Pause</a>";

}






function htmlspecialchars_java(ch) {
   ch = ch.replace(/&amp;/g,"&")
   ch = ch.replace(/&quot;/g,"\"")
   ch = ch.replace(/&#039;/g,"\'")
   ch = ch.replace(/&lt;/g,"<")
   ch = ch.replace(/&gt;/g,">")
   return ch
}

function req_actu(id)
	{
/*@cc_on @*/

	var xhr_object = null;
	
	if(window.XMLHttpRequest) // Firefox
		xhr_object = new XMLHttpRequest();
	else if(window.ActiveXObject) // Internet Explorer
   		xhr_object = new ActiveXObject("Microsoft.XMLHTTP");
	else
		{ // XMLHttpRequest non supporté par le navigateur
   		alert("Votre navigateur ne supporte pas les objets XMLHTTPRequest...");
   		return;
		}
	xhr_object.open("POST", "show_actu.php", true);
	
	xhr_object.onreadystatechange = function()
		{
		if(xhr_object.readyState == 4)
	       eval(xhr_object.responseText);
		}

	xhr_object.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
	var data = "family="+id;
   	xhr_object.send(data);
	}
function req_trafic(id)
	{
/*@cc_on @*/

	var xhr_object = null;
	
	if(window.XMLHttpRequest) // Firefox
		xhr_object = new XMLHttpRequest();
	else if(window.ActiveXObject) // Internet Explorer
   		xhr_object = new ActiveXObject("Microsoft.XMLHTTP");
	else
		{ // XMLHttpRequest non supporté par le navigateur
   		alert("Votre navigateur ne supporte pas les objets XMLHTTPRequest...");
   		return;
		}
	xhr_object.open("POST", "show_trafic.php", true);
	
	xhr_object.onreadystatechange = function()
		{
		if(xhr_object.readyState == 4)
	       eval(xhr_object.responseText);
		}

	xhr_object.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
	var data = "family="+id;
   	xhr_object.send(data);
	}

function req_spec(f,mode)
	{
/*@cc_on @*/
	var l1    = f.elements["ligne"];
	var l2    = f.elements["arret"];
	var index = l1.selectedIndex;
   		var xhr_object = null;
	
		if(window.XMLHttpRequest) // Firefox
			xhr_object = new XMLHttpRequest();
		else if(window.ActiveXObject) // Internet Explorer
    		xhr_object = new ActiveXObject("Microsoft.XMLHTTP");
   		else
   			{ // XMLHttpRequest non supporté par le navigateur
      		alert("Votre navigateur ne supporte pas les objets XMLHTTPRequest...");
      		return;
   			}
   		xhr_object.open("POST", "req_spec.php", true);
	
		xhr_object.onreadystatechange = function()
			{
			if(xhr_object.readyState == 4)
        eval(xhr_object.responseText);
			}

		xhr_object.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
		var data = "family="+escape(l1.options[index].value)+"&form="+f.id+"&select=arret"+"&mode="+mode;
   		xhr_object.send(data);
	}
