﻿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();
if(_16&&$telerik.isIE){
var _1a=_18.get_popupElement().getElementsByTagName("INPUT")[0];
if(_1a){
_1a.value=_16;
}
}
return _18;
};
window.radopen=function(url,_1c){
var _1d=GetRadWindowManager();
return _1d.open(url,_1c);
};
Telerik.Web.UI.RadWindowManager=function(_1e){
Telerik.Web.UI.RadWindowManager.initializeBase(this,[_1e]);
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(_1f){
var _20=parseInt(_1f);
if(isNaN(_1f)){
return;
}
Telerik.Web.UI.RadWindowUtils._zIndex=_1f;
},initialize:function(_21){
try{
var _22=this.get_element().style.zIndex;
if(_22){
this.set_zIndex(_22);
}
}
catch(e){
}
this._initialize();
this._registerAsPageManager();
if(this.get_preserveClientState()){
this.restoreState();
}
},dispose:function(){
var _23=this.get_preserveClientState();
if(_23){
this.saveState();
}
this._disposeWindows();
this._windows=null;
Telerik.Web.UI.RadWindowManager.callBaseMethod(this,"dispose");
},open:function(url,_25){
var _26=this.getWindowByName(_25);
if(!_26){
if(!_25){
_25=this.get_id()+this._getUniqueId();
}
_26=this._createWindow(_25);
}
if(url){
_26.setUrl(url);
}
_26.show();
return _26;
},getActiveWindow:function(){
return Telerik.Web.UI.RadWindowController.get_activeWindow();
},getWindowById:function(id){
var _28=this.get_windows();
for(var i=0;i<_28.length;i++){
var _2a=_28[i];
if(id==_2a.get_id()){
return _2a;
}
}
return null;
},getWindowByName:function(_2b){
var _2c=this.get_windows();
if(!_2c){
return null;
}
for(var i=0;i<_2c.length;i++){
var _2e=_2c[i];
if(_2b==_2e.get_name()){
return _2e;
}
}
return null;
},removeWindow:function(_2f){
if(!_2f){
return;
}
var w=this.getWindowByName(_2f.get_name());
var _31=this.get_windows();
if(w){
Array.remove(_31,w);
}
},_getUniqueId:function(){
return ""+(new Date()-100);
},_initialize:function(){
var _32=this._windowIDs;
for(var i=0;i<_32.length;i++){
var _34=_32[i];
var _35=$find(_34);
if(!_35){
continue;
}
_35.set_windowManager(this);
this._windows[this._windows.length]=_35;
}
},_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(_38,_39){
var wnd=this.clone(_38,_39);
this._windows[this._windows.length]=wnd;
wnd.set_windowManager(this);
return wnd;
},_replaceLocalization:function(_3b,_3c){
var _3d=/##LOC\[(.*?)\]##/;
while(_3b.match(_3d)){
var _3e=_3c[RegExp.$1]?_3c[RegExp.$1]:"";
_3b=_3b.replace(_3d,_3e);
}
return _3b;
},_getStandardPopup:function(_3f,_40,_41){
var _42=this._createWindow(_3f+this._getUniqueId(),false);
_42.set_destroyOnClose(true);
_42.set_modal(true);
var div=document.getElementById(this.get_id()+"_"+_3f.toLowerCase()+"template");
var _44=this._stringFormat(div.innerHTML,_42.get_id(),_40,_41?_41:"");
_44=this._replaceLocalization(_44,Telerik.Web.UI.RadWindowUtils.Localization);
var _45=document.createElement("DIV");
_45.innerHTML=_44;
_42.set_behaviors(Telerik.Web.UI.WindowBehaviors.Close);
_42.set_visibleStatusbar(false);
_42.set_contentElement(_45);
var _46=_42.get_contentElement().getElementsByTagName("INPUT")[0];
if(!_46){
_46=_42.get_contentElement().getElementsByTagName("A")[0];
}
if(_46&&_46.focus){
window.setTimeout(function(){
if(_46.setActive){
_46.setActive();
}else{
_46.focus();
}
},0);
}
return _42;
},_stringFormat:function(_47){
for(var i=1;i<arguments.length;i++){
_47=_47.replace(new RegExp("\\{"+(i-1)+"\\}","ig"),arguments[i]);
}
return _47;
},_registerAsPageManager:function(){
var _49=Telerik.Web.UI.WindowManager.Manager;
var _4a=this.get_id();
if(_49&&_49.get_id()==_4a){
_49.dispose();
Telerik.Web.UI.WindowManager.Manager=null;
}
if(_49&&!_49.get_id()){
Telerik.Web.UI.WindowManager.Manager=null;
}
if(!Telerik.Web.UI.WindowManager.Manager){
Telerik.Web.UI.WindowManager.Manager=this;
}
},saveWindowState:function(_4b){
if(!_4b||!_4b.isCreated()){
return;
}
var _4c=_4b.getWindowBounds();
var _4d=(_4b.isVisible()||_4b.isMinimized())+"@"+_4c.width+"@"+_4c.height+"@"+_4c.x+"@"+_4c.y+"@"+_4b.isMinimized();
this._setRadWindowCookie(_4b.get_id(),_4d);
},saveState:function(){
var _4e=this.get_windows();
for(i=0;i<_4e.length;i++){
var _4f=_4e[i];
if(_4f.isCloned()){
this.saveWindowState(_4f);
}
}
},restoreState:function(){
function restoreWindow(_50,_51){
var _52=_51.split("@");
if(_52.length>1){
if("true"==_52[0]&&!_50.isVisible()){
_50.show();
}
window.setTimeout(function(){
if(parseInt(_52[1])>0){
_50.set_width(_52[1]);
}
if(parseInt(_52[2])>0){
_50.set_height(_52[2]);
}
if("true"==_52[0]){
_50.moveTo(parseInt(_52[3]),parseInt(_52[4]));
}
if("true"==_52[5]){
_50.minimize();
}
},1);
}
}
var _53=this.get_windows();
for(i=0;i<_53.length;i++){
var _54=_53[i];
var _55=this._getRadWindowCookie(_54.get_id());
if(_55){
restoreWindow(_54,_55);
}
}
},_getOnlyCookie:function(){
var _56="RadWindowCookie";
var _57=document.cookie.split("; ");
for(var i=0;i<_57.length;i++){
var _59=_57[i].split("=");
if(_56==_59[0]){
return _59[1];
}
}
return null;
},_setRadWindowCookie:function(_5a,_5b){
_5a="["+_5a+"]";
var _5c=this._getOnlyCookie();
var _5d="";
var _5e="";
if(_5c){
var _5f=_5c.split(_5a);
if(_5f&&_5f.length>1){
_5d=_5f[0];
_5e=_5f[1].substr(_5f[1].indexOf("#")+1);
}else{
_5e=_5c;
}
}
var _60=new Date();
_60.setFullYear(_60.getFullYear()+10);
document.cookie="RadWindowCookie"+"="+(_5d+_5a+"-"+_5b+"#"+_5e)+";path=/;expires="+_60.toUTCString()+";";
},_getRadWindowCookie:function(_61){
var _62=this._getOnlyCookie();
if(!_62){
return;
}
var _63=null;
_61="["+_61+"]";
var _64=_62.indexOf(_61);
if(_64>=0){
var _65=_64+_61.length+1;
_63=_62.substring(_65,_62.indexOf("#",_65));
}
return _63;
},cascade:function(){
var _66=40;
var _67=40;
var _68=this._getWindowsSortedByZindex();
for(var i=0;i<_68.length;i++){
var _6a=_68[i];
if(!_6a.isClosed()&&_6a.isVisible()){
var _6b=_6a.restore();
_6a.moveTo(_66,_67);
_6a.setActive(true);
_66+=25;
_67+=25;
}
}
},tile:function(){
var _6c=this._getWindowsSortedByZindex();
var _6d=0;
for(var i=0;i<_6c.length;i++){
var _6f=_6c[i];
if(!_6f.isClosed()&&_6f.isVisible()){
_6d++;
}
}
var _70=5;
var _71=0;
var _72=1;
if(_6d<=_70){
_71=_6d;
}else{
var i=2;
while((_6d*i)<(_70*(i+1))){
i++;
if(i>6){
break;
}
}
_72=i;
_71=Math.ceil(_6d/_72);
}
var _73=$telerik.getClientBounds();
var _74=Math.floor(_73.width/_71);
var _75=Math.floor(_73.height/_72);
var _76=document.documentElement.scrollLeft||document.body.scrollLeft;
var top=document.documentElement.scrollTop||document.body.scrollTop;
var _78=0;
for(var i=0;i<_6c.length;i++){
var _6f=_6c[i];
if(!_6f.isClosed()&&_6f.isVisible()){
_78++;
if((_78-1)%(_71)==0&&_78>_71){
top+=_75;
_76=document.documentElement.scrollLeft||document.body.scrollLeft;
}
_6f.restore();
_6f.moveTo(_76,top);
_6f.setSize(_74,_75);
_76+=_74;
}
}
},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 _79=this._windows.concat([]);
var _7a=function(_7b,_7c){
var z1=_7b.get_zindex();
var z2=_7c.get_zindex();
if(z1==z2){
return 0;
}
return (z1<z2?-1:1);
};
return _79.sort(_7a);
},_executeAll:function(_7f){
if(!this._windows){
return;
}
var _80=this._windows.concat([]);
for(var i=0;i<_80.length;i++){
_80[i][_7f]();
}
},_executeActiveWindow:function(_82){
var _83=this.getActiveWindow();
if(_83&&"function"==typeof (_83[_82])){
_83[_82]();
}
},get_preserveClientState:function(){
return this._preserveClientState;
},set_preserveClientState:function(_84){
if(this._preserveClientState!=_84){
this._preserveClientState=_84;
}
},set_windowControls:function(_85){
this._windowIDs=eval(_85);
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();