/*
jQWidgets v3.7.1 (2015-Feb)
Copyright (c) 2011-2015 jQWidgets.
License: http://jqwidgets.com/license/
*/
(function(n){n.jqx.jqxWidget("jqxDockPanel","",{});n.extend(n.jqx._jqxDockPanel.prototype,{defineInstance:function(){var t={width:null,height:null,lastchildfill:!0,disabled:!1,events:["layout"]};return n.extend(!0,this,t),t},createInstance:function(){var t=this;this.host.addClass(this.toThemeProperty("jqx-dockpanel"));this.host.addClass(this.toThemeProperty("jqx-rc-all"));this.childrenCount=n(this.host).children().length;this.host.wrapInner('<div style="overflow: hidden; width: 100%; height: 100%;" class="innerContainer"><\/div>');this.$wrapper=this.host.find(".innerContainer");this.$wrapper.css("position","relative");this.sizeCache=[];this.performLayout();n.jqx.utilities.resize(this.host,function(){t.refresh()})},render:function(){this.width!=null&&this.width.toString().indexOf("px")!=-1?this.host.width(this.width):this.width==undefined||isNaN(this.width)||this.host.width(this.width);this.height!=null&&this.height.toString().indexOf("px")!=-1?this.host.height(this.height):this.height==undefined||isNaN(this.height)||this.host.height(this.height);this.sizeCache=[];this.performLayout()},resize:function(n,t){this.width=n;this.height=t;this.render()},performLayout:function(){if(!this.disabled){var o=this.childrenCount,r=0,u=0,f=0,e=0,t=this,i={width:this.host.width(),height:this.host.height()};this.sizeCache.length<this.$wrapper.children().length&&n.each(this.$wrapper.children(),function(i){var r=n(this),u;r.css("position","absolute");u={width:r.css("width"),height:r.css("height")};t.sizeCache[i]=u});n.each(this.$wrapper.children(),function(s){var a=this.getAttribute("dock"),c,l,h;if(a==undefined&&(a="left"),s==o-1&&t.lastchildfill&&(a="fill"),c=n(this),c.css("position","absolute"),c.css("width",t.sizeCache[s].width),c.css("height",t.sizeCache[s].height),l={width:c.outerWidth(),height:c.outerHeight()},h={x:f,y:e,width:Math.max(0,i.width-(f+r)),height:Math.max(0,i.height-(e+u))},s<o)switch(a){case"left":f+=l.width;h.width=l.width;break;case"top":e+=l.height;h.height=l.height;break;case"right":r+=l.width;h.x=Math.max(0,i.width-r);h.width=l.width;break;case"bottom":u+=l.height;h.y=Math.max(0,i.height-u);h.height=l.height}c.css("left",h.x);c.css("top",h.y);c.css("width",h.width);c.css("height",h.height)});this._raiseevent(0)}},destroy:function(){n.jqx.utilities.resize(this.host,null,!0);this.host.remove()},_raiseevent:function(t,i,r){var f,u;if(this.isInitialized!=undefined&&this.isInitialized==!0)return f=this.events[t],u=new n.Event(f),u.previousValue=i,u.currentValue=r,u.owner=this,this.host.trigger(u)},propertyChangedHandler:function(n){this.isInitialized&&n.render()},refresh:function(){this.render()}})})(jqxBaseFramework)