$(document).ready(function() {
	$("#menu").find("a").mouseover(function() {
		$(this).fadeTo("slow",0.5);
	}).mouseout(function() {
		$(this).fadeTo("slow",1);
	});
	RandomAnnonceur();
	$("ul.evenements").jcarousel({
        auto: 3,
        vertical: true,
		scroll: 1,
		wrap: "both"
    });
});

$(document).everyTime(20000,RandomAnnonceur);

function RandomAnnonceur() {
	$("#carnet .annonceur").empty();
	$("#carnet .annonceur").addClass("loading");
	$.ajax({
		type: "POST",
		url: SITE_PATH+"content/ajax/Ajax_Annonceurs.php",
		success: function(data){
			$("#carnet .annonceur").html(data);
			$("#carnet .annonceur").removeClass("loading");
			Shadowbox.init();
		}
	});
}

function HighlightDates() {
	$(".Event").parents(".DateBox").addClass("Reserved");
	$("#jMonthCalendar").find(".DateLabel").click(function() {
		if($(this).parents("td").hasClass("Reserved")) {
			var id = $(this).siblings("div").find("a").attr("href");
			document.location = "evenement-"+id+"-rennes.html";
		}
	});
}