(function(F){F.facebox=function(M,L){F.facebox.loading();
if(M.ajax){G(M.ajax)
}else{if(M.image){C(M.image)
}else{if(M.div){J(M.div)
}else{if(F.isFunction(M)){M.call(F)
}else{F.facebox.reveal(M,L)
}}}}};
F.extend(F.facebox,{settings:{opacity:0,overlay:true,loadingImage:"./images/fbx_loading.gif",closeImage:"./images/fbx_closelabel.gif",imageTypes:["png","jpg","jpeg","gif"],boxWidth:null,buttons:null,faceboxHtml:'    <div id="facebox" style="display:none;">       <div class="popup">         <table class="fbx_table">           <tbody>             <tr>               <td class="tl fbx_td"/><td class="b fbx_td"/><td class="tr fbx_td"/>             </tr>             <tr>               <td class="b fbx_td"/>               <td class="body fbx_td">                 <div class="content">                 </div>                 <div class="footer">                   <a href="#" class="close">                     <img src="./images/fbx_closelabel.gif" title="close" class="close_image" />                   </a>                 </div>               </td>               <td class="b fbx_td"/>             </tr>             <tr>               <td class="bl fbx_td"/><td class="b fbx_td"/><td class="br fbx_td"/>             </tr>           </tbody>         </table>       </div>     </div>'},loading:function(){K();
if(F("#facebox .loading").length==1){return true
}E();
F("#facebox .content").empty();
F("#facebox .body").children().hide().end().append('<div class="loading"><img src="'+F.facebox.settings.loadingImage+'"/></div>');
F("#facebox").css({top:H()[1]+(I()/10),left:385.5}).show();
F(document).bind("keydown.facebox",function(L){if(L.keyCode==27){F.facebox.close()
}return true
});
F(document).trigger("loading.facebox")
},reveal:function(R,M){F(document).trigger("beforeReveal.facebox");
if(jQuery.browser.msie&&navigator.userAgent.search(/MSIE 6/)>0){F("select:visible").hide().addClass("fbx_selhidden")
}if(M){F("#facebox .content").addClass(M)
}F("#facebox .content").append(R);
F("#facebox .loading").remove();
var N=F("#facebox .body");
var L=(F.facebox.settings.boxWidth)?F.facebox.settings.boxWidth:F("#facebox table").width();
N.width(L);
N.children().fadeIn("normal");
F("#facebox").css("left",F(window).width()/2-(L/2));
F(document).trigger("reveal.facebox").trigger("afterReveal.facebox");
var Q=F.facebox.settings.buttons;
if(Q){F("#facebox .close").hide();
var P="";
for(var O=0;
O<Q.length;
O++){P+='<span class="button" onclick="setTimeout(function(){$.facebox.settings.buttons['+O+"].callBack()},200);$(document).trigger('close.facebox')\">"+Q[O].label+"</span>"
}F("#facebox .footer").css({textAlign:"center"}).html(P)
}else{setTimeout(function(){F("#facebox .footer").css({textAlign:"right"}).html('<a onclick="$.facebox.close()" href="javascript://" class="close"><img src="./images/fbx_closelabel.gif" title="close" class="close_image" /></a>')
},100)
}},close:function(){F(document).trigger("close.facebox");
return false
}});
F.fn.facebox=function(L){K(L);
function M(){F.facebox.loading(true);
var N=this.rel.match(/facebox\[?\.(\w+)\]?/);
if(N){N=N[1]
}J(this.href,N);
return false
}return this.click(M)
};
function K(N){if(F.facebox.settings.inited){return true
}else{F.facebox.settings.inited=true
}F(document).trigger("init.facebox");
D();
var L=F.facebox.settings.imageTypes.join("|");
F.facebox.settings.imageTypesRegexp=new RegExp("."+L+"$","i");
if(N){F.extend(F.facebox.settings,N)
}F("body").append(F.facebox.settings.faceboxHtml);
var M=[new Image(),new Image()];
M[0].src=F.facebox.settings.closeImage;
M[1].src=F.facebox.settings.loadingImage;
F("#facebox").find(".b:first, .bl, .br, .tl, .tr").each(function(){M.push(new Image());
M.slice(-1).src=F(this).css("background-image").replace(/url\((.+)\)/,"$1")
});
if(F.facebox.settings.closeImage){F("#facebox .close").click(F.facebox.close);
F("#facebox .close_image").attr("src",F.facebox.settings.closeImage)
}else{F("#facebox .close").hide()
}}function H(){var M,L;
if(self.pageYOffset){L=self.pageYOffset;
M=self.pageXOffset
}else{if(document.documentElement&&document.documentElement.scrollTop){L=document.documentElement.scrollTop;
M=document.documentElement.scrollLeft
}else{if(document.body){L=document.body.scrollTop;
M=document.body.scrollLeft
}}}return new Array(M,L)
}function I(){var L;
if(self.innerHeight){L=self.innerHeight
}else{if(document.documentElement&&document.documentElement.clientHeight){L=document.documentElement.clientHeight
}else{if(document.body){L=document.body.clientHeight
}}}return L
}function D(){var L=F.facebox.settings;
L.loadingImage=L.loading_image||L.loadingImage;
L.closeImage=L.close_image||L.closeImage;
L.imageTypes=L.image_types||L.imageTypes;
L.faceboxHtml=L.facebox_html||L.faceboxHtml
}function J(M,L){if(M.match(/#/)){var N=window.location.href.split("#")[0];
var O=M.replace(N,"");
F.facebox.reveal(F(O).clone().show(),L)
}else{if(M.match(F.facebox.settings.imageTypesRegexp)){C(M,L)
}else{G(M,L)
}}}function C(M,L){var N=new Image();
N.onload=function(){F.facebox.reveal('<div class="image"><img src="'+N.src+'" /></div>',L)
};
N.src=M
}function G(M,L){F.get(M,function(N){F.facebox.reveal(N,L)
})
}function B(){return F.facebox.settings.overlay==false||F.facebox.settings.opacity===null
}function E(){if(B()){return 
}if(F("facebox_overlay").length==0){F("body").append('<div id="facebox_overlay" class="facebox_hide"></div>')
}F("#facebox_overlay").hide().addClass("facebox_overlayBG").css("opacity",F.facebox.settings.opacity).click(function(){F(document).trigger("close.facebox")
}).fadeIn(200);
return false
}function A(){if(B()){return 
}F("#facebox_overlay").fadeOut(200,function(){F("#facebox_overlay").removeClass("facebox_overlayBG");
F("#facebox_overlay").addClass("facebox_hide");
F("#facebox_overlay").remove()
});
return false
}F(document).bind("close.facebox",function(){F(document).unbind("keydown.facebox");
F("#facebox").fadeOut(function(){F("#facebox .content").removeClass().addClass("content");
A();
F("#facebox .loading").remove();
F.facebox.settings.buttons=F.facebox.settings.boxWidth=null;
if(jQuery.browser.msie&&navigator.userAgent.search(/MSIE 6/)>0){F("select.fbx_selhidden").removeClass("fbx_selhidden").show()
}})
})
})(jQuery);