﻿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,"rdRtl");
}
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,false);
},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,_d,_e){
_e=_e?_e:false;
var _f=_b.get_element();
var _10=this.get_element();
var _11=this;
var _12=_b.get_enableAnimation()?_b.get_animationDuration():0;
if(!_e){
_12=0;
}
var _13={};
var _14;
if(_c){
_14=_c;
_14.style.display="";
var _15=$telerik.getLocation(_14);
var _16=$telerik.getBounds(_14);
_13.left=_15.x;
_13.top=_15.y;
_13.width=_16.width;
}else{
_14=this._clearElement;
_12=0;
_13.width=$telerik.getBounds(_f).width;
}
$telerik.$(_f).animate(_13,_12,function(){
if(_14){
if(_14.className.indexOf("rdPlaceHolder")!=-1){
_14.style.display="none";
}
}
if(_b._closed){
_f.style.display="none";
}
_10.insertBefore(_f,_14);
var _17=$find(_b.get_dockZoneID());
if(_17){
_17._resetDockIndices();
}
_b.set_dockZoneID(_10.id);
if(_11.get_fitDocks()){
if(!_11.get_isHorizontal()){
_b._fitWidth();
}
}else{
if(!_11.get_isHorizontal()){
_b._unfitWidth();
}
}
_b._resetPosition();
if(_b._tableElement){
_b._setSize();
}
_b._setPinUnpinVisibility();
_11._resetDockIndices();
if(_d){
_b.raise_dockPositionChanged(new Sys.EventArgs());
}
});
},_resetDockIndices:function(){
var _18=this.get_docks();
for(var i=0;i<_18.length;i++){
_18[i].set_index(i);
_18[i].updateClientState();
}
},get_isHorizontal:function(){
return Sys.UI.DomElement.containsCssClass(this.get_element(),"rdHorizontal");
},_lastFoundItem:null,_lastFoundItemBounds:null,_findItemAt:function(_1a,_1b){
var el=this.get_element();
if(!(this._lastFoundItem&&this._isInside(_1a,this._lastFoundItemBounds))){
this._lastFoundItem=null;
this._lastFoundItemBounds=null;
var _1d=el.firstChild;
while(_1d!=null){
if(_1d!=this._placeholder&&_1d!=_1b&&_1d.nodeType!=3&&_1d.nodeType!=8){
var _1e=this._getMarginBox(_1b);
var _1f=this._getBorderBox(_1b);
var _20=$telerik.getBounds(_1d);
var loc=$telerik.getLocation(_1d);
_20.x=loc.x;
_20.y=loc.y;
_20.x-=(($telerik.isSafari?0:_1e.left)+_1f.left+2);
_20.y-=(_1e.top+_1f.top+2);
_20.width+=(($telerik.isSafari?0:_1e.right)+_1f.right+2);
_20.height+=(_1e.bottom+_1f.bottom+2);
if(this._isInside(_1a,_20)){
this._lastFoundItem=_1d;
this._lastFoundItemBounds=_20;
break;
}
}
_1d=_1d.nextSibling;
}
}
return this._lastFoundItem;
},_isInside:function(_22,_23){
return (_22.x>_23.x&&_22.x<(_23.x+_23.width)&&_22.y>_23.y&&_22.y<(_23.y+_23.height));
},_showPlaceholder:function(_24,_25){
this._repositionPlaceholder(_24.get_element(),_25);
var _26=_24._getBoundsWithBorderAndMargin();
var _27=_24._getMarginBox(this._placeholder);
var _28=_24._getBorderBox(this._placeholder);
var _29=this.get_isHorizontal();
var _2a=this._placeholder.style;
_2a.height=_26.height-(_27.vertical+_28.vertical)+"px";
_2a.width=this.get_fitDocks()&&!_29?"100%":_26.width-(_27.horizontal+_28.horizontal)+"px";
_2a.display="block";
},_repositionPlaceholder:function(_2b,_2c){
var _2d=this._findItemAt(_2c,_2b);
var _2e=this.get_element();
if(null==_2d){
_2e.insertBefore(this._placeholder,this._clearElement);
}else{
if(_2d.previousSibling!=this._placeholder){
_2e.insertBefore(this._placeholder,_2d);
}
}
},_getMarginBox:function(_2f){
return $telerik.getMarginBox(_2f);
},_getBorderBox:function(_30){
return $telerik.getBorderBox(_30);
},_hidePlaceholder:function(){
this._placeholder.style.display="none";
this._lastFoundItem=null;
this._lastFoundItemBounds=null;
},canDrop:function(_31){
return ((_31.get_dockMode()&Telerik.Web.UI.DockMode.Docked)>0&&Array.indexOf(_31.get_forbiddenZones(),this.get_uniqueName())<0);
},drop:function(_32){
var _33=new Sys.CancelEventArgs();
_32.raise_dockPositionChanging(_33);
this._hidePlaceholder();
if(this.get_highlightedCssClass()!=null){
this.removeCssClass(this.get_highlightedCssClass());
}
if(_33.get_cancel()){
_32._restorePosition();
}else{
this._dockBefore(_32,this._placeholder,true,true);
}
},dragEnterTarget:function(_34,_35){
this._showPlaceholder(_34,_35);
if(this.get_highlightedCssClass()!=null){
this.addCssClass(this.get_highlightedCssClass());
}
},onDragInTarget:function(_36,_37){
this._repositionPlaceholder(_36.get_element(),_37);
},dragLeaveTarget:function(_38){
this._hidePlaceholder();
if(this.get_highlightedCssClass()!=null){
this.removeCssClass(this.get_highlightedCssClass());
}
},pointInZone:function(e){
return $telerik.isMouseOverElement(this.get_element(),e);
},hitTest:function(_3a,e){
if(!this.canDrop(_3a)){
return false;
}
if(this.pointInZone(e)){
var _3c=$telerik.getDocumentRelativeCursorPosition(e);
loc={x:_3c.left,y:_3c.top};
this.dragEnterTarget(_3a,loc);
return true;
}else{
this.dragLeaveTarget(_3a);
return false;
}
},getScrollOffset:function(_3d,_3e){
var _3f=_3d.scrollLeft;
var top=_3d.scrollTop;
if(_3e){
var _41=_3d.parentNode;
while(_41!=null&&_41.scrollLeft!=null){
_3f+=_41.scrollLeft;
top+=_41.scrollTop;
if(_41==document.body&&(_3f!=0&&top!=0)){
break;
}
_41=_41.parentNode;
}
}
return {x:_3f,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(_44){
this._clientID=_44;
},get_fitDocks:function(){
return this._fitDocks;
},set_fitDocks:function(_45){
this._fitDocks=_45;
},get_highlightedCssClass:function(){
return this._highlightedCssClass;
},set_highlightedCssClass:function(_46){
this._highlightedCssClass=_46;
},get_layoutID:function(){
return this._layoutID;
},set_layoutID:function(_47){
this._layoutID=_47;
},get_uniqueName:function(){
return this._uniqueName;
},set_uniqueName:function(_48){
this._uniqueName=_48;
}};
Telerik.Web.UI.RadDockZone.registerClass("Telerik.Web.UI.RadDockZone",Telerik.Web.UI.RadWebControl);


if(typeof(Sys)!=='undefined')Sys.Application.notifyScriptLoaded();