var Box={el:null,init:{html:null,modal:false,show:null,close:null,top:0,left:0,url:null,urldata:null,width:0,height:0},open:function(B){if(this.el!=null&&this.el.length!=0){Box._close(B);return false;}$j.extend(this,this.init,B);if(this.url!=null){$j.ajax({type:"GET",url:this.url,data:this.urldata,cache:false,success:function(A){Box.html=A;Box.load();}});}else{Box.load();}$j(document).one("keydown",function(A){if(A.which==27){Box._close();return false;}});if(this.modal==true){if($j(".black_box").length!=0){$j(".black_box").remove();}$j('<div class="black_box" style="background:#000000;filter:alpha(opacity=40);opacity: 0.40;-moz-opacity: 0.40;-khtml-opacity:0.4;position:absolute;top:0;left:0;z-index:100;width:100%;height:5000px;display:none"></div>').prependTo("body").css({width:"100%",height:$j(document).height()});}},load:function(){if(this.top==0||this.left==0){if(this.width!=0){this.left=($j(window).width()-this.width)/2;}else{this.left=($j(window).width()-801)/2;}if(this.height!=0){this.top=$j(window).scrollTop()+($j(window).height()/2)-this.height/2;}else{this.top=$j(window).scrollTop()+($j(window).height()/2)-276;}if(this.top<0){this.top=0;}}if(this.el==null){var B=$j("<div style='display:none;'></div>").prependTo("body");this.el=$j(this.html).prependTo(B);this.el.show();B.show();this.el.css({top:Box.top+"px",left:($j(window).width()-this.el.width())/2+"px"});}this.events();if(this.modal==true){$j(".black_box").fadeIn("slow",function(){Box.el.fadeIn("slow");});}else{this.el.show();}},events:function(){$j("#coordonnees-modal .modal_close, #oney .modal_close").click(function(){Box._close();return false;});$j("#modal-carnet-adresse .modal_close").click(function(){Box._close();return false;});$j("#modal-carnet-adresse .pp_modal_close").click(function(){Box._close();return false;});$j("#identification-modal .modal_close").click(function(){Box._close();return false;});$j("#participation-modal .modal_close").click(function(){Box._close();return false;});$j("#modal-error-layer .bt_modal_close").click(function(){Box._close();return false;});$j("#num_1 .modal_close").click(function(){Box._close();return false;});$j("#num_1 .modal_close_bottom").click(function(){Box._close();return false;});$j("#modal-retrait-produit-indisponible .modal_close").click(function(){Box._close();return false;});$j("#modal-recap-mode-livraison .modal_close").click(function(){Box._close();return false;});if(this.show){this.show();}},maj:function(B){if(this.el!=null){this.el.html($j(B).html());this.events();}},_close:function(B){if(this.modal==true){this.el.fadeOut("slow",function(){$j(".black_box").fadeOut("slow",function(){$j(".black_box").remove();if(Box.el!=null){Box.el.remove();}Box.el=null;if(this.close){this.close();}if(B!=null){Box.open(B);}});});}else{if(Box.el!=null){Box.el.remove();}Box.el=null;if(this.close){this.close();}if(B!=null){Box.open(B);}}}};
