var timer=null;

function resetTimer()
  {
	clearTimeout(timer);
  }
function montrerMenu(n)
  {
	if(timer!=null)  {resetTimer();}
	cacherLesMenus();
	offSet = $('#idMenu'+n).offset();
	var nlnew = offSet.left + ($('#idMenu'+n).width() - $('#snav'+n).width())/2;
	$('#snav'+n).css('margin-left',nlnew+'px');
	$('#snav'+n).css('display','block');
  }
function retardateurMaskerMenu(n)
  {
	timer = setTimeout ( "maskerMenu("+n+")", 1000 );
  }
function maskerMenu(n)
  {
	$('#snav'+n).css('display','none');
  }
function cacherLesMenus()
  {
	$('#snav0').css('display','none');
	$('#snav1').css('display','none');
	$('#snav2').css('display','none');
	$('#snav3').css('display','none');
	$('#snav4').css('display','none');
  }
function getPageActu(nRubrique,nParPage,idBloc,nPage)
  {$("#"+idBloc).load(localPath+"library/ajax/lstActus.php",{ 'nPage': nPage, 'nParPage': nParPage , 'idBloc':idBloc ,'nRubrique':nRubrique });}
function getPageActu2(nRubrique,nParPage,idBloc,nPage) 
  {$("#"+idBloc).load(localPath+"library/ajax/lstActus.php",{ 'nPage': nPage, 'nParPage': nParPage , 'idBloc':idBloc ,'nRubrique':nRubrique, 'type':'bas' });}
function getPageBlog(nRubrique,nParPage,ordonancement,idBloc,nPage)
  {$("#"+idBloc).load(localPath+"library/ajax/lstBlogs.php",{ 'nPage': nPage, 'nParPage': nParPage , 'idBloc':idBloc ,'nRubrique':nRubrique, 'ordonancement':ordonancement });}
function getPageBlog3(feedURL,nParPage,lieu,idBloc,nPage)
  {$("#"+idBloc).load(localPath+"library/ajax/listeRSS.php",{ 'url': feedURL, 'nbItems': nParPage , 'lieu':lieu ,'type':'blog', 'divCible':idBloc, 'nPage':nPage });}
function getVideoTem(idBloc,idPage,idTem)
  {$("#"+idBloc).load(localPath+"library/ajax/lstVideos.php",{ 'idPage': idPage, 'idTem': idTem , 'idBloc':idBloc });}
function chargeRSS(divCible,nbItems,urlFlux,lieu)
  {$("#"+divCible).load(localPath+"library/ajax/listeRSS.php",{ 'url':urlFlux, 'nbItems':nbItems, 'lieu':lieu});}
function chargeRSSBlog(divCible,nbItems,urlFlux,lieu)
  {$("#"+divCible).load(localPath+"library/ajax/listeRSS.php",{ 'url':urlFlux, 'nbItems':nbItems, 'lieu':lieu, 'type':'blog', 'divCible':divCible});}
function voterSondage(idS)
  {$("#blocSondage").load(localPath+"library/ajax/votersondage.php",{ 'idS': idS, 'repChoisie':$("input[name='repSondage']:checked").val() });}
function ajouterCom(idArticle,repa)
  {$("#zoneCom").load(localPath+"library/ajax/newCom.php",{ 'idArticle': idArticle, 'repa':repa });}
function controlFields(controles,messages)
  {
	toutestok = true;
	for(i=1;i<=controles.length;i++)
	  {
		if(eval(controles[i]))
		  {
			alert(messages[i]);
			toutestok = false;
			i=controles.length+2;
		  }
	  }
	
	return toutestok;
  }


function voirEcoles(idBloc)
  {
	if($('#'+idBloc).hasClass('actif'))
	  {
		$('#'+idBloc).removeClass('actif');
		$('#contenu'+idBloc).css('display','none');
	  }
	else
	  {
		$('#'+idBloc).addClass('actif');
		$('#contenu'+idBloc).css('display','block');
	  }
  }

