var validate_options={onfocusout:function(element){if(!this.checkable(element)){this.element(element);}},success:"valid",focusCleanup:true,rules:{name:"required",email:{required:true,email:true}},messages:{name:{required:'Champs obligatoire'},email:{required:'Champs obligatoire',email:'Doit être une adresse valide'}}};$(document).ready(function(e){try{$("body select").msDropDown();}
catch(e){alert(e.message);}
function popup(page,largeur,hauteur,options)
{var top=(screen.height-hauteur)/2;var left=(screen.width-largeur)/2;window.open(page,"","top="+top+",left="+left+",width="+largeur+",height="+hauteur+","+options);}
$('#search_field').focus(function(){if($(this).val()==$(this).attr("title")){$(this).val("");}}).blur(function(){if($(this).val()==""){$(this).val($(this).attr("title"));}});$("body").delegate(".add_wish","click",function(event){event.preventDefault();var url=$(this).attr('href');var opt_array=new Array();$("select").each(function(index){opt_array[index]=$(this).val();});var productX=$("#product").offset().left;var productY=$("#product").offset().top;var basketX=$("#wish_count").offset().left;var basketY=$("#wish_count").offset().top;var gotoX=basketX-productX;var gotoY=basketY-productY;var newImageWidth=$("#product").width()/3;var newImageHeight=$("#product").height()/3;$.getJSON(url,{opt:opt_array},function(json){$("#product").parent().clone().prependTo("#product").attr('id','animated_div').css({'position':'absolute'}).animate({opacity:0.4},100).animate({opacity:0.1,marginLeft:gotoX,marginTop:gotoY,width:newImageWidth,height:newImageHeight},1200,function(){$("#wish_count").html("");$("#wish_count").html(json.count);$("#animated_div").remove();});});return false;});$("body").delegate(".delete_icon","click",function(){$(this).parents("li").css({"background-color":"#fbcdcd"},'fast');var url=$(this).attr('href');var item=$(this);$.getJSON(url,function(json){$("#wish_count").html("");$("#wish_count").html(json.count);$("#wish_size").html("");$("#wish_size").html(json.count);});item.parents("li").fadeOut("fast");return false;});$("body").delegate(".delete_all","click",function(){var url=$(this).attr('href');var item=$(this);$.getJSON(url,function(json){$("#wish_count").html("");$("#wish_count").html(json.count);$("#wish_size").html("");$("#wish_size").html(json.count);});item.parents("ul").fadeOut("fast");return false;});$("#submit_cart").mouseover(function(){$(this).css('background-position','-10px -255px');$(this).css('color','#6c1711');$(this).css('cursor','pointer');}).mouseout(function(){$(this).css('background-position','-10px -270px');$(this).css('color','#fff');});});
