$(document).ready(function(){
	$("ul.menu li a").click(function() {
		$("ul.menu > li.active").removeClass("active"); 
		$(this).parents("li").addClass("active"); 
	});
	

	$("table.tableau_formateurs").each(function(i){
		if (is_int(i/2)) {
			$(this).addClass('bgTable');
		}
	});
	
	 $("table.tableau_formateurs").hover(function() {
		 $(this).css({ border:"dotted 1px #FF853F"});
	 }, function () {
	      var cssObj = {
	        border: "dotted 1px #DEDEDE",
	        fontWeight: ""
	      }
	      $(this).css(cssObj);
	    });
	 
	 // gestion des coins arrondis
	 $(".blocinfos").corner();
	 $("#push > .corner").corner();
	 
	 //
	 $("#licenceTT").css({ display: "none"});
	 $('#licenceTTLink').click(function() {
		 $('#licence').toggle();
	 });
	 
	 // faq
	 $(".hide").css({ display: "none"});
	 
	 $('.parent_hide').click(function() {
		 $(this).next().toggle('slow');
	 });

});

function is_int( mixed_var ) {
    // Find whether the type of a variable is integer
    // 
    // +    discuss at: http://kevin.vanzonneveld.net/techblog/article/javascript_equivalent_for_phps_is_int/
    // +       version: 805.3114
    // +   original by: Alex
    // +   improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
    // *     example 1: is_int(186.31);
    // *     returns 1: false
    // *     example 2: is_int(12);
    // *     returns 2: true

    var y = parseInt(mixed_var * 1);
    
    if (isNaN(y)) {
        return false;
    }
    
    return mixed_var == y && mixed_var.toString() == y.toString(); 
}
