text: var Window=Class.create();Window.keepMultiModalWindow=false;Window.prototype={initialize:function(A){if($(A)){alert("Window "+A+" is already register is the DOM!!, be sure to use setDestroyOnClose()")}this.hasEffectLib=String.prototype.parseColor!=null;this.options=Object.extend({className:"dialog",minWidth:100,minHeight:20,resizable:true,closable:true,minimizable:true,maximizable:true,draggable:true,userData:null,showEffect:(this.hasEffectLib?Effect.Appear:Element.show),hideEffect:(this.hasEffectLib?Effect.Fade:Element.hide),showEffectOptions:{},hideEffectOptions:{},effectOptions:null,parent:document.getElementsByTagName("body").item(0),title:"&nbsp;",url:null,onload:Prototype.emptyFunction,width:200,height:300,opacity:1,recenterAuto:true},arguments[1]||{});if(this.options.effectOptions){Object.extend(this.options.hideEffectOptions,this.options.effectOptions);Object.extend(this.options.showEffectOptions,this.options.effectOptions)}if(this.options.hideEffect==Element.hide){this.options.hideEffect=function(){Element.hide(this.element);if(this.destroyOnClose){this.destroy()}}.bind(this)}this.element=this._createWindow(A);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);if(this.options.recenterAuto){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);if(this.options.recenterAuto){Event.observe(window,"resize",this.eventResize);Event.observe(window,"scroll",this.eventResize)}if(this.options.draggable){this.bottombar.addClassName("bottom_draggable");this.topbar.addClassName("top_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(arguments[1].left!=null){this.element.setStyle({left:parseFloat(arguments[1].left)+"px"});this.useLeft=true}if(arguments[1].right!=null){this.element.setStyle({right:parseFloat(arguments[1].right)+"px"});this.useLeft=false}if(this.useLeft==null){this.element.setStyle({left:"0px"});this.useLeft=true}if(arguments[1].top!=null){this.element.setStyle({top:parseFloat(arguments[1].top)+"px"});this.useTop=true}if(arguments[1].bottom!=null){this.element.setStyle({bottom:parseFloat(arguments[1].bottom)+"px"});this.useTop=false}if(this.useTop==null){this.element.setStyle({top:"0px"});this.useTop=true}this.storedLocation=null;this.setOpacity(this.options.opacity);if(this.options.zIndex){this.setZIndex(this.options.zIndex)}this.destroyOnClose=false;this._getWindowBorderSize();this.width=this.options.width;this.height=this.options.height;this.visible=false;if(this.width&&this.height){this.setSize(this.options.width,this.options.height)}this.setTitle(this.options.title);Windows.register(this)},destroy:function(){Windows.notify("onDestroy",this);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);if(this.options.recenterAuto){Event.stopObserving(window,"resize",this.eventResize);Event.stopObserving(window,"scroll",this.eventResize)}Event.stopObserving(this.content,"load",this.options.onload);if(this._oldParent){var C=this.getContent();var A=null;for(var B=0;B<C.childNodes.length;B++){A=C.childNodes[B];if(Node.ELEMENT_NODE==A.nodeType){break}A=null}if(A){this._oldParent.appendChild(A)}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)},setDelegate:function(A){this.delegate=A},getDelegate:function(){return this.delegate},getContent:function(){return this.content},setContent:function(G,F,B){var A=$(G);if(null==A){throw"Unable to find element '"+G+"' in DOM"}this._oldParent=A.parentNode;var E=null;var D=null;if(F){E=Element.getDimensions(A)}if(B){D=Position.cumulativeOffset(A)}var C=this.getContent();C.appendChild(A);A.show();if(F){this.setSize(E.width,E.height)}if(B){this.setLocation(D[1]-this.heightN,D[0]-this.widthW)}},setAjaxContent:function(B,A,D,C){this.showFunction=D?"showCenter":"show";this.showModal=C||false;if(A==null){A={}}this.onComplete=A.onComplete;A.onComplete=this._setAjaxContent.bind(this);new Ajax.Request(B,A)},_setAjaxContent:function(A){Element.update(this.getContent(),A.responseText);if(this.onComplete){this.onComplete(A)}this[this.showFunction](this.showModal)},setCookie:function(B,C,M,E,A){B=B||this.element.id;this.cookie=[B,C,M,E,A];var K=WindowUtilities.getCookie(B);if(K){var L=K.split(",");var I=L[0].split(":");var H=L[1].split(":");var J=parseFloat(L[2]),F=parseFloat(L[3]);var G=L[4];var D=L[5];this.setSize(J,F);if(G=="true"){this.doMinimize=true}else{if(D=="true"){this.doMaximize=true}}this.useLeft=I[0]=="l";this.useTop=H[0]=="t";this.element.setStyle(this.useLeft?{left:I[1]}:{right:I[1]});this.element.setStyle(this.useTop?{top:H[1]}:{bottom:H[1]})}},getId:function(){return this.element.id},setDestroyOnClose:function(){var A=this.destroy.bind(this);if(this.options.hideEffectOptions.afterFinish){var B=this.options.hideEffectOptions.afterFinish;this.options.hideEffectOptions.afterFinish=function(){B();A()}}else{this.options.hideEffectOptions.afterFinish=function(){A()}}this.destroyOnClose=true},_initDrag:function(B){this.pointer=[Event.pointerX(B),Event.pointerY(B)];if(Event.element(B)==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"));Windows.notify("onStartResize",this)}else{this.doResize=false;var A=$(this.getId()+"_close");if(A&&Position.within(A,this.pointer[0],this.pointer[1])){return }this.toFront();if(!this.options.draggable){return }Windows.notify("onStartMove",this)}Event.observe(document,"mouseup",this.eventMouseUp,false);Event.observe(document,"mousemove",this.eventMouseMove,false);WindowUtilities.disableScreen("__invisible__","__invisible__");document.body.ondrag=function(){return false};document.body.onselectstart=function(){return false};Event.stop(B)},_updateDrag:function(C){var D=[Event.pointerX(C),Event.pointerY(C)];var B=D[0]-this.pointer[0];var A=D[1]-this.pointer[1];if(this.doResize){this.setSize(this.widthOrg+B,this.heightOrg+A);B=this.width-this.widthOrg;A=this.height-this.heightOrg;if(!this.useLeft){this.element.setStyle({right:(this.rightOrg-B)+"px"})}if(!this.useTop){this.element.setStyle({bottom:(this.bottomOrg-A)+"px"})}}else{this.pointer=D;if(this.useLeft){this.element.setStyle({left:parseFloat(this.element.getStyle("left"))+B+"px"})}else{this.element.setStyle({right:parseFloat(this.element.getStyle("right"))-B+"px"})}if(this.useTop){this.element.setStyle({top:parseFloat(this.element.getStyle("top"))+A+"px"})}else{this.element.setStyle({bottom:parseFloat(this.element.getStyle("bottom"))-A+"px"})}}if(this.iefix){this._fixIEOverlapping()}this._removeStoreLocation();Event.stop(C)},_endDrag:function(A){WindowUtilities.enableScreen("__invisible__");if(this.doResize){Windows.notify("onEndResize",this)}else{Windows.notify("onEndMove",this)}Event.stopObserving(document,"mouseup",this.eventMouseUp,false);Event.stopObserving(document,"mousemove",this.eventMouseMove,false);this._saveCookie();Event.stop(A);document.body.ondrag=null;document.body.onselectstart=null},_createWindow:function(H){var E=this.options.className;var G=document.createElement("div");G.setAttribute("id",H);G.className="dialog";var F;if(this.options.url){F='<iframe frameborder="0" name="'+H+'_content"  id="'+H+'_content" src="'+this.options.url+'"> </iframe>'}else{F='<div id="'+H+'_content" class="'+E+'_content"> </div>'}var C=this.options.closable?"<div class='"+E+"_close' id='"+H+"_close' onclick='Windows.close(\""+H+"\", event)'> </div>":"";var B=this.options.minimizable?"<div class='"+E+"_minimize' id='"+H+"_minimize' onclick='Windows.minimize(\""+H+"\", event)'> </div>":"";var A=this.options.maximizable?"<div class='"+E+"_maximize' id='"+H+"_maximize' onclick='Windows.maximize(\""+H+"\", event)'> </div>":"";var D=this.options.resizable?"class='"+E+"_sizer' id='"+H+"_sizer'":"class='"+E+"_se'";G.innerHTML=C+B+A+"      <table id='"+H+"_row1' class=\"top table_window\">        <tr>          <td class='"+E+"_nw'>&nbsp;</td>          <td class='"+E+"_n'><div id='"+H+"_top' class='"+E+"_title title_window'>"+this.options.title+"</div></td>          <td class='"+E+"_ne'>&nbsp;</td>        </tr>      </table>      <table id='"+H+"_row2' class=\"mid table_window\">        <tr>          <td class='"+E+"_w'></td>            <td id='"+H+"_table_content' class='"+E+"_content' valign='top'>"+F+"</td>          <td class='"+E+"_e'></td>        </tr>      </table>        <table id='"+H+"_row3' class=\"bot table_window\">        <tr>          <td class='"+E+"_sw'>&nbsp;</td>            <td class='"+E+"_s'><div id='"+H+"_bottom' class='status_bar'>&nbsp;</div></td>            <td "+D+">&nbsp;</td>        </tr>      </table>    ";Element.hide(G);this.options.parent.insertBefore(G,this.options.parent.firstChild);Event.observe($(H+"_content"),"load",this.options.onload);return G},setLocation:function(B,A){if(B<0){B=0}if(A<0){A=0}this.element.setStyle({top:B+"px"});this.element.setStyle({left:A+"px"});this.useLeft=true;this.useTop=true},getLocation:function(){var A={};if(this.useTop){A=Object.extend(A,{top:this.element.getStyle("top")})}else{A=Object.extend(A,{bottom:this.element.getStyle("bottom")})}if(this.useLeft){A=Object.extend(A,{left:this.element.getStyle("left")})}else{A=Object.extend(A,{right:this.element.getStyle("right")})}return A},getSize:function(){return{width:this.width,height:this.height}},setSize:function(B,A){B=parseFloat(B);A=parseFloat(A);if(B<this.options.minWidth){B=this.options.minWidth}if(A<this.options.minHeight){A=this.options.minHeight}if(this.options.maxHeight&&A>this.options.maxHeight){A=this.options.maxHeight}if(this.options.maxWidth&&B>this.options.maxWidth){B=this.options.maxWidth}this.width=B;this.height=A;this.element.setStyle({width:B+this.widthW+this.widthE+"px"});this.element.setStyle({height:A+this.heightN+this.heightS+"px"});var C=$(this.element.id+"_content");C.setStyle({height:A+"px"});C.setStyle({width:B+"px"})},updateHeight:function(){this.setSize(this.width,this.content.scrollHeight)},updateWidth:function(){this.setSize(this.content.scrollWidth,this.height)},toFront:function(){if(Windows.focusedWindow==this){return }this.setZIndex(Windows.maxZIndex+20);Windows.notify("onFocus",this)},show:function(B){if(B){Windows.addModalWindow(this);this.modal=true;this.setZIndex(Windows.maxZIndex+20);Windows.unsetOverflow(this)}if(this.oldStyle){this.getContent().setStyle({overflow:this.oldStyle})}if(!this.width||!this.height){var A=WindowUtilities._computeSize(this.content.innerHTML,this.content.id,this.width,this.height,0);if(this.height){this.width=A+5}else{this.height=A+5}}this.setSize(this.width,this.height);if(this.centered){this._center(this.centerTop,this.centerLeft)}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();this.visible=true;WindowUtilities.focusedWindow=this;Windows.notify("onShow",this)},showCenter:function(A,C,B){this.centered=true;this.centerTop=C;this.centerLeft=B;this.show(A)},isVisible:function(){return this.visible},_center:function(C,B){var D=WindowUtilities.getWindowScroll();var A=WindowUtilities.getPageSize();if(!C){C=(A.windowHeight-(this.height+this.heightN+this.heightS))/2}C+=D.top;if(!B){B=(A.windowWidth-(this.width+this.widthW+this.widthE))/2}B+=D.left;this.setLocation(C,B);this.toFront()},_recenter:function(B){if(this.modal&&this.centered){var A=WindowUtilities.getPageSize();if($("overlay_modal")){$("overlay_modal").style.height=(A.pageHeight+"px");$("overlay_modal").style.width=(A.pageWidth+"px")}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()}Windows.notify("onHide",this)},minimize:function(){var A=$(this.getId()+"_row2");var D=A.getDimensions().height;if(A.visible()){var C=this.element.getHeight()-D;A.hide();this.element.setStyle({height:C+"px"});if(!this.useTop){var B=parseFloat(this.element.getStyle("bottom"));this.element.setStyle({bottom:(B+D)+"px"})}}else{var C=this.element.getHeight()+D;this.element.setStyle({height:C+"px"});if(!this.useTop){var B=parseFloat(this.element.getStyle("bottom"));this.element.setStyle({bottom:(B-D)+"px"})}A.show();this.toFront()}Windows.notify("onMinimize",this);this._saveCookie()},maximize:function(){if(this.storedLocation!=null){this._restoreLocation();if(this.iefix){this.iefix.hide()}}else{this._storeLocation();Windows.unsetOverflow(this);var B=WindowUtilities.getWindowScroll();var A=WindowUtilities.getPageSize();this.element.setStyle(this.useLeft?{left:B.left}:{right:B.left});this.element.setStyle(this.useTop?{top:B.top}:{bottom:B.top});this.setSize(A.windowWidth-this.widthW-this.widthE,A.windowHeight-this.heightN-this.heightS);this.toFront();if(this.iefix){this._fixIEOverlapping()}}Windows.notify("onMaximize",this);this._saveCookie()},isMinimized:function(){var A=$(this.getId()+"_row2");return !A.visible()},isMaximized:function(){return(this.storedLocation!=null)},setOpacity:function(A){if(Element.setOpacity){Element.setOpacity(this.element,A)}},setZIndex:function(A){this.element.setStyle({zIndex:A});Windows.updateZindex(A,this)},setTitle:function(A){if(!A||A==""){A="&nbsp;"}Element.update(this.element.id+"_top",A)},setStatusBar:function(B){var A=$(this.getId()+"_bottom");if(typeof (B)=="object"){if(this.bottombar.firstChild){this.bottombar.replaceChild(B,this.bottombar.firstChild)}else{this.bottombar.appendChild(B)}}else{this.bottombar.innerHTML=B}},_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(A){var B=this._createHiddenDiv(this.options.className+"_n");this.heightN=Element.getDimensions(B).height;B.parentNode.removeChild(B);var B=this._createHiddenDiv(this.options.className+"_s");this.heightS=Element.getDimensions(B).height;B.parentNode.removeChild(B);var B=this._createHiddenDiv(this.options.className+"_e");this.widthE=Element.getDimensions(B).width;B.parentNode.removeChild(B);var B=this._createHiddenDiv(this.options.className+"_w");this.widthW=Element.getDimensions(B).width;B.parentNode.removeChild(B);if(/Konqueror|Safari|KHTML/.test(navigator.userAgent)){this.setSize(this.width,this.height)}if(this.doMaximize){this.maximize()}if(this.doMinimize){this.minimize()}},_createHiddenDiv:function(B){var A=document.getElementsByTagName("body").item(0);var C=document.createElement("div");C.setAttribute("id",this.element.id+"_tmp");C.className=B;C.style.display="none";C.innerHTML="";A.insertBefore(C,A.firstChild);return C},_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;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 A="";if(this.useLeft){A+="l:"+(this.storedLocation?this.storedLocation.left:this.element.getStyle("left"))}else{A+="r:"+(this.storedLocation?this.storedLocation.right:this.element.getStyle("right"))}if(this.useTop){A+=",t:"+(this.storedLocation?this.storedLocation.top:this.element.getStyle("top"))}else{A+=",b:"+(this.storedLocation?this.storedLocation.bottom:this.element.getStyle("bottom"))}A+=","+(this.storedLocation?this.storedLocation.width:this.width);A+=","+(this.storedLocation?this.storedLocation.height:this.height);A+=","+this.isMinimized();A+=","+this.isMaximized();WindowUtilities.setCookie(A,this.cookie)}}};var Windows={windows:[],modalWindows:[],observers:[],focusedWindow:null,maxZIndex:0,addObserver:function(A){this.removeObserver(A);this.observers.push(A)},removeObserver:function(A){this.observers=this.observers.reject(function(B){return B==A})},notify:function(A,B){this.observers.each(function(C){if(C[A]){C[A](A,B)}})},getWindow:function(A){return this.windows.detect(function(B){return B.getId()==A})},getFocusedWindow:function(){return this.focusedWindow},register:function(A){this.windows.push(A)},addModalWindow:function(A){if(this.modalWindows.length==0){WindowUtilities.disableScreen(A.options.className,"overlay_modal",A.getId())}else{if(Window.keepMultiModalWindow){$("overlay_modal").style.zIndex=Windows.maxZIndex+20;Windows.maxZIndex+=20;WindowUtilities._hideSelect(this.modalWindows.last().getId())}else{this.modalWindows.last().element.hide()}WindowUtilities._showSelect(A.getId())}this.modalWindows.push(A)},removeModalWindow:function(A){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(A){this.windows.push(A)},unregister:function(A){this.windows=this.windows.reject(function(B){return B==A})},close:function(C,A){var B=this.getWindow(C);if(B&&B.visible){if(B.getDelegate()&&!B.getDelegate().canClose(B)){return }this.notify("onClose",B);B.hide()}if(A){Event.stop(A)}},closeAll:function(){this.windows.each(function(A){Windows.close(A.getId())})},closeAllModalWindows:function(){WindowUtilities.enableScreen();this.modalWindows.each(function(A){A.hide()})},minimize:function(C,A){var B=this.getWindow(C);if(B&&B.visible){B.minimize()}Event.stop(A)},maximize:function(C,A){var B=this.getWindow(C);if(B&&B.visible){B.maximize()}Event.stop(A)},unsetOverflow:function(A){this.windows.each(function(B){B.oldOverflow=B.getContent().getStyle("overflow")||"auto";B.getContent().setStyle({overflow:"hidden"})});if(A&&A.oldOverflow){A.getContent().setStyle({overflow:A.oldOverflow})}},resetOverflow:function(){this.windows.each(function(A){if(A.oldOverflow){A.getContent().setStyle({overflow:A.oldOverflow})}})},updateZindex:function(A,B){if(A>this.maxZIndex){this.maxZIndex=A}this.focusedWindow=B}};var Dialog={dialogId:null,onCompleteFunc:null,callFunc:null,parameters:null,confirm:function(D,C){if(typeof D!="string"){Dialog._runAjaxRequest(D,C,Dialog.confirm);return }C=C||{};var G=C.okLabel?C.okLabel:"Ok";var A=C.cancelLabel?C.cancelLabel:"Cancel";var F=C.windowParameters||{};F.className=F.className||"alert";var B="class ='"+(C.buttonClass?C.buttonClass+" ":"")+" ok_button'";var E="class ='"+(C.buttonClass?C.buttonClass+" ":"")+" cancel_button'";var D="			<div class='"+F.className+"_message'>"+D+"</div>				<div class='"+F.className+"_buttons'>					<input type='button' value='"+G+"' onclick='Dialog.okCallback()'"+B+"/>					<input type='button' value='"+A+"' onclick='Dialog.cancelCallback()' "+E+"/>				</div>		";return this._openDialog(D,C)},alert:function(C,B){if(typeof C!="string"){Dialog._runAjaxRequest(C,B,Dialog.alert);return }B=B||{};var E=B.okLabel?B.okLabel:"Ok";var D=B.windowParameters||{};D.className=D.className||"alert";var A="class ='"+(B.buttonClass?B.buttonClass+" ":"")+" ok_button'";var C="			<div class='"+D.className+"_message'>"+C+"</div>				<div class='"+D.className+"_buttons'>					<input type='button' value='"+E+"' onclick='Dialog.okCallback()'"+A+"/>				</div>";return this._openDialog(C,B)},info:function(C,B){if(typeof C!="string"){Dialog._runAjaxRequest(C,B,Dialog.info);return }B=B||{};B.windowParameters=B.windowParameters||{};var A=B.windowParameters.className||"alert";var C="<div id='modal_dialog_message' class='"+A+"_message'>"+C+"</div>";if(B.showProgress){C+="<div id='modal_dialog_progress' class='"+A+"_progress'>	</div>"}B.windowParameters.ok=null;B.windowParameters.cancel=null;B.windowParameters.className=A;return this._openDialog(C,B)},setInfoMessage:function(A){$("modal_dialog_message").update(A)},closeInfo:function(){Windows.close(this.dialogId)},_openDialog:function(D,C){if(!C.windowParameters.height&&!C.windowParameters.width){C.windowParameters.width=WindowUtilities.getPageSize().pageWidth/2}if(C.id){this.dialogId=C.id}else{var B=new Date();this.dialogId="modal_dialog_"+B.getTime()}if(!C.windowParameters.height||!C.windowParameters.width){var A=WindowUtilities._computeSize(D,this.dialogId,C.windowParameters.width,C.windowParameters.height);if(C.windowParameters.height){C.windowParameters.width=A+5}else{C.windowParameters.height=A+5}}var F=C&&C.windowParameters?C.windowParameters:{};F.resizable=F.resizable||false;F.effectOptions=F.effectOptions||{duration:1};F.minimizable=false;F.maximizable=false;F.closable=false;var E=new Window(this.dialogId,F);E.getContent().innerHTML=D;E.showCenter(true,C.top,C.left);E.setDestroyOnClose();E.cancelCallback=C.cancel;E.okCallback=C.ok;return E},_getAjaxContent:function(A){Dialog.callFunc(A.responseText,Dialog.parameters)},_runAjaxRequest:function(C,B,A){if(C.options==null){C.options={}}Dialog.onCompleteFunc=C.options.onComplete;Dialog.parameters=B;Dialog.callFunc=A;C.options.onComplete=Dialog._getAjaxContent;new Ajax.Request(C.url,C.options)},okCallback:function(){var A=Windows.focusedWindow;if(!A.okCallback||A.okCallback(A)){$$("#"+A.getId()+" input").each(function(B){B.onclick=null});A.hide()}},cancelCallback:function(){var A=Windows.focusedWindow;$$("#"+A.getId()+" input").each(function(B){B.onclick=null});A.hide();if(A.cancelCallback){A.cancelCallback(A)}}};var isIE=navigator.appVersion.match(/MSIE/)=="MSIE";var WindowUtilities={getWindowScroll:function(){var w=window;var T,L,W,H;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(){var E,A;if(window.innerHeight&&window.scrollMaxY){E=document.body.scrollWidth;A=window.innerHeight+window.scrollMaxY}else{if(document.body.scrollHeight>document.body.offsetHeight){E=document.body.scrollWidth;A=document.body.scrollHeight}else{E=document.body.offsetWidth;A=document.body.offsetHeight}}var C,F;if(self.innerHeight){C=self.innerWidth;F=self.innerHeight}else{if(document.documentElement&&document.documentElement.clientHeight){C=document.documentElement.clientWidth;F=document.documentElement.clientHeight}else{if(document.body){C=document.body.clientWidth;F=document.body.clientHeight}}}var D,B;if(A<F){D=F}else{D=A}if(E<C){B=C}else{B=E}return{pageWidth:B,pageHeight:D,windowWidth:C,windowHeight:F}},disableScreen:function(D,C,F){WindowUtilities.initLightbox(C,D);var B=document.getElementsByTagName("body").item(0);var E=$(C);var A=WindowUtilities.getPageSize();if(F&&isIE){WindowUtilities._hideSelect();WindowUtilities._showSelect(F)}E.style.height=(A.pageHeight+"px");E.style.width=(A.windowWidth+"px");E.style.display="block"},enableScreen:function(B){B=B||"overlay_modal";var A=$(B);if(A){A.style.display="none";if(B!="__invisible__"){WindowUtilities._showSelect()}A.parentNode.removeChild(A)}},_hideSelect:function(A){if(isIE){A=A==null?"":"#"+A+" ";$$(A+"select").each(function(B){if(!WindowUtilities.isDefined(B.oldVisibility)){B.oldVisibility=B.style.visibility?B.style.visibility:"visible";B.style.visibility="hidden"}})}},_showSelect:function(A){if(isIE){A=A==null?"":"#"+A+" ";$$(A+"select").each(function(B){if(WindowUtilities.isDefined(B.oldVisibility)){try{B.style.visibility=B.oldVisibility}catch(C){B.style.visibility="visible"}B.oldVisibility=null}else{if(B.style.visibility){B.style.visibility="visible"}}})}},isDefined:function(A){return typeof (A)!="undefined"&&A!=null},initLightbox:function(D,B){if($(D)){Element.setStyle(D,{zIndex:Windows.maxZIndex+10})}else{var A=document.getElementsByTagName("body").item(0);var C=document.createElement("div");C.setAttribute("id",D);C.className="overlay_"+B;C.style.display="none";C.style.position="absolute";C.style.top="0";C.style.left="0";C.style.zIndex=Windows.maxZIndex+10;C.style.width="100%";A.insertBefore(C,A.firstChild)}},setCookie:function(B,A){document.cookie=A[0]+"="+escape(B)+((A[1])?"; expires="+A[1].toGMTString():"")+((A[2])?"; path="+A[2]:"")+((A[3])?"; domain="+A[3]:"")+((A[4])?"; secure":"")},getCookie:function(C){var B=document.cookie;var E=C+"=";var D=B.indexOf("; "+E);if(D==-1){D=B.indexOf(E);if(D!=0){return null}}else{D+=2}var A=document.cookie.indexOf(";",D);if(A==-1){A=B.length}return unescape(B.substring(D+E.length,A))},addCss:function(D,A){if((typeof (A)=="undefined")||(typeof (A)=="string"&&A.length==0)){A="default.css"}if(typeof (cssPath)=="undefined"){cssPath=""}var C=$A(document.getElementsByTagName("link"));var E=true;C.each(function(F){if(F.href==A||F.href==cssPath+A){E=false}});if(E){var B=document.createElement("link");B.setAttribute("type","text/css");B.setAttribute("rel","stylesheet");B.setAttribute("href",cssPath+A);B.setAttribute("media","screen");document.getElementsByTagName("head")[0].appendChild(B)}},_computeSize:function(E,H,D,A,F){if(F==null){F=5}var C=document.getElementsByTagName("body").item(0);var G=document.createElement("div");G.setAttribute("id",H);if(A){G.style.height=A+"px"}else{G.style.width=D+"px"}G.style.position="absolute";G.style.top="0";G.style.left="0";G.style.display="none";G.innerHTML=E;C.insertBefore(G,C.firstChild);var B;if(A){B=$(H).getDimensions().width+F}else{B=$(H).getDimensions().height+F}C.removeChild(G);return B}};Event.observe(window,"load",function(A){WindowUtilities.addCss(A,"./css/defaultWin.css");WindowUtilities.addCss(A,"./css/mac_os_x.css");WindowUtilities.addCss(A,"./css/nuncio.css");WindowUtilities.addCss(A,"./css/alphacube.css");WindowUtilities.addCss(A,"./css/spread.css")});