/* <![CDATA[ */

function createZoomContent(nb,test){

		$("#contenuZoom").empty();
		 $("#contenuZoom").append("<h3>"+test[0].getElementsByTagName("titre")[0].firstChild.nodeValue+"<\/h3><div class='zoomTexte'>"+ test[0].getElementsByTagName("corps")[0].firstChild.nodeValue+"<a class='suiteLink' title='"+test[0].getElementsByTagName("titrelien")[0].firstChild.nodeValue+"' href='"+test[0].getElementsByTagName("lien")[0].firstChild.nodeValue+"'>"+test[0].getElementsByTagName("titrelien")[0].firstChild.nodeValue+"<span style='font-size:9px'>&#9654;<\/span><\/a><\/div><div class='zoomPicto'><img src='"+test[0].getElementsByTagName("graphe")[0].firstChild.nodeValue+"' alt='"+test[0].getElementsByTagName("titre")[0].firstChild.nodeValue+"' title='"+test[0].getElementsByTagName("titre")[0].firstChild.nodeValue+"' /><\/div><div style='clear:both'><\/div>");


		
		if(nb > 0){
			$("#btnPre").show();
		}else{
			$("#btnPre").hide();
		}
		
		if(nb < numRows-1){
			$("#btnNex").show();
		}else{
			$("#btnNex").hide();
		}						
}

$.timer({name:"ZoomAuto", interval: 15, end: "unlimited"}, function() {

		if(nb < numRows-1){
			 getNodeZoomContent(nb+1);
		}else{
			 getNodeZoomContent(0);
		}					
});

$("#btnPre").click(
	function(){ 
		var noeud = (nb-1);
		getNodeZoomContent(noeud);
	
	}
);
	
$("#btnNex").click(
	function(){ 		
		var noeud = (nb+1);
		getNodeZoomContent(noeud);
		
	}
);

//Recuperation du Noeuds XML	
function getNodeZoomContent(numb3rs){
	$.ajax({
			type: "GET",
			url: "http://"+SERVERNAME+"/ct_common/AjaxGetZoomContent.php?numb3rs="+numb3rs+"&codePays="+CODEPAYSCONTENT,
			dataType : "xml",
			
			success:function(data){
				var test = data.getElementsByTagName('tests');
				numRows = test[0].getElementsByTagName('numRows')[0].firstChild.nodeValue;
				nb=numb3rs;
				createZoomContent(numb3rs,test);
			}
	})
}

//Appel De l'affichage du premier noeaud
//$(document).ready(function(){
	getNodeZoomContent(0);
	//}
//); 
		
/* ]]> */