var GB_CURRENT=null; GB_hide=function(){ GB_CURRENT.hide(); }; GreyBox=new AJS.Class({init:function(_1){ this.type="page"; this.overlay_click_close=false; this.salt=0; this.root_dir=GB_ROOT_DIR; this.callback_fns=[]; this.reload_on_close=false; this.src_loader=this.root_dir+"loader_frame.html"; AJS.update(this,_1); },addCallback:function(fn){ if(fn){ this.callback_fns.push(fn); } },show:function(_3){ GB_CURRENT=this; this.url=_3; var _4=[AJS.$bytc("object"),AJS.$bytc("embed")]; if(AJS.isIe()){ _4.push(AJS.$bytc("select")); } AJS.map(AJS.flattenList(_4),function(_5){ _5.style.visibility="hidden"; }); this.createElements(); return false; },hide:function(){ this.onHide(); if(AJS.fx){ var _6=this.overlay; AJS.fx.fadeOut(this.overlay,{onComplete:function(){ AJS.removeElement(_6); _6=null; },duration:300}); AJS.removeElement(this.g_window); }else{ AJS.removeElement(this.g_window,this.overlay); } this.removeFrame(); AJS.REV(window,"scroll",_GB_setOverlayDimension); AJS.REV(window,"resize",_GB_update); if(AJS.isIe()){ AJS.map(AJS.$bytc("select"),function(_7){ _7.style.visibility="visible"; }); } AJS.map(AJS.$bytc("object"),function(_8){ _8.style.visibility="visible"; }); var _9=this.callback_fns; if(_9!=[]){ AJS.map(_9,function(fn){ fn(); }); } GB_CURRENT=null; if(this.reload_on_close){ window.location.reload(); } },update:function(){ this.setOverlayDimension(); this.setFrameSize(); this.setWindowPosition(); },createElements:function(){ this.initOverlay(); this.g_window=AJS.DIV({"id":"GB_window"}); AJS.hideElement(this.g_window); AJS.getBody().insertBefore(this.g_window,this.overlay.nextSibling); this.initFrame(); this.initHook(); this.update(); var me=this; if(AJS.fx){ AJS.fx.fadeIn(this.overlay,{duration:300,to:0.7,onComplete:function(){ me.onShow(); AJS.showElement(me.g_window); me.startLoading(); }}); }else{ AJS.setOpacity(this.overlay,0.7); AJS.showElement(this.g_window); this.onShow(); this.startLoading(); } AJS.AEV(window,"scroll",_GB_setOverlayDimension); AJS.AEV(window,"resize",_GB_update); },removeFrame:function(){ try{ AJS.removeElement(this.iframe); } catch(e){ } this.iframe=null; },startLoading:function(){ this.iframe.src=this.src_loader+"?s="+this.salt++; AJS.showElement(this.iframe); },setOverlayDimension:function(){ var _c=AJS.getWindowSize(); if(AJS.isMozilla()||AJS.isOpera()){ AJS.setWidth(this.overlay,"100%"); }else{ AJS.setWidth(this.overlay,_c.w); } var _d=Math.max(AJS.getScrollTop()+_c.h,AJS.getScrollTop()+this.height); if(_d