// JavaScript Document

function writediv(div,texte)
{
	document.getElementById(div).innerHTML = texte;
}

function file(fichier)
{
	if(window.XMLHttpRequest) /*FIREFOX*/ xhr_object = new XMLHttpRequest(); 
	else if(window.ActiveXObject) /*IE*/  xhr_object = new ActiveXObject("Microsoft.XMLHTTP"); 
	else return(false); 
	tmp = Math.random(); 
	xhr_object.open("GET", fichier, false); 
	xhr_object.send(null); 
	if(xhr_object.readyState == 4) return(xhr_object.responseText);
	else return(false);
}

function getActualite( c )
{ 
		writediv('milieu2',"<img src='images/pictos/loading.gif' style='margin-left:180px;'>");
		if( texte = file('actualiteAjax.php?compteur='+c+'&rnd='+rnd())){	
			
			writediv('milieu2',texte);
		}
	
}	
function rnd() {
	ord=Math.random();
	ord=ord*10000000000000000000;
	return ord;
}
function fctMoine (){
	 var c = parseInt(document.forms['mf'].compteur.value);
	 if  ( c  > 0  )
	 {
		  var g =parseInt( c - 1);
		  getActualite(g);
	 }
}
function fctPlus  (){
	var c = parseInt(document.forms['mf'].compteur.value);
	 if  ( c  < 2  )
	 {
		  var g = parseInt( c + 1);
		  getActualite(g);
	 }
	 
	
}