Type.registerNamespace("Telerik.Web.UI");
Type.registerNamespace("Telerik.Web.UI.WindowManager");
function GetRadWindowManager(){
return Telerik.Web.UI.WindowManager.Manager;
}
window.radalert=function(_1,_2,_3,_4){
var _5=GetRadWindowManager();
var _6=_5._getStandardPopup("alert",_1);
if(typeof (_4)!="undefined"){
_6.set_title(_4);
}
_6.setSize(_2?_2:280,_3?_3:200);
_6.show();
_6.center();
return _6;
};
window.radconfirm=function(_7,_8,_9,_a,_b,_c){
var _d=GetRadWindowManager();
var _e=_d._getStandardPopup("confirm",_7);
if(typeof (_c)!="undefined"){
_e.set_title(_c);
}
_e.setSize(_9?_9:280,_a?_a:200);
_e.callBack=function(_f){
if(_8){
_8(_f);
}
_e.close();
_e.callBack=null;
};
_e.show();
_e.center();
return _e;
};
window.radprompt=function(_10,_11,_12,_13,_14,_15,_16){
var _17=GetRadWindowManager();
var _18=_17._getStandardPopup("prompt",_10,_16);
if(typeof (_15)!="undefined"){
_18.set_title(_15);
}
_18.setSize(_12?_12:280,_13?_13:200);
_18.callBack=function(_19){
if(_11){
_11(_19);
}
_18.close();
_18.callBack=null;
};
_18.show();
_18.center();
return _18;
};
window.radopen=function(url,_1b){
var _1c=GetRadWindowManager();
return _1c.open(url,_1b);
};
Telerik.Web.UI.RadWindowManager=function(_1d){
Telerik.Web.UI.RadWindowManager.initializeBase(this,[_1d]);
this._windowIDs=[];
this._windows=[];
this._preserveClientState=false;
this.Open=this.open;
this.GetWindowByName=this.getWindowByName;
this.GetWindowById=this.getWindowById;
this.GetActiveWindow=this.getActiveWindow;
this.GetWindowObjects=this.get_windows;
this.GetWindows=this.get_windows;
this.Cascade=this.cascade;
this.Tile=this.tile;
this.RestoreAll=this.restoreAll;
this.MaximizeAll=this.maximizeAll;
this.MinimizeAll=this.minimizeAll;
this.ShowAll=this.showAll;
this.CloseAll=this.closeAll;
this.CloseActiveWindow=this.closeActiveWindow;
this.MinimizeActiveWindow=this.minimizeActiveWindow;
this.RestoreActiveWindow=this.restoreActiveWindow;
};
Telerik.Web.UI.RadWindowManager.prototype={get_zIndex:function(){
return Telerik.Web.UI.RadWindowUtils._zIndex;
},set_zIndex:function(_1e){
var _1f=parseInt(_1e);
if(isNaN(_1e)){
return;
}
Telerik.Web.UI.RadWindowUtils._zIndex=_1e;
},initialize:function(_20){
this._initialize();
this._registerAsPageManager();
if(this.get_preserveClientState()){
this.restoreState();
}
},dispose:function(){
var _21=this.get_preserveClientState();
if(_21){
this.saveState();
}
this._disposeWindows();
this._windows=null;
Telerik.Web.UI.RadWindowManager.callBaseMethod(this,"dispose");
},open:function(url,_23){
var _24=this.getWindowByName(_23);
if(!_24){
if(!_23){
_23=this.get_id()+this._getUniqueId();
}
_24=this._createWindow(_23);
}
if(url){
_24.setUrl(url);
}
_24.show();
return _24;
},getActiveWindow:function(){
return Telerik.Web.UI.RadWindowController.get_activeWindow();
},getWindowById:function(id){
var _26=this.get_windows();
for(var i=0;i<_26.length;i++){
var _28=_26[i];
if(id==_28.get_id()){
return _28;
}
}
return null;
},getWindowByName:function(_29){
var _2a=this.get_windows();
if(!_2a){
return null;
}
for(var i=0;i<_2a.length;i++){
var _2c=_2a[i];
if(_29==_2c.get_name()){
return _2c;
}
}
return null;
},removeWindow:function(_2d){
if(!_2d){
return;
}
var w=this.getWindowByName(_2d.get_name());
var _2f=this.get_windows();
if(w){
Array.remove(_2f,w);
}
},_getUniqueId:function(){
return ""+(new Date()-100);
},_initialize:function(){
var _30=this._windowIDs;
for(var i=0;i<_30.length;i++){
var _32=_30[i];
var _33=$find(_32);
if(!_33){
continue;
}
_33.set_windowManager(this);
this._windows[this._windows.length]=_33;
}
},_disposeWindows:function(){
for(var i=0;i<this._windows.length;i++){
var t=this._windows[i];
if(t.isCloned()){
t.dispose();
}
}
this._windows=[];
},_createWindow:function(_36,_37){
var wnd=this.clone(_36,_37);
this._windows[this._windows.length]=wnd;
wnd.set_windowManager(this);
return wnd;
},_replaceLocalization:function(_39,_3a){
var _3b=/##LOC\[(.*?)\]##/;
while(_39.match(_3b)){
var _3c=_3a[RegExp.$1]?_3a[RegExp.$1]:"";
_39=_39.replace(_3b,_3c);
}
return _39;
},_getStandardPopup:function(_3d,_3e,_3f){
var _40=this._createWindow(_3d+this._getUniqueId(),false);
_40.set_destroyOnClose(true);
_40.set_modal(true);
var div=document.getElementById(this.get_id()+"_"+_3d.toLowerCase()+"template");
var _42=this._stringFormat(div.innerHTML,_40.get_id(),_3e,_3f?_3f:"");
_42=this._replaceLocalization(_42,Telerik.Web.UI.RadWindowUtils.Localization);
var _43=document.createElement("DIV");
_43.innerHTML=_42;
_40.set_behaviors(Telerik.Web.UI.WindowBehaviors.Close);
_40.set_visibleStatusbar(false);
_40.set_contentElement(_43);
return _40;
},_stringFormat:function(_44){
for(var i=1;i<arguments.length;i++){
_44=_44.replace(new RegExp("\\{"+(i-1)+"\\}","ig"),arguments[i]);
}
return _44;
},_registerAsPageManager:function(){
var _46=Telerik.Web.UI.WindowManager.Manager;
var _47=this.get_id();
if(_46&&_46.get_id()==_47){
_46.dispose();
Telerik.Web.UI.WindowManager.Manager=null;
}
if(!Telerik.Web.UI.WindowManager.Manager){
Telerik.Web.UI.WindowManager.Manager=this;
}
},saveWindowState:function(_48){
if(!_48||!_48.isCreated()){
return;
}
var _49=_48.getWindowBounds();
var _4a=(_48.isVisible()||_48.isMinimized())+"@"+_49.width+"@"+_49.height+"@"+_49.x+"@"+_49.y+"@"+_48.isMinimized();
this._setRadWindowCookie(_48.get_id(),_4a);
},saveState:function(){
var _4b=this.get_windows();
for(i=0;i<_4b.length;i++){
var _4c=_4b[i];
if(_4c.isCloned()){
this.saveWindowState(_4c);
}
}
},restoreState:function(){
function restoreWindow(_4d,_4e){
var _4f=_4e.split("@");
if(_4f.length>1){
if("true"==_4f[0]&&!_4d.isVisible()){
_4d.show();
}
window.setTimeout(function(){
if(parseInt(_4f[1])>0){
_4d.set_width(_4f[1]);
}
if(parseInt(_4f[2])>0){
_4d.set_height(_4f[2]);
}
if("true"==_4f[0]){
_4d.moveTo(parseInt(_4f[3]),parseInt(_4f[4]));
}
if("true"==_4f[5]){
_4d.minimize();
}
},1);
}
}
var _50=this.get_windows();
for(i=0;i<_50.length;i++){
var _51=_50[i];
var _52=this._getRadWindowCookie(_51.get_id());
if(_52){
restoreWindow(_51,_52);
}
}
},_getOnlyCookie:function(){
var _53="RadWindowCookie";
var _54=document.cookie.split("; ");
for(var i=0;i<_54.length;i++){
var _56=_54[i].split("=");
if(_53==_56[0]){
return _56[1];
}
}
return null;
},_setRadWindowCookie:function(_57,_58){
_57="["+_57+"]";
var _59=this._getOnlyCookie();
var _5a="";
var _5b="";
if(_59){
var _5c=_59.split(_57);
if(_5c&&_5c.length>1){
_5a=_5c[0];
_5b=_5c[1].substr(_5c[1].indexOf("#")+1);
}else{
_5b=_59;
}
}
var _5d=new Date();
_5d.setFullYear(_5d.getFullYear()+10);
document.cookie="RadWindowCookie"+"="+(_5a+_57+"-"+_58+"#"+_5b)+";path=/;expires="+_5d.toUTCString()+";";
},_getRadWindowCookie:function(_5e){
var _5f=this._getOnlyCookie();
if(!_5f){
return;
}
var _60=null;
_5e="["+_5e+"]";
var _61=_5f.indexOf(_5e);
if(_61>=0){
var _62=_61+_5e.length+1;
_60=_5f.substring(_62,_5f.indexOf("#",_62));
}
return _60;
},cascade:function(){
var _63=40;
var _64=40;
var _65=this._getWindowsSortedByZindex();
for(var i=0;i<_65.length;i++){
var _67=_65[i];
if(!_67.isClosed()&&_67.isVisible()){
var _68=_67.restore();
_67.moveTo(_63,_64);
_67.setActive(true);
_63+=25;
_64+=25;
}
}
},tile:function(){
var _69=this._getWindowsSortedByZindex();
var _6a=0;
for(var i=0;i<_69.length;i++){
var _6c=_69[i];
if(!_6c.isClosed()&&_6c.isVisible()){
_6a++;
}
}
var _6d=5;
var _6e=0;
var _6f=1;
if(_6a<=_6d){
_6e=_6a;
}else{
var i=2;
while((_6a*i)<(_6d*(i+1))){
i++;
if(i>6){
break;
}
}
_6f=i;
_6e=Math.ceil(_6a/_6f);
}
var _70=$telerik.getClientBounds();
var _71=Math.floor(_70.width/_6e);
var _72=Math.floor(_70.height/_6f);
var _73=document.documentElement.scrollLeft||document.body.scrollLeft;
var top=document.documentElement.scrollTop||document.body.scrollTop;
var _75=0;
for(var i=0;i<_69.length;i++){
var _6c=_69[i];
if(!_6c.isClosed()&&_6c.isVisible()){
_75++;
if((_75-1)%(_6e)==0&&_75>_6e){
top+=_72;
_73=document.documentElement.scrollLeft||document.body.scrollLeft;
}
_6c.restore();
_6c.moveTo(_73,top);
_6c.setSize(_71,_72);
_73+=_71;
}
}
},closeActiveWindow:function(){
this._executeActiveWindow("close");
},minimizeActiveWindow:function(){
this._executeActiveWindow("minimize");
},restoreActiveWindow:function(){
this._executeActiveWindow("restore");
},closeAll:function(){
this._executeAll("close");
},showAll:function(){
this._executeAll("show");
},minimizeAll:function(){
this._executeAll("minimize");
},maximizeAll:function(){
this._executeAll("maximize");
},restoreAll:function(){
this._executeAll("restore");
},_getWindowsSortedByZindex:function(){
var _76=this._windows.concat([]);
var _77=function(_78,_79){
var z1=_78.get_zindex();
var z2=_79.get_zindex();
if(z1==z2){
return 0;
}
return (z1<z2?-1:1);
};
return _76.sort(_77);
},_executeAll:function(_7c){
if(!this._windows){
return;
}
var _7d=this._windows.concat([]);
for(var i=0;i<_7d.length;i++){
_7d[i][_7c]();
}
},_executeActiveWindow:function(_7f){
var _80=this.getActiveWindow();
if(_80&&"function"==typeof (_80[_7f])){
_80[_7f]();
}
},get_preserveClientState:function(){
return this._preserveClientState;
},set_preserveClientState:function(_81){
if(this._preserveClientState!=_81){
this._preserveClientState=_81;
}
},set_windowControls:function(_82){
this._windowIDs=eval(_82);
this._disposeWindows();
},get_windowControls:function(){
},get_windows:function(){
return this._windows;
}};
$telerik.makeCompatible(Telerik.Web.UI.RadWindowManager);
Telerik.Web.UI.RadWindowManager.registerClass("Telerik.Web.UI.RadWindowManager",Telerik.Web.UI.RadWindow);

