$(function() {

	$("#menu2").hover(function(){$("#menu_drop1").slideUp('fast');});
	$("#menu3").hover(function(){$("#menu_drop1").slideUp('fast');});
	$("#menu4").hover(function(){$("#menu_drop1").slideUp('fast');});
	$("#menu5").hover(function(){$("#menu_drop1").slideUp('fast');});

	$("#menu1").hover(function(){$("#menu_drop2").slideUp('fast');});
	$("#menu3").hover(function(){$("#menu_drop2").slideUp('fast');});
	$("#menu4").hover(function(){$("#menu_drop2").slideUp('fast');});
	$("#menu5").hover(function(){$("#menu_drop2").slideUp('fast');});


	$("#menu1").hover(function(){$("#menu_drop1").slideDown('fast');});
	$("#menu_drop1").mouseleave(function() {$(this).slideUp('fast');});
	
	$("#menu2").hover(function(){$("#menu_drop2").slideDown('fast');});
	$("#menu_drop2").mouseleave(function() {$(this).slideUp('fast');});
	
	
    //changement matiere :   
   $("#combo_mat").change(function () {

		var final = "id="+$(this).val();
		
		var lang = $('#lang').val();
		
		$.ajax({
			url: "http://"+document.domain+"/"+lang+"/couleurs",
			type: "POST",
			data: final,
			success: function(html){
				$("#content_couleur").empty();
				$("#content_couleur").append(html);
			}
    	});
    		
		$.ajax({
			url: "http://"+document.domain+"/"+lang+"/prix",
			type: "POST",
			data: final,
			success: function(html){
				$("#content_price").empty();
				$("#content_price").append(html);
			}
    	});
    		
		
		$.ajax({
			url: "http://"+document.domain+"/"+lang+"/image_matiere",
			type: "POST",
			data: final,
			success: function(html){
				if (html != ""){
					$("#image_produit").empty();
					$("#image_produit").append('<a href="/mediatheque/products/zoom/'+html+'" class="jqzoom"  title=""><img src="/mediatheque/products/big/'+html+'" /></a>');
					var options = {
					    zoomWidth: 240,
						zoomHeight: 533,
			            title :false,
			            position : 'right',
			            showEffect : 'slow',
			            hideEffect : 'slow',
			            yOffset : 5,
			            xOffset : 45
					};
					$(".jqzoom").jqzoom(options);
				}
			},
			error : function (html){
				//alert("error");
			}
    	});	
    	
    	
   
   })
   
   $("#combo_mat").trigger('change');
	
});

function showRadioCoul (html){
    $("#image_produit").empty();
    $("#image_produit").append('<a href="/mediatheque/products/zoom/'+html+'" class="jqzoom"  title=""><img src="/mediatheque/products/big/'+html+'" /></a>');
    var options = {
		zoomWidth: 240,
		zoomHeight: 533,
		title :false,
		position : 'right',
		showEffect : 'slow',
		hideEffect : 'slow',
		yOffset : 5,
		xOffset : 45
    };
    $(".jqzoom").jqzoom(options);
}	

