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