var BoxHeader={el:null,init:{html:null,modal:false,show:null,close:null,top:0,left:0,url:null,urldata:null},open:function(A){if(this.el!=null&&this.el.length!=0){BoxHeader._close(A);return false;}$j.extend(this,this.init,A);if(this.url!=null){$j.ajax({type:"GET",url:this.url,data:this.urldata,cache:false,success:function(B){BoxHeader.html=B;BoxHeader.load();}});}else{BoxHeader.load();}$j(document).one("keydown",function(B){if(B.which==27){BoxHeader._close();return false;}});if(this.modal==true){if($j(".black_box_header").length!=0){$j(".black_box_header").remove();}$j('<div class="black_box_header" style="position:absolute;top:0;left:0;z-index:100;width:100%;height:5000px;display:none"></div>').prependTo("body").css({width:$j(window).width(),height:$j(document).height()});}},load:function(){this.el=$j(this.html).prependTo("body");if(this.top==0||this.left==0){this.top=$(window).scrollTop()+($(window).height()/2)-(this.el.height()/2);this.left=($(window).width()/2)-(this.el.width()/2);}this.el.css({top:BoxHeader.top+"px",left:BoxHeader.left+"px"});this.el.css("display","block");this.el.animate({"width":"310px","marginTop":"-50px"},200).animate({"height":"212px","marginTop":"0px"},250);this.el.show();this.events();if(this.modal==true){$j(".black_Box_Header").fadeIn("slow",function(){BoxHeader.el.fadeIn("slow");});}else{this.el.show();}},events:function(){$j("div[class $= '_close'],a[class $= '_close']",this.el).click(function(){BoxHeader._close();return false;});if(this.show){this.show();}},maj:function(A){if(this.el!=null){this.el.html($j(A).html());this.events();}},_close:function(A){if(this.modal==true){this.el.fadeOut("slow",function(){$j(".black_box_header").fadeOut("slow",function(){$j(".black_box_header").remove();if(BoxHeader.el!=null){BoxHeader.el.remove();}BoxHeader.el=null;if(this.close){this.close();}if(A!=null){BoxHeader.open(A);}});});}else{if(BoxHeader.el!=null){BoxHeader.el.remove();}BoxHeader.el=null;if(this.close){this.close();}if(A!=null){BoxHeader.open(A);}}}};
