function afficher(id,classe,goto_down,goto_up) {

	

  if(document.getElementById(id).style.display=="none" || document.getElementById(id).style.display=="") // si il est visible, on le cache
  {
	 $("."+classe).slideUp("slow") ;
	 $("#"+id).slideDown("normal") ;
	 
	 if(goto_down)
	 {
	 	var url = ""+window.location.href;
	 	
	 	var debut = url.lastIndexOf("/") + 1;
	 	var page = url.substring(debut);
	 	
	 	if(page.indexOf("#",0) != -1) /* SI une ancre est trouvee, on l'enleve */
	 	{
	 		page = page.substring(0,page.indexOf("#",0));
	 	}
	 	
		 document.location.href= page+""+goto_down+"";
	 }
  }
  else
  {
	 $("#"+id).slideUp("slow") ;
	 
	 if(goto_up)
	 {
	 	var url = ""+window.location.href;
	 	
	 	var debut = url.lastIndexOf("/") + 1;
	 	var page = url.substring(debut);
	 	
	 	if(page.indexOf("#",0) != -1) /* SI une ancre est trouvee, on l'enleve */
	 	{
	 		page = page.substring(0,page.indexOf("#",0));
	 	}
	 
		 document.location.href= page+""+goto_up+"";
	 }
  }
	
}


function getElementsByClass(classe)
{
	var divs = document.getElementsByTagName('td');
	var resultats = new Array();
	for(var i=0; i<divs.length; i++)
		if(divs[i].className == classe)
			resultats.push(divs[i]);
	return resultats;
}

function set_borders(id)
{
	var inset = 0;
	

	
	if(document.getElementById("cell"+id).style.border.indexOf("inset",0) != -1)// si la bordure est deja inset
	{
		inset = 1;
		
	}
	
	var tds = getElementsByClass('event');
	for(var i=0; i<tds.length; i++)
		tds[i].style.border= "1px outset #ffa517";
		
	if(inset == 0)
	{
		document.getElementById("cell"+id).style.border= "1px inset #ffa517";
	}
	
	
}

function textedesc(id,text)
{
 
	document.getElementById(id).innerHTML = ""+text;
	if(document.getElementById(id).style.display=="none" || document.getElementById(id).style.display=="") // si il est visible, on le cache
 	{
 		$("#"+id).slideDown("normal") ;
 	}
 	
	
}

function clear_zone(text)
{

	/*if(this.value==text)
	{
		this.value='';
	}
*/
}

function fill(text)
{
	/*if(this.value=='')
	{
		this.value=text;
	}*/

}




function cal(date) {
	$.get("cal.php?date="+date,function(html) 
	{
		$("#bloc_calendrier").html(""+html+"");
		
	});
	
	
}




function display_news(){

mytime=setTimeout('display_ct()',1)
}

function display_c(){

mytime=setTimeout('display_ct()',refresh)
}
var i=0;

function init_news(tableau,delai){
 tab=tableau
 refresh=delai
}

function display_ct() {

document.getElementById('bloc_news').innerHTML = tab[i];
i++
if(i==tab.length)
{i=0}
tt=display_c();
}
