(function(g){g.fn.layout=function(t){function L(b){if(!b)return true;var c=b.keyCode;if(c<33)return true;var e={38:"north",40:"south",37:"west",39:"east"},d=b.shiftKey,f=b.ctrlKey,i,k,j,l;if(f&&c>=37&&c<=40&&p[e[c]].enableCursorHotkey)l=e[c];else if(f||d)g.each(m.borderPanes.split(","),function(q,w){i=p[w];k=i.customHotkey;j=i.customHotkeyModifier;if(d&&j=="SHIFT"||f&&j=="CTRL"||f&&d)if(k&&c==(isNaN(k)||k<=9?k.toUpperCase().charCodeAt(0):k)){l=w;return false}});if(!l||!s[l]||!p[l].closable||n[l].isHidden)return true;
ka(l);b.stopPropagation();return b.returnValue=false}function H(b){if(this&&this.tagName)b=this;var c;if(K(b))c=s[b];else if(g(b).data("layoutRole"))c=g(b);else g(b).parents().each(function(){if(g(this).data("layoutRole")){c=g(this);return false}});if(c&&c.length){var e=c.data("layoutEdge");b=n[e];b.cssSaved&&M(e);if(b.isSliding||b.isResizing||b.isClosed)b.cssSaved=false;else{var d={zIndex:m.zIndex.pane_normal+2},f={},i=c.css("overflow"),k=c.css("overflowX"),j=c.css("overflowY");if(i!="visible"){f.overflow=
i;d.overflow="visible"}if(k&&k!="visible"&&k!="auto"){f.overflowX=k;d.overflowX="visible"}if(j&&j!="visible"&&j!="auto"){f.overflowY=k;d.overflowY="visible"}b.cssSaved=f;c.css(d);g.each(m.allPanes.split(","),function(l,q){q!=e&&M(q)})}}}function M(b){if(this&&this.tagName)b=this;var c;if(K(b))c=s[b];else if(g(b).data("layoutRole"))c=g(b);else g(b).parents.each(function(){if(g(this).data("layoutRole")){c=g(this);return false}});if(c&&c.length){b=c.data("layoutEdge");b=n[b];var e=b.cssSaved||{};!b.isSliding&&
!b.isResizing&&c.css("zIndex",m.zIndex.pane_normal);c.css(e);b.cssSaved=false}}function P(b,c,e){var d=g(b);if(d.length)if(m.borderPanes.indexOf(c)==-1)alert(G.errButton+G.Pane.toLowerCase()+": "+c);else{b=p[c].buttonClass+"-"+e;d.addClass(b+" "+b+"-"+c).data("layoutName",p.name);return d}else alert(G.errButton+G.selector+": "+b);return false}function U(b,c,e){switch(c.toLowerCase()){case "toggle":z(b,e);break;case "open":u(b,e);break;case "close":r(b,e);break;case "pin":y(b,e);break;case "toggle-slide":z(b,
e,true);break;case "open-slide":u(b,e,true);break}}function z(b,c,e){(b=P(b,c,"toggle"))&&b.click(function(d){ka(c,!!e);d.stopPropagation()})}function u(b,c,e){(b=P(b,c,"open"))&&b.attr("title",G.Open).click(function(d){Z(c,!!e);d.stopPropagation()})}function r(b,c){(b=P(b,c,"close"))&&b.attr("title",G.Close).click(function(e){Q(c);e.stopPropagation()})}function y(b,c){var e=P(b,c,"pin");if(e){var d=n[c];e.click(function(f){V(g(this),c,d.isSliding||d.isClosed);d.isSliding||d.isClosed?Z(c):Q(c);f.stopPropagation()});
V(e,c,!d.isClosed&&!d.isSliding);m[c].pins.push(b)}}function B(b,c){g.each(m[b].pins,function(e,d){V(g(d),b,c)})}function V(b,c,e){var d=b.attr("pin");if(!(d&&e==(d=="down"))){d=p[c].buttonClass+"-pin";var f=d+"-"+c;c=d+"-up "+f+"-up";d=d+"-down "+f+"-down";b.attr("pin",e?"down":"up").attr("title",e?G.Unpin:G.Pin).removeClass(e?c:d).addClass(e?d:c)}}function wa(b){b=g.extend({},p.cookie,b||{}).name||p.name||"Layout";var c=document.cookie;c=c?c.split(";"):[];for(var e,d=0,f=c.length;d<f;d++){e=g.trim(c[d]).split("=");
if(e[0]==b)return Ma(decodeURIComponent(e[1]))}return""}function xa(b,c){c=g.extend({},p.cookie,c||{});var e=c.name||p.name||"Layout",d="",f="",i=false;if(c.expires.toUTCString)f=c.expires;else if(typeof c.expires=="number"){f=new Date;if(c.expires>0)f.setDate(f.getDate()+c.expires);else{f.setYear(1970);i=true}}if(f)d+=";expires="+f.toUTCString();if(c.path)d+=";path="+c.path;if(c.domain)d+=";domain="+c.domain;if(c.secure)d+=";secure";if(i){n.cookie={};document.cookie=e+"="+d}else{n.cookie=ya(b||c.keys);
document.cookie=e+"="+encodeURIComponent(Na(n.cookie))+d}return g.extend({},n.cookie)}function bb(){xa("",{expires:-1})}function Oa(b){if(b=wa(b)){n.cookie=g.extend({},b);Pa(b)}return b}function Pa(b){g.extend(true,p,b)}function ya(b){var c={},e={isClosed:"initClosed",isHidden:"initHidden"},d,f,i;if(!b)b=p.cookie.keys;if(g.isArray(b))b=b.join(",");b=b.replace(/__/g,".").split(",");for(var k=0,j=b.length;k<j;k++){d=b[k].split(".");f=d[0];d=d[1];if(!(m.allPanes.indexOf(f)<0)){i=n[f][d];if(i!=undefined){if(d==
"isClosed"&&n[f].isSliding)i=true;(c[f]||(c[f]={}))[e[d]?e[d]:d]=i}}}return c}function Na(b){function c(e){var d=[],f=0,i,k,j;for(i in e){k=e[i];j=typeof k;if(j=="string")k='"'+k+'"';else if(j=="object")k=c(k);d[f++]='"'+i+'":'+k}return"{"+d.join(",")+"}"}return c(b)}function Ma(b){try{return window.eval("("+b+")")||{}}catch(c){return{}}}var G={Pane:"Pane",Open:"Open",Close:"Close",Resize:"Resize",Slide:"Slide Open",Pin:"Pin",Unpin:"Un-Pin",selector:"selector",msgNoRoom:"Not enough room to show this pane.",
errContainerMissing:"UI Layout Initialization Error\n\nThe specified layout-container does not exist.",errCenterPaneMissing:"UI Layout Initialization Error\n\nThe center-pane element does not exist.\n\nThe center-pane is a required element.",errContainerHeight:"UI Layout Initialization Warning\n\nThe layout-container \"CONTAINER\" has no height.\n\nTherefore the layout is 0-height and hence 'invisible'!",errButton:"Error Adding Button \n\nInvalid "},p={name:"",scrollToBookmarkOnLoad:true,resizeWithWindow:true,
resizeWithWindowDelay:200,resizeWithWindowMaxDelay:0,onresizeall_start:null,onresizeall_end:null,onload:null,onunload:null,autoBindCustomButtons:false,zIndex:null,defaults:{applyDemoStyles:false,closable:true,resizable:true,slidable:true,initClosed:false,initHidden:false,contentSelector:".ui-layout-content",findNestedContent:false,paneClass:"ui-layout-pane",resizerClass:"ui-layout-resizer",togglerClass:"ui-layout-toggler",buttonClass:"ui-layout-button",minSize:0,maxSize:0,spacing_open:6,spacing_closed:6,
togglerLength_open:50,togglerLength_closed:50,togglerAlign_open:"center",togglerAlign_closed:"center",togglerTip_open:G.Close,togglerTip_closed:G.Open,resizerDblClickToggle:true,noSelectionWhileDragging:true,autoResize:true,autoReopen:true,resizerDragOpacity:1,maskIframesOnResize:true,resizeWhileDragging:false,resizeContentWhileDragging:false,noRoomToOpenTip:G.msgNoRoom,resizerTip:G.Resize,sliderTip:G.Slide,sliderCursor:"pointer",slideTrigger_open:"click",slideTrigger_close:"mouseout",hideTogglerOnSlide:false,
togglerContent_open:"",togglerContent_closed:"",showOverflowOnHover:false,trackMouseWhenSliding:false,enableCursorHotkey:true,customHotkeyModifier:"SHIFT",fxName:"slide",fxSpeed:null,fxSettings:{},fxOpacityFix:true,triggerEventsOnLoad:false,triggerEventsWhileDragging:true,onshow_start:null,onshow_end:null,onhide_start:null,onhide_end:null,onopen_start:null,onopen_end:null,onclose_start:null,onclose_end:null,onresize_start:null,onresize_end:null},north:{paneSelector:".ui-layout-north",size:"auto",
resizerCursor:"n-resize",customHotkey:""},south:{paneSelector:".ui-layout-south",size:"auto",resizerCursor:"s-resize",customHotkey:""},east:{paneSelector:".ui-layout-east",size:200,resizerCursor:"e-resize",customHotkey:""},west:{paneSelector:".ui-layout-west",size:200,resizerCursor:"w-resize",customHotkey:""},center:{paneSelector:".ui-layout-center",minWidth:0,minHeight:0},useStateCookie:false,cookie:{name:"",autoSave:true,autoLoad:true,domain:"",path:"",expires:"",secure:false,keys:"north.size,south.size,east.size,west.size,north.isClosed,south.isClosed,east.isClosed,west.isClosed,north.isHidden,south.isHidden,east.isHidden,west.isHidden"}},
za={slide:{all:{duration:"fast"},north:{direction:"up"},south:{direction:"down"},east:{direction:"right"},west:{direction:"left"}},drop:{all:{duration:"slow"},north:{direction:"up"},south:{direction:"down"},east:{direction:"right"},west:{direction:"left"}},scale:{all:{duration:"fast"}}},n={id:"layout"+(new Date).getTime(),initialized:false,container:{},north:{},south:{},east:{},west:{},center:{},cookie:{}},m={allPanes:"north,south,west,east,center",borderPanes:"north,south,west,east",altSide:{north:"south",
south:"north",east:"west",west:"east"},hidden:{visibility:"hidden"},visible:{visibility:"visible"},zIndex:{pane_normal:1,resizer_normal:2,iframe_mask:2,pane_sliding:100,pane_animate:1E3,resizer_drag:1E4},resizers:{cssReq:{position:"absolute",padding:0,margin:0,fontSize:"1px",textAlign:"left",overflow:"hidden"},cssDemo:{background:"#DDD",border:"none"}},togglers:{cssReq:{position:"absolute",display:"block",padding:0,margin:0,overflow:"hidden",textAlign:"center",fontSize:"1px",cursor:"pointer",zIndex:1},
cssDemo:{background:"#AAA"}},content:{cssReq:{position:"relative"},cssDemo:{overflow:"auto",padding:"10px"},cssDemoPane:{overflow:"hidden",padding:0}},panes:{cssReq:{position:"absolute",margin:0},cssDemo:{padding:"10px",background:"#FFF",border:"1px solid #BBB",overflow:"auto"}},north:{side:"Top",sizeType:"Height",dir:"horz",cssReq:{top:0,bottom:"auto",left:0,right:0,width:"auto"},pins:[]},south:{side:"Bottom",sizeType:"Height",dir:"horz",cssReq:{top:"auto",bottom:0,left:0,right:0,width:"auto"},pins:[]},
east:{side:"Right",sizeType:"Width",dir:"vert",cssReq:{left:"auto",right:0,top:"auto",bottom:"auto",height:"auto"},pins:[]},west:{side:"Left",sizeType:"Width",dir:"vert",cssReq:{left:0,right:"auto",top:"auto",bottom:"auto",height:"auto"},pins:[]},center:{dir:"center",cssReq:{left:"auto",right:"auto",top:"auto",bottom:"auto",height:"auto",width:"auto"}},timers:{}},K=function(b){try{return typeof b=="string"||typeof b=="object"&&b.constructor.toString().match(/string/i)!==null}catch(c){return false}},
cb=function(b){return K(b)?g.trim(b):b==undefined||b==null?"":b},Aa=function(b,c){return Math.min(b,c)},E=function(b,c){return Math.max(b,c)},db=function(b){var c={cookie:{},defaults:{fxSettings:{}},north:{fxSettings:{}},south:{fxSettings:{}},east:{fxSettings:{}},west:{fxSettings:{}},center:{fxSettings:{}}};b=b||{};if(b.effects||b.cookie||b.defaults||b.north||b.south||b.west||b.east||b.center)c=g.extend(true,c,b);else g.each(b,function(e,d){a=e.split("__");if(!a[1]||c[a[0]])c[a[1]?a[0]:"defaults"][a[1]?
a[1]:a[0]]=d});return c},Qa=function(b,c,e){function d(i){var k=m[i];if(k.doCallback){f.push(i);i=k.callback.split(",")[1];i!=c&&!g.inArray(i,f)>=0&&d(i)}else{k.doCallback=true;k.callback=b+","+c+","+(e?1:0)}}var f=[];g.each(m.borderPanes.split(","),function(i,k){if(m[k].isMoving){d(k);return false}})},Ra=function(b){b=m[b];m.isLayoutBusy=false;delete b.isMoving;if(b.doCallback&&b.callback){b.doCallback=false;var c=b.callback.split(","),e=c[2]>0?true:false;if(c[0]=="open")Z(c[1],e);else c[0]=="close"&&
Q(c[1],e);if(!b.doCallback)b.callback=null}},C=function(b,c){if(c){var e;try{if(typeof c=="function")e=c;else if(K(c))if(c.match(/,/)){var d=c.split(",");e=eval(d[0]);if(typeof e=="function"&&d.length>1)return e(d[1])}else e=eval(c);else return;if(typeof e=="function")return b&&s[b]?e(b,s[b],g.extend({},n[b]),p[b],p.name):e(Sa,g.extend({},n),p,p.name)}catch(f){}}},Ta=function(b,c){if(!b)return{};b.jquery||(b=g(b));var e={display:b.css("display"),visibility:b.css("visibility")};if(c||e.display=="none"){b.css({display:"block",
visibility:"hidden"});return e}else return{}},Ua=function(b){if(!n.browser.mozilla){var c=s[b];n[b].tagName=="IFRAME"?c.css(m.hidden).css(m.visible):c.find("IFRAME").css(m.hidden).css(m.visible)}},ea=function(b,c){b.jquery||(b=g(b));var e=Ta(b);c=parseInt(g.curCSS(b[0],c,true),10)||0;b.css(e);return c},la=function(b,c){if(b.jquery)b=b[0];c="border"+c.substr(0,1).toUpperCase()+c.substr(1);return g.curCSS(b,c+"Style",true)=="none"?0:parseInt(g.curCSS(b,c+"Width",true),10)||0},N=function(b,c){var e=
K(b),d=e?s[b]:g(b);if(isNaN(c))c=e?W(b):d.outerWidth();if(c<=0)return 0;if(!n.browser.boxModel)return c;b=c-la(d,"Left")-la(d,"Right")-ea(d,"paddingLeft")-ea(d,"paddingRight");return b>0?b:0},O=function(b,c){var e=K(b),d=e?s[b]:g(b);if(isNaN(c))c=e?W(b):d.outerHeight();if(c<=0)return 0;if(!n.browser.boxModel)return c;b=c-la(d,"Top")-la(d,"Bottom")-ea(d,"paddingTop")-ea(d,"paddingBottom");return b>0?b:0},eb=function(b,c){return m[b].dir=="horz"?O(b,c):N(b,c)},ra=function(b){var c=m[b].dir;b={minWidth:1001-
N(b,1E3),minHeight:1001-O(b,1E3)};if(c=="horz")b.minSize=b.minHeight;if(c=="vert")b.minSize=b.minWidth;return b},fb=function(b,c,e){var d=b;if(K(b))d=s[b];else b.jquery||(d=g(b));h=O(d,c);d.css({height:h,visibility:"visible"});if(h>0&&d.innerWidth()>0){if(e&&d.data("autoHidden")){d.show().data("autoHidden",false);n.browser.mozilla||d.css(m.hidden).css(m.visible)}}else e&&!d.data("autoHidden")&&d.hide().data("autoHidden",true)},$=function(b,c,e){if(!e)e=m[b].dir;if(K(c)&&c.match(/%/))c=parseInt(c)/
100;if(c===0)return 0;else if(c>=1)return parseInt(c,10);else if(c>0){b=p;var d;if(e=="horz")d=v.innerHeight-(s.north?b.north.spacing_open:0)-(s.south?b.south.spacing_open:0);else if(e=="vert")d=v.innerWidth-(s.west?b.west.spacing_open:0)-(s.east?b.east.spacing_open:0);return Math.floor(d*c)}else if(b=="center")return 0;else{d=s[b];e=e=="horz"?"height":"width";b=Ta(d);var f=d.css(e);d.css(e,"auto");c=e=="height"?d.outerHeight():d.outerWidth();d.css(e,f).css(b);return c}},W=function(b,c){var e=s[b],
d=p[b],f=n[b],i=c?d.spacing_open:0;d=c?d.spacing_closed:0;return!e||f.isHidden?0:f.isClosed||f.isSliding&&c?d:m[b].dir=="horz"?e.outerHeight()+i:e.outerWidth()+i},X=function(b,c){var e=p[b],d=n[b],f=m[b],i=f.dir;f.side.toLowerCase();f.sizeType.toLowerCase();c=c!=undefined?c:d.isSliding;f=e.spacing_open;var k=m.altSide[b],j=n[k],l=s[k],q=!l||j.isVisible===false||j.isSliding?0:i=="horz"?l.outerHeight():l.outerWidth();k=(!l||j.isHidden?0:p[k][j.isClosed!==false?"spacing_closed":"spacing_open"])||0;j=
i=="horz"?v.innerHeight:v.innerWidth;l=ra("center");l=i=="horz"?E(p.center.minHeight,l.minHeight):E(p.center.minWidth,l.minWidth);c=j-f-(c?0:$("center",l,i)+q+k);i=d.minSize=E($(b,e.minSize),ra(b).minSize);c=d.maxSize=Aa(e.maxSize?$(b,e.maxSize):1E5,c);d=d.resizerPosition={};f=v.insetTop;q=v.insetLeft;k=v.innerWidth;j=v.innerHeight;e=e.spacing_open;switch(b){case "north":d.min=f+i;d.max=f+c;break;case "west":d.min=q+i;d.max=q+c;break;case "south":d.min=f+j-c-e;d.max=f+j-i-e;break;case "east":d.min=
q+k-c-e;d.max=q+k-i-e;break}},gb=function(){var b={top:W("north",true),bottom:W("south",true),left:W("west",true),right:W("east",true),width:0,height:0};with(b){width=v.innerWidth-left-right;height=v.innerHeight-bottom-top;top+=v.insetTop;bottom+=v.insetBottom;left+=v.insetLeft;right+=v.insetRight}return b},fa=function(b){var c={},e=c.css={},d={},f,i,k=b.offset();c.offsetLeft=k.left;c.offsetTop=k.top;g.each("Left,Right,Top,Bottom".split(","),function(j,l){f=e["border"+l]=la(b,l);i=e["padding"+l]=
ea(b,"padding"+l);d[l]=f+i;c["inset"+l]=i});c.offsetWidth=b.innerWidth(true);c.offsetHeight=b.innerHeight(true);c.outerWidth=b.outerWidth();c.outerHeight=b.outerHeight();c.innerWidth=c.outerWidth-d.Left-d.Right;c.innerHeight=c.outerHeight-d.Top-d.Bottom;e.width=b.width();e.height=b.height();return c},Ba=function(b,c){var e={};b=b[0].style;c=c.split(",");var d="Top,Bottom,Left,Right".split(","),f="Color,Style,Width".split(","),i,k,j,l,q,w;for(l=0;l<c.length;l++){i=c[l];if(i.match(/(border|padding|margin)$/))for(q=
0;q<4;q++){k=d[q];if(i=="border")for(w=0;w<3;w++){j=f[w];e[i+k+j]=b[i+k+j]}else e[i+k]=b[i+k]}else e[i]=b[i]}return e},Ca=function(b,c,e){R(b);m.timers[b]=setTimeout(c,e)},R=function(b){if(m.timers[b]){clearTimeout(m.timers[b]);delete m.timers[b]}},hb=function(b){return!!m.timers[b]},Da=function(b,c){b=g(b);var e=b.data("layoutRole"),d=b.data("layoutEdge"),f=p[d][e+"Class"];d="-"+d;var i=b.hasClass(f+"-closed")?"-closed":"-open",k=i=="-closed"?"-open":"-closed";i=f+"-hover "+(f+d+"-hover ")+(f+i+
"-hover ")+(f+d+i+"-hover ");if(c)i+=f+k+"-hover "+(f+d+k+"-hover ");if(e=="resizer"&&b.hasClass(f+"-sliding"))i+=f+"-sliding-hover "+(f+d+"-sliding-hover ");return g.trim(i)},ma=function(b,c){b=c||this;g(b).addClass(Da(b))},Y=function(b,c){b=c||this;g(b).removeClass(Da(b,true))},ib=function(){var b=Number(p.resizeWithWindowDelay)||100;if(b>0){R("winResize");Ca("winResize",function(){R("winResize");R("winResizeRepeater");sa()},b);m.timers.winResizeRepeater||Va()}},Va=function(){var b=Number(p.resizeWithWindowMaxDelay);
b>0&&Ca("winResizeRepeater",function(){Va();sa()},b)},Wa=function(){var b=p;n.cookie=ya();b.useStateCookie&&b.cookie.autoSave&&xa();C(null,b.onunload)},kb=function(){if(!window.mouseCoords){window.mouseCoords={X:0,Y:0};g(document).bind("mousemove."+J,jb)}},jb=function(b){var c=window.mouseCoords;c.X=b.pageX;c.Y=b.pageY},Ea=function(b){var c=K(b)&&s[b]?s[b]:g(b);if(!c.length)return false;var e=c.offset();b=e.top;e=e.left;var d=e+c.outerWidth();c=b+c.outerHeight();var f=window.mouseCoords;return f.X>=
e&&f.X<=d&&f.Y>=b&&f.Y<=c},lb=function(){v.tagName=F.attr("tagName");var b=v.tagName=="BODY",c=F,e={};v.ref=v.tagName+(c.selector||"").split(".slice")[0];c.data("layoutContainer",J).data("layoutName",p.name);if(!c.data("layoutCSS")){if(b){e=g.extend(Ba(c,"position,margin,padding,border"),{height:c.css("height"),overflow:c.css("overflow"),overflowX:c.css("overflowX"),overflowY:c.css("overflowY")});var d=g("html");d.data("layoutCSS",{height:"auto",overflow:d.css("overflow"),overflowX:d.css("overflowX"),
overflowY:d.css("overflowY")})}else e=Ba(c,"position,margin,padding,border,top,bottom,left,right,width,height,overflow,overflowX,overflowY");c.data("layoutCSS",e)}try{if(b){g("html").css({height:"100%",overflow:"hidden",overflowX:"hidden",overflowY:"hidden"});g("body").css({position:"relative",height:"100%",overflow:"hidden",overflowX:"hidden",overflowY:"hidden",margin:0,padding:0,border:"none"})}else{e={overflow:"hidden"};var f=c.css("position");c.css("height");if(!c.data("layoutRole"))if(!f||!f.match(/fixed|absolute|relative/))e.position=
"relative";c.css(e);c.is(":visible")&&c.innerHeight()<2&&alert(G.errContainerHeight.replace(/CONTAINER/,v.ref))}}catch(i){}g.extend(n.container,fa(c))},mb=function(){g.each(m.borderPanes.split(","),function(b,c){b=p[c];if(b.enableCursorHotkey||b.customHotkey){g(document).bind("keydown."+J,L);return false}})},nb=function(){function b(k){for(var j in c)if(k[j]!=undefined){k[c[j]]=k[j];delete k[j]}}t=db(t);var c={applyDefaultStyles:"applyDemoStyles"};b(t.defaults);g.each(m.allPanes.split(","),function(k,
j){b(t[j])});if(t.effects){g.extend(za,t.effects);delete t.effects}g.extend(p.cookie,t.cookie);g.each("name,zIndex,scrollToBookmarkOnLoad,resizeWithWindow,resizeWithWindowDelay,resizeWithWindowMaxDelay,onresizeall,onresizeall_start,onresizeall_end,onload,onunload,autoBindCustomButtons,useStateCookie".split(","),function(k,j){if(t[j]!==undefined)p[j]=t[j];else if(t.defaults[j]!==undefined){p[j]=t.defaults[j];delete t.defaults[j]}});g.each("paneSelector,resizerCursor,customHotkey".split(","),function(k,
j){delete t.defaults[j]});g.extend(true,p.defaults,t.defaults);m.center=g.extend(true,{},m.panes,m.center);var e=p.zIndex;if(e===0||e>0){m.zIndex.pane_normal=e;m.zIndex.resizer_normal=e+1;m.zIndex.iframe_mask=e+1}g.extend(p.center,t.center);var d=g.extend(true,{},p.defaults,t.defaults,p.center);g.each("paneClass,contentSelector,applyDemoStyles,showOverflowOnHover,triggerEventsOnLoad".split(","),function(k,j){p.center[j]=d[j]});var f,i=p.defaults;g.each(m.borderPanes.split(","),function(k,j){m[j]=
g.extend(true,{},m.panes,m[j]);f=p[j]=g.extend(true,{},p.defaults,p[j],t.defaults,t[j]);if(!f.paneClass)f.paneClass="ui-layout-pane";if(!f.resizerClass)f.resizerClass="ui-layout-resizer";if(!f.togglerClass)f.togglerClass="ui-layout-toggler";g.each(["_open","_close",""],function(l,q){var w="fxName"+q;l="fxSpeed"+q;q="fxSettings"+q;f[w]=t[j][w]||t[j].fxName||t.defaults[w]||t.defaults.fxName||f[w]||f.fxName||i[w]||i.fxName||"none";var x=f[w];if(x=="none"||!g.effects||!g.effects[x]||!za[x]&&!f[q]&&!f.fxSettings)x=
f[w]="none";x=za[x]||{};w=x.all||{};x=x[j]||{};f[q]=g.extend({},w,x,i.fxSettings||{},i[q]||{},f.fxSettings,f[q],t.defaults.fxSettings,t.defaults[q]||{},t[j].fxSettings,t[j][q]||{});f[l]=t[j][l]||t[j].fxSpeed||t.defaults[l]||t.defaults.fxSpeed||f[l]||f[q].duration||f.fxSpeed||f.fxSettings.duration||i.fxSpeed||i.fxSettings.duration||x.duration||w.duration||"normal"})})},Xa=function(b){b=p[b].paneSelector;if(b.substr(0,1)==="#")return F.find(b).eq(0);else{var c=F.children(b).eq(0);return c.length?c:
F.children("form:first").children(b).eq(0)}},ob=function(){g.each(m.allPanes.split(","),function(b,c){b=p[c];var e=n[c],d=m[c],f=d.dir,i=c=="center",k={},j,l,q;ga[c]=false;j=s[c]=Xa(c);if(!j.length){s[c]=false;return true}j.data("layoutCSS")||j.data("layoutCSS",Ba(j,"position,top,left,bottom,right,width,height,overflow,zIndex,display,backgroundColor,padding,margin,border"));j.data("layoutName",p.name).data("layoutRole","pane").data("layoutEdge",c).css(d.cssReq).css("zIndex",m.zIndex.pane_normal).css(b.applyDemoStyles?
d.cssDemo:{}).addClass(b.paneClass+" "+b.paneClass+"-"+c).bind("mouseenter."+J,ma).bind("mouseleave."+J,Y);Ya(c,false);if(!i){l=e.size=$(c,b.size);d=$(c,b.minSize)||1;q=$(c,b.maxSize)||1E5;if(l>0)l=E(Aa(l,q),d)}e.tagName=j.attr("tagName");e.noRoom=false;e.isVisible=true;if(!i){e.isClosed=false;e.isSliding=false;e.isResizing=false;e.isHidden=false}switch(c){case "north":k.top=v.insetTop;k.left=v.insetLeft;k.right=v.insetRight;break;case "south":k.bottom=v.insetBottom;k.left=v.insetLeft;k.right=v.insetRight;
break;case "west":k.left=v.insetLeft;break;case "east":k.right=v.insetRight;break;case "center":}if(f=="horz")k.height=E(1,O(c,l));else if(f=="vert")k.width=E(1,N(c,l));j.css(k);f!="horz"&&ha(c,true);j.css({visibility:"visible",display:"block"});if(b.initClosed&&b.closable)Q(c,true,true);else if(b.initHidden||b.initClosed)Fa(c);b.showOverflowOnHover&&j.hover(H,M)});Za();g.each(m.borderPanes.split(","),function(b,c){if(s[c]&&n[c].isVisible){X(c);aa(c)}});ha("center");g.each(m.allPanes.split(","),function(b,
c){o=p[c];if(s[c]&&o.triggerEventsOnLoad&&n[c].isVisible)C(c,o.onresize_end||o.onresize)});F.innerHeight()<2&&alert(G.errContainerHeight.replace(/CONTAINER/,v.ref))},Za=function(b){if(!b||b=="all")b=m.borderPanes;g.each(b.split(","),function(c,e){c=s[e];A[e]=false;S[e]=false;if(c){c=p[e];var d=n[e],f=c.resizerClass,i=c.togglerClass;m[e].side.toLowerCase();var k="-"+e,j=A[e]=g("<div></div>"),l=c.closable?(S[e]=g("<div></div>")):false;d.isVisible&&c.resizable||!d.isVisible&&c.slidable&&j.attr("title",
c.sliderTip).css("cursor",c.sliderCursor);j.attr("id",c.paneSelector.substr(0,1)=="#"?c.paneSelector.substr(1)+"-resizer":"").data("layoutRole","resizer").data("layoutEdge",e).css(m.resizers.cssReq).css("zIndex",m.zIndex.resizer_normal).css(c.applyDemoStyles?m.resizers.cssDemo:{}).addClass(f+" "+f+k).appendTo(F).hover(ma,Y);if(l){l.attr("id",c.paneSelector.substr(0,1)=="#"?c.paneSelector.substr(1)+"-toggler":"").data("layoutRole","toggler").data("layoutEdge",e).css(m.togglers.cssReq).css(c.applyDemoStyles?
m.togglers.cssDemo:{}).addClass(i+" "+i+k).appendTo(j).click(function(q){ka(e);q.stopPropagation()}).hover(ma,Y);c.togglerContent_open&&g("<span>"+c.togglerContent_open+"</span>").data("layoutRole","togglerContent").data("layoutEdge",e).addClass("content content-open").css("display","none").appendTo(l).hover(ma,Y);c.togglerContent_closed&&g("<span>"+c.togglerContent_closed+"</span>").data("layoutRole","togglerContent").data("layoutEdge",e).addClass("content content-closed").css("display","none").appendTo(l).hover(ma,
Y)}if(d.isVisible)Ga(e);else{Ha(e);na(e,true)}}});oa("all")},Ya=function(b,c){var e=p[b],d=e.contentSelector,f=s[b],i;if(d)i=ga[b]=e.findNestedContent?f.find(d).eq(0):f.children(d).eq(0);if(i&&i.length){i.css(m.content.cssReq);if(e.applyDemoStyles){i.css(m.content.cssDemo);f.css(m.content.cssDemoPane)}n[b].content={};c!==false&&ja(b)}else ga[b]=false},pb=function(){var b;g.each("toggle,open,close,pin,toggle-slide,open-slide".split(","),function(c,e){g.each(m.borderPanes.split(","),function(d,f){g(".ui-layout-button-"+
e+"-"+f).each(function(){b=g(this).data("layoutName")||g(this).attr("layoutName");if(b==undefined||b==p.name)e.substr("-slide")>0?U(this,e.split("-")[0],f,true):U(this,e,f)})})})},$a=function(b){var c=typeof g.fn.draggable=="function",e;if(!b||b=="all")b=m.borderPanes;g.each(b.split(","),function(d,f){var i=p[f],k=n[f];d=m[f];var j=d.dir=="horz"?"top":"left",l,q;if(!c||!s[f]||!i.resizable){i.resizable=false;return true}var w=A[f],x=i.resizerClass,T=x+"-drag",ia=x+"-"+f+"-drag",Ia=x+"-dragging",Ja=
x+"-"+f+"-dragging",ba=x+"-dragging-limit",ca=false;k.isClosed||w.attr("title",i.resizerTip).css("cursor",i.resizerCursor);w.draggable({containment:F[0],axis:d.dir=="horz"?"y":"x",delay:100,distance:1,helper:"clone",opacity:i.resizerDragOpacity,addClasses:false,zIndex:m.zIndex.resizer_drag,start:function(){i=p[f];k=n[f];q=i.resizeWhileDragging;if(false===C(f,i.onresize_start))return false;m.isLayoutBusy=true;k.isResizing=true;R(f+"_closeSlider");X(f);l=k.resizerPosition;w.addClass(T+" "+ia);ca=false;
e=g(i.maskIframesOnResize===true?"iframe":i.maskIframesOnResize).filter(":visible");var D,I=0;e.each(function(){D="ui-layout-mask-"+ ++I;g(this).data("layoutMaskID",D);g('<div id="'+D+'" class="ui-layout-mask ui-layout-mask-'+f+'"/>').css({background:"#fff",opacity:"0.001",zIndex:m.zIndex.iframe_mask,position:"absolute",width:this.offsetWidth+"px",height:this.offsetHeight+"px"}).css(g(this).position()).appendTo(this.parentNode)});i.noSelectionWhileDragging&&g(document).disableSelection()},drag:function(D,
I){if(!ca){I.helper.addClass(Ia+" "+Ja).children().css("visibility","hidden");ca=true;k.isSliding&&s[f].css("zIndex",m.zIndex.pane_sliding)}var da=0;if(I.position[j]<l.min){I.position[j]=l.min;da=-1}else if(I.position[j]>l.max){I.position[j]=l.max;da=1}if(da){I.helper.addClass(ba);window.defaultStatus="Panel has reached its "+(da>0?"maximum":"minimum")+" size"}else{I.helper.removeClass(ba);window.defaultStatus=""}q&&Ka(D,I,f)},stop:function(D,I){i.noSelectionWhileDragging&&g(document).enableSelection();
window.defaultStatus="";w.removeClass(T+" "+ia+" "+ba);k.isResizing=false;m.isLayoutBusy=false;Ka(D,I,f,true)}});var Ka=function(D,I,da,qb){D=I.position;I=m[da];var pa;switch(da){case "north":pa=D.top;break;case "west":pa=D.left;break;case "south":pa=v.offsetHeight-D.top-i.spacing_open;break;case "east":pa=v.offsetWidth-D.left-i.spacing_open;break}La(da,pa-v["inset"+I.side]);qb?g("div.ui-layout-mask").each(function(){this.parentNode.removeChild(this)}):e.each(function(){g("#"+g(this).data("layoutMaskID")).css(g(this).position()).css({width:this.offsetWidth+
"px",height:this.offsetHeight+"px"})})}})},Fa=function(b,c){var e=p[b],d=n[b],f=s[b],i=A[b];if(!(!f||d.isHidden))if(!(n.initialized&&false===C(b,e.onhide_start))){d.isSliding=false;i&&i.hide();if(!n.initialized||d.isClosed){d.isClosed=true;d.isHidden=true;d.isVisible=false;f.hide();ha(m[b].dir=="horz"?"all":"center");if(n.initialized||e.triggerEventsOnLoad)C(b,e.onhide_end||e.onhide)}else{d.isHiding=true;Q(b,false,c)}}},ta=function(b,c,e,d){var f=n[b];if(s[b]&&f.isHidden)if(false!==C(b,p[b].onshow_start)){f.isSliding=
false;f.isShowing=true;c===false?Q(b,true):Z(b,false,e,d)}},rb=function(b){var c=typeof b,e=c=="string"?b:g(this).data("layoutEdge");c=="object"&&b.stopImmediatePropagation();n[e].isClosed?Z(e,true):qa(e,true)},ab=function(b){function c(){d.isClosed?qa(e,false):Q(e)}var e=(K(b)?s[b]:g(this)).data("layoutEdge");b=p[e];var d=n[e];if(!(d.isClosed||d.isResizing))if(b.slideTrigger_close=="click")c();else b.trackMouseWhenSliding&&Ea(e)?R(e+"_closeSlider"):Ca(e+"_closeSlider",c,300)},ka=function(b,c){K(b)||
(b=g(this).data("layoutEdge"));var e=n[cb(b)];if(e.isHidden)ta(b);else e.isClosed?Z(b,!!c):Q(b)},Q=function(b,c,e,d){function f(){if(j.isClosed){na(b,true);var x=m.altSide[b];if(n[x].noRoom){X(x);aa(x)}if(!d&&(n.initialized||k.triggerEventsOnLoad)){if(!l&&!w)C(b,k.onclose_end||k.onclose);if(l)C(b,k.onshow_end||k.onshow);if(q)C(b,k.onhide_end||k.onhide)}}Ra(b)}var i=s[b],k=p[b],j=n[b];e=!e&&!j.isClosed&&k.fxName_close!="none";var l=j.isShowing,q=j.isHiding,w=j.isSliding;delete j.isShowing;delete j.isHiding;
if(i&&k.closable)if(!(!c&&j.isClosed&&!l))if(m.isLayoutBusy)Qa("close",b,c);else if(!(n.initialized&&!l&&false===C(b,k.onclose_start))){m[b].isMoving=true;m.isLayoutBusy=true;j.isClosed=true;j.isVisible=false;if(q)j.isHidden=true;else if(l)j.isHidden=false;if(j.isSliding)qa(b,false);else if(n.initialized)ha(m[b].dir=="horz"?"all":"center",false);n.initialized&&Ha(b);if(e){ua(b,true);i.hide(k.fxName_close,k.fxSettings_close,k.fxSpeed_close,function(){ua(b,false);f()})}else{i.hide();f()}}},Ha=function(b){var c=
A[b],e=S[b],d=p[b],f=m[b].side.toLowerCase(),i=d.resizerClass,k=d.togglerClass,j="-"+b;c.css(f,v["inset"+m[b].side]).removeClass(i+"-open "+i+j+"-open").removeClass(i+"-sliding "+i+j+"-sliding").addClass(i+"-closed "+i+j+"-closed").unbind("dblclick."+J);d.resizable&&typeof g.fn.draggable=="function"&&c.draggable("disable").removeClass("ui-state-disabled").css("cursor","default").attr("title","");if(e){e.removeClass(k+"-open "+k+j+"-open").addClass(k+"-closed "+k+j+"-closed").attr("title",d.togglerTip_closed);
e.children(".content-open").hide();e.children(".content-closed").css("display","block")}B(b,false);n.initialized&&oa("all")},Z=function(b,c,e,d){function f(){if(j.isVisible){Ua(b);if(j.isSliding)k.slideTrigger_close=="mouseout"&&hb(b+"_closeSlider")&&k.trackMouseWhenSliding&&Ea(b)&&R(b+"_closeSlider");else ha(m[b].dir=="vert"?"center":"all",false);Ga(b)}Ra(b)}var i=s[b],k=p[b],j=n[b];e=!e&&j.isClosed&&k.fxName_open!="none";var l=j.isShowing;delete j.isShowing;if(!(!i||!k.resizable&&!k.closable))if(!(j.isVisible&&
!j.isSliding))if(j.isHidden&&!l)ta(b,true);else if(m.isLayoutBusy)Qa("open",b,c);else if(false!==C(b,k.onopen_start)){X(b,c);if(j.minSize>j.maxSize){B(b,false);!d&&k.noRoomToOpenTip&&alert(k.noRoomToOpenTip)}else{m[b].isMoving=true;m.isLayoutBusy=true;if(c)qa(b,true);else if(j.isSliding)qa(b,false);else k.slidable&&na(b,false);j.noRoom=false;aa(b);j.isVisible=true;j.isClosed=false;if(l)j.isHidden=false;if(e){ua(b,true);i.show(k.fxName_open,k.fxSettings_open,k.fxSpeed_open,function(){ua(b,false);f()})}else{i.show();
f()}}}},Ga=function(b,c){var e=s[b],d=A[b],f=S[b],i=p[b],k=n[b],j=m[b].side.toLowerCase(),l=i.resizerClass,q=i.togglerClass,w="-"+b;d.css(j,v["inset"+m[b].side]+W(b)).removeClass(l+"-closed "+l+w+"-closed").addClass(l+"-open "+l+w+"-open");k.isSliding?d.addClass(l+"-sliding "+l+w+"-sliding"):d.removeClass(l+"-sliding "+l+w+"-sliding");i.resizerDblClickToggle&&d.bind("dblclick",ka);Y(0,d);if(i.resizable&&typeof g.fn.draggable=="function")d.draggable("enable").css("cursor",i.resizerCursor).attr("title",
i.resizerTip);else k.isSliding||d.css("cursor","default");if(f){f.removeClass(q+"-closed "+q+w+"-closed").addClass(q+"-open "+q+w+"-open").attr("title",i.togglerTip_open);Y(0,f);f.children(".content-closed").hide();f.children(".content-open").css("display","block")}B(b,!k.isSliding);if(n.initialized){oa("all");ja(b)}g.extend(k,fa(e));if(!c&&(n.initialized||i.triggerEventsOnLoad)&&e.is(":visible")){C(b,i.onopen_end||i.onopen);if(k.isShowing)C(b,i.onshow_end||i.onshow);if(n.initialized)C(b,i.onresize_end||
i.onresize)}},ua=function(b,c){var e=s[b];if(c){e.css({zIndex:m.zIndex.pane_animate});if(b=="south")e.css({top:v.insetTop+v.innerHeight-e.outerHeight()});else b=="east"&&e.css({left:v.insetLeft+v.innerWidth-e.outerWidth()})}else{e.css({zIndex:n[b].isSliding?m.zIndex.pane_sliding:m.zIndex.pane_normal});if(b=="south")e.css({top:"auto"});else b=="east"&&e.css({left:"auto"});b=p[b];n.browser.msie&&b.fxOpacityFix&&b.fxName_open!="slide"&&e.css("filter")&&e.css("opacity")==1&&e[0].style.removeAttribute("filter")}},
na=function(b,c){var e=p[b];b=A[b];var d=e.slideTrigger_open;if(b&&e.slidable){if(d!="click"&&d!="dblclick"&&d!="mouseover")d=e.slideTrigger_open="click";b[c?"bind":"unbind"](d,rb).css("cursor",c?e.sliderCursor:"default").attr("title",c?e.sliderTip:"")}},qa=function(b,c){function e(l){R(b+"_closeSlider");l.stopPropagation()}var d=p[b],f=d.slideTrigger_close,i=c?"bind":"unbind",k=s[b],j=A[b];n[b].isSliding=c;R(b+"_closeSlider");k.css({zIndex:c?m.zIndex.pane_sliding:m.zIndex.pane_normal});j.css({zIndex:c?
m.zIndex.pane_sliding:m.zIndex.resizer_normal});if(f!="mouseout"&&f!="click")f=d.slideTrigger_close="mouseout";c&&na(b,false);j[i](f,ab);if(f=="mouseout"){k[i]("mouseout."+J,ab);j[i]("mouseover",e);k[i]("mouseover."+J,e)}if(c){if(f=="click"&&!d.resizable){j.css("cursor",c?d.sliderCursor:"default");j.attr("title",c?d.togglerTip_open:"")}}else R(b+"_closeSlider")},aa=function(b,c,e){c=p[b];var d=n[b],f=m[b],i=s[b],k=A[b],j=f.dir=="vert",l=false;if(b=="center"||j&&d.noVerticalRoom)if((l=d.minHeight<=
d.maxHeight&&(j||d.minWidth<=d.maxWidth))&&d.noRoom){i.show();k&&k.show();d.isVisible=true;d.noRoom=false;if(j)d.noVerticalRoom=false;Ua(b)}else if(!l&&!d.noRoom){i.hide();k&&k.hide();d.isVisible=false;d.noRoom=true}if(b!="center")if(d.minSize<=d.maxSize){if(d.size>d.maxSize)va(b,d.maxSize,e);else if(d.size<d.minSize)va(b,d.minSize,e);else if(k&&i.is(":visible")){e=f.side.toLowerCase();f=d.size+v["inset"+f.side];ea(k,e)!=f&&k.css(e,f)}if(d.noRoom)if(d.wasOpen&&c.closable)if(c.autoReopen)Z(b,false,
true,true);else d.noRoom=false;else ta(b,d.wasOpen,true,true)}else if(!d.noRoom){d.noRoom=true;d.wasOpen=!d.isClosed&&!d.isSliding;c.closable?Q(b,true,true):Fa(b,true)}},La=function(b,c,e){var d=p[b],f=d.resizeWhileDragging&&!m.isLayoutBusy;d.autoResize=false;va(b,c,e,f)},va=function(b,c,e,d){var f=p[b],i=n[b],k=s[b],j=A[b],l=m[b].side.toLowerCase(),q="inset"+m[b].side,w=m.isLayoutBusy&&!f.triggerEventsWhileDragging,x;X(b);x=i.size;c=$(b,c);c=E(c,$(b,f.minSize));c=Aa(c,i.maxSize);if(c<i.minSize)aa(b,
false,e);else if(!(!d&&c==x)){i.size=c;k.css(m[b].sizeType.toLowerCase(),E(1,eb(b,c)));g.extend(i,fa(k));j&&k.is(":visible")&&j.css(l,c+v[q]);if(!e){i.isSliding||ha(m[b].dir=="horz"?"all":"center",w,d);oa("all")}ja(b);if(!e&&!w&&n.initialized&&i.isVisible)C(b,f.onresize_end||f.onresize);b=m.altSide[b];if(c<x&&n[b].noRoom){X(b);aa(b,false,e)}}},ha=function(b,c,e){if(!b||b=="all")b="east,west,center";g.each(b.split(","),function(d,f){if(s[f]){d=p[f];var i=n[f],k=s[f],j=true,l={};j=gb();g.extend(i,fa(k));
if(f=="center"){if(!e&&i.isVisible&&j.width==i.outerWidth&&j.height==i.outerHeight)return true;g.extend(i,ra(f),{maxWidth:j.width,maxHeight:j.height});l=j;l.width=N(f,j.width);l.height=O(f,j.height);j=l.width>0&&l.height>0}else{g.extend(i,fa(k),ra(f));if(!e&&!i.noVerticalRoom&&j.height==i.outerHeight)return true;l.top=j.top;l.bottom=j.bottom;l.height=O(f,j.height);i.maxHeight=E(0,l.height);j=i.maxHeight>0;if(!j)i.noVerticalRoom=true}if(j){k.css(l);f=="center"&&g.extend(i,fa(k));i.noRoom&&aa(f);n.initialized&&
ja(f)}else!i.noRoom&&i.isVisible&&aa(f);if(f=="center"){k=n.browser;k=k.isIE6||k.msie&&!k.boxModel;if(s.north&&(k||n.north.tagName=="IFRAME"))s.north.css("width",N(s.north,v.innerWidth));if(s.south&&(k||n.south.tagName=="IFRAME"))s.south.css("width",N(s.south,v.innerWidth))}if(!c&&n.initialized&&i.isVisible)C(f,d.onresize_end||d.onresize)}})},sa=function(){g.extend(n.container,fa(F));if(v.outerHeight){if(false===C(null,p.onresizeall_start))return false;var b,c;g.each(["south","north","east","west"],
function(e,d){if(s[d]){c=n[d];b=p[d];if(b.autoResize&&c.size!=b.size)va(d,b.size,true);else{X(d);aa(d,false,true)}}});ha("all",true);oa("all");b=p;g.each(m.allPanes.split(","),function(e,d){if(n[d].isVisible)C(d,b[d].onresize_end||b[d].onresize)});C(null,b.onresizeall_end||b.onresizeall)}},ja=function(b){if(!b||b=="all")b=m.allPanes;g.each(b.split(","),function(c,e){var d=s[e],f=ga[e];c=p[e];e=n[e];var i=e.content;if(d&&f&&d.is(":visible")){var k=f[0],j=function(){g.swap(f[0],{height:"auto",display:"block",
visibility:"hidden"},function(){i.above=k.offsetTop;i.below=d.innerHeight()-k.offsetTop-k.offsetHeight})};if(c.resizeContentWhileDragging||!e.isResizing||i.above==undefined)g.swap(d[0],{position:"relative",height:"auto",visibility:"hidden"},j);fb(f,d.innerHeight()-i.above-i.below,true)}})},oa=function(b){if(!b||b=="all")b=m.borderPanes;g.each(b.split(","),function(c,e){c=p[e];var d=n[e],f=s[e],i=A[e],k=S[e],j;if(f&&i){e=m[e].dir;var l=d.isClosed?"_closed":"_open",q=c["spacing"+l],w=c["togglerAlign"+
l];l=c["togglerLength"+l];var x;if(q==0)i.hide();else{!d.noRoom&&!d.isHidden&&i.show();if(e=="horz"){x=f.outerWidth();d.resizerLength=x;i.css({width:E(1,N(i,x)),height:E(0,O(i,q)),left:ea(f,"left")})}else{x=f.outerHeight();d.resizerLength=x;i.css({height:E(1,O(i,x)),width:E(0,N(i,q)),top:v.insetTop+W("north",true)})}Y(c,i);if(k){if(l==0||d.isSliding&&c.hideTogglerOnSlide){k.hide();return}else k.show();if(!(l>0)||l=="100%"||l>x){l=x;d=0}else if(K(w))switch(w){case "top":case "left":d=0;break;case "bottom":case "right":d=
x-l;break;case "middle":case "center":default:d=Math.floor((x-l)/2)}else{d=parseInt(w);d=w>=0?d:x-l+d}if(e=="horz"){var T=N(k,l);k.css({width:E(0,T),height:E(1,O(k,q)),left:d,top:0});k.children(".content").each(function(){j=g(this);j.css("marginLeft",Math.floor((T-j.outerWidth())/2))})}else{var ia=O(k,l);k.css({height:E(0,ia),width:E(1,N(k,q)),top:d,left:0});k.children(".content").each(function(){j=g(this);j.css("marginTop",Math.floor((ia-j.outerHeight())/2))})}Y(0,k)}if(!n.initialized&&c.initHidden){i.hide();
k&&k.hide()}}}})},F=g(this).eq(0);if(!F.length){alert(G.errContainerMissing);return null}if(F.data("layoutContainer"))return g.extend({},window[F.data("layoutContainer")]);var s={},ga={},A={},S={},v=n.container,J=n.id;(function(){nb();var b=p;if(false===C(null,b.onload))return false;if(!Xa("center").length){alert(G.errCenterPaneMissing);return null}b.useStateCookie&&b.cookie.autoLoad&&Oa();n.browser={mozilla:g.browser.mozilla,msie:g.browser.msie,isIE6:g.browser.msie&&g.browser.version==6,boxModel:g.support.boxModel};
lb();ob();$a();ja("all");if(b.scrollToBookmarkOnLoad)with(self.location)hash&&replace(hash);b.autoBindCustomButtons&&pb();mb();kb();b.resizeWithWindow&&!F.data("layoutRole")&&g(window).bind("resize."+J,ib);g(window).bind("unload."+J,Wa);n.initialized=true})();var Sa={options:p,state:n,container:F,panes:s,contents:ga,resizers:A,togglers:S,toggle:ka,open:Z,close:Q,hide:Fa,show:ta,initContent:Ya,sizeContent:ja,sizePane:La,swapPanes:function(b,c){function e(j){var l=s[j],q=ga[j];return!l?false:{pane:j,
P:l?l[0]:false,C:q?q[0]:false,state:g.extend({},n[j]),options:g.extend({},p[j])}}function d(j,l){if(j){var q=j.P,w=j.C,x=j.pane,T=m[l],ia=T.side.toLowerCase(),Ia="inset"+T.side,Ja=g.extend({},n[l]),ba=p[l],ca={resizerCursor:ba.resizerCursor};g.each("fxName,fxSpeed,fxSettings".split(","),function(Ka,D){ca[D]=ba[D];ca[D+"_open"]=ba[D+"_open"];ca[D+"_close"]=ba[D+"_close"]});s[l]=g(q).data("layoutEdge",l).css(m.hidden).css(T.cssReq);ga[l]=w?g(w):false;p[l]=g.extend({},j.options,ca);n[l]=g.extend({},
j.state);q.className=q.className.replace(new RegExp("pane-"+x,"g"),"pane-"+l);if(!A[l]){Za(l);$a(l)}if(T.dir!=m[x].dir){q=k[l]||0;X(l);q=E(q,n[l].minSize);La(l,q,true)}else A[l].css(ia,v[Ia]+(n[l].isVisible?W(l):0));if(j.state.isVisible&&!Ja.isVisible)Ga(l,true);else{Ha(l,true);na(l,true)}j=null}}var f=e(b),i=e(c),k={};k[b]=f?f.state.size:0;k[c]=i?i.state.size:0;s[b]=false;s[c]=false;n[b]={};n[c]={};d(f,c);d(i,b);f=i=k=null;if(!s[b]&&A[b]){A[b].remove();A[b]=S[b]=false}if(!s[c]&&A[c]){A[c].remove();
A[c]=S[c]=false}s[b]&&s[b].css(m.visible);s[c]&&s[c].css(m.visible);sa()},resizeAll:sa,destroy:function(){g(window).unbind("."+J);g(document).unbind("."+J);window[J]=null;var b=v.tagName=="BODY",c=o.paneClass,e=[c,c+"-open",c+"-closed",c+"-sliding"],d,f,i;g.each(m.allPanes.split(","),function(k,j){d=s[j];if(!d)return true;if(j!="center"){S[j]&&S[j].remove();A[j].remove()}f=c+"-"+j;i=[];i.push(f);i.push(f+"-open");i.push(f+"-closed");i.push(f+"-sliding");g.merge(i,e);g.merge(i,Da(d,true));d.removeClass(i.join(" ")).removeData("layoutRole").removeData("layoutEdge").unbind("."+
J).unbind("mouseenter").unbind("mouseleave");d.data("layoutContainer")||d.css(d.data("layoutCSS"))});F.removeData("layoutContainer");F.data("layoutEdge")||F.css(F.data("layoutCSS"));b&&g("html").css(g("html").data("layoutCSS"));Wa();if((b=p.name)&&window[b])window[b]=null},setSizeLimits:X,bindButton:U,addToggleBtn:z,addOpenBtn:u,addCloseBtn:r,addPinBtn:y,allowOverflow:H,resetOverflow:M,encodeJSON:Na,decodeJSON:Ma,getState:ya,getCookie:wa,saveCookie:xa,deleteCookie:bb,loadCookie:Oa,loadState:Pa,cssWidth:N,
cssHeight:O,isMouseOver:Ea};return window[J]=Sa}})(jQuery);
(function(g){function t(u){for(var r=[];u=U(u);)r[r.length]=u[0];return r}function L(u){return g("table.treeTable tbody tr."+z.childPrefix+u[0].id)}function H(u,r){var y=g(u.children("td")[z.treeColumn]),B=parseInt(y.css("padding-left"),10)+r;y.css("padding-left",+B+"px");L(u).each(function(){H(g(this),r)})}function M(u){if(!u.hasClass("initialized")){u.addClass("initialized");var r=L(u);!u.hasClass("parent")&&r.length>0&&u.addClass("parent");if(u.hasClass("parent")){var y=g(u.children("td")[z.treeColumn]),
B=parseInt(y.css("padding-left"),10)+z.indent;r.each(function(){g(g(this).children("td")[z.treeColumn]).css("padding-left",B+"px")});if(z.expandable){y.prepend('<span style="padding-left: '+z.indent+'px" class="expander"></span>');u.click(function(){u.toggleBranch()});u.hasClass("expanded")||u.hasClass("collapsed")||u.addClass(z.initialState);if(u.hasClass("collapsed"))u.collapse();else u.hasClass("expanded")&&u.expand()}}}}function P(u,r){u.insertAfter(r);L(u).reverse().each(function(){P(g(this),
u[0])})}function U(u){u=u[0].className.split(" ");for(key in u)if(u[key].match("child-of-"))return g("#"+u[key].substring(9))}var z;g.fn.treeTable=function(u){z=g.extend({},g.fn.treeTable.defaults,u);return this.each(function(){g(this).addClass("treeTable").find("tbody tr").each(function(){if(!z.expandable||g(this)[0].className.search("child-of-")==-1)M(g(this))})})};g.fn.treeTable.defaults={childPrefix:"child-of-",expandable:true,indent:19,initialState:"collapsed",treeColumn:0};g.fn.collapse=function(){g(this).addClass("collapsed");
L(g(this)).each(function(){M(g(this));g(this).hasClass("collapsed")||g(this).collapse();g(this).hide()});return this};g.fn.expand=function(){g(this).removeClass("collapsed").addClass("expanded");L(g(this)).each(function(){M(g(this));g(this).is(".expanded.parent")&&g(this).expand();g(this).show()});return this};g.fn.appendBranchTo=function(u){var r=g(this),y=U(r),B=g.map(t(g(u)),function(V){return V.id});if(g.inArray(r[0].id,B)==-1&&(!y||u.id!=y[0].id)&&u.id!=r[0].id){H(r,t(r).length*z.indent*-1);
y&&r.removeClass(z.childPrefix+y[0].id);r.addClass(z.childPrefix+u.id);P(r,u);H(r,t(r).length*z.indent)}return this};g.fn.reverse=function(){return this.pushStack(this.get().reverse(),arguments)};g.fn.toggleBranch=function(){g(this).hasClass("collapsed")?g(this).expand():g(this).removeClass("expanded").collapse();g(this).trigger("treetable-toggle");return this}})(jQuery);
function SimPubClient(){var g=this,t=null,L="",H={},M,P,U,z,u;g.onOpen=function(){};g.onClose=function(){};g.onMessage=function(){};g.connect=function(r,y){t=new g.transport;t.onread=U;t.onclose=P;t.onopen=M;t.open(r,y)};g.close=function(){t.close()};g.send=function(r){if(z(r)){r=JSON.stringify(r);t.send(r+"\r\n")}};g.resubscribe=function(){var r;for(r in H)H.hasOwnProperty(r)&&g.send({cmd:"subscribe",node:r,retrieve:true,after:H[r]})};M=function(){try{g.onOpen()}catch(r){}};P=function(r){try{g.onClose(r)}catch(y){}};
U=function(r){var y,B,V;L+=r;r=L.split("\r\n");L=r[r.length-1];for(B=0;B<r.length-1;++B){y=r[B];try{V=JSON.parse(y);u(V)&&g.onMessage(V)}catch(wa){}}};z=function(r){if(r.cmd=="subscribe")r.node in H||(H[r.node]=-1);else r.cmd=="unsubscribe"&&delete H[r.node];return true};u=function(r){var y,B;if(r.type=="itemsPublished"||r.type=="itemsRetrieved"){if(!(r.node in H))return false;for(y=0;y<r.items.length;++y){B=r.items[y];B=B.id||-1;if(B>H[r.node])H[r.node]=B}}return true}}
SimPubClient.prototype.transport=TCPSocket;(function(g){g.fn.extend({ensureVisible:function(t){return this.each(function(){if(this.scrollTop>t.offsetTop)this.scrollTop=t.offsetTop;else if(this.scrollTop<t.offsetTop+t.offsetHeight-this.clientHeight)this.scrollTop=t.offsetTop+t.offsetHeight-this.clientHeight;if(this.scrollLeft>t.offsetLeft)this.scrollLeft=t.offsetLeft;else if(this.scrollLeft<t.offsetLeft+t.offsetWidth-this.clientWidth)this.scrollLeft=t.offsetLeft+t.offsetWidth-this.clientWidth})}})})(jQuery);

