jQuery(document).ready(function(){
	jQuery('#dialog_newsletter').dialog({
		autoOpen: false,
		width: 550,
		buttons: {
			"S'inscrire": function() { 
				$.post("/lists/?p=subscribe&id=1", $("#testform").serialize(),function(data){
  
   $('#dialog_newsletter').html(data);
 });
				
			}, 
			"Fermer": function() { 
				$(this).dialog("close"); 
			} 
		}
	});
	jQuery('#menu_newsletter').click(function(){
		$('#dialog_newsletter').dialog('open');
		return false;
	});
	jQuery('#dialog_contact').dialog({
		autoOpen: false,
		width: 550,
		buttons: {
			"Envoyer": function() { 
				$.post("/contact/formulaire", $("#contactform").serialize(),function(data){
  
   $('#dialog_contact').html(data);
 });
				
			}, 
			"Fermer": function() { 
				$(this).dialog("close"); 
			} 
		}
	});
	jQuery('#menu_contact').click(function(){
		$('#dialog_contact').dialog('open');
		return false;
	});
	
	$("#img_produitsss").hover(function() {
	$(this).css({'z-index' : '10'}); /*Add a higher z-index value so this image stays on top*/
	$(this).removeClass("img_produit");
	$(this).addClass("img_produit_hover");

	 
	$(this).find('img').addClass("hover").stop() /* Add class of "hover", then stop animation queue buildup*/
		.animate({
			
			marginLeft: '-95px',
			top: '50%',
			left: '50%',
			width: '500px', /* Set new width */
			padding: '10px',
			border: '1px solid grey'
		}, 200); /* this value of "200" is the speed of how fast/slow this hover animates */

	} , function() {
	$(this).css({'z-index' : '0'}); /* Set z-index back to 0 */
	
	$(this).find('img').removeClass("hover").stop()  /* Remove the "hover" class , then stop animation queue buildup*/
		.animate({
			marginTop: '0', /* Set alignment back to default */
			marginLeft: '0',
			top: '0',
			left: '0',
			width: '350px', /* Set width back to default */
			 /* Set height back to default */
			padding: '5px',
			border: '0'
		}, 400);
		$(this).removeClass("img_produit_hover");
	$(this).addClass("img_produit");
});
});
