Type.registerNamespace("Telerik.Web.UI");
Telerik.Web.UI.DialogDefinition=function(){
this.Width="600px";
this.Height="400px";
this.Title="";
this.Behaviors=36;
this.Modal=true;
this.VisibleStatusbar=false;
this.VisibleTitlebar=true;
this.ClientCallbackFunction="";
};
Telerik.Web.UI.DialogDefinition.registerClass("Telerik.Web.UI.DialogDefinition",null);
Telerik.Web.UI.DialogDefinitionsDictionary=function(_1){
for(var _2 in _1){
var _3=_1[_2];
var _4=new Telerik.Web.UI.DialogDefinition();
for(var _5 in _3){
_4[_5]=_3[_5];
}
this[_2]=_4;
}
};
Telerik.Web.UI.DialogDefinitionsDictionary.registerClass("Telerik.Web.UI.DialogDefinitionsDictionary",null);
Telerik.Web.UI.DialogOpenEventArgs=function(_6,_7){
Telerik.Web.UI.DialogOpenEventArgs.initializeBase(this);
this._dialogName=_6;
if(_7){
this._parameters=_7;
}else{
this._parameters={};
}
};
Telerik.Web.UI.DialogOpenEventArgs.prototype={get_dialogName:function(){
return this._dialogName;
},set_parameters:function(_8){
this._parameters=_8;
},get_parameters:function(){
return this._parameters;
}};
Telerik.Web.UI.DialogOpenEventArgs.registerClass("Telerik.Web.UI.DialogOpenEventArgs",Sys.EventArgs);
Telerik.Web.UI.RadDialogOpener=function(_9){
Telerik.Web.UI.RadDialogOpener.initializeBase(this,[_9]);
this._additionalQueryString="";
this._dialogDefinitions={};
this._handlerUrl="";
this._handlerChecked=false;
this._useClassicDialogs=false;
this._skin="";
this._dialogParametersProviderTypeName="";
this._dialogUrlLengthLimit=2000;
this._dialogUniqueID="";
this._dialogContainers={};
this._container=null;
};
Telerik.Web.UI.RadDialogOpener.prototype={initialize:function(){
Telerik.Web.UI.RadDialogOpener.callBaseMethod(this,"initialize");
this._dialogDefinitions=new Telerik.Web.UI.DialogDefinitionsDictionary(this.get_dialogDefinitions());
},dispose:function(){
Telerik.Web.UI.RadDialogOpener.callBaseMethod(this,"dispose");
},get_container:function(){
return this._container;
},set_container:function(_a){
this._container=_a;
},get_additionalQueryString:function(){
return this._additionalQueryString;
},set_additionalQueryString:function(_b){
this._additionalQueryString=_b;
},get_dialogDefinitions:function(){
return this._dialogDefinitions;
},get_handlerUrl:function(){
return this._handlerUrl;
},set_handlerUrl:function(_c){
this._handlerUrl=_c;
},get_useClassicDialogs:function(){
return this._useClassicDialogs;
},set_useClassicDialogs:function(_d){
this._useClassicDialogs=_d;
},get_skin:function(){
return this._skin;
},set_skin:function(_e){
this._skin=_e;
},add_open:function(_f){
this.get_events().addHandler("open",_f);
},remove_open:function(_10){
this.get_events().removeHandler("open",_10);
},add_close:function(_11){
this.get_events().addHandler("close",_11);
},remove_close:function(_12){
this.get_events().removeHandler("close",_12);
},openUrl:function(url,_14,_15,_16,_17,_18,_19,_1a,_1b,_1c,_1d,_1e){
_1e="EXTERNAL_URL"+(_1e||"default");
var _1f=this._getDialogContainer(_1e);
_1f.set_width(_15+"px");
_1f.set_height(_16+"px");
_1f.set_behaviors(_1b||Telerik.Web.UI.WindowBehaviors.Default);
_1f.set_modal(_1a==true);
_1f.set_visibleStatusbar(_1c==true);
_1f.set_visibleTitlebar(_1d==true);
_1f.set_title(_19?_19:"");
var _20=new Telerik.Web.UI.DialogOpenEventArgs(url,_14);
this.raiseEvent("open",_20);
_1f.ClientParameters=_14;
_1f.set_clientCallBackFunction(_17);
_1f.setUrl(url);
_1f.show();
_1f.center();
window.setTimeout(function(){
_1f.setActive(true);
},100);
},open:function(_21,_22,_23){
if(!this._handlerChecked){
this._checkDialogHandler(this.get_handlerUrl());
}
var _24=this._getDialogDefinition(_21);
var _25=new Telerik.Web.UI.DialogOpenEventArgs(_21,_22);
this.raiseEvent("open",_25);
var _22=_25.get_parameters();
if(!_23){
_23=_24.ClientCallbackFunction;
}
if(this.get_useClassicDialogs()){
var _26=$create(Telerik.Web.UI.ClassicDialog,{dialogOpener:this});
_26.ClientParameters=_22;
this._applyParameters(_21,_26);
if(_23){
_26.set_clientCallBackFunction(_23);
}
window.__getCurrentRadEditorRadWindowReference=function(){
return _26;
};
var _27="width="+parseInt(_24["Width"])+",height="+parseInt(_24["Height"]);
_27+=",resizable=0,scrollbars=0,status=0,toolbar=0,menubar=0,directories=0";
var wnd=_26.open(_27);
wnd.radWindow=_26;
return wnd;
}else{
var _26=this._getDialogContainer(_21);
var _29=_24["Height"];
_26.set_height(_29);
_26.set_width(_24["Width"]);
_26.set_behaviors(_24["Behaviors"]);
_26.set_modal(_24["Modal"]);
_26.set_visibleStatusbar(_24["VisibleStatusbar"]);
_26.set_visibleTitlebar(_24["VisibleTitlebar"]);
if(_24["ReloadOnShow"]!=null){
_26.set_reloadOnShow(_24["ReloadOnShow"]);
}
_26.ClientParameters=_22;
this._applyParameters(_21,_26);
if(_23){
_26.set_clientCallBackFunction(_23);
}
_26.show();
_26.set_height(_29);
_26.center();
window.setTimeout(function(){
_26.setActive(true);
},100);
}
},_applyParameters:function(_2a,_2b){
var _2c=this._getDialogParameters(_2a);
if(!_2c){
return;
}
var _2d="&dp="+encodeURIComponent(_2c);
var _2e=this._getBaseDialogUrl(_2a);
var _2f=_2e.length+_2d.length;
var _30=this._dialogParametersProviderTypeName=="";
var _31=_30&&_2f<=this._dialogUrlLengthLimit;
if(_31){
var _32=_2b.get_navigateUrl();
var url=_2e+_2d;
if(_32!=url){
_2b.setUrl(url);
}else{
var _34=_2b.get_contentFrame();
if(_34&&_34.contentWindow&&_34.contentWindow.$find){
var _35=_34.contentWindow.initDialog;
if(_35){
_34.contentWindow.setTimeout(function(){
_35();
},1);
}
}
}
}else{
_2b.setUrl(_2e);
_2b.DialogParameters=_2c;
}
},_closeContainerDelegate:function(_36){
this.raiseEvent("close",_36);
},_getDialogContainer:function(_37){
if(typeof (this._dialogContainers[_37])=="undefined"){
var _38=$find(this.get_id()+_37);
if(null!=_38){
_38.dispose();
}
this._dialogContainers[_37]=this.get_container().clone(this.get_id()+_37);
var _39=this;
this._dialogContainers[_37].get_dialogOpener=function(){
return _39;
};
this._dialogContainers[_37].add_close(Function.createDelegate(this,this._closeContainerDelegate));
}
return this._dialogContainers[_37];
},_getBaseDialogUrl:function(_3a){
var _3b=this.get_handlerUrl().indexOf("?")<0?"?":"&";
return this.get_handlerUrl()+_3b+"DialogName="+_3a+"&Skin="+this.get_skin()+"&Title="+encodeURIComponent(this._getDialogDefinition(_3a)["Title"])+"&doid="+this._dialogUniqueID+"&dpptn="+encodeURIComponent(this._dialogParametersProviderTypeName)+this.get_additionalQueryString();
},_getDialogDefinition:function(_3c){
var _3d=this.get_dialogDefinitions()[_3c];
if(_3d){
return _3d;
}else{
throw Error.argumentNull("dialogName",String.format("Dialog Parameters for the {0} dialog do not exist",_3c));
}
},_getDialogParameters:function(_3e){
return this._getDialogDefinition(_3e)["SerializedParameters"];
},_checkDialogHandler:function(url){
var _40=url.indexOf("?")<0?"?":"&";
var _41=url+_40+"checkHandler=true";
var _42=new Sys.Net.WebRequest();
_42.set_url(_41);
_42.add_completed(Function.createDelegate(this,this._checkRequestCompleted));
var _43=new Sys.Net.XMLHttpExecutor();
_42.set_executor(_43);
_43.executeRequest();
},_checkRequestCompleted:function(_44,_45){
if(_44.get_responseAvailable()){
var _46=_44.get_webRequest();
var _47=_44.get_responseData();
if(_47&&_47.indexOf("HandlerCheckOK")>0){
this._handlerChecked=true;
return;
}
}
window.alert("Web.config registration missing!\n The Telerik dialogs require a HttpHandler registration in the web.config file. Please, use the control's Smart Tag to add the handler automatically, or see the help for more information: Controls > RadEditor > Dialogs > Introduction");
}};
Telerik.Web.UI.RadDialogOpener.registerClass("Telerik.Web.UI.RadDialogOpener",Telerik.Web.UI.RadWebControl);
Telerik.Web.UI.ClassicDialog=function(_48,_49){
Telerik.Web.UI.ClassicDialog.initializeBase(this);
this.BrowserWindow=window;
this._dialogOpener=null;
this._clientCallBackFunction=null;
this._window=null;
this._url="";
this._closeEvent=[];
};
Telerik.Web.UI.ClassicDialog.prototype={close:function(_4a){
this.raise_close();
if(null!=_4a&&!(_4a instanceof Sys.UI.DomEvent)){
var _4b=this.get_clientCallBackFunction();
if(_4b){
_4b(this,_4a);
}
}
var wnd=this.get_contentFrame();
wnd.setTimeout(function(){
wnd.close();
wnd.parent.focus();
},100);
},open:function(_4d){
this._window=window.open(this.get_navigateUrl(),"Dialog"+(new Date()-100),_4d);
return this._window;
},setUrl:function(_4e){
this._url=_4e;
},get_navigateUrl:function(){
return this._url;
},get_contentFrame:function(){
return this._window;
},set_title:function(_4f){
if(this._window&&this._window.document){
this._window.document.title=_4f;
}
},dispose:function(){
this._window=null;
this._clientCallBackFunction=null;
this._dialogOpener=null;
this._closeEvent=[];
Telerik.Web.UI.ClassicDialog.callBaseMethod(this,"dispose");
},get_dialogOpener:function(){
return this._dialogOpener;
},set_dialogOpener:function(_50){
this._dialogOpener=_50;
},get_clientCallBackFunction:function(){
return this._clientCallBackFunction;
},set_clientCallBackFunction:function(_51){
this._clientCallBackFunction=_51;
},add_close:function(_52){
Array.add(this._closeEvent,_52);
},remove_close:function(_53){
Array.remove(this._closeEvent,_53);
},raise_close:function(_54){
var evt=this._closeEvent;
if(!evt||(evt.length===0)){
return;
}
evt=Array.clone(evt);
if(!evt._handler){
evt._handler=function(_56,_57){
for(var i=0,l=evt.length;i<l;i++){
evt[i](_56,_57);
}
};
}
var _5a=evt._handler;
if(_5a){
if(!_54){
_54=Sys.EventArgs.Empty;
}
_5a(this,_54);
}
}};
Telerik.Web.UI.ClassicDialog.registerClass("Telerik.Web.UI.ClassicDialog",Sys.Component);


if(typeof(Sys)!=='undefined')Sys.Application.notifyScriptLoaded();