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