﻿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){
var _16=GetRadWindowManager();
var _17="";
var _18=_16._getStandardPopup("prompt",_10,_17);
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={initialize:function(_1e){
this._initialize();
this._registerAsPageManager();
if(this.get_preserveClientState()){
this.restoreState();
}
},dispose:function(){
var _1f=this.get_preserveClientState();
if(_1f){
this.saveState();
}
this._disposeWindows();
this._windows=null;
Telerik.Web.UI.RadWindowManager.callBaseMethod(this,"dispose");
},open:function(url,_21){
var _22=this.getWindowByName(_21);
if(!_22){
if(!_21){
_21=this.get_id()+(new Date()-100);
}
_22=this._createWindow(_21);
}
if(url){
_22.setUrl(url);
}
_22.show();
return _22;
},getActiveWindow:function(){
return Telerik.Web.UI.RadWindowController.get_activeWindow();
},getWindowById:function(id){
var _24=this.get_windows();
for(var i=0;i<_24.length;i++){
var _26=_24[i];
if(id==_26.get_id()){
return _26;
}
}
return null;
},getWindowByName:function(_27){
var _28=this.get_windows();
for(var i=0;i<_28.length;i++){
var _2a=_28[i];
if(_27==_2a.get_name()){
return _2a;
}
}
return null;
},_initialize:function(){
var _2b=this._windowIDs;
for(var i=0;i<_2b.length;i++){
var _2d=_2b[i];
var _2e=$find(_2d);
if(!_2e){
continue;
}
_2e.set_windowManager(this);
this._windows[this._windows.length]=_2e;
}
},_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(_31,_32){
var wnd=this.clone(_31,_32);
this._windows[this._windows.length]=wnd;
return wnd;
},_replaceLocalization:function(_34,_35){
var _36=/##LOC\[(.*?)\]##/;
while(_34.match(_36)){
var _37=_35[RegExp.$1]?_35[RegExp.$1]:"";
_34=_34.replace(_36,_37);
}
return _34;
},_getStandardPopup:function(_38,_39,_3a){
var _3b=this._createWindow(_38,false);
_3b.set_destroyOnClose(true);
_3b.set_modal(true);
var div=document.getElementById(this.get_id()+"_"+_38.toLowerCase()+"template");
var _3d=this._stringFormat(div.innerHTML,_3b.get_id(),_39,_3a);
var _3e={"OK":"OK","Cancel":"Cancel","Yes":"Yes","No":"No"};
_3d=this._replaceLocalization(_3d,_3e);
var _3f=document.createElement("DIV");
_3f.innerHTML=_3d;
_3b.set_behaviors(Telerik.Web.UI.WindowBehaviors.Close);
_3b.set_visibleStatusbar(false);
_3b.set_contentElement(_3f);
return _3b;
},_stringFormat:function(_40){
for(var i=1;i<arguments.length;i++){
_40=_40.replace(new RegExp("\\{"+(i-1)+"\\}","ig"),arguments[i]);
}
return _40;
},_registerAsPageManager:function(){
var _42=Telerik.Web.UI.WindowManager.Manager;
var _43=this.get_id();
if(_42&&_42.get_id()==_43){
_42.dispose();
Telerik.Web.UI.WindowManager.Manager=null;
}
if(!Telerik.Web.UI.WindowManager.Manager){
Telerik.Web.UI.WindowManager.Manager=this;
}
},saveWindowState:function(_44){
var _45=_44.getWindowBounds();
var _46=(_44.isVisible()||_44.isMinimized())+"@"+_45.width+"@"+_45.height+"@"+_45.x+"@"+_45.y+"@"+_44.isMinimized();
this._setRadWindowCookie(_44.get_id(),_46);
},saveState:function(){
var _47=this.get_windows();
for(i=0;i<_47.length;i++){
var _48=_47[i];
if(_48.isCloned()){
this.saveWindowState(_48);
}
}
},restoreState:function(){
function restoreWindow(_49){
var _4a=oStr.split("@");
if(_4a.length>1){
if("true"==_4a[0]&&!_49.IsVisible()){
_49.Show();
}
window.setTimeout(function(){
if(parseInt(_4a[1])>0){
_49.set_width(_4a[1]);
}
if(parseInt(_4a[2])>0){
_49.set_height(_4a[2]);
}
_49.moveTo(parseInt(_4a[3]),parseInt(_4a[4]));
if("true"==_4a[5]){
_49.minimize();
}
},1);
}
}
var _4b=this.get_windows();
for(i=0;i<_4b.length;i++){
var _4c=_4b[i];
var _4d=this._getRadWindowCookie(_4c.get_id());
if(_4d){
restoreWindow(_4c);
}
}
},_getOnlyCookie:function(){
var _4e="RadWindowCookie";
var _4f=document.cookie.split("; ");
for(var i=0;i<_4f.length;i++){
var _51=_4f[i].split("=");
if(_4e==_51[0]){
return _51[1];
}
}
return null;
},_setRadWindowCookie:function(_52,_53){
_52="["+_52+"]";
var _54=this._getOnlyCookie();
var _55="";
var _56="";
if(_54){
var _57=_54.split(_52);
if(_57&&_57.length>1){
_55=_57[0];
_56=_57[1].substr(_57[1].indexOf("#")+1);
}else{
_56=_54;
}
}
var _58=new Date();
_58.setFullYear(_58.getFullYear()+10);
document.cookie="RadWindowCookie"+"="+(_55+_52+"-"+_53+"#"+_56)+";path=/;expires="+_58.toUTCString()+";";
},_getRadWindowCookie:function(_59){
var _5a=this._getOnlyCookie();
if(!_5a){
return;
}
var _5b=null;
_59="["+_59+"]";
var _5c=_5a.indexOf(_59);
if(_5c>=0){
var _5d=_5c+_59.length+1;
_5b=_5a.substring(_5d,_5a.indexOf("#",_5d));
}
return _5b;
},cascade:function(){
var _5e=40;
var _5f=40;
var _60=this._getWindowsSortedByZindex();
for(var i=0;i<_60.length;i++){
var _62=_60[i];
if(!_62.isClosed()&&_62.isVisible()){
var _63=_62.restore();
_62.moveTo(_5e,_5f);
_62.setActive(true);
_5e+=25;
_5f+=25;
}
}
},tile:function(){
var _64=this._getWindowsSortedByZindex();
var _65=0;
for(var i=0;i<_64.length;i++){
var _67=_64[i];
if(!_67.isClosed()&&_67.isVisible()){
_65++;
}
}
var _68=5;
var _69=0;
var _6a=1;
if(_65<=_68){
_69=_65;
}else{
var i=2;
while((_65*i)<(_68*(i+1))){
i++;
if(i>6){
break;
}
}
_6a=i;
_69=Math.ceil(_65/_6a);
}
var _6b=TelerikCommonScripts.getClientBounds();
var _6c=Math.floor(_6b.width/_69);
var _6d=Math.floor(_6b.height/_6a);
var _6e=document.documentElement.scrollLeft||document.body.scrollLeft;
var top=document.documentElement.scrollTop||document.body.scrollTop;
var _70=0;
for(var i=0;i<_64.length;i++){
var _67=_64[i];
if(!_67.isClosed()&&_67.isVisible()){
_70++;
if((_70-1)%(_69)==0&&_70>_69){
top+=_6d;
_6e=document.documentElement.scrollLeft||document.body.scrollLeft;
}
_67.restore();
_67.moveTo(_6e,top);
_67.setSize(_6c,_6d);
_6e+=_6c;
}
}
},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 _71=this._windows.concat([]);
var _72=function(_73,_74){
var z1=_73.get_zindex();
var z2=_74.get_zindex();
if(z1==z2){
return 0;
}
return (z1<z2?-1:1);
};
return _71.sort(_72);
},_executeAll:function(_77){
if(!this._windows){
return;
}
var _78=this._windows.concat([]);
for(var i=0;i<_78.length;i++){
_78[i][_77]();
}
},_executeActiveWindow:function(_7a){
var _7b=this.getActiveWindow();
if(_7b&&"function"==typeof (_7b[_7a])){
_7b[_7a]();
}
},get_preserveClientState:function(){
return this._preserveClientState;
},set_preserveClientState:function(_7c){
if(this._preserveClientState!=_7c){
this._preserveClientState=_7c;
}
},set_windowControls:function(_7d){
this._windowIDs=eval(_7d);
this._disposeWindows();
},get_windowControls:function(){
},get_windows:function(){
return this._windows;
}};
$telerikCommon.makeCompatible(Telerik.Web.UI.RadWindowManager);
Telerik.Web.UI.RadWindowManager.registerClass("Telerik.Web.UI.RadWindowManager",Telerik.Web.UI.RadWindow);


if(typeof(Sys)!=='undefined')Sys.Application.notifyScriptLoaded();