function fermeture_div(){
$("#message_inscription_mailing").slideUp("slow",function(){$("#message_inscription_mailing").empty();});
}

	function slide(navigation_id, pad_out, pad_in, time, multiplier)
{
	// creates the target paths
	var list_elements = navigation_id + " li.sliding-element-departement";
	var link_elements = list_elements + " a";
	
	// initiates the timer used for the sliding animation
	var timer = 0;
	
	// creates the slide animation for all list elements 
	$(list_elements).each(function(i)
	{
		// margin left = - ([width of element] + [total vertical padding of element])
		$(this).css("margin-left","-180px");
		// updates timer
		timer = (timer*multiplier + time);
		$(this).animate({ marginLeft: "0" }, timer);
		$(this).animate({ marginLeft: "15px" }, timer);
		$(this).animate({ marginLeft: "0" }, timer);
	});

	// creates the hover-slide effect for all link elements 		
	$(link_elements).each(function(i)
	{
		$(this).hover(
		function()
		{
			$(this).animate({ paddingLeft: pad_out }, 150);
		},		
		function()
		{
			$(this).animate({ paddingLeft: pad_in }, 150);
		});
	});
}
$('.map').maphilight({
					fillColor : "FF8A4A",	 
					strokeColor : "FF8A4A"
				});

$(document).ready(function(){
//actualites
	var newsoption1 = {
  firstname: "mynews",
  secondname: "showhere",
  thirdname:"news_display",
  fourthname:"news_button",
  playingtitle:"Actuellement en ligne : ",
  nexttitle:"Actualite Suivante : ",
  imagedir: "template/",
  prevtitle:"Actualite Precedente : ",

   newsspeed:'20000'
}
$.init_news(newsoption1);
						  
//end actualites
						   
//effect menu	

slide("#sliding-navigation-departement", 25, 15, 150, .8);

$('#contactwrap').corner({
			  tl: { radius: 6 },
			  tr: { radius: 6 },
			  bl: { radius: 6 },
			  br: { radius: 6 }});

$('#submitwrap').corner({
			  tl: { radius: 6 },
			  tr: { radius: 6 },
			  bl: { radius: 6 },
			  br: { radius: 6 }});
$('#Description_Pays').corner({
			  tl: { radius: 6 },
			  tr: { radius: 6 },
			  bl: { radius: 6 },
			  br: { radius: 6 }});
$('#module_image_lasted').corner({
			  tl: { radius: 6 },
			  tr: { radius: 6 },
			  bl: { radius: 6 },
			  br: { radius: 6 }});
$('#menus_membre').corner({
			  tl: { radius: 6 },
			  tr: { radius: 6 },
			  bl: { radius: 6 },
			  br: { radius: 6 }});
$('#menus_membre_paypal').corner({
			  tl: { radius: 6 },
			  tr: { radius: 6 },
			  bl: { radius: 6 },
			  br: { radius: 6 }});
$('#menus_newsletter').corner({
			  tl: { radius: 6 },
			  tr: { radius: 6 },
			  bl: { radius: 6 },
			  br: { radius: 6 }});
$('.menu_departement').corner({
			  tl: { radius: 6 },
			  tr: { radius: 6 },
			  bl: { radius: 6 },
			  br: { radius: 6 }});
	$('.info_carte').corner({
			  tl: { radius: 6 },
			  tr: { radius: 6 },
			  bl: { radius: 6 },
			  br: { radius: 6 }});
$('.message_nb_site').corner({
			  tl: { radius: 1 },
			  tr: { radius: 1 },
			  bl: { radius: 6 },
			  br: { radius: 6 }});
 $(".div_logo_payant_ville").fadeTo(100,0.3);
$(".div_logo_payant_ville").mouseover(function(){
$(this).fadeTo("slow", 1);
});
$(".div_logo_payant_ville").mouseout(function(){
$(this).fadeTo("slow", 0.3);
 });
$(".pagination a").mouseover(function(){
  $(".pagination a").filter(".current").removeClass("current");
  $(this).addClass("current");
	});
$(".div_button_type_hebergement").mouseover(function(){$(this).css({background: "#FCDE98" })});
  $(".div_button_type_hebergement").mouseout(function(){$(this).css({background: "#FFCC33" })});
$(".affiche_site").mouseover(function(){$(this).css({background: "#FFEBD7" })});
  $(".affiche_site").mouseout(function(){$(this).css({background: "#eee" })});
$(".menu_membre").mouseover(function(){$(this).css({background: "#fff" })});
$(".menu_membre").mouseout(function(){$(this).css({background: "#FFEBD7" })});

//contôle du formulaire de Mailing
var validator = $("#mailingform").validate({
		rules: {
			emailMailing: {
				required: true,
				email: true
			},
			confEmailMailing: {
				required: true,
				email: true,
				equalTo: "#emailMailing"
			}
		},
		messages: {
		
			emailMailing: {
				required: "&nbsp;",
				email: "&nbsp;"
			},
			confEmailMailing: {
				required: "&nbsp;",
				email: "&nbsp;",
				equalTo: "&nbsp;"
			}
			
		},
		// the errorPlacement has to take the table layout into account
		errorPlacement: function(error, element) {
			if ( element.is(":radio") )
				error.appendTo( element.parent().next().next() );
			else if ( element.is(":checkbox") )
				error.appendTo ( element.next() );
			else
				error.appendTo( element.parent().next() );
		},
		// specifying a submitHandler prevents the default submit, good for the demo
		submitHandler: function() {
		$("#mailingwrap").css({ opacity: "0.50", background: "#FFFFFF"});
		$("#onload_transaction").addClass("onload_transaction");
			$.ajax({ 
				    
  type: "POST", 
  url: "MailingInscription/InscriptionProcess.php", 
  data: {
   email:$("#emailMailing").val()
  },
  success: function(msg){ 
  $("#mailingwrap").css({ opacity: "1", background: "#FFEFE8"});
   $("#onload_transaction").removeClass("onload_transaction");
   $("#message_inscription_mailing").slideDown("slow",function(){$("#message_inscription_mailing").html(msg);});
 $("#mailingform input[@type=text]").val("");
 $(".status").empty();
  setTimeout("fermeture_div()",4000);
  }
  });
		},
		// set this class to error-labels to indicate valid fields
		success: function(label) {
			// set &nbsp; as text for IE
			label.html("&nbsp;").addClass("checked");
		}
	});

  //fin Controle



 
						  
							});// ready close
