(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]