$(document).ready(function() {


// retour haut	
$(".remonte").click(function(){$.scrollTo( $("body"), 1200 );return false;})
	
	
// clutip
$('#tablo_palm tbody > tr, #prog1 tbody > tr, #tablo_fiche_tend, #bt_perimetre, a img#ret, img.pv').cluetip({splitTitle: '|', showTitle: false });


// bouton : slide des semaines	
$("div#semaine").hide();
	$("a#semaines").click(function(){
		$("div#semaine").slideToggle("slow");
 	return false;
});
	
	
$("p#perimetre").hide();
// bouton : slide du perimetre	
	$("div#bt_perimetre").click(function(){
		$("p#perimetre").slideToggle("slow");
		$(this).toggleClass("active");
	  	$(this).siblings(this).removeClass("active");
  	return false;
});		


// tabs	
$('#ongl3 > ul, .meil_prog > ul, #ongl_acc_1 > ul, #ongl_acc_2 > ul').tabs({ fxSlide: true, fxFade: false, fxSpeed: 'fast' });


// rollover sur tr : table id="prog"
	$('#prog1 tbody tr').hover(
		function() { $(this).find('td').each(function(i){if(i==0)$(this).addClass('highlight1'); else if(i==1) $(this).addClass('highlight'); else if(i==2) $(this).addClass('highlight2'); else $(this).addClass('highlight'); })},
		function() { $(this).find('td').each(function(i){if(i==0)$(this).removeClass('highlight1'); else if(i==1) $(this).removeClass('highlight'); else if(i==2) $(this).removeClass('highlight2'); else $(this).removeClass('highlight');})}
	);
	$('#prog tbody tr').hover(
		function() { $(this).find('td').each(function(i){if(i==0)$(this).addClass('highlight1'); else if(i==1) $(this).addClass('highlight'); else $(this).addClass('highlight2');})},
		function() { $(this).find('td').each(function(i){if(i==0)$(this).removeClass('highlight1'); else if(i==1) $(this).removeClass('highlight'); else $(this).removeClass('highlight2');})}
	);
	$('#tablo_palm tbody tr').hover(
		function() { $(this).find('td').each(function(i){if(i==0)$(this).addClass('highlight'); else $(this).addClass('highlight3');})},
		function() { $(this).find('td').each(function(i){if(i==0)$(this).removeClass('highlight'); else $(this).removeClass('highlight3');})}
	);
	$('#adh tr').hover(
		function() { $(this).find('td:fist').addClass('adh_over').find('td:second').addClass('adh_over'); },
		function() { $(this).find('td:fist').removeClass('adh_over').find('td:second').removeClass('adh_over'); }
	);
// click sur tr title="|Voir la fiche détaillée" : tables
	$("#prog1 tbody tr, #prog tbody tr, #tablo_palm tr, #adh tr").click(function(){
			window.location=$(this).find("a").attr("href");
			return false;
		});
	$("#prog1 tbody td, #prog tbody td, #tablo_palm td, #adh td").css("cursor","pointer");



	








});
