function fermeture_div(){
$("#message_inscription_mailing").slideUp("slow",function(){$("#message_inscription_mailing").empty();});
}
function verif_vide(){
		if (($('#hebergement').val() == '') || ($('#hebergement').val() == 'Saisir votre recherche')){
			$('#message_search').html("S&eacute;lectionnez un mot");
			}else{
				$(".recherche_form").submit();
				}
		}

	// creates the hover-slide effect for all link elements 		
function changeBgOver(name,url){
 if( $('#'+name).attr('class') != 'active'){
	$('#'+name).find('img').attr('src',url+'template/img/'+name+'-over.gif');
	}
	}
	function changeBgOut(name,url){
 if( $('#'+name).attr('class') != 'active'){
	$('#'+name).find('img').attr('src',url+'template/img/'+name+'.gif');
 }
	}
$(document).ready(function(){	
	$("#hebergement").focus(function(){
											$(this).css("background","#FFFFFF");
											$(this).css('color','#000000');
											$(this).val("");
															});
						   
	$("#hebergement").blur(function(){
				if (($(this).val() == '') || ($(this).val() == 'Saisir votre recherche')){
					$(this).css("background","#EBEBEB");
					$(this).css('color','#999999');
					$(this).val("Saisir votre recherche");
				}
				}); 
	$("#arbo_cat").jBreadCrumb();
	//actualites
	
					
					
//end actualites
$(".sliding-element-departement a").mouseover(function(){
			$(this).animate({ paddingLeft: "15px" }, 150);
		});
		$(".sliding-element-departement a").mouseout(function(){
			$(this).animate({ paddingLeft: "0" }, 150);
		});						   

 $(".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);
 });
 $(".div_logo_payant_ville_none").fadeTo(100,0.3);
$(".div_logo_payant_ville_none").mouseover(function(){
$(this).fadeTo("slow", 1);
});
$(".div_logo_payant_ville_none").mouseout(function(){
$(this).fadeTo("slow", 0.3);
 });
$(".pagination a").mouseover(function(){
  $(".pagination a").filter(".current").removeClass("current");
  $(this).addClass("current");
	});
//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"});
		$("#onload_transaction").addClass("onload_transaction");
			$.ajax({ 
				    
  type: "POST", 
  url: "MailingInscription/InscriptionProcess.php", 
  data: {
   email:$("#emailMailing").val()
  },
  success: function(msg){ 
  $("#mailingwrap").css({ opacity: "1", background: "#BBD9F7"});
   $("#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
