Type.registerNamespace("Telerik.Web.UI");
Telerik.Web.UI.DockMode=function(){
throw Error.notImplemented();
};
Telerik.Web.UI.DockMode.prototype={Floating:1,Docked:2,Default:3};
Telerik.Web.UI.DockMode.registerEnum("Telerik.Web.UI.DockMode");
Telerik.Web.UI.RadDock=function(_1){
Telerik.Web.UI.RadDock.initializeBase(this,[_1]);
this._enableDrag=true;
this._top=0;
this._left=0;
this._autoPostBack=false;
this._dockZoneID=null;
this._title=null;
this._commands=null;
this._closed=false;
this._collapsed=false;
this._pinned=false;
this._index=0;
this._forbiddenZones=[];
this._layoutID=null;
this._handle=null;
this._dockMode=Telerik.Web.UI.DockMode.Default;
this._width="300px";
this._height=null;
this._uniqueID=null;
this._uniqueName=null;
this._grip=null;
this._titleBar=null;
this._commandsContainer=null;
this._contentContainer=null;
this._handle=null;
this._form=null;
this.set_handle=this.set_handle;
this._isCustomHandle=false;
};
Telerik.Web.UI.RadDock.DragDataType="RadDock";
Telerik.Web.UI.RadDock.prototype={getCommand:function(_2){
return this._commands?this._commands[_2]:null;
},get_handle:function(){
return this._handle;
},set_handle:function(_3){
this._isCustomHandle=true;
this._setHandle(_3);
},_setHandle:function(_4){
this._disposeDrag();
this._handle=_4;
this._initializeDrag();
},_radShowHelper:function(){
if(this.get_closed()){
return;
}
this._setContentContainerHeight();
this._setCommandsContainerWidth();
},initialize:function(){
Telerik.Web.UI.RadDock.callBaseMethod(this,"initialize");
this._initializeHtmlElementVariables();
var me=this;
this.get_element().RadShow=function(){
window.setTimeout(function(){
me._radShowHelper();
},10);
};
this._initializeCommands();
this._updateToggleCommandsState();
this._setPinUnpinVisibility();
this._setHandle(this._titleBar||this._grip);
this._setContentContainerHeight();
this.raise_initialize();
},dispose:function(){
this.get_element().RadShow=null;
this._disposeDrag();
Telerik.Web.UI.RadDock.callBaseMethod(this,"dispose");
},undock:function(){
var _6=this.get_element();
this._form.appendChild(_6);
var _7=this._getLocation(_6);
this.set_left(_7.x);
this.set_top(_7.y);
var _8=$find(this.get_dockZoneID());
if(_8){
this.set_dockZoneID("");
_8._resetDockIndices();
this._unfitWidth();
}
this._setPinUnpinVisibility();
this.updateClientState();
},_fitWidth:function(){
this.get_element().style.width="100%";
},_unfitWidth:function(){
this.get_element().style.width=this.get_width();
},_initializeHtmlElementVariables:function(){
this._grip=$get(this.get_id()+"_G");
this._titleBar=$get(this.get_id()+"_T");
if(this._titleBar){
var _9=this._titleBar.lastChild;
while(_9){
if(_9.className=="rdCommands"){
this._commandsContainer=_9;
break;
}
_9=_9.previousSibling;
}
}
var _a=this.get_element().parentNode;
while(_a){
if(_a.tagName.toLowerCase()==="form"){
this._form=_a;
break;
}
_a=_a.parentNode;
}
},_initializeCommands:function(){
if(!this._commandsContainer){
return;
}
var _b=this._commandsContainer.getElementsByTagName("a");
var _c=this._commands;
if(_c){
this._commands={};
for(var i=0;i<_c.length;i++){
var _e=_c[i];
var _f=eval(_e.clientTypeName);
if(_f==Telerik.Web.UI.DockCommand||_f.inheritsFrom(Telerik.Web.UI.DockCommand)){
_e.radDock=this;
var _10=null;
if(_e.command){
_10={"command":eval(_e.command)};
delete _e.command;
}
var cmd=$create(_f,_e,_10,null,_b[i]);
this._commands[cmd.get_name()]=cmd;
}else{
throw Error.invalidOperation(_e.clientTypeName+" does not inherit from Telerik.Web.UI.DockCommand.");
}
}
}
},_updateToggleCommandsState:function(){
var _12=this.getCommand("ExpandCollapse");
if(_12){
_12.set_state(this.get_collapsed()?2:1);
}
var _13=this.getCommand("PinUnpin");
if(_13){
_13.set_state(this.get_pinned()?2:1);
}
},_setPinUnpinVisibility:function(){
var _14=this.getCommand("PinUnpin");
if(_14){
_14.get_element().style.display=this.get_dockZoneID()?"none":"inline";
}
this._setCommandsContainerWidth();
},_setCommandsContainerWidth:function(){
if(!this._commandsContainer){
return;
}
var _15=this._commandsContainer.getElementsByTagName("a");
var _16=0;
for(var i=0;i<_15.length;i++){
var _18=this._getBoundsWithBorderAndMargin(_15[i]);
_16+=_18.width;
}
this._commandsContainer.style.width=_16+"px";
},_getBoundsWithBorderAndMargin:function(_19){
if(!_19){
_19=this.get_element();
}
var _1a=this._getBounds(_19);
var _1b=this._getMarginBox(_19);
var _1c=this._getBorderBox(_19);
_1a.width+=(_1b.horizontal+_1c.horizontal);
_1a.height+=(_1b.vertical+_1c.vertical);
return _1a;
},_getBounds:function(_1d){
if(!_1d){
_1d=this.get_element();
}
return $telerik.getBounds(_1d);
},_getMarginBox:function(_1e){
if(!_1e){
_1e=this.get_element();
}
return $telerik.getMarginBox(_1e);
},_getBorderBox:function(_1f){
if(!_1f){
_1f=this.get_element();
}
return $telerik.getBorderBox(_1f);
},_resetPosition:function(){
var _20=this.get_element();
_20.style.top="";
_20.style.left="";
_20.originalPosition="relative";
_20.style.position="relative";
_20.style.zIndex=this.originalZIndex;
},_setContentContainerHeight:function(){
if(!Sys.UI.DomElement.containsCssClass(this.get_element(),"rdVariableHeight")){
var _21=this._getBounds();
var _22=this.get_handle();
if(_22&&!this._isCustomHandle){
var _23=this._getBoundsWithBorderAndMargin(_22);
_21.height-=_23.height;
}
var _24=_21.height-2;
this.get_contentContainer().style.height=(_24<0?0:_24)+"px";
}else{
this.get_contentContainer().style.height="";
}
},_initializeDrag:function(){
this._disposeDrag();
if(this._handle&&this.get_enableDrag()&&!this.get_pinned()){
$addHandlers(this._handle,{"mousedown":this._mouseDownHandler},this);
Sys.UI.DomElement.addCssClass(this._handle,"rdDraggable");
}
},_disposeDrag:function(){
if(this._handle){
$clearHandlers(this._handle);
Sys.UI.DomElement.removeCssClass(this._handle,"rdDraggable");
}
},_mouseDownHandler:function(e){
window._event=e;
var _26=(0>Array.indexOf(["input","button","select","textarea","label","a"],e.target.tagName.toLowerCase()));
if(_26&&this.get_enableDrag()&&!this.get_pinned()){
e.preventDefault();
this._startDragDrop();
}
},_startDragDrop:function(){
var _27=this.get_element();
this.originalZIndex=_27.style.zIndex;
var _28=this._getBounds(_27);
var _29=this._getBorderBox(_27);
_28.width-=_29.horizontal;
_28.height-=_29.vertical;
_27.style.width=_28.width+"px";
_27.style.zIndex="9999999";
var _2a=$telerik.getLocation(_27);
this._form.appendChild(_27);
var _2b=$find(this.get_dockZoneID());
if(_2b){
_2b._showPlaceholder(this);
}
this._setLocation(_2a);
Telerik.Web.DragDropManager.startDragDrop(this,_27,null);
},_restorePosition:function(){
var _2c=$find(this.get_dockZoneID());
if(_2c){
_2c.dock(this,this.get_index());
}else{
this.undock();
}
},_getLocation:function(_2d){
if(!_2d){
_2d=this.get_element();
}
return $telerik.getLocation(_2d);
},_setLocation:function(_2e){
$telerik.setLocation(this.get_element(),_2e);
},get_contentContainer:function(){
if(!this._contentContainer){
this._contentContainer=$get(this.get_id()+"_C");
}
return this._contentContainer;
},saveClientState:function(){
var _2f={Top:this.get_top(),Left:this.get_left(),DockZoneID:this.get_dockZoneID(),Collapsed:this.get_collapsed(),Pinned:this.get_pinned(),Closed:this.get_closed(),Index:this.get_index()};
return Sys.Serialization.JavaScriptSerializer.serialize(_2f);
},conditionalPostback:function(_30){
if(this.get_autoPostBack()){
this.doPostBack(_30);
}
},doPostBack:function(_31){
__doPostBack(this.get_uniqueID(),_31);
},get_dragDataType:function(){
return Telerik.Web.UI.RadDock.DragDataType;
},getDragData:function(_32){
return this;
},get_dragMode:function(){
return Telerik.Web.DragMode.Move;
},onDragStart:function(){
this.raise_dragStart(new Sys.EventArgs());
},onDrag:function(){
this.raise_drag(new Sys.EventArgs());
},onDragEnd:function(_33){
this.raise_dragEnd(new Sys.EventArgs());
if(_33){
this._restorePosition();
}
},add_command:function(_34){
this.get_events().addHandler("command",_34);
},remove_command:function(_35){
this.get_events().removeHandler("command",_35);
},raise_command:function(_36){
this.raiseEvent("command",_36);
},add_dragStart:function(_37){
this.get_events().addHandler("dragStart",_37);
},remove_dragStart:function(_38){
this.get_events().removeHandler("dragStart",_38);
},raise_dragStart:function(_39){
this.raiseEvent("dragStart",_39);
},add_drag:function(_3a){
this.get_events().addHandler("drag",_3a);
},remove_drag:function(_3b){
this.get_events().removeHandler("drag",_3b);
},raise_drag:function(_3c){
this.raiseEvent("drag",_3c);
},add_dragEnd:function(_3d){
this.get_events().addHandler("dragEnd",_3d);
},remove_dragEnd:function(_3e){
this.get_events().removeHandler("dragEnd",_3e);
},raise_dragEnd:function(_3f){
this.raiseEvent("dragEnd",_3f);
},add_dockPositionChanged:function(_40){
this.get_events().addHandler("dockPositionChanged",_40);
},remove_dockPositionChanged:function(_41){
this.get_events().removeHandler("dockPositionChanged",_41);
},raise_dockPositionChanged:function(_42){
this.raiseEvent("dockPositionChanged",_42);
this.conditionalPostback("dockPositionChanged");
},add_dockPositionChanging:function(_43){
this.get_events().addHandler("dockPositionChanging",_43);
},remove_dockPositionChanging:function(_44){
this.get_events().removeHandler("dockPositionChanging",_44);
},raise_dockPositionChanging:function(_45){
this.raiseEvent("dockPositionChanging",_45);
},add_initialize:function(_46){
this.get_events().addHandler("initialize",_46);
},remove_initialize:function(_47){
this.get_events().removeHandler("initialize",_47);
},raise_initialize:function(_48){
this.raiseEvent("initialize",_48);
},get_top:function(){
return this._top;
},set_top:function(_49){
this._top=_49;
},get_left:function(){
return this._left;
},set_left:function(_4a){
this._left=_4a;
},get_closed:function(){
return this._closed;
},set_closed:function(_4b){
this._closed=_4b;
var _4c=this.get_element();
_4c.style.display=_4b?"none":"block";
if(!_4b){
this._radShowHelper();
Telerik.Web.UI.CallRadShow(_4c);
}
},get_collapsed:function(){
return this._collapsed;
},set_collapsed:function(_4d){
this._collapsed=_4d;
this.get_element().style.height=_4d?"auto":this.get_height();
if(this._collapsed){
this.addCssClass("rdCollapsed");
}else{
this.removeCssClass("rdCollapsed");
if(this.get_height()==null){
this.addCssClass("rdVariableHeight");
}
}
this._setContentContainerHeight();
if(!this._collapsed){
Telerik.Web.UI.CallRadShow(this.get_contentContainer());
}
var _4e=this.getCommand("ExpandCollapse");
if(_4e){
_4e.set_state(_4d?2:1);
}
},get_autoPostBack:function(){
return this._autoPostBack;
},set_autoPostBack:function(_4f){
this._autoPostBack=_4f;
},get_commands:function(){
return this._commands;
},set_commands:function(_50){
this._commands=_50;
},get_dockMode:function(){
return this._dockMode;
},set_dockMode:function(_51){
this._dockMode=_51;
},get_dockZoneID:function(){
return this._dockZoneID;
},set_dockZoneID:function(_52){
this._dockZoneID=_52;
},get_forbiddenZones:function(){
return this._forbiddenZones;
},set_forbiddenZones:function(_53){
this._forbiddenZones=_53;
},get_height:function(){
return this._height;
},set_height:function(_54){
this._height=_54;
},get_index:function(){
return this._index;
},set_index:function(_55){
this._index=_55;
},get_layoutID:function(){
return this._layoutID;
},set_layoutID:function(_56){
this._layoutID=_56;
},get_enableDrag:function(){
return this._enableDrag;
},set_enableDrag:function(_57){
this._enableDrag=_57;
this._initializeDrag();
},get_pinned:function(){
return this._pinned;
},set_pinned:function(_58){
this._pinned=_58;
var ddm=Telerik.Web.DragDropManager._getInstance();
var _5a=this.get_element();
var _5b=this._getLocation(_5a);
if(_58){
_5b=ddm.subtractPoints(_5b,ddm.getScrollOffset(_5a,true));
this.get_element().style.position="fixed";
this.set_enableDrag(false);
}else{
_5b=ddm.addPoints(_5b,ddm.getScrollOffset(_5a,true));
this._setLocation(_5b);
this.set_enableDrag(true);
}
var _5c=this.getCommand("PinUnpin");
if(_5c){
_5c.set_state(_58?2:1);
}
},get_title:function(){
return this._title;
},set_title:function(_5d){
this._title=_5d;
},get_uniqueID:function(){
return this._uniqueID;
},set_uniqueID:function(_5e){
this._uniqueID=_5e;
},get_uniqueName:function(){
return this._uniqueName;
},set_uniqueName:function(_5f){
this._uniqueName=_5f;
},get_width:function(){
return this._width;
},set_width:function(_60){
this._width=_60;
}};
$telerik.makeCompatible(Telerik.Web.UI.RadDock);
Telerik.Web.UI.RadDock.registerClass("Telerik.Web.UI.RadDock",Telerik.Web.UI.RadWebControl,Telerik.Web.IDragSource);
Telerik.Web.UI.CallRadResize=function(_61){
var _62=_61.getElementsByTagName("*");
for(var i=0;i<_62.length;i++){
var _64=_62[i];
if(_64.RadResize){
_64.RadResize();
}
}
};
Telerik.Web.UI.CallRadShow=function(_65){
var _66=_65.getElementsByTagName("*");
for(var i=0;i<_66.length;i++){
var _68=_66[i];
if(_68.RadShow){
_68.RadShow();
}
}
};
Telerik.Web.UI.DockCommand=function(_69){
Telerik.Web.UI.DockCommand.initializeBase(this,[_69]);
this._clientTypeName=null;
this._cssClass="rdCustom";
this._radDock=null;
this._name="Custom";
this._text="Custom";
this._autoPostBack=false;
};
Telerik.Web.UI.DockCommand.prototype={add_command:function(_6a){
this.get_events().addHandler("command",_6a);
},remove_command:function(_6b){
this.get_events().removeHandler("command",_6b);
},raise_command:function(_6c){
var _6d=this.get_events().getHandler("command");
if(_6d){
_6d(this.get_radDock(),_6c);
}
},get_clientTypeName:function(){
return this._clientTypeName;
},set_clientTypeName:function(_6e){
this._clientTypeName=_6e;
},get_cssClass:function(){
return this._cssClass;
},set_cssClass:function(_6f){
this._cssClass=_6f;
},get_name:function(){
return this._name;
},set_name:function(_70){
this._name=_70;
},get_text:function(){
return this._text;
},set_text:function(_71){
this._text=_71;
},get_autoPostBack:function(){
return this._autoPostBack;
},set_autoPostBack:function(_72){
this._autoPostBack=_72;
},get_radDock:function(){
return this._radDock;
},set_radDock:function(_73){
this._radDock=_73;
},onCommand:function(e){
var _75=new Sys.CancelEventArgs();
_75.command=this;
_75.Command=this;
this.raise_command(_75);
if(_75.get_cancel()){
return;
}
this.get_radDock().raise_command(_75);
if(_75.get_cancel()){
return;
}
this.get_radDock().updateClientState();
this.conditionalPostback();
},conditionalPostback:function(){
if(this.get_autoPostBack()){
this.get_radDock().doPostBack(this.get_name());
}
},initialize:function(){
Telerik.Web.UI.DockCommand.callBaseMethod(this,"initialize");
$addHandlers(this.get_element(),{"click":this.onCommand},this);
},dispose:function(){
$clearHandlers(this.get_element());
Telerik.Web.UI.DockCommand.callBaseMethod(this,"dispose");
}};
$telerik.makeCompatible(Telerik.Web.UI.DockCommand);
Telerik.Web.UI.DockCommand.registerClass("Telerik.Web.UI.DockCommand",Sys.UI.Control);
Telerik.Web.UI.DockToggleCommand=function(_76){
Telerik.Web.UI.DockToggleCommand.initializeBase(this,[_76]);
this._state=1;
this._alternateCssClass="rdCustom";
this._alternateText="Custom";
this._initialSetState=false;
};
Telerik.Web.UI.DockToggleCommand.prototype={updateState:function(){
var _77=this.get_element();
if(this.get_state()==1){
_77.title=this.get_text();
Sys.UI.DomElement.addCssClass(_77,this.get_cssClass());
Sys.UI.DomElement.removeCssClass(_77,this.get_alternateCssClass());
}else{
_77.title=this.get_alternateText();
Sys.UI.DomElement.addCssClass(_77,this.get_alternateCssClass());
Sys.UI.DomElement.removeCssClass(_77,this.get_cssClass());
}
},get_state:function(){
return this._state;
},set_state:function(_78){
this._state=_78;
if(this._initialSetState){
this.updateState();
}
},get_alternateCssClass:function(){
return this._alternateCssClass;
},set_alternateCssClass:function(_79){
this._alternateCssClass=_79;
},get_alternateText:function(){
return this._alternateText;
},set_alternateText:function(_7a){
this._alternateText=_7a;
},initialize:function(){
Telerik.Web.UI.DockToggleCommand.callBaseMethod(this,"initialize");
this._initialSetState=true;
this.updateState();
},dispose:function(){
Telerik.Web.UI.DockToggleCommand.callBaseMethod(this,"dispose");
}};
$telerik.makeCompatible(Telerik.Web.UI.DockToggleCommand);
Telerik.Web.UI.DockToggleCommand.registerClass("Telerik.Web.UI.DockToggleCommand",Telerik.Web.UI.DockCommand);
Telerik.Web.UI.DockCloseCommand=function(_7b){
Telerik.Web.UI.DockCloseCommand.initializeBase(this,[_7b]);
this._cssClass="rdClose";
this._name="Close";
this._text="Close";
};
Telerik.Web.UI.DockCloseCommand.prototype={onCommand:function(e){
this.get_radDock().set_closed(true);
Telerik.Web.UI.DockCloseCommand.callBaseMethod(this,"onCommand");
}};
$telerik.makeCompatible(Telerik.Web.UI.DockCloseCommand);
Telerik.Web.UI.DockCloseCommand.registerClass("Telerik.Web.UI.DockCloseCommand",Telerik.Web.UI.DockCommand);
Telerik.Web.UI.DockExpandCollapseCommand=function(_7d){
Telerik.Web.UI.DockExpandCollapseCommand.initializeBase(this,[_7d]);
this._cssClass="rdCollapse";
this._alternateCssClass="rdExpand";
this._name="ExpandCollapse";
this._text="Collapse";
this._alternateText="Expand";
};
Telerik.Web.UI.DockExpandCollapseCommand.prototype={onCommand:function(e){
this.get_radDock().set_collapsed(!this.get_radDock().get_collapsed());
Telerik.Web.UI.DockExpandCollapseCommand.callBaseMethod(this,"onCommand");
}};
$telerik.makeCompatible(Telerik.Web.UI.DockExpandCollapseCommand);
Telerik.Web.UI.DockExpandCollapseCommand.registerClass("Telerik.Web.UI.DockExpandCollapseCommand",Telerik.Web.UI.DockToggleCommand);
Telerik.Web.UI.DockPinUnpinCommand=function(_7f){
Telerik.Web.UI.DockPinUnpinCommand.initializeBase(this,[_7f]);
this._cssClass="rdUnpin";
this._alternateCssClass="rdPin";
this._name="PinUnpin";
this._text="Pin";
this._alternateText="Unpin";
};
Telerik.Web.UI.DockPinUnpinCommand.prototype={onCommand:function(e){
this.get_radDock().set_pinned(!this.get_radDock().get_pinned());
Telerik.Web.UI.DockPinUnpinCommand.callBaseMethod(this,"onCommand");
}};
$telerik.makeCompatible(Telerik.Web.UI.DockPinUnpinCommand);
Telerik.Web.UI.DockPinUnpinCommand.registerClass("Telerik.Web.UI.DockPinUnpinCommand",Telerik.Web.UI.DockToggleCommand);
Telerik.Web.UI._documentDropZone=function(_81){
};
Telerik.Web.UI._documentDropZone.prototype={get_dropTargetElement:function(){
return ($telerik.standardsMode)?document.body:document.documentElement;
},canDrop:function(_82,_83,_84){
return (_83===Telerik.Web.UI.RadDock.DragDataType&&(_84.get_dockMode()&Telerik.Web.UI.DockMode.Floating)>0);
},drop:function(_85,_86,_87){
var _88=new Sys.CancelEventArgs();
_87.raise_dockPositionChanging(_88);
_87.get_element().style.zIndex=_87.originalZIndex;
if(_88.get_cancel()){
_87._restorePosition();
}else{
_87.undock();
_87.raise_dockPositionChanged(new Sys.EventArgs());
}
},onDragEnterTarget:function(_89,_8a,_8b){
},onDragLeaveTarget:function(_8c,_8d,_8e){
},onDragInTarget:function(_8f,_90,_91){
}};
Telerik.Web.UI._documentDropZone.registerClass("Telerik.Web.UI._documentDropZone",null,Telerik.Web.IDropTarget);
Telerik.Web.UI.DocumentDropZone=new Telerik.Web.UI._documentDropZone();
Telerik.Web.DragDropManager.registerDropTarget(Telerik.Web.UI.DocumentDropZone,true);

