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._navigateUrl=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_restrictionZoneID(null);
_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(){
var _47=true;
if(_46.setActive){
try{
_46.setActive();
_47=false;
}
catch(e){
}
}
if(_47){
_46.focus();
}
},0);
}
return _42;
},_stringFormat:function(_48){
for(var i=1;i<arguments.length;i++){
_48=_48.replace(new RegExp("\\{"+(i-1)+"\\}","ig"),arguments[i]);
}
return _48;
},_registerAsPageManager:function(){
var _4a=Telerik.Web.UI.WindowManager.Manager;
var _4b=this.get_id();
if(_4a&&_4a.get_id()==_4b){
_4a.dispose();
Telerik.Web.UI.WindowManager.Manager=null;
}
if(_4a&&!_4a.get_id()){
Telerik.Web.UI.WindowManager.Manager=null;
}
if(!Telerik.Web.UI.WindowManager.Manager){
Telerik.Web.UI.WindowManager.Manager=this;
}
},saveWindowState:function(_4c){
if(!_4c||!_4c.isCreated()){
return;
}
var _4d=_4c.getWindowBounds();
var _4e=(_4c.isVisible()||_4c.isMinimized())+"@"+_4d.width+"@"+_4d.height+"@"+_4d.x+"@"+_4d.y+"@"+_4c.isMinimized();
this._setRadWindowCookie(_4c.get_id(),_4e);
},saveState:function(){
var _4f=this.get_windows();
for(i=0;i<_4f.length;i++){
var _50=_4f[i];
if(_50.isCloned()){
this.saveWindowState(_50);
}
}
},restoreState:function(){
function restoreWindow(_51,_52){
var _53=_52.split("@");
if(_53.length>1){
if("true"==_53[0]&&!_51.isVisible()){
_51.show();
}
window.setTimeout(function(){
if(parseInt(_53[1])>0){
_51.set_width(_53[1]);
}
if(parseInt(_53[2])>0){
_51.set_height(_53[2]);
}
if("true"==_53[0]){
_51.moveTo(parseInt(_53[3]),parseInt(_53[4]));
}
if("true"==_53[5]){
_51.minimize();
}
},1);
}
}
var _54=this.get_windows();
for(i=0;i<_54.length;i++){
var _55=_54[i];
var _56=this._getRadWindowCookie(_55.get_id());
if(_56){
restoreWindow(_55,_56);
}
}
},_getOnlyCookie:function(){
var _57="RadWindowCookie";
var _58=document.cookie.split("; ");
for(var i=0;i<_58.length;i++){
var _5a=_58[i].split("=");
if(_57==_5a[0]){
return _5a[1];
}
}
return null;
},_setRadWindowCookie:function(_5b,_5c){
_5b="["+_5b+"]";
var _5d=this._getOnlyCookie();
var _5e="";
var _5f="";
if(_5d){
var _60=_5d.split(_5b);
if(_60&&_60.length>1){
_5e=_60[0];
_5f=_60[1].substr(_60[1].indexOf("#")+1);
}else{
_5f=_5d;
}
}
var _61=new Date();
_61.setFullYear(_61.getFullYear()+10);
document.cookie="RadWindowCookie"+"="+(_5e+_5b+"-"+_5c+"#"+_5f)+";path=/;expires="+_61.toUTCString()+";";
},_getRadWindowCookie:function(_62){
var _63=this._getOnlyCookie();
if(!_63){
return;
}
var _64=null;
_62="["+_62+"]";
var _65=_63.indexOf(_62);
if(_65>=0){
var _66=_65+_62.length+1;
_64=_63.substring(_66,_63.indexOf("#",_66));
}
return _64;
},cascade:function(){
var _67=40;
var _68=40;
var _69=this._getWindowsSortedByZindex();
for(var i=0;i<_69.length;i++){
var _6b=_69[i];
if(!_6b.isClosed()&&_6b.isVisible()){
var _6c=_6b.restore();
_6b.moveTo(_67,_68);
_6b.setActive(true);
_67+=25;
_68+=25;
}
}
},tile:function(){
var _6d=this._getWindowsSortedByZindex();
var _6e=0;
for(var i=0;i<_6d.length;i++){
var _70=_6d[i];
if(!_70.isClosed()&&_70.isVisible()){
_6e++;
}
}
var _71=5;
var _72=0;
var _73=1;
if(_6e<=_71){
_72=_6e;
}else{
var i=2;
while((_6e*i)<(_71*(i+1))){
i++;
if(i>6){
break;
}
}
_73=i;
_72=Math.ceil(_6e/_73);
}
var _74=$telerik.getClientBounds();
var _75=Math.floor(_74.width/_72);
var _76=Math.floor(_74.height/_73);
var _77=document.documentElement.scrollLeft||document.body.scrollLeft;
var top=document.documentElement.scrollTop||document.body.scrollTop;
var _79=0;
for(var i=0;i<_6d.length;i++){
var _70=_6d[i];
if(!_70.isClosed()&&_70.isVisible()){
_79++;
if((_79-1)%(_72)==0&&_79>_72){
top+=_76;
_77=document.documentElement.scrollLeft||document.body.scrollLeft;
}
_70.restore();
_70.moveTo(_77,top);
_70.setSize(_75,_76);
_77+=_75;
}
}
},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 _7a=this._windows.concat([]);
var _7b=function(_7c,_7d){
var z1=_7c.get_zindex();
var z2=_7d.get_zindex();
if(z1==z2){
return 0;
}
return (z1<z2?-1:1);
};
return _7a.sort(_7b);
},_executeAll:function(_80){
if(!this._windows){
return;
}
var _81=this._windows.concat([]);
for(var i=0;i<_81.length;i++){
_81[i][_80]();
}
},_executeActiveWindow:function(_83){
var _84=this.getActiveWindow();
if(_84&&"function"==typeof (_84[_83])){
_84[_83]();
}
},get_preserveClientState:function(){
return this._preserveClientState;
},set_preserveClientState:function(_85){
if(this._preserveClientState!=_85){
this._preserveClientState=_85;
}
},set_windowControls:function(_86){
this._windowIDs=eval(_86);
this._disposeWindows();
},get_windowControls:function(){
},get_windows:function(){
return this._windows;
}};
Telerik.Web.UI.RadWindowManager.registerClass("Telerik.Web.UI.RadWindowManager",Telerik.Web.UI.RadWindow);

