function updateText_wait(){
$("alert_message").innerHTML=memory._text;
var _1=WindowUtilities._computeSize(Dialog.content_1+memory._text+Dialog.content_2,"count_size_div",540,0);
Dialog.win.setSize(540,_1);
Dialog.win._center(Dialog.win.centerTop,Dialog.win.centerLeft);
}
var memory={_text:null};
var Window=Class.create();
Window.keepMultiModalWindow=false;
Window.prototype={initialize:function(id){
if($(id)){
alert("Window "+id+" 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(id);
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 _3=this.getContent();
var _4=null;
for(var i=0;i<_3.childNodes.length;i++){
_4=_3.childNodes[i];
if(Node.ELEMENT_NODE==_4.nodeType){
break;
}
_4=null;
}
if(_4){
this._oldParent.appendChild(_4);
}
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(_6){
this.delegate=_6;
},getDelegate:function(){
return this.delegate;
},getContent:function(){
return this.content;
},setContent:function(id,_8,_9){
var _a=$(id);
if(null==_a){
throw "Unable to find element '"+id+"' in DOM";
}
this._oldParent=_a.parentNode;
var d=null;
var p=null;
if(_8){
d=Element.getDimensions(_a);
}
if(_9){
p=Position.cumulativeOffset(_a);
}
var _d=this.getContent();
_d.appendChild(_a);
_a.show();
if(_8){
this.setSize(d.width,d.height);
}
if(_9){
this.setLocation(p[1]-this.heightN,p[0]-this.widthW);
}
},setAjaxContent:function(_e,_f,_10,_11){
this.showFunction=_10?"showCenter":"show";
this.showModal=_11||false;
if(_f==null){
_f={};
}
this.onComplete=_f.onComplete;
_f.onComplete=this._setAjaxContent.bind(this);
new Ajax.Request(_e,_f);
},_setAjaxContent:function(_12){
Element.update(this.getContent(),_12.responseText);
if(this.onComplete){
this.onComplete(_12);
}
this[this.showFunction](this.showModal);
},setCookie:function(_13,_14,_15,_16,_17){
_13=_13||this.element.id;
this.cookie=[_13,_14,_15,_16,_17];
var _18=WindowUtilities.getCookie(_13);
if(_18){
var _19=_18.split(",");
var x=_19[0].split(":");
var y=_19[1].split(":");
var w=parseFloat(_19[2]),h=parseFloat(_19[3]);
var _1d=_19[4];
var _1e=_19[5];
this.setSize(w,h);
if(_1d=="true"){
this.doMinimize=true;
}else{
if(_1e=="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(){
var _1f=this.destroy.bind(this);
if(this.options.hideEffectOptions.afterFinish){
var _20=this.options.hideEffectOptions.afterFinish;
this.options.hideEffectOptions.afterFinish=function(){
_20();
_1f();
};
}else{
this.options.hideEffectOptions.afterFinish=function(){
_1f();
};
}
this.destroyOnClose=true;
},_initDrag:function(_21){
this.pointer=[Event.pointerX(_21),Event.pointerY(_21)];
if(Event.element(_21)==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 _22=$(this.getId()+"_close");
if(_22&&Position.within(_22,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(_21);
},_updateDrag:function(_23){
var _24=[Event.pointerX(_23),Event.pointerY(_23)];
var dx=_24[0]-this.pointer[0];
var dy=_24[1]-this.pointer[1];
if(this.doResize){
this.setSize(this.widthOrg+dx,this.heightOrg+dy);
dx=this.width-this.widthOrg;
dy=this.height-this.heightOrg;
if(!this.useLeft){
this.element.setStyle({right:(this.rightOrg-dx)+"px"});
}
if(!this.useTop){
this.element.setStyle({bottom:(this.bottomOrg-dy)+"px"});
}
}else{
this.pointer=_24;
if(this.useLeft){
this.element.setStyle({left:parseFloat(this.element.getStyle("left"))+dx+"px"});
}else{
this.element.setStyle({right:parseFloat(this.element.getStyle("right"))-dx+"px"});
}
if(this.useTop){
this.element.setStyle({top:parseFloat(this.element.getStyle("top"))+dy+"px"});
}else{
this.element.setStyle({bottom:parseFloat(this.element.getStyle("bottom"))-dy+"px"});
}
}
if(this.iefix){
this._fixIEOverlapping();
}
this._removeStoreLocation();
Event.stop(_23);
},_endDrag:function(_27){
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(_27);
document.body.ondrag=null;
document.body.onselectstart=null;
},_createWindow:function(id){
var _29=this.options.className;
var win=document.createElement("div");
win.setAttribute("id",id);
win.className="dialog";
var _2b;
if(this.options.url){
_2b="<iframe frameborder=\"0\" name=\""+id+"_content\"  id=\""+id+"_content\" src=\""+this.options.url+"\"> </iframe>";
}else{
_2b="<div id=\""+id+"_content\" class=\""+_29+"_content\"> </div>";
}
var _2c=this.options.closable?"<div class='"+_29+"_close' id='"+id+"_close' onclick='Windows.close(\""+id+"\", event)'> </div>":"";
var _2d=this.options.minimizable?"<div class='"+_29+"_minimize' id='"+id+"_minimize' onclick='Windows.minimize(\""+id+"\", event)'> </div>":"";
var _2e=this.options.maximizable?"<div class='"+_29+"_maximize' id='"+id+"_maximize' onclick='Windows.maximize(\""+id+"\", event)'> </div>":"";
var _2f=this.options.resizable?"class='"+_29+"_sizer' id='"+id+"_sizer'":"class='"+_29+"_se'";
win.innerHTML=_2c+_2d+_2e+"      <table id='"+id+"_row1' class=\"top table_window\">        <tr>          <td class='"+_29+"_nw'>&nbsp;</td>          <td class='"+_29+"_n'><div id='"+id+"_top' class='"+_29+"_title title_window'>"+this.options.title+"</div></td>          <td class='"+_29+"_ne'>&nbsp;</td>        </tr>      </table>      <table id='"+id+"_row2' class=\"mid table_window\">        <tr>          <td class='"+_29+"_w'></td>            <td id='"+id+"_table_content' class='"+_29+"_content' valign='top'>"+_2b+"</td>          <td class='"+_29+"_e'></td>        </tr>      </table>        <table id='"+id+"_row3' class=\"bot table_window\">        <tr>          <td class='"+_29+"_sw'>&nbsp;</td>            <td class='"+_29+"_s'><div id='"+id+"_bottom' class='status_bar'>&nbsp;</div></td>            <td "+_2f+">&nbsp;</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;
},setLocation:function(top,_31){
if(top<0){
top=0;
}
if(_31<0){
_31=0;
}
this.element.setStyle({top:top+"px"});
this.element.setStyle({left:_31+"px"});
this.useLeft=true;
this.useTop=true;
},getLocation:function(){
var _32={};
if(this.useTop){
_32=Object.extend(_32,{top:this.element.getStyle("top")});
}else{
_32=Object.extend(_32,{bottom:this.element.getStyle("bottom")});
}
if(this.useLeft){
_32=Object.extend(_32,{left:this.element.getStyle("left")});
}else{
_32=Object.extend(_32,{right:this.element.getStyle("right")});
}
return _32;
},getSize:function(){
return {width:this.width,height:this.height};
},setSize:function(_33,_34){
_33=parseFloat(_33);
_34=parseFloat(_34);
if(_33<this.options.minWidth){
_33=this.options.minWidth;
}
if(_34<this.options.minHeight){
_34=this.options.minHeight;
}
if(this.options.maxHeight&&_34>this.options.maxHeight){
_34=this.options.maxHeight;
}
if(this.options.maxWidth&&_33>this.options.maxWidth){
_33=this.options.maxWidth;
}
this.width=_33;
this.height=_34;
this.element.setStyle({width:_33+this.widthW+this.widthE+"px"});
this.element.setStyle({height:_34+this.heightN+this.heightS+"px"});
var _35=$(this.element.id+"_content");
_35.setStyle({height:_34+"px"});
_35.setStyle({width:_33+"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(_36){
if(_36){
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 _37=WindowUtilities._computeSize(this.content.innerHTML,this.content.id,this.width,this.height,0);
if(this.height){
this.width=_37+5;
}else{
this.height=_37+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(_38,top,_3a){
this.centered=true;
this.centerTop=top;
this.centerLeft=_3a;
this.show(_38);
},isVisible:function(){
return this.visible;
},_center:function(top,_3c){
var _3d=WindowUtilities.getWindowScroll();
var _3e=WindowUtilities.getPageSize();
if(!top){
top=(_3e.windowHeight-(this.height+this.heightN+this.heightS))/2;
}
top+=_3d.top;
if(!_3c){
_3c=(_3e.windowWidth-(this.width+this.widthW+this.widthE))/2;
}
_3c+=_3d.left;
this.setLocation(top,_3c);
this.toFront();
},_recenter:function(_3f){
if(this.modal&&this.centered){
var _40=WindowUtilities.getPageSize();
if($("overlay_modal")){
$("overlay_modal").style.height=(_40.pageHeight+"px");
$("overlay_modal").style.width=(_40.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 r2=$(this.getId()+"_row2");
var dh=r2.getDimensions().height;
if(r2.visible()){
var h=this.element.getHeight()-dh;
r2.hide();
this.element.setStyle({height:h+"px"});
if(!this.useTop){
var _44=parseFloat(this.element.getStyle("bottom"));
this.element.setStyle({bottom:(_44+dh)+"px"});
}
}else{
var h=this.element.getHeight()+dh;
this.element.setStyle({height:h+"px"});
if(!this.useTop){
var _44=parseFloat(this.element.getStyle("bottom"));
this.element.setStyle({bottom:(_44-dh)+"px"});
}
r2.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 _45=WindowUtilities.getWindowScroll();
var _46=WindowUtilities.getPageSize();
this.element.setStyle(this.useLeft?{left:_45.left}:{right:_45.left});
this.element.setStyle(this.useTop?{top:_45.top}:{bottom:_45.top});
this.setSize(_46.windowWidth-this.widthW-this.widthE,_46.windowHeight-this.heightN-this.heightS);
this.toFront();
if(this.iefix){
this._fixIEOverlapping();
}
}
Windows.notify("onMaximize",this);
this._saveCookie();
},isMinimized:function(){
var r2=$(this.getId()+"_row2");
return !r2.visible();
},isMaximized:function(){
return (this.storedLocation!=null);
},setOpacity:function(_48){
if(Element.setOpacity){
Element.setOpacity(this.element,_48);
}
},setZIndex:function(_49){
this.element.setStyle({zIndex:_49});
Windows.updateZindex(_49,this);
},setTitle:function(_4a){
if(!_4a||_4a==""){
_4a="&nbsp;";
}
Element.update(this.element.id+"_top",_4a);
},setStatusBar:function(_4b){
var _4c=$(this.getId()+"_bottom");
if(typeof (_4b)=="object"){
if(this.bottombar.firstChild){
this.bottombar.replaceChild(_4b,this.bottombar.firstChild);
}else{
this.bottombar.appendChild(_4b);
}
}else{
this.bottombar.innerHTML=_4b;
}
},_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(_4d){
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);
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(_4f){
var _50=document.getElementsByTagName("body").item(0);
var win=document.createElement("div");
win.setAttribute("id",this.element.id+"_tmp");
win.className=_4f;
win.style.display="none";
win.innerHTML="";
_50.insertBefore(win,_50.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;
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 _52="";
if(this.useLeft){
_52+="l:"+(this.storedLocation?this.storedLocation.left:this.element.getStyle("left"));
}else{
_52+="r:"+(this.storedLocation?this.storedLocation.right:this.element.getStyle("right"));
}
if(this.useTop){
_52+=",t:"+(this.storedLocation?this.storedLocation.top:this.element.getStyle("top"));
}else{
_52+=",b:"+(this.storedLocation?this.storedLocation.bottom:this.element.getStyle("bottom"));
}
_52+=","+(this.storedLocation?this.storedLocation.width:this.width);
_52+=","+(this.storedLocation?this.storedLocation.height:this.height);
_52+=","+this.isMinimized();
_52+=","+this.isMaximized();
WindowUtilities.setCookie(_52,this.cookie);
}
}};
var Windows={windows:[],modalWindows:[],observers:[],focusedWindow:null,maxZIndex:0,addObserver:function(_53){
this.removeObserver(_53);
this.observers.push(_53);
},removeObserver:function(_54){
this.observers=this.observers.reject(function(o){
return o==_54;
});
},notify:function(_56,win){
this.observers.each(function(o){
if(o[_56]){
o[_56](_56,win);
}
});
},getWindow:function(id){
return this.windows.detect(function(d){
return d.getId()==id;
});
},getFocusedWindow:function(){
return this.focusedWindow;
},register:function(win){
this.windows.push(win);
},addModalWindow:function(win){
if(this.modalWindows.length==0){
WindowUtilities.disableScreen(win.options.className,"overlay_modal",win.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(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;
});
},close:function(id,_62){
var win=this.getWindow(id);
if(win&&win.visible){
if(win.getDelegate()&&!win.getDelegate().canClose(win)){
return;
}
this.notify("onClose",win);
win.hide();
}
if(_62){
Event.stop(_62);
}
},closeAll:function(){
this.windows.each(function(w){
Windows.close(w.getId());
});
},closeAllModalWindows:function(){
WindowUtilities.enableScreen();
this.modalWindows.each(function(win){
win.hide();
});
},minimize:function(id,_67){
var win=this.getWindow(id);
if(win&&win.visible){
win.minimize();
}
Event.stop(_67);
},maximize:function(id,_6a){
var win=this.getWindow(id);
if(win&&win.visible){
win.maximize();
}
Event.stop(_6a);
},unsetOverflow:function(_6c){
this.windows.each(function(d){
d.oldOverflow=d.getContent().getStyle("overflow")||"auto";
d.getContent().setStyle({overflow:"hidden"});
});
if(_6c&&_6c.oldOverflow){
_6c.getContent().setStyle({overflow:_6c.oldOverflow});
}
},resetOverflow:function(){
this.windows.each(function(d){
if(d.oldOverflow){
d.getContent().setStyle({overflow:d.oldOverflow});
}
});
},updateZindex:function(_6f,win){
if(_6f>this.maxZIndex){
this.maxZIndex=_6f;
}
this.focusedWindow=win;
}};
var Dialog={dialogId:null,onCompleteFunc:null,callFunc:null,parameters:null,win:null,content_1:null,content_2:null,confirm:function(_71,_72){
if(typeof _71!="string"){
Dialog._runAjaxRequest(_71,_72,Dialog.confirm);
return;
}
_72=_72||{};
var _73=_72.okLabel?_72.okLabel:"Ok";
var _74=_72.cancelLabel?_72.cancelLabel:"Cancel";
var _75=_72.windowParameters||{};
_75.className=_75.className||"alert";
var _76="class ='"+(_72.buttonClass?_72.buttonClass+" ":"")+" ok_button'";
var _77="class ='"+(_72.buttonClass?_72.buttonClass+" ":"")+" cancel_button'";
var _71="\t\t\t<div class='"+_75.className+"_message'>"+_71+"</div>\t\t\t\t<div class='"+_75.className+"_buttons'>\t\t\t\t\t<input type='button' value='"+_73+"' onclick='Dialog.okCallback()'"+_76+"/>\t\t\t\t\t<input type='button' value='"+_74+"' onclick='Dialog.cancelCallback()' "+_77+"/>\t\t\t\t</div>\t\t";
return this._openDialog(_71,_72);
},alert:function(_78,_79){
if(typeof _78!="string"){
Dialog._runAjaxRequest(_78,_79,Dialog.alert);
return;
}
_79=_79||{};
var _7a=_79.okLabel?_79.okLabel:"Ok";
var _7b=_79.windowParameters||{};
_7b.className=_7b.className||"alert";
var _7c="class ='"+(_79.buttonClass?_79.buttonClass+" ":"")+" ok_button'";
var _78="\t\t\t<div class='"+_7b.className+"_message'>"+_78+"</div>\t\t\t\t<div class='"+_7b.className+"_buttons'>\t\t\t\t\t<input type='button' value='"+_7a+"' onclick='Dialog.okCallback()'"+_7c+"/>\t\t\t\t</div>";
return this._openDialog(_78,_79);
},info:function(_7d,_7e){
if(typeof _7d!="string"){
Dialog._runAjaxRequest(_7d,_7e,Dialog.info);
return;
}
_7e=_7e||{};
_7e.windowParameters=_7e.windowParameters||{};
var _7f=_7e.windowParameters.className||"alert";
var _7d="<div id='modal_dialog_message' class='"+_7f+"_message'>"+_7d+"</div>";
if(_7e.showProgress){
_7d+="<div id='modal_dialog_progress' class='"+_7f+"_progress'>\t</div>";
}
_7e.windowParameters.ok=null;
_7e.windowParameters.cancel=null;
_7e.windowParameters.className=_7f;
return this._openDialog(_7d,_7e);
},setInfoMessage:function(_80){
$("modal_dialog_message").update(_80);
},closeInfo:function(){
Windows.close(this.dialogId);
},_openDialog:function(_81,_82){
if(!_82.windowParameters.height&&!_82.windowParameters.width){
_82.windowParameters.width=WindowUtilities.getPageSize().pageWidth/2;
}
if(_82.id){
this.dialogId=_82.id;
}else{
var t=new Date();
this.dialogId="modal_dialog_"+t.getTime();
}
if(!_82.windowParameters.height||!_82.windowParameters.width){
var _84=WindowUtilities._computeSize(_81,this.dialogId,_82.windowParameters.width,_82.windowParameters.height);
if(_82.windowParameters.height){
_82.windowParameters.width=_84+5;
}else{
_82.windowParameters.height=_84+5;
}
}
var _85=_82&&_82.windowParameters?_82.windowParameters:{};
_85.resizable=_85.resizable||false;
_85.effectOptions=_85.effectOptions||{duration:1};
_85.minimizable=false;
_85.maximizable=false;
_85.closable=false;
var win=new Window(this.dialogId,_85);
win.getContent().innerHTML=_81;
win.showCenter(true,_82.top,_82.left);
win.setDestroyOnClose();
win.cancelCallback=_82.cancel;
win.okCallback=_82.ok;
Dialog.onCompleteFunc();
return win;
},_getAjaxContent:function(_87){
memory._text=_87.responseText;
setTimeout("updateText_wait()",500);
},_runAjaxRequest:function(_88,_89,_8a){
if(_88.options==null){
_88.options={};
}
Dialog.onCompleteFunc=_88.options.onComplete;
Dialog.parameters=_89;
Dialog.callFunc=_8a;
_89=_89||{};
var _8b=_89.okLabel?_89.okLabel:"Ok";
var _8c=_89.windowParameters||{};
_8c.className=_8c.className||"alert";
var _8d="class ='"+(_89.buttonClass?_89.buttonClass+" ":"")+" ok_button'";
var _8e="\t\t\t<div id='alert_message' class='"+_8c.className+"_message'><div id='modal_dialog_progress' class='"+_8c.className+"_progress'></div></div>\t\t\t\t<div class='"+_8c.className+"_buttons'>\t\t\t\t\t<input type='button' value='"+_8b+"' onclick='Dialog.okCallback()'"+_8d+"/>\t\t\t\t</div>";
Dialog.content_1="<div id='alert_message' class='"+_8c.className+"_message'>";
Dialog.content_2="</div><div class='"+_8c.className+"_buttons'><input type='button' value='"+_8b+"' onclick='Dialog.okCallback()'"+_8d+"/></div>";
Dialog.win=this._openDialog(_8e,_89);
_88.options.onComplete=Dialog._getAjaxContent;
new Ajax.Request(_88.url,_88.options);
},okCallback:function(){
var win=Windows.focusedWindow;
if(!win.okCallback||win.okCallback(win)){
$$("#"+win.getId()+" input").each(function(_90){
_90.onclick=null;
});
win.hide();
}
},cancelCallback:function(){
var win=Windows.focusedWindow;
$$("#"+win.getId()+" input").each(function(_92){
_92.onclick=null;
});
win.hide();
if(win.cancelCallback){
win.cancelCallback(win);
}
}};
var isIE=true;
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 _95,yScroll;
if(window.innerHeight&&window.scrollMaxY){
_95=document.body.scrollWidth;
yScroll=window.innerHeight+window.scrollMaxY;
}else{
if(document.body.scrollHeight>document.body.offsetHeight){
_95=document.body.scrollWidth;
yScroll=document.body.scrollHeight;
}else{
_95=document.body.offsetWidth;
yScroll=document.body.offsetHeight;
}
}
var _96,windowHeight;
if(self.innerHeight){
_96=self.innerWidth;
windowHeight=self.innerHeight;
}else{
if(document.documentElement&&document.documentElement.clientHeight){
_96=document.documentElement.clientWidth;
windowHeight=document.documentElement.clientHeight;
}else{
if(document.body){
_96=document.body.clientWidth;
windowHeight=document.body.clientHeight;
}
}
}
var _97,pageWidth;
if(yScroll<windowHeight){
_97=windowHeight;
}else{
_97=yScroll;
}
if(_95<_96){
pageWidth=_96;
}else{
pageWidth=_95;
}
return {pageWidth:pageWidth,pageHeight:_97,windowWidth:_96,windowHeight:windowHeight};
},disableScreen:function(_98,_99,_9a){
WindowUtilities.initLightbox(_99,_98);
var _9b=document.getElementsByTagName("body").item(0);
var _9c=$(_99);
var _9d=WindowUtilities.getPageSize();
if(_9a&&isIE){
WindowUtilities._hideSelect();
WindowUtilities._showSelect(_9a);
}
_9c.style.height=(_9d.pageHeight+"px");
_9c.style.width=(_9d.windowWidth+"px");
_9c.style.display="block";
},enableScreen:function(id){
id=id||"overlay_modal";
var _9f=$(id);
if(_9f){
_9f.style.display="none";
if(id!="__invisible__"){
WindowUtilities._showSelect();
}
_9f.parentNode.removeChild(_9f);
}
},_hideSelect:function(id){
if(isIE){
id=id==null?"":"#"+id+" ";
$$(id+"select").each(function(_a1){
if(!WindowUtilities.isDefined(_a1.oldVisibility)){
_a1.oldVisibility=_a1.style.visibility?_a1.style.visibility:"visible";
_a1.style.visibility="hidden";
}
});
}
},_showSelect:function(id){
if(isIE){
id=id==null?"":"#"+id+" ";
$$(id+"select").each(function(_a3){
if(WindowUtilities.isDefined(_a3.oldVisibility)){
try{
_a3.style.visibility=_a3.oldVisibility;
}
catch(e){
_a3.style.visibility="visible";
}
_a3.oldVisibility=null;
}else{
if(_a3.style.visibility){
_a3.style.visibility="visible";
}
}
});
}
},isDefined:function(_a4){
return typeof (_a4)!="undefined"&&_a4!=null;
},initLightbox:function(id,_a6){
if($(id)){
Element.setStyle(id,{zIndex:Windows.maxZIndex+10});
}else{
var _a7=document.getElementsByTagName("body").item(0);
var _a8=document.createElement("div");
_a8.setAttribute("id",id);
_a8.className="overlay_"+_a6;
_a8.style.display="none";
_a8.style.position="absolute";
_a8.style.top="0";
_a8.style.left="0";
_a8.style.zIndex=Windows.maxZIndex+10;
_a8.style.width="100%";
_a7.insertBefore(_a8,_a7.firstChild);
}
},setCookie:function(_a9,_aa){
document.cookie=_aa[0]+"="+escape(_a9)+((_aa[1])?"; expires="+_aa[1].toGMTString():"")+((_aa[2])?"; path="+_aa[2]:"")+((_aa[3])?"; domain="+_aa[3]:"")+((_aa[4])?"; secure":"");
},getCookie:function(_ab){
var dc=document.cookie;
var _ad=_ab+"=";
var _ae=dc.indexOf("; "+_ad);
if(_ae==-1){
_ae=dc.indexOf(_ad);
if(_ae!=0){
return null;
}
}else{
_ae+=2;
}
var end=document.cookie.indexOf(";",_ae);
if(end==-1){
end=dc.length;
}
return unescape(dc.substring(_ae+_ad.length,end));
},addCss:function(_b0,_b1){
if((typeof (_b1)=="undefined")||(typeof (_b1)=="string"&&_b1.length==0)){
_b1="default.css";
}
if(typeof (cssPath)=="undefined"){
cssPath="";
}
var h=$A(document.getElementsByTagName("link"));
var _b3=true;
h.each(function(lnk){
if(lnk.href==_b1||lnk.href==cssPath+_b1){
_b3=false;
}
});
if(_b3){
var l=document.createElement("link");
l.setAttribute("type","text/css");
l.setAttribute("rel","stylesheet");
l.setAttribute("href",cssPath+_b1);
l.setAttribute("media","screen");
document.getElementsByTagName("head")[0].appendChild(l);
}
},_computeSize:function(_b6,id,_b8,_b9,_ba){
if(_ba==null){
_ba=5;
}
var _bb=document.getElementsByTagName("body").item(0);
var _bc=document.createElement("div");
_bc.setAttribute("id",id);
if(_b9){
_bc.style.height=_b9+"px";
}else{
_bc.style.width=_b8+"px";
}
_bc.style.position="absolute";
_bc.style.top="0";
_bc.style.left="0";
_bc.style.display="none";
_bc.innerHTML=_b6;
_bb.insertBefore(_bc,_bb.firstChild);
var _bd;
if(_b9){
_bd=$(id).getDimensions().width+_ba;
}else{
_bd=$(id).getDimensions().height+_ba;
}
_bb.removeChild(_bc);
return _bd;
}};
Event.observe(window,"load",WindowUtilities.addCss);

