// OBLET PRONOSTIC
function objDivAnime( idDiv, idBtn, idCache, bg , n )
 {
	this.objBtn = $("#" + idBtn) ;
	this.objDiv = $("#" + idDiv) ;
	this.objBtn.pere = $("#" + idDiv) ;
	this.objDiv.css( "background-color", bg ) ; 
	this.nbrDiv = n ;

	this.objBtn.click (  
		function() {
			for ( i = 0 ; i < n ; i++) $("#detail"+i).attr("src" , 'http://www.foot4cash.com/img/btn_plus.png' ) ;
			if (  $("#"+idCache).css("display") == "none" ) this.src = 'http://www.foot4cash.com/img/btn_moins.png' ;
			showDiv( $("#last").attr("value") , idCache ) ;
		} 
	);
	this.objDiv.mouseover ( function() { this.style.backgroundColor = '#FFC' ; } );
	this.objDiv.mouseout ( function() { this.style.backgroundColor = bg ; } );
}

function showDiv( precedent, suivant ) 
{
	if ( precedent != suivant && precedent != 'init' ) 
	{						
		$("#"+precedent).css("display","none") ;
		$("#"+suivant).css("display","block") ;
		$("#last").attr( "value", suivant ) ;
	} 
	else 
	{
		if ( $("#"+precedent).css("display")  == "block" )
		{
			$("#"+precedent).css("display","none") ;
			$("#last").attr( "value", suivant ) ;
		} else {
			$("#"+precedent).css("display","block") ;
			$("#last").attr( "value", suivant ) ;
		}
	}
}

for ( i = 0; i <= nbrObjAnim; i++) {
	var newObjRencontre = "newObjRencontre" + i ;
	i%2 == 0 ? couleur = "transparent" : couleur = "#EEEEEE" ;
	newObjRencontre = new objDivAnime( "prono"+i, "detail"+i, "stat"+i , couleur , nbrObjAnim ) ;
}
$("#last").attr( "value", "stat"+ 0 );
$("#stat"+0).css("display","block") ;
$("#detail"+0).attr("src","http://www.foot4cash.com/img/btn_moins.png") ;
