Type.registerNamespace("Telerik.Web.UI");
Telerik.Web.UI.RadDockZonesGlobalArray=[];
Telerik.Web.UI.registerRadDockZone=function(_1){
if(!Array.contains(this.RadDockZonesGlobalArray,_1)){
Array.add(this.RadDockZonesGlobalArray,_1);
}
};
Telerik.Web.UI.unregisterRadDockZone=function(_2){
Array.remove(this.RadDockZonesGlobalArray,_2);
};
Telerik.Web.UI.RadDockZone=function(_3){
Telerik.Web.UI.RadDockZone.initializeBase(this,[_3]);
this._clientID=null;
this._highlightedCssClass=null;
this._fitDocks=true;
this._uniqueName=null;
this._layoutID=null;
};
Telerik.Web.UI.RadDockZone.prototype={initialize:function(){
Telerik.Web.UI.RadDockZone.callBaseMethod(this,"initialize");
this._resetDockIndices();
this._placeholder=$get(this.get_clientID()+"_D");
if($telerik.isRightToLeft(this.get_element())){
Sys.UI.DomElement.addCssClass(this._placeholder,"raddock_rtl");
}
this._clearElement=$get(this.get_clientID()+"_C");
Telerik.Web.UI.registerRadDockZone(this);
},dispose:function(){
Telerik.Web.UI.unregisterRadDockZone(this);
Telerik.Web.UI.RadDockZone.callBaseMethod(this,"dispose");
},dock:function(_4,_5){
var _6=this.get_docks();
var _7=null;
if(_6.length>_5){
_7=_6[_5].get_element();
}
this._dockBefore(_4,_7);
},get_docks:function(){
var _8=[];
var _9=this.get_element().firstChild;
while(_9!=null){
if(_9!=this._placeholder&&_9.id){
var _a=$find(_9.id);
if(_a&&Telerik.Web.UI.RadDock&&Telerik.Web.UI.RadDock.isInstanceOfType(_a)){
Array.add(_8,_a);
}
}
_9=_9.nextSibling;
}
return _8;
},_dockBefore:function(_b,_c){
var _d=_b.get_element();
var _e=this.get_element();
if(_c){
_e.insertBefore(_d,_c);
}else{
_e.insertBefore(_d,this._clearElement);
}
var _f=$find(_b.get_dockZoneID());
if(_f){
_f._resetDockIndices();
}
_b.set_dockZoneID(_e.id);
if(this.get_fitDocks()){
if(!this.get_isHorizontal()){
_b._fitWidth();
}
}else{
if(!this.get_isHorizontal()){
_b._unfitWidth();
}
}
_b._resetPosition();
if(_b._tableElement){
_b._setSize();
}
_b._setPinUnpinVisibility();
this._resetDockIndices();
},_resetDockIndices:function(){
var _10=this.get_docks();
for(var i=0;i<_10.length;i++){
_10[i].set_index(i);
_10[i].updateClientState();
}
},get_isHorizontal:function(){
return Sys.UI.DomElement.containsCssClass(this.get_element(),"rdHorizontal");
},_lastFoundItem:null,_lastFoundItemBounds:null,_findItemAt:function(_12,_13){
var el=this.get_element();
if(!(this._lastFoundItem&&this._isInside(_12,this._lastFoundItemBounds))){
this._lastFoundItem=null;
this._lastFoundItemBounds=null;
var _15=el.firstChild;
while(_15!=null){
if(_15!=this._placeholder&&_15!=_13&&_15.nodeType!=3&&_15.nodeType!=8){
var _16=this._getMarginBox(_13);
var _17=this._getBorderBox(_13);
var _18=$telerik.getBounds(_15);
var loc=$telerik.getLocation(_15);
_18.x=loc.x;
_18.y=loc.y;
_18.x-=(($telerik.isSafari?0:_16.left)+_17.left+2);
_18.y-=(_16.top+_17.top+2);
_18.width+=(($telerik.isSafari?0:_16.right)+_17.right+2);
_18.height+=(_16.bottom+_17.bottom+2);
if(this._isInside(_12,_18)){
this._lastFoundItem=_15;
this._lastFoundItemBounds=_18;
break;
}
}
_15=_15.nextSibling;
}
}
return this._lastFoundItem;
},_isInside:function(_1a,_1b){
return (_1a.x>_1b.x&&_1a.x<(_1b.x+_1b.width)&&_1a.y>_1b.y&&_1a.y<(_1b.y+_1b.height));
},_showPlaceholder:function(_1c,_1d){
this._repositionPlaceholder(_1c.get_element(),_1d);
var _1e=_1c._getBoundsWithBorderAndMargin();
var _1f=_1c._getMarginBox(this._placeholder);
var _20=_1c._getBorderBox(this._placeholder);
var _21=this.get_isHorizontal();
var _22=this._placeholder.style;
_22.height=_1e.height-(_1f.vertical+_20.vertical)+"px";
_22.width=this.get_fitDocks()&&!_21?"100%":_1e.width-(_1f.horizontal+_20.horizontal)+"px";
_22.display="block";
},_repositionPlaceholder:function(_23,_24){
var _25=this._findItemAt(_24,_23);
var _26=this.get_element();
if(null==_25){
_26.insertBefore(this._placeholder,this._clearElement);
}else{
if(_25.previousSibling!=this._placeholder){
_26.insertBefore(this._placeholder,_25);
}
}
},_getMarginBox:function(_27){
return $telerik.getMarginBox(_27);
},_getBorderBox:function(_28){
return $telerik.getBorderBox(_28);
},_hidePlaceholder:function(){
this._placeholder.style.display="none";
this._lastFoundItem=null;
this._lastFoundItemBounds=null;
},canDrop:function(_29){
return ((_29.get_dockMode()&Telerik.Web.UI.DockMode.Docked)>0&&Array.indexOf(_29.get_forbiddenZones(),this.get_uniqueName())<0);
},drop:function(_2a){
var _2b=new Sys.CancelEventArgs();
_2a.raise_dockPositionChanging(_2b);
this._hidePlaceholder();
if(this.get_highlightedCssClass()!=null){
this.removeCssClass(this.get_highlightedCssClass());
}
if(_2b.get_cancel()){
_2a._restorePosition();
}else{
this._dockBefore(_2a,this._placeholder);
_2a.raise_dockPositionChanged(new Sys.EventArgs());
}
},dragEnterTarget:function(_2c,_2d){
this._showPlaceholder(_2c,_2d);
if(this.get_highlightedCssClass()!=null){
this.addCssClass(this.get_highlightedCssClass());
}
},onDragInTarget:function(_2e,_2f){
this._repositionPlaceholder(_2e.get_element(),_2f);
},dragLeaveTarget:function(_30){
this._hidePlaceholder();
if(this.get_highlightedCssClass()!=null){
this.removeCssClass(this.get_highlightedCssClass());
}
},pointInZone:function(e){
return $telerik.isMouseOverElement(this.get_element(),e);
},hitTest:function(_32,e){
if(!this.canDrop(_32)){
return false;
}
if(this.pointInZone(e)){
var _34=$telerik.getDocumentRelativeCursorPosition(e);
loc={x:_34.left,y:_34.top};
this.dragEnterTarget(_32,loc);
return true;
}else{
this.dragLeaveTarget(_32);
return false;
}
},getScrollOffset:function(_35,_36){
var _37=_35.scrollLeft;
var top=_35.scrollTop;
if(_36){
var _39=_35.parentNode;
while(_39!=null&&_39.scrollLeft!=null){
_37+=_39.scrollLeft;
top+=_39.scrollTop;
if(_39==document.body&&(_37!=0&&top!=0)){
break;
}
_39=_39.parentNode;
}
}
return {x:_37,y:top};
},addPoints:function(p1,p2){
return {x:p1.x+p2.x,y:p1.y+p2.y};
},get_clientID:function(){
return this._clientID;
},set_clientID:function(_3c){
this._clientID=_3c;
},get_fitDocks:function(){
return this._fitDocks;
},set_fitDocks:function(_3d){
this._fitDocks=_3d;
},get_highlightedCssClass:function(){
return this._highlightedCssClass;
},set_highlightedCssClass:function(_3e){
this._highlightedCssClass=_3e;
},get_layoutID:function(){
return this._layoutID;
},set_layoutID:function(_3f){
this._layoutID=_3f;
},get_uniqueName:function(){
return this._uniqueName;
},set_uniqueName:function(_40){
this._uniqueName=_40;
}};
Telerik.Web.UI.RadDockZone.registerClass("Telerik.Web.UI.RadDockZone",Telerik.Web.UI.RadWebControl);

