(function(i){i.fn.layout=function(u){function na(b){if(!b)return true;var c=b.keyCode;if(c<33)return true;var d={38:"north",40:"south",37:"west",39:"east"},e=c>=37&&c<=40,f=b.shiftKey,g=b.ctrlKey,k=false,h,m,j;if(!g&&!f)return true;else if(e&&p[d[c]].enableCursorHotkey)k=d[c];else i.each(l.borderPanes.split(","),function(n,r){h=p[r];m=h.customHotkey;j=h.customHotkeyModifier;if(f&&j=="SHIFT"||g&&j=="CTRL"||g&&f)if(m&&c==(isNaN(m)||m<=9?m.toUpperCase().charCodeAt(0):m)){k=r;return false}});if(!k)return true; h=p[k];d=t[k];if(!h.enableCursorHotkey||d.isHidden||!s[k])return true;if((d=b.target||b.srcElement)&&f&&e&&(d.tagName=="TEXTAREA"||d.tagName=="INPUT"&&(c==37||c==39)))return true;R(k);b.stopPropagation();return b.returnValue=false}function ea(b){if(this&&this.tagName)b=this;b=typeof b=="string"?s[b]:i(b).attr("pane")?i(b):i(b).parents("div[pane]:first");if(b.length){var c=b.attr("pane"),d=t[c];d.cssSaved&&S(c);if(d.isSliding||d.isResizing||d.isClosed)d.cssSaved=false;else{var e={zIndex:l.zIndex.pane_normal+ 1},f={},g=b.css("overflow"),k=b.css("overflowX"),h=b.css("overflowY");if(g!="visible"){f.overflow=g;e.overflow="visible"}if(k&&k!="visible"&&k!="auto"){f.overflowX=k;e.overflowX="visible"}if(h&&h!="visible"&&h!="auto"){f.overflowY=k;e.overflowY="visible"}d.cssSaved=f;b.css(e);i.each(l.allPanes.split(","),function(m,j){j!=c&&S(j)})}}}function S(b){if(this&&this.tagName)b=this;b=typeof b=="string"?s[b]:i(b).hasClass("ui-layout-pane")?i(b):i(b).parents("div[pane]:first");if(b.length){var c=b.attr("pane"); c=t[c];var d=c.cssSaved||{};!c.isSliding&&!c.isResizing&&b.css("zIndex",l.zIndex.pane_normal);b.css(d);c.cssSaved=false}}function T(b,c,d){var e=i(b);if(e.length)if(l.borderPanes.indexOf(c)==-1)alert("Error Adding Button \n\nInvalid pane: "+c);else{b=p[c].buttonClass+"-"+d;e.addClass(b+" "+b+"-"+c);return e}else alert("Error Adding Button \n\nInvalid selector: "+b);return false}function fa(b,c){i.each(l[b].pins,function(d,e){Y(i(e),b,c)})}function Y(b,c,d){var e=b.attr("pin");if(!(e&&d==(e=="down"))){var f= p[c].buttonClass+"-pin",g=f+"-"+c;c=f+"-up";e=g+"-up";f=f+"-down";g=g+"-down";b.attr("pin",d?"down":"up").attr("title",d?"Un-Pin":"Pin").removeClass(d?c:f).removeClass(d?e:g).addClass(d?f:c).addClass(d?g:e)}}var F={paneClass:"ui-layout-pane",resizerClass:"ui-layout-resizer",togglerClass:"ui-layout-toggler",togglerInnerClass:"ui-layout-",buttonClass:"ui-layout-button",contentSelector:".ui-layout-content",contentIgnoreSelector:".ui-layout-ignore"},p={name:"",scrollToBookmarkOnLoad:true,defaults:{applyDefaultStyles:false, closable:true,resizable:true,slidable:true,contentSelector:F.contentSelector,contentIgnoreSelector:F.contentIgnoreSelector,paneClass:F.paneClass,resizerClass:F.resizerClass,togglerClass:F.togglerClass,buttonClass:F.buttonClass,resizerDragOpacity:1,maskIframesOnResize:true,minSize:0,maxSize:0,spacing_open:6,spacing_closed:6,togglerLength_open:50,togglerLength_closed:50,togglerAlign_open:"center",togglerAlign_closed:"center",togglerTip_open:"Close",togglerTip_closed:"Open",resizerTip:"Resize",sliderTip:"Slide Open", sliderCursor:"pointer",slideTrigger_open:"click",slideTrigger_close:"mouseout",hideTogglerOnSlide:false,togglerContent_open:"",togglerContent_closed:"",showOverflowOnHover:false,enableCursorHotkey:true,customHotkeyModifier:"SHIFT",fxName:"slide",fxSpeed:null,fxSettings:{},initClosed:false,initHidden:false},north:{paneSelector:".ui-layout-north",size:"auto",resizerCursor:"n-resize"},south:{paneSelector:".ui-layout-south",size:"auto",resizerCursor:"s-resize"},east:{paneSelector:".ui-layout-east",size:200, resizerCursor:"e-resize"},west:{paneSelector:".ui-layout-west",size:200,resizerCursor:"w-resize"},center:{paneSelector:".ui-layout-center"}},Z={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"}}},t={id:Math.floor(Math.random()*1E4),container:{},north:{},south:{},east:{}, west:{},center:{}},ga={north:"south",south:"north",east:"west",west:"east"},M=function(b){if(typeof b=="string")return true;else if(typeof b=="object")try{return b.constructor.toString().match(/string/i)!==null}catch(c){}return false},G=function(b){return typeof b=="string"||M(b)?i.trim(b):b},v=function(b,c){return Math.max(b,c)},oa=function(b){var c={defaults:{fxSettings:{}},north:{fxSettings:{}},south:{fxSettings:{}},east:{fxSettings:{}},west:{fxSettings:{}},center:{fxSettings:{}}};b=b||{};if(b.effects|| b.defaults||b.north||b.south||b.west||b.east||b.center)c=i.extend(c,b);else i.each(b,function(d,e){a=d.split("__");c[a[1]?a[0]:"defaults"][a[1]?a[1]:a[0]]=e});return c},ha=function(b,c,d){function e(k){g=l[k];if(g.doCallback){cpPane=g.callback.split(",")[1];cpPane!=k&&cpPane!=c&&e(cpPane,true)}else{g.doCallback=true;g.callback=f}}var f=b+","+c+","+(d?1:0),g;i.each(l.borderPanes.split(","),function(k,h){if(l[h].isMoving){e(h);return false}})},ia=function(b){b=l[b];l.isLayoutBusy=false;delete b.isMoving; if(b.doCallback&&b.callback){b.doCallback=false;var c=b.callback.split(","),d=c[2]>0?true:false;if(c[0]=="open")K(c[1],d);else c[0]=="close"&&I(c[1],d);if(!b.doCallback)b.callback=null}},y=function(b,c){if(c){var d;try{if(typeof c=="function")d=c;else if(typeof c!="string")return;else if(c.indexOf(",")>0){var e=c.split(",");d=eval(e[0]);if(typeof d=="function"&&e.length>1)return d(e[1])}else d=eval(c);if(typeof d=="function")return d(b,s[b],i.extend({},t[b]),i.extend({},p[b]),p.name)}catch(f){}}}, D=function(b,c){var d=0,e=false,f="";if(!i.browser.msie)if(i.curCSS(b[0],"display",true)=="none"){e=true;f=i.curCSS(b[0],"visibility",true);b.css({display:"block",visibility:"hidden"})}d=parseInt(i.curCSS(b[0],c,true),10)||0;if(e){b.css({display:"none"});f&&f!="hidden"&&b.css({visibility:f})}return d},E=function(b,c){var d;if(M(b)){b=G(b);d=s[b]}else d=i(b);if(c<=0)return 0;else c>0||(c=M(b)?H(b):d.outerWidth());return i.boxModel?c-D(d,"paddingLeft")-D(d,"paddingRight")-(i.curCSS(d[0],"borderLeftStyle", true)=="none"?0:D(d,"borderLeftWidth"))-(i.curCSS(d[0],"borderRightStyle",true)=="none"?0:D(d,"borderRightWidth")):c},A=function(b,c){var d;if(M(b)){b=G(b);d=s[b]}else d=i(b);if(c<=0)return 0;else c>0||(c=M(b)?H(b):d.outerHeight());return i.boxModel?c-D(d,"paddingTop")-D(d,"paddingBottom")-(i.curCSS(d[0],"borderTopStyle",true)=="none"?0:D(d,"borderTopWidth"))-(i.curCSS(d[0],"borderBottomStyle",true)=="none"?0:D(d,"borderBottomWidth")):c},H=function(b,c){var d=s[b],e=p[b],f=t[b],g=c?e.spacing_open: 0;e=c?e.spacing_closed:0;return!d||f.isHidden?0:f.isClosed||f.isSliding&&c?e:l[b].dir=="horz"?d.outerHeight()+g:d.outerWidth()+g},U=function(b){var c=q,d=l[b].dir,e=t[b],f=s[ga[b]],g=p[b].spacing_open,k=p[ga[b]].spacing_open,h=!f?0:d=="horz"?f.outerHeight():f.outerWidth();f=e.minSize||0;d=Math.min(e.maxSize||9999,(d=="horz"?c.innerHeight:c.innerWidth)-g-h-k);var m,j;switch(b){case "north":m=c.offsetTop+f;j=c.offsetTop+d;break;case "west":m=c.offsetLeft+f;j=c.offsetLeft+d;break;case "south":m=c.offsetTop+ c.innerHeight-d;j=c.offsetTop+c.innerHeight-f;break;case "east":m=c.offsetLeft+c.innerWidth-d;j=c.offsetLeft+c.innerWidth-f}i.extend(e,{minSize:f,maxSize:d,minPosition:m,maxPosition:j})},ja=function(){var b={top:H("north",true),bottom:H("south",true),left:H("west",true),right:H("east",true),width:0,height:0};b.width=q.innerWidth-left-right;b.height=q.innerHeight-bottom-top;b.top+=q.top;b.bottom+=q.bottom;b.left+=q.left;b.right+=q.right;return b},ka=function(b){var c={},d,e,f;i.each("Left,Right,Top,Bottom".split(","), function(){d=G(this);e=c["border"+d]=D(b,"border"+d+"Width");f=c["padding"+d]=D(b,"padding"+d);c["offset"+d]=e+f;if(b==z)c[d.toLowerCase()]=i.boxModel?f:0});c.innerWidth=c.outerWidth=b.outerWidth();c.innerHeight=c.outerHeight=b.outerHeight();if(i.boxModel){c.innerWidth-=c.offsetLeft+c.offsetRight;c.innerHeight-=c.offsetTop+c.offsetBottom}return c},pa=function(b,c,d,e){var f=window.layout=window.layout||{};f=f.timers=f.timers||{};b="layout_"+t.id+"_"+b+"_"+c;f[b]||(f[b]=setTimeout(d,e))},V=function(b, c){var d=window.layout=window.layout||{};d=d.timers=d.timers||{};var e="layout_"+t.id+"_"+b+"_"+c;if(d[e]){clearTimeout(d[e]);delete d[e];return true}else return false},qa=function(){try{if(z[0].tagName=="BODY"){i("html").css({height:"100%",overflow:"hidden"});i("body").css({position:"relative",height:"100%",overflow:"hidden",margin:0,padding:0,border:"none"})}else{var b={overflow:"hidden"},c=z.css("position"),d=z.css("height");if(!z.hasClass("ui-layout-pane")){if(!c||"fixed,absolute,relative".indexOf(c)< 0)b.position="relative";if(!d||d=="auto")b.height="100%"}z.css(b)}}catch(e){}q=t.container=ka(z)},ra=function(){i.each(l.borderPanes.split(","),function(b,c){var d=p[c];if(d.enableCursorHotkey||d.customHotkey){i(document).keydown(na);return false}})},sa=function(){u=oa(u);if(u.effects){i.extend(Z,u.effects);delete u.effects}i.each("name,scrollToBookmarkOnLoad".split(","),function(d,e){if(u[e]!==undefined)p[e]=u[e];else if(u.defaults[e]!==undefined){p[e]=u.defaults[e];delete u.defaults[e]}});i.each("paneSelector,resizerCursor,customHotkey".split(","), function(d,e){delete u.defaults[e]});i.extend(p.defaults,u.defaults);l.center=i.extend(true,{},l.defaults,l.center);i.extend(p.center,u.center);var b=i.extend(true,{},p.defaults,u.defaults,p.center);i.each("paneClass,contentSelector,contentIgnoreSelector,applyDefaultStyles,showOverflowOnHover".split(","),function(d,e){p.center[e]=b[e]});var c=p.defaults;i.each(l.borderPanes.split(","),function(d,e){l[e]=i.extend(true,{},l.defaults,l[e]);o=p[e]=i.extend(true,{},p.defaults,p[e],u.defaults,u[e]);if(!o.paneClass)o.paneClass= F.paneClass;if(!o.resizerClass)o.resizerClass=F.resizerClass;if(!o.togglerClass)o.togglerClass=F.togglerClass;i.each(["_open","_close",""],function(f,g){var k="fxName"+g,h="fxSpeed"+g,m="fxSettings"+g;o[k]=u[e][k]||u[e].fxName||u.defaults[k]||u.defaults.fxName||o[k]||o.fxName||c[k]||c.fxName||"none";var j=o[k];if(j=="none"||!i.effects||!i.effects[j]||!Z[j]&&!o[m]&&!o.fxSettings)j=o[k]="none";j=Z[j]||{};k=j.all||{};j=j[e]||{};o[m]=i.extend({},k,j,c.fxSettings||{},c[m]||{},o.fxSettings,o[m],u.defaults.fxSettings, u.defaults[m]||{},u[e].fxSettings,u[e][m]||{});o[h]=u[e][h]||u[e].fxSpeed||u.defaults[h]||u.defaults.fxSpeed||o[h]||o[m].duration||o.fxSpeed||o.fxSettings.duration||c.fxSpeed||c.fxSettings.duration||j.duration||k.duration||"normal"})})},ta=function(){i.each(l.allPanes.split(","),function(){var b=G(this),c=p[b],d=t[b],e=l[b].dir,f=c.size=="auto"||isNaN(c.size)?0:c.size,g=c.minSize||1,k=c.maxSize||9999,h=c.spacing_open||0,m=c.paneSelector,j={},n;N[b]=false;if(m.substr(0,1)==="#")n=s[b]=z.find(m+":first"); else{n=s[b]=z.children(m+":first");n.length||(n=s[b]=z.children("form:first").children(m+":first"))}if(!n.length){s[b]=false;return true}n.attr("pane",b).addClass(c.paneClass+" "+c.paneClass+"-"+b);if(b!="center"){d.isClosed=false;d.isSliding=false;d.isResizing=false;d.isHidden=false;d.noRoom=false;l[b].pins=[]}j=i.extend({visibility:"visible",display:"block"},l.defaults.cssReq,l[b].cssReq);c.applyDefaultStyles&&i.extend(j,l.defaults.cssDef,l[b].cssDef);n.css(j);j={};switch(b){case "north":j.top= q.top;j.left=q.left;j.right=q.right;break;case "south":j.bottom=q.bottom;j.left=q.left;j.right=q.right;break;case "west":j.left=q.left;break;case "east":j.right=q.right}if(e=="horz"){if(f===0||f=="auto"){n.css({height:"auto"});f=n.outerHeight()}f=v(f,g);f=Math.min(f,k);f=Math.min(f,q.innerHeight-h);j.height=v(1,A(b,f));d.size=f;d.maxSize=k;d.minSize=v(g,f-j.height+1);n.css(j)}else if(e=="vert"){if(f===0||f=="auto"){n.css({width:"auto","float":"left"});f=n.outerWidth();n.css({"float":"none"})}f=v(f, g);f=Math.min(f,k);f=Math.min(f,q.innerWidth-h);j.width=v(1,E(b,f));d.size=f;d.maxSize=k;d.minSize=v(g,f-j.width+1);n.css(j);L(b,null,true)}else if(b=="center"){n.css(j);L("center",null,true)}if(c.initClosed&&c.closable){n.hide().addClass("closed");d.isClosed=true}else if(c.initHidden||c.initClosed){$(b,true);d.isHidden=true}else n.addClass("open");c.showOverflowOnHover&&n.hover(ea,S);if(c.contentSelector){d=N[b]=n.children(c.contentSelector+":first");if(!d.length){N[b]=false;return true}d.css(l.content.cssReq); c.applyDefaultStyles&&d.css(l.content.cssDef);n.css({overflow:"hidden"})}})},ua=function(){i.each(l.borderPanes.split(","),function(){var b=G(this),c=p[b],d=t[b],e=c.resizerClass,f=c.togglerClass,g=s[b];B[b]=false;O[b]=false;if(!(!g||!c.closable&&!c.resizable)){var k=l[b].edge;g=g.is(":visible");var h="-"+b,m=g?"-open":"-closed",j;j=B[b]=i("");g&&c.resizable||!g&&c.slidable&&j.attr("title",c.sliderTip).css("cursor",c.sliderCursor);j.attr("id",c.paneSelector.substr(0,1)=="#"?c.paneSelector.substr(1)+ "-resizer":"").attr("resizer",b).css(l.resizers.cssReq).css(k,q[k]+H(b)).addClass(e+" "+e+h+" "+e+m+" "+e+h+m).appendTo(z);c.applyDefaultStyles&&j.css(l.resizers.cssDef);if(c.closable){e=O[b]=i("
");e.attr("id",c.paneSelector.substr(0,1)=="#"?c.paneSelector.substr(1)+"-toggler":"").css(l.togglers.cssReq).attr("title",g?c.togglerTip_open:c.togglerTip_closed).click(function(n){R(b);n.stopPropagation()}).mouseover(function(n){n.stopPropagation()}).addClass(f+" "+f+h+" "+f+m+" "+f+h+m).appendTo(j); if(c.togglerContent_open)i(""+c.togglerContent_open+"").addClass("content content-open").css("display",d.isClosed?"none":"block").appendTo(e);if(c.togglerContent_closed)i(""+c.togglerContent_closed+"").addClass("content content-closed").css("display",d.isClosed?"block":"none").appendTo(e);c.applyDefaultStyles&&e.css(l.togglers.cssDef);g||aa(b,true)}}});P("all",true)},va=function(){var b=typeof i.fn.draggable=="function",c;i.each(l.borderPanes.split(","),function(){var d= G(this),e=p[d],f=t[d];if(!b||!s[d]||!e.resizable){e.resizable=false;return true}var g=e.resizerClass,k=g+"-drag",h=g+"-"+d+"-drag",m=g+"-dragging",j=g+"-"+d+"-dragging",n=false,r=B[d];f.isClosed||r.attr("title",e.resizerTip).css("cursor",e.resizerCursor);r.draggable({containment:z[0],axis:l[d].dir=="horz"?"y":"x",delay:200,distance:1,helper:"clone",opacity:e.resizerDragOpacity,zIndex:l.zIndex.resizing,start:function(){if(false===y(d,e.onresize_start))return false;f.isResizing=true;V(d,"closeSlider"); r.addClass(k+" "+h);n=false;var w=d=="east"||d=="south"?e.spacing_open:0;U(d);f.minPosition-=w;f.maxPosition-=w;c=l[d].dir=="horz"?"top":"left";i(e.maskIframesOnResize===true?"iframe":e.maskIframesOnResize).each(function(){i('
').css({background:"#fff",opacity:"0.001",zIndex:9,position:"absolute",width:this.offsetWidth+"px",height:this.offsetHeight+"px"}).css(i(this).offset()).appendTo(this.parentNode)})},drag:function(w,x){if(!n){i(".ui-draggable-dragging").addClass(m+ " "+j).children().css("visibility","hidden");n=true;f.isSliding&&s[d].css("zIndex",l.zIndex.sliding)}if(x.position[c]f.maxPosition)x.position[c]=f.maxPosition},stop:function(w,x){var C=x.position,J;r.removeClass(k+" "+h);switch(d){case "north":J=C.top;break;case "west":J=C.left;break;case "south":J=q.outerHeight-C.top-r.outerHeight();break;case "east":J=q.outerWidth-C.left-r.outerWidth()}ba(d,J-q[l[d].edge]);i("div.ui-layout-mask").remove(); f.isResizing=false}})})},$=function(b,c){var d=p[b],e=t[b],f=s[b],g=B[b];if(!(!f||e.isHidden))if(false!==y(b,d.onhide_start)){e.isSliding=false;g&&g.hide();if(c||e.isClosed){e.isClosed=true;e.isHidden=true;f.hide();L(l[b].dir=="horz"?"all":"center");y(b,d.onhide_end||d.onhide)}else{e.isHiding=true;I(b,false)}}},W=function(b,c){var d=p[b],e=t[b],f=B[b];if(s[b]&&e.isHidden)if(false!==y(b,d.onshow_start)){e.isSliding=false;e.isShowing=true;f&&d.spacing_open>0&&f.show();c===false?I(b,true):K(b)}},R=function(b){var c= t[b];if(c.isHidden)W(b);else c.isClosed?K(b):I(b)},I=function(b,c,d){function e(){aa(b,true);x||y(b,h.onclose_end||h.onclose);if(x)y(b,h.onshow_end||h.onshow);if(C)y(b,h.onhide_end||h.onhide);ia(b)}var f=s[b],g=B[b],k=O[b],h=p[b],m=t[b];d=!d&&!m.isClosed&&h.fxName_close!="none";var j=l[b].edge,n=h.resizerClass,r=h.togglerClass,w="-"+b,x=m.isShowing,C=m.isHiding;delete m.isShowing;delete m.isHiding;if(!(!f||!h.resizable&&!h.closable))if(!(!c&&m.isClosed&&!x))if(l.isLayoutBusy)ha("close",b,c);else if(!(!x&& false===y(b,h.onclose_start))){l[b].isMoving=true;l.isLayoutBusy=true;m.isClosed=true;if(C)m.isHidden=true;else if(x)m.isHidden=false;fa(b,false);m.isSliding||L(l[b].dir=="horz"?"all":"center");if(g){g.css(j,q[j]).removeClass(n+"-open "+n+w+"-open").removeClass(n+"-sliding "+n+w+"-sliding").addClass(n+"-closed "+n+w+"-closed");h.resizable&&g.draggable("disable").css("cursor","default").attr("title","");k&&k.removeClass(r+"-open "+r+w+"-open").addClass(r+"-closed "+r+w+"-closed").attr("title",h.togglerTip_closed); P()}if(d){X(b,true);f.hide(h.fxName_close,h.fxSettings_close,h.fxSpeed_close,function(){X(b,false);m.isClosed&&e()})}else{f.hide();e()}}},K=function(b,c,d){function e(){m.isSliding||L(l[b].dir=="vert"?"center":"all");if(g){g.css(j,q[j]+H(b)).removeClass(n+C+" "+n+w+C).addClass(n+x+" "+n+w+x).addClass(!m.isSliding?"":n+J+" "+n+w+J);h.resizable?g.draggable("enable").css("cursor",h.resizerCursor).attr("title",h.resizerTip):g.css("cursor","default");k&&k.removeClass(r+C+" "+r+w+C).addClass(r+x+" "+r+ w+x).attr("title",h.togglerTip_open);P("all")}Q(b);fa(b,!m.isSliding);y(b,h.onopen_end||h.onopen);if(ca)y(b,h.onshow_end||h.onshow);ia(b)}var f=s[b],g=B[b],k=O[b],h=p[b],m=t[b];d=!d&&m.isClosed&&h.fxName_open!="none";var j=l[b].edge,n=h.resizerClass,r=h.togglerClass,w="-"+b,x="-open",C="-closed",J="-sliding",ca=m.isShowing;delete m.isShowing;if(!(!f||!h.resizable&&!h.closable))if(m.isClosed||m.isSliding)if(m.isHidden&&!ca)W(b,true);else if(l.isLayoutBusy)ha("open",b,c);else if(false!==y(b,h.onopen_start)){l[b].isMoving= true;l.isLayoutBusy=true;m.isSliding&&!c&&da(b,false);m.isClosed=false;if(ca)m.isHidden=false;U(b);m.size>m.maxSize&&f.css(l[b].sizeType,v(1,l[b].dir=="horz"?A(b,m.maxSize):E(b,m.maxSize)));aa(b,false);if(d){X(b,true);f.show(h.fxName_open,h.fxSettings_open,h.fxSpeed_open,function(){X(b,false);m.isClosed||e()})}else{f.show();e()}}},X=function(b,c){var d=s[b];if(c){d.css({zIndex:l.zIndex.animation});if(b=="south")d.css({top:q.top+q.innerHeight-d.outerHeight()});else b=="east"&&d.css({left:q.left+q.innerWidth- d.outerWidth()})}else{t[b].isSliding||d.css({zIndex:l.zIndex.pane_normal});if(b=="south")d.css({top:"auto"});else b=="east"&&d.css({left:"auto"})}},aa=function(b,c){var d=p[b],e=B[b],f=d.slideTrigger_open;if(e&&d.slidable){if(f!="click"&&f!="dblclick"&&f!="mouseover")f="click";e[c?"bind":"unbind"](f,wa).css("cursor",c?d.sliderCursor:"default").attr("title",c?d.sliderTip:"")}},da=function(b,c){function d(k){V(b,"closeSlider");k.stopPropagation()}var e=p[b].slideTrigger_close,f=s[b],g=B[b];t[b].isSliding= c;V(b,"closeSlider");f.css({zIndex:c?l.zIndex.sliding:l.zIndex.pane_normal});g.css({zIndex:c?l.zIndex.sliding:l.zIndex.resizer_normal});if(e!="click"&&e!="mouseout")e="mouseout";if(c){f.bind(e,la);g.bind(e,la);e="mouseout";f.bind("mouseover",d);g.bind("mouseover",d)}else{f.unbind(e);g.unbind(e);e="mouseout";f.unbind("mouseover");g.unbind("mouseover");V(b,"closeSlider")}},wa=function(){var b=i(this).attr("resizer");if(t[b].isClosed){da(b,true);K(b,true)}},la=function(){function b(){da(d,false);e.isClosed|| I(d)}var c=i(this),d=c.attr("pane")||c.attr("resizer");c=p[d];var e=t[d];e.isClosed||e.isResizing||(c.slideTrigger_close=="click"?b():pa(d,"closeSlider",b,300))},ba=function(b,c){var d=l[b].edge,e=l[b].dir,f=p[b],g=t[b],k=s[b],h=B[b];U(b);g.minSize=v(g.minSize,f.minSize);if(f.maxSize>0)g.maxSize=Math.min(g.maxSize,f.maxSize);c=v(c,g.minSize);c=Math.min(c,g.maxSize);g.size=c;h.css(d,c+q[d]);k.css(l[b].sizeType,v(1,l[b].dir=="horz"?A(b,c):E(b,c)));g.isSliding||L(e=="horz"?"all":"center");P();Q(b);y(b, f.onresize_end||f.onresize)},L=function(b,c,d){if(!b||b=="all")b="east,west,center";var e=ja();c&&i.extend(e,c);i.each(b.split(","),function(){if(s[this]){var f=G(this),g=p[f],k=t[f],h=s[f],m=B[f],j=true,n={};if(f=="center"){e=ja();n=i.extend({},e);n.width=v(1,E(f,n.width));n.height=v(1,A(f,n.height));j=n.width>1&&n.height>1;if(i.browser.msie&&(!i.boxModel||i.browser.version<7)){s.north&&s.north.css({width:E(s.north,q.innerWidth)});s.south&&s.south.css({width:E(s.south,q.innerWidth)})}}else{n.top= e.top;n.bottom=e.bottom;n.height=v(1,A(f,e.height));j=n.height>1}if(j){h.css(n);if(k.noRoom){k.noRoom=false;if(k.isHidden)return;else W(f,!k.isClosed)}if(!d){Q(f);y(f,g.onresize_end||g.onresize)}}else if(!k.noRoom){k.noRoom=true;if(!k.isHidden)if(d){h.hide();m&&m.hide()}else $(f)}}})},Q=function(b){if(!b||b=="all")b=l.allPanes;i.each(b.split(","),function(){if(N[this]){var c=G(this),d=p[c].contentIgnoreSelector,e=s[c];c=N[c];var f=c[0],g=A(e);e.children().each(function(){if(this!=f){var k=i(this); if(!d||!k.is(d))g-=k.outerHeight()}});if(g>0)g=A(c,g);g<1?c.hide():c.css({height:g}).show()}})},P=function(b,c){if(!b||b=="all")b=l.borderPanes;i.each(b.split(","),function(){var d=G(this),e=p[d],f=t[d],g=s[d],k=B[d],h=O[d];if(!(!g||!k||!e.resizable&&!e.closable)){var m=l[d].dir,j=f.isClosed?"_closed":"_open";d=e["spacing"+j];var n=e["togglerAlign"+j];j=e["togglerLength"+j];var r;if(d==0)k.hide();else{!f.noRoom&&!f.isHidden&&k.show();if(m=="horz"){r=g.outerWidth();k.css({width:v(1,E(k,r)),height:v(1, A(k,d)),left:D(g,"left")})}else{r=g.outerHeight();k.css({height:v(1,A(k,r)),width:v(1,E(k,d)),top:q.top+H("north",true)})}if(h){if(j==0||f.isSliding&&e.hideTogglerOnSlide){h.hide();return}else h.show();if(!(j>0)||j=="100%"||j>r){j=r;g=0}else if(typeof n=="string")switch(n){case "top":case "left":g=0;break;case "bottom":case "right":g=r-j;break;default:g=Math.floor((r-j)/2)}else{g=parseInt(n);g=n>=0?g:r-j+g}r=e.togglerContent_open?h.children(".content-open"):false;var w=e.togglerContent_closed?h.children(".content-closed"): false;n=f.isClosed?w:r;if(r)r.css("display",f.isClosed?"none":"block");if(w)w.css("display",f.isClosed?"block":"none");if(m=="horz"){f=E(h,j);h.css({width:v(0,f),height:v(1,A(h,d)),left:g});n&&n.css("marginLeft",Math.floor((f-n.outerWidth())/2))}else{f=A(h,j);h.css({height:v(0,f),width:v(1,E(h,d)),top:g});n&&n.css("marginTop",Math.floor((f-n.outerHeight())/2))}}if(c&&e.initHidden){k.hide();h&&h.hide()}}}})},ma=function(){var b=q.innerWidth,c=q.innerHeight;q=t.container=ka(z);var d=q.innerHeightf.maxSize&&ba(h,f.maxSize)}});L("all");P("all")},z=i(this).css({overflow:"hidden"}),s={},N={},B={},O={},l={allPanes:"north,south,east,west,center",borderPanes:"north,south,east,west",zIndex:{resizer_normal:1,pane_normal:2,mask:4,sliding:100,resizing:1E4,animation:1E4},resizers:{cssReq:{position:"absolute",padding:0,margin:0,fontSize:"1px",textAlign:"left", overflow:"hidden",zIndex:1},cssDef:{background:"#DDD",border:"none"}},togglers:{cssReq:{position:"absolute",display:"block",padding:0,margin:0,overflow:"hidden",textAlign:"center",fontSize:"1px",cursor:"pointer",zIndex:1},cssDef:{background:"#AAA"}},content:{cssReq:{overflow:"auto"},cssDef:{}},defaults:{cssReq:{position:"absolute",margin:0,zIndex:2},cssDef:{padding:"10px",background:"#FFF",border:"1px solid #BBB",overflow:"auto"}},north:{edge:"top",sizeType:"height",dir:"horz",cssReq:{top:0,bottom:"auto", left:0,right:0,width:"auto"}},south:{edge:"bottom",sizeType:"height",dir:"horz",cssReq:{top:"auto",bottom:0,left:0,right:0,width:"auto"}},east:{edge:"right",sizeType:"width",dir:"vert",cssReq:{left:"auto",right:0,top:"auto",bottom:"auto",height:"auto"}},west:{edge:"left",sizeType:"width",dir:"vert",cssReq:{left:0,right:"auto",top:"auto",bottom:"auto",height:"auto"}},center:{dir:"center",cssReq:{left:"auto",right:"auto",top:"auto",bottom:"auto",height:"auto",width:"auto"}}},q=t.container;(function(){sa(); qa();ta();ua();va();Q("all");p.scrollToBookmarkOnLoad&&self.location.hash&&replace(self.location.hash);ra();i(window).resize(function(){var b="timerLayout_"+t.id;window[b]&&clearTimeout(window[b]);window[b]=null;window[b]=setTimeout(ma,100)})})();return{options:p,state:t,panes:s,toggle:R,open:K,close:I,hide:$,show:W,resizeContent:Q,sizePane:ba,resizeAll:ma,addToggleBtn:function(b,c){var d=T(b,c,"toggle");if(d)d.attr("title",t[c].isClosed?"Open":"Close").click(function(e){R(c);e.stopPropagation()})}, addOpenBtn:function(b,c){var d=T(b,c,"open");d&&d.attr("title","Open").click(function(e){K(c);e.stopPropagation()})},addCloseBtn:function(b,c){var d=T(b,c,"close");d&&d.attr("title","Close").click(function(e){I(c);e.stopPropagation()})},addPinBtn:function(b,c){var d=T(b,c,"pin");if(d){var e=t[c];d.click(function(f){Y(i(this),c,e.isSliding||e.isClosed);e.isSliding||e.isClosed?K(c):I(c);f.stopPropagation()});Y(d,c,!e.isClosed&&!e.isSliding);l[c].pins.push(b)}},allowOverflow:ea,resetOverflow:S,cssWidth:E, cssHeight:A}}})(jQuery);