var Window=Class.create();
Window.keepMultiModalWindow=false;
Window.hasEffectLib=(typeof Effect!="undefined");
Window.resizeEffectDuration=0.4;
Window.prototype={initialize:function(){
var id;
var _2=0;
if(arguments.length>0){
if(typeof arguments[0]=="string"){
id=arguments[0];
_2=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[_2]||{});
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 _3=this;
[this.topbar,this.topbar.up().previous(),this.topbar.up().next()].each(function(_4){
_4.observe("mousedown",_3.eventMouseDown);
_4.addClassName("top_draggable");
});
[this.bottombar.up(),this.bottombar.up().previous(),this.bottombar.up().next()].each(function(_5){
_5.observe("mousedown",_3.eventMouseDown);
_5.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 _6=this.getContent();
var _7=null;
for(var i=0;i<_6.childNodes.length;i++){
_7=_6.childNodes[i];
if(_7.nodeType==1){
break;
}
_7=null;
}
if(_7){
this._oldParent.appendChild(_7);
}
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(_9){
this.options.closeCallback=_9;
},getContent:function(){
return this.content;
},setContent:function(id,_b,_c){
var _d=$(id);
if(null==_d){
throw "Unable to find element '"+id+"' in DOM";
}
this._oldParent=_d.parentNode;
var d=null;
var p=null;
if(_b){
d=Element.getDimensions(_d);
}
if(_c){
p=Position.cumulativeOffset(_d);
}
var _10=this.getContent();
this.setHTMLContent("");
_10=this.getContent();
_10.appendChild(_d);
_d.show();
if(_b){
this.setSize(d.width,d.height);
}
if(_c){
this.setLocation(p[1]-this.heightN,p[0]-this.widthW);
}
},setHTMLContent:function(_11){
if(this.options.url){
this.content.src=null;
this.options.url=null;
var _12="<div id=\""+this.getId()+"_content\" class=\""+this.options.className+"_content\"> </div>";
$(this.getId()+"_table_content").innerHTML=_12;
this.content=$(this.element.id+"_content");
}
this.getContent().innerHTML=_11;
},setAjaxContent:function(url,_14,_15,_16){
this.showFunction=_15?"showCenter":"show";
this.showModal=_16||false;
_14=_14||{};
this.setHTMLContent("");
this.onComplete=_14.onComplete;
if(!this._onCompleteHandler){
this._onCompleteHandler=this._setAjaxContent.bind(this);
}
_14.onComplete=this._onCompleteHandler;
new Ajax.Request(url,_14);
_14.onComplete=this.onComplete;
},_setAjaxContent:function(_17){
Element.update(this.getContent(),_17.responseText);
if(this.onComplete){
this.onComplete(_17);
}
this.onComplete=null;
this[this.showFunction](this.showModal);
},setURL:function(url){
if(this.options.url){
this.content.src=null;
}
this.options.url=url;
var _19="<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=_19;
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(_1a,_1b,_1c,_1d,_1e){
_1a=_1a||this.element.id;
this.cookie=[_1a,_1b,_1c,_1d,_1e];
var _1f=WindowUtilities.getCookie(_1a);
if(_1f){
var _20=_1f.split(",");
var x=_20[0].split(":");
var y=_20[1].split(":");
var w=parseFloat(_20[2]),h=parseFloat(_20[3]);
var _24=_20[4];
var _25=_20[5];
this.setSize(w,h);
if(_24=="true"){
this.doMinimize=true;
}else{
if(_25=="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(_26,_27){
this.constraint=_26;
this.constraintPad=Object.extend(this.constraintPad,_27||{});
if(this.useTop&&this.useLeft){
this.setLocation(parseFloat(this.element.style.top),parseFloat(this.element.style.left));
}
},_initDrag:function(_28){
if(Event.element(_28)==this.sizer&&this.isMinimized()){
return;
}
if(Event.element(_28)!=this.sizer&&this.isMaximized()){
return;
}
if(Prototype.Browser.IE&&this.heightN==0){
this._getWindowBorderSize();
}
this.pointer=[this._round(Event.pointerX(_28),this.options.gridX),this._round(Event.pointerY(_28),this.options.gridY)];
if(this.options.wiredDrag){
this.currentDrag=this._createWiredElement();
}else{
this.currentDrag=this.element;
}
if(Event.element(_28)==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 _29=$(this.getId()+"_close");
if(_29&&Position.within(_29,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(_28);
},_round:function(val,_2b){
return _2b==1?val:val=Math.floor(val/_2b)*_2b;
},_updateDrag:function(_2c){
var _2d=[this._round(Event.pointerX(_2c),this.options.gridX),this._round(Event.pointerY(_2c),this.options.gridY)];
var dx=_2d[0]-this.pointer[0];
var dy=_2d[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=_2d;
if(this.useLeft){
var _32=parseFloat(this.currentDrag.getStyle("left"))+dx;
var _33=this._updateLeftConstraint(_32);
this.pointer[0]+=_33-_32;
this.currentDrag.setStyle({left:_33+"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 _35=this._updateTopConstraint(top);
this.pointer[1]+=_35-top;
this.currentDrag.setStyle({top:_35+"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(_2c);
},_endDrag:function(_36){
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(_36);
this._hideWiredElement();
this._saveCookie();
document.body.ondrag=null;
document.body.onselectstart=null;
},_updateLeftConstraint:function(_37){
if(this.constraint&&this.useLeft&&this.useTop){
var _38=this.options.parent==document.body?WindowUtilities.getPageSize().windowWidth:this.options.parent.getDimensions().width;
if(_37<this.constraintPad.left){
_37=this.constraintPad.left;
}
if(_37+this.width+this.widthE+this.widthW>_38-this.constraintPad.right){
_37=_38-this.constraintPad.right-this.width-this.widthE-this.widthW;
}
}
return _37;
},_updateTopConstraint:function(top){
if(this.constraint&&this.useLeft&&this.useTop){
var _3a=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>_3a-this.constraintPad.bottom){
top=_3a-this.constraintPad.bottom-h;
}
}
return top;
},_updateWidthConstraint:function(w){
if(this.constraint&&this.useLeft&&this.useTop){
var _3d=this.options.parent==document.body?WindowUtilities.getPageSize().windowWidth:this.options.parent.getDimensions().width;
var _3e=parseFloat(this.element.getStyle("left"));
if(_3e+w+this.widthE+this.widthW>_3d-this.constraintPad.right){
w=_3d-this.constraintPad.right-_3e-this.widthE-this.widthW;
}
}
return w;
},_updateHeightConstraint:function(h){
if(this.constraint&&this.useLeft&&this.useTop){
var _40=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>_40-this.constraintPad.bottom){
h=_40-this.constraintPad.bottom-top-this.heightN-this.heightS;
}
}
return h;
},_createWindow:function(id){
var _43=this.options.className;
var win=document.createElement("div");
win.setAttribute("id",id);
win.className="dialog";
var _45;
if(this.options.url){
_45="<iframe frameborder=\"0\" name=\""+id+"_content\"  id=\""+id+"_content\" src=\""+this.options.url+"\"> </iframe>";
}else{
_45="<div id=\""+id+"_content\" class=\""+_43+"_content\"> </div>";
}
var _46=this.options.closable?"<div class='"+_43+"_close' id='"+id+"_close' onclick='Windows.close(\""+id+"\", event)'> </div>":"";
var _47=this.options.minimizable?"<div class='"+_43+"_minimize' id='"+id+"_minimize' onclick='Windows.minimize(\""+id+"\", event)'> </div>":"";
var _48=this.options.maximizable?"<div class='"+_43+"_maximize' id='"+id+"_maximize' onclick='Windows.maximize(\""+id+"\", event)'> </div>":"";
var _49=this.options.resizable?"class='"+_43+"_sizer' id='"+id+"_sizer'":"class='"+_43+"_se'";
var _4a="../themes/default/blank.gif";
win.innerHTML=_46+_47+_48+"      <table id='"+id+"_row1' class=\"top table_window\">        <tr>          <td class='"+_43+"_nw'></td>          <td class='"+_43+"_n'><div id='"+id+"_top' class='"+_43+"_title title_window'>"+this.options.title+"</div></td>          <td class='"+_43+"_ne'></td>        </tr>      </table>      <table id='"+id+"_row2' class=\"mid table_window\">        <tr>          <td class='"+_43+"_w'></td>            <td id='"+id+"_table_content' class='"+_43+"_content' valign='top'>"+_45+"</td>          <td class='"+_43+"_e'></td>        </tr>      </table>        <table id='"+id+"_row3' class=\"bot table_window\">        <tr>          <td class='"+_43+"_sw'></td>            <td class='"+_43+"_s'><div id='"+id+"_bottom' class='status_bar'><span style='float:left; width:1px; height:1px'></span></div></td>            <td "+_49+"></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(_4b){
var _4c=this.options.className;
var id=this.getId();
$A(["_close","_minimize","_maximize","_sizer","_content"]).each(function(_4e){
this._toggleClassName($(id+_4e),_4c+_4e,_4b+_4e);
}.bind(this));
this._toggleClassName($(id+"_top"),_4c+"_title",_4b+"_title");
$$("#"+id+" td").each(function(td){
td.className=td.className.sub(_4c,_4b);
});
this.options.className=_4b;
},_toggleClassName:function(_50,_51,_52){
if(_50){
_50.removeClassName(_51);
_50.addClassName(_52);
}
},setLocation:function(top,_54){
top=this._updateTopConstraint(top);
_54=this._updateLeftConstraint(_54);
var e=this.currentDrag||this.element;
e.setStyle({top:top+"px"});
e.setStyle({left:_54+"px"});
this.useLeft=true;
this.useTop=true;
},getLocation:function(){
var _56={};
if(this.useTop){
_56=Object.extend(_56,{top:this.element.getStyle("top")});
}else{
_56=Object.extend(_56,{bottom:this.element.getStyle("bottom")});
}
if(this.useLeft){
_56=Object.extend(_56,{left:this.element.getStyle("left")});
}else{
_56=Object.extend(_56,{right:this.element.getStyle("right")});
}
return _56;
},getSize:function(){
return {width:this.width,height:this.height};
},setSize:function(_57,_58,_59){
_57=parseFloat(_57);
_58=parseFloat(_58);
if(!this.minimized&&_57<this.options.minWidth){
_57=this.options.minWidth;
}
if(!this.minimized&&_58<this.options.minHeight){
_58=this.options.minHeight;
}
if(this.options.maxHeight&&_58>this.options.maxHeight){
_58=this.options.maxHeight;
}
if(this.options.maxWidth&&_57>this.options.maxWidth){
_57=this.options.maxWidth;
}
if(this.useTop&&this.useLeft&&Window.hasEffectLib&&Effect.ResizeWindow&&_59){
new Effect.ResizeWindow(this,null,null,_57,_58,{duration:Window.resizeEffectDuration});
}else{
this.width=_57;
this.height=_58;
var e=this.currentDrag?this.currentDrag:this.element;
e.setStyle({width:_57+this.widthW+this.widthE+"px"});
e.setStyle({height:_58+this.heightN+this.heightS+"px"});
if(!this.currentDrag||this.currentDrag==this.element){
var _5b=$(this.element.id+"_content");
_5b.setStyle({height:_58+"px"});
_5b.setStyle({width:_57+"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(_5c){
if(!this.width||!this.height||!this.visible){
this.computeBounds();
}
var w=this.width;
var h=this.height;
if(!_5c){
w+=this.widthW+this.widthE;
h+=this.heightN+this.heightS;
}
var _5f=Object.extend(this.getLocation(),{width:w+"px",height:h+"px"});
return _5f;
},computeBounds:function(){
if(!this.width||!this.height){
var _60=WindowUtilities._computeSize(this.content.innerHTML,this.content.id,this.width,this.height,0,this.options.className);
if(this.height){
this.width=_60+5;
}else{
this.height=_60+5;
}
}
this.setSize(this.width,this.height);
if(this.centered){
this._center(this.centerTop,this.centerLeft);
}
},show:function(_61){
this.visible=true;
if(_61){
if(typeof this.overlayOpacity=="undefined"){
var _62=this;
setTimeout(function(){
_62.show(_61);
},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(_63,top,_65){
this.centered=true;
this.centerTop=top;
this.centerLeft=_65;
this.show(_63);
},isVisible:function(){
return this.visible;
},_center:function(top,_67){
var _68=WindowUtilities.getWindowScroll(this.options.parent);
var _69=WindowUtilities.getPageSize(this.options.parent);
if(typeof top=="undefined"){
top=(_69.windowHeight-(this.height+this.heightN+this.heightS))/2;
}
top+=_68.top;
if(typeof _67=="undefined"){
_67=(_69.windowWidth-(this.width+this.widthW+this.widthE))/2;
}
_67+=_68.left;
this.setLocation(top,_67);
this.toFront();
},_recenter:function(_6a){
if(this.centered){
var _6b=WindowUtilities.getPageSize(this.options.parent);
var _6c=WindowUtilities.getWindowScroll(this.options.parent);
if(this.pageSize&&this.pageSize.windowWidth==_6b.windowWidth&&this.pageSize.windowHeight==_6b.windowHeight&&this.windowScroll.left==_6c.left&&this.windowScroll.top==_6c.top){
return;
}
this.pageSize=_6b;
this.windowScroll=_6c;
if($("overlay_modal")){
$("overlay_modal").setStyle({height:(_6b.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 _6d=this.destroy.bind(this);
if(this.options.hideEffectOptions.afterFinish){
var _6e=this.options.hideEffectOptions.afterFinish;
this.options.hideEffectOptions.afterFinish=function(){
_6e();
_6d();
};
}else{
this.options.hideEffectOptions.afterFinish=function(){
_6d();
};
}
}
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 _72=parseFloat(this.element.getStyle("bottom"));
this.element.setStyle({bottom:(_72+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 _75=parseFloat(this.element.getStyle("bottom"));
this.element.setStyle({bottom:(_75-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 _76=WindowUtilities.getWindowScroll(this.options.parent);
var _77=WindowUtilities.getPageSize(this.options.parent);
var _78=_76.left;
var top=_76.top;
if(this.options.parent!=document.body){
_76={top:0,left:0,bottom:0,right:0};
var dim=this.options.parent.getDimensions();
_77.windowWidth=dim.width;
_77.windowHeight=dim.height;
top=0;
_78=0;
}
if(this.constraint){
_77.windowWidth-=Math.max(0,this.constraintPad.left)+Math.max(0,this.constraintPad.right);
_77.windowHeight-=Math.max(0,this.constraintPad.top)+Math.max(0,this.constraintPad.bottom);
_78+=Math.max(0,this.constraintPad.left);
top+=Math.max(0,this.constraintPad.top);
}
var _7b=_77.windowWidth-this.widthW-this.widthE;
var _7c=_77.windowHeight-this.heightN-this.heightS;
if(this.useLeft&&this.useTop&&Window.hasEffectLib&&Effect.ResizeWindow){
new Effect.ResizeWindow(this,top,_78,_7b,_7c,{duration:Window.resizeEffectDuration});
}else{
this.setSize(_7b,_7c);
this.element.setStyle(this.useLeft?{left:_78}:{right:_78});
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(_7d){
if(Element.setOpacity){
Element.setOpacity(this.element,_7d);
}
},setZIndex:function(_7e){
this.element.setStyle({zIndex:_7e});
Windows.updateZindex(_7e,this);
},setTitle:function(_7f){
if(!_7f||_7f==""){
_7f="&nbsp;";
}
Element.update(this.element.id+"_top",_7f);
},getTitle:function(){
return $(this.element.id+"_top").innerHTML;
},setStatusBar:function(_80){
var _81=$(this.getId()+"_bottom");
if(typeof (_80)=="object"){
if(this.bottombar.firstChild){
this.bottombar.replaceChild(_80,this.bottombar.firstChild);
}else{
this.bottombar.appendChild(_80);
}
}else{
this.bottombar.innerHTML=_80;
}
},_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(_82){
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 _88=this;
setTimeout(function(){
_88.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(_89){
var _8a=document.body;
var win=document.createElement("div");
win.setAttribute("id",this.element.id+"_tmp");
win.className=_89;
win.style.display="none";
win.innerHTML="";
_8a.insertBefore(win,_8a.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 _8c="";
if(this.useLeft){
_8c+="l:"+(this.storedLocation?this.storedLocation.left:this.element.getStyle("left"));
}else{
_8c+="r:"+(this.storedLocation?this.storedLocation.right:this.element.getStyle("right"));
}
if(this.useTop){
_8c+=",t:"+(this.storedLocation?this.storedLocation.top:this.element.getStyle("top"));
}else{
_8c+=",b:"+(this.storedLocation?this.storedLocation.bottom:this.element.getStyle("bottom"));
}
_8c+=","+(this.storedLocation?this.storedLocation.width:this.width);
_8c+=","+(this.storedLocation?this.storedLocation.height:this.height);
_8c+=","+this.isMinimized();
_8c+=","+this.isMaximized();
WindowUtilities.setCookie(_8c,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(_8f){
if(this.options[_8f]){
this.options[_8f](this);
}else{
Windows.notify(_8f,this);
}
}};
var Windows={windows:[],modalWindows:[],observers:[],focusedWindow:null,maxZIndex:0,overlayShowEffectOptions:{duration:0.5},overlayHideEffectOptions:{duration:0.5},addObserver:function(_90){
this.removeObserver(_90);
this.observers.push(_90);
},removeObserver:function(_91){
this.observers=this.observers.reject(function(o){
return o==_91;
});
},notify:function(_93,win){
this.observers.each(function(o){
if(o[_93]){
o[_93](_93,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,_a1){
var win=this.getWindow(id);
if(win&&win.visible){
win.minimize();
}
Event.stop(_a1);
},maximize:function(id,_a4){
var win=this.getWindow(id);
if(win&&win.visible){
win.maximize();
}
Event.stop(_a4);
},close:function(id,_a7){
var win=this.getWindow(id);
if(win){
win.close();
}
if(_a7){
Event.stop(_a7);
}
},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(_ad){
this.windows.each(function(d){
d.oldOverflow=d.getContent().getStyle("overflow")||"auto";
d.getContent().setStyle({overflow:"hidden"});
});
if(_ad&&_ad.oldOverflow){
_ad.getContent().setStyle({overflow:_ad.oldOverflow});
}
},resetOverflow:function(){
this.windows.each(function(d){
if(d.oldOverflow){
d.getContent().setStyle({overflow:d.oldOverflow});
}
});
},updateZindex:function(_b0,win){
if(_b0>this.maxZIndex){
this.maxZIndex=_b0;
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(_b2,_b3){
if(_b2&&typeof _b2!="string"){
Dialog._runAjaxRequest(_b2,_b3,Dialog.confirm);
return;
}
_b2=_b2||"";
_b3=_b3||{};
var _b4=_b3.okLabel?_b3.okLabel:"Ok";
var _b5=_b3.cancelLabel?_b3.cancelLabel:"Cancel";
_b3=Object.extend(_b3,_b3.windowParameters||{});
_b3.windowParameters=_b3.windowParameters||{};
_b3.className=_b3.className||"alert";
var _b6="class ='"+(_b3.buttonClass?_b3.buttonClass+" ":"")+" ok_button'";
var _b7="class ='"+(_b3.buttonClass?_b3.buttonClass+" ":"")+" cancel_button'";
if(_b3.buttonType=="div"){
MyButton="<div onclick='Dialog.okCallback();' "+_b6+">"+_b4+"</div>";
}else{
MyButton="<input type='button' value='"+_b4+"' onclick='Dialog.okCallback();' "+_b6+"/>";
}
var _b8="      <div class='"+_b3.className+"_message'>"+_b8+"</div>        <div class='"+_b3.className+"_buttons'>          "+MyButton+"          <input type='button' value='"+_b5+"' onclick='Dialog.cancelCallback()' "+_b7+"/>        </div>    ";
return this._openDialog(_b8,_b3);
},alert:function(_b9,_ba){
if(_b9&&typeof _b9!="string"){
Dialog._runAjaxRequest(_b9,_ba,Dialog.alert);
return;
}
_b9=_b9||"";
_ba=_ba||{};
var _bb=_ba.okLabel?_ba.okLabel:"Ok";
_ba=Object.extend(_ba,_ba.windowParameters||{});
_ba.windowParameters=_ba.windowParameters||{};
_ba.className=_ba.className||"alert";
var _bc="class ='"+(_ba.buttonClass?_ba.buttonClass+" ":"")+" ok_button'";
if(_ba.buttonType=="div"){
MyButton="<div onclick='Dialog.okCallback()' "+_bc+">"+_bb+"</div>";
}else{
MyButton="<input type='button' value='"+_bb+"' onclick='Dialog.okCallback()' "+_bc+"/>";
}
var _bd="      <div class='"+_ba.className+"_message'>"+_bd+"</div>        <div class='"+_ba.className+"_buttons'>          "+MyButton+"        </div>";
return this._openDialog(_bd,_ba);
},info:function(_be,_bf){
if(_be&&typeof _be!="string"){
Dialog._runAjaxRequest(_be,_bf,Dialog.info);
return;
}
_be=_be||"";
_bf=_bf||{};
_bf=Object.extend(_bf,_bf.windowParameters||{});
_bf.windowParameters=_bf.windowParameters||{};
_bf.className=_bf.className||"alert";
var _c0="<div id='modal_dialog_message' class='"+_bf.className+"_message'>"+_c0+"</div>";
if(_bf.showProgress){
_c0+="<div id='modal_dialog_progress' class='"+_bf.className+"_progress'>  </div>";
}
_bf.ok=null;
_bf.cancel=null;
return this._openDialog(_c0,_bf);
},setInfoMessage:function(_c1){
$("modal_dialog_message").update(_c1);
},closeInfo:function(){
Windows.close(this.dialogId);
},_openDialog:function(_c2,_c3){
var _c4=_c3.className;
if(!_c3.height&&!_c3.width){
_c3.width=WindowUtilities.getPageSize(_c3.options.parent||document.body).pageWidth/2;
}
if(_c3.id){
this.dialogId=_c3.id;
}else{
var t=new Date();
this.dialogId="modal_dialog_"+t.getTime();
_c3.id=this.dialogId;
}
if(!_c3.height||!_c3.width){
var _c6=WindowUtilities._computeSize(_c2,this.dialogId,_c3.width,_c3.height,5,_c4);
if(_c3.height){
_c3.width=_c6+5;
}else{
_c3.height=_c6+5;
}
}
_c3.effectOptions=_c3.effectOptions;
_c3.resizable=_c3.resizable||false;
_c3.minimizable=_c3.minimizable||false;
_c3.maximizable=_c3.maximizable||false;
_c3.draggable=_c3.draggable||false;
_c3.closable=_c3.closable||false;
var win=new Window(_c3);
win.getContent().innerHTML=_c2;
win.showCenter(true,_c3.top,_c3.left);
win.setDestroyOnClose();
win.cancelCallback=_c3.onCancel||_c3.cancel;
win.okCallback=_c3.onOk||_c3.ok;
return win;
},_getAjaxContent:function(_c8){
Dialog.callFunc(_c8.responseText,Dialog.parameters);
},_runAjaxRequest:function(_c9,_ca,_cb){
if(_c9.options==null){
_c9.options={};
}
Dialog.onCompleteFunc=_c9.options.onComplete;
Dialog.parameters=_ca;
Dialog.callFunc=_cb;
_c9.options.onComplete=Dialog._getAjaxContent;
new Ajax.Request(_c9.url,_c9.options);
},okCallback:function(){
var win=Windows.focusedWindow;
if(!win.okCallback||win.okCallback(win)){
$$("#"+win.getId()+" input").each(function(_cd){
_cd.onclick=null;
});
win.close();
}
},cancelCallback:function(){
var win=Windows.focusedWindow;
$$("#"+win.getId()+" input").each(function(_cf){
_cf.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(_d0){
var T,L,W,H;
_d0=_d0||document.body;
if(_d0!=document.body){
T=_d0.scrollTop;
L=_d0.scrollLeft;
W=_d0.scrollWidth;
H=_d0.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(_d3){
_d3=_d3||document.body;
var _d4,windowHeight;
var _d5,pageWidth;
if(_d3!=document.body){
_d4=_d3.getWidth();
windowHeight=_d3.getHeight();
pageWidth=_d3.scrollWidth;
_d5=_d3.scrollHeight;
}else{
var _d6,yScroll;
if(window.innerHeight&&window.scrollMaxY){
_d6=document.body.scrollWidth;
yScroll=window.innerHeight+window.scrollMaxY;
}else{
if(document.body.scrollHeight>document.body.offsetHeight){
_d6=document.body.scrollWidth;
yScroll=document.body.scrollHeight;
}else{
_d6=document.body.offsetWidth;
yScroll=document.body.offsetHeight;
}
}
if(self.innerHeight){
_d4=self.innerWidth;
windowHeight=self.innerHeight;
}else{
if(document.documentElement&&document.documentElement.clientHeight){
_d4=document.documentElement.clientWidth;
windowHeight=document.documentElement.clientHeight;
}else{
if(document.body){
_d4=document.body.clientWidth;
windowHeight=document.body.clientHeight;
}
}
}
if(yScroll<windowHeight){
_d5=windowHeight;
}else{
_d5=yScroll;
}
if(_d6<_d4){
pageWidth=_d4;
}else{
pageWidth=_d6;
}
}
return {pageWidth:pageWidth,pageHeight:_d5,windowWidth:_d4,windowHeight:windowHeight};
},disableScreen:function(_d7,_d8,_d9,_da,_db){
WindowUtilities.initLightbox(_d8,_d7,function(){
this._disableScreen(_d7,_d8,_d9,_da);
}.bind(this),_db||document.body);
},_disableScreen:function(_dc,_dd,_de,_df){
var _e0=$(_dd);
var _e1=WindowUtilities.getPageSize(_e0.parentNode);
if(_df&&Prototype.Browser.IE){
WindowUtilities._hideSelect();
WindowUtilities._showSelect(_df);
}
_e0.style.height=(_e1.pageHeight+"px");
_e0.style.display="none";
if(_dd=="overlay_modal"&&Window.hasEffectLib&&Windows.overlayShowEffectOptions){
_e0.overlayOpacity=_de;
new Effect.Appear(_e0,Object.extend({from:0,to:_de},Windows.overlayShowEffectOptions));
}else{
_e0.style.display="block";
}
},enableScreen:function(id){
id=id||"overlay_modal";
var _e3=$(id);
if(_e3){
if(id=="overlay_modal"&&Window.hasEffectLib&&Windows.overlayHideEffectOptions){
new Effect.Fade(_e3,Object.extend({from:_e3.overlayOpacity,to:0},Windows.overlayHideEffectOptions));
}else{
_e3.style.display="none";
_e3.parentNode.removeChild(_e3);
}
if(id!="__invisible__"){
WindowUtilities._showSelect();
}
}
},_hideSelect:function(id){
if(Prototype.Browser.IE){
id=id==null?"":"#"+id+" ";
$$(id+"select").each(function(_e5){
if(!WindowUtilities.isDefined(_e5.oldVisibility)){
_e5.oldVisibility=_e5.style.visibility?_e5.style.visibility:"visible";
_e5.style.visibility="hidden";
}
});
}
},_showSelect:function(id){
if(Prototype.Browser.IE){
id=id==null?"":"#"+id+" ";
$$(id+"select").each(function(_e7){
if(WindowUtilities.isDefined(_e7.oldVisibility)){
try{
_e7.style.visibility=_e7.oldVisibility;
}
catch(e){
_e7.style.visibility="visible";
}
_e7.oldVisibility=null;
}else{
if(_e7.style.visibility){
_e7.style.visibility="visible";
}
}
});
}
},isDefined:function(_e8){
return typeof (_e8)!="undefined"&&_e8!=null;
},initLightbox:function(id,_ea,_eb,_ec){
if($(id)){
Element.setStyle(id,{zIndex:Windows.maxZIndex+1});
Windows.maxZIndex++;
_eb();
}else{
var _ed=document.createElement("div");
_ed.setAttribute("id",id);
_ed.className="overlay_"+_ea;
_ed.style.display="none";
_ed.style.position="absolute";
_ed.style.top="0";
_ed.style.left="0";
_ed.style.zIndex=Windows.maxZIndex+1;
Windows.maxZIndex++;
_ed.style.width="100%";
_ec.insertBefore(_ed,_ec.firstChild);
if(Prototype.Browser.WebKit&&id=="overlay_modal"){
setTimeout(function(){
_eb();
},10);
}else{
_eb();
}
}
},setCookie:function(_ee,_ef){
document.cookie=_ef[0]+"="+escape(_ee)+((_ef[1])?"; expires="+_ef[1].toGMTString():"")+((_ef[2])?"; path="+_ef[2]:"")+((_ef[3])?"; domain="+_ef[3]:"")+((_ef[4])?"; secure":"");
},getCookie:function(_f0){
var dc=document.cookie;
var _f2=_f0+"=";
var _f3=dc.indexOf("; "+_f2);
if(_f3==-1){
_f3=dc.indexOf(_f2);
if(_f3!=0){
return null;
}
}else{
_f3+=2;
}
var end=document.cookie.indexOf(";",_f3);
if(end==-1){
end=dc.length;
}
return unescape(dc.substring(_f3+_f2.length,end));
},_computeSize:function(_f5,id,_f7,_f8,_f9,_fa){
var _fb=document.body;
var _fc=document.createElement("div");
_fc.setAttribute("id",id);
_fc.className=_fa+"_content";
if(_f8){
_fc.style.height=_f8+"px";
}else{
_fc.style.width=_f7+"px";
}
_fc.style.position="absolute";
_fc.style.top="0";
_fc.style.left="0";
_fc.style.display="none";
_fc.innerHTML=_f5;
_fb.insertBefore(_fc,_fb.firstChild);
var _fd;
if(_f8){
_fd=$(_fc).getDimensions().width+_f9;
}else{
_fd=$(_fc).getDimensions().height+_f9;
}
_fb.removeChild(_fc);
return _fd;
}};

