﻿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={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()+this._getUniqueId();
}
_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();
if(!_28){
return null;
}
for(var i=0;i<_28.length;i++){
var _2a=_28[i];
if(_27==_2a.get_name()){
return _2a;
}
}
return null;
},removeWindow:function(_2b){
if(!_2b){
return;
}
var w=this.getWindowByName(_2b.get_name());
var _2d=this.get_windows();
if(w){
Array.remove(_2d,w);
}
},_getUniqueId:function(){
return ""+(new Date()-100);
},_initialize:function(){
var _2e=this._windowIDs;
for(var i=0;i<_2e.length;i++){
var _30=_2e[i];
var _31=$find(_30);
if(!_31){
continue;
}
_31.set_windowManager(this);
this._windows[this._windows.length]=_31;
}
},_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(_34,_35){
var wnd=this.clone(_34,_35);
this._windows[this._windows.length]=wnd;
wnd.set_windowManager(this);
return wnd;
},_replaceLocalization:function(_37,_38){
var _39=/##LOC\[(.*?)\]##/;
while(_37.match(_39)){
var _3a=_38[RegExp.$1]?_38[RegExp.$1]:"";
_37=_37.replace(_39,_3a);
}
return _37;
},_getStandardPopup:function(_3b,_3c,_3d){
var _3e=this._createWindow(_3b+this._getUniqueId(),false);
_3e.set_destroyOnClose(true);
_3e.set_modal(true);
var div=document.getElementById(this.get_id()+"_"+_3b.toLowerCase()+"template");
var _40=this._stringFormat(div.innerHTML,_3e.get_id(),_3c,_3d?_3d:"");
_40=this._replaceLocalization(_40,Telerik.Web.UI.RadWindowUtils.Localization);
var _41=document.createElement("DIV");
_41.innerHTML=_40;
_3e.set_behaviors(Telerik.Web.UI.WindowBehaviors.Close);
_3e.set_visibleStatusbar(false);
_3e.set_contentElement(_41);
return _3e;
},_stringFormat:function(_42){
for(var i=1;i<arguments.length;i++){
_42=_42.replace(new RegExp("\\{"+(i-1)+"\\}","ig"),arguments[i]);
}
return _42;
},_registerAsPageManager:function(){
var _44=Telerik.Web.UI.WindowManager.Manager;
var _45=this.get_id();
if(_44&&_44.get_id()==_45){
_44.dispose();
Telerik.Web.UI.WindowManager.Manager=null;
}
if(!Telerik.Web.UI.WindowManager.Manager){
Telerik.Web.UI.WindowManager.Manager=this;
}
},saveWindowState:function(_46){
if(!_46||!_46.isCreated()){
return;
}
var _47=_46.getWindowBounds();
var _48=(_46.isVisible()||_46.isMinimized())+"@"+_47.width+"@"+_47.height+"@"+_47.x+"@"+_47.y+"@"+_46.isMinimized();
this._setRadWindowCookie(_46.get_id(),_48);
},saveState:function(){
var _49=this.get_windows();
for(i=0;i<_49.length;i++){
var _4a=_49[i];
if(_4a.isCloned()){
this.saveWindowState(_4a);
}
}
},restoreState:function(){
function restoreWindow(_4b,_4c){
var _4d=_4c.split("@");
if(_4d.length>1){
if("true"==_4d[0]&&!_4b.IsVisible()){
_4b.Show();
}
window.setTimeout(function(){
if(parseInt(_4d[1])>0){
_4b.set_width(_4d[1]);
}
if(parseInt(_4d[2])>0){
_4b.set_height(_4d[2]);
}
_4b.moveTo(parseInt(_4d[3]),parseInt(_4d[4]));
if("true"==_4d[5]){
_4b.minimize();
}
},1);
}
}
var _4e=this.get_windows();
for(i=0;i<_4e.length;i++){
var _4f=_4e[i];
var _50=this._getRadWindowCookie(_4f.get_id());
if(_50){
restoreWindow(_4f,_50);
}
}
},_getOnlyCookie:function(){
var _51="RadWindowCookie";
var _52=document.cookie.split("; ");
for(var i=0;i<_52.length;i++){
var _54=_52[i].split("=");
if(_51==_54[0]){
return _54[1];
}
}
return null;
},_setRadWindowCookie:function(_55,_56){
_55="["+_55+"]";
var _57=this._getOnlyCookie();
var _58="";
var _59="";
if(_57){
var _5a=_57.split(_55);
if(_5a&&_5a.length>1){
_58=_5a[0];
_59=_5a[1].substr(_5a[1].indexOf("#")+1);
}else{
_59=_57;
}
}
var _5b=new Date();
_5b.setFullYear(_5b.getFullYear()+10);
document.cookie="RadWindowCookie"+"="+(_58+_55+"-"+_56+"#"+_59)+";path=/;expires="+_5b.toUTCString()+";";
},_getRadWindowCookie:function(_5c){
var _5d=this._getOnlyCookie();
if(!_5d){
return;
}
var _5e=null;
_5c="["+_5c+"]";
var _5f=_5d.indexOf(_5c);
if(_5f>=0){
var _60=_5f+_5c.length+1;
_5e=_5d.substring(_60,_5d.indexOf("#",_60));
}
return _5e;
},cascade:function(){
var _61=40;
var _62=40;
var _63=this._getWindowsSortedByZindex();
for(var i=0;i<_63.length;i++){
var _65=_63[i];
if(!_65.isClosed()&&_65.isVisible()){
var _66=_65.restore();
_65.moveTo(_61,_62);
_65.setActive(true);
_61+=25;
_62+=25;
}
}
},tile:function(){
var _67=this._getWindowsSortedByZindex();
var _68=0;
for(var i=0;i<_67.length;i++){
var _6a=_67[i];
if(!_6a.isClosed()&&_6a.isVisible()){
_68++;
}
}
var _6b=5;
var _6c=0;
var _6d=1;
if(_68<=_6b){
_6c=_68;
}else{
var i=2;
while((_68*i)<(_6b*(i+1))){
i++;
if(i>6){
break;
}
}
_6d=i;
_6c=Math.ceil(_68/_6d);
}
var _6e=$telerik.getClientBounds();
var _6f=Math.floor(_6e.width/_6c);
var _70=Math.floor(_6e.height/_6d);
var _71=document.documentElement.scrollLeft||document.body.scrollLeft;
var top=document.documentElement.scrollTop||document.body.scrollTop;
var _73=0;
for(var i=0;i<_67.length;i++){
var _6a=_67[i];
if(!_6a.isClosed()&&_6a.isVisible()){
_73++;
if((_73-1)%(_6c)==0&&_73>_6c){
top+=_70;
_71=document.documentElement.scrollLeft||document.body.scrollLeft;
}
_6a.restore();
_6a.moveTo(_71,top);
_6a.setSize(_6f,_70);
_71+=_6f;
}
}
},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 _74=this._windows.concat([]);
var _75=function(_76,_77){
var z1=_76.get_zindex();
var z2=_77.get_zindex();
if(z1==z2){
return 0;
}
return (z1<z2?-1:1);
};
return _74.sort(_75);
},_executeAll:function(_7a){
if(!this._windows){
return;
}
var _7b=this._windows.concat([]);
for(var i=0;i<_7b.length;i++){
_7b[i][_7a]();
}
},_executeActiveWindow:function(_7d){
var _7e=this.getActiveWindow();
if(_7e&&"function"==typeof (_7e[_7d])){
_7e[_7d]();
}
},get_preserveClientState:function(){
return this._preserveClientState;
},set_preserveClientState:function(_7f){
if(this._preserveClientState!=_7f){
this._preserveClientState=_7f;
}
},set_windowControls:function(_80){
this._windowIDs=eval(_80);
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);


if(typeof(Sys)!=='undefined')Sys.Application.notifyScriptLoaded();