/* javascript pour le formulaire de recherche */
$(document).ready(function(){
	$("label.taperici").taperici();
});

/* on enleve la derniere bordure dans les liens du header */
$(document).ready(function(){
    $("div#usermenu div#links ul > li:first-child a").css("background-image","none");
});

/* javascript de survol */
$(document).ready(function(){
	$(".content-view-une, .children .content-view-line, .content-view-children .content-view-line, .content-view-children .content-view-flash, .content-view-embed .class-event-calendar .content-view-children .content-view-line").hover(
		function(){
			$(this).addClass("hover");
		},
		function(){
			$(this).removeClass("hover");
		}
	);
});

/* javascript de "centrage" des images dans un diapo */
$(document).ready(function(){
	$(".content-view-galleryline .attribute-image p").each(function(i){
		var taille = parseInt(100 - $("img", this).height())/2;
		$(this)
			.css("margin-top",taille)
			.css("height",100 - taille)
		;
	});

	$(".gallery-image .attribute-image").each(function(i){
		var taille = parseInt(400 - $("img", this).height())/2;
		$(this)
			.css("margin-top",taille)
			.css("height",400 - taille)
		;
	});
});

/* affichage d'un diaporama dans un reportage */
$(function() {
    $(".diaporama .jCarouselLite").jCarouselLite({
        btnNext: ".diapo-next",
        btnPrev: ".diapo-prev",
        visible: 3,
        scroll: 3,
        circular: false,
        vertical: false
    });
});

function openwindow(fichier,largeur,hauteur){
      window.open(fichier,"photo"+(100000000000000000*Math.random()),"width="+largeur+",height="+hauteur+",location=no,menubar=no,toolbar=no,status=no");
}

/*
$(document).ready(function () { // On verifie que la page est chargée
        $.get("test.php",{},
        function success(data){ // Au succès on renvoie le résultat de la requête
        alert(data); // Affichage
    });
});*/

/* menu de navigation superieur */
$(document).ready(function(){
	var $topmenu = $("#topmenu > ul");
	$topmenu
		.find("> li")
			.hover(
				function(){
					$(this)
						.addClass("hover");
				},
				function(){
					$(this).removeClass("hover");
				}
			)
		.end()
		.find("ul li")
			.hover(
				function(){
					$(this).addClass("hover");
				},
				function(){
					$(this).removeClass("hover");
				}
			)
		.end()

	;
});

/* Aganda : montrer les evenements caches quand il y en a trop */
$(document).ready(function(){
    $("a#ezagenda_month_hidden_show").click(
		function(){
			$("#ezagenda_month_hidden").show();
			$(this).hide();
			return false;
		}
	);
});