$(function(){
	var FullscreenrOptions = { width: 1027, height: 1260, bgID: "#bgmaximage" };
	jQuery.fn.fullscreenr(FullscreenrOptions);


	$("select[name=region_id]").change(function(){
		var section = $("input[name=section]").val();
		var region_id = $(this).val();

		if(section == "points-de-collecte") {
			$.ajax({
				type: "POST",
				url: "/includes/php/region_name.php",
				data:"region_id="+region_id,
				success: function(response) {
					var form_url = "/" + section + "/" + response + ".html";
					$("form#slt_regions").attr("action", form_url);
					$("form#slt_regions").submit();
				}
			});
		} else
			$("form#slt_regions").submit();
	});


	$("div#sidebar ul li.active a").hover(function(){
		$(this).stop().animate({opacity : .5}, 500);
	}, function(){
		$(this).stop().animate({opacity : 1}, 500);
	});

	$("div#sidebar ul li.selected a").animate({opacity : .5}, 500);

	var i = 0;
	$("div.box").find("li").each(function(){
		i++;
		var row = (i % 2);		
		$(this).addClass("row" + row);
	});


	$("#amis_guignolee").innerfade({
		speed: "slow",
		timeout: 4000,
		type: "sequence",
		containerheight: "150px"
	});
});
