var Window=Class.create();Window.keepMultiModalWindow=false;Window.hasEffectLib=(typeof Effect!="undefined");Window.resizeEffectDuration=0.4;Window.prototype={initialize:function(){var id;var _186=0;if(arguments.length>0){if(typeof arguments[0]=="string"){id=arguments[0];_186=1;}else{id=arguments[0]?arguments[0].id:null;}}if(!id){id="window_"+new Date().getTime();}if($(id)){alert("Window "+id+" is already registered in the DOM! Make sure you use setDestroyOnClose() or destroyOnClose: true in the constructor");}this.options=Object.extend({className:"dialog",blurClassName:null,minWidth:100,minHeight:20,resizable:true,closable:true,minimizable:true,maximizable:true,draggable:true,userData:null,showEffect:(Window.hasEffectLib?Effect.Appear:Element.show),hideEffect:(Window.hasEffectLib?Effect.Fade:Element.hide),showEffectOptions:{},hideEffectOptions:{},effectOptions:null,parent:document.body,title:"&nbsp;",url:null,onload:Prototype.emptyFunction,width:200,height:300,opacity:1,recenterAuto:true,wiredDrag:false,closeCallback:null,destroyOnClose:false,gridX:1,gridY:1},arguments[_186]||{});if(this.options.blurClassName){this.options.focusClassName=this.options.className;}if(typeof this.options.top=="undefined"&&typeof this.options.bottom=="undefined"){this.options.top=this._round(Math.random()*500,this.options.gridY);}if(typeof this.options.left=="undefined"&&typeof this.options.right=="undefined"){this.options.left=this._round(Math.random()*500,this.options.gridX);}if(this.options.effectOptions){Object.extend(this.options.hideEffectOptions,this.options.effectOptions);Object.extend(this.options.showEffectOptions,this.options.effectOptions);if(this.options.showEffect==Element.Appear){this.options.showEffectOptions.to=this.options.opacity;}}if(Window.hasEffectLib){if(this.options.showEffect==Effect.Appear){this.options.showEffectOptions.to=this.options.opacity;}if(this.options.hideEffect==Effect.Fade){this.options.hideEffectOptions.from=this.options.opacity;}}if(this.options.hideEffect==Element.hide){this.options.hideEffect=function(){Element.hide(this.element);if(this.options.destroyOnClose){this.destroy();}}.bind(this);}if(this.options.parent!=document.body){this.options.parent=$(this.options.parent);}this.element=this._createWindow(id);this.element.win=this;this.eventMouseDown=this._initDrag.bindAsEventListener(this);this.eventMouseUp=this._endDrag.bindAsEventListener(this);this.eventMouseMove=this._updateDrag.bindAsEventListener(this);this.eventOnLoad=this._getWindowBorderSize.bindAsEventListener(this);this.eventMouseDownContent=this.toFront.bindAsEventListener(this);this.eventResize=this._recenter.bindAsEventListener(this);this.topbar=$(this.element.id+"_top");this.bottombar=$(this.element.id+"_bottom");this.content=$(this.element.id+"_content");Event.observe(this.topbar,"mousedown",this.eventMouseDown);Event.observe(this.bottombar,"mousedown",this.eventMouseDown);Event.observe(this.content,"mousedown",this.eventMouseDownContent);Event.observe(window,"load",this.eventOnLoad);Event.observe(window,"resize",this.eventResize);Event.observe(window,"scroll",this.eventResize);Event.observe(this.options.parent,"scroll",this.eventResize);if(this.options.draggable){var that=this;[this.topbar,this.topbar.up().previous(),this.topbar.up().next()].each(function(_188){_188.observe("mousedown",that.eventMouseDown);_188.addClassName("top_draggable");});[this.bottombar.up(),this.bottombar.up().previous(),this.bottombar.up().next()].each(function(_189){_189.observe("mousedown",that.eventMouseDown);_189.addClassName("bottom_draggable");});}if(this.options.resizable){this.sizer=$(this.element.id+"_sizer");Event.observe(this.sizer,"mousedown",this.eventMouseDown);}this.useLeft=null;this.useTop=null;if(typeof this.options.left!="undefined"){this.element.setStyle({left:parseFloat(this.options.left)+"px"});this.useLeft=true;}else{this.element.setStyle({right:parseFloat(this.options.right)+"px"});this.useLeft=false;}if(typeof this.options.top!="undefined"){this.element.setStyle({top:parseFloat(this.options.top)+"px"});this.useTop=true;}else{this.element.setStyle({bottom:parseFloat(this.options.bottom)+"px"});this.useTop=false;}this.storedLocation=null;this.setOpacity(this.options.opacity);if(this.options.zIndex){this.setZIndex(this.options.zIndex);}if(this.options.destroyOnClose){this.setDestroyOnClose(true);}this._getWindowBorderSize();this.width=this.options.width;this.height=this.options.height;this.visible=false;this.constraint=false;this.constraintPad={top:0,left:0,bottom:0,right:0};if(this.width&&this.height){this.setSize(this.options.width,this.options.height);}this.setTitle(this.options.title);Windows.register(this);},destroy:function(){this._notify("onDestroy");Event.stopObserving(this.topbar,"mousedown",this.eventMouseDown);Event.stopObserving(this.bottombar,"mousedown",this.eventMouseDown);Event.stopObserving(this.content,"mousedown",this.eventMouseDownContent);Event.stopObserving(window,"load",this.eventOnLoad);Event.stopObserving(window,"resize",this.eventResize);Event.stopObserving(window,"scroll",this.eventResize);Event.stopObserving(this.content,"load",this.options.onload);if(this._oldParent){var _18a=this.getContent();var _18b=null;for(var i=0;i<_18a.childNodes.length;i++){_18b=_18a.childNodes[i];if(_18b.nodeType==1){break;}_18b=null;}if(_18b){this._oldParent.appendChild(_18b);}this._oldParent=null;}if(this.sizer){Event.stopObserving(this.sizer,"mousedown",this.eventMouseDown);}if(this.options.url){this.content.src=null;}if(this.iefix){Element.remove(this.iefix);}Element.remove(this.element);Windows.unregister(this);},setCloseCallback:function(_18d){this.options.closeCallback=_18d;},getContent:function(){return this.content;},setContent:function(id,_18f,_190){var _191=$(id);if(null==_191){throw "Unable to find element '"+id+"' in DOM";}this._oldParent=_191.parentNode;var d=null;var p=null;if(_18f){d=Element.getDimensions(_191);}if(_190){p=Position.cumulativeOffset(_191);}var _194=this.getContent();this.setHTMLContent("");_194=this.getContent();_194.appendChild(_191);_191.show();if(_18f){this.setSize(d.width,d.height);}if(_190){this.setLocation(p[1]-this.heightN,p[0]-this.widthW);}},setHTMLContent:function(html){if(this.options.url){this.content.src=null;this.options.url=null;var _196="<div id=\""+this.getId()+"_content\" class=\""+this.options.className+"_content\"> </div>";$(this.getId()+"_table_content").innerHTML=_196;this.content=$(this.element.id+"_content");}this.getContent().innerHTML=html;},setAjaxContent:function(url,_198,_199,_19a){this.showFunction=_199?"showCenter":"show";this.showModal=_19a||false;_198=_198||{};this.setHTMLContent("");this.onComplete=_198.onComplete;if(!this._onCompleteHandler){this._onCompleteHandler=this._setAjaxContent.bind(this);}_198.onComplete=this._onCompleteHandler;new Ajax.Request(url,_198);_198.onComplete=this.onComplete;},_setAjaxContent:function(_19b){Element.update(this.getContent(),_19b.responseText);if(this.onComplete){this.onComplete(_19b);}this.onComplete=null;this[this.showFunction](this.showModal);},setURL:function(url){if(this.options.url){this.content.src=null;}this.options.url=url;var _19d="<iframe frameborder='0' name='"+this.getId()+"_content'  id='"+this.getId()+"_content' src='"+url+"' width='"+this.width+"' height='"+this.height+"'> </iframe>";$(this.getId()+"_table_content").innerHTML=_19d;this.content=$(this.element.id+"_content");},getURL:function(){return this.options.url?this.options.url:null;},refresh:function(){if(this.options.url){$(this.element.getAttribute("id")+"_content").src=this.options.url;}},setCookie:function(name,_19f,path,_1a1,_1a2){name=name||this.element.id;this.cookie=[name,_19f,path,_1a1,_1a2];var _1a3=WindowUtilities.getCookie(name);if(_1a3){var _1a4=_1a3.split(",");var x=_1a4[0].split(":");var y=_1a4[1].split(":");var w=parseFloat(_1a4[2]),h=parseFloat(_1a4[3]);var mini=_1a4[4];var maxi=_1a4[5];this.setSize(w,h);if(mini=="true"){this.doMinimize=true;}else{if(maxi=="true"){this.doMaximize=true;}}this.useLeft=x[0]=="l";this.useTop=y[0]=="t";this.element.setStyle(this.useLeft?{left:x[1]}:{right:x[1]});this.element.setStyle(this.useTop?{top:y[1]}:{bottom:y[1]});}},getId:function(){return this.element.id;},setDestroyOnClose:function(){this.options.destroyOnClose=true;},setConstraint:function(bool,_1ab){this.constraint=bool;this.constraintPad=Object.extend(this.constraintPad,_1ab||{});if(this.useTop&&this.useLeft){this.setLocation(parseFloat(this.element.style.top),parseFloat(this.element.style.left));}},_initDrag:function(_1ac){if(Event.element(_1ac)==this.sizer&&this.isMinimized()){return;}if(Event.element(_1ac)!=this.sizer&&this.isMaximized()){return;}if(Prototype.Browser.IE&&this.heightN==0){this._getWindowBorderSize();}this.pointer=[this._round(Event.pointerX(_1ac),this.options.gridX),this._round(Event.pointerY(_1ac),this.options.gridY)];if(this.options.wiredDrag){this.currentDrag=this._createWiredElement();}else{this.currentDrag=this.element;}if(Event.element(_1ac)==this.sizer){this.doResize=true;this.widthOrg=this.width;this.heightOrg=this.height;this.bottomOrg=parseFloat(this.element.getStyle("bottom"));this.rightOrg=parseFloat(this.element.getStyle("right"));this._notify("onStartResize");}else{this.doResize=false;var _1ad=$(this.getId()+"_close");if(_1ad&&Position.within(_1ad,this.pointer[0],this.pointer[1])){this.currentDrag=null;return;}this.toFront();if(!this.options.draggable){return;}this._notify("onStartMove");}Event.observe(document,"mouseup",this.eventMouseUp,false);Event.observe(document,"mousemove",this.eventMouseMove,false);WindowUtilities.disableScreen("__invisible__","__invisible__",this.overlayOpacity);document.body.ondrag=function(){return false;};document.body.onselectstart=function(){return false;};this.currentDrag.show();Event.stop(_1ac);},_round:function(val,_1af){return _1af==1?val:val=Math.floor(val/_1af)*_1af;},_updateDrag:function(_1b0){var _1b1=[this._round(Event.pointerX(_1b0),this.options.gridX),this._round(Event.pointerY(_1b0),this.options.gridY)];var dx=_1b1[0]-this.pointer[0];var dy=_1b1[1]-this.pointer[1];if(this.doResize){var w=this.widthOrg+dx;var h=this.heightOrg+dy;dx=this.width-this.widthOrg;dy=this.height-this.heightOrg;if(this.useLeft){w=this._updateWidthConstraint(w);}else{this.currentDrag.setStyle({right:(this.rightOrg-dx)+"px"});}if(this.useTop){h=this._updateHeightConstraint(h);}else{this.currentDrag.setStyle({bottom:(this.bottomOrg-dy)+"px"});}this.setSize(w,h);this._notify("onResize");}else{this.pointer=_1b1;if(this.useLeft){var left=parseFloat(this.currentDrag.getStyle("left"))+dx;var _1b7=this._updateLeftConstraint(left);this.pointer[0]+=_1b7-left;this.currentDrag.setStyle({left:_1b7+"px"});}else{this.currentDrag.setStyle({right:parseFloat(this.currentDrag.getStyle("right"))-dx+"px"});}if(this.useTop){var top=parseFloat(this.currentDrag.getStyle("top"))+dy;var _1b9=this._updateTopConstraint(top);this.pointer[1]+=_1b9-top;this.currentDrag.setStyle({top:_1b9+"px"});}else{this.currentDrag.setStyle({bottom:parseFloat(this.currentDrag.getStyle("bottom"))-dy+"px"});}this._notify("onMove");}if(this.iefix){this._fixIEOverlapping();}this._removeStoreLocation();Event.stop(_1b0);},_endDrag:function(_1ba){WindowUtilities.enableScreen("__invisible__");if(this.doResize){this._notify("onEndResize");}else{this._notify("onEndMove");}Event.stopObserving(document,"mouseup",this.eventMouseUp,false);Event.stopObserving(document,"mousemove",this.eventMouseMove,false);Event.stop(_1ba);this._hideWiredElement();this._saveCookie();document.body.ondrag=null;document.body.onselectstart=null;},_updateLeftConstraint:function(left){if(this.constraint&&this.useLeft&&this.useTop){var _1bc=this.options.parent==document.body?WindowUtilities.getPageSize().windowWidth:this.options.parent.getDimensions().width;if(left<this.constraintPad.left){left=this.constraintPad.left;}if(left+this.width+this.widthE+this.widthW>_1bc-this.constraintPad.right){left=_1bc-this.constraintPad.right-this.width-this.widthE-this.widthW;}}return left;},_updateTopConstraint:function(top){if(this.constraint&&this.useLeft&&this.useTop){var _1be=this.options.parent==document.body?WindowUtilities.getPageSize().windowHeight:this.options.parent.getDimensions().height;var h=this.height+this.heightN+this.heightS;if(top<this.constraintPad.top){top=this.constraintPad.top;}if(top+h>_1be-this.constraintPad.bottom){top=_1be-this.constraintPad.bottom-h;}}return top;},_updateWidthConstraint:function(w){if(this.constraint&&this.useLeft&&this.useTop){var _1c1=this.options.parent==document.body?WindowUtilities.getPageSize().windowWidth:this.options.parent.getDimensions().width;var left=parseFloat(this.element.getStyle("left"));if(left+w+this.widthE+this.widthW>_1c1-this.constraintPad.right){w=_1c1-this.constraintPad.right-left-this.widthE-this.widthW;}}return w;},_updateHeightConstraint:function(h){if(this.constraint&&this.useLeft&&this.useTop){var _1c4=this.options.parent==document.body?WindowUtilities.getPageSize().windowHeight:this.options.parent.getDimensions().height;var top=parseFloat(this.element.getStyle("top"));if(top+h+this.heightN+this.heightS>_1c4-this.constraintPad.bottom){h=_1c4-this.constraintPad.bottom-top-this.heightN-this.heightS;}}return h;},_createWindow:function(id){var _1c7=this.options.className;var win=document.createElement("div");win.setAttribute("id",id);win.className="dialog";var _1c9;if(this.options.url){_1c9="<iframe frameborder=\"0\" name=\""+id+"_content\"  id=\""+id+"_content\" src=\""+this.options.url+"\"> </iframe>";}else{_1c9="<div id=\""+id+"_content\" class=\""+_1c7+"_content\"> </div>";}var _1ca=this.options.closable?"<div class='"+_1c7+"_close' id='"+id+"_close' onclick='Windows.close(\""+id+"\", event)'> </div>":"";var _1cb=this.options.minimizable?"<div class='"+_1c7+"_minimize' id='"+id+"_minimize' onclick='Windows.minimize(\""+id+"\", event)'> </div>":"";var _1cc=this.options.maximizable?"<div class='"+_1c7+"_maximize' id='"+id+"_maximize' onclick='Windows.maximize(\""+id+"\", event)'> </div>":"";var _1cd=this.options.resizable?"class='"+_1c7+"_sizer' id='"+id+"_sizer'":"class='"+_1c7+"_se'";var _1ce="../themes/default/blank.gif";win.innerHTML=_1ca+_1cb+_1cc+"      <table id='"+id+"_row1' class=\"top table_window\">        <tr>          <td class='"+_1c7+"_nw'></td>          <td class='"+_1c7+"_n'><div id='"+id+"_top' class='"+_1c7+"_title title_window'>"+this.options.title+"</div></td>          <td class='"+_1c7+"_ne'></td>        </tr>      </table>      <table id='"+id+"_row2' class=\"mid table_window\">        <tr>          <td class='"+_1c7+"_w'></td>            <td id='"+id+"_table_content' class='"+_1c7+"_content' valign='top'>"+_1c9+"</td>          <td class='"+_1c7+"_e'></td>        </tr>      </table>        <table id='"+id+"_row3' class=\"bot table_window\">        <tr>          <td class='"+_1c7+"_sw'></td>            <td class='"+_1c7+"_s'><div id='"+id+"_bottom' class='status_bar'><span style='float:left; width:1px; height:1px'></span></div></td>            <td "+_1cd+"></td>        </tr>      </table>    ";Element.hide(win);this.options.parent.insertBefore(win,this.options.parent.firstChild);Event.observe($(id+"_content"),"load",this.options.onload);return win;},changeClassName:function(_1cf){var _1d0=this.options.className;var id=this.getId();$A(["_close","_minimize","_maximize","_sizer","_content"]).each(function(_1d2){this._toggleClassName($(id+_1d2),_1d0+_1d2,_1cf+_1d2);}.bind(this));this._toggleClassName($(id+"_top"),_1d0+"_title",_1cf+"_title");$$("#"+id+" td").each(function(td){td.className=td.className.sub(_1d0,_1cf);});this.options.className=_1cf;},_toggleClassName:function(_1d4,_1d5,_1d6){if(_1d4){_1d4.removeClassName(_1d5);_1d4.addClassName(_1d6);}},setLocation:function(top,left){top=this._updateTopConstraint(top);left=this._updateLeftConstraint(left);var e=this.currentDrag||this.element;e.setStyle({top:top+"px"});e.setStyle({left:left+"px"});this.useLeft=true;this.useTop=true;},getLocation:function(){var _1da={};if(this.useTop){_1da=Object.extend(_1da,{top:this.element.getStyle("top")});}else{_1da=Object.extend(_1da,{bottom:this.element.getStyle("bottom")});}if(this.useLeft){_1da=Object.extend(_1da,{left:this.element.getStyle("left")});}else{_1da=Object.extend(_1da,{right:this.element.getStyle("right")});}return _1da;},getSize:function(){return {width:this.width,height:this.height};},setSize:function(_1db,_1dc,_1dd){_1db=parseFloat(_1db);_1dc=parseFloat(_1dc);if(!this.minimized&&_1db<this.options.minWidth){_1db=this.options.minWidth;}if(!this.minimized&&_1dc<this.options.minHeight){_1dc=this.options.minHeight;}if(this.options.maxHeight&&_1dc>this.options.maxHeight){_1dc=this.options.maxHeight;}if(this.options.maxWidth&&_1db>this.options.maxWidth){_1db=this.options.maxWidth;}if(this.useTop&&this.useLeft&&Window.hasEffectLib&&Effect.ResizeWindow&&_1dd){new Effect.ResizeWindow(this,null,null,_1db,_1dc,{duration:Window.resizeEffectDuration});}else{this.width=_1db;this.height=_1dc;var e=this.currentDrag?this.currentDrag:this.element;e.setStyle({width:_1db+this.widthW+this.widthE+"px"});e.setStyle({height:_1dc+this.heightN+this.heightS+"px"});if(!this.currentDrag||this.currentDrag==this.element){var _1df=$(this.element.id+"_content");_1df.setStyle({height:_1dc+"px"});_1df.setStyle({width:_1db+"px"});}}},updateHeight:function(){this.setSize(this.width,this.content.scrollHeight,true);},updateWidth:function(){this.setSize(this.content.scrollWidth,this.height,true);},toFront:function(){if(this.element.style.zIndex<Windows.maxZIndex){this.setZIndex(Windows.maxZIndex+1);}if(this.iefix){this._fixIEOverlapping();}},getBounds:function(_1e0){if(!this.width||!this.height||!this.visible){this.computeBounds();}var w=this.width;var h=this.height;if(!_1e0){w+=this.widthW+this.widthE;h+=this.heightN+this.heightS;}var _1e3=Object.extend(this.getLocation(),{width:w+"px",height:h+"px"});return _1e3;},computeBounds:function(){if(!this.width||!this.height){var size=WindowUtilities._computeSize(this.content.innerHTML,this.content.id,this.width,this.height,0,this.options.className);if(this.height){this.width=size+5;}else{this.height=size+5;}}this.setSize(this.width,this.height);if(this.centered){this._center(this.centerTop,this.centerLeft);}},show:function(_1e5){this.visible=true;if(_1e5){if(typeof this.overlayOpacity=="undefined"){var that=this;setTimeout(function(){that.show(_1e5);},10);return;}Windows.addModalWindow(this);this.modal=true;this.setZIndex(Windows.maxZIndex+1);Windows.unsetOverflow(this);}else{if(!this.element.style.zIndex){this.setZIndex(Windows.maxZIndex+1);}}if(this.oldStyle){this.getContent().setStyle({overflow:this.oldStyle});}this.computeBounds();this._notify("onBeforeShow");if(this.options.showEffect!=Element.show&&this.options.showEffectOptions){this.options.showEffect(this.element,this.options.showEffectOptions);}else{this.options.showEffect(this.element);}this._checkIEOverlapping();WindowUtilities.focusedWindow=this;this._notify("onShow");},showCenter:function(_1e7,top,left){this.centered=true;this.centerTop=top;this.centerLeft=left;this.show(_1e7);},isVisible:function(){return this.visible;},_center:function(top,left){var _1ec=WindowUtilities.getWindowScroll(this.options.parent);var _1ed=WindowUtilities.getPageSize(this.options.parent);if(typeof top=="undefined"){top=(_1ed.windowHeight-(this.height+this.heightN+this.heightS))/2;}top+=_1ec.top;if(typeof left=="undefined"){left=(_1ed.windowWidth-(this.width+this.widthW+this.widthE))/2;}left+=_1ec.left;this.setLocation(top,left);this.toFront();},_recenter:function(_1ee){if(this.centered){var _1ef=WindowUtilities.getPageSize(this.options.parent);var _1f0=WindowUtilities.getWindowScroll(this.options.parent);if(this.pageSize&&this.pageSize.windowWidth==_1ef.windowWidth&&this.pageSize.windowHeight==_1ef.windowHeight&&this.windowScroll.left==_1f0.left&&this.windowScroll.top==_1f0.top){return;}this.pageSize=_1ef;this.windowScroll=_1f0;if($("overlay_modal")){$("overlay_modal").setStyle({height:(_1ef.pageHeight+"px")});}if(this.options.recenterAuto){this._center(this.centerTop,this.centerLeft);}}},hide:function(){this.visible=false;if(this.modal){Windows.removeModalWindow(this);Windows.resetOverflow();}this.oldStyle=this.getContent().getStyle("overflow")||"auto";this.getContent().setStyle({overflow:"hidden"});this.options.hideEffect(this.element,this.options.hideEffectOptions);if(this.iefix){this.iefix.hide();}if(!this.doNotNotifyHide){this._notify("onHide");}},close:function(){if(this.visible){if(this.options.closeCallback&&!this.options.closeCallback(this)){return;}if(this.options.destroyOnClose){var _1f1=this.destroy.bind(this);if(this.options.hideEffectOptions.afterFinish){var func=this.options.hideEffectOptions.afterFinish;this.options.hideEffectOptions.afterFinish=function(){func();_1f1();};}else{this.options.hideEffectOptions.afterFinish=function(){_1f1();};}}Windows.updateFocusedWindow();this.doNotNotifyHide=true;this.hide();this.doNotNotifyHide=false;this._notify("onClose");}},minimize:function(){if(this.resizing){return;}var r2=$(this.getId()+"_row2");if(!this.minimized){this.minimized=true;var dh=r2.getDimensions().height;this.r2Height=dh;var h=this.element.getHeight()-dh;if(this.useLeft&&this.useTop&&Window.hasEffectLib&&Effect.ResizeWindow){new Effect.ResizeWindow(this,null,null,null,this.height-dh,{duration:Window.resizeEffectDuration});}else{this.height-=dh;this.element.setStyle({height:h+"px"});r2.hide();}if(!this.useTop){var _1f6=parseFloat(this.element.getStyle("bottom"));this.element.setStyle({bottom:(_1f6+dh)+"px"});}}else{this.minimized=false;var dh=this.r2Height;this.r2Height=null;if(this.useLeft&&this.useTop&&Window.hasEffectLib&&Effect.ResizeWindow){new Effect.ResizeWindow(this,null,null,null,this.height+dh,{duration:Window.resizeEffectDuration});}else{var h=this.element.getHeight()+dh;this.height+=dh;this.element.setStyle({height:h+"px"});r2.show();}if(!this.useTop){var _1f6=parseFloat(this.element.getStyle("bottom"));this.element.setStyle({bottom:(_1f6-dh)+"px"});}this.toFront();}this._notify("onMinimize");this._saveCookie();},maximize:function(){if(this.isMinimized()||this.resizing){return;}if(Prototype.Browser.IE&&this.heightN==0){this._getWindowBorderSize();}if(this.storedLocation!=null){this._restoreLocation();if(this.iefix){this.iefix.hide();}}else{this._storeLocation();Windows.unsetOverflow(this);var _1f7=WindowUtilities.getWindowScroll(this.options.parent);var _1f8=WindowUtilities.getPageSize(this.options.parent);var left=_1f7.left;var top=_1f7.top;if(this.options.parent!=document.body){_1f7={top:0,left:0,bottom:0,right:0};var dim=this.options.parent.getDimensions();_1f8.windowWidth=dim.width;_1f8.windowHeight=dim.height;top=0;left=0;}if(this.constraint){_1f8.windowWidth-=Math.max(0,this.constraintPad.left)+Math.max(0,this.constraintPad.right);_1f8.windowHeight-=Math.max(0,this.constraintPad.top)+Math.max(0,this.constraintPad.bottom);left+=Math.max(0,this.constraintPad.left);top+=Math.max(0,this.constraintPad.top);}var _1fc=_1f8.windowWidth-this.widthW-this.widthE;var _1fd=_1f8.windowHeight-this.heightN-this.heightS;if(this.useLeft&&this.useTop&&Window.hasEffectLib&&Effect.ResizeWindow){new Effect.ResizeWindow(this,top,left,_1fc,_1fd,{duration:Window.resizeEffectDuration});}else{this.setSize(_1fc,_1fd);this.element.setStyle(this.useLeft?{left:left}:{right:left});this.element.setStyle(this.useTop?{top:top}:{bottom:top});}this.toFront();if(this.iefix){this._fixIEOverlapping();}}this._notify("onMaximize");this._saveCookie();},isMinimized:function(){return this.minimized;},isMaximized:function(){return (this.storedLocation!=null);},setOpacity:function(_1fe){if(Element.setOpacity){Element.setOpacity(this.element,_1fe);}},setZIndex:function(_1ff){this.element.setStyle({zIndex:_1ff});Windows.updateZindex(_1ff,this);},setTitle:function(_200){if(!_200||_200==""){_200="&nbsp;";}Element.update(this.element.id+"_top",_200);},getTitle:function(){return $(this.element.id+"_top").innerHTML;},setStatusBar:function(_201){var _202=$(this.getId()+"_bottom");if(typeof (_201)=="object"){if(this.bottombar.firstChild){this.bottombar.replaceChild(_201,this.bottombar.firstChild);}else{this.bottombar.appendChild(_201);}}else{this.bottombar.innerHTML=_201;}},_checkIEOverlapping:function(){if(!this.iefix&&(navigator.appVersion.indexOf("MSIE")>0)&&(navigator.userAgent.indexOf("Opera")<0)&&(this.element.getStyle("position")=="absolute")){new Insertion.After(this.element.id,"<iframe id=\""+this.element.id+"_iefix\" "+"style=\"display:none;position:absolute;filter:progid:DXImageTransform.Microsoft.Alpha(opacity=0);\" "+"src=\"javascript:false;\" frameborder=\"0\" scrolling=\"no\"></iframe>");this.iefix=$(this.element.id+"_iefix");}if(this.iefix){setTimeout(this._fixIEOverlapping.bind(this),50);}},_fixIEOverlapping:function(){Position.clone(this.element,this.iefix);this.iefix.style.zIndex=this.element.style.zIndex-1;this.iefix.show();},_getWindowBorderSize:function(_203){var div=this._createHiddenDiv(this.options.className+"_n");this.heightN=Element.getDimensions(div).height;div.parentNode.removeChild(div);var div=this._createHiddenDiv(this.options.className+"_s");this.heightS=Element.getDimensions(div).height;div.parentNode.removeChild(div);var div=this._createHiddenDiv(this.options.className+"_e");this.widthE=Element.getDimensions(div).width;div.parentNode.removeChild(div);var div=this._createHiddenDiv(this.options.className+"_w");this.widthW=Element.getDimensions(div).width;div.parentNode.removeChild(div);var div=document.createElement("div");div.className="overlay_"+this.options.className;document.body.appendChild(div);var that=this;setTimeout(function(){that.overlayOpacity=($(div).getStyle("opacity"));div.parentNode.removeChild(div);},10);if(Prototype.Browser.IE){this.heightS=$(this.getId()+"_row3").getDimensions().height;this.heightN=$(this.getId()+"_row1").getDimensions().height;}if(Prototype.Browser.WebKit&&Prototype.Browser.WebKitVersion<420){this.setSize(this.width,this.height);}if(this.doMaximize){this.maximize();}if(this.doMinimize){this.minimize();}},_createHiddenDiv:function(_206){var _207=document.body;var win=document.createElement("div");win.setAttribute("id",this.element.id+"_tmp");win.className=_206;win.style.display="none";win.innerHTML="";_207.insertBefore(win,_207.firstChild);return win;},_storeLocation:function(){if(this.storedLocation==null){this.storedLocation={useTop:this.useTop,useLeft:this.useLeft,top:this.element.getStyle("top"),bottom:this.element.getStyle("bottom"),left:this.element.getStyle("left"),right:this.element.getStyle("right"),width:this.width,height:this.height};}},_restoreLocation:function(){if(this.storedLocation!=null){this.useLeft=this.storedLocation.useLeft;this.useTop=this.storedLocation.useTop;if(this.useLeft&&this.useTop&&Window.hasEffectLib&&Effect.ResizeWindow){new Effect.ResizeWindow(this,this.storedLocation.top,this.storedLocation.left,this.storedLocation.width,this.storedLocation.height,{duration:Window.resizeEffectDuration});}else{this.element.setStyle(this.useLeft?{left:this.storedLocation.left}:{right:this.storedLocation.right});this.element.setStyle(this.useTop?{top:this.storedLocation.top}:{bottom:this.storedLocation.bottom});this.setSize(this.storedLocation.width,this.storedLocation.height);}Windows.resetOverflow();this._removeStoreLocation();}},_removeStoreLocation:function(){this.storedLocation=null;},_saveCookie:function(){if(this.cookie){var _209="";if(this.useLeft){_209+="l:"+(this.storedLocation?this.storedLocation.left:this.element.getStyle("left"));}else{_209+="r:"+(this.storedLocation?this.storedLocation.right:this.element.getStyle("right"));}if(this.useTop){_209+=",t:"+(this.storedLocation?this.storedLocation.top:this.element.getStyle("top"));}else{_209+=",b:"+(this.storedLocation?this.storedLocation.bottom:this.element.getStyle("bottom"));}_209+=","+(this.storedLocation?this.storedLocation.width:this.width);_209+=","+(this.storedLocation?this.storedLocation.height:this.height);_209+=","+this.isMinimized();_209+=","+this.isMaximized();WindowUtilities.setCookie(_209,this.cookie);}},_createWiredElement:function(){if(!this.wiredElement){if(Prototype.Browser.IE){this._getWindowBorderSize();}var div=document.createElement("div");div.className="wired_frame "+this.options.className+"_wired_frame";div.style.position="absolute";this.options.parent.insertBefore(div,this.options.parent.firstChild);this.wiredElement=$(div);}if(this.useLeft){this.wiredElement.setStyle({left:this.element.getStyle("left")});}else{this.wiredElement.setStyle({right:this.element.getStyle("right")});}if(this.useTop){this.wiredElement.setStyle({top:this.element.getStyle("top")});}else{this.wiredElement.setStyle({bottom:this.element.getStyle("bottom")});}var dim=this.element.getDimensions();this.wiredElement.setStyle({width:dim.width+"px",height:dim.height+"px"});this.wiredElement.setStyle({zIndex:Windows.maxZIndex+30});return this.wiredElement;},_hideWiredElement:function(){if(!this.wiredElement||!this.currentDrag){return;}if(this.currentDrag==this.element){this.currentDrag=null;}else{if(this.useLeft){this.element.setStyle({left:this.currentDrag.getStyle("left")});}else{this.element.setStyle({right:this.currentDrag.getStyle("right")});}if(this.useTop){this.element.setStyle({top:this.currentDrag.getStyle("top")});}else{this.element.setStyle({bottom:this.currentDrag.getStyle("bottom")});}this.currentDrag.hide();this.currentDrag=null;if(this.doResize){this.setSize(this.width,this.height);}}},_notify:function(_20c){if(this.options[_20c]){this.options[_20c](this);}else{Windows.notify(_20c,this);}}};var Windows={windows:[],modalWindows:[],observers:[],focusedWindow:null,maxZIndex:0,overlayShowEffectOptions:{duration:0.5},overlayHideEffectOptions:{duration:0.5},addObserver:function(_20d){this.removeObserver(_20d);this.observers.push(_20d);},removeObserver:function(_20e){this.observers=this.observers.reject(function(o){return o==_20e;});},notify:function(_210,win){this.observers.each(function(o){if(o[_210]){o[_210](_210,win);}});},getWindow:function(id){return this.windows.detect(function(d){return d.getId()==id;});},getFocusedWindow:function(){return this.focusedWindow;},updateFocusedWindow:function(){this.focusedWindow=this.windows.length>=2?this.windows[this.windows.length-2]:null;},register:function(win){this.windows.push(win);},addModalWindow:function(win){if(this.modalWindows.length==0){WindowUtilities.disableScreen(win.options.className,"overlay_modal",win.overlayOpacity,win.getId(),win.options.parent);}else{if(Window.keepMultiModalWindow){$("overlay_modal").style.zIndex=Windows.maxZIndex+1;Windows.maxZIndex+=1;WindowUtilities._hideSelect(this.modalWindows.last().getId());}else{this.modalWindows.last().element.hide();}WindowUtilities._showSelect(win.getId());}this.modalWindows.push(win);},removeModalWindow:function(win){this.modalWindows.pop();if(this.modalWindows.length==0){WindowUtilities.enableScreen();}else{if(Window.keepMultiModalWindow){this.modalWindows.last().toFront();WindowUtilities._showSelect(this.modalWindows.last().getId());}else{this.modalWindows.last().element.show();}}},register:function(win){this.windows.push(win);},unregister:function(win){this.windows=this.windows.reject(function(d){return d==win;});},closeAll:function(){this.windows.each(function(w){Windows.close(w.getId());});},closeAllModalWindows:function(){WindowUtilities.enableScreen();this.modalWindows.each(function(win){if(win){win.close();}});},minimize:function(id,_21e){var win=this.getWindow(id);if(win&&win.visible){win.minimize();}Event.stop(_21e);},maximize:function(id,_221){var win=this.getWindow(id);if(win&&win.visible){win.maximize();}Event.stop(_221);},close:function(id,_224){var win=this.getWindow(id);if(win){win.close();}if(_224){Event.stop(_224);}},blur:function(id){var win=this.getWindow(id);if(!win){return;}if(win.options.blurClassName){win.changeClassName(win.options.blurClassName);}if(this.focusedWindow==win){this.focusedWindow=null;}win._notify("onBlur");},focus:function(id){var win=this.getWindow(id);if(!win){return;}if(this.focusedWindow){this.blur(this.focusedWindow.getId());}if(win.options.focusClassName){win.changeClassName(win.options.focusClassName);}this.focusedWindow=win;win._notify("onFocus");},unsetOverflow:function(_22a){this.windows.each(function(d){d.oldOverflow=d.getContent().getStyle("overflow")||"auto";d.getContent().setStyle({overflow:"hidden"});});if(_22a&&_22a.oldOverflow){_22a.getContent().setStyle({overflow:_22a.oldOverflow});}},resetOverflow:function(){this.windows.each(function(d){if(d.oldOverflow){d.getContent().setStyle({overflow:d.oldOverflow});}});},updateZindex:function(_22d,win){if(_22d>this.maxZIndex){this.maxZIndex=_22d;if(this.focusedWindow){this.blur(this.focusedWindow.getId());}}this.focusedWindow=win;if(this.focusedWindow){this.focus(this.focusedWindow.getId());}}};var Dialog={dialogId:null,onCompleteFunc:null,callFunc:null,parameters:null,confirm:function(_22f,_230){if(_22f&&typeof _22f!="string"){Dialog._runAjaxRequest(_22f,_230,Dialog.confirm);return;}_22f=_22f||"";_230=_230||{};var _231=_230.okLabel?_230.okLabel:"Ok";var _232=_230.cancelLabel?_230.cancelLabel:"Cancel";_230=Object.extend(_230,_230.windowParameters||{});_230.windowParameters=_230.windowParameters||{};_230.className=_230.className||"alert";var _233="class ='"+(_230.buttonClass?_230.buttonClass+" ":"")+" ok_button'";var _234="class ='"+(_230.buttonClass?_230.buttonClass+" ":"")+" cancel_button'";var _22f="      <div class='"+_230.className+"_message'>"+_22f+"</div>        <div class='"+_230.className+"_buttons'>          <input type='button' value='"+_231+"' onclick='Dialog.okCallback()' "+_233+"/>          <input type='button' value='"+_232+"' onclick='Dialog.cancelCallback()' "+_234+"/>        </div>    ";return this._openDialog(_22f,_230);},alert:function(_235,_236){if(_235&&typeof _235!="string"){Dialog._runAjaxRequest(_235,_236,Dialog.alert);return;}_235=_235||"";_236=_236||{};var _237=_236.okLabel?_236.okLabel:"Ok";_236=Object.extend(_236,_236.windowParameters||{});_236.windowParameters=_236.windowParameters||{};_236.className=_236.className||"alert";var _238="class ='"+(_236.buttonClass?_236.buttonClass+" ":"")+" ok_button'";var _235="      <div class='"+_236.className+"_message'>"+_235+"</div>        <div class='"+_236.className+"_buttons'>          <input type='button' value='"+_237+"' onclick='Dialog.okCallback()' "+_238+"/>        </div>";return this._openDialog(_235,_236);},info:function(_239,_23a){if(_239&&typeof _239!="string"){Dialog._runAjaxRequest(_239,_23a,Dialog.info);return;}_239=_239||"";_23a=_23a||{};_23a=Object.extend(_23a,_23a.windowParameters||{});_23a.windowParameters=_23a.windowParameters||{};_23a.className=_23a.className||"alert";var _239="<div id='modal_dialog_message' class='"+_23a.className+"_message'>"+_239+"</div>";if(_23a.showProgress){_239+="<div id='modal_dialog_progress' class='"+_23a.className+"_progress'>  </div>";}_23a.ok=null;_23a.cancel=null;return this._openDialog(_239,_23a);},setInfoMessage:function(_23b){$("modal_dialog_message").update(_23b);},closeInfo:function(){Windows.close(this.dialogId);},_openDialog:function(_23c,_23d){var _23e=_23d.className;if(!_23d.height&&!_23d.width){_23d.width=WindowUtilities.getPageSize(_23d.options.parent||document.body).pageWidth/2;}if(_23d.id){this.dialogId=_23d.id;}else{var t=new Date();this.dialogId="modal_dialog_"+t.getTime();_23d.id=this.dialogId;}if(!_23d.height||!_23d.width){var size=WindowUtilities._computeSize(_23c,this.dialogId,_23d.width,_23d.height,5,_23e);if(_23d.height){_23d.width=size+5;}else{_23d.height=size+5;}}_23d.effectOptions=_23d.effectOptions;_23d.resizable=_23d.resizable||false;_23d.minimizable=_23d.minimizable||false;_23d.maximizable=_23d.maximizable||false;_23d.draggable=_23d.draggable||false;_23d.closable=_23d.closable||false;var win=new Window(_23d);win.getContent().innerHTML=_23c;win.showCenter(true,_23d.top,_23d.left);win.setDestroyOnClose();win.cancelCallback=_23d.onCancel||_23d.cancel;win.okCallback=_23d.onOk||_23d.ok;return win;},_getAjaxContent:function(_242){Dialog.callFunc(_242.responseText,Dialog.parameters);},_runAjaxRequest:function(_243,_244,_245){if(_243.options==null){_243.options={};}Dialog.onCompleteFunc=_243.options.onComplete;Dialog.parameters=_244;Dialog.callFunc=_245;_243.options.onComplete=Dialog._getAjaxContent;new Ajax.Request(_243.url,_243.options);},okCallback:function(){var win=Windows.focusedWindow;if(!win.okCallback||win.okCallback(win)){$$("#"+win.getId()+" input").each(function(_247){_247.onclick=null;});win.close();}},cancelCallback:function(){var win=Windows.focusedWindow;$$("#"+win.getId()+" input").each(function(_249){_249.onclick=null;});win.close();if(win.cancelCallback){win.cancelCallback(win);}}};if(Prototype.Browser.WebKit){var array=navigator.userAgent.match(new RegExp(/AppleWebKit\/([\d\.\+]*)/));Prototype.Browser.WebKitVersion=parseFloat(array[1]);}var WindowUtilities={getWindowScroll:function(_24a){var T,L,W,H;_24a=_24a||document.body;if(_24a!=document.body){T=_24a.scrollTop;L=_24a.scrollLeft;W=_24a.scrollWidth;H=_24a.scrollHeight;}else{var w=window;with(w.document){if(w.document.documentElement&&documentElement.scrollTop){T=documentElement.scrollTop;L=documentElement.scrollLeft;}else{if(w.document.body){T=body.scrollTop;L=body.scrollLeft;}}if(w.innerWidth){W=w.innerWidth;H=w.innerHeight;}else{if(w.document.documentElement&&documentElement.clientWidth){W=documentElement.clientWidth;H=documentElement.clientHeight;}else{W=body.offsetWidth;H=body.offsetHeight;}}}}return {top:T,left:L,width:W,height:H};},getPageSize:function(_24d){_24d=_24d||document.body;var _24e,windowHeight;var _24f,pageWidth;if(_24d!=document.body){_24e=_24d.getWidth();windowHeight=_24d.getHeight();pageWidth=_24d.scrollWidth;_24f=_24d.scrollHeight;}else{var _250,yScroll;if(window.innerHeight&&window.scrollMaxY){_250=document.body.scrollWidth;yScroll=window.innerHeight+window.scrollMaxY;}else{if(document.body.scrollHeight>document.body.offsetHeight){_250=document.body.scrollWidth;yScroll=document.body.scrollHeight;}else{_250=document.body.offsetWidth;yScroll=document.body.offsetHeight;}}if(self.innerHeight){_24e=self.innerWidth;windowHeight=self.innerHeight;}else{if(document.documentElement&&document.documentElement.clientHeight){_24e=document.documentElement.clientWidth;windowHeight=document.documentElement.clientHeight;}else{if(document.body){_24e=document.body.clientWidth;windowHeight=document.body.clientHeight;}}}if(yScroll<windowHeight){_24f=windowHeight;}else{_24f=yScroll;}if(_250<_24e){pageWidth=_24e;}else{pageWidth=_250;}}return {pageWidth:pageWidth,pageHeight:_24f,windowWidth:_24e,windowHeight:windowHeight};},disableScreen:function(_251,_252,_253,_254,_255){WindowUtilities.initLightbox(_252,_251,function(){this._disableScreen(_251,_252,_253,_254);}.bind(this),_255||document.body);},_disableScreen:function(_256,_257,_258,_259){var _25a=$(_257);var _25b=WindowUtilities.getPageSize(_25a.parentNode);if(_259&&Prototype.Browser.IE){WindowUtilities._hideSelect();WindowUtilities._showSelect(_259);}_25a.style.height=(_25b.pageHeight+"px");_25a.style.display="none";if(_257=="overlay_modal"&&Window.hasEffectLib&&Windows.overlayShowEffectOptions){_25a.overlayOpacity=_258;new Effect.Appear(_25a,Object.extend({from:0,to:_258},Windows.overlayShowEffectOptions));}else{_25a.style.display="block";}},enableScreen:function(id){id=id||"overlay_modal";var _25d=$(id);if(_25d){if(id=="overlay_modal"&&Window.hasEffectLib&&Windows.overlayHideEffectOptions){new Effect.Fade(_25d,Object.extend({from:_25d.overlayOpacity,to:0},Windows.overlayHideEffectOptions));}else{_25d.style.display="none";_25d.parentNode.removeChild(_25d);}if(id!="__invisible__"){WindowUtilities._showSelect();}}},_hideSelect:function(id){if(Prototype.Browser.IE){id=id==null?"":"#"+id+" ";$$(id+"select").each(function(_25f){if(!WindowUtilities.isDefined(_25f.oldVisibility)){_25f.oldVisibility=_25f.style.visibility?_25f.style.visibility:"visible";_25f.style.visibility="hidden";}});}},_showSelect:function(id){if(Prototype.Browser.IE){id=id==null?"":"#"+id+" ";$$(id+"select").each(function(_261){if(WindowUtilities.isDefined(_261.oldVisibility)){try{_261.style.visibility=_261.oldVisibility;}catch(e){_261.style.visibility="visible";}_261.oldVisibility=null;}else{if(_261.style.visibility){_261.style.visibility="visible";}}});}},isDefined:function(_262){return typeof (_262)!="undefined"&&_262!=null;},initLightbox:function(id,_264,_265,_266){if($(id)){Element.setStyle(id,{zIndex:Windows.maxZIndex+1});Windows.maxZIndex++;_265();}else{var _267=document.createElement("div");_267.setAttribute("id",id);_267.className="overlay_"+_264;_267.style.display="none";_267.style.position="absolute";_267.style.top="0";_267.style.left="0";_267.style.zIndex=Windows.maxZIndex+1;Windows.maxZIndex++;_267.style.width="100%";_266.insertBefore(_267,_266.firstChild);if(Prototype.Browser.WebKit&&id=="overlay_modal"){setTimeout(function(){_265();},10);}else{_265();}}},setCookie:function(_268,_269){document.cookie=_269[0]+"="+escape(_268)+((_269[1])?"; expires="+_269[1].toGMTString():"")+((_269[2])?"; path="+_269[2]:"")+((_269[3])?"; domain="+_269[3]:"")+((_269[4])?"; secure":"");},getCookie:function(name){var dc=document.cookie;var _26c=name+"=";var _26d=dc.indexOf("; "+_26c);if(_26d==-1){_26d=dc.indexOf(_26c);if(_26d!=0){return null;}}else{_26d+=2;}var end=document.cookie.indexOf(";",_26d);if(end==-1){end=dc.length;}return unescape(dc.substring(_26d+_26c.length,end));},_computeSize:function(_26f,id,_271,_272,_273,_274){var _275=document.body;var _276=document.createElement("div");_276.setAttribute("id",id);_276.className=_274+"_content";if(_272){_276.style.height=_272+"px";}else{_276.style.width=_271+"px";}_276.style.position="absolute";_276.style.top="0";_276.style.left="0";_276.style.display="none";_276.innerHTML=_26f;_275.insertBefore(_276,_275.firstChild);var size;if(_272){size=$(_276).getDimensions().width+_273;}else{size=$(_276).getDimensions().height+_273;}_275.removeChild(_276);return size;}};