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.toDock=function(a){return a;
};
$telerik.findDock=$find;
Telerik.Web.UI.RadDock=function(a){Telerik.Web.UI.RadDock.initializeBase(this,[a]);
this._initialized=false;
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._allowedZones=[];
this._layoutID=null;
this._handle=null;
this._dockMode=Telerik.Web.UI.DockMode.Default;
this._resizable=false;
this._width="300px";
this._height=null;
this._expandedHeight=0;
this._uniqueID=null;
this._uniqueName=null;
this._handle=null;
this._form=null;
this._skin="Default";
this._enableAnimation=false;
this._animationDuration=300;
this._draggedCssClass="rdDragHelper";
this._tableElement=null;
this._grip=null;
this._titleBar=null;
this._commandsContainer=null;
this._topLeftBar=null;
this._topRightBar=null;
this._middleLeftBar=null;
this._middleRightBar=null;
this._contentContainer=null;
this._bottomLeftBar=null;
this._bottomMiddleBar=null;
this._bottomRightBar=null;
this._dropDownTouchScroll=null;
this.set_handle=this.set_handle;
this._isCustomHandle=false;
};
Telerik.Web.UI.RadDock.DragDataType="RadDock";
Telerik.Web.UI.RadDock.prototype={_fixIeHeight:function(c,a){if("CSS1Compat"==document.compatMode){var d=(c.offsetHeight-parseInt(a));
if(d>0){var b=(parseInt(c.style.height)-d);
if(b>0){c.style.height=b+"px";
}}}},_isDockRightToLeft:function(){var b=this._isRightToLeft;
if(b==null){var a=this.get_element();
if(a){b=this._isRightToLeft=$telerik.isRightToLeft(a);
}}return b;
},_setResizeLimit:function(){var d=this.get_element();
var h=0;
var a=this._getBounds(this._topBar).height;
var b=this._getBounds(this._bottomBar).height;
h=h+a+b;
this._minHeight=h;
d.style.minHeight=this._minHeight+"px";
this._handlesHeight=a+b;
var e=0;
var c=this._getBounds(this._middleLeftBar).width;
var f=this._getBounds(this._middleRightBar).width;
var g=this.get_commandsContainer()?$telerik.getOuterBounds(this.get_commandsContainer()).width:0;
this._minWidth=e+c+f+g;
d.style.minWidth=this._minWidth+"px";
this._handlesWidth=c+f;
},_updateSizeValues:function(){var a=this._getBounds();
this._width=a.width;
this._height=a.height;
},_setWidthHtmlEl:function(a,b){if(!a){return;
}if(!b){b=this.get_element();
}if(a.toString().indexOf("%")>-1){b.style.width=parseInt(a)+"%";
}else{b.style.width=parseInt(a)+"px";
}},_setHeightHtmlEl:function(a,b){if(!b){b=this.get_element();
}if(!a){b.style.height="";
return;
}if(a.toString().indexOf("%")>-1){b.style.height=parseInt(a)+"%";
}else{b.style.height=parseInt(a)+"px";
}},_moveElements:function(a,b){while(a.childNodes&&a.childNodes.length>0){var c=a.childNodes[0];
a.removeChild(c);
b.appendChild(c);
}},_configureHandles:function(g){if(!this._resizeExtender){return;
}var d=["e","s","w","sw","se","nw","ne"];
var h=this._resizeExtender._handles;
var b=null;
var c=this.get_dockZone();
if(c&&this.get_parent()){b=c.get_isHorizontal()?"e":"s";
}for(var e=0;
e<d.length;
e++){var f=d[e];
var a=h[f];
if(a){a.style.cursor=(!g)||(b&&b!=f)?"":f+"-resize";
}}},_fixEmWidth:function(){var g=this.get_titleBar();
if(g==null){return;
}var b=$telerik.getBounds(g).width;
if(b>0){var a=this.get_titleElement();
if(a){if($telerik.isIE6){a.style.display="none";
b=$telerik.getBounds(g).width;
a.style.display="block";
}var f=this.get_commandsContainer();
var d=f?$telerik.getOuterBounds(f).width:0;
var e=b-d-30;
var c=e>0?e:0;
a.style.width=c+"px";
}}},_enableMoveResize:function(){if(this._resizeExtender){this._resizeExtender.dispose();
}var a={};
if(this._resizable){if(this._isDockRightToLeft()){a={s:this._middleRightBar,w:this._middleLeftBar,e:this._bottomMiddleBar,sw:this._bottomRightBar,se:this._bottomLeftBar,nw:this._topRightBar,ne:this._topLeftBar};
}else{a={e:this._middleRightBar,w:this._middleLeftBar,s:this._bottomMiddleBar,se:this._bottomRightBar,sw:this._bottomLeftBar,ne:this._topRightBar,nw:this._topLeftBar};
}}if(this._handle&&this.get_enableDrag()&&!this.get_pinned()){a.move=this._handle;
}this._resizeExtender=new Telerik.Web.UI.ResizeExtender(this,this.get_element(),a,this._tableElement);
if(this._resizable){if(this._collapsed){this._configureHandles(false);
}if(this.get_dockZoneID()){this._configureHandles(true);
}}},_makeResizable:function(){this._enableMoveResize();
},onResizeStart:function(){if(this._collapsed||!this._resizable){return;
}var a=this.get_titleElement();
if(a){a.style.display="none";
}this._setResizeLimit();
this.raise_resizeStart(new Sys.EventArgs());
},onResizing:function(d){if(this._collapsed||!this._resizable){return false;
}var c=this.get_dockZone();
if(c){var h=this._caluclateZoneFreeSpace(c);
var a=this._getBounds();
if(c.get_isHorizontal()){if((d.width>a.width)&&((d.width-a.width)>=h.width)){return false;
}}else{if((d.height>a.height)&&((d.height-a.height)>=h.height)){return false;
}}}var g=this.get_contentContainer();
if(g){var b=d.height;
b-=this._handlesHeight;
var f=d.width;
f-=this._handlesWidth;
if(b<=0||f<=this._minWidth){return false;
}else{g.style.height=b+"px";
if($telerik.isIE6){g.style.width=f+"px";
}}}},onResizeEnd:function(){if(this._collapsed||!this._resizable){return;
}var c=this._getBounds();
var b=c.width;
var a=c.height;
if(b<this._minWidth){b=this._minWidth;
}if(a<this._minHeight){a=this._minHeight;
}this._setSize(b,a);
this._fixEmWidth();
var d=this.get_titleElement();
if(d){d.style.display="block";
}var e=this.get_element();
e.style.minWidth="";
e.style.minHeight="";
this._updateSizeValues();
this.updateClientState();
this.raise_resizeEnd(new Sys.EventArgs());
},_caluclateZoneFreeSpace:function(a){var c=$telerik.getContentSize(a.get_element());
var b=a.get_docks();
for(var e=0;
e<b.length;
e++){var d=b[e]._getBounds();
c.height-=d.height;
c.width-=d.width;
}return c;
},_initializeDrag:function(){if(this._handle){this._disposeDrag();
if(this.get_enableDrag()&&!this.get_pinned()){Sys.UI.DomElement.addCssClass(this._handle,"rdDraggable");
this._enableMoveResize();
}else{if(this._resizable){this._enableMoveResize();
}}}},_disposeDrag:function(){if(this._handle&&this._resizeExtender){this._resizeExtender.dispose();
this._resizeExtender=null;
Sys.UI.DomElement.removeCssClass(this._handle,"rdDraggable");
}},_startDragDrop:function(){var a=this.get_element();
this.originalZIndex=a.style.zIndex;
var d=this._getBounds(a);
var c=this._getBorderBox(a);
d.width-=c.horizontal;
d.height-=c.vertical;
a.style.width=d.width+"px";
a.style.zIndex="9999999";
var e=$telerik.getLocation(a);
if(a.parentNode!=this._form){this._form.appendChild(a);
}var b=$find(this.get_dockZoneID());
if(b){b._showPlaceholder(this,e);
}this._setLocation(e);
},onDragStart:function(b){if(!this.get_enableDrag()||this.get_pinned()){return false;
}var c=new Sys.CancelEventArgs();
c.ownerEvent=b.ownerEvent;
this.raiseEvent("dragStart",c);
if(c.get_cancel()){return false;
}this.get_contentContainer().style.overflow="hidden";
this.addCssClass(this._draggedCssClass);
this._startDragDrop();
var a=this.get_element();
return true;
},onDrag:function(a){this._hitZone=this.dockingZoneHitTest(a.ownerEvent);
this.raise_drag(new Sys.EventArgs());
},onDragEnd:function(a){var c=this._hitZone;
if(!c){var b=this._getBounds();
c=this._hitZone=this.dockingZoneHitTest(a.ownerEvent);
}if(c){if(c.canDrop(this)){c.drop(this);
}else{this._restorePosition();
}}else{if(this.canDrop()){this.drop();
}else{this._restorePosition();
}}this.get_contentContainer().style.overflow="auto";
this.removeCssClass(this._draggedCssClass);
this.raise_dragEnd(new Sys.EventArgs());
},get_dockZones:function(){if(typeof(Telerik.Web.UI.RadDockZonesGlobalArray)=="undefined"){return[];
}return Telerik.Web.UI.RadDockZonesGlobalArray;
},dockingZoneHitTest:function(f){var d=null;
var c=this.get_dockZones();
var b=this.get_element();
var g=[];
var k=[];
for(var h=0;
h<c.length;
h++){if(c[h].hitTest(this,f,false)){g[g.length]=c[h].get_element();
k[k.length]=c[h];
}}if(g.length>0){if(g.length==1){d=$find(g[0].id);
}else{if(g.length>1){b.style.display="none";
var a=document.elementFromPoint(f.clientX,f.clientY);
b.style.display="";
if(a){var j=document.body;
while(a!=j){for(var h=0;
h<g.length;
h++){if(a==g[h]){if(a.id){d=$find(a.id);
}break;
}}if(d!=null){break;
}a=a.parentNode;
}}}}for(var h=0;
h<k.length;
h++){if(k[h]!=d){k[h].dragLeaveTarget(this);
}else{d.hitTest(this,f,true);
}}}return d;
},canDrop:function(){return(this.get_dockMode()&Telerik.Web.UI.DockMode.Floating)>0;
},drop:function(){var a=new Sys.CancelEventArgs();
this.raise_dockPositionChanging(a);
this.get_element().style.zIndex=this.originalZIndex;
if(a.get_cancel()){this._restorePosition();
}else{this.undock();
this.raise_dockPositionChanged(new Sys.EventArgs());
}},clone:function(e){if(!e){e="RadDockClone_"+(new Date()-100);
}var l=this.get_handle();
this._setHandle(null);
var a=this.get_commands();
for(var q in a){$clearHandlers(a[q].get_element());
}var b=this.get_element();
var h=b.cloneNode(true);
h.removeAttribute("control");
var f=$telerik.getElementByClassName(h,"rdTable","TABLE").rows;
var d=$telerik.getElementByClassName(f[0].cells[1],"rdTitleBar","DIV");
var j=$telerik.getElementByClassName(f[1].cells[1],"rdContent","DIV");
var m=h.getElementsByTagName("input")[0];
d.setAttribute("id",e+"_T");
j.setAttribute("id",e+"_C");
h.setAttribute("id",e);
m.setAttribute("id",e+"_ClientState");
m.setAttribute("name",e+"_ClientState");
b.parentNode.insertBefore(h,b.nextSibling);
var o=$telerik.cloneControl(this,Telerik.Web.UI.RadDock,h);
this._setHandle(l);
var c=o.get_commandsContainer().getElementsByTagName("a");
for(var p=0;
p<c.length;
p++){var b=c[p];
b.removeAttribute("control");
}o.set_commands(Array.clone(this._originalCommandsObject));
o._initializeCommands();
for(var k in a){var n=a[k];
var g=a[k].get_element();
$addHandlers(g,{click:n.onCommand,mousedown:n.onMouseDown},n);
}o.set_uniqueID(e);
if(o.get_dockZone()){o.get_dockZone()._resetDockIndices();
}return o;
},getCommand:function(a){return this._commands?this._commands[a]:null;
},get_handle:function(){return this._handle;
},set_handle:function(a){this._isCustomHandle=true;
this._setHandle(a);
},_setHandle:function(a){this._disposeDrag();
this._handle=a;
this._initializeDrag();
},_repaintHelper:function(){if(this.get_closed()||$telerik.getInvisibleParent(this.get_element())!=null){return;
}this._fixEmWidth();
this._setContentContainerHeight();
},subtractPoints:function(b,a){return{x:b.x-a.x,y:b.y-a.y};
},addPoints:function(b,a){return{x:b.x+a.x,y:b.y+a.y};
},initialize:function(){Telerik.Web.UI.RadDock.callBaseMethod(this,"initialize");
if(this._isDockRightToLeft()){var f=this.get_element();
Sys.UI.DomElement.addCssClass(f,"rdRtl");
Sys.UI.DomElement.addCssClass(f,"RadDock_"+this._skin+"_rtl");
}this._initializeHtmlElementVariables();
this._setUnselectableOn();
this._initializeCommands();
this._updateToggleCommandsState();
this._setPinUnpinVisibility();
this._setHandle(this._titleBar||this._grip);
var a=this.get_element();
var c=a.parentNode;
var e=$telerik.getInvisibleParent(this.get_element().parentNode);
isHidden=(e!=null);
if(isHidden){var b={position:a.style.position,top:a.style.top,left:a.style.left};
a.parentNode.removeChild(a);
a.style.position="absolute";
a.style.top="-5000px";
a.style.left="-5000px";
document.body.appendChild(a);
}else{this._fixEmWidth();
}if(this._height){this._setContentContainerHeight(this._height);
}this._middleMiddleCell.style.height="auto";
if(this._height!=null){this._setHeightHtmlEl(this._height);
}this._makeResizable();
if(isHidden){a.style.position=b.position;
a.style.top=b.top;
a.style.left=b.left;
a.parentNode.removeChild(a);
var d=this.get_dockZone();
if(d&&Telerik.Web.UI.RadDockZone.isInstanceOfType(d)){c.insertBefore(a,d._placeholder);
}else{c.appendChild(a);
}}if(Telerik.Web.UI.TouchScrollExtender._getNeedsScrollExtender()&&!this._dropDownTouchScroll){this._createTouchScrollExtender(true);
}this.updateClientState();
this.raise_initialize();
},dispose:function(){this._createTouchScrollExtender(false);
Telerik.Web.UI.RadDock.callBaseMethod(this,"dispose");
},_createTouchScrollExtender:function(c){var a=$get(this.get_id()+"_C");
if(a){var b=this._dropDownTouchScroll;
if(b){if(!c){b.dispose();
this._dropDownTouchScroll=null;
}}else{if(c){this._dropDownTouchScroll=new Telerik.Web.UI.TouchScrollExtender(a);
this._dropDownTouchScroll.initialize();
}}}},undock:function(){var a=this.get_element();
if(a.parentNode!=this._form){this._form.appendChild(a);
}var b=this._getLocation(a);
this.set_left(b.x);
this.set_top(b.y);
var c=$find(this.get_dockZoneID());
if(c){this.set_dockZoneID("");
c._resetDockIndices();
this._unfitWidth();
}this._setPinUnpinVisibility();
this.updateClientState();
},_fitWidth:function(){this.get_element().style.width="100%";
this.get_contentContainer().style.width="100%";
this._fixEmWidth();
},_unfitWidth:function(){this.set_width(this.get_width());
this._fixEmWidth();
},_initializeHtmlElementVariables:function(){this._grip=$get(this.get_id()+"_G");
this._titleBar=$get(this.get_id()+"_T");
this.get_commandsContainer();
var a=this.get_element();
this._tableElement=a.getElementsByTagName("table")[0];
var c=this._tableElement.rows;
this._topBar=c[0];
this._topLeftBar=c[0].cells[0];
this._topRightBar=c[0].cells[2];
this._middleLeftBar=c[1].cells[0];
this._middleMiddleCell=c[1].cells[1];
this._middleRightBar=c[1].cells[2];
this._bottomBar=c[2];
this._bottomLeftBar=c[2].cells[0];
this._bottomMiddleBar=c[2].cells[1];
this._bottomRightBar=c[2].cells[2];
var b=this.get_element().parentNode;
while(b){if(b.tagName.toLowerCase()==="form"){this._form=b;
break;
}b=b.parentNode;
}},_setUnselectableOn:function(){this._topLeftBar.setAttribute("unselectable","on");
this._topRightBar.setAttribute("unselectable","on");
this._middleLeftBar.setAttribute("unselectable","on");
this._middleRightBar.setAttribute("unselectable","on");
this._bottomLeftBar.setAttribute("unselectable","on");
this._bottomMiddleBar.setAttribute("unselectable","on");
this._bottomRightBar.setAttribute("unselectable","on");
},_initializeCommands:function(){if(!this._commandsContainer){return;
}var c=this._commandsContainer.getElementsByTagName("a");
var b=this._commands;
if(b){this._commands={};
for(var f=0;
f<b.length;
f++){var e=b[f];
var d=eval(e.clientTypeName);
if(d==Telerik.Web.UI.DockCommand||d.inheritsFrom(Telerik.Web.UI.DockCommand)){e.radDock=this;
var g=null;
if(e.command){g={command:eval(e.command)};
delete e.command;
}var a=$create(d,e,g,null,c[f]);
this._commands[a.get_name()]=a;
}else{throw Error.invalidOperation(e.clientTypeName+" does not inherit from Telerik.Web.UI.DockCommand.");
}}}},_updateToggleCommandsState:function(){var a=this.getCommand("ExpandCollapse");
if(a){a.set_state(this.get_collapsed()?2:1);
}var b=this.getCommand("PinUnpin");
if(b){b.set_state(this.get_pinned()?2:1);
}},_setPinUnpinVisibility:function(){var a=this.getCommand("PinUnpin");
if(a){a.get_element().style.display=this.get_dockZoneID()?"none":"";
}},_getBounds:function(a){if(!a){a=this.get_element();
}return $telerik.getBounds(a);
},_getMarginBox:function(a){if(!a){a=this.get_element();
}return $telerik.getMarginBox(a);
},_getBorderBox:function(a){if(!a){a=this.get_element();
}return $telerik.getBorderBox(a);
},_resetPosition:function(){var a=this.get_element();
a.style.top="";
a.style.left="";
a.style.position="";
if(typeof(this.originalZIndex)=="undefined"){this.originalZIndex="";
}a.style.zIndex=this.originalZIndex;
},_setContentContainerHeight:function(e){var a=this.get_contentContainer();
if(!a){return;
}if(this._height!=null||this._resizable){var d=this._getBounds();
var b=e!=null?parseInt(e):d.height;
var g=this._getBounds(this._topBar);
var f=this._getBounds(this._bottomBar);
var c=b-g.height-f.height;
a.style.height=(c<0?0:c)+"px";
}else{a.style.height="";
}},_restorePosition:function(){var a=$find(this.get_dockZoneID());
if(a){a.dock(this,this.get_index());
}else{this.undock();
}},_getLocation:function(a){if(!a){a=this.get_element();
}return $telerik.getLocation(a);
},_setLocation:function(a){$telerik.setLocation(this.get_element(),a);
},_setSize:function(a,b){var c=this._getBounds();
this._setHeight(b);
if(!a){a=c.width;
}this._setWidthHtmlEl(a);
},_setHeight:function(a){this._setContentContainerHeight(a);
this._setHeightHtmlEl(a);
},get_contentContainer:function(){if(!this._contentContainer){this._contentContainer=$get(this.get_id()+"_C");
}return this._contentContainer;
},get_titleBar:function(){if(!this._titleBar){this._titleBar=$get(this.get_id()+"_T");
}return this._titleBar;
},get_commandsContainer:function(){if(!this._commandsContainer){var a=this.get_titleBar();
if(a){this._commandsContainer=$telerik.getElementByClassName(a,"rdCommands","UL");
}else{this._commandsContainer=null;
}}return this._commandsContainer;
},get_titleElement:function(){if(!this._titleElement){var a=this.get_titleBar();
this._titleElement=a?a.getElementsByTagName("em")[0]:null;
}return this._titleElement;
},get_innerDivElement:function(c){var b=this._tableElement;
if(b){if(b.rows.length>1){var a=b.rows[1].cells[1];
if(a){return a.getElementsByTagName("div")[c];
}}}return this.get_element().getElementsByTagName("div")[c];
},saveClientState:function(){var a={Top:this.get_top(),Left:this.get_left(),DockZoneID:this.get_dockZoneID(),Collapsed:this.get_collapsed(),Pinned:this.get_pinned(),Resizable:this.get_resizable(),Closed:this.get_closed(),Width:this.get_width(),Height:this.get_height(),ExpandedHeight:this._expandedHeight,Index:this.get_index()};
return Sys.Serialization.JavaScriptSerializer.serialize(a);
},conditionalPostback:function(a){if(this.get_autoPostBack()){this.doPostBack(a);
}},doPostBack:function(a){__doPostBack(this.get_uniqueID(),a);
},add_command:function(a){this.get_events().addHandler("command",a);
},remove_command:function(a){this.get_events().removeHandler("command",a);
},raise_command:function(a){this.raiseEvent("command",a);
},add_dragStart:function(a){this.get_events().addHandler("dragStart",a);
},remove_dragStart:function(a){this.get_events().removeHandler("dragStart",a);
},raise_dragStart:function(a){this.raiseEvent("dragStart",a);
},add_drag:function(a){this.get_events().addHandler("drag",a);
},remove_drag:function(a){this.get_events().removeHandler("drag",a);
},raise_drag:function(a){this.raiseEvent("drag",a);
},add_dragEnd:function(a){this.get_events().addHandler("dragEnd",a);
},remove_dragEnd:function(a){this.get_events().removeHandler("dragEnd",a);
},raise_dragEnd:function(a){this.raiseEvent("dragEnd",a);
},add_dockPositionChanged:function(a){this.get_events().addHandler("dockPositionChanged",a);
},remove_dockPositionChanged:function(a){this.get_events().removeHandler("dockPositionChanged",a);
},raise_dockPositionChanged:function(a){this.raiseEvent("dockPositionChanged",a);
this.conditionalPostback("dockPositionChanged");
},add_dockPositionChanging:function(a){this.get_events().addHandler("dockPositionChanging",a);
},remove_dockPositionChanging:function(a){this.get_events().removeHandler("dockPositionChanging",a);
},raise_dockPositionChanging:function(a){this.raiseEvent("dockPositionChanging",a);
},add_initialize:function(a){this.get_events().addHandler("initialize",a);
},remove_initialize:function(a){this.get_events().removeHandler("initialize",a);
},raise_initialize:function(a){this.raiseEvent("initialize",a);
},add_resizeStart:function(a){this.get_events().addHandler("resizeStart",a);
},remove_resizeStart:function(a){this.get_events().removeHandler("resizeStart",a);
},raise_resizeStart:function(a){this.raiseEvent("resizeStart",a);
},add_resizeEnd:function(a){this.get_events().addHandler("resizeEnd",a);
},remove_resizeEnd:function(a){this.get_events().removeHandler("resizeEnd",a);
},raise_resizeEnd:function(a){this.raiseEvent("resizeEnd",a);
},get_top:function(){return this._top;
},set_top:function(a){if(a!=""){a=parseInt(a);
if(this._initialized){this.get_element().style.top=a+"px";
}}this._top=a;
this.updateClientState();
},get_left:function(){return this._left;
},set_left:function(a){if(a!=""){a=parseInt(a);
if(this._initialized){this.get_element().style.left=a+"px";
}}this._left=a;
this.updateClientState();
},_onCloseAnimationEnd:function(){var a=this.get_element();
var b=this.get_contentContainer();
var c=this.getCommand("Close");
var d=this.get_titleElement();
if(d!=null){d.style.display="block";
}if(this._closed){a.style.display="none";
this.updateClientState();
if(c){Telerik.Web.UI.DockCloseCommand.callBaseMethod(c,"onCommand");
}}else{a.style.display="block";
this._repaintHelper();
if(!this._collapsed){this.set_height(this.get_height());
}$telerik.repaintChildren(this);
this.updateClientState();
if(c){Telerik.Web.UI.DockCloseCommand.callBaseMethod(c,"onCommand");
}}},get_closed:function(){return this._closed;
},set_closed:function(e,a){if(!this._initialized){return;
}this._closed=e;
a=a?a:false;
var d=this.get_enableAnimation()?this._animationDuration:0;
if(!a||d==0){this._onCloseAnimationEnd();
return;
}var c=this.get_element();
var b=Function.createDelegate(this,this._onCloseAnimationEnd);
var f=this.get_titleElement();
if(f!=null){f.style.display="none";
}if(e){$telerik.$(c).hide(d,b);
}else{$telerik.$(c).show(d,b);
}},get_collapsed:function(){return this._collapsed;
},set_collapsed:function(i,a){a=a?a:false;
var g=this._collapsed;
this._collapsed=i;
if(!this._initialized){return;
}var h=this;
var f=this.get_element();
var b=this._tableElement;
var m=this.get_contentContainer();
var j=this.get_enableAnimation()?this.get_animationDuration():0;
if(!a){j=0;
}var d={};
var c=this.getCommand("ExpandCollapse");
f.style.height="auto";
if(this._resizable){b.style.height="auto";
}if(this._collapsed){this._expandedHeight=this._height?parseInt(this._height):parseInt(h._getBounds().height);
d.height="0px";
$telerik.$(m).animate(d,j,function(){h._configureHandles(false);
h._setContentContainerHeight();
h.addCssClass("rdCollapsed");
if(c){c.set_state(2);
Telerik.Web.UI.DockExpandCollapseCommand.callBaseMethod(c,"onCommand");
}});
}else{if(g&&!this._collapsed&&!this._expandedHeight){if(this._height){this._expandedHeight=parseInt(this._height);
}else{m.style.height="auto";
h.removeCssClass("rdCollapsed");
this._expandedHeight=parseInt(h._getBounds().height);
h.addCssClass("rdCollapsed");
}}h.removeCssClass("rdCollapsed");
var k=this._getBounds(this._topBar).height;
var e=this._getBounds(this._bottomMiddleBar).height;
var l=parseInt(this._expandedHeight)-k-e;
d.height=l+"px";
m.style.height="0px";
$telerik.$(m).animate(d,j,function(){m.style.display="";
b.style.height="";
if(h.get_height()!=null){h._setHeightHtmlEl(h._expandedHeight);
}if(h._resizable){h._configureHandles(true);
}if(h.get_height()==null){f.style.height="";
}h._setContentContainerHeight();
if(c){c.set_state(1);
}$telerik.repaintChildren(h);
if(h._resizable){h.set_height($telerik.getBounds(f).height+"px");
}h.updateClientState();
if(c){Telerik.Web.UI.DockExpandCollapseCommand.callBaseMethod(c,"onCommand");
}});
}},get_autoPostBack:function(){return this._autoPostBack;
},set_autoPostBack:function(a){this._autoPostBack=a;
},get_commands:function(){return this._commands;
},set_commands:function(a){this._commands=a;
this._originalCommandsObject=a;
},get_dockMode:function(){return this._dockMode;
},set_dockMode:function(a){this._dockMode=a;
},get_dockZoneID:function(){return this._dockZoneID;
},set_dockZoneID:function(a){if(!this._collapsed){this._configureHandles(true);
}this._dockZoneID=a;
},get_forbiddenZones:function(){return this._forbiddenZones;
},set_forbiddenZones:function(a){this._forbiddenZones=a;
},get_allowedZones:function(){return this._allowedZones;
},set_allowedZones:function(a){this._allowedZones=a;
},get_height:function(){return this._height;
},set_height:function(a){this._height=a;
this.updateClientState();
if(this._initialized){if(this._tableElement){this._tableElement.style.height="auto";
}this._setHeight(a);
}},get_index:function(){return this._index;
},set_index:function(a){this._index=a;
},get_layoutID:function(){return this._layoutID;
},set_layoutID:function(a){this._layoutID=a;
},get_enableDrag:function(){return this._enableDrag;
},set_enableDrag:function(a){this._enableDrag=a;
this._initializeDrag();
},get_enableAnimation:function(){return this._enableAnimation;
},set_enableAnimation:function(a){this._enableAnimation=a;
},get_animationDuration:function(){return this._animationDuration;
},set_animationDuration:function(a){this._animationDuration=a;
},get_pinned:function(){return this._pinned;
},set_pinned:function(e){this._pinned=e;
if(!this._initialized){return;
}var c=this.getCommand("PinUnpin");
if(c){c.set_state(e?2:1);
}if($telerik.isIE6){if(e){this.set_enableDrag(false);
}else{this.set_enableDrag(true);
}return;
}var a=this.get_element();
a.style.position="absolute";
var b=$telerik.getScrollOffset(a,true);
var d=this._getLocation(a);
if(e){d=this.subtractPoints(d,b);
this._setLocation(d);
a.style.position="fixed";
this.set_enableDrag(false);
}else{d=this.addPoints(d,b);
this._setLocation(d);
this.set_enableDrag(true);
}},get_title:function(){return this._title;
},set_title:function(b){this._title=b;
var a=this.get_titleElement();
if(a){a.innerHTML=b;
}},get_uniqueID:function(){return this._uniqueID;
},set_uniqueID:function(a){this._uniqueID=a;
},get_uniqueName:function(){return this._uniqueName;
},set_uniqueName:function(a){this._uniqueName=a;
},set_visibleTitlebar:function(a){if(a==null){a=true;
}var b=this._topBar;
if(a){this.get_titleBar().style.display="";
Sys.UI.DomElement.removeCssClass(b,"rdNone");
}else{Sys.UI.DomElement.addCssClass(b,"rdNone");
this.get_titleBar().style.display="none";
}},get_width:function(){return this._width;
},set_width:function(a){this._width=a;
this.updateClientState();
if(this._initialized){this._setWidthHtmlEl(a);
}},get_skin:function(){return this._skin;
},set_skin:function(a){if(a&&this._skin!=a){this._skin=a;
}},get_resizable:function(){return this._resizable;
},set_resizable:function(a){this._resizable=a;
this._makeResizable();
},get_dockZone:function(){return this._dockZone;
},set_dockZone:function(a){this._dockZone=a;
}};
Telerik.Web.UI.RadDock.registerClass("Telerik.Web.UI.RadDock",Telerik.Web.UI.RadWebControl);
Telerik.Web.UI.RadDock.prototype.repaint=function(){this._repaintHelper();
};
Telerik.Web.UI.DockCommand=function(a){Telerik.Web.UI.DockCommand.initializeBase(this,[a]);
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(a){this.get_events().addHandler("command",a);
},remove_command:function(a){this.get_events().removeHandler("command",a);
},raise_command:function(a){var b=this.get_events().getHandler("command");
if(b){b(this.get_radDock(),a);
}},get_clientTypeName:function(){return this._clientTypeName;
},set_clientTypeName:function(a){this._clientTypeName=a;
},get_cssClass:function(){return this._cssClass;
},set_cssClass:function(a){this._cssClass=a;
},get_name:function(){return this._name;
},set_name:function(a){this._name=a;
},get_text:function(){return this._text;
},set_text:function(a){this._text=a;
},get_autoPostBack:function(){return this._autoPostBack;
},set_autoPostBack:function(a){this._autoPostBack=a;
},get_radDock:function(){return this._radDock;
},set_radDock:function(a){this._radDock=a;
},onCommand:function(a){var b=new Sys.CancelEventArgs();
b.command=this;
b.event=a;
b.Command=this;
this.raise_command(b);
if(b.get_cancel()){return;
}this.get_radDock().raise_command(b);
if(b.get_cancel()){return;
}this.get_radDock().updateClientState();
this.conditionalPostback();
},onMouseDown:function(a){$telerik.cancelRawEvent(a);
},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,mousedown:this.onMouseDown},this);
},dispose:function(){$clearHandlers(this.get_element());
Telerik.Web.UI.DockCommand.callBaseMethod(this,"dispose");
}};
Telerik.Web.UI.DockCommand.registerClass("Telerik.Web.UI.DockCommand",Sys.UI.Control);
Telerik.Web.UI.DockToggleCommand=function(a){Telerik.Web.UI.DockToggleCommand.initializeBase(this,[a]);
this._state=1;
this._alternateCssClass="rdCustom";
this._alternateText="Custom";
this._initialSetState=false;
};
Telerik.Web.UI.DockToggleCommand.prototype={updateState:function(){var b=this.get_element();
var a=b.getElementsByTagName("span")[0];
if(this.get_state()==1){b.title=this.get_text();
Sys.UI.DomElement.addCssClass(a,this.get_cssClass());
Sys.UI.DomElement.removeCssClass(a,this.get_alternateCssClass());
}else{b.title=this.get_alternateText();
Sys.UI.DomElement.addCssClass(a,this.get_alternateCssClass());
Sys.UI.DomElement.removeCssClass(a,this.get_cssClass());
}},get_state:function(){return this._state;
},set_state:function(a){this._state=a;
if(this._initialSetState){this.updateState();
}},get_alternateCssClass:function(){return this._alternateCssClass;
},set_alternateCssClass:function(a){this._alternateCssClass=a;
},get_alternateText:function(){return this._alternateText;
},set_alternateText:function(a){this._alternateText=a;
},initialize:function(){Telerik.Web.UI.DockToggleCommand.callBaseMethod(this,"initialize");
this._initialSetState=true;
this.updateState();
},dispose:function(){Telerik.Web.UI.DockToggleCommand.callBaseMethod(this,"dispose");
}};
Telerik.Web.UI.DockToggleCommand.registerClass("Telerik.Web.UI.DockToggleCommand",Telerik.Web.UI.DockCommand);
Telerik.Web.UI.DockCloseCommand=function(a){Telerik.Web.UI.DockCloseCommand.initializeBase(this,[a]);
this._cssClass="rdClose";
this._name="Close";
this._text="Close";
};
Telerik.Web.UI.DockCloseCommand.prototype={onCommand:function(a){this.get_radDock().set_closed(true,true);
}};
Telerik.Web.UI.DockCloseCommand.registerClass("Telerik.Web.UI.DockCloseCommand",Telerik.Web.UI.DockCommand);
Telerik.Web.UI.DockExpandCollapseCommand=function(a){Telerik.Web.UI.DockExpandCollapseCommand.initializeBase(this,[a]);
this._cssClass="rdCollapse";
this._alternateCssClass="rdExpand";
this._name="ExpandCollapse";
this._text="Collapse";
this._alternateText="Expand";
};
Telerik.Web.UI.DockExpandCollapseCommand.prototype={onCommand:function(a){this.get_radDock().set_collapsed(!this.get_radDock().get_collapsed(),true);
}};
Telerik.Web.UI.DockExpandCollapseCommand.registerClass("Telerik.Web.UI.DockExpandCollapseCommand",Telerik.Web.UI.DockToggleCommand);
Telerik.Web.UI.DockPinUnpinCommand=function(a){Telerik.Web.UI.DockPinUnpinCommand.initializeBase(this,[a]);
this._cssClass="rdUnpin";
this._alternateCssClass="rdPin";
this._name="PinUnpin";
this._text="Pin";
this._alternateText="Unpin";
};
Telerik.Web.UI.DockPinUnpinCommand.prototype={onCommand:function(a){this.get_radDock().set_pinned(!this.get_radDock().get_pinned());
Telerik.Web.UI.DockPinUnpinCommand.callBaseMethod(this,"onCommand");
}};
Telerik.Web.UI.DockPinUnpinCommand.registerClass("Telerik.Web.UI.DockPinUnpinCommand",Telerik.Web.UI.DockToggleCommand);
if(typeof(Sys)!=='undefined')Sys.Application.notifyScriptLoaded();
