(function(A){A.facebox=function(C,B){A.facebox.init();A.facebox.loading();A.isFunction(C)?C.call(A):A.facebox.reveal(C,B)};A.facebox.settings={loading_image:"/images/facebox/loading.gif",close_image:"/images/facebox/closelabel.gif",image_types:["png","jpg","jpeg","gif"],facebox_html:'  <div id="facebox" style="display:none;">     <div class="popup">       <table>         <tbody>           <tr>             <td class="tl"/><td class="b"/><td class="tr"/>           </tr>           <tr>             <td class="b"/>             <td class="body">               <div class="header"> 	            <a href="javascript:;" class="close"> 	              <img src="'+this.close_image+'" title="close" class="close_image" /> 	            </a> 	          </div>               <div class="content">               </div>               <div class="footer">                 <a href="javascript:;" class="close">                   <img src="'+this.close_image+'" title="close" class="close_image" />                 </a>               </div>             </td>             <td class="b"/>           </tr>           <tr>             <td class="bl"/><td class="b"/><td class="br"/>           </tr>         </tbody>       </table>     </div>   </div>'};A.facebox.loading=function(){if(A("#facebox .loading").length==1){return true}A("#facebox .content").empty();A("#facebox .body").children().hide().end().append('<div class="loading"><img src="'+A.facebox.settings.loading_image+'"/></div>');var B=A.facebox.getPageScroll();A("#facebox").css({top:B[1]+(A.facebox.getPageHeight()/10),left:B[0]}).show();A(document).bind("keydown.facebox",function(C){if(C.keyCode==27){A.facebox.close()}})};A.facebox.reveal=function(C,B){if(B){A("#facebox .content").addClass(B)}A("#facebox .content").append(C);A("#facebox .loading").remove();A("#facebox .body").children().fadeIn("normal")};A.facebox.close=function(){A(document).trigger("close.facebox");return false};A(document).bind("close.facebox",function(){A(document).unbind("keydown.facebox");A("#facebox").fadeOut(function(){A("#facebox .content").removeClass().addClass("content")})});A.fn.facebox=function(C){A.facebox.init(C);var B=A.facebox.settings.image_types.join("|");B=new RegExp("."+B+"$","i");function D(){A.facebox.loading(true);var E=this.rel.match(/facebox\[\.(\w+)\]/);if(E){E=E[1]}if(this.href.match(/#/)){var F=window.location.href.split("#")[0];var H=this.href.replace(F,"");A.facebox.reveal(A(H).clone().show(),E)}else{if(this.href.match(B)){var G=new Image();G.onload=function(){A.facebox.reveal('<div class="image"><img src="'+G.src+'" /></div>',E)};G.src=this.href}else{A.get(this.href,function(I){A.facebox.reveal(I,E)})}}return false}this.click(D);return this};A.facebox.init=function(C){if(A.facebox.settings.inited){return true}else{A.facebox.settings.inited=true}if(C){A.extend(A.facebox.settings,C)}A("body").append(A.facebox.settings.facebox_html);var B=[new Image(),new Image()];B[0].src=A.facebox.settings.close_image;B[1].src=A.facebox.settings.loading_image;A("#facebox").find(".b:first, .bl, .br, .tl, .tr").each(function(){B.push(new Image());B.slice(-1).src=A(this).css("background-image").replace(/url\((.+)\)/,"$1")});A("#facebox .close").click(closeFacebox);A("#facebox .close_image").attr("src",A.facebox.settings.close_image)};A.facebox.getPageScroll=function(){var C,B;if(self.pageYOffset){B=self.pageYOffset;C=self.pageXOffset}else{if(document.documentElement&&document.documentElement.scrollTop){B=document.documentElement.scrollTop;C=document.documentElement.scrollLeft}else{if(document.body){B=document.body.scrollTop;C=document.body.scrollLeft}}}return new Array(C,B)};A.facebox.getPageHeight=function(){var B;if(self.innerHeight){B=self.innerHeight}else{if(document.documentElement&&document.documentElement.clientHeight){B=document.documentElement.clientHeight}else{if(document.body){B=document.body.clientHeight}}}return B}})(jQuery);