(function($){$.layout={version:"1.3.rc29.15",revision:0.032915,language:{Open:"Open",Close:"Close",Resize:"Resize",Slide:"Slide Open",Pin:"Pin",Unpin:"Un-Pin",noRoomToOpenTip:"Not enough room to show this pane.",pane:"pane",selector:"selector",errButton:"Error Adding Button \n\nInvalid ",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'!"},browser:{mozilla:!!$.browser.mozilla,webkit:!!$.browser.webkit||!!$.browser.safari,msie:!!$.browser.msie,isIE6:!!$.browser.msie&&$.browser.version==6,boxModel:false},scrollbarWidth:function(){return window.scrollbarWidth||$.layout.getScrollbarSize("width")},scrollbarHeight:function(){return window.scrollbarHeight||$.layout.getScrollbarSize("height")},getScrollbarSize:function(dim){var $c=$('<div style="position: absolute; top: -10000px; left: -10000px; width: 100px; height: 100px; overflow: scroll;"></div>').appendTo("body");var d={width:$c.width()-$c[0].clientWidth,height:$c.height()-$c[0].clientHeight};$c.remove();window.scrollbarWidth=d.width;window.scrollbarHeight=d.height;return dim.match(/^(width|height)$/i)?d[dim]:d},showInvisibly:function($E,force){if(!$E){return{}}if(!$E.jquery){$E=$($E)}var CSS={display:$E.css("display"),visibility:$E.css("visibility")};if(force||CSS.display=="none"){$E.css({display:"block",visibility:"hidden"});return CSS}else{return{}}},getElementDimensions:function($E){var d={},x=d.css={},i={},b,p,N=$.layout.cssNum,off=$E.offset();d.offsetLeft=off.left;d.offsetTop=off.top;$.each("Left,Right,Top,Bottom".split(","),function(idx,e){b=x["border"+e]=$.layout.borderWidth($E,e);p=x["padding"+e]=$.layout.cssNum($E,"padding"+e);i[e]=b+p;d["inset"+e]=p});d.offsetWidth=$E.innerWidth();d.offsetHeight=$E.innerHeight();d.outerWidth=$E.outerWidth();d.outerHeight=$E.outerHeight();d.innerWidth=Math.max(0,d.outerWidth-i.Left-i.Right);d.innerHeight=Math.max(0,d.outerHeight-i.Top-i.Bottom);x.width=$E.width();x.height=$E.height();x.top=N($E,"top",true);x.bottom=N($E,"bottom",true);x.left=N($E,"left",true);x.right=N($E,"right",true);return d},getElementCSS:function($E,list){var CSS={},style=$E[0].style,props=list.split(","),sides="Top,Bottom,Left,Right".split(","),attrs="Color,Style,Width".split(","),p,s,a,i,j,k;for(i=0;i<props.length;i++){p=props[i];if(p.match(/(border|padding|margin)$/)){for(j=0;j<4;j++){s=sides[j];if(p=="border"){for(k=0;k<3;k++){a=attrs[k];CSS[p+s+a]=style[p+s+a]}}else{CSS[p+s]=style[p+s]}}}else{CSS[p]=style[p]}}return CSS},cssWidth:function($E,outerWidth){var b=$.layout.borderWidth,n=$.layout.cssNum;if(outerWidth<=0){return 0}if(!$.layout.browser.boxModel){return outerWidth}var W=outerWidth-b($E,"Left")-b($E,"Right")-n($E,"paddingLeft")-n($E,"paddingRight");return Math.max(0,W)},cssHeight:function($E,outerHeight){var b=$.layout.borderWidth,n=$.layout.cssNum;if(outerHeight<=0){return 0}if(!$.layout.browser.boxModel){return outerHeight}var H=outerHeight-b($E,"Top")-b($E,"Bottom")-n($E,"paddingTop")-n($E,"paddingBottom");return Math.max(0,H)},cssNum:function($E,prop,allowAuto){if(!$E.jquery){$E=$($E)}var CSS=$.layout.showInvisibly($E),p=$.curCSS($E[0],prop,true),v=allowAuto&&p=="auto"?p:(parseInt(p,10)||0);$E.css(CSS);return v},borderWidth:function(el,side){if(el.jquery){el=el[0]}var b="border"+side.substr(0,1).toUpperCase()+side.substr(1);return $.curCSS(el,b+"Style",true)=="none"?0:(parseInt($.curCSS(el,b+"Width",true),10)||0)},isMouseOverElem:function(evt,el){var $E=$(el||this),d=$E.offset(),T=d.top,L=d.left,R=L+$E.outerWidth(),B=T+$E.outerHeight(),x=evt.pageX,y=evt.pageY;return($.layout.browser.msie&&x<0&&y<0)||((x>=L&&x<=R)&&(y>=T&&y<=B))}};$.fn.layout=function(opts){var lang=$.layout.language,options={name:"",containerClass:"ui-layout-container",scrollToBookmarkOnLoad:true,resizeWithWindow:true,resizeWithWindowDelay:200,resizeWithWindowMaxDelay:0,onresizeall_start:null,onresizeall_end:null,onload_start:null,onload_end:null,onunload_start:null,onunload_end:null,autoBindCustomButtons:false,zIndex:null,initPanes:true,showErrorMessages:true,defaults:{applyDemoStyles:false,closable:true,resizable:true,slidable:true,initClosed:false,initHidden:false,contentSelector:".ui-layout-content",contentIgnoreSelector:".ui-layout-ignore",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:lang.Close,togglerTip_closed:lang.Open,togglerContent_open:"",togglerContent_closed:"",resizerDblClickToggle:true,autoResize:true,autoReopen:true,resizerDragOpacity:1,maskIframesOnResize:true,resizeNestedLayout:true,resizeWhileDragging:false,resizeContentWhileDragging:false,noRoomToOpenTip:lang.noRoomToOpenTip,resizerTip:lang.Resize,sliderTip:lang.Slide,sliderCursor:"pointer",slideTrigger_open:"click",slideTrigger_close:"mouseleave",slideDelay_open:300,slideDelay_close:300,hideTogglerOnSlide:false,preventQuickSlideClose:$.layout.browser.webkit,preventPrematureSlideClose:false,showOverflowOnHover: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,onsizecontent_start:null,onsizecontent_end:null,onswap_start:null,onswap_end:null,ondrag_start:null,ondrag_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"}},effects={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"}}},state={id:"layout"+new Date().getTime(),initialized:false,container:{},north:{},south:{},east:{},west:{},center:{},cookie:{}},_c={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:1000,resizer_drag:10000},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"}}},timer={data:{},set:function(s,fn,ms){timer.clear(s);timer.data[s]=setTimeout(fn,ms)},clear:function(s){var t=timer.data;if(t[s]){clearTimeout(t[s]);delete t[s]}}},isStr=function(o){try{return typeof o=="string"||(typeof o=="object"&&o.constructor.toString().match(/string/i)!==null)}catch(e){return false}},str=function(o){return isStr(o)?$.trim(o):o==undefined||o==null?"":o},min=function(x,y){return Math.min(x,y)},max=function(x,y){return Math.max(x,y)},_transformData=function(d){var a,json={cookie:{},defaults:{fxSettings:{}},north:{fxSettings:{}},south:{fxSettings:{}},east:{fxSettings:{}},west:{fxSettings:{}},center:{fxSettings:{}}};d=d||{};if(d.effects||d.cookie||d.defaults||d.north||d.south||d.west||d.east||d.center){json=$.extend(true,json,d)}else{$.each(d,function(key,val){a=key.split("__");if(!a[1]||json[a[0]]){json[a[1]?a[0]:"defaults"][a[1]?a[1]:a[0]]=val}})}return json},_queue=function(action,pane,param){var tried=[];$.each(_c.borderPanes.split(","),function(i,p){if(_c[p].isMoving){bindCallback(p);return false}});function bindCallback(p){var c=_c[p];if(!c.doCallback){c.doCallback=true;c.callback=action+","+pane+","+(param?1:0)}else{tried.push(p);var cbPane=c.callback.split(",")[1];if(cbPane!=pane&&!$.inArray(cbPane,tried)>=0){bindCallback(cbPane)}}}},_dequeue=function(pane){var c=_c[pane];_c.isLayoutBusy=false;delete c.isMoving;if(!c.doCallback||!c.callback){return}c.doCallback=false;var cb=c.callback.split(","),param=(cb[2]>0?true:false);if(cb[0]=="open"){open(cb[1],param)}else{if(cb[0]=="close"){close(cb[1],param)}}if(!c.doCallback){c.callback=null}},_execCallback=function(pane,v_fn){if(!v_fn){return}var fn;try{if(typeof v_fn=="function"){fn=v_fn}else{if(!isStr(v_fn)){return}else{if(v_fn.match(/,/)){var args=v_fn.split(",");fn=eval(args[0]);if(typeof fn=="function"&&args.length>1){return fn(args[1])}}else{fn=eval(v_fn)}}}if(typeof fn=="function"){if(pane&&$Ps[pane]){return fn(pane,$Ps[pane],state[pane],options[pane],options.name)}else{return fn(Instance,state,options,options.name)}}}catch(ex){}},_fixIframe=function(pane){if($.layout.browser.mozilla){return}var $P=$Ps[pane];if(state[pane].tagName=="IFRAME"){$P.css(_c.hidden).css(_c.visible)}else{$P.find("IFRAME").css(_c.hidden).css(_c.visible)}},cssW=function(el,outerWidth){var str=isStr(el),$E=str?$Ps[el]:$(el);if(!$E.length){return 0}if(isNaN(outerWidth)){outerWidth=str?getPaneSize(el):$E.outerWidth()}return $.layout.cssWidth($E,outerWidth)},cssH=function(el,outerHeight){var str=isStr(el),$E=str?$Ps[el]:$(el);if(!$E.length){return 0}if(isNaN(outerHeight)){outerHeight=str?getPaneSize(el):$E.outerHeight()}return $.layout.cssHeight($E,outerHeight)},cssSize=function(pane,outerSize){if(_c[pane].dir=="horz"){return cssH(pane,outerSize)}else{return cssW(pane,outerSize)}},cssMinDims=function(pane){var dir=_c[pane].dir,d={minWidth:1001-cssW(pane,1000),minHeight:1001-cssH(pane,1000)};if(dir=="horz"){d.minSize=d.minHeight}if(dir=="vert"){d.minSize=d.minWidth}return d},setOuterWidth=function(el,outerWidth,autoHide){var $E=el,w;if(isStr(el)){$E=$Ps[el]}else{if(!el.jquery){$E=$(el)}}w=cssW($E,outerWidth);$E.css({width:w});if(w>0){if(autoHide&&$E.data("autoHidden")&&$E.innerHeight()>0){$E.show().data("autoHidden",false);if(!$.layout.browser.mozilla){$E.css(_c.hidden).css(_c.visible)}}}else{if(autoHide&&!$E.data("autoHidden")){$E.hide().data("autoHidden",true)}}},setOuterHeight=function(el,outerHeight,autoHide){var $E=el,h;if(isStr(el)){$E=$Ps[el]}else{if(!el.jquery){$E=$(el)}}h=cssH($E,outerHeight);$E.css({height:h,visibility:"visible"});if(h>0&&$E.innerWidth()>0){if(autoHide&&$E.data("autoHidden")){$E.show().data("autoHidden",false);if(!$.layout.browser.mozilla){$E.css(_c.hidden).css(_c.visible)}}}else{if(autoHide&&!$E.data("autoHidden")){$E.hide().data("autoHidden",true)}}},setOuterSize=function(el,outerSize,autoHide){if(_c[pane].dir=="horz"){setOuterHeight(el,outerSize,autoHide)}else{setOuterWidth(el,outerSize,autoHide)}},_parseSize=function(pane,size,dir){if(!dir){dir=_c[pane].dir}if(isStr(size)&&size.match(/%/)){size=parseInt(size,10)/100}if(size===0){return 0}else{if(size>=1){return parseInt(size,10)}else{if(size>0){var o=options,avail;if(dir=="horz"){avail=sC.innerHeight-($Ps.north?o.north.spacing_open:0)-($Ps.south?o.south.spacing_open:0)}else{if(dir=="vert"){avail=sC.innerWidth-($Ps.west?o.west.spacing_open:0)-($Ps.east?o.east.spacing_open:0)}}return Math.floor(avail*size)}else{if(pane=="center"){return 0}else{var $P=$Ps[pane],dim=(dir=="horz"?"height":"width"),vis=$.layout.showInvisibly($P),s=$P.css(dim);$P.css(dim,"auto");size=(dim=="height")?$P.outerHeight():$P.outerWidth();$P.css(dim,s).css(vis);return size}}}}},getPaneSize=function(pane,inclSpace){var $P=$Ps[pane],o=options[pane],s=state[pane],oSp=(inclSpace?o.spacing_open:0),cSp=(inclSpace?o.spacing_closed:0);if(!$P||s.isHidden){return 0}else{if(s.isClosed||(s.isSliding&&inclSpace)){return cSp}else{if(_c[pane].dir=="horz"){return $P.outerHeight()+oSp}else{return $P.outerWidth()+oSp}}}},setSizeLimits=function(pane,slide){if(!isInitialized()){return}var o=options[pane],s=state[pane],c=_c[pane],dir=c.dir,side=c.side.toLowerCase(),type=c.sizeType.toLowerCase(),isSliding=(slide!=undefined?slide:s.isSliding),$P=$Ps[pane],paneSpacing=o.spacing_open,altPane=_c.altSide[pane],altS=state[altPane],$altP=$Ps[altPane],altPaneSize=(!$altP||altS.isVisible===false||altS.isSliding?0:(dir=="horz"?$altP.outerHeight():$altP.outerWidth())),altPaneSpacing=((!$altP||altS.isHidden?0:options[altPane][altS.isClosed!==false?"spacing_closed":"spacing_open"])||0),containerSize=(dir=="horz"?sC.innerHeight:sC.innerWidth),minCenterDims=cssMinDims("center"),minCenterSize=dir=="horz"?max(options.center.minHeight,minCenterDims.minHeight):max(options.center.minWidth,minCenterDims.minWidth),limitSize=(containerSize-paneSpacing-(isSliding?0:(_parseSize("center",minCenterSize,dir)+altPaneSize+altPaneSpacing))),minSize=s.minSize=max(_parseSize(pane,o.minSize),cssMinDims(pane).minSize),maxSize=s.maxSize=min((o.maxSize?_parseSize(pane,o.maxSize):100000),limitSize),r=s.resizerPosition={},top=sC.insetTop,left=sC.insetLeft,W=sC.innerWidth,H=sC.innerHeight,rW=o.spacing_open;switch(pane){case"north":r.min=top+minSize;r.max=top+maxSize;break;case"west":r.min=left+minSize;r.max=left+maxSize;break;case"south":r.min=top+H-maxSize-rW;r.max=top+H-minSize-rW;break;case"east":r.min=left+W-maxSize-rW;r.max=left+W-minSize-rW;break}},calcNewCenterPaneDims=function(){var d={top:getPaneSize("north",true),bottom:getPaneSize("south",true),left:getPaneSize("west",true),right:getPaneSize("east",true),width:0,height:0};d.width=sC.innerWidth-d.left-d.right;d.height=sC.innerHeight-d.bottom-d.top;d.top+=sC.insetTop;d.bottom+=sC.insetBottom;d.left+=sC.insetLeft;d.right+=sC.insetRight;return d},elDims=function($E){return $.layout.getElementDimensions($E)},elCSS=function($E,list){return $.layout.getElementCSS($E,list)},getHoverClasses=function(el,allStates){var $El=$(el),type=$El.data("layoutRole"),pane=$El.data("layoutEdge"),o=options[pane],root=o[type+"Class"],_pane="-"+pane,_open="-open",_closed="-closed",_slide="-sliding",_hover="-hover ",_state=$El.hasClass(root+_closed)?_closed:_open,_alt=_state==_closed?_open:_closed,classes=(root+_hover)+(root+_pane+_hover)+(root+_state+_hover)+(root+_pane+_state+_hover);if(allStates){classes+=(root+_alt+_hover)+(root+_pane+_alt+_hover)}if(type=="resizer"&&$El.hasClass(root+_slide)){classes+=(root+_slide+_hover)+(root+_pane+_slide+_hover)}return $.trim(classes)},addHover=function(evt,el){var $E=$(el||this);if(evt&&$E.data("layoutRole")=="toggler"){evt.stopPropagation()}$E.addClass(getHoverClasses($E))},removeHover=function(evt,el){var $E=$(el||this);$E.removeClass(getHoverClasses($E,true))},onResizerEnter=function(evt){$("body").disableSelection();addHover(evt,this)},onResizerLeave=function(evt,el){var e=el||this,pane=$(e).data("layoutEdge"),name=pane+"ResizerLeave";timer.clear(pane+"_openSlider");timer.clear(name);if(!el){removeHover(evt,this);timer.set(name,function(){onResizerLeave(evt,e)},200)}else{if(!state[pane].isResizing){$("body").enableSelection()}}},_create=function(){initOptions();var o=options;$.layout.browser.boxModel=$.support.boxModel;if(o.useStateCookie&&o.cookie.autoLoad){loadCookie()}state.creatingLayout=true;if(false===_execCallback(null,o.onload_start)){return"cancel"}_initContainer();initHotkeys();if(o.autoBindCustomButtons){initButtons()}$(window).bind("unload."+sID,unload);if(o.initPanes){_initLayoutElements()}delete state.creatingLayout;return state.initialized},isInitialized=function(){if(state.initialized||state.creatingLayout){return true}else{return _initLayoutElements()}},_initLayoutElements=function(){var o=options;if(!$N.is(":visible")){return false}if(!getPane("center").length){if(o.showErrorMessages){alert(lang.errCenterPaneMissing)}return false}state.creatingLayout=true;$.extend(sC,elDims($N));initPanes();sizeContent();if(o.scrollToBookmarkOnLoad){var l=self.location;if(l.hash){l.replace(l.hash)}}if(o.resizeWithWindow&&!$N.data("layoutRole")){$(window).bind("resize."+sID,windowResize)}delete state.creatingLayout;state.initialized=true;_execCallback(null,o.onload_end||o.onload);return true},windowResize=function(){var delay=Number(options.resizeWithWindowDelay);if(delay<10){delay=100}timer.clear("winResize");timer.set("winResize",function(){timer.clear("winResize");timer.clear("winResizeRepeater");var dims=elDims($N);if(dims.innerWidth!==sC.innerWidth||dims.innerHeight!==sC.innerHeight){resizeAll()}},delay);if(!timer.data.winResizeRepeater){setWindowResizeRepeater()}},setWindowResizeRepeater=function(){var delay=Number(options.resizeWithWindowMaxDelay);if(delay>0){timer.set("winResizeRepeater",function(){setWindowResizeRepeater();resizeAll()},delay)}},unload=function(){var o=options;state.cookie=getState();_execCallback(null,o.onunload_start);if(o.useStateCookie&&o.cookie.autoSave){saveCookie()}_execCallback(null,o.onunload_end||o.onunload)},_initContainer=function(){var tag=sC.tagName=$N[0].tagName,o=options,fullPage=(tag=="BODY"),props="overflow,position,margin,padding,border",CSS={},hid="hidden",isVis=$N.is(":visible");sC.selector=$N.selector.split(".slice")[0];sC.ref=tag+"/"+sC.selector;$N.data("layout",Instance).data("layoutContainer",sID).addClass(o.containerClass);if(!$N.data("layoutCSS")){if(fullPage){CSS=$.extend(elCSS($N,props),{height:$N.css("height"),overflow:$N.css("overflow"),overflowX:$N.css("overflowX"),overflowY:$N.css("overflowY")});var $H=$("html");$H.data("layoutCSS",{height:"auto",overflow:$H.css("overflow"),overflowX:$H.css("overflowX"),overflowY:$H.css("overflowY")})}else{CSS=elCSS($N,props+",top,bottom,left,right,width,height,overflow,overflowX,overflowY")}$N.data("layoutCSS",CSS)}try{if(fullPage){$("html").css({height:"100%",overflow:hid,overflowX:hid,overflowY:hid});$("body").css({position:"relative",height:"100%",overflow:hid,overflowX:hid,overflowY:hid,margin:0,padding:0,border:"none"});$.extend(sC,elDims($N))}else{CSS={overflow:hid,overflowX:hid,overflowY:hid};var p=$N.css("position"),h=$N.css("height");if(!$N.data("layoutRole")){if(!p||!p.match(/fixed|absolute|relative/)){CSS.position="relative"}}$N.css(CSS);if(isVis){$.extend(sC,elDims($N));if(o.showErrorMessages&&sC.innerHeight<2){alert(lang.errContainerHeight.replace(/CONTAINER/,sC.ref))}}}}catch(ex){}},initHotkeys=function(panes){if(!panes||panes=="all"){panes=_c.borderPanes}$.each(panes.split(","),function(i,pane){var o=options[pane];if(o.enableCursorHotkey||o.customHotkey){$(document).bind("keydown."+sID,keyDown);return false}})},initOptions=function(){opts=_transformData(opts);var newOpts={applyDefaultStyles:"applyDemoStyles"};renameOpts(opts.defaults);$.each(_c.allPanes.split(","),function(i,pane){renameOpts(opts[pane])});if(opts.effects){$.extend(effects,opts.effects);delete opts.effects}$.extend(options.cookie,opts.cookie);var globals="name,containerClass,zIndex,scrollToBookmarkOnLoad,resizeWithWindow,resizeWithWindowDelay,resizeWithWindowMaxDelay,onresizeall,onresizeall_start,onresizeall_end,onload,onload_start,onload_end,onunload,onunload_start,onunload_end,autoBindCustomButtons,useStateCookie,showErrorMessages";$.each(globals.split(","),function(i,key){if(opts[key]!==undefined){options[key]=opts[key]}else{if(opts.defaults[key]!==undefined){options[key]=opts.defaults[key];delete opts.defaults[key]}}});$.each("paneSelector,resizerCursor,customHotkey".split(","),function(i,key){delete opts.defaults[key]});$.extend(true,options.defaults,opts.defaults);_c.center=$.extend(true,{},_c.panes,_c.center);var z=options.zIndex;if(z===0||z>0){_c.zIndex.pane_normal=z;_c.zIndex.resizer_normal=z+1;_c.zIndex.iframe_mask=z+1}$.extend(options.center,opts.center);var o_Center=$.extend(true,{},options.defaults,opts.defaults,options.center);var optionsCenter=("paneClass,contentSelector,applyDemoStyles,triggerEventsOnLoad,showOverflowOnHover,onresize,onresize_start,onresize_end,resizeNestedLayout,resizeContentWhileDragging,findNestedContent,onsizecontent,onsizecontent_start,onsizecontent_end").split(",");$.each(optionsCenter,function(i,key){options.center[key]=o_Center[key]});var o,defs=options.defaults;$.each(_c.borderPanes.split(","),function(i,pane){_c[pane]=$.extend(true,{},_c.panes,_c[pane]);o=options[pane]=$.extend(true,{},options.defaults,options[pane],opts.defaults,opts[pane]);if(!o.paneClass){o.paneClass="ui-layout-pane"}if(!o.resizerClass){o.resizerClass="ui-layout-resizer"}if(!o.togglerClass){o.togglerClass="ui-layout-toggler"}$.each(["_open","_close",""],function(i,n){var sName="fxName"+n,sSpeed="fxSpeed"+n,sSettings="fxSettings"+n;o[sName]=opts[pane][sName]||opts[pane].fxName||opts.defaults[sName]||opts.defaults.fxName||o[sName]||o.fxName||defs[sName]||defs.fxName||"none";var fxName=o[sName];if(fxName=="none"||!$.effects||!$.effects[fxName]||(!effects[fxName]&&!o[sSettings]&&!o.fxSettings)){fxName=o[sName]="none"}var fx=effects[fxName]||{},fx_all=fx.all||{},fx_pane=fx[pane]||{};o[sSettings]=$.extend({},fx_all,fx_pane,defs.fxSettings||{},defs[sSettings]||{},o.fxSettings,o[sSettings],opts.defaults.fxSettings,opts.defaults[sSettings]||{},opts[pane].fxSettings,opts[pane][sSettings]||{});o[sSpeed]=opts[pane][sSpeed]||opts[pane].fxSpeed||opts.defaults[sSpeed]||opts.defaults.fxSpeed||o[sSpeed]||o[sSettings].duration||o.fxSpeed||o.fxSettings.duration||defs.fxSpeed||defs.fxSettings.duration||fx_pane.duration||fx_all.duration||"normal"})});function renameOpts(O){for(var key in newOpts){if(O[key]!=undefined){O[newOpts[key]]=O[key];delete O[key]}}}},getPane=function(pane){var sel=options[pane].paneSelector;if(sel.substr(0,1)==="#"){return $N.find(sel).eq(0)}else{var $P=$N.children(sel).eq(0);return $P.length?$P:$N.children("form:first").children(sel).eq(0)}},initPanes=function(){$.each(_c.allPanes.split(","),function(idx,pane){addPane(pane,true)});initHandles();$.each(_c.borderPanes.split(","),function(i,pane){if($Ps[pane]&&state[pane].isVisible){setSizeLimits(pane);makePaneFit(pane)}});sizeMidPanes("center");setTimeout(function(){$.each(_c.allPanes.split(","),function(i,pane){var o=options[pane];if($Ps[pane]&&state[pane].isVisible){if(o.triggerEventsOnLoad){_execCallback(pane,o.onresize_end||o.onresize)}resizeNestedLayout(pane)}})},50);if(options.showErrorMessages&&$N.innerHeight()<2){alert(lang.errContainerHeight.replace(/CONTAINER/,sC.ref))}},addPane=function(pane,force){if(!force&&!isInitialized()){return}var o=options[pane],s=state[pane],c=_c[pane],fx=s.fx,dir=c.dir,spacing=o.spacing_open||0,isCenter=(pane=="center"),CSS={},$P=$Ps[pane],size,minSize,maxSize;if($P){removePane(pane)}else{$Cs[pane]=false}$P=$Ps[pane]=getPane(pane);if(!$P.length){$Ps[pane]=false;return}if(!$P.data("layoutCSS")){var props="position,top,left,bottom,right,width,height,overflow,zIndex,display,backgroundColor,padding,margin,border";$P.data("layoutCSS",elCSS($P,props))}$P.data("parentLayout",Instance).data("layoutRole","pane").data("layoutEdge",pane).css(c.cssReq).css("zIndex",_c.zIndex.pane_normal).css(o.applyDemoStyles?c.cssDemo:{}).addClass(o.paneClass+" "+o.paneClass+"-"+pane).bind("mouseenter."+sID,addHover).bind("mouseleave."+sID,removeHover);initContent(pane,false);if(!isCenter){size=s.size=_parseSize(pane,o.size);minSize=_parseSize(pane,o.minSize)||1;maxSize=_parseSize(pane,o.maxSize)||100000;if(size>0){size=max(min(size,maxSize),minSize)}s.isClosed=false;s.isSliding=false;s.isResizing=false;s.isHidden=false}s.tagName=$P[0].tagName;s.edge=pane;s.noRoom=false;s.isVisible=true;switch(pane){case"north":CSS.top=sC.insetTop;CSS.left=sC.insetLeft;CSS.right=sC.insetRight;break;case"south":CSS.bottom=sC.insetBottom;CSS.left=sC.insetLeft;CSS.right=sC.insetRight;break;case"west":CSS.left=sC.insetLeft;break;case"east":CSS.right=sC.insetRight;break;case"center":}if(dir=="horz"){CSS.height=max(1,cssH(pane,size))}else{if(dir=="vert"){CSS.width=max(1,cssW(pane,size))}}$P.css(CSS);if(dir!="horz"){sizeMidPanes(pane,true)}if(o.initClosed&&o.closable&&!o.initHidden){close(pane,true,true)}else{if(o.initHidden||o.initClosed){hide(pane)}else{if(!s.noRoom){$P.css("display","block")}}}$P.css("visibility","visible");if(o.showOverflowOnHover){$P.hover(allowOverflow,resetOverflow)}if(state.initialized){initHandles(pane);initHotkeys(pane);resizeAll();if(s.isVisible){if(o.triggerEventsOnLoad){_execCallback(pane,o.onresize_end||o.onresize)}resizeNestedLayout(pane)}}},initHandles=function(panes){if(!panes||panes=="all"){panes=_c.borderPanes}$.each(panes.split(","),function(i,pane){var $P=$Ps[pane];$Rs[pane]=false;$Ts[pane]=false;if(!$P){return}var o=options[pane],s=state[pane],c=_c[pane],rClass=o.resizerClass,tClass=o.togglerClass,side=c.side.toLowerCase(),spacing=(s.isVisible?o.spacing_open:o.spacing_closed),_pane="-"+pane,_state=(s.isVisible?"-open":"-closed"),$R=$Rs[pane]=$("<div></div>"),$T=(o.closable?$Ts[pane]=$("<div></div>"):false);if(!s.isVisible&&o.slidable){$R.attr("title",o.sliderTip).css("cursor",o.sliderCursor)}$R.attr("id",(o.paneSelector.substr(0,1)=="#"?o.paneSelector.substr(1)+"-resizer":"")).data("parentLayout",Instance).data("layoutRole","resizer").data("layoutEdge",pane).css(_c.resizers.cssReq).css("zIndex",_c.zIndex.resizer_normal).css(o.applyDemoStyles?_c.resizers.cssDemo:{}).addClass(rClass+" "+rClass+_pane).appendTo($N);if($T){$T.attr("id",(o.paneSelector.substr(0,1)=="#"?o.paneSelector.substr(1)+"-toggler":"")).data("parentLayout",Instance).data("layoutRole","toggler").data("layoutEdge",pane).css(_c.togglers.cssReq).css(o.applyDemoStyles?_c.togglers.cssDemo:{}).addClass(tClass+" "+tClass+_pane).appendTo($R);if(o.togglerContent_open){$("<span>"+o.togglerContent_open+"</span>").data("layoutRole","togglerContent").data("layoutEdge",pane).addClass("content content-open").css("display","none").appendTo($T)}if(o.togglerContent_closed){$("<span>"+o.togglerContent_closed+"</span>").data("layoutRole","togglerContent").data("layoutEdge",pane).addClass("content content-closed").css("display","none").appendTo($T)}enableClosable(pane)}initResizable(pane);if(s.isVisible){setAsOpen(pane)}else{setAsClosed(pane);bindStartSlidingEvent(pane,true)}});sizeHandles("all")},initContent=function(pane,resize){if(!isInitialized()){return}var o=options[pane],sel=o.contentSelector,$P=$Ps[pane],$C;if(sel){$C=$Cs[pane]=(o.findNestedContent)?$P.find(sel).eq(0):$P.children(sel).eq(0)}if($C&&$C.length){if(!$C.data("layoutCSS")){$C.data("layoutCSS",elCSS($C,"height"))}$C.css(_c.content.cssReq);if(o.applyDemoStyles){$C.css(_c.content.cssDemo);$P.css(_c.content.cssDemoPane)}state[pane].content={};if(resize!==false){sizeContent(pane)}}else{$Cs[pane]=false}},initButtons=function(){var pre="ui-layout-button-",name;$.each("toggle,open,close,pin,toggle-slide,open-slide".split(","),function(i,action){$.each(_c.borderPanes.split(","),function(ii,pane){$("."+pre+action+"-"+pane).each(function(){name=$(this).data("layoutName")||$(this).attr("layoutName");if(name==undefined||name==options.name){bindButton(this,action,pane)}})})})},initResizable=function(panes){var draggingAvailable=(typeof $.fn.draggable=="function"),$Frames,side;if(!panes||panes=="all"){panes=_c.borderPanes}$.each(panes.split(","),function(idx,pane){var o=options[pane],s=state[pane],c=_c[pane],side=(c.dir=="horz"?"top":"left"),r,live;if(!draggingAvailable||!$Ps[pane]||!o.resizable){o.resizable=false;return true}var $P=$Ps[pane],$R=$Rs[pane],base=o.resizerClass,resizerClass=base+"-drag",resizerPaneClass=base+"-"+pane+"-drag",helperClass=base+"-dragging",helperPaneClass=base+"-"+pane+"-dragging",helperLimitClass=base+"-dragging-limit",helperPaneLimitClass=base+"-"+pane+"-dragging-limit",helperClassesSet=false;if(!s.isClosed){$R.attr("title",o.resizerTip).css("cursor",o.resizerCursor)}$R.bind("mouseenter."+sID,onResizerEnter).bind("mouseleave."+sID,onResizerLeave);$R.draggable({containment:$N[0],axis:(c.dir=="horz"?"y":"x"),delay:0,distance:1,helper:"clone",opacity:o.resizerDragOpacity,addClasses:false,zIndex:_c.zIndex.resizer_drag,start:function(e,ui){o=options[pane];s=state[pane];live=o.resizeWhileDragging;if(false===_execCallback(pane,o.ondrag_start)){return false}_c.isLayoutBusy=true;s.isResizing=true;timer.clear(pane+"_closeSlider");setSizeLimits(pane);r=s.resizerPosition;$R.addClass(resizerClass+" "+resizerPaneClass);helperClassesSet=false;$Frames=$(o.maskIframesOnResize===true?"iframe":o.maskIframesOnResize).filter(":visible");var id,i=0;$Frames.each(function(){id="ui-layout-mask-"+(++i);$(this).data("layoutMaskID",id);$('<div id="'+id+'" class="ui-layout-mask ui-layout-mask-'+pane+'"/>').css({background:"#fff",opacity:"0.001",zIndex:_c.zIndex.iframe_mask,position:"absolute",width:this.offsetWidth+"px",height:this.offsetHeight+"px"}).css($(this).position()).appendTo(this.parentNode)});$("body").disableSelection()},drag:function(e,ui){if(!helperClassesSet){ui.helper.addClass(helperClass+" "+helperPaneClass).css({right:"auto",bottom:"auto"}).children().css("visibility","hidden");helperClassesSet=true;if(s.isSliding){$Ps[pane].css("zIndex",_c.zIndex.pane_sliding)}}var limit=0;if(ui.position[side]<r.min){ui.position[side]=r.min;limit=-1}else{if(ui.position[side]>r.max){ui.position[side]=r.max;limit=1}}if(limit){ui.helper.addClass(helperLimitClass+" "+helperPaneLimitClass);window.defaultStatus="Panel has reached its "+((limit>0&&pane.match(/north|west/))||(limit<0&&pane.match(/south|east/))?"maximum":"minimum")+" size"}else{ui.helper.removeClass(helperLimitClass+" "+helperPaneLimitClass);window.defaultStatus=""}if(live){resizePanes(e,ui,pane)}},stop:function(e,ui){$("body").enableSelection();window.defaultStatus="";$R.removeClass(resizerClass+" "+resizerPaneClass);s.isResizing=false;_c.isLayoutBusy=false;resizePanes(e,ui,pane,true)}});var resizePanes=function(evt,ui,pane,resizingDone){var dragPos=ui.position,c=_c[pane],resizerPos,newSize,i=0;switch(pane){case"north":resizerPos=dragPos.top;break;case"west":resizerPos=dragPos.left;break;case"south":resizerPos=sC.offsetHeight-dragPos.top-o.spacing_open;break;case"east":resizerPos=sC.offsetWidth-dragPos.left-o.spacing_open;break}if(resizingDone){$("div.ui-layout-mask").each(function(){this.parentNode.removeChild(this)});if(false===_execCallback(pane,o.ondrag_end||o.ondrag)){return false}}else{$Frames.each(function(){$("#"+$(this).data("layoutMaskID")).css($(this).position()).css({width:this.offsetWidth+"px",height:this.offsetHeight+"px"})})}newSize=resizerPos-sC["inset"+c.side];manualSizePane(pane,newSize)}})},destroy=function(){$(window).unbind("."+sID);$(document).unbind("."+sID);$.each(_c.allPanes.split(","),function(i,pane){removePane(pane,false,true)});$N.removeData("layout").removeData("layoutContainer").removeClass(options.containerClass);if(!$N.data("layoutEdge")&&$N.data("layoutCSS")){$N.css($N.data("layoutCSS")).removeData("layoutCSS")}if(sC.tagName=="BODY"&&($N=$("html")).data("layoutCSS")){$N.css($N.data("layoutCSS")).removeData("layoutCSS")}unload()},removePane=function(pane,remove,skipResize){if(!isInitialized()){return}if(!$Ps[pane]){return}var $P=$Ps[pane],$C=$Cs[pane],$R=$Rs[pane],$T=$Ts[pane],_open="-open",_sliding="-sliding",_closed="-closed",root=options[pane].paneClass,pRoot=root+"-"+pane,classes=[root,root+_open,root+_closed,root+_sliding,pRoot,pRoot+_open,pRoot+_closed,pRoot+_sliding];$.merge(classes,getHoverClasses($P,true));if(!$P||!$P.length){}else{if(remove&&!$P.data("layoutContainer")&&(!$C||!$C.length||!$C.data("layoutContainer"))){$P.remove()}else{$P.removeClass(classes.join(" ")).removeData("layoutParent").removeData("layoutRole").removeData("layoutEdge").removeData("autoHidden").unbind("."+sID);if(!$P.data("layoutContainer")){$P.css($P.data("layoutCSS")).removeData("layoutCSS")}if($C&&$C.length&&!$C.data("layoutContainer")){$C.css($C.data("layoutCSS")).removeData("layoutCSS")}}}if($T&&$T.length){$T.remove()}if($R&&$R.length){$R.remove()}$Ps[pane]=$Cs[pane]=$Rs[pane]=$Ts[pane]=false;if(!skipResize){resizeAll();state[pane]={}}},hide=function(pane,noAnimation){if(!isInitialized()){return}var o=options[pane],s=state[pane],$P=$Ps[pane],$R=$Rs[pane];if(!$P||s.isHidden){return}if(state.initialized&&false===_execCallback(pane,o.onhide_start)){return}s.isSliding=false;if($R){$R.hide()}if(!state.initialized||s.isClosed){s.isClosed=true;s.isHidden=true;s.isVisible=false;$P.hide();sizeMidPanes(_c[pane].dir=="horz"?"all":"center");if(state.initialized||o.triggerEventsOnLoad){_execCallback(pane,o.onhide_end||o.onhide)}}else{s.isHiding=true;close(pane,false,noAnimation)}},show=function(pane,openPane,noAnimation,noAlert){if(!isInitialized()){return}var o=options[pane],s=state[pane],$P=$Ps[pane],$R=$Rs[pane];if(!$P||!s.isHidden){return}if(false===_execCallback(pane,o.onshow_start)){return}s.isSliding=false;s.isShowing=true;if(openPane===false){close(pane,true)}else{open(pane,false,noAnimation,noAlert)}},toggle=function(pane,slide){if(!isInitialized()){return}if(!isStr(pane)){pane.stopImmediatePropagation();pane=$(this).data("layoutEdge")}var s=state[str(pane)];if(s.isHidden){show(pane)}else{if(s.isClosed){open(pane,!!slide)}else{close(pane)}}},_closePane=function(pane,setHandles){var $P=$Ps[pane],s=state[pane];$P.hide();s.isClosed=true;s.isVisible=false},close=function(pane,force,noAnimation,skipCallback){if(!state.initialized&&$Ps[pane]){_closePane(pane);return}if(!isInitialized()){return}var $P=$Ps[pane],$R=$Rs[pane],$T=$Ts[pane],o=options[pane],s=state[pane],doFX=!noAnimation&&!s.isClosed&&(o.fxName_close!="none"),isShowing=s.isShowing,isHiding=s.isHiding,wasSliding=s.isSliding;delete s.isShowing;delete s.isHiding;if(!$P||(!o.closable&&!isShowing&&!isHiding)){return}else{if(!force&&s.isClosed&&!isShowing){return}}if(_c.isLayoutBusy){_queue("close",pane,force);return}if(!isShowing&&false===_execCallback(pane,o.onclose_start)){return}_c[pane].isMoving=true;_c.isLayoutBusy=true;s.isClosed=true;s.isVisible=false;if(isHiding){s.isHidden=true}else{if(isShowing){s.isHidden=false}}if(s.isSliding){bindStopSlidingEvents(pane,false)}else{sizeMidPanes(_c[pane].dir=="horz"?"all":"center",false)}setAsClosed(pane);if(doFX){lockPaneForFX(pane,true);$P.hide(o.fxName_close,o.fxSettings_close,o.fxSpeed_close,function(){lockPaneForFX(pane,false);close_2()})}else{$P.hide();close_2()}function close_2(){if(s.isClosed){bindStartSlidingEvent(pane,true);var altPane=_c.altSide[pane];if(state[altPane].noRoom){setSizeLimits(altPane);makePaneFit(altPane)}if(!skipCallback&&(state.initialized||o.triggerEventsOnLoad)){if(!isShowing){_execCallback(pane,o.onclose_end||o.onclose)}if(isShowing){_execCallback(pane,o.onshow_end||o.onshow)}if(isHiding){_execCallback(pane,o.onhide_end||o.onhide)}}}_dequeue(pane)}},setAsClosed=function(pane){var $P=$Ps[pane],$R=$Rs[pane],$T=$Ts[pane],o=options[pane],s=state[pane],side=_c[pane].side.toLowerCase(),inset="inset"+_c[pane].side,rClass=o.resizerClass,tClass=o.togglerClass,_pane="-"+pane,_open="-open",_sliding="-sliding",_closed="-closed";$R.css(side,sC[inset]).removeClass(rClass+_open+" "+rClass+_pane+_open).removeClass(rClass+_sliding+" "+rClass+_pane+_sliding).addClass(rClass+_closed+" "+rClass+_pane+_closed).unbind("dblclick."+sID);if(o.resizable&&typeof $.fn.draggable=="function"){$R.draggable("disable").removeClass("ui-state-disabled").css("cursor","default").attr("title","")}if($T){$T.removeClass(tClass+_open+" "+tClass+_pane+_open).addClass(tClass+_closed+" "+tClass+_pane+_closed).attr("title",o.togglerTip_closed);$T.children(".content-open").hide();$T.children(".content-closed").css("display","block")}syncPinBtns(pane,false);if(state.initialized){sizeHandles("all")}},open=function(pane,slide,noAnimation,noAlert){if(!isInitialized()){return}var $P=$Ps[pane],$R=$Rs[pane],$T=$Ts[pane],o=options[pane],s=state[pane],doFX=!noAnimation&&s.isClosed&&(o.fxName_open!="none"),isShowing=s.isShowing;delete s.isShowing;if(!$P||(!o.resizable&&!o.closable&&!isShowing)){return}else{if(s.isVisible&&!s.isSliding){return}}if(s.isHidden&&!isShowing){show(pane,true);return}if(_c.isLayoutBusy){_queue("open",pane,slide);return}setSizeLimits(pane,slide);if(false===_execCallback(pane,o.onopen_start)){return}setSizeLimits(pane,slide);if(s.minSize>s.maxSize){syncPinBtns(pane,false);if(!noAlert&&o.noRoomToOpenTip){alert(o.noRoomToOpenTip)}return}_c[pane].isMoving=true;_c.isLayoutBusy=true;if(slide){bindStopSlidingEvents(pane,true)}else{if(s.isSliding){bindStopSlidingEvents(pane,false)}else{if(o.slidable){bindStartSlidingEvent(pane,false)}}}s.noRoom=false;makePaneFit(pane);s.isVisible=true;s.isClosed=false;if(isShowing){s.isHidden=false}if(doFX){lockPaneForFX(pane,true);$P.show(o.fxName_open,o.fxSettings_open,o.fxSpeed_open,function(){lockPaneForFX(pane,false);open_2()})}else{$P.show();open_2()}function open_2(){if(s.isVisible){_fixIframe(pane);if(!s.isSliding){sizeMidPanes(_c[pane].dir=="vert"?"center":"all",false)}setAsOpen(pane)}_dequeue(pane)}},setAsOpen=function(pane,skipCallback){var $P=$Ps[pane],$R=$Rs[pane],$T=$Ts[pane],o=options[pane],s=state[pane],side=_c[pane].side.toLowerCase(),inset="inset"+_c[pane].side,rClass=o.resizerClass,tClass=o.togglerClass,_pane="-"+pane,_open="-open",_closed="-closed",_sliding="-sliding";$R.css(side,sC[inset]+getPaneSize(pane)).removeClass(rClass+_closed+" "+rClass+_pane+_closed).addClass(rClass+_open+" "+rClass+_pane+_open);if(s.isSliding){$R.addClass(rClass+_sliding+" "+rClass+_pane+_sliding)}else{$R.removeClass(rClass+_sliding+" "+rClass+_pane+_sliding)}if(o.resizerDblClickToggle){$R.bind("dblclick",toggle)}removeHover(0,$R);if(o.resizable&&typeof $.fn.draggable=="function"){$R.draggable("enable").css("cursor",o.resizerCursor).attr("title",o.resizerTip)}else{if(!s.isSliding){$R.css("cursor","default")}}if($T){$T.removeClass(tClass+_closed+" "+tClass+_pane+_closed).addClass(tClass+_open+" "+tClass+_pane+_open).attr("title",o.togglerTip_open);removeHover(0,$T);$T.children(".content-closed").hide();$T.children(".content-open").css("display","block")}syncPinBtns(pane,!s.isSliding);$.extend(s,elDims($P));if(state.initialized){sizeHandles("all");sizeContent(pane,true)}if(!skipCallback&&(state.initialized||o.triggerEventsOnLoad)&&$P.is(":visible")){_execCallback(pane,o.onopen_end||o.onopen);if(s.isShowing){_execCallback(pane,o.onshow_end||o.onshow)}if(state.initialized){_execCallback(pane,o.onresize_end||o.onresize);resizeNestedLayout(pane)}}},slideOpen=function(evt_or_pane){if(!isInitialized()){return}var evt=isStr(evt_or_pane)?null:evt_or_pane,pane=evt?$(this).data("layoutEdge"):evt_or_pane,s=state[pane],delay=options[pane].slideDelay_open;if(evt){evt.stopImmediatePropagation()}if(s.isClosed&&evt&&evt.type=="mouseenter"&&delay>0){timer.set(pane+"_openSlider",open_NOW,delay)}else{open_NOW()}function open_NOW(evt){if(!s.isClosed){bindStopSlidingEvents(pane,true)}else{if(!_c[pane].isMoving){open(pane,true)}}}},slideClose=function(evt_or_pane){if(!isInitialized()){return}var evt=isStr(evt_or_pane)?null:evt_or_pane,pane=evt?$(this).data("layoutEdge"):evt_or_pane,o=options[pane],s=state[pane],delay=_c[pane].isMoving?1000:300;if(s.isClosed||s.isResizing){return}else{if(o.slideTrigger_close=="click"){close_NOW()}else{if(o.preventQuickSlideClose&&_c.isLayoutBusy){return}else{if(o.preventPrematureSlideClose&&evt&&$.layout.isMouseOverElem(evt,$Ps[pane])){return}else{if(evt){timer.set(pane+"_closeSlider",close_NOW,max(o.slideDelay_close,delay))}else{close_NOW()}}}}}function close_NOW(){if(s.isClosed){bindStopSlidingEvents(pane,false)}else{if(!_c[pane].isMoving){close(pane)}}}},slideToggle=function(pane){toggle(pane,true)},lockPaneForFX=function(pane,doLock){var $P=$Ps[pane];if(doLock){$P.css({zIndex:_c.zIndex.pane_animate});if(pane=="south"){$P.css({top:sC.insetTop+sC.innerHeight-$P.outerHeight()})}else{if(pane=="east"){$P.css({left:sC.insetLeft+sC.innerWidth-$P.outerWidth()})}}}else{$P.css({zIndex:(state[pane].isSliding?_c.zIndex.pane_sliding:_c.zIndex.pane_normal)});if(pane=="south"){$P.css({top:"auto"})}else{if(pane=="east"){$P.css({left:"auto"})}}var o=options[pane];if($.layout.browser.msie&&o.fxOpacityFix&&o.fxName_open!="slide"&&$P.css("filter")&&$P.css("opacity")==1){$P[0].style.removeAttribute("filter")}}},bindStartSlidingEvent=function(pane,enable){var o=options[pane],$P=$Ps[pane],$R=$Rs[pane],trigger=o.slideTrigger_open.toLowerCase();if(!$R||(enable&&!o.slidable)){return}if(trigger.match(/mouseover/)){trigger=o.slideTrigger_open="mouseenter"}else{if(!trigger.match(/click|dblclick|mouseenter/)){trigger=o.slideTrigger_open="click"}}$R[enable?"bind":"unbind"](trigger+"."+sID,slideOpen).css("cursor",enable?o.sliderCursor:"default").attr("title",enable?o.sliderTip:"")},bindStopSlidingEvents=function(pane,enable){var o=options[pane],s=state[pane],z=_c.zIndex,trigger=o.slideTrigger_close.toLowerCase(),action=(enable?"bind":"unbind"),$P=$Ps[pane],$R=$Rs[pane];s.isSliding=enable;timer.clear(pane+"_closeSlider");if(enable){bindStartSlidingEvent(pane,false)}$P.css("zIndex",enable?z.pane_sliding:z.pane_normal);$R.css("zIndex",enable?z.pane_sliding:z.resizer_normal);if(!trigger.match(/click|mouseleave/)){trigger=o.slideTrigger_close="mouseleave"}$R[action](trigger,slideClose);if(trigger=="mouseleave"){$P[action]("mouseleave."+sID,slideClose);$R[action]("mouseenter."+sID,cancelMouseOut);$P[action]("mouseenter."+sID,cancelMouseOut)}if(!enable){timer.clear(pane+"_closeSlider")}else{if(trigger=="click"&&!o.resizable){$R.css("cursor",enable?o.sliderCursor:"default");$R.attr("title",enable?o.togglerTip_open:"")}}function cancelMouseOut(evt){timer.clear(pane+"_closeSlider");evt.stopPropagation()}},makePaneFit=function(pane,isOpening,skipCallback,force){var o=options[pane],s=state[pane],c=_c[pane],$P=$Ps[pane],$R=$Rs[pane],isSidePane=c.dir=="vert",hasRoom=false;if(pane=="center"||(isSidePane&&s.noVerticalRoom)){hasRoom=(s.maxHeight>0);if(hasRoom&&s.noRoom){$P.show();if($R){$R.show()}s.isVisible=true;s.noRoom=false;if(isSidePane){s.noVerticalRoom=false}_fixIframe(pane)}else{if(!hasRoom&&!s.noRoom){$P.hide();if($R){$R.hide()}s.isVisible=false;s.noRoom=true}}}if(pane=="center"){}else{if(s.minSize<=s.maxSize){hasRoom=true;if(s.size>s.maxSize){sizePane(pane,s.maxSize,skipCallback,force)}else{if(s.size<s.minSize){sizePane(pane,s.minSize,skipCallback,force)}else{if($R&&$P.is(":visible")){var side=c.side.toLowerCase(),pos=s.size+sC["inset"+c.side];if($.layout.cssNum($R,side)!=pos){$R.css(side,pos)}}}}if(s.noRoom){if(s.wasOpen&&o.closable){if(o.autoReopen){open(pane,false,true,true)}else{s.noRoom=false}}else{show(pane,s.wasOpen,true,true)}}}else{if(!s.noRoom){s.noRoom=true;s.wasOpen=!s.isClosed&&!s.isSliding;if(s.isClosed){}else{if(o.closable){close(pane,true,true)}else{hide(pane,true)}}}}}},manualSizePane=function(pane,size,skipCallback){if(!isInitialized()){return}var o=options[pane],forceResize=o.resizeWhileDragging&&!_c.isLayoutBusy;o.autoResize=false;sizePane(pane,size,skipCallback,forceResize)},sizePane=function(pane,size,skipCallback,force){if(!isInitialized()){return}var o=options[pane],s=state[pane],$P=$Ps[pane],$R=$Rs[pane],side=_c[pane].side.toLowerCase(),dimName=_c[pane].sizeType.toLowerCase(),inset="inset"+_c[pane].side,skipResizeWhileDragging=_c.isLayoutBusy&&!o.triggerEventsWhileDragging,oldSize;setSizeLimits(pane);oldSize=s.size;size=_parseSize(pane,size);size=max(size,_parseSize(pane,o.minSize));size=min(size,s.maxSize);if(size<s.minSize){makePaneFit(pane,false,skipCallback);return}if(!force&&size==oldSize){return}if(!skipCallback&&state.initialized&&s.isVisible){_execCallback(pane,o.onresize_start)}$P.css(dimName,max(1,cssSize(pane,size)));s.size=size;$.extend(s,elDims($P));if($R&&$P.is(":visible")){$R.css(side,size+sC[inset])}sizeContent(pane);if(!skipCallback&&!skipResizeWhileDragging&&state.initialized&&s.isVisible){_execCallback(pane,o.onresize_end||o.onresize);resizeNestedLayout(pane)}if(!skipCallback){if(!s.isSliding){sizeMidPanes(_c[pane].dir=="horz"?"all":"center",skipResizeWhileDragging,force)}sizeHandles("all")}var altPane=_c.altSide[pane];if(size<oldSize&&state[altPane].noRoom){setSizeLimits(altPane);makePaneFit(altPane,false,skipCallback)}},sizeMidPanes=function(panes,skipCallback,force){if(!panes||panes=="all"){panes="east,west,center"}$.each(panes.split(","),function(i,pane){if(!$Ps[pane]){return}var o=options[pane],s=state[pane],$P=$Ps[pane],$R=$Rs[pane],isCenter=(pane=="center"),hasRoom=true,CSS={},newCenter=calcNewCenterPaneDims();$.extend(s,elDims($P));if(pane=="center"){if(!force&&s.isVisible&&newCenter.width==s.outerWidth&&newCenter.height==s.outerHeight){return true}$.extend(s,cssMinDims(pane),{maxWidth:newCenter.width,maxHeight:newCenter.height});CSS=newCenter;CSS.width=cssW(pane,CSS.width);CSS.height=cssH(pane,CSS.height);hasRoom=CSS.width>0&&CSS.height>0;if(!hasRoom&&!state.initialized&&o.minWidth>0){var reqPx=o.minWidth-s.outerWidth,minE=options.east.minSize||0,minW=options.west.minSize||0,sizeE=state.east.size,sizeW=state.west.size,newE=sizeE,newW=sizeW;if(reqPx>0&&state.east.isVisible&&sizeE>minE){newE=max(sizeE-minE,sizeE-reqPx);reqPx-=sizeE-newE}if(reqPx>0&&state.west.isVisible&&sizeW>minW){newW=max(sizeW-minW,sizeW-reqPx);reqPx-=sizeW-newW}if(reqPx==0){if(sizeE!=minE){sizePane("east",newE,true)}if(sizeW!=minW){sizePane("west",newW,true)}sizeMidPanes("center",skipCallback,force);return}}}else{if(s.isVisible&&!s.noVerticalRoom){$.extend(s,elDims($P),cssMinDims(pane))}if(!force&&!s.noVerticalRoom&&newCenter.height==s.outerHeight){return true}CSS.top=newCenter.top;CSS.bottom=newCenter.bottom;CSS.height=cssH(pane,newCenter.height);s.maxHeight=max(0,CSS.height);hasRoom=(s.maxHeight>0);if(!hasRoom){s.noVerticalRoom=true}}if(hasRoom){if(!skipCallback&&state.initialized){_execCallback(pane,o.onresize_start)}$P.css(CSS);if(s.noRoom&&!s.isClosed&&!s.isHidden){makePaneFit(pane)}if(s.isVisible){$.extend(s,elDims($P));if(state.initialized){sizeContent(pane)}}}else{if(!s.noRoom&&s.isVisible){makePaneFit(pane)}}if(!s.isVisible){return true}if(pane=="center"){var b=$.layout.browser;var fix=b.isIE6||(b.msie&&!b.boxModel);if($Ps.north&&(fix||state.north.tagName=="IFRAME")){$Ps.north.css("width",cssW($Ps.north,sC.innerWidth))}if($Ps.south&&(fix||state.south.tagName=="IFRAME")){$Ps.south.css("width",cssW($Ps.south,sC.innerWidth))}}if(!skipCallback&&state.initialized){_execCallback(pane,o.onresize_end||o.onresize);resizeNestedLayout(pane)}})},resizeAll=function(){if(!state.initialized){_initLayoutElements();return}var oldW=sC.innerWidth,oldH=sC.innerHeight;if(!$N.is(":visible:")){return}$.extend(state.container,elDims($N));if(!sC.outerHeight){return}if(false===_execCallback(null,options.onresizeall_start)){return false}var shrunkH=(sC.innerHeight<oldH),shrunkW=(sC.innerWidth<oldW),$P,o,s,dir;$.each(["south","north","east","west"],function(i,pane){if(!$Ps[pane]){return}s=state[pane];o=options[pane];dir=_c[pane].dir;if(o.autoResize&&s.size!=o.size){sizePane(pane,o.size,true,true)}else{setSizeLimits(pane);makePaneFit(pane,false,true,true)}});sizeMidPanes("all",true,true);sizeHandles("all");o=options;$.each(_c.allPanes.split(","),function(i,pane){$P=$Ps[pane];if(!$P){return}if(state[pane].isVisible){_execCallback(pane,o[pane].onresize_end||o[pane].onresize);resizeNestedLayout(pane)}});_execCallback(null,o.onresizeall_end||o.onresizeall)},resizeNestedLayout=function(pane){var $P=$Ps[pane],$C=$Cs[pane],d="layoutContainer";if(options[pane].resizeNestedLayout){if($P.data(d)){$P.layout().resizeAll()}else{if($C&&$C.data(d)){$C.layout().resizeAll()}}}},sizeContent=function(panes,remeasure){if(!isInitialized()){return}if(!panes||panes=="all"){panes=_c.allPanes}$.each(panes.split(","),function(idx,pane){var $P=$Ps[pane],$C=$Cs[pane],o=options[pane],s=state[pane],m=s.content;if(!$P||!$C||!$P.is(":visible")){return true}if(false===_execCallback(null,o.onsizecontent_start)){return}if(!_c.isLayoutBusy||m.top==undefined||remeasure||o.resizeContentWhileDragging){_measure();if(m.hiddenFooters>0&&$P.css("overflow")=="hidden"){$P.css("overflow","visible");_measure();$P.css("overflow","hidden")}}var newH=s.innerHeight-(m.spaceAbove-s.css.paddingTop)-(m.spaceBelow-s.css.paddingBottom);if(!$C.is(":visible")||m.height!=newH){setOuterHeight($C,newH,true);m.height=newH}if(state.initialized){_execCallback(pane,o.onsizecontent_end||o.onsizecontent);resizeNestedLayout(pane)}function _below($E){return max(s.css.paddingBottom,(parseInt($E.css("marginBottom"),10)||0))}function _measure(){var ignore=options[pane].contentIgnoreSelector,$Fs=$C.nextAll().not(ignore||":lt(0)"),$Fs_vis=$Fs.filter(":visible"),$F=$Fs_vis.filter(":last");m={top:$C[0].offsetTop,height:$C.outerHeight(),numFooters:$Fs.length,hiddenFooters:$Fs.length-$Fs_vis.length,spaceBelow:0};m.spaceAbove=m.top;m.bottom=m.top+m.height;if($F.length){m.spaceBelow=($F[0].offsetTop+$F.outerHeight())-m.bottom+_below($F)}else{m.spaceBelow=_below($C)}}})},sizeHandles=function(panes){if(!panes||panes=="all"){panes=_c.borderPanes}$.each(panes.split(","),function(i,pane){var o=options[pane],s=state[pane],$P=$Ps[pane],$R=$Rs[pane],$T=$Ts[pane],$TC;if(!$P||!$R){return}var dir=_c[pane].dir,_state=(s.isClosed?"_closed":"_open"),spacing=o["spacing"+_state],togAlign=o["togglerAlign"+_state],togLen=o["togglerLength"+_state],paneLen,offset,CSS={};if(spacing==0){$R.hide();return}else{if(!s.noRoom&&!s.isHidden){$R.show()}}if(dir=="horz"){paneLen=$P.outerWidth();s.resizerLength=paneLen;$R.css({width:max(1,cssW($R,paneLen)),height:max(0,cssH($R,spacing)),left:$.layout.cssNum($P,"left")})}else{paneLen=$P.outerHeight();s.resizerLength=paneLen;$R.css({height:max(1,cssH($R,paneLen)),width:max(0,cssW($R,spacing)),top:sC.insetTop+getPaneSize("north",true)})}removeHover(o,$R);if($T){if(togLen==0||(s.isSliding&&o.hideTogglerOnSlide)){$T.hide();return}else{$T.show()}if(!(togLen>0)||togLen=="100%"||togLen>paneLen){togLen=paneLen;offset=0}else{if(isStr(togAlign)){switch(togAlign){case"top":case"left":offset=0;break;case"bottom":case"right":offset=paneLen-togLen;break;case"middle":case"center":default:offset=Math.floor((paneLen-togLen)/2)}}else{var x=parseInt(togAlign,10);if(togAlign>=0){offset=x}else{offset=paneLen-togLen+x}}}if(dir=="horz"){var width=cssW($T,togLen);$T.css({width:max(0,width),height:max(1,cssH($T,spacing)),left:offset,top:0});$T.children(".content").each(function(){$TC=$(this);$TC.css("marginLeft",Math.floor((width-$TC.outerWidth())/2))})}else{var height=cssH($T,togLen);$T.css({height:max(0,height),width:max(1,cssW($T,spacing)),top:offset,left:0});$T.children(".content").each(function(){$TC=$(this);$TC.css("marginTop",Math.floor((height-$TC.outerHeight())/2))})}removeHover(0,$T)}if(!state.initialized&&(o.initHidden||s.noRoom)){$R.hide();if($T){$T.hide()}}})},enableClosable=function(pane){if(!isInitialized()){return}var $T=$Ts[pane],o=options[pane];if(!$T){return}o.closable=true;$T.bind("click."+sID,function(evt){evt.stopPropagation();toggle(pane)}).bind("mouseenter."+sID,addHover).bind("mouseleave."+sID,removeHover).css("visibility","visible").css("cursor","pointer").attr("title",state[pane].isClosed?o.togglerTip_closed:o.togglerTip_open).show()},disableClosable=function(pane,hide){if(!isInitialized()){return}var $T=$Ts[pane];if(!$T){return}options[pane].closable=false;if(state[pane].isClosed){open(pane,false,true)}$T.unbind("."+sID).css("visibility",hide?"hidden":"visible").css("cursor","default").attr("title","")},enableSlidable=function(pane){if(!isInitialized()){return}var $R=$Rs[pane],o=options[pane];if(!$R||!$R.data("draggable")){return}options[pane].slidable=true;if(s.isClosed){bindStartSlidingEvent(pane,true)}},disableSlidable=function(pane){if(!isInitialized()){return}var $R=$Rs[pane];if(!$R){return}options[pane].slidable=false;if(state[pane].isSliding){close(pane,false,true)}else{bindStartSlidingEvent(pane,false);$R.css("cursor","default").attr("title","");removeHover(null,$R[0])}},enableResizable=function(pane){if(!isInitialized()){return}var $R=$Rs[pane],o=options[pane];if(!$R||!$R.data("draggable")){return}o.resizable=true;$R.draggable("enable").bind("mouseenter."+sID,onResizerEnter).bind("mouseleave."+sID,onResizerLeave);if(!state[pane].isClosed){$R.css("cursor",o.resizerCursor).attr("title",o.resizerTip)}},disableResizable=function(pane){if(!isInitialized()){return}var $R=$Rs[pane];if(!$R||!$R.data("draggable")){return}options[pane].resizable=false;$R.draggable("disable").unbind("."+sID).css("cursor","default").attr("title","");removeHover(null,$R[0])},swapPanes=function(pane1,pane2){if(!isInitialized()){return}state[pane1].edge=pane2;state[pane2].edge=pane1;var cancelled=false;if(false===_execCallback(pane1,options[pane1].onswap_start)){cancelled=true}if(!cancelled&&false===_execCallback(pane2,options[pane2].onswap_start)){cancelled=true}if(cancelled){state[pane1].edge=pane1;state[pane2].edge=pane2;return}var oPane1=copy(pane1),oPane2=copy(pane2),sizes={};sizes[pane1]=oPane1?oPane1.state.size:0;sizes[pane2]=oPane2?oPane2.state.size:0;$Ps[pane1]=false;$Ps[pane2]=false;state[pane1]={};state[pane2]={};if($Ts[pane1]){$Ts[pane1].remove()}if($Ts[pane2]){$Ts[pane2].remove()}if($Rs[pane1]){$Rs[pane1].remove()}if($Rs[pane2]){$Rs[pane2].remove()}$Rs[pane1]=$Rs[pane2]=$Ts[pane1]=$Ts[pane2]=false;move(oPane1,pane2);move(oPane2,pane1);oPane1=oPane2=sizes=null;if($Ps[pane1]){$Ps[pane1].css(_c.visible)}if($Ps[pane2]){$Ps[pane2].css(_c.visible)}resizeAll();_execCallback(pane1,options[pane1].onswap_end||options[pane1].onswap);_execCallback(pane2,options[pane2].onswap_end||options[pane2].onswap);return;function copy(n){var $P=$Ps[n],$C=$Cs[n];return !$P?false:{pane:n,P:$P?$P[0]:false,C:$C?$C[0]:false,state:$.extend({},state[n]),options:$.extend({},options[n])}}function move(oPane,pane){if(!oPane){return}var P=oPane.P,C=oPane.C,oldPane=oPane.pane,c=_c[pane],side=c.side.toLowerCase(),inset="inset"+c.side,s=$.extend({},state[pane]),o=options[pane],fx={resizerCursor:o.resizerCursor},re,size,pos;$.each("fxName,fxSpeed,fxSettings".split(","),function(i,k){fx[k]=o[k];fx[k+"_open"]=o[k+"_open"];fx[k+"_close"]=o[k+"_close"]});$Ps[pane]=$(P).data("layoutEdge",pane).css(_c.hidden).css(c.cssReq);$Cs[pane]=C?$(C):false;options[pane]=$.extend({},oPane.options,fx);state[pane]=$.extend({},oPane.state);re=new RegExp(o.paneClass+"-"+oldPane,"g");P.className=P.className.replace(re,o.paneClass+"-"+pane);initHandles(pane);if(c.dir!=_c[oldPane].dir){size=sizes[pane]||0;setSizeLimits(pane);size=max(size,state[pane].minSize);manualSizePane(pane,size,true)}else{$Rs[pane].css(side,sC[inset]+(state[pane].isVisible?getPaneSize(pane):0))}if(oPane.state.isVisible&&!s.isVisible){setAsOpen(pane,true)}else{setAsClosed(pane);bindStartSlidingEvent(pane,true)}oPane=null}};function keyDown(evt){if(!evt){return true}var code=evt.keyCode;if(code<33){return true}var PANE={38:"north",40:"south",37:"west",39:"east"},ALT=evt.altKey,SHIFT=evt.shiftKey,CTRL=evt.ctrlKey,CURSOR=(CTRL&&code>=37&&code<=40),o,k,m,pane;if(CURSOR&&options[PANE[code]].enableCursorHotkey){pane=PANE[code]}else{if(CTRL||SHIFT){$.each(_c.borderPanes.split(","),function(i,p){o=options[p];k=o.customHotkey;m=o.customHotkeyModifier;if((SHIFT&&m=="SHIFT")||(CTRL&&m=="CTRL")||(CTRL&&SHIFT)){if(k&&code==(isNaN(k)||k<=9?k.toUpperCase().charCodeAt(0):k)){pane=p;return false}}})}}if(!pane||!$Ps[pane]||!options[pane].closable||state[pane].isHidden){return true}toggle(pane);evt.stopPropagation();evt.returnValue=false;return false}function allowOverflow(el){if(!isInitialized()){return}if(this&&this.tagName){el=this}var $P;if(isStr(el)){$P=$Ps[el]}else{if($(el).data("layoutRole")){$P=$(el)}else{$(el).parents().each(function(){if($(this).data("layoutRole")){$P=$(this);return false}})}}if(!$P||!$P.length){return}var pane=$P.data("layoutEdge"),s=state[pane];if(s.cssSaved){resetOverflow(pane)}if(s.isSliding||s.isResizing||s.isClosed){s.cssSaved=false;return}var newCSS={zIndex:(_c.zIndex.pane_normal+2)},curCSS={},of=$P.css("overflow"),ofX=$P.css("overflowX"),ofY=$P.css("overflowY");if(of!="visible"){curCSS.overflow=of;newCSS.overflow="visible"}if(ofX&&!ofX.match(/visible|auto/)){curCSS.overflowX=ofX;newCSS.overflowX="visible"}if(ofY&&!ofY.match(/visible|auto/)){curCSS.overflowY=ofX;newCSS.overflowY="visible"}s.cssSaved=curCSS;$P.css(newCSS);$.each(_c.allPanes.split(","),function(i,p){if(p!=pane){resetOverflow(p)}})}function resetOverflow(el){if(!isInitialized()){return}if(this&&this.tagName){el=this}var $P;if(isStr(el)){$P=$Ps[el]}else{if($(el).data("layoutRole")){$P=$(el)}else{$(el).parents().each(function(){if($(this).data("layoutRole")){$P=$(this);return false}})}}if(!$P||!$P.length){return}var pane=$P.data("layoutEdge"),s=state[pane],CSS=s.cssSaved||{};if(!s.isSliding&&!s.isResizing){$P.css("zIndex",_c.zIndex.pane_normal)}$P.css(CSS);s.cssSaved=false}function getBtn(selector,pane,action){var $E=$(selector),err=options.showErrorMessages;if(!$E.length){if(err){alert(lang.errButton+lang.selector+": "+selector)}}else{if(_c.borderPanes.indexOf(pane)==-1){if(err){alert(lang.errButton+lang.pane+": "+pane)}}else{var btn=options[pane].buttonClass+"-"+action;$E.addClass(btn+" "+btn+"-"+pane).data("layoutName",options.name);return $E}}return null}function bindButton(selector,action,pane){switch(action.toLowerCase()){case"toggle":addToggleBtn(selector,pane);break;case"open":addOpenBtn(selector,pane);break;case"close":addCloseBtn(selector,pane);break;case"pin":addPinBtn(selector,pane);break;case"toggle-slide":addToggleBtn(selector,pane,true);break;case"open-slide":addOpenBtn(selector,pane,true);break}}function addToggleBtn(selector,pane,slide){var $E=getBtn(selector,pane,"toggle");if($E){$E.click(function(evt){toggle(pane,!!slide);evt.stopPropagation()})}}function addOpenBtn(selector,pane,slide){var $E=getBtn(selector,pane,"open");if($E){$E.attr("title",lang.Open).click(function(evt){open(pane,!!slide);evt.stopPropagation()})}}function addCloseBtn(selector,pane){var $E=getBtn(selector,pane,"close");if($E){$E.attr("title",lang.Close).click(function(evt){close(pane);evt.stopPropagation()})}}function addPinBtn(selector,pane){var $E=getBtn(selector,pane,"pin");if($E){var s=state[pane];$E.click(function(evt){setPinState($(this),pane,(s.isSliding||s.isClosed));if(s.isSliding||s.isClosed){open(pane)}else{close(pane)}evt.stopPropagation()});setPinState($E,pane,(!s.isClosed&&!s.isSliding));_c[pane].pins.push(selector)}}function syncPinBtns(pane,doPin){$.each(_c[pane].pins,function(i,selector){setPinState($(selector),pane,doPin)})}function setPinState($Pin,pane,doPin){var updown=$Pin.attr("pin");if(updown&&doPin==(updown=="down")){return}var pin=options[pane].buttonClass+"-pin",side=pin+"-"+pane,UP=pin+"-up "+side+"-up",DN=pin+"-down "+side+"-down";$Pin.attr("pin",doPin?"down":"up").attr("title",doPin?lang.Unpin:lang.Pin).removeClass(doPin?UP:DN).addClass(doPin?DN:UP)}function isCookiesEnabled(){return(navigator.cookieEnabled!=0)}function getCookie(opts){var o=$.extend({},options.cookie,opts||{}),name=o.name||options.name||"Layout",c=document.cookie,cs=c?c.split(";"):[],pair;for(var i=0,n=cs.length;i<n;i++){pair=$.trim(cs[i]).split("=");if(pair[0]==name){return decodeJSON(decodeURIComponent(pair[1]))}}return""}function saveCookie(keys,opts){var o=$.extend({},options.cookie,opts||{}),name=o.name||options.name||"Layout",params="",date="",clear=false;if(o.expires.toUTCString){date=o.expires}else{if(typeof o.expires=="number"){date=new Date();if(o.expires>0){date.setDate(date.getDate()+o.expires)}else{date.setYear(1970);clear=true}}}if(date){params+=";expires="+date.toUTCString()}if(o.path){params+=";path="+o.path}if(o.domain){params+=";domain="+o.domain}if(o.secure){params+=";secure"}if(clear){state.cookie={};document.cookie=name+"="+params}else{state.cookie=getState(keys||o.keys);document.cookie=name+"="+encodeURIComponent(encodeJSON(state.cookie))+params}return $.extend({},state.cookie)}function deleteCookie(){saveCookie("",{expires:-1})}function loadCookie(opts){var o=getCookie(opts);if(o){state.cookie=$.extend({},o);loadState(o)}return o}function loadState(opts,animate){opts=_transformData(opts);$.extend(true,options,opts);if(state.initialized){var pane,o,s,h,c,a=!animate;$.each(_c.allPanes.split(","),function(idx,pane){o=opts[pane];if(typeof o!="object"){return}s=o.size;c=o.initClosed;h=o.initHidden;if(s>0||s=="auto"){sizePane(pane,s)}if(h===true){hide(pane,a)}else{if(c===false){open(pane,false,a)}else{if(c===true){close(pane,false,a)}else{if(h===false){show(pane,false,a)}}}}})}}function getState(keys){var data={},alt={isClosed:"initClosed",isHidden:"initHidden"},pair,pane,key,val;if(!keys){keys=options.cookie.keys}if($.isArray(keys)){keys=keys.join(",")}keys=keys.replace(/__/g,".").split(",");for(var i=0,n=keys.length;i<n;i++){pair=keys[i].split(".");pane=pair[0];key=pair[1];if(_c.allPanes.indexOf(pane)<0){continue}val=state[pane][key];if(val==undefined){continue}if(key=="isClosed"&&state[pane]["isSliding"]){val=true}(data[pane]||(data[pane]={}))[alt[key]?alt[key]:key]=val}return data}function encodeJSON(JSON){return parse(JSON);function parse(h){var D=[],i=0,k,v,t;for(k in h){v=h[k];t=typeof v;if(t=="string"){v='"'+v+'"'}else{if(t=="object"){v=parse(v)}}D[i++]='"'+k+'":'+v}return"{"+D.join(",")+"}"}}function decodeJSON(str){try{return window["eval"]("("+str+")")||{}}catch(e){return{}}}var $N=$(this).eq(0);if(!$N.length){if(options.showErrorMessages){alert(lang.errContainerMissing)}return null}if($N.data("layoutContainer")&&$N.data("layout")){return $N.data("layout")}var $Ps={},$Cs={},$Rs={},$Ts={},sC=state.container,sID=state.id;var Instance={options:options,state:state,container:$N,panes:$Ps,contents:$Cs,resizers:$Rs,togglers:$Ts,toggle:toggle,hide:hide,show:show,open:open,close:close,slideOpen:slideOpen,slideClose:slideClose,slideToggle:slideToggle,initContent:initContent,sizeContent:sizeContent,sizePane:manualSizePane,swapPanes:swapPanes,resizeAll:resizeAll,initPanes:isInitialized,destroy:destroy,addPane:addPane,removePane:removePane,setSizeLimits:setSizeLimits,bindButton:bindButton,addToggleBtn:addToggleBtn,addOpenBtn:addOpenBtn,addCloseBtn:addCloseBtn,addPinBtn:addPinBtn,allowOverflow:allowOverflow,resetOverflow:resetOverflow,encodeJSON:encodeJSON,decodeJSON:decodeJSON,getState:getState,getCookie:getCookie,saveCookie:saveCookie,deleteCookie:deleteCookie,loadCookie:loadCookie,loadState:loadState,cssWidth:cssW,cssHeight:cssH,enableClosable:enableClosable,disableClosable:disableClosable,enableSlidable:enableSlidable,disableSlidable:disableSlidable,enableResizable:enableResizable,disableResizable:disableResizable};if(_create()==="cancel"){return null}else{return Instance}}})(jQuery);var JSON=JSON||{};(function(){function f(n){return n<10?"0"+n:n}if(typeof Date.prototype.toJSON!=="function"){Date.prototype.toJSON=function(key){return isFinite(this.valueOf())?this.getUTCFullYear()+"-"+f(this.getUTCMonth()+1)+"-"+f(this.getUTCDate())+"T"+f(this.getUTCHours())+":"+f(this.getUTCMinutes())+":"+f(this.getUTCSeconds())+"Z":null};String.prototype.toJSON=Number.prototype.toJSON=Boolean.prototype.toJSON=function(key){return this.valueOf()}}var cx=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,escapable=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,gap,indent,meta={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},rep;function quote(string){escapable.lastIndex=0;return escapable.test(string)?'"'+string.replace(escapable,function(a){var c=meta[a];return typeof c==="string"?c:"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+string+'"'}function str(key,holder){var i,k,v,length,mind=gap,partial,value=holder[key];if(value&&typeof value==="object"&&typeof value.toJSON==="function"){value=value.toJSON(key)}if(typeof rep==="function"){value=rep.call(holder,key,value)}switch(typeof value){case"string":return quote(value);case"number":return isFinite(value)?String(value):"null";case"boolean":case"null":return String(value);case"object":if(!value){return"null"}gap+=indent;partial=[];if(Object.prototype.toString.apply(value)==="[object Array]"){length=value.length;for(i=0;i<length;i+=1){partial[i]=str(i,value)||"null"}v=partial.length===0?"[]":gap?"[\n"+gap+partial.join(",\n"+gap)+"\n"+mind+"]":"["+partial.join(",")+"]";gap=mind;return v}if(rep&&typeof rep==="object"){length=rep.length;for(i=0;i<length;i+=1){if(typeof rep[i]==="string"){k=rep[i];v=str(k,value);if(v){partial.push(quote(k)+(gap?": ":":")+v)}}}}else{for(k in value){if(Object.prototype.hasOwnProperty.call(value,k)){v=str(k,value);if(v){partial.push(quote(k)+(gap?": ":":")+v)}}}}v=partial.length===0?"{}":gap?"{\n"+gap+partial.join(",\n"+gap)+"\n"+mind+"}":"{"+partial.join(",")+"}";gap=mind;return v}}if(typeof JSON.stringify!=="function"){JSON.stringify=function(value,replacer,space){var i;gap="";indent="";if(typeof space==="number"){for(i=0;i<space;i+=1){indent+=" "}}else{if(typeof space==="string"){indent=space}}rep=replacer;if(replacer&&typeof replacer!=="function"&&(typeof replacer!=="object"||typeof replacer.length!=="number")){throw new Error("JSON.stringify")}return str("",{"":value})}}if(typeof JSON.parse!=="function"){JSON.parse=function(text,reviver){var j;function walk(holder,key){var k,v,value=holder[key];if(value&&typeof value==="object"){for(k in value){if(Object.prototype.hasOwnProperty.call(value,k)){v=walk(value,k);if(v!==undefined){value[k]=v}else{delete value[k]}}}}return reviver.call(holder,key,value)}text=String(text);cx.lastIndex=0;if(cx.test(text)){text=text.replace(cx,function(a){return"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)})}if(/^[\],:{}\s]*$/.test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,""))){j=eval("("+text+")");return typeof reviver==="function"?walk({"":j},""):j}throw new SyntaxError("JSON.parse")}}}());var layoutState={options:{layoutName:"layout",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",domain:"",path:"",expires:"",secure:false},data:{},clear:function(a){this.save(a,"dummyKey",{expires:-1})},save:function(c,j,a){var b=jQuery.extend({},this.options,a||{}),i=window[c||b.layoutName];if(!j){j=b.keys}if(typeof j=="string"){j=j.split(",")}if(!i||!i.state||!j.length){return false}var g=typeof b.expires=="number",d=new Date(),f="",h=false;if(g||b.expires.toUTCString){if(g){if(b.expires<=0){d.setYear(1970);h=true}else{d.setTime(d.getTime()+(b.expires*24*60*60*1000))}}else{d=b.expires}f+=";expires="+d.toUTCString()}if(b.path){f+=";path="+b.path}if(b.domain){f+=";domain="+b.domain}if(b.secure){f+=";secure"}if(h){this.data={};document.cookie=(c||b.layoutName)+"="+f}else{this.data=e(i,j);document.cookie=(c||b.layoutName)+"="+encodeURIComponent(JSON.stringify(this.data))+f}return this.data;function e(s,v){var k=s.state,q={},t="north,south,east,west,center",r={isClosed:"initClosed",isHidden:"initHidden"},l=(v[0].indexOf("__")>0?"__":"."),o,n,u,m;for(var p=0;p<v.length;p++){o=v[p].split(l);n=o[0];u=o[1];if(t.indexOf(n)<0){continue}if(u=="isClosed"){m=k[n][u]||k[n]["isSliding"]}else{m=k[n][u]}if(m!=undefined){if(l=="."){if(!q[n]){q[n]={}}q[n][r[u]?r[u]:u]=m}else{q[n+l+(r[u]?r[u]:u)]=m}}}return q}},load:function(a){if(!a){a=this.options.layoutName}if(!a){return{}}var e={},g=document.cookie,d,f,b;if(g&&g!=""){d=g.split(";");for(b=0;b<d.length;b++){g=jQuery.trim(d[b]);f=g.split("=");if(f[0]==a){e=JSON.parse(decodeURIComponent(f[1]));break}}}return(this.data=e)}};"use strict";(function(){if(jQuery&&jQuery.jstree){return}var c=false,b=false,a=false;(function(g){g.vakata={};g.vakata.css={get_css:function(n,k,l){n=n.toLowerCase();var m=l.cssRules||l.rules,i=0;do{if(m.length&&i>m.length+5){return false}if(m[i].selectorText&&m[i].selectorText.toLowerCase()==n){if(k===true){if(l.removeRule){l.removeRule(i)}if(l.deleteRule){l.deleteRule(i)}return true}else{return m[i]}}}while(m[++i]);return false},add_css:function(j,i){if(g.jstree.css.get_css(j,false,i)){return false}if(i.insertRule){i.insertRule(j+" { }",0)}else{i.addRule(j,null,0)}return g.vakata.css.get_css(j)},remove_css:function(j,i){return g.vakata.css.get_css(j,true,i)},add_sheet:function(j){var i=false,l=true;if(j.str){if(j.title){i=g("style[id='"+j.title+"-stylesheet']")[0]}if(i){l=false}else{i=document.createElement("style");i.setAttribute("type","text/css");if(j.title){i.setAttribute("id",j.title+"-stylesheet")}}if(i.styleSheet){if(l){document.getElementsByTagName("head")[0].appendChild(i);i.styleSheet.cssText=j.str}else{i.styleSheet.cssText=i.styleSheet.cssText+" "+j.str}}else{i.appendChild(document.createTextNode(j.str));document.getElementsByTagName("head")[0].appendChild(i)}return i.sheet||i.styleSheet}if(j.url){if(document.createStyleSheet){try{i=document.createStyleSheet(j.url)}catch(k){}}else{i=document.createElement("link");i.rel="stylesheet";i.type="text/css";i.media="all";i.href=j.url;document.getElementsByTagName("head")[0].appendChild(i);return i.styleSheet}}}};var h=[],f=-1,e={},d={};g.fn.jstree=function(l){var i=(typeof l=="string"),j=Array.prototype.slice.call(arguments,1),k=this;if(i){if(l.substring(0,1)=="_"){return k}this.each(function(){var m=h[g.data(this,"jstree-instance-id")],n=(m&&g.isFunction(m[l]))?m[l].apply(m,j):m;if(typeof n!=="undefined"&&(l.indexOf("is_")===0||(n!==true&&n!==false))){k=n;return false}})}else{this.each(function(){var q=g.data(this,"jstree-instance-id"),n=[],m=l?g.extend({},true,l):{},r=g(this),p=false,o=[];n=n.concat(j);if(r.data("jstree")){n.push(r.data("jstree"))}m=n.length?g.extend.apply(null,[true,m].concat(n)):m;if(typeof q!=="undefined"&&h[q]){h[q].destroy()}q=parseInt(h.push({}),10)-1;g.data(this,"jstree-instance-id",q);m.plugins=g.isArray(m.plugins)?m.plugins:g.jstree.defaults.plugins.slice();m.plugins.unshift("core");m.plugins=m.plugins.sort().join(",,").replace(/(,|^)([^,]+)(,,\2)+(,|$)/g,"$1$2$4").replace(/,,+/g,",").replace(/,$/,"").split(",");p=g.extend(true,{},g.jstree.defaults,m);p.plugins=m.plugins;g.each(e,function(s,t){if(g.inArray(s,p.plugins)===-1){p[s]=null;delete p[s]}else{o.push(s)}});p.plugins=o;h[q]=new g.jstree._instance(q,g(this).addClass("jstree jstree-"+q),p);g.each(h[q]._get_settings().plugins,function(s,t){h[q].data[t]={}});g.each(h[q]._get_settings().plugins,function(s,t){if(e[t]){e[t].__init.apply(h[q])}});setTimeout(function(){h[q].init()},0)})}return k};g.jstree={defaults:{plugins:[]},_focused:function(){return h[f]||null},_reference:function(i){if(h[i]){return h[i]}var j=g(i);if(!j.length&&typeof i==="string"){j=g("#"+i)}if(!j.length){return null}return h[j.closest(".jstree").data("jstree-instance-id")]||null},_instance:function(j,i,k){this.data={core:{}};this.get_settings=function(){return g.extend(true,{},k)};this._get_settings=function(){return k};this.get_index=function(){return j};this.get_container=function(){return i};this.get_container_ul=function(){return i.children("ul:eq(0)")};this._set_settings=function(l){k=g.extend(true,{},k,l)}},_fn:{},plugin:function(i,j){j=g.extend({},{__init:g.noop,__destroy:g.noop,_fn:{},defaults:false},j);e[i]=j;g.jstree.defaults[i]=j.defaults;g.each(j._fn,function(k,l){l.plugin=i;l.old=g.jstree._fn[k];g.jstree._fn[k]=function(){var m,o=l,n=Array.prototype.slice.call(arguments),q=new g.Event("before.jstree"),p=false;if(this.data.core.locked===true&&k!=="unlock"&&k!=="is_locked"){return}do{if(o&&o.plugin&&g.inArray(o.plugin,this._get_settings().plugins)!==-1){break}o=o.old}while(o);if(!o){return}if(k.indexOf("_")===0){m=o.apply(this,n)}else{m=this.get_container().triggerHandler(q,{func:k,inst:this,args:n,plugin:o.plugin});if(m===false){return}if(typeof m!=="undefined"){n=m}m=o.apply(g.extend({},this,{__callback:function(r){this.get_container().triggerHandler(k+".jstree",{inst:this,args:n,rslt:r,rlbk:p})},__rollback:function(){p=this.get_rollback();return p},__call_old:function(r){return o.old.apply(this,(r?Array.prototype.slice.call(arguments,1):n))}}),n)}return m};g.jstree._fn[k].old=l.old;g.jstree._fn[k].plugin=i})},rollback:function(i){if(i){if(!g.isArray(i)){i=[i]}g.each(i,function(j,k){h[k.i].set_rollback(k.h,k.d)})}}};g.jstree._fn=g.jstree._instance.prototype={};g(function(){var k=navigator.userAgent.toLowerCase(),j=(k.match(/.+?(?:rv|it|ra|ie)[\/: ]([\d.]+)/)||[0,"0"])[1],i=".jstree ul, .jstree li { display:block; margin:0 0 0 0; padding:0 0 0 0; list-style-type:none; } .jstree li { display:block; min-height:18px; line-height:18px; white-space:nowrap; margin-left:18px; min-width:18px; } .jstree-rtl li { margin-left:0; margin-right:18px; } .jstree > ul > li { margin-left:0px; } .jstree-rtl > ul > li { margin-right:0px; } .jstree ins { display:inline-block; text-decoration:none; width:18px; height:18px; margin:0 0 0 0; padding:0; } .jstree a { display:inline-block; line-height:16px; height:16px; color:black; white-space:nowrap; text-decoration:none; padding:1px 2px; margin:0; } .jstree a:focus { outline: none; } .jstree a > ins { height:16px; width:16px; } .jstree a > .jstree-icon { margin-right:3px; } .jstree-rtl a > .jstree-icon { margin-left:3px; margin-right:0; } li.jstree-open > ul { display:block; } li.jstree-closed > ul { display:none; } ";if(/msie/.test(k)&&parseInt(j,10)==6){c=true;try{document.execCommand("BackgroundImageCache",false,true)}catch(l){}i+=".jstree li { height:18px; margin-left:0; margin-right:0; } .jstree li li { margin-left:18px; } .jstree-rtl li li { margin-left:0px; margin-right:18px; } li.jstree-open ul { display:block; } li.jstree-closed ul { display:none !important; } .jstree li a { display:inline; border-width:0 !important; padding:0px 2px !important; } .jstree li a ins { height:16px; width:16px; margin-right:3px; } .jstree-rtl li a ins { margin-right:0px; margin-left:3px; } "}if(/msie/.test(k)&&parseInt(j,10)==7){b=true;i+=".jstree li a { border-width:0 !important; padding:0px 2px !important; } "}if(!/compatible/.test(k)&&/mozilla/.test(k)&&parseFloat(j,10)<1.9){a=true;i+=".jstree ins { display:-moz-inline-box; } .jstree li { line-height:12px; } .jstree a { display:-moz-inline-box; } .jstree .jstree-no-icons .jstree-checkbox { display:-moz-inline-stack !important; } "}g.vakata.css.add_sheet({str:i,title:"jstree"})});g.jstree.plugin("core",{__init:function(){this.data.core.locked=false;this.data.core.to_open=this.get_settings().core.initially_open;this.data.core.to_load=this.get_settings().core.initially_load},defaults:{html_titles:false,animation:500,initially_open:[],initially_load:[],open_parents:true,notify_plugins:true,rtl:false,load_open:false,strings:{loading:"Loading ...",new_node:"New node",multiple_selection:"Multiple selection"}},_fn:{init:function(){this.set_focus();if(this._get_settings().core.rtl){this.get_container().addClass("jstree-rtl").css("direction","rtl")}this.get_container().html("<ul><li class='jstree-last jstree-leaf'><ins>&#160;</ins><a class='jstree-loading' href='#'><ins class='jstree-icon'>&#160;</ins>"+this._get_string("loading")+"</a></li></ul>");this.data.core.li_height=this.get_container_ul().find("li.jstree-closed, li.jstree-leaf").eq(0).height()||18;this.get_container().delegate("li > ins","click.jstree",g.proxy(function(j){var i=g(j.target);if(i.is("ins")&&j.pageY-i.offset().top<this.data.core.li_height){this.toggle_node(i)}},this)).bind("mousedown.jstree",g.proxy(function(){this.set_focus()},this)).bind("dblclick.jstree",function(j){var k;if(document.selection&&document.selection.empty){document.selection.empty()}else{if(window.getSelection){k=window.getSelection();try{k.removeAllRanges();k.collapse()}catch(i){}}}});if(this._get_settings().core.notify_plugins){this.get_container().bind("load_node.jstree",g.proxy(function(k,j){var l=this._get_node(j.rslt.obj),i=this;if(l===-1){l=this.get_container_ul()}if(!l.length){return}l.find("li").each(function(){var m=g(this);if(m.data("jstree")){g.each(m.data("jstree"),function(o,n){if(i.data[o]&&g.isFunction(i["_"+o+"_notify"])){i["_"+o+"_notify"].call(i,m,n)}})}})},this))}if(this._get_settings().core.load_open){this.get_container().bind("load_node.jstree",g.proxy(function(k,j){var l=this._get_node(j.rslt.obj),i=this;if(l===-1){l=this.get_container_ul()}if(!l.length){return}l.find("li.jstree-open:not(:has(ul))").each(function(){i.load_node(this,g.noop,g.noop)})},this))}this.__callback();this.load_node(-1,function(){this.loaded();this.reload_nodes()})},destroy:function(){var j,m=this.get_index(),k=this._get_settings(),l=this;g.each(k.plugins,function(n,p){try{e[p].__destroy.apply(l)}catch(o){}});this.__callback();if(this.is_focused()){for(j in h){if(h.hasOwnProperty(j)&&j!=m){h[j].set_focus();break}}}if(m===f){f=-1}this.get_container().unbind(".jstree").undelegate(".jstree").removeData("jstree-instance-id").find("[class^='jstree']").andSelf().attr("class",function(){return this.className.replace(/jstree[^ ]*|$/ig,"")});g(document).unbind(".jstree-"+m).undelegate(".jstree-"+m);h[m]=null;delete h[m]},_core_notify:function(j,i){if(i.opened){this.open_node(j,false,true)}},lock:function(){this.data.core.locked=true;this.get_container().children("ul").addClass("jstree-locked").css("opacity","0.7");this.__callback({})},unlock:function(){this.data.core.locked=false;this.get_container().children("ul").removeClass("jstree-locked").css("opacity","1");this.__callback({})},is_locked:function(){return this.data.core.locked},save_opened:function(){var i=this;this.data.core.to_open=[];this.get_container_ul().find("li.jstree-open").each(function(){if(this.id){i.data.core.to_open.push("#"+this.id.toString().replace(/^#/,"").replace(/\\\//g,"/").replace(/\//g,"\\/").replace(/\\\./g,".").replace(/\./g,"\\.").replace(/\:/g,"\\:"))}});this.__callback(i.data.core.to_open)},save_loaded:function(){},reload_nodes:function(j){var m=this,i=true,l=[],k=[];if(!j){this.data.core.reopen=false;this.data.core.refreshing=true;this.data.core.to_open=g.map(g.makeArray(this.data.core.to_open),function(o){return"#"+o.toString().replace(/^#/,"").replace(/\\\//g,"/").replace(/\//g,"\\/").replace(/\\\./g,".").replace(/\./g,"\\.").replace(/\:/g,"\\:")});this.data.core.to_load=g.map(g.makeArray(this.data.core.to_load),function(o){return"#"+o.toString().replace(/^#/,"").replace(/\\\//g,"/").replace(/\//g,"\\/").replace(/\\\./g,".").replace(/\./g,"\\.").replace(/\:/g,"\\:")});if(this.data.core.to_open.length){this.data.core.to_load=this.data.core.to_load.concat(this.data.core.to_open)}}if(this.data.core.to_load.length){g.each(this.data.core.to_load,function(n,o){if(o=="#"){return true}if(g(o).length){l.push(o)}else{k.push(o)}});if(l.length){this.data.core.to_load=k;g.each(l,function(n,o){if(!m._is_loaded(o)){m.load_node(o,function(){m.reload_nodes(true)},function(){m.reload_nodes(true)});i=false}})}}if(this.data.core.to_open.length){g.each(this.data.core.to_open,function(n,o){m.open_node(o,false,true)})}if(i){if(this.data.core.reopen){clearTimeout(this.data.core.reopen)}this.data.core.reopen=setTimeout(function(){m.__callback({},m)},50);this.data.core.refreshing=false;this.reopen()}},reopen:function(){var i=this;if(this.data.core.to_open.length){g.each(this.data.core.to_open,function(j,k){i.open_node(k,false,true)})}this.__callback({})},refresh:function(i){var j=this;this.save_opened();if(!i){i=-1}i=this._get_node(i);if(!i){i=-1}if(i!==-1){i.children("UL").remove()}else{this.get_container_ul().empty()}this.load_node(i,function(){j.__callback({obj:i});j.reload_nodes()})},loaded:function(){this.__callback()},set_focus:function(){if(this.is_focused()){return}var i=g.jstree._focused();if(i){i.unset_focus()}this.get_container().addClass("jstree-focused");f=this.get_index();this.__callback()},is_focused:function(){return f==this.get_index()},unset_focus:function(){if(this.is_focused()){this.get_container().removeClass("jstree-focused");f=-1}this.__callback()},_get_node:function(i){var j=g(i,this.get_container());if(j.is(".jstree")||i==-1){return -1}j=j.closest("li",this.get_container());return j.length?j:false},_get_next:function(j,i){j=this._get_node(j);if(j===-1){return this.get_container().find("> ul > li:first-child")}if(!j.length){return false}if(i){return(j.nextAll("li").size()>0)?j.nextAll("li:eq(0)"):false}if(j.hasClass("jstree-open")){return j.find("li:eq(0)")}else{if(j.nextAll("li").size()>0){return j.nextAll("li:eq(0)")}else{return j.parentsUntil(".jstree","li").next("li").eq(0)}}},_get_prev:function(j,i){j=this._get_node(j);if(j===-1){return this.get_container().find("> ul > li:last-child")}if(!j.length){return false}if(i){return(j.prevAll("li").length>0)?j.prevAll("li:eq(0)"):false}if(j.prev("li").length){j=j.prev("li").eq(0);while(j.hasClass("jstree-open")){j=j.children("ul:eq(0)").children("li:last")}return j}else{var k=j.parentsUntil(".jstree","li:eq(0)");return k.length?k:false}},_get_parent:function(i){i=this._get_node(i);if(i==-1||!i.length){return false}var j=i.parentsUntil(".jstree","li:eq(0)");return j.length?j:-1},_get_children:function(i){i=this._get_node(i);if(i===-1){return this.get_container().children("ul:eq(0)").children("li")}if(!i.length){return false}return i.children("ul:eq(0)").children("li")},get_path:function(k,i){var j=[],l=this;k=this._get_node(k);if(k===-1||!k||!k.length){return false}k.parentsUntil(".jstree","li").each(function(){j.push(i?this.id:l.get_text(this))});j.reverse();j.push(i?k.attr("id"):this.get_text(k));return j},_get_string:function(i){return this._get_settings().core.strings[i]||i},is_open:function(i){i=this._get_node(i);return i&&i!==-1&&i.hasClass("jstree-open")},is_closed:function(i){i=this._get_node(i);return i&&i!==-1&&i.hasClass("jstree-closed")},is_leaf:function(i){i=this._get_node(i);return i&&i!==-1&&i.hasClass("jstree-leaf")},correct_state:function(i){i=this._get_node(i);if(!i||i===-1){return false}i.removeClass("jstree-closed jstree-open").addClass("jstree-leaf").children("ul").remove();this.__callback({obj:i})},open_node:function(l,m,j){l=this._get_node(l);if(!l.length){return false}if(!l.hasClass("jstree-closed")){if(m){m.call()}return false}var k=j||c?0:this._get_settings().core.animation,i=this;if(!this._is_loaded(l)){l.children("a").addClass("jstree-loading");this.load_node(l,function(){i.open_node(l,m,j)},m)}else{if(this._get_settings().core.open_parents){l.parentsUntil(".jstree",".jstree-closed").each(function(){i.open_node(this,false,true)})}if(k){l.children("ul").css("display","none")}l.removeClass("jstree-closed").addClass("jstree-open").children("a").removeClass("jstree-loading");if(k){l.children("ul").stop(true,true).slideDown(k,function(){this.style.display="";i.after_open(l)})}else{i.after_open(l)}this.__callback({obj:l});if(m){m.call()}}},after_open:function(i){this.__callback({obj:i})},close_node:function(l,j){l=this._get_node(l);var k=j||c?0:this._get_settings().core.animation,i=this;if(!l.length||!l.hasClass("jstree-open")){return false}if(k){l.children("ul").attr("style","display:block !important")}l.removeClass("jstree-open").addClass("jstree-closed");if(k){l.children("ul").stop(true,true).slideUp(k,function(){this.style.display="";i.after_close(l)})}else{i.after_close(l)}this.__callback({obj:l})},after_close:function(i){this.__callback({obj:i})},toggle_node:function(i){i=this._get_node(i);if(i.hasClass("jstree-closed")){return this.open_node(i)}if(i.hasClass("jstree-open")){return this.close_node(i)}},open_all:function(k,j,i){k=k?this._get_node(k):-1;if(!k||k===-1){k=this.get_container_ul()}if(i){k=k.find("li.jstree-closed")}else{i=k;if(k.is(".jstree-closed")){k=k.find("li.jstree-closed").andSelf()}else{k=k.find("li.jstree-closed")}}var l=this;k.each(function(){var m=this;if(!l._is_loaded(this)){l.open_node(this,function(){l.open_all(m,j,i)},!j)}else{l.open_node(this,false,!j)}});if(i.find("li.jstree-closed").length===0){this.__callback({obj:i})}},close_all:function(j,i){var k=this;j=j?this._get_node(j):this.get_container();if(!j||j===-1){j=this.get_container_ul()}j.find("li.jstree-open").andSelf().each(function(){k.close_node(this,!i)});this.__callback({obj:j})},clean_node:function(i){i=i&&i!=-1?g(i):this.get_container_ul();i=i.is("li")?i.find("li").andSelf():i.find("li");i.removeClass("jstree-last").filter("li:last-child").addClass("jstree-last").end().filter(":has(li)").not(".jstree-open").removeClass("jstree-leaf").addClass("jstree-closed");i.not(".jstree-open, .jstree-closed").addClass("jstree-leaf").children("ul").remove();this.__callback({obj:i})},get_rollback:function(){this.__callback();return{i:this.get_index(),h:this.get_container().children("ul").clone(true),d:this.data}},set_rollback:function(i,j){this.get_container().empty().append(i);this.data=j;this.__callback()},load_node:function(k,i,j){this.__callback({obj:k})},_is_loaded:function(i){return true},create_node:function(n,i,m,p,j){n=this._get_node(n);i=typeof i==="undefined"?"last":i;var o=g("<li />"),l=this._get_settings().core,k;if(n!==-1&&!n.length){return false}if(!j&&!this._is_loaded(n)){this.load_node(n,function(){this.create_node(n,i,m,p,true)});return false}this.__rollback();if(typeof m==="string"){m={data:m}}if(!m){m={}}if(m.attr){o.attr(m.attr)}if(m.metadata){o.data(m.metadata)}if(m.state){o.addClass("jstree-"+m.state)}if(!m.data){m.data=this._get_string("new_node")}if(!g.isArray(m.data)){k=m.data;m.data=[];m.data.push(k)}g.each(m.data,function(r,q){k=g("<a />");if(g.isFunction(q)){q=q.call(this,m)}if(typeof q=="string"){k.attr("href","#")[l.html_titles?"html":"text"](q)}else{if(!q.attr){q.attr={}}if(!q.attr.href){q.attr.href="#"}k.attr(q.attr)[l.html_titles?"html":"text"](q.title);if(q.language){k.addClass(q.language)}}k.prepend("<ins class='jstree-icon'>&#160;</ins>");if(q.icon){if(q.icon.indexOf("/")===-1){k.children("ins").addClass(q.icon)}else{k.children("ins").css("background","url('"+q.icon+"') center center no-repeat")}}o.append(k)});o.prepend("<ins class='jstree-icon'>&#160;</ins>");if(n===-1){n=this.get_container();if(i==="before"){i="first"}if(i==="after"){i="last"}}switch(i){case"before":n.before(o);k=this._get_parent(n);break;case"after":n.after(o);k=this._get_parent(n);break;case"inside":case"first":if(!n.children("ul").length){n.append("<ul />")}n.children("ul").prepend(o);k=n;break;case"last":if(!n.children("ul").length){n.append("<ul />")}n.children("ul").append(o);k=n;break;default:if(!n.children("ul").length){n.append("<ul />")}if(!i){i=0}k=n.children("ul").children("li").eq(i);if(k.length){k.before(o)}else{n.children("ul").append(o)}k=n;break}if(k===-1||k.get(0)===this.get_container().get(0)){k=-1}this.clean_node(k);this.__callback({obj:o,parent:k});if(p){p.call(this,o)}return o},get_text:function(j){j=this._get_node(j);if(!j.length){return false}var i=this._get_settings().core.html_titles;j=j.children("a:eq(0)");if(i){j=j.clone();j.children("INS").remove();return j.html()}else{j=j.contents().filter(function(){return this.nodeType==3})[0];return j.nodeValue}},set_text:function(j,k){j=this._get_node(j);if(!j.length){return false}j=j.children("a:eq(0)");if(this._get_settings().core.html_titles){var i=j.children("INS").clone();j.html(k).prepend(i);this.__callback({obj:j,name:k});return true}else{j=j.contents().filter(function(){return this.nodeType==3})[0];this.__callback({obj:j,name:k});return(j.nodeValue=k)}},rename_node:function(i,j){i=this._get_node(i);this.__rollback();if(i&&i.length&&this.set_text.apply(this,Array.prototype.slice.call(arguments))){this.__callback({obj:i,name:j})}},delete_node:function(l){l=this._get_node(l);if(!l.length){return false}this.__rollback();var k=this._get_parent(l),j=g([]),i=this;l.each(function(){j=j.add(i._get_prev(this))});l=l.detach();if(k!==-1&&k.find("> ul > li").length===0){k.removeClass("jstree-open jstree-closed").addClass("jstree-leaf")}this.clean_node(k);this.__callback({obj:l,prev:j,parent:k});return l},prepare_move:function(m,k,n,i,j){var l={};l.ot=g.jstree._reference(m)||this;l.o=l.ot._get_node(m);l.r=k===-1?-1:this._get_node(k);l.p=(typeof n==="undefined"||n===false)?"last":n;if(!j&&d.o&&d.o[0]===l.o[0]&&d.r[0]===l.r[0]&&d.p===l.p){this.__callback(d);if(i){i.call(this,d)}return}l.ot=g.jstree._reference(l.o)||this;l.rt=g.jstree._reference(l.r)||this;if(l.r===-1||!l.r){l.cr=-1;switch(l.p){case"first":case"before":case"inside":l.cp=0;break;case"after":case"last":l.cp=l.rt.get_container().find(" > ul > li").length;break;default:l.cp=l.p;break}}else{if(!/^(before|after)$/.test(l.p)&&!this._is_loaded(l.r)){return this.load_node(l.r,function(){this.prepare_move(m,k,n,i,true)})}switch(l.p){case"before":l.cp=l.r.index();l.cr=l.rt._get_parent(l.r);break;case"after":l.cp=l.r.index()+1;l.cr=l.rt._get_parent(l.r);break;case"inside":case"first":l.cp=0;l.cr=l.r;break;case"last":l.cp=l.r.find(" > ul > li").length;l.cr=l.r;break;default:l.cp=l.p;l.cr=l.r;break}}l.np=l.cr==-1?l.rt.get_container():l.cr;l.op=l.ot._get_parent(l.o);l.cop=l.o.index();if(l.op===-1){l.op=l.ot?l.ot.get_container():this.get_container()}if(!/^(before|after)$/.test(l.p)&&l.op&&l.np&&l.op[0]===l.np[0]&&l.o.index()<l.cp){l.cp++}l.or=l.np.find(" > ul > li:nth-child("+(l.cp+1)+")");d=l;this.__callback(d);if(i){i.call(this,d)}},check_move:function(){var k=d,i=true,j=k.r===-1?this.get_container():k.r;if(!k||!k.o||k.or[0]===k.o[0]){return false}if(k.op&&k.np&&k.op[0]===k.np[0]&&k.cp-1===k.o.index()){return false}k.o.each(function(){if(j.parentsUntil(".jstree","li").andSelf().index(this)!==-1){i=false;return false}});return i},move_node:function(p,l,i,k,j,n){if(!j){return this.prepare_move(p,l,i,function(o){this.move_node(o,false,false,k,true,n)})}if(k){d.cy=true}if(!n&&!this.check_move()){return false}this.__rollback();var q=false;if(k){q=p.o.clone(true);q.find("*[id]").andSelf().each(function(){if(this.id){this.id="copy_"+this.id}})}else{q=p.o}if(p.or.length){p.or.before(q)}else{if(!p.np.children("ul").length){g("<ul />").appendTo(p.np)}p.np.children("ul:eq(0)").append(q)}try{p.ot.clean_node(p.op);p.rt.clean_node(p.np);if(!p.op.find("> ul > li").length){p.op.removeClass("jstree-open jstree-closed").addClass("jstree-leaf").children("ul").remove()}}catch(m){}if(k){d.cy=true;d.oc=q}this.__callback(d);return d},_get_move:function(){return d}}})})(jQuery);(function(d){var g,f,e;d(function(){if(/msie/.test(navigator.userAgent.toLowerCase())){f=d('<textarea cols="10" rows="2"></textarea>').css({position:"absolute",top:-1000,left:0}).appendTo("body");e=d('<textarea cols="10" rows="2" style="overflow: hidden;"></textarea>').css({position:"absolute",top:-1000,left:0}).appendTo("body");g=f.width()-e.width();f.add(e).remove()}else{f=d("<div />").css({width:100,height:100,overflow:"auto",position:"absolute",top:-1000,left:0}).prependTo("body").append("<div />").find("div").css({width:"100%",height:200});g=100-f.width();f.parent().remove()}});d.jstree.plugin("ui",{__init:function(){this.data.ui.selected=d();this.data.ui.last_selected=false;this.data.ui.hovered=null;this.data.ui.to_select=this.get_settings().ui.initially_select;this.get_container().delegate("a","click.jstree",d.proxy(function(h){h.preventDefault();h.currentTarget.blur();if(!d(h.currentTarget).hasClass("jstree-loading")){this.select_node(h.currentTarget,true,h)}},this)).delegate("a","mouseenter.jstree",d.proxy(function(h){if(!d(h.currentTarget).hasClass("jstree-loading")){this.hover_node(h.target)}},this)).delegate("a","mouseleave.jstree",d.proxy(function(h){if(!d(h.currentTarget).hasClass("jstree-loading")){this.dehover_node(h.target)}},this)).bind("reopen.jstree",d.proxy(function(){this.reselect()},this)).bind("get_rollback.jstree",d.proxy(function(){this.dehover_node();this.save_selected()},this)).bind("set_rollback.jstree",d.proxy(function(){this.reselect()},this)).bind("close_node.jstree",d.proxy(function(i,j){var h=this._get_settings().ui,k=this._get_node(j.rslt.obj),l=(k&&k.length)?k.children("ul").find("a.jstree-clicked"):d(),m=this;if(h.selected_parent_close===false||!l.length){return}l.each(function(){m.deselect_node(this);if(h.selected_parent_close==="select_parent"){m.select_node(k)}})},this)).bind("delete_node.jstree",d.proxy(function(i,j){var h=this._get_settings().ui.select_prev_on_delete,k=this._get_node(j.rslt.obj),l=(k&&k.length)?k.find("a.jstree-clicked"):[],m=this;l.each(function(){m.deselect_node(this)});if(h&&l.length){j.rslt.prev.each(function(){if(this.parentNode){m.select_node(this);return false}})}},this)).bind("move_node.jstree",d.proxy(function(h,i){if(i.rslt.cy){i.rslt.oc.find("a.jstree-clicked").removeClass("jstree-clicked")}},this))},defaults:{select_limit:-1,select_multiple_modifier:"ctrl",select_range_modifier:"shift",selected_parent_close:"select_parent",selected_parent_open:true,select_prev_on_delete:true,disable_selecting_children:false,initially_select:[]},_fn:{_get_node:function(h,i){if(typeof h==="undefined"||h===null){return i?this.data.ui.selected:this.data.ui.last_selected}var j=d(h,this.get_container());if(j.is(".jstree")||h==-1){return -1}j=j.closest("li",this.get_container());return j.length?j:false},_ui_notify:function(i,h){if(h.selected){this.select_node(i,false)}},save_selected:function(){var h=this;this.data.ui.to_select=[];this.data.ui.selected.each(function(){if(this.id){h.data.ui.to_select.push("#"+this.id.toString().replace(/^#/,"").replace(/\\\//g,"/").replace(/\//g,"\\/").replace(/\\\./g,".").replace(/\./g,"\\.").replace(/\:/g,"\\:"))}});this.__callback(this.data.ui.to_select)},reselect:function(){var i=this,h=this.data.ui.to_select;h=d.map(d.makeArray(h),function(j){return"#"+j.toString().replace(/^#/,"").replace(/\\\//g,"/").replace(/\//g,"\\/").replace(/\\\./g,".").replace(/\./g,"\\.").replace(/\:/g,"\\:")});d.each(h,function(j,k){if(k&&k!=="#"){i.select_node(k)}});this.data.ui.selected=this.data.ui.selected.filter(function(){return this.parentNode});this.__callback()},refresh:function(h){this.save_selected();return this.__call_old()},hover_node:function(h){h=this._get_node(h);if(!h.length){return false}if(!h.hasClass("jstree-hovered")){this.dehover_node()}this.data.ui.hovered=h.children("a").addClass("jstree-hovered").parent();this._fix_scroll(h);this.__callback({obj:h})},dehover_node:function(){var i=this.data.ui.hovered,h;if(!i||!i.length){return false}h=i.children("a").removeClass("jstree-hovered").parent();if(this.data.ui.hovered[0]===h[0]){this.data.ui.hovered=null}this.__callback({obj:i})},select_node:function(k,h,l){k=this._get_node(k);if(k==-1||!k||!k.length){return false}var p=this._get_settings().ui,n=(p.select_multiple_modifier=="on"||(p.select_multiple_modifier!==false&&l&&l[p.select_multiple_modifier+"Key"])),i=(p.select_range_modifier!==false&&l&&l[p.select_range_modifier+"Key"]&&this.data.ui.last_selected&&this.data.ui.last_selected[0]!==k[0]&&this.data.ui.last_selected.parent()[0]===k.parent()[0]),j=this.is_selected(k),m=true,o=this;if(h){if(p.disable_selecting_children&&n&&((k.parentsUntil(".jstree","li").children("a.jstree-clicked").length)||(k.children("ul").find("a.jstree-clicked:eq(0)").length))){return false}m=false;switch(!0){case (i):this.data.ui.last_selected.addClass("jstree-last-selected");k=k[k.index()<this.data.ui.last_selected.index()?"nextUntil":"prevUntil"](".jstree-last-selected").andSelf();if(p.select_limit==-1||k.length<p.select_limit){this.data.ui.last_selected.removeClass("jstree-last-selected");this.data.ui.selected.each(function(){if(this!==o.data.ui.last_selected[0]){o.deselect_node(this)}});j=false;m=true}else{m=false}break;case (j&&!n):this.deselect_all();j=false;m=true;break;case (!j&&!n):if(p.select_limit==-1||p.select_limit>0){this.deselect_all();m=true}break;case (j&&n):this.deselect_node(k);break;case (!j&&n):if(p.select_limit==-1||this.data.ui.selected.length+1<=p.select_limit){m=true}break}}if(m&&!j){if(!i){this.data.ui.last_selected=k}k.children("a").addClass("jstree-clicked");if(p.selected_parent_open){k.parents(".jstree-closed").each(function(){o.open_node(this,false,true)})}this.data.ui.selected=this.data.ui.selected.add(k);this._fix_scroll(k.eq(0));this.__callback({obj:k,e:l})}},_fix_scroll:function(i){var j=this.get_container()[0],h;if(j.scrollHeight>j.offsetHeight){i=this._get_node(i);if(!i||i===-1||!i.length||!i.is(":visible")){return}h=i.offset().top-this.get_container().offset().top;if(h<0){j.scrollTop=j.scrollTop+h-1}if(h+this.data.core.li_height+(j.scrollWidth>j.offsetWidth?g:0)>j.offsetHeight){j.scrollTop=j.scrollTop+(h-j.offsetHeight+this.data.core.li_height+1+(j.scrollWidth>j.offsetWidth?g:0))}}},deselect_node:function(h){h=this._get_node(h);if(!h.length){return false}if(this.is_selected(h)){h.children("a").removeClass("jstree-clicked");this.data.ui.selected=this.data.ui.selected.not(h);if(this.data.ui.last_selected.get(0)===h.get(0)){this.data.ui.last_selected=this.data.ui.selected.eq(0)}this.__callback({obj:h})}},toggle_select:function(h){h=this._get_node(h);if(!h.length){return false}if(this.is_selected(h)){this.deselect_node(h)}else{this.select_node(h)}},is_selected:function(h){return this.data.ui.selected.index(this._get_node(h))>=0},get_selected:function(h){return h?d(h).find("a.jstree-clicked").parent():this.data.ui.selected},deselect_all:function(i){var h=i?d(i).find("a.jstree-clicked").parent():this.get_container().find("a.jstree-clicked").parent();h.children("a.jstree-clicked").removeClass("jstree-clicked");this.data.ui.selected=d([]);this.data.ui.last_selected=false;this.__callback({obj:h})}}});d.jstree.defaults.plugins.push("ui")})(jQuery);(function(d){d.jstree.plugin("crrm",{__init:function(){this.get_container().bind("move_node.jstree",d.proxy(function(h,g){if(this._get_settings().crrm.move.open_onmove){var f=this;g.rslt.np.parentsUntil(".jstree").andSelf().filter(".jstree-closed").each(function(){f.open_node(this,false,true)})}},this))},defaults:{input_width_limit:200,move:{always_copy:false,open_onmove:true,default_position:"last",check_move:function(e){return true}}},_fn:{_show_input:function(e,l){e=this._get_node(e);var j=this._get_settings().core.rtl,k=this._get_settings().crrm.input_width_limit,g=e.children("ins").width(),f=e.find("> a:visible > ins").width()*e.find("> a:visible > ins").length,m=this.get_text(e),i=d("<div />",{css:{position:"absolute",top:"-200px",left:(j?"0px":"-1000px"),visibility:"hidden"}}).appendTo("body"),h=e.css("position","relative").append(d("<input />",{value:m,"class":"jstree-rename-input",css:{padding:"0",border:"1px solid silver",position:"absolute",left:(j?"auto":(g+f+4)+"px"),right:(j?(g+f+4)+"px":"auto"),top:"0px",height:(this.data.core.li_height-2)+"px",lineHeight:(this.data.core.li_height-2)+"px",width:"150px"},blur:d.proxy(function(){var o=e.children(".jstree-rename-input"),n=o.val();if(n===""){n=m}i.remove();o.remove();this.set_text(e,m);this.rename_node(e,n);l.call(this,e,n,m);e.css("position","")},this),keyup:function(o){var n=o.keyCode||o.which;if(n==27){this.value=m;this.blur();return}else{if(n==13){this.blur();return}else{h.width(Math.min(i.text("pW"+this.value).width(),k))}}},keypress:function(o){var n=o.keyCode||o.which;if(n==13){return false}}})).children(".jstree-rename-input");this.set_text(e,"");i.css({fontFamily:h.css("fontFamily")||"",fontSize:h.css("fontSize")||"",fontWeight:h.css("fontWeight")||"",fontStyle:h.css("fontStyle")||"",fontStretch:h.css("fontStretch")||"",fontVariant:h.css("fontVariant")||"",letterSpacing:h.css("letterSpacing")||"",wordSpacing:h.css("wordSpacing")||""});h.width(Math.min(i.text("pW"+h[0].value).width(),k))[0].select()},rename:function(g){g=this._get_node(g);this.__rollback();var e=this.__callback;this._show_input(g,function(i,h,f){e.call(this,{obj:i,new_name:h,old_name:f})})},create:function(i,f,h,k,e){var g,j=this;i=this._get_node(i);if(!i){i=-1}this.__rollback();g=this.create_node(i,f,h,function(l){var m=this._get_parent(l),n=d(l).index();if(k){k.call(this,l)}if(m.length&&m.hasClass("jstree-closed")){this.open_node(m,false,true)}if(!e){this._show_input(l,function(q,p,o){j.__callback({obj:q,name:p,parent:m,position:n})})}else{j.__callback({obj:l,name:this.get_text(l),parent:m,position:n})}});return g},remove:function(g){g=this._get_node(g,true);var f=this._get_parent(g),e=this._get_prev(g);this.__rollback();g=this.delete_node(g);if(g!==false){this.__callback({obj:g,prev:e,parent:f})}},check_move:function(){if(!this.__call_old()){return false}var e=this._get_settings().crrm.move;if(!e.check_move.call(this,this._get_move())){return false}return true},move_node:function(k,i,e,g,f,j){var h=this._get_settings().crrm.move;if(!f){if(typeof e==="undefined"){e=h.default_position}if(e==="inside"&&!h.default_position.match(/^(before|after)$/)){e=h.default_position}return this.__call_old(true,k,i,e,g,false,j)}if(h.always_copy===true||(h.always_copy==="multitree"&&k.rt.get_index()!==k.ot.get_index())){g=true}this.__call_old(true,k,i,e,g,true,j)},cut:function(e){e=this._get_node(e,true);if(!e||!e.length){return false}this.data.crrm.cp_nodes=false;this.data.crrm.ct_nodes=e;this.__callback({obj:e})},copy:function(e){e=this._get_node(e,true);if(!e||!e.length){return false}this.data.crrm.ct_nodes=false;this.data.crrm.cp_nodes=e;this.__callback({obj:e})},paste:function(f){f=this._get_node(f);if(!f||!f.length){return false}var e=this.data.crrm.ct_nodes?this.data.crrm.ct_nodes:this.data.crrm.cp_nodes;if(!this.data.crrm.ct_nodes&&!this.data.crrm.cp_nodes){return false}if(this.data.crrm.ct_nodes){this.move_node(this.data.crrm.ct_nodes,f);this.data.crrm.ct_nodes=false}if(this.data.crrm.cp_nodes){this.move_node(this.data.crrm.cp_nodes,f,false,true)}this.__callback({obj:f,nodes:e})}}})})(jQuery);(function(d){var e=[];d.jstree._themes=false;d.jstree.plugin("themes",{__init:function(){this.get_container().bind("init.jstree",d.proxy(function(){var f=this._get_settings().themes;this.data.themes.dots=f.dots;this.data.themes.icons=f.icons;this.set_theme(f.theme,f.url)},this)).bind("loaded.jstree",d.proxy(function(){if(!this.data.themes.dots){this.hide_dots()}else{this.show_dots()}if(!this.data.themes.icons){this.hide_icons()}else{this.show_icons()}},this))},defaults:{theme:"default",url:false,dots:true,icons:true},_fn:{set_theme:function(g,f){if(!g){return false}if(!f){f=d.jstree._themes+g+"/style.css"}if(d.inArray(f,e)==-1){e.push(f)}if(this.data.themes.theme!=g){this.get_container().removeClass("jstree-"+this.data.themes.theme);this.data.themes.theme=g}this.get_container().addClass("jstree-"+g);if(!this.data.themes.dots){this.hide_dots()}else{this.show_dots()}if(!this.data.themes.icons){this.hide_icons()}else{this.show_icons()}this.__callback()},get_theme:function(){return this.data.themes.theme},show_dots:function(){this.data.themes.dots=true;this.get_container().children("ul").removeClass("jstree-no-dots")},hide_dots:function(){this.data.themes.dots=false;this.get_container().children("ul").addClass("jstree-no-dots")},toggle_dots:function(){if(this.data.themes.dots){this.hide_dots()}else{this.show_dots()}},show_icons:function(){this.data.themes.icons=true;this.get_container().children("ul").removeClass("jstree-no-icons")},hide_icons:function(){this.data.themes.icons=false;this.get_container().children("ul").addClass("jstree-no-icons")},toggle_icons:function(){if(this.data.themes.icons){this.hide_icons()}else{this.show_icons()}}}});d(function(){if(d.jstree._themes===false){d("script").each(function(){if(this.src.toString().match(/jquery\.jstree[^\/]*?\.js(\?.*)?$/)){d.jstree._themes=this.src.toString().replace(/jquery\.jstree[^\/]*?\.js(\?.*)?$/,"")+"themes/";return false}})}if(d.jstree._themes===false){d.jstree._themes="themes/"}});d.jstree.defaults.plugins.push("themes")})(jQuery);(function(d){d.jstree.plugin("json_data",{__init:function(){var e=this._get_settings().json_data;if(e.progressive_unload){this.get_container().bind("after_close.jstree",function(g,f){f.rslt.obj.children("ul").remove()})}},defaults:{data:false,ajax:false,correct_state:true,progressive_render:false,progressive_unload:false},_fn:{load_node:function(g,e,f){var h=this;this.load_node_json(g,function(){h.__callback({obj:h._get_node(g)});e.call(this)},f)},_is_loaded:function(f){var e=this._get_settings().json_data;f=this._get_node(f);return f==-1||!f||(!e.ajax&&!e.progressive_render&&!d.isFunction(e.data))||f.is(".jstree-open, .jstree-leaf")||f.children("ul").children("li").length>0},refresh:function(f){f=this._get_node(f);var e=this._get_settings().json_data;if(f&&f!==-1&&e.progressive_unload&&(d.isFunction(e.data)||!!e.ajax)){f.removeData("jstree-children")}return this.__call_old()},load_node_json:function(i,e,g){var h=this.get_settings().json_data,k,f=function(){},j=function(){};i=this._get_node(i);if(i&&i!==-1&&(h.progressive_render||h.progressive_unload)&&!i.is(".jstree-open, .jstree-leaf")&&i.children("ul").children("li").length===0&&i.data("jstree-children")){k=this._parse_json(i.data("jstree-children"),i);if(k){i.append(k);if(!h.progressive_unload){i.removeData("jstree-children")}}this.clean_node(i);if(e){e.call(this)}return}if(i&&i!==-1){if(i.data("jstree-is-loading")){return}else{i.data("jstree-is-loading",true)}}switch(!0){case (!h.data&&!h.ajax):throw"Neither data nor ajax settings supplied.";case (d.isFunction(h.data)):h.data.call(this,i,d.proxy(function(l){l=this._parse_json(l,i);if(!l){if(i===-1||!i){if(h.correct_state){this.get_container().children("ul").empty()}}else{i.children("a.jstree-loading").removeClass("jstree-loading");i.removeData("jstree-is-loading");if(h.correct_state){this.correct_state(i)}}if(g){g.call(this)}}else{if(i===-1||!i){this.get_container().children("ul").empty().append(l.children())}else{i.append(l).children("a.jstree-loading").removeClass("jstree-loading");i.removeData("jstree-is-loading")}this.clean_node(i);if(e){e.call(this)}}},this));break;case (!!h.data&&!h.ajax)||(!!h.data&&!!h.ajax&&(!i||i===-1)):if(!i||i==-1){k=this._parse_json(h.data,i);if(k){this.get_container().children("ul").empty().append(k.children());this.clean_node()}else{if(h.correct_state){this.get_container().children("ul").empty()}}}if(e){e.call(this)}break;case (!h.data&&!!h.ajax)||(!!h.data&&!!h.ajax&&i&&i!==-1):f=function(m,n,o){var l=this.get_settings().json_data.ajax.error;if(l){l.call(this,m,n,o)}if(i!=-1&&i.length){i.children("a.jstree-loading").removeClass("jstree-loading");i.removeData("jstree-is-loading");if(n==="success"&&h.correct_state){this.correct_state(i)}}else{if(n==="success"&&h.correct_state){this.get_container().children("ul").empty()}}if(g){g.call(this)}};j=function(o,m,l){var n=this.get_settings().json_data.ajax.success;if(n){o=n.call(this,o,m,l)||o}if(o===""||(o&&o.toString&&o.toString().replace(/^[\s\n]+$/,"")==="")||(!d.isArray(o)&&!d.isPlainObject(o))){return f.call(this,l,m,"")}o=this._parse_json(o,i);if(o){if(i===-1||!i){this.get_container().children("ul").empty().append(o.children())}else{i.append(o).children("a.jstree-loading").removeClass("jstree-loading");i.removeData("jstree-is-loading")}this.clean_node(i);if(e){e.call(this)}}else{if(i===-1||!i){if(h.correct_state){this.get_container().children("ul").empty();if(e){e.call(this)}}}else{i.children("a.jstree-loading").removeClass("jstree-loading");i.removeData("jstree-is-loading");if(h.correct_state){this.correct_state(i);if(e){e.call(this)}}}}};h.ajax.context=this;h.ajax.error=f;h.ajax.success=j;if(!h.ajax.dataType){h.ajax.dataType="json"}if(d.isFunction(h.ajax.url)){h.ajax.url=h.ajax.url.call(this,i)}if(d.isFunction(h.ajax.data)){h.ajax.data=h.ajax.data.call(this,i)}d.ajax(h.ajax);break}},_parse_json:function(e,k,q){var m=false,f=this._get_settings(),u=f.json_data,r=f.core.html_titles,l,h,g,o,n;if(!e){return m}if(u.progressive_unload&&k&&k!==-1){k.data("jstree-children",m)}if(d.isArray(e)){m=d();if(!e.length){return false}for(h=0,g=e.length;h<g;h++){l=this._parse_json(e[h],k,true);if(l.length){m=m.add(l)}}}else{if(typeof e=="string"){e={data:e}}if(!e.data&&e.data!==""){return m}m=d("<li />");if(e.attr){m.attr(e.attr)}if(e.metadata){m.data(e.metadata)}if(e.state){m.addClass("jstree-"+e.state)}if(!d.isArray(e.data)){l=e.data;e.data=[];e.data.push(l)}d.each(e.data,function(p,j){l=d("<a />");if(d.isFunction(j)){j=j.call(this,e)}if(typeof j=="string"){l.attr("href","#")[r?"html":"text"](j)}else{if(!j.attr){j.attr={}}if(!j.attr.href){j.attr.href="#"}l.attr(j.attr)[r?"html":"text"](j.title);if(j.language){l.addClass(j.language)}}l.prepend("<ins class='jstree-icon'>&#160;</ins>");if(!j.icon&&e.icon){j.icon=e.icon}if(j.icon){if(j.icon.indexOf("/")===-1){l.children("ins").addClass(j.icon)}else{l.children("ins").css("background","url('"+j.icon+"') center center no-repeat")}}m.append(l)});m.prepend("<ins class='jstree-icon'>&#160;</ins>");if(e.children){if(u.progressive_render&&e.state!=="open"){m.addClass("jstree-closed").data("jstree-children",e.children)}else{if(u.progressive_unload){m.data("jstree-children",e.children)}if(d.isArray(e.children)&&e.children.length){l=this._parse_json(e.children,k,true);if(l.length){n=d("<ul />");n.append(l);m.append(n)}}}}}if(!q){o=d("<ul />");o.append(m);m=o}return m},get_json:function(j,g,e,n){var q=[],p=this._get_settings(),k=this,i,h,m,l,o,f;j=this._get_node(j);if(!j||j===-1){j=this.get_container().find("> ul > li")}g=d.isArray(g)?g:["id","class"];if(!n&&this.data.types){g.push(p.types.type_attr)}e=d.isArray(e)?e:[];j.each(function(){m=d(this);i={data:[]};if(g.length){i.attr={}}d.each(g,function(s,r){h=m.attr(r);if(h&&h.length&&h.replace(/jstree[^ ]*/ig,"").length){i.attr[r]=(" "+h).replace(/ jstree[^ ]*/ig,"").replace(/\s+$/ig," ").replace(/^ /,"").replace(/ $/,"")}});if(m.hasClass("jstree-open")){i.state="open"}if(m.hasClass("jstree-closed")){i.state="closed"}if(m.data()){i.metadata=m.data()}l=m.children("a");l.each(function(){o=d(this);if(e.length||d.inArray("languages",p.plugins)!==-1||o.children("ins").get(0).style.backgroundImage.length||(o.children("ins").get(0).className&&o.children("ins").get(0).className.replace(/jstree[^ ]*|$/ig,"").length)){f=false;if(d.inArray("languages",p.plugins)!==-1&&d.isArray(p.languages)&&p.languages.length){d.each(p.languages,function(r,s){if(o.hasClass(s)){f=s;return false}})}h={attr:{},title:k.get_text(o,f)};d.each(e,function(r,s){h.attr[s]=(" "+(o.attr(s)||"")).replace(/ jstree[^ ]*/ig,"").replace(/\s+$/ig," ").replace(/^ /,"").replace(/ $/,"")});if(d.inArray("languages",p.plugins)!==-1&&d.isArray(p.languages)&&p.languages.length){d.each(p.languages,function(r,s){if(o.hasClass(s)){h.language=s;return true}})}if(o.children("ins").get(0).className.replace(/jstree[^ ]*|$/ig,"").replace(/^\s+$/ig,"").length){h.icon=o.children("ins").get(0).className.replace(/jstree[^ ]*|$/ig,"").replace(/\s+$/ig," ").replace(/^ /,"").replace(/ $/,"")}if(o.children("ins").get(0).style.backgroundImage.length){h.icon=o.children("ins").get(0).style.backgroundImage.replace("url(","").replace(")","")}}else{h=k.get_text(o)}if(l.length>1){i.data.push(h)}else{i.data=h}});m=m.find("> ul > li");if(m.length){i.children=k.get_json(m,g,e,true)}q.push(i)});return q}}})})(jQuery);(function(j){var f=false,d=false,g=false,h=false,k=false,e=false,n=false,l=false,i=false;j.vakata.dnd={is_down:false,is_drag:false,helper:false,scroll_spd:10,init_x:0,init_y:0,threshold:5,helper_left:5,helper_top:10,user_data:{},drag_start:function(q,p,m){if(j.vakata.dnd.is_drag){j.vakata.drag_stop({})}try{q.currentTarget.unselectable="on";q.currentTarget.onselectstart=function(){return false};if(q.currentTarget.style){q.currentTarget.style.MozUserSelect="none"}}catch(o){}j.vakata.dnd.init_x=q.pageX;j.vakata.dnd.init_y=q.pageY;j.vakata.dnd.user_data=p;j.vakata.dnd.is_down=true;j.vakata.dnd.helper=j("<div id='vakata-dragged' />").html(m);j(document).bind("mousemove",j.vakata.dnd.drag);j(document).bind("mouseup",j.vakata.dnd.drag_stop);return false},drag:function(p){if(!j.vakata.dnd.is_down){return}if(!j.vakata.dnd.is_drag){if(Math.abs(p.pageX-j.vakata.dnd.init_x)>5||Math.abs(p.pageY-j.vakata.dnd.init_y)>5){j.vakata.dnd.helper.appendTo("body");j.vakata.dnd.is_drag=true;j(document).triggerHandler("drag_start.vakata",{event:p,data:j.vakata.dnd.user_data})}else{return}}if(p.type==="mousemove"){var q=j(document),o=q.scrollTop(),m=q.scrollLeft();if(p.pageY-o<20){if(e&&n==="down"){clearInterval(e);e=false}if(!e){n="up";e=setInterval(function(){j(document).scrollTop(j(document).scrollTop()-j.vakata.dnd.scroll_spd)},150)}}else{if(e&&n==="up"){clearInterval(e);e=false}}if(j(window).height()-(p.pageY-o)<20){if(e&&n==="up"){clearInterval(e);e=false}if(!e){n="down";e=setInterval(function(){j(document).scrollTop(j(document).scrollTop()+j.vakata.dnd.scroll_spd)},150)}}else{if(e&&n==="down"){clearInterval(e);e=false}}if(p.pageX-m<20){if(k&&l==="right"){clearInterval(k);k=false}if(!k){l="left";k=setInterval(function(){j(document).scrollLeft(j(document).scrollLeft()-j.vakata.dnd.scroll_spd)},150)}}else{if(k&&l==="left"){clearInterval(k);k=false}}if(j(window).width()-(p.pageX-m)<20){if(k&&l==="left"){clearInterval(k);k=false}if(!k){l="right";k=setInterval(function(){j(document).scrollLeft(j(document).scrollLeft()+j.vakata.dnd.scroll_spd)},150)}}else{if(k&&l==="right"){clearInterval(k);k=false}}}j.vakata.dnd.helper.css({left:(p.pageX+j.vakata.dnd.helper_left)+"px",top:(p.pageY+j.vakata.dnd.helper_top)+"px"});j(document).triggerHandler("drag.vakata",{event:p,data:j.vakata.dnd.user_data})},drag_stop:function(m){if(k){clearInterval(k)}if(e){clearInterval(e)}j(document).unbind("mousemove",j.vakata.dnd.drag);j(document).unbind("mouseup",j.vakata.dnd.drag_stop);j(document).triggerHandler("drag_stop.vakata",{event:m,data:j.vakata.dnd.user_data});j.vakata.dnd.helper.remove();j.vakata.dnd.init_x=0;j.vakata.dnd.init_y=0;j.vakata.dnd.user_data={};j.vakata.dnd.is_down=false;j.vakata.dnd.is_drag=false}};j(function(){var m="#vakata-dragged { display:block; margin:0 0 0 0; padding:4px 4px 4px 24px; position:absolute; top:-2000px; line-height:16px; z-index:10000; } ";j.vakata.css.add_sheet({str:m,title:"vakata"})});j.jstree.plugin("dnd",{__init:function(){this.data.dnd={active:false,after:false,inside:false,before:false,off:false,prepared:false,w:0,to1:false,to2:false,cof:false,cw:false,ch:false,i1:false,i2:false,mto:false};this.get_container().bind("mouseenter.jstree",j.proxy(function(q){if(j.vakata.dnd.is_drag&&j.vakata.dnd.user_data.jstree){if(this.data.themes){g.attr("class","jstree-"+this.data.themes.theme);if(h){h.attr("class","jstree-"+this.data.themes.theme)}j.vakata.dnd.helper.attr("class","jstree-dnd-helper jstree-"+this.data.themes.theme)}if(q.currentTarget===q.target&&j.vakata.dnd.user_data.obj&&j(j.vakata.dnd.user_data.obj).length&&j(j.vakata.dnd.user_data.obj).parents(".jstree:eq(0)")[0]!==q.target){var p=j.jstree._reference(q.target),o;if(p.data.dnd.foreign){o=p._get_settings().dnd.drag_check.call(this,{o:f,r:p.get_container(),is_root:true});if(o===true||o.inside===true||o.before===true||o.after===true){j.vakata.dnd.helper.children("ins").attr("class","jstree-ok")}}else{p.prepare_move(f,p.get_container(),"last");if(p.check_move()){j.vakata.dnd.helper.children("ins").attr("class","jstree-ok")}}}}},this)).bind("mouseup.jstree",j.proxy(function(q){if(j.vakata.dnd.is_drag&&j.vakata.dnd.user_data.jstree&&q.currentTarget===q.target&&j.vakata.dnd.user_data.obj&&j(j.vakata.dnd.user_data.obj).length&&j(j.vakata.dnd.user_data.obj).parents(".jstree:eq(0)")[0]!==q.target){var p=j.jstree._reference(q.currentTarget),o;if(p.data.dnd.foreign){o=p._get_settings().dnd.drag_check.call(this,{o:f,r:p.get_container(),is_root:true});if(o===true||o.inside===true||o.before===true||o.after===true){p._get_settings().dnd.drag_finish.call(this,{o:f,r:p.get_container(),is_root:true})}}else{p.move_node(f,p.get_container(),"last",q[p._get_settings().dnd.copy_modifier+"Key"])}}},this)).bind("mouseleave.jstree",j.proxy(function(o){if(o.relatedTarget&&o.relatedTarget.id&&o.relatedTarget.id==="jstree-marker-line"){return false}if(j.vakata.dnd.is_drag&&j.vakata.dnd.user_data.jstree){if(this.data.dnd.i1){clearInterval(this.data.dnd.i1)}if(this.data.dnd.i2){clearInterval(this.data.dnd.i2)}if(this.data.dnd.to1){clearTimeout(this.data.dnd.to1)}if(this.data.dnd.to2){clearTimeout(this.data.dnd.to2)}if(j.vakata.dnd.helper.children("ins").hasClass("jstree-ok")){j.vakata.dnd.helper.children("ins").attr("class","jstree-invalid")}}},this)).bind("mousemove.jstree",j.proxy(function(p){if(j.vakata.dnd.is_drag&&j.vakata.dnd.user_data.jstree){var o=this.get_container()[0];if(p.pageX+24>this.data.dnd.cof.left+this.data.dnd.cw){if(this.data.dnd.i1){clearInterval(this.data.dnd.i1)}this.data.dnd.i1=setInterval(j.proxy(function(){this.scrollLeft+=j.vakata.dnd.scroll_spd},o),100)}else{if(p.pageX-24<this.data.dnd.cof.left){if(this.data.dnd.i1){clearInterval(this.data.dnd.i1)}this.data.dnd.i1=setInterval(j.proxy(function(){this.scrollLeft-=j.vakata.dnd.scroll_spd},o),100)}else{if(this.data.dnd.i1){clearInterval(this.data.dnd.i1)}}}if(p.pageY+24>this.data.dnd.cof.top+this.data.dnd.ch){if(this.data.dnd.i2){clearInterval(this.data.dnd.i2)}this.data.dnd.i2=setInterval(j.proxy(function(){this.scrollTop+=j.vakata.dnd.scroll_spd},o),100)}else{if(p.pageY-24<this.data.dnd.cof.top){if(this.data.dnd.i2){clearInterval(this.data.dnd.i2)}this.data.dnd.i2=setInterval(j.proxy(function(){this.scrollTop-=j.vakata.dnd.scroll_spd},o),100)}else{if(this.data.dnd.i2){clearInterval(this.data.dnd.i2)}}}}},this)).bind("scroll.jstree",j.proxy(function(o){if(j.vakata.dnd.is_drag&&j.vakata.dnd.user_data.jstree&&g&&h){g.hide();h.hide()}},this)).delegate("a","mousedown.jstree",j.proxy(function(o){if(o.which===1){this.start_drag(o.currentTarget,o);return false}},this)).delegate("a","mouseenter.jstree",j.proxy(function(o){if(j.vakata.dnd.is_drag&&j.vakata.dnd.user_data.jstree){this.dnd_enter(o.currentTarget)}},this)).delegate("a","mousemove.jstree",j.proxy(function(o){if(j.vakata.dnd.is_drag&&j.vakata.dnd.user_data.jstree){if(!d||!d.length||d.children("a")[0]!==o.currentTarget){this.dnd_enter(o.currentTarget)}if(typeof this.data.dnd.off.top==="undefined"){this.data.dnd.off=j(o.target).offset()}this.data.dnd.w=(o.pageY-(this.data.dnd.off.top||0))%this.data.core.li_height;if(this.data.dnd.w<0){this.data.dnd.w+=this.data.core.li_height}this.dnd_show()}},this)).delegate("a","mouseleave.jstree",j.proxy(function(o){if(j.vakata.dnd.is_drag&&j.vakata.dnd.user_data.jstree){if(o.relatedTarget&&o.relatedTarget.id&&o.relatedTarget.id==="jstree-marker-line"){return false}if(g){g.hide()}if(h){h.hide()}this.data.dnd.mto=setTimeout((function(p){return function(){p.dnd_leave(o)}})(this),0)}},this)).delegate("a","mouseup.jstree",j.proxy(function(o){if(j.vakata.dnd.is_drag&&j.vakata.dnd.user_data.jstree){this.dnd_finish(o)}},this));j(document).bind("drag_stop.vakata",j.proxy(function(){if(this.data.dnd.to1){clearTimeout(this.data.dnd.to1)}if(this.data.dnd.to2){clearTimeout(this.data.dnd.to2)}if(this.data.dnd.i1){clearInterval(this.data.dnd.i1)}if(this.data.dnd.i2){clearInterval(this.data.dnd.i2)}this.data.dnd.after=false;this.data.dnd.before=false;this.data.dnd.inside=false;this.data.dnd.off=false;this.data.dnd.prepared=false;this.data.dnd.w=false;this.data.dnd.to1=false;this.data.dnd.to2=false;this.data.dnd.i1=false;this.data.dnd.i2=false;this.data.dnd.active=false;this.data.dnd.foreign=false;if(g){g.css({top:"-2000px"})}if(h){h.css({top:"-2000px"})}},this)).bind("drag_start.vakata",j.proxy(function(q,o){if(o.data.jstree){var p=j(o.event.target);if(p.closest(".jstree").hasClass("jstree-"+this.get_index())){this.dnd_enter(p)}}},this));var m=this._get_settings().dnd;if(m.drag_target){j(document).delegate(m.drag_target,"mousedown.jstree-"+this.get_index(),j.proxy(function(p){f=p.target;j.vakata.dnd.drag_start(p,{jstree:true,obj:p.target},"<ins class='jstree-icon'></ins>"+j(p.target).text());if(this.data.themes){if(g){g.attr("class","jstree-"+this.data.themes.theme)}if(h){h.attr("class","jstree-"+this.data.themes.theme)}j.vakata.dnd.helper.attr("class","jstree-dnd-helper jstree-"+this.data.themes.theme)}j.vakata.dnd.helper.children("ins").attr("class","jstree-invalid");var o=this.get_container();this.data.dnd.cof=o.offset();this.data.dnd.cw=parseInt(o.width(),10);this.data.dnd.ch=parseInt(o.height(),10);this.data.dnd.foreign=true;p.preventDefault()},this))}if(m.drop_target){j(document).delegate(m.drop_target,"mouseenter.jstree-"+this.get_index(),j.proxy(function(o){if(this.data.dnd.active&&this._get_settings().dnd.drop_check.call(this,{o:f,r:j(o.target),e:o})){j.vakata.dnd.helper.children("ins").attr("class","jstree-ok")}},this)).delegate(m.drop_target,"mouseleave.jstree-"+this.get_index(),j.proxy(function(o){if(this.data.dnd.active){j.vakata.dnd.helper.children("ins").attr("class","jstree-invalid")}},this)).delegate(m.drop_target,"mouseup.jstree-"+this.get_index(),j.proxy(function(o){if(this.data.dnd.active&&j.vakata.dnd.helper.children("ins").hasClass("jstree-ok")){this._get_settings().dnd.drop_finish.call(this,{o:f,r:j(o.target),e:o})}},this))}},defaults:{copy_modifier:"ctrl",check_timeout:100,open_timeout:500,drop_target:".jstree-drop",drop_check:function(m){return true},drop_finish:j.noop,drag_target:".jstree-draggable",drag_finish:j.noop,drag_check:function(m){return{after:false,before:false,inside:true}}},_fn:{dnd_prepare:function(){if(!d||!d.length){return}this.data.dnd.off=d.offset();if(this._get_settings().core.rtl){this.data.dnd.off.right=this.data.dnd.off.left+d.width()}if(this.data.dnd.foreign){var m=this._get_settings().dnd.drag_check.call(this,{o:f,r:d});this.data.dnd.after=m.after;this.data.dnd.before=m.before;this.data.dnd.inside=m.inside;this.data.dnd.prepared=true;return this.dnd_show()}this.prepare_move(f,d,"before");this.data.dnd.before=this.check_move();this.prepare_move(f,d,"after");this.data.dnd.after=this.check_move();if(this._is_loaded(d)){this.prepare_move(f,d,"inside");this.data.dnd.inside=this.check_move()}else{this.data.dnd.inside=false}this.data.dnd.prepared=true;return this.dnd_show()},dnd_show:function(){if(!this.data.dnd.prepared){return}var q=["before","inside","after"],m=false,p=this._get_settings().core.rtl,s;if(this.data.dnd.w<this.data.core.li_height/3){q=["before","inside","after"]}else{if(this.data.dnd.w<=this.data.core.li_height*2/3){q=this.data.dnd.w<this.data.core.li_height/2?["inside","before","after"]:["inside","after","before"]}else{q=["after","inside","before"]}}j.each(q,j.proxy(function(o,r){if(this.data.dnd[r]){j.vakata.dnd.helper.children("ins").attr("class","jstree-ok");m=r;return false}},this));if(m===false){j.vakata.dnd.helper.children("ins").attr("class","jstree-invalid")}s=p?(this.data.dnd.off.right-18):(this.data.dnd.off.left+10);switch(m){case"before":g.css({left:s+"px",top:(this.data.dnd.off.top-6)+"px"}).show();if(h){h.css({left:(s+8)+"px",top:(this.data.dnd.off.top-1)+"px"}).show()}break;case"after":g.css({left:s+"px",top:(this.data.dnd.off.top+this.data.core.li_height-6)+"px"}).show();if(h){h.css({left:(s+8)+"px",top:(this.data.dnd.off.top+this.data.core.li_height-1)+"px"}).show()}break;case"inside":g.css({left:s+(p?-4:4)+"px",top:(this.data.dnd.off.top+this.data.core.li_height/2-5)+"px"}).show();if(h){h.hide()}break;default:g.hide();if(h){h.hide()}break}i=m;return m},dnd_open:function(){this.data.dnd.to2=false;this.open_node(d,j.proxy(this.dnd_prepare,this),true)},dnd_finish:function(m){if(this.data.dnd.foreign){if(this.data.dnd.after||this.data.dnd.before||this.data.dnd.inside){this._get_settings().dnd.drag_finish.call(this,{o:f,r:d,p:i})}}else{this.dnd_prepare();this.move_node(f,d,i,m[this._get_settings().dnd.copy_modifier+"Key"])}f=false;d=false;g.hide();if(h){h.hide()}},dnd_enter:function(o){if(this.data.dnd.mto){clearTimeout(this.data.dnd.mto);this.data.dnd.mto=false}var m=this._get_settings().dnd;this.data.dnd.prepared=false;d=this._get_node(o);if(m.check_timeout){if(this.data.dnd.to1){clearTimeout(this.data.dnd.to1)}this.data.dnd.to1=setTimeout(j.proxy(this.dnd_prepare,this),m.check_timeout)}else{this.dnd_prepare()}if(m.open_timeout){if(this.data.dnd.to2){clearTimeout(this.data.dnd.to2)}if(d&&d.length&&d.hasClass("jstree-closed")){this.data.dnd.to2=setTimeout(j.proxy(this.dnd_open,this),m.open_timeout)}}else{if(d&&d.length&&d.hasClass("jstree-closed")){this.dnd_open()}}},dnd_leave:function(m){this.data.dnd.after=false;this.data.dnd.before=false;this.data.dnd.inside=false;j.vakata.dnd.helper.children("ins").attr("class","jstree-invalid");g.hide();if(h){h.hide()}if(d&&d[0]===m.target.parentNode){if(this.data.dnd.to1){clearTimeout(this.data.dnd.to1);this.data.dnd.to1=false}if(this.data.dnd.to2){clearTimeout(this.data.dnd.to2);this.data.dnd.to2=false}}},start_drag:function(q,p){f=this._get_node(q);if(this.data.ui&&this.is_selected(f)){f=this._get_node(null,true)}var o=f.length>1?this._get_string("multiple_selection"):this.get_text(f),m=this.get_container();if(!this._get_settings().core.html_titles){o=o.replace(/</ig,"&lt;").replace(/>/ig,"&gt;")}j.vakata.dnd.drag_start(p,{jstree:true,obj:f},"<ins class='jstree-icon'></ins>"+o);if(this.data.themes){if(g){g.attr("class","jstree-"+this.data.themes.theme)}if(h){h.attr("class","jstree-"+this.data.themes.theme)}j.vakata.dnd.helper.attr("class","jstree-dnd-helper jstree-"+this.data.themes.theme)}this.data.dnd.cof=m.offset();this.data.dnd.cw=parseInt(m.width(),10);this.data.dnd.ch=parseInt(m.height(),10);this.data.dnd.active=true}}});j(function(){var m="#vakata-dragged ins { display:block; text-decoration:none; width:16px; height:16px; margin:0 0 0 0; padding:0; position:absolute; top:4px; left:4px;  -moz-border-radius:4px; border-radius:4px; -webkit-border-radius:4px; } #vakata-dragged .jstree-ok { background:green; } #vakata-dragged .jstree-invalid { background:red; } #jstree-marker { padding:0; margin:0; font-size:12px; overflow:hidden; height:12px; width:8px; position:absolute; top:-30px; z-index:10001; background-repeat:no-repeat; display:none; background-color:transparent; text-shadow:1px 1px 1px white; color:black; line-height:10px; } #jstree-marker-line { padding:0; margin:0; line-height:0%; font-size:1px; overflow:hidden; height:1px; width:100px; position:absolute; top:-30px; z-index:10000; background-repeat:no-repeat; display:none; background-color:#456c43;  cursor:pointer; border:1px solid #eeeeee; border-left:0; -moz-box-shadow: 0px 0px 2px #666; -webkit-box-shadow: 0px 0px 2px #666; box-shadow: 0px 0px 2px #666;  -moz-border-radius:1px; border-radius:1px; -webkit-border-radius:1px; }";j.vakata.css.add_sheet({str:m,title:"jstree"});g=j("<div />").attr({id:"jstree-marker"}).hide().html("&raquo;").bind("mouseleave mouseenter",function(o){g.hide();h.hide();o.preventDefault();o.stopImmediatePropagation();return false}).appendTo("body");h=j("<div />").attr({id:"jstree-marker-line"}).hide().bind("mouseup",function(o){if(d&&d.length){d.children("a").trigger(o);o.preventDefault();o.stopImmediatePropagation();return false}}).bind("mouseleave",function(p){var o=j(p.relatedTarget);if(o.is(".jstree")||o.closest(".jstree").length===0){if(d&&d.length){d.children("a").trigger(p);g.hide();h.hide();p.preventDefault();p.stopImmediatePropagation();return false}}}).appendTo("body");j(document).bind("drag_start.vakata",function(p,o){if(o.data.jstree){g.show();if(h){h.show()}}});j(document).bind("drag_stop.vakata",function(p,o){if(o.data.jstree){g.hide();if(h){h.hide()}}})})})(jQuery);(function(d){d.vakata.context={hide_on_mouseleave:false,cnt:d("<div id='vakata-contextmenu' />"),vis:false,tgt:false,par:false,func:false,data:false,rtl:false,show:function(o,n,l,j,i,e,k){d.vakata.context.rtl=!!k;var g=d.vakata.context.parse(o),f,m;if(!g){return}d.vakata.context.vis=true;d.vakata.context.tgt=n;d.vakata.context.par=e||n||null;d.vakata.context.data=i||null;d.vakata.context.cnt.html(g).css({visibility:"hidden",display:"block",left:0,top:0});if(d.vakata.context.hide_on_mouseleave){d.vakata.context.cnt.one("mouseleave",function(h){d.vakata.context.hide()})}f=d.vakata.context.cnt.height();m=d.vakata.context.cnt.width();if(l+m>d(document).width()){l=d(document).width()-(m+5);d.vakata.context.cnt.find("li > ul").addClass("right")}if(j+f>d(document).height()){j=j-(f+n[0].offsetHeight);d.vakata.context.cnt.find("li > ul").addClass("bottom")}d.vakata.context.cnt.css({left:l,top:j}).find("li:has(ul)").bind("mouseenter",function(s){var p=d(document).width(),r=d(document).height(),q=d(this).children("ul").show();if(p!==d(document).width()){q.toggleClass("right")}if(r!==d(document).height()){q.toggleClass("bottom")}}).bind("mouseleave",function(h){d(this).children("ul").hide()}).end().css({visibility:"visible"}).show();d(document).triggerHandler("context_show.vakata")},hide:function(){d.vakata.context.vis=false;d.vakata.context.cnt.attr("class","").css({visibility:"hidden"});d(document).triggerHandler("context_hide.vakata")},parse:function(h,g){if(!h){return false}var i="",f=false,e=true;if(!g){d.vakata.context.func={}}i+="<ul>";d.each(h,function(j,k){if(!k){return true}d.vakata.context.func[j]=k.action;if(!e&&k.separator_before){i+="<li class='vakata-separator vakata-separator-before'></li>"}e=false;i+="<li class='"+(k._class||"")+(k._disabled?" jstree-contextmenu-disabled ":"")+"'><ins ";if(k.icon&&k.icon.indexOf("/")===-1){i+=" class='"+k.icon+"' "}if(k.icon&&k.icon.indexOf("/")!==-1){i+=" style='background:url("+k.icon+") center center no-repeat;' "}i+=">&#160;</ins><a href='#' rel='"+j+"'>";if(k.submenu){i+="<span style='float:"+(d.vakata.context.rtl?"left":"right")+";'>&raquo;</span>"}i+=k.label+"</a>";if(k.submenu){f=d.vakata.context.parse(k.submenu,true);if(f){i+=f}}i+="</li>";if(k.separator_after){i+="<li class='vakata-separator vakata-separator-after'></li>";e=true}});i=i.replace(/<li class\='vakata-separator vakata-separator-after'\><\/li\>$/,"");i+="</ul>";d(document).triggerHandler("context_parse.vakata");return i.length>10?i:false},exec:function(e){if(d.isFunction(d.vakata.context.func[e])){d.vakata.context.func[e].call(d.vakata.context.data,d.vakata.context.par);return true}else{return false}}};d(function(){var e="#vakata-contextmenu { display:block; visibility:hidden; left:0; top:-200px; position:absolute; margin:0; padding:0; min-width:180px; background:#ebebeb; border:1px solid silver; z-index:10000; *width:180px; } #vakata-contextmenu ul { min-width:180px; *width:180px; } #vakata-contextmenu ul, #vakata-contextmenu li { margin:0; padding:0; list-style-type:none; display:block; } #vakata-contextmenu li { line-height:20px; min-height:20px; position:relative; padding:0px; } #vakata-contextmenu li a { padding:1px 6px; line-height:17px; display:block; text-decoration:none; margin:1px 1px 0 1px; } #vakata-contextmenu li ins { float:left; width:16px; height:16px; text-decoration:none; margin-right:2px; } #vakata-contextmenu li a:hover, #vakata-contextmenu li.vakata-hover > a { background:gray; color:white; } #vakata-contextmenu li ul { display:none; position:absolute; top:-2px; left:100%; background:#ebebeb; border:1px solid gray; } #vakata-contextmenu .right { right:100%; left:auto; } #vakata-contextmenu .bottom { bottom:-1px; top:auto; } #vakata-contextmenu li.vakata-separator { min-height:0; height:1px; line-height:1px; font-size:1px; overflow:hidden; margin:0 2px; background:silver; /* border-top:1px solid #fefefe; */ padding:0; } ";d.vakata.css.add_sheet({str:e,title:"vakata"});d.vakata.context.cnt.delegate("a","click",function(f){f.preventDefault()}).delegate("a","mouseup",function(f){if(!d(this).parent().hasClass("jstree-contextmenu-disabled")&&d.vakata.context.exec(d(this).attr("rel"))){d.vakata.context.hide()}else{d(this).blur()}}).delegate("a","mouseover",function(){d.vakata.context.cnt.find(".vakata-hover").removeClass("vakata-hover")}).appendTo("body");d(document).bind("mousedown",function(f){if(d.vakata.context.vis&&!d.contains(d.vakata.context.cnt[0],f.target)){d.vakata.context.hide()}});if(typeof d.hotkeys!=="undefined"){d(document).bind("keydown","up",function(f){if(d.vakata.context.vis){var g=d.vakata.context.cnt.find("ul:visible").last().children(".vakata-hover").removeClass("vakata-hover").prevAll("li:not(.vakata-separator)").first();if(!g.length){g=d.vakata.context.cnt.find("ul:visible").last().children("li:not(.vakata-separator)").last()}g.addClass("vakata-hover");f.stopImmediatePropagation();f.preventDefault()}}).bind("keydown","down",function(f){if(d.vakata.context.vis){var g=d.vakata.context.cnt.find("ul:visible").last().children(".vakata-hover").removeClass("vakata-hover").nextAll("li:not(.vakata-separator)").first();if(!g.length){g=d.vakata.context.cnt.find("ul:visible").last().children("li:not(.vakata-separator)").first()}g.addClass("vakata-hover");f.stopImmediatePropagation();f.preventDefault()}}).bind("keydown","right",function(f){if(d.vakata.context.vis){d.vakata.context.cnt.find(".vakata-hover").children("ul").show().children("li:not(.vakata-separator)").removeClass("vakata-hover").first().addClass("vakata-hover");f.stopImmediatePropagation();f.preventDefault()}}).bind("keydown","left",function(f){if(d.vakata.context.vis){d.vakata.context.cnt.find(".vakata-hover").children("ul").hide().children(".vakata-separator").removeClass("vakata-hover");f.stopImmediatePropagation();f.preventDefault()}}).bind("keydown","esc",function(f){d.vakata.context.hide();f.preventDefault()}).bind("keydown","space",function(f){d.vakata.context.cnt.find(".vakata-hover").last().children("a").click();f.preventDefault()})}});d.jstree.plugin("contextmenu",{__init:function(){this.get_container().delegate("a","contextmenu.jstree",d.proxy(function(f){f.preventDefault();if(!d(f.currentTarget).hasClass("jstree-loading")){this.show_contextmenu(f.currentTarget,f.pageX,f.pageY)}},this)).delegate("a","click.jstree",d.proxy(function(f){if(this.data.contextmenu){d.vakata.context.hide()}},this)).bind("destroy.jstree",d.proxy(function(){if(this.data.contextmenu){d.vakata.context.hide()}},this));d(document).bind("context_hide.vakata",d.proxy(function(){this.data.contextmenu=false},this))},defaults:{select_node:false,show_at_node:true,items:{create:{separator_before:false,separator_after:true,label:"Create",action:function(e){this.create(e)}},rename:{separator_before:false,separator_after:false,label:"Rename",action:function(e){this.rename(e)}},remove:{separator_before:false,icon:false,separator_after:false,label:"Delete",action:function(e){if(this.is_selected(e)){this.remove()}else{this.remove(e)}}},ccp:{separator_before:true,icon:false,separator_after:false,label:"Edit",action:false,submenu:{cut:{separator_before:false,separator_after:false,label:"Cut",action:function(e){this.cut(e)}},copy:{separator_before:false,icon:false,separator_after:false,label:"Copy",action:function(e){this.copy(e)}},paste:{separator_before:false,icon:false,separator_after:false,label:"Paste",action:function(e){this.paste(e)}}}}}},_fn:{show_contextmenu:function(j,e,l){j=this._get_node(j);var h=this.get_settings().contextmenu,f=j.children("a:visible:eq(0)"),k=false,g=false;if(h.select_node&&this.data.ui&&!this.is_selected(j)){this.deselect_all();this.select_node(j,true)}if(h.show_at_node||typeof e==="undefined"||typeof l==="undefined"){k=f.offset();e=k.left;l=k.top+this.data.core.li_height}g=j.data("jstree")&&j.data("jstree").contextmenu?j.data("jstree").contextmenu:h.items;if(d.isFunction(g)){g=g.call(this,j)}this.data.contextmenu=true;d.vakata.context.show(g,f,e,l,this,j,this._get_settings().core.rtl);if(this.data.themes){d.vakata.context.cnt.attr("class","jstree-"+this.data.themes.theme+"-context")}}}})})(jQuery)})();(function(b){function a(d){this.input=d;if(d.attr("type")=="password"){this.handlePassword()}b(d[0].form).submit(function(){if(d.hasClass("placeholder")&&d[0].value==d.attr("placeholder")){d[0].value=""}})}a.prototype={show:function(f){if(this.input[0].value===""||(f&&this.valueIsPlaceholder())){if(this.isPassword){try{this.input[0].setAttribute("type","text")}catch(d){this.input.before(this.fakePassword.show()).hide()}}this.input.addClass("placeholder");this.input[0].value=this.input.attr("placeholder")}},hide:function(){if(this.valueIsPlaceholder()&&this.input.hasClass("placeholder")){this.input.removeClass("placeholder");this.input[0].value="";if(this.isPassword){try{this.input[0].setAttribute("type","password")}catch(d){}this.input.show();this.input[0].focus()}}},valueIsPlaceholder:function(){return this.input[0].value==this.input.attr("placeholder")},handlePassword:function(){var d=this.input;d.attr("realType","password");this.isPassword=true;if(b.browser.msie&&d[0].outerHTML){var e=b(d[0].outerHTML.replace(/type=(['"])?password\1/gi,"type=$1text$1"));this.fakePassword=e.val(d.attr("placeholder")).addClass("placeholder").focus(function(){d.trigger("focus");b(this).hide()});b(d[0].form).submit(function(){e.remove();d.show()})}}};var c=!!("placeholder" in document.createElement("input"));b.fn.placeholder=function(){return c?this:this.each(function(){var d=b(this);var e=new a(d);e.show(true);d.focus(function(){e.hide()});d.blur(function(){e.show(false)});if(b.browser.msie){b(window).load(function(){if(d.val()){d.removeClass("placeholder")}e.show(true)});d.focus(function(){if(this.value==""){var f=this.createTextRange();f.collapse(true);f.moveStart("character",0);f.select()}})}})}})(jQuery);(function(d,c){d.widget("compilr.tabs",d.ui.tabs,{options:{autoplay:false,autoplayClickStop:false,autoplayInterval:4000,autoHeight:false,autoHeightTime:0,buttonsFunction:"slide",classBtnDisabled:"ui-state-disabled",btnNext:".ui-tabs-next",btnPrev:".ui-tabs-prev",classExtLink:"st_ext",classTab:".ui-tab",classTabActive:["st-tabs-selected"],tabsContainer:".ui-tabs-container",classTabsList:"ui-tabs-nav",panelsContainer:".ui-panels",classViewActive:"st-active-view",viewContainer:".ui-panels-container",contentAnim:"slideH",contentAnimTime:600,contentEasing:"easeInOutExpo",offsetBR:0,offsetTL:0,orientation:"horizontal",scrollable:false,tabSaveState:false,tabsAnimTime:300,tabsEasing:"",tabsScroll:true,tabsSlideLength:0,totalHeight:"",totalWidth:"auto",urlLinking:true},_tabify:function(a){var f=this,e=f.options;d.ui.tabs.prototype._tabify.apply(this,arguments);if(e.scrollable&&a){d.extend(f,{animated:"#"+f.element.attr("id")+" ."+e.classTabsList+":animated",tab:[],activeTab:[],li:[],lastElem:[],view:[],activeView:[],val:{},margin:0});f.tabsCont=f.element.find(e.tabsContainer);f.tabsInnerCont=f.tabsCont.children("div").first();f.contentCont=f.element.find(e.viewContainer);f.content=f.contentCont.find(e.panelsContainer);f.prev=f.element.find(e.btnPrev).click(function(){f[e.buttonsFunction+"Prev"]();return false});f.next=f.element.find(e.btnNext).click(function(){f[e.buttonsFunction+"Next"]();return false});f.tabsInnerCont.css("overflow","hidden");f.val={func:"outerWidth",obj:"left",attr:"marginLeft"};if(e.totalWidth.length>0){f.resize("width")}if(e.totalHeight.length>0){f.resize("height")}f.setSlideLength();f.posActive();f.bind()}},resize:function(f){var e=this,h=e.options;switch(f){case"width":if(h.totalWidth=="auto"){e.element.css("width","100%")}else{e.element.css("width",h.totalWidth+"px")}break;case"height":var g=e.contentCont.outerHeight(true)-e.contentCont.height();e.contentCont.css("height",h.totalHeight-(e.tabsCont.outerHeight(true)+g)+"px");break}},setAutoWidth:function(){var h=this,g=h.options;if(!h.lis.length){return}h.val.tabsSlideLength=h.tabsInnerCont.width();h.lastElem=h.lis.last();var l=h.lastElem.outerWidth(true)+h.lastElem.position().left,k=h.tabsCont.outerWidth(true),j=h.prev.outerWidth(true)+h.next.outerWidth(true);if(l>k){h.tabsCont.addClass("st-sliding-active");h.val.tabsSlideLength=h.tabsInnerCont.width();h.initButtons();h.showButtons()}else{if(-+h.margin<0+g.offsetBR){if(l<h.tabsInnerCont.width()){var i=h.val.tabsSlideLength-l;h.margin=h.margin-i;if(h.margin+1<j+g.offsetBR){h.margin=0+g.offsetBR;h.hideButtons();h.val.tabsSlideLength=k}h.initButtons()}else{if(l<=k-h.margin){h.margin=0+g.offsetBR;h.hideButtons();h.val.tabsSlideLength=k}}h.list.animate({marginLeft:-+h.margin},150)}else{if(h.margin==0+g.offsetBR&&l<=k){h.hideButtons();h.val.tabsSlideLength=k}}}},bind:function(){var a=this,h=a.options;if(h.totalWidth=="auto"){var g=null;var f=function(){a.setAutoWidth();if(a.lis.length>1){a.tab=a.lis.filter(".ui-tabs-selected").find("a");a.li=a.tab.closest("li");a.setActive();a.val.elemP=a.li.position();a.val.activeElemP=a.activeTab.position();a.val.hash=a.getHash(a.tab);a.slideClicked()}};d(window).resize(f);a.element.on("tabsadd",f);a.element.on("tabsremove",f)}a.element.on("tabsselect",function(j,i){a.tab=d(i.tab);a.li=a.tab.closest("li");var b="."+h.classTabActive.join(",.");if(a.li.is(b)){return false}a.setActive();a.val.elemP=a.li.position();a.val.activeElemP=a.activeTab.position();a.val.hash=a.getHash(a.tab);a.slideClicked()});if(d.fn.mousewheel&&h.tabsScroll==true){a.list.mousewheel(function(b,e){e>0?a.slidePrev():a.slideNext();return false})}d("a."+h.classExtLink).each(function(){if(d(this).attr("rel")==a.element.attr("id")){d(this).click(function(){var b=a.findByRel(d(this).attr("href").slice(1));b.trigger("click");return false})}})},setSlideLength:function(){var b=this.options;this.val.tabsSlideLength=b.tabsSlideLength==0?this.tabsInnerCont.width():b.tabsSlideLength},posActive:function(){var f=this,e=f.options,h=f.val,g=f.margin;f.getActive();f.lastElem=f.list.children("li:last");f.tab=f.activeTab;f.activeTab=f.activeTab.parents("li");if(f.lastElem[h.func](true)+f.lastElem.position()[h.obj]>h.tabsSlideLength){f.tabsCont.addClass("st-sliding-active");f.setSlideLength();h.elemD=f.activeTab[h.func](true);h.elemP=f.activeTab.position()[h.obj];if(h.elemP>h.tabsSlideLength){g+=h.elemD+(h.elemP-h.tabsSlideLength);g=g+e.offsetBR}else{if(h.elemP+h.elemD>h.tabsSlideLength){g+=h.elemD-(h.tabsSlideLength-h.elemP);g=g+e.offsetBR}else{g=g-e.offsetTL}}f.list.css(h.attr,-+g);f.margin=g;f.initButtons();f.showButtons()}},find:function(b){return this.tab.parents("li")[b]().find("a")},findByRel:function(b){return this.list.find("[rel="+b+"]")},getHash:function(b){this.val.hash=this.tab.attr("hash");if(this.val.hash){return this.val.hash}else{return this.tab.prop("hash")}},getActive:function(){var a=this,f=a.options;if(f.urlLinking==true&&location.hash){a.activeTab=this.findByRel(location.hash.slice(1))}if(!a.activeTab.length){if(d.cookie){var e=d.cookie(a.element.attr("id"))}if(e){a.removeActive();a.activeTab=a.lis.find("a").eq(e);a.li=a.activeTab.closest("li").addClass(f.classTabActive.join(" "))}else{a.activeTab=a.list.find("li."+f.classTabActive.join(".")+" a");if(!a.activeTab.length){a.activeTab=a.list.find("a:first");a.activeTab.closest("li").addClass(f.classTabActive.join(" "))}}}else{a.removeActive();a.activeTab.closest("li").addClass(f.classTabActive.join(" "))}a.saveActive(a.activeTab)},removeActive:function(){this.list.find("li."+this.options.classTabActive.join(".")).removeClass(this.options.classTabActive.join(" "))},setActive:function(){var f=this,e=this.options;f.activeTab=f.list.find("li."+e.classTabActive.join(".")).removeClass(e.classTabActive.join(" "));f.tab.closest("li").addClass(e.classTabActive.join(" "));f.saveActive(f.tab)},saveActive:function(a){if(this.options.tabSaveState==true){d.cookie(this.element.attr("id"),a.parents("li").index())}},initButtons:function(){var f=this,e=f.options;if(e.buttonsFunction=="slide"){if(f.list.children("li:first").position()[f.val.obj]==0+e.offsetTL){f.disableButton(f.prev)}else{f.enableButton(f.prev)}if(f.lastElem.position()[f.val.obj]+f.lastElem[f.val.func](true)<=f.val.tabsSlideLength-e.offsetBR){f.disableButton(f.next)}else{f.enableButton(f.next)}}else{f.setButtonState()}},enableButton:function(b){b.removeClass(this.options.classBtnDisabled)},disableButton:function(b){b.addClass(this.options.classBtnDisabled)},showButtons:function(){this.prev.show();this.next.show()},hideButtons:function(){this.tabsCont.removeClass("st-sliding-active");this.prev.hide();this.next.hide()},setButtonState:function(f){var e=this,g=e.options;if(g.buttonsFunction=="click"){e.li=e.tab.parents("li")}if(e.li.is(":first-child")){e.disableButton(e.prev);e.enableButton(e.next)}else{if(e.li.is(":last-child")){e.disableButton(e.next);e.enableButton(e.prev)}else{if(f){e.enableButton(f)}else{if(g.buttonsFunction=="click"){e.enableButton(e.prev);e.enableButton(e.next)}}}}},slideClicked:function(){var f=this,e=f.options,h=f.val,g=f.margin;h.elemP=h.elemP[h.obj];h.elemD=f.li[h.func](true);h.nextElemPos=f.li.next().length==1?f.li.next().position()[h.obj]:0;if(h.elemP<0+e.offsetTL){h.elemHidden=h.elemD-h.nextElemPos;g=g-(h.elemHidden+e.offsetTL);f.enableButton(f.next)}else{if(h.elemD+h.elemP>h.tabsSlideLength-e.offsetBR){g+=h.elemD-(h.tabsSlideLength-(h.elemP+e.offsetBR));f.enableButton(f.prev)}}f.margin=g;f.animate();f.setButtonState()},slidePrev:function(){var a=this,f=a.options,e=a.val;if(d(a.animated).length){return false}a.list.children("li").each(function(){a.li=d(this);e.elemP=a.li.position()[e.obj];if(a.val.elemP>=-1+f.offsetTL){e.elemHidden=a.li.prev()[e.func](true)-e.elemP;a.margin=a.margin-e.elemHidden-f.offsetTL;a.li=a.li.prev();a.animate();a.setButtonState(a.next);return false}})},slideNext:function(){var a=this,f=a.options,e=a.val;if(d(a.animated).length){return false}a.list.children("li").each(function(){a.li=d(this);e.elemD=a.li[e.func](true);e.elemP=a.li.position()[e.obj];if(e.elemD+e.elemP>e.tabsSlideLength-f.offsetBR){e.elemHidden=e.tabsSlideLength-e.elemP;a.margin+=e.elemD-e.elemHidden+f.offsetBR;a.animate();a.setButtonState(a.prev);return false}})},animate:function(){var f=this,e=f.options;f.list.animate({marginLeft:-+f.margin},e.tabsAnimTime,e.tabsEasing)},refresh:function(){var a=this;d("ul:first li",a.element).each(function(e){var f=d(d("a:first",this).attr("href"));f.parent().append(f)});return a._tabify()},add:function(p,o,n){if(n===c){n=this.anchors.length}var m=this,l=m.options,k=d(l.tabTemplate.replace(/#\{href\}/g,p).replace(/#\{label\}/g,o)),b=!p.indexOf("#")?p.replace("#",""):m._tabId(d("a",k)[0]);k.addClass("ui-state-default ui-corner-top").data("destroy.tabs",true);var a=m.element.find("#"+b);if(!a.length){a=d(l.panelTemplate).attr("id",b).data("destroy.tabs",true)}a.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom ui-tabs-hide");if(n>=m.lis.length){k.appendTo(m.list);a.appendTo(l.panelContainer?m.element.find(l.panelContainer):m.list[0].parentNode)}else{k.insertBefore(m.lis[n]);a.insertBefore(m.panels[n])}l.disabled=d.map(l.disabled,function(f,e){return f>=n?++f:f});m._tabify();if(this.anchors.length==1){l.selected=0;k.addClass("ui-tabs-selected ui-state-active");a.removeClass("ui-tabs-hide");m.element.queue("tabs",function(){m._trigger("show",null,m._ui(m.anchors[0],m.panels[0]))});m.load(0)}m._trigger("add",null,m._ui(m.anchors[n],m.panels[n]));return this}});d.compilr.tabs.options=d.extend({},d.ui.tabs.prototype.options)})(jQuery);(function(a){a.extend(a.fn,{validate:function(d){if(this.length){var c=a.data(this[0],"validator");if(c){return c}this.attr("novalidate","novalidate");c=new a.validator(d,this[0]);a.data(this[0],"validator",c);if(c.settings.onsubmit){d=this.find("input, button");d.filter(".cancel").click(function(){c.cancelSubmit=true});c.settings.submitHandler&&d.filter(":submit").click(function(){c.submitButton=this});this.submit(function(f){function b(){if(c.settings.submitHandler){if(c.submitButton){var e=a("<input type='hidden'/>").attr("name",c.submitButton.name).val(c.submitButton.value).appendTo(c.currentForm)}c.settings.submitHandler.call(c,c.currentForm);c.submitButton&&e.remove();return false}return true}c.settings.debug&&f.preventDefault();if(c.cancelSubmit){c.cancelSubmit=false;return b()}if(c.form()){if(c.pendingRequest){c.formSubmitted=true;return false}return b()}else{c.focusInvalid();return false}})}return c}else{d&&d.debug&&window.console&&console.warn("nothing selected, can't validate, returning nothing")}},valid:function(){if(a(this[0]).is("form")){return this.validate().form()}else{var d=true,c=a(this[0].form).validate();this.each(function(){d&=c.element(this)});return d}},removeAttrs:function(e){var c={},f=this;a.each(e.split(/\s/),function(d,b){c[b]=f.attr(b);f.removeAttr(b)});return c},rules:function(i,c){var n=this[0];if(i){var m=a.data(n.form,"validator").settings,l=m.rules,k=a.validator.staticRules(n);switch(i){case"add":a.extend(k,a.validator.normalizeRule(c));l[n.name]=k;if(c.messages){m.messages[n.name]=a.extend(m.messages[n.name],c.messages)}break;case"remove":if(!c){delete l[n.name];return k}var j={};a.each(c.split(/\s/),function(b,d){j[d]=k[d];delete k[d]});return j}}n=a.validator.normalizeRules(a.extend({},a.validator.metadataRules(n),a.validator.classRules(n),a.validator.attributeRules(n),a.validator.staticRules(n)),n);if(n.required){m=n.required;delete n.required;n=a.extend({required:m},n)}return n}});a.extend(a.expr[":"],{blank:function(b){return !a.trim(""+b.value)},filled:function(b){return !!a.trim(""+b.value)},unchecked:function(b){return !b.checked}});a.validator=function(d,c){this.settings=a.extend(true,{},a.validator.defaults,d);this.currentForm=c;this.init()};a.validator.format=function(d,c){if(arguments.length==1){return function(){var b=a.makeArray(arguments);b.unshift(d);return a.validator.format.apply(this,b)}}if(arguments.length>2&&c.constructor!=Array){c=a.makeArray(arguments).slice(1)}if(c.constructor!=Array){c=[c]}a.each(c,function(f,b){d=d.replace(RegExp("\\{"+f+"\\}","g"),b)});return d};a.extend(a.validator,{defaults:{messages:{},groups:{},rules:{},errorClass:"error",validClass:"valid",errorElement:"label",focusInvalid:true,errorContainer:a([]),errorLabelContainer:a([]),onsubmit:true,ignore:":hidden",ignoreTitle:false,onfocusin:function(b){this.lastActive=b;if(this.settings.focusCleanup&&!this.blockFocusCleanup){this.settings.unhighlight&&this.settings.unhighlight.call(this,b,this.settings.errorClass,this.settings.validClass);this.addWrapper(this.errorsFor(b)).hide()}},onfocusout:function(b){if(!this.checkable(b)&&(b.name in this.submitted||!this.optional(b))){this.element(b)}},onkeyup:function(b){if(b.name in this.submitted||b==this.lastElement){this.element(b)}},onclick:function(b){if(b.name in this.submitted){this.element(b)}else{b.parentNode.name in this.submitted&&this.element(b.parentNode)}},highlight:function(e,c,f){e.type==="radio"?this.findByName(e.name).addClass(c).removeClass(f):a(e).addClass(c).removeClass(f)},unhighlight:function(e,c,f){e.type==="radio"?this.findByName(e.name).removeClass(c).addClass(f):a(e).removeClass(c).addClass(f)}},setDefaults:function(b){a.extend(a.validator.defaults,b)},messages:{required:"This field is required.",remote:"Please fix this field.",email:"Please enter a valid email address.",url:"Please enter a valid URL.",date:"Please enter a valid date.",dateISO:"Please enter a valid date (ISO).",number:"Please enter a valid number.",digits:"Please enter only digits.",creditcard:"Please enter a valid credit card number.",equalTo:"Please enter the same value again.",accept:"Please enter a value with a valid extension.",maxlength:a.validator.format("Please enter no more than {0} characters."),minlength:a.validator.format("Please enter at least {0} characters."),rangelength:a.validator.format("Please enter a value between {0} and {1} characters long."),range:a.validator.format("Please enter a value between {0} and {1}."),max:a.validator.format("Please enter a value less than or equal to {0}."),min:a.validator.format("Please enter a value greater than or equal to {0}.")},autoCreateRanges:false,prototype:{init:function(){function e(h){var d=a.data(this[0].form,"validator"),b="on"+h.type.replace(/^validate/,"");d.settings[b]&&d.settings[b].call(d,this[0],h)}this.labelContainer=a(this.settings.errorLabelContainer);this.errorContext=this.labelContainer.length&&this.labelContainer||a(this.currentForm);this.containers=a(this.settings.errorContainer).add(this.settings.errorLabelContainer);this.submitted={};this.valueCache={};this.pendingRequest=0;this.pending={};this.invalid={};this.reset();var c=this.groups={};a.each(this.settings.groups,function(d,b){a.each(b.split(/\s/),function(j,i){c[i]=d})});var f=this.settings.rules;a.each(f,function(d,b){f[d]=a.validator.normalizeRule(b)});a(this.currentForm).validateDelegate("[type='text'], [type='password'], [type='file'], select, textarea, [type='number'], [type='search'] ,[type='tel'], [type='url'], [type='email'], [type='datetime'], [type='date'], [type='month'], [type='week'], [type='time'], [type='datetime-local'], [type='range'], [type='color'] ","focusin focusout keyup",e).validateDelegate("[type='radio'], [type='checkbox'], select, option","click",e);this.settings.invalidHandler&&a(this.currentForm).bind("invalid-form.validate",this.settings.invalidHandler)},form:function(){this.checkForm();a.extend(this.submitted,this.errorMap);this.invalid=a.extend({},this.errorMap);this.valid()||a(this.currentForm).triggerHandler("invalid-form",[this]);this.showErrors();return this.valid()},checkForm:function(){this.prepareForm();for(var d=0,c=this.currentElements=this.elements();c[d];d++){this.check(c[d])}return this.valid()},element:function(d){this.lastElement=d=this.validationTargetFor(this.clean(d));this.prepareElement(d);this.currentElements=a(d);var c=this.check(d);if(c){delete this.invalid[d.name]}else{this.invalid[d.name]=true}if(!this.numberOfInvalids()){this.toHide=this.toHide.add(this.containers)}this.showErrors();return c},showErrors:function(d){if(d){a.extend(this.errorMap,d);this.errorList=[];for(var c in d){this.errorList.push({message:d[c],element:this.findByName(c)[0]})}this.successList=a.grep(this.successList,function(b){return !(b.name in d)})}this.settings.showErrors?this.settings.showErrors.call(this,this.errorMap,this.errorList):this.defaultShowErrors()},resetForm:function(){a.fn.resetForm&&a(this.currentForm).resetForm();this.submitted={};this.lastElement=null;this.prepareForm();this.hideErrors();this.elements().removeClass(this.settings.errorClass)},numberOfInvalids:function(){return this.objectLength(this.invalid)},objectLength:function(e){var c=0,f;for(f in e){c++}return c},hideErrors:function(){this.addWrapper(this.toHide).hide()},valid:function(){return this.size()==0},size:function(){return this.errorList.length},focusInvalid:function(){if(this.settings.focusInvalid){try{a(this.findLastActive()||this.errorList.length&&this.errorList[0].element||[]).filter(":visible").focus().trigger("focusin")}catch(b){}}},findLastActive:function(){var b=this.lastActive;return b&&a.grep(this.errorList,function(c){return c.element.name==b.name}).length==1&&b},elements:function(){var d=this,c={};return a(this.currentForm).find("input, select, textarea").not(":submit, :reset, :image, [disabled]").not(this.settings.ignore).filter(function(){!this.name&&d.settings.debug&&window.console&&console.error("%o has no name assigned",this);if(this.name in c||!d.objectLength(a(this).rules())){return false}return c[this.name]=true})},clean:function(b){return a(b)[0]},errors:function(){return a(this.settings.errorElement+"."+this.settings.errorClass,this.errorContext)},reset:function(){this.successList=[];this.errorList=[];this.errorMap={};this.toShow=a([]);this.toHide=a([]);this.currentElements=a([])},prepareForm:function(){this.reset();this.toHide=this.errors().add(this.containers)},prepareElement:function(b){this.reset();this.toHide=this.errorsFor(b)},check:function(i){i=this.validationTargetFor(this.clean(i));var c=a(i).rules(),n=false,m;for(m in c){var l={method:m,parameters:c[m]};try{var k=a.validator.methods[m].call(this,i.value.replace(/\r/g,""),i,l.parameters);if(k=="dependency-mismatch"){n=true}else{n=false;if(k=="pending"){this.toHide=this.toHide.not(this.errorsFor(i));return}if(!k){this.formatAndAdd(i,l);return false}}}catch(j){this.settings.debug&&window.console&&console.log("exception occured when checking element "+i.id+", check the '"+l.method+"' method",j);throw j}}if(!n){this.objectLength(c)&&this.successList.push(i);return true}},customMetaMessage:function(e,c){if(a.metadata){var f=this.settings.meta?a(e).metadata()[this.settings.meta]:a(e).metadata();return f&&f.messages&&f.messages[c]}},customMessage:function(e,c){var f=this.settings.messages[e];return f&&(f.constructor==String?f:f[c])},findDefined:function(){for(var b=0;b<arguments.length;b++){if(arguments[b]!==undefined){return arguments[b]}}},defaultMessage:function(d,c){return this.findDefined(this.customMessage(d.name,c),this.customMetaMessage(d,c),!this.settings.ignoreTitle&&d.title||undefined,a.validator.messages[c],"<strong>Warning: No message defined for "+d.name+"</strong>")},formatAndAdd:function(f,c){var h=this.defaultMessage(f,c.method),g=/\$?\{(\d+)\}/g;if(typeof h=="function"){h=h.call(this,c.parameters,f)}else{if(g.test(h)){h=jQuery.format(h.replace(g,"{$1}"),c.parameters)}}this.errorList.push({message:h,element:f});this.errorMap[f.name]=h;this.submitted[f.name]=h},addWrapper:function(b){if(this.settings.wrapper){b=b.add(b.parent(this.settings.wrapper))}return b},defaultShowErrors:function(){for(var d=0;this.errorList[d];d++){var c=this.errorList[d];this.settings.highlight&&this.settings.highlight.call(this,c.element,this.settings.errorClass,this.settings.validClass);this.showLabel(c.element,c.message)}if(this.errorList.length){this.toShow=this.toShow.add(this.containers)}if(this.settings.success){for(d=0;this.successList[d];d++){this.showLabel(this.successList[d])}}if(this.settings.unhighlight){d=0;for(c=this.validElements();c[d];d++){this.settings.unhighlight.call(this,c[d],this.settings.errorClass,this.settings.validClass)}}this.toHide=this.toHide.not(this.toShow);this.hideErrors();this.addWrapper(this.toShow).show()},validElements:function(){return this.currentElements.not(this.invalidElements())},invalidElements:function(){return a(this.errorList).map(function(){return this.element})},showLabel:function(e,c){var f=this.errorsFor(e);if(f.length){f.removeClass(this.settings.validClass).addClass(this.settings.errorClass);f.attr("generated")&&f.html(c)}else{f=a("<"+this.settings.errorElement+"/>").attr({"for":this.idOrName(e),generated:true}).addClass(this.settings.errorClass).html(c||"");if(this.settings.wrapper){f=f.hide().show().wrap("<"+this.settings.wrapper+"/>").parent()}this.labelContainer.append(f).length||(this.settings.errorPlacement?this.settings.errorPlacement(f,a(e)):f.insertAfter(e))}if(!c&&this.settings.success){f.text("");typeof this.settings.success=="string"?f.addClass(this.settings.success):this.settings.success(f)}this.toShow=this.toShow.add(f)},errorsFor:function(d){var c=this.idOrName(d);return this.errors().filter(function(){return a(this).attr("for")==c})},idOrName:function(b){return this.groups[b.name]||(this.checkable(b)?b.name:b.id||b.name)},validationTargetFor:function(b){if(this.checkable(b)){b=this.findByName(b.name).not(this.settings.ignore)[0]}return b},checkable:function(b){return/radio|checkbox/i.test(b.type)},findByName:function(d){var c=this.currentForm;return a(document.getElementsByName(d)).map(function(f,b){return b.form==c&&b.name==d&&b||null})},getLength:function(d,c){switch(c.nodeName.toLowerCase()){case"select":return a("option:selected",c).length;case"input":if(this.checkable(c)){return this.findByName(c.name).filter(":checked").length}}return d.length},depend:function(d,c){return this.dependTypes[typeof d]?this.dependTypes[typeof d](d,c):true},dependTypes:{"boolean":function(b){return b},string:function(d,c){return !!a(d,c.form).length},"function":function(d,c){return d(c)}},optional:function(b){return !a.validator.methods.required.call(this,a.trim(b.value),b)&&"dependency-mismatch"},startRequest:function(b){if(!this.pending[b.name]){this.pendingRequest++;this.pending[b.name]=true}},stopRequest:function(d,c){this.pendingRequest--;if(this.pendingRequest<0){this.pendingRequest=0}delete this.pending[d.name];if(c&&this.pendingRequest==0&&this.formSubmitted&&this.form()){a(this.currentForm).submit();this.formSubmitted=false}else{if(!c&&this.pendingRequest==0&&this.formSubmitted){a(this.currentForm).triggerHandler("invalid-form",[this]);this.formSubmitted=false}}},previousValue:function(b){return a.data(b,"previousValue")||a.data(b,"previousValue",{old:null,valid:true,message:this.defaultMessage(b,"remote")})}},classRuleSettings:{required:{required:true},email:{email:true},url:{url:true},date:{date:true},dateISO:{dateISO:true},dateDE:{dateDE:true},number:{number:true},numberDE:{numberDE:true},digits:{digits:true},creditcard:{creditcard:true}},addClassRules:function(d,c){d.constructor==String?this.classRuleSettings[d]=c:a.extend(this.classRuleSettings,d)},classRules:function(d){var c={};(d=a(d).attr("class"))&&a.each(d.split(" "),function(){this in a.validator.classRuleSettings&&a.extend(c,a.validator.classRuleSettings[this])});return c},attributeRules:function(f){var c={};f=a(f);for(var h in a.validator.methods){var g;if(g=h==="required"&&typeof a.fn.prop==="function"?f.prop(h):f.attr(h)){c[h]=g}else{if(f[0].getAttribute("type")===h){c[h]=true}}}c.maxlength&&/-1|2147483647|524288/.test(c.maxlength)&&delete c.maxlength;return c},metadataRules:function(d){if(!a.metadata){return{}}var c=a.data(d.form,"validator").settings.meta;return c?a(d).metadata()[c]:a(d).metadata()},staticRules:function(e){var c={},f=a.data(e.form,"validator");if(f.settings.rules){c=a.validator.normalizeRule(f.settings.rules[e.name])||{}}return c},normalizeRules:function(d,c){a.each(d,function(h,g){if(g===false){delete d[h]}else{if(g.param||g.depends){var b=true;switch(typeof g.depends){case"string":b=!!a(g.depends,c.form).length;break;case"function":b=g.depends.call(c,c)}if(b){d[h]=g.param!==undefined?g.param:true}else{delete d[h]}}}});a.each(d,function(f,b){d[f]=a.isFunction(b)?b(c):b});a.each(["minlength","maxlength","min","max"],function(){if(d[this]){d[this]=Number(d[this])}});a.each(["rangelength","range"],function(){if(d[this]){d[this]=[Number(d[this][0]),Number(d[this][1])]}});if(a.validator.autoCreateRanges){if(d.min&&d.max){d.range=[d.min,d.max];delete d.min;delete d.max}if(d.minlength&&d.maxlength){d.rangelength=[d.minlength,d.maxlength];delete d.minlength;delete d.maxlength}}d.messages&&delete d.messages;return d},normalizeRule:function(d){if(typeof d=="string"){var c={};a.each(d.split(/\s/),function(){c[this]=true});d=c}return d},addMethod:function(e,c,f){a.validator.methods[e]=c;a.validator.messages[e]=f!=undefined?f:a.validator.messages[e];c.length<3&&a.validator.addClassRules(e,a.validator.normalizeRule(e))},methods:{required:function(e,c,f){if(!this.depend(f,c)){return"dependency-mismatch"}switch(c.nodeName.toLowerCase()){case"select":return(e=a(c).val())&&e.length>0;case"input":if(this.checkable(c)){return this.getLength(e,c)>0}default:return a.trim(e).length>0}},remote:function(h,c,l){if(this.optional(c)){return"dependency-mismatch"}var k=this.previousValue(c);this.settings.messages[c.name]||(this.settings.messages[c.name]={});k.originalMessage=this.settings.messages[c.name].remote;this.settings.messages[c.name].remote=k.message;l=typeof l=="string"&&{url:l}||l;if(this.pending[c.name]){return"pending"}if(k.old===h){return k.valid}k.old=h;var j=this;this.startRequest(c);var i={};i[c.name]=h;a.ajax(a.extend(true,{url:l,mode:"abort",port:"validate"+c.name,dataType:"json",data:i,success:function(e){j.settings.messages[c.name].remote=k.originalMessage;var b=e===true;if(b){var d=j.formSubmitted;j.prepareElement(c);j.formSubmitted=d;j.successList.push(c);j.showErrors()}else{d={};e=e||j.defaultMessage(c,"remote");d[c.name]=k.message=a.isFunction(e)?e(h):e;j.showErrors(d)}k.valid=b;j.stopRequest(c,b)}},l));return"pending"},minlength:function(e,c,f){return this.optional(c)||this.getLength(a.trim(e),c)>=f},maxlength:function(e,c,f){return this.optional(c)||this.getLength(a.trim(e),c)<=f},rangelength:function(e,c,f){e=this.getLength(a.trim(e),c);return this.optional(c)||e>=f[0]&&e<=f[1]},min:function(e,c,f){return this.optional(c)||e>=f},max:function(e,c,f){return this.optional(c)||e<=f},range:function(e,c,f){return this.optional(c)||e>=f[0]&&e<=f[1]},email:function(d,c){return this.optional(c)||/^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))$/i.test(d)},url:function(d,c){return this.optional(c)||/^(https?|ftp):\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i.test(d)},date:function(d,c){return this.optional(c)||!/Invalid|NaN/.test(new Date(d))},dateISO:function(d,c){return this.optional(c)||/^\d{4}[\/-]\d{1,2}[\/-]\d{1,2}$/.test(d)},number:function(d,c){return this.optional(c)||/^-?(?:\d+|\d{1,3}(?:,\d{3})+)(?:\.\d+)?$/.test(d)},digits:function(d,c){return this.optional(c)||/^\d+$/.test(d)},creditcard:function(h,c){if(this.optional(c)){return"dependency-mismatch"}if(/[^0-9 -]+/.test(h)){return false}var l=0,k=0,j=false;h=h.replace(/\D/g,"");for(var i=h.length-1;i>=0;i--){k=h.charAt(i);k=parseInt(k,10);if(j){if((k*=2)>9){k-=9}}l+=k;j=!j}return l%10==0},accept:function(e,c,f){f=typeof f=="string"?f.replace(/,/g,"|"):"png|jpe?g|gif";return this.optional(c)||e.match(RegExp(".("+f+")$","i"))},equalTo:function(e,c,f){f=a(f).unbind(".validate-equalTo").bind("blur.validate-equalTo",function(){a(c).valid()});return e==f.val()}}});a.format=a.validator.format})(jQuery);(function(f){var e={};if(f.ajaxPrefilter){f.ajaxPrefilter(function(c,b,a){b=c.port;if(c.mode=="abort"){e[b]&&e[b].abort();e[b]=a}})}else{var d=f.ajax;f.ajax=function(b){var a=("port" in b?b:f.ajaxSettings).port;if(("mode" in b?b:f.ajaxSettings).mode=="abort"){e[a]&&e[a].abort();return e[a]=d.apply(this,arguments)}return d.apply(this,arguments)}}})(jQuery);(function(a){!jQuery.event.special.focusin&&!jQuery.event.special.focusout&&document.addEventListener&&a.each({focus:"focusin",blur:"focusout"},function(e,c){function f(b){b=a.event.fix(b);b.type=c;return a.event.handle.call(this,b)}a.event.special[c]={setup:function(){this.addEventListener(e,f,true)},teardown:function(){this.removeEventListener(e,f,true)},handler:function(b){arguments[0]=a.event.fix(b);arguments[0].type=c;return a.event.handle.apply(this,arguments)}}});a.extend(a.fn,{validateDelegate:function(e,c,f){return this.bind(c,function(d){var b=a(d.target);if(b.is(e)){return f.apply(b,arguments)}})}})})(jQuery);(function addExtraValidatorMethods(b){var a=function(d,g,f){return this.optional(g)||f.test(d)},c="Invalid format.";b.validator.addMethod("pattern",a,c);b.validator.addMethod("pattern2",a,c);b.validator.addMethod("pattern3",a,c);b.validator.addMethod("pattern4",a,c);b.validator.addMethod("notEqualTo",function(d,h,g){var f=b(g).unbind(".validate-notEqualTo").bind("blur.validate-notEqualTo",function(){b(h).valid()});return d!=f.val()},"Please enter a different value.")})(jQuery);(function(a){a.fn.showpassword=function(b){var d=a(this);var c={classname:"show-password",markup:'<label><input type="checkbox" /></label>',parent:"",text:"Show Password"};return this.each(function(){var i=a.extend({},c,b);var h={classname:"class",name:"password-input",text:"Show Password"};var g="sp_"+parseInt(Math.random()*1000);var e=a(i.markup).attr({"class":i.classname}).append(i.text),f=e.find("input").attr({id:g}),j=a('<input type="text" value="" style="display: none;" />').addClass(i.classname+" hidden "+d.attr("class"));a(this).before(j);if(i.parent){e.appendTo(i.parent)}else{a(this).after(e)}f.click(function(){if(a(this).is(":checked")){j.val(d.val()).attr("id",d.attr("id")).attr("name",d.attr("name"));j.toggleClass("hidden visible").css("display","");d.hide().removeAttr("id").removeAttr("name")}else{d.val(j.val()).attr("id",j.attr("id")).attr("name",j.attr("name"));d.css("display","");j.toggleClass("hidden visible").hide().removeAttr("id").removeAttr("name")}});d.data("showpassword",this);return this})}})(jQuery);(function(b){b.widget("db.jWizard",{_stepIndex:0,_stepCount:0,_actualCount:0,_create:function(){this._buildSteps();this._buildTitle();if(this.options.menuEnable){this._buildMenu()}this._buildButtons();if(this.options.counter.enable){this._buildCounter()}this.element.addClass("ui-widget jw-widget");this.element.find(".ui-state-default").live("mouseover mouseout",function(a){if(a.type==="mouseover"){b(this).addClass("ui-state-hover")}else{b(this).removeClass("ui-state-hover")}});this._changeStep(this._stepIndex,true)},destroy:function(){this._destroySteps();this._destroyTitle();if(this.options.menuEnable){this._destroyMenu()}this._destroyButtons();if(this.options.counter.enable){this._destroyCounter()}this.element.removeClass("ui-widget");this.element.find(".ui-state-default").unbind("mouseover").unbind("mouseout");b.Widget.prototype.destroy.call(this)},disable:function(){this.element.addClass("ui-state-disabled").find("button").attr("disabled","disabled")},enable:function(){this.element.removeClass("ui-state-disabled").find("button").removeAttr("disabled")},_setOption:function(a,e){var f=a.split(".");if(f.length>1){switch(f[0]){case"buttons":this.options[f[0]][f[1]]=e;switch(f[1]){case"jqueryui":this.options[f[0]][f[1]][f[2]]=e;if(f[2]==="enable"){if(e){this.find(".jw-buttons > button").button("destroy")}else{this._destroyButtons();this._buildButtons()}break}break;case"cancelHide":this.element.find(".jw-button-cancel")[e?"addClass":"removeClass"]("ui-helper-hidden");break;case"cancelType":this.element.find(".jw-button-cancel").attr("type",e);break;case"finishType":this.element.find(".jw-button-finish").attr("type",e);break;case"cancelText":this.element.find(".jw-button-cancel").text(e);break;case"previousText":this.element.find(".jw-button-previous").text(e);break;case"nextText":this.element.find(".jw-button-next").text(e);break;case"finishText":this.element.find(".jw-button-finish").text(e);break}break;case"counter":this.options[f[0]][f[1]]=e;switch(f[1]){case"enable":if(e){this._buildCounter();this._updateCounter()}else{this._destroyCounter()}break;case"type":case"progressbar":case"location":if(this.options.counter.enable){this._destroyCounter();this._buildCounter();this._updateCounter()}break;case"startCount":case"startHide":case"finishCount":case"finishHide":case"appendText":case"orientText":if(this.options.counter.enable){this._updateCounter()}break}break;case"effects":if(f.length===2){this.options[f[0]][f[1]]=e}else{this.options[f[0]][f[1]][f[2]]=e}break}}else{this.options[f[0]]=e;switch(f[0]){case"titleHide":this.element.find(".jw-header")[e?"addClass":"removeClass"]("ui-helper-hidden");break;case"menuEnable":if(e){this._buildMenu();this._updateMenu()}else{this._destroyMenu()}break;case"counter":this._destroyCounter();this._buildCounter();this._updateCounter();break}}},firstStep:function(){this.changeStep(0,"first")},lastStep:function(){this.changeStep(this._stepCount-1,"last")},nextStep:function(){var a={wizard:this.element,currentStepIndex:this._stepIndex,nextStepIndex:this._stepIndex+1,delta:1};if(this._trigger("next",null,a)!==false){this.changeStep(this._stepIndex+1,"next")}},previousStep:function(){var a={wizard:this.element,currentStepIndex:this._stepIndex,nextStepIndex:this._stepIndex-1,delta:-1};if(this._trigger("previous",null,a)!==false){this.changeStep(this._stepIndex-1,"previous")}},changeStep:function(a,e){e=e||"manual";a=typeof a==="number"?a:b(a).index();var f={wizard:this.element,currentStepIndex:this._stepIndex,nextStepIndex:a,delta:a-this._stepIndex,type:e};if(this._trigger("changestep",null,f)!==false){this._changeStep(a)}},_effect:function(a,k,j,m,i){var l=this,n=this.options.effects[k][j];m=m||"effect";if(!a.length||!a.hasClass("jw-animated")){a[m]();if(i){i.call(this)}return false}n.callback=i||b.noop;a[m](n.type,n.options,n.duration,n.callback)},_log:function(){if(this.options.debug&&window.console){console.log[console.firebug?"apply":"call"](console,Array.prototype.slice.call(arguments))}},_updateNavigation:function(a){this._updateButtons();if(this.options.menuEnable){this._updateMenu(a)}if(this.options.counter.enable){this._updateCounter(a)}},_buildTitle:function(){this.element.prepend(b("<div />",{"class":"jw-header ui-widget-header ui-corner-top"+(this.options.titleHide?" ui-helper-hidden":""),html:'<h2 class="jw-title'+((this.options.effects.enable&&this.options.effects.title.enable)?" jw-animated":"")+'" />'}))},_updateTitle:function(g){var h=this,a=this.element.find(".jw-title"),f=this.element.find(".jw-step:eq("+this._stepIndex+")");if(!g){this._effect(a,"title","hide","hide",function(){a.text(f.attr("title"));h._effect(a,"title","show","show")})}else{a.text(f.attr("title"))}},_destroyTitle:function(){b(".jw-header").remove()},_buildSteps:function(){var a=this.element.children("div, fieldset");this._stepCount=a.length;a.addClass("jw-step").each(function(f){var e=b(this);if(this.tagName.toLowerCase()==="fieldset"){e.attr("title",e.find("legend").text())}});if(this.options.effects.enable&&this.options.effects.step.enable){a.addClass("jw-animated")}a.hide().wrapAll(b("<div />",{"class":"jw-content ui-widget-content ui-helper-clearfix",html:'<div class="jw-steps-wrap" />'})).eq(this._stepIndex).show()},_destroySteps:function(){b(".jw-step").show().unwrap().unwrap();b(".jw-step").unbind("show").unbind("hide").removeClass("jw-step")},_changeStep:function(a,i){var j=this,g=this.element.find(".jw-step"),h=g.eq(this._stepIndex);if(typeof a==="number"){if(a<0||a>(g.length-1)){alert("Index "+a+" Out of Range");return false}a=g.eq(a)}else{if(typeof a==="object"){if(!a.is(g.selector)){alert("Supplied Element is NOT one of the Wizard Steps");return false}}}if(!i){this._disableButtons();this._stepIndex=g.index(a);this._updateTitle(i);this._effect(h,"step","hide","hide",function(){j._effect(a,"step","show","show",function(){j._enableButtons();j._updateNavigation(i)})})}else{this._stepIndex=g.index(a);this._updateTitle(i);this._updateNavigation(i)}},_buildMenu:function(){var e=[],f,a;this.element.addClass("jw-hasmenu");this.element.find(".jw-step").each(function(c){e.push(b("<li />",{"class":"ui-corner-all "+(c===0?"jw-current ui-state-highlight":"jw-inactive ui-state-disabled"),html:b("<a />",{step:c,text:b(this).attr("title")})})[0])});f=b("<div />",{"class":"jw-menu-wrap",html:b("<div />",{"class":"jw-menu",html:b("<ol />",{html:b(e)})})});this.element.find(".jw-content").prepend(f);if(this.options.effects.enable&&this.options.effects.menu.enable){f.find("li").addClass("jw-animated")}f.find("a").click(b.proxy(function(c){var d=b(c.target),h=parseInt(d.attr("step"),10);if(d.parent().hasClass("jw-active")){this.changeStep(h,h<=this._stepIndex?"previous":"next")}},this))},_destroyMenu:function(){this.element.removeClass("jw-hasmenu").find(".jw-menu-wrap").remove()},_updateMenu:function(f){var g=this,a=this._stepIndex,h=this.element.find(".jw-menu");if(!f){this._effect(h.find("li:eq("+a+")"),"menu","change")}h.find("a").each(function(l){var e=b(this),c=e.parent(),k=parseInt(e.attr("step"),10),d="";if(k<a){d+="jw-active ui-state-default"}else{if(k===a){d+="jw-current ui-state-highlight"}else{if(k>a){d+="jw-inactive ui-state-disabled";e.removeAttr("href")}}}c.removeClass("jw-active jw-current jw-inactive ui-state-default ui-state-highlight ui-state-disabled").addClass(d)})},_buildCounter:function(){var a=b("<span />",{"class":"jw-counter ui-widget-content ui-corner-all jw-"+this.options.counter.orientText});if(this.options.counter.location==="header"){this.element.find(".jw-header").prepend(a)}else{if(this.options.counter.location==="footer"){this.element.find(".jw-footer").prepend(a)}}if(!this.options.counter.startCount){this._stepCount--}if(!this.options.counter.finishCount){this._stepCount--}if(this.options.effects.enable&&this.options.effects.counter.enable){a.addClass("jw-animated")}if(this.options.counter.progressbar){a.html('<span class="jw-counter-text" /> <span class="jw-counter-progressbar" />').find(".jw-counter-progressbar").progressbar()}},_updateCounter:function(k){var i=this.element.find(".jw-counter"),n=this.options.counter,l="",m=this._stepIndex,j=this._stepCount,a=0;if(!n.startCount){m--;j--}if(!k){this._effect(i,"counter","change")}a=Math.round((m/j)*100);if(n.type==="percentage"){l=((a<=100)?a:100)+"%"}else{if(n.type==="count"){if(m<0){l=0}else{if(m>j){l=j}else{l=m}}l+=" of "+j}else{l="N/A"}}if(n.appendText){l+=" "+n.appendText}if(n.progressbar){this.element.find(".jw-counter-progressbar").progressbar("option","value",a);this.element.find(".jw-counter-text").text(l)}else{i.text(l)}if((n.startHide&&this._stepIndex===0)||(n.finishHide&&this._stepIndex===(this._actualCount-1))){i.hide()}else{i.show()}},_destroyCounter:function(){this.element.find(".jw-counter").remove()},_buildButtons:function(){var m=this,l=this.options.buttons,n=b("<div />",{"class":"jw-footer ui-widget-footer ui-corner-bottom"}),i=b('<button type="'+l.cancelType+'" class="ui-state-default ui-corner-all jw-button-cancel jw-priority-secondary'+(l.cancelHide?" ui-helper-hidden":"")+'">'+l.cancelText+"</button>"),k=b('<button type="button" class="ui-state-default ui-corner-all jw-button-previous">'+l.previousText+"</button>"),a=b('<button type="button" class="ui-state-default ui-corner-all jw-button-next">'+l.nextText+"</button>"),j=b('<button type="'+l.finishType+'" class="ui-state-default ui-corner-all jw-button-finish ui-state-highlight">'+l.finishText+"</button>");i.click(function(c){m._trigger("cancel",c)});k.click(function(c){m.previousStep()});a.click(function(c){m.nextStep()});j.click(function(c){m._trigger("finish",c)});if(l.jqueryui.enable){i.button({icons:{primary:l.jqueryui.cancelIcon}});k.button({icons:{primary:l.jqueryui.previousIcon}});a.button({icons:{secondary:l.jqueryui.nextIcon}});j.button({icons:{secondary:l.jqueryui.finishIcon}})}this.element.append(n.append(b('<div class="jw-buttons" />').append(i).append(k).append(a).append(j)))},_updateButtons:function(){var f=this.element.find(".jw-step"),h=this.element.find(".jw-button-previous"),a=this.element.find(".jw-button-next"),g=this.element.find(".jw-button-finish");switch(f.index(f.filter(":visible"))){case -1:case 0:h.hide();a.show();g.hide();break;case f.length-1:h.show();a.hide();g.show();break;default:h.show();a.show();g.hide();break}},_disableButtons:function(){this.element.find(".jw-buttons button").addClass("ui-state-disabled").attr("disabled",true)},_enableButtons:function(){this.element.find(".jw-buttons button").removeClass("ui-state-disabled").attr("disabled",false)},_destroyButtons:function(){this.element.find(".jw-footer").remove()},options:{debug:false,disabled:false,titleHide:false,menuEnable:false,buttons:{jqueryui:{enable:false,cancelIcon:"ui-icon-circle-close",previousIcon:"ui-icon-circle-triangle-w",nextIcon:"ui-icon-circle-triangle-e",finishIcon:"ui-icon-circle-check"},cancelHide:false,cancelType:"button",finishType:"button",cancelText:"Cancel",previousText:"Previous",nextText:"Next",finishText:"Finish"},counter:{enable:false,type:"count",progressbar:false,location:"footer",startCount:true,startHide:false,finishCount:true,finishHide:false,appendText:"Complete",orientText:"left"},effects:{enable:false,step:{enable:false,hide:{type:"slide",options:{direction:"left"},duration:"normal"},show:{type:"slide",options:{direction:"left"},duration:"normal"}},title:{enable:false,hide:{type:"slide",duration:"normal"},show:{type:"slide",duration:"normal"}},menu:{enable:false,change:{type:"highlight",duration:"normal"}},counter:{enable:false,change:{type:"highlight",duration:"normal"}}},cancel:b.noop,previous:b.noop,next:b.noop,finish:b.noop,changestep:function(a,d){if(a.isDefaultPrevented()){if(typeof a.nextStepIndex!=="undefined"){d.wizard.jWizard("changeStep",a.nextStepIndex);return false}}}}})}(jQuery));(function(a){var b=function(c){return isNaN(c)?0:c};a.fn.leftBorderWidth=function(){var c=parseFloat(a(this).css("borderLeftWidth"));var d=parseFloat(a(this).css("padding-left"));var e=0;if(a(this).css("margin-left")!="auto"){e=parseFloat(a(this).css("margin-left"))}return b(c)+b(d)+b(e)};a.fn.rightBorderWidth=function(){var c=parseFloat(a(this).css("borderRightWidth"));var e=parseFloat(a(this).css("padding-right"));var d=0;if(a(this).css("margin-right")!="auto"){d=parseFloat(a(this).css("margin-right"))}return b(c)+b(e)+b(d)};a.fn.topBorderWidth=function(){var c=parseFloat(a(this).css("borderTopWidth"));var d=parseFloat(a(this).css("padding-top"));var e=0;if(a(this).css("margin-top")!="auto"){e=parseFloat(a(this).css("margin-top"))}return b(c)+b(d)+b(e)};a.fn.bottomBorderWidth=function(){var c=parseFloat(a(this).css("borderBottomWidth"));var e=parseFloat(a(this).css("padding-bottom"));var d=0;if(a(this).css("margin-bottom")!="auto"){d=parseFloat(a(this).css("margin-bottom"))}return b(c)+b(e)+b(d)};a.fn.borderSize=function(){var e=a(this).leftBorderWidth()+a(this).rightBorderWidth();var d=a(this).topBorderWidth()+a(this).bottomBorderWidth();var c={width:e,height:d};return c};a.fn.setOuterWidth=function(c){var d=a(this).leftBorderWidth()+a(this).rightBorderWidth();a(this).width(c-d);return this};a.fn.setOuterHeight=function(c){var d=a(this).topBorderWidth()+a(this).bottomBorderWidth();a(this).height(c-d);return this};a.fn.getWidget=function(){var c=this.data("widgetName");if(c&&c!=""){return this.data(c)}return null};a.fn.matchHeight=function(d){var c=0;this.each(function(){c=Math.max(c,a(this).outerHeight())});return this.each(function(){var f=a(this),e=d?f.find(d+":first"):a(this),f=e.height()+(c-f.outerHeight());e.css("min-height",f+"px")})}})(jQuery);(function(a){var c="ui-state-hover",b="compilr-dialog-defaultdockingzone";a.widget("compilr.dialog",a.ui.dialog,{options:{captionButtons:{},collapsingAnimation:null,expandingAnimation:null,contentUrl:"",minimizeZoneElementId:"",buttonCreating:null,stateChanged:null,blur:null},_create:function(){var d=this,e=d.options;a.ui.dialog.prototype._create.apply(d,arguments);d.uiDialog.addClass("compilr-dialog");d._initWindow();d._bindWindowResize();d._attachDraggableResizableEvent();d.originalPosition=d.options.position;d.isPin=false},_init:function(){var d=this,e=d.options;a.ui.dialog.prototype._init.apply(d,arguments);if(e.disabled){d.disable()}},_handleDisabledOption:function(e,f){var d=this;if(e){if(!d.disabledDiv){d.disabledDiv=d._createDisabledDiv()}d.disabledDiv.appendTo("body")}else{if(d.disabledDiv){d.disabledDiv.remove();d.disabledDiv=null}}},_createDisabledDiv:function(){var e=this,h=e.uiDialog,g=h.offset(),f=h.outerWidth(),d=h.outerHeight();return a("<div></div>").addClass("ui-disabled").css({"z-index":"99999",position:"absolute",width:f,height:d,left:g.left,top:g.top})},destroy:function(){var d=this;if(d.disabledDiv){d.disabledDiv.remove();d.disabledDiv=null}a.ui.dialog.prototype.destroy.apply(d,arguments)},_attachDraggableResizableEvent:function(){var e=this,d=e.uiDialog,f=e.options;if(f.draggable&&d.draggable){d.bind("dragstop",function(g,h){e._saveNormalState();e._destoryIframeMask()}).bind("dragstart",function(g,h){e._createIframeMask()})}if(f.resizable&&d.resizable){d.bind("resizestop",function(g,h){e._saveNormalState();e._destoryIframeMask()}).bind("resizestart",function(g,h){e._createIframeMask()})}},_createIframeMask:function(){var d=this;if(d.innerFrame){d.mask=a("<div style='width:100%;height:100%;position:absolute;top:0px;left:0px;z-index:"+(a.ui.dialog.maxZ+1)+"'></div>").appendTo(d.uiDialog)}},_destoryIframeMask:function(){var d=this;if(d.innerFrame&&d.mask){d.mask.remove();d.mask=undefined}},_initWindow:function(){var d=this,e=true;d._createCaptionButtons();d._checkUrl();d.uiDialogButtonPane=a(".ui-dialog-buttonpane",d.uiDialog);d.uiDialog.bind("mousedown",function(g){var f=g.target;if(!a.contains(d.element[0],f)){d.uiDialog.focus()}}).bind("mouseenter",function(f){e=true}).bind("mouseleave",function(f){e=false}).bind("focusout",function(h){var g=h.target,f=a(this);if(!e){d._trigger("blur",h,{el:d.element})}})},_checkUrl:function(){var d=this,g=d.options,e=g.contentUrl,f=a('<iframe style="width:100%;height:99%;" frameborder="0"></iframe>');if(typeof e==="string"&&e.length>0){d.element.addClass("compilr-dialog-hasframe");f.attr("src",e);d.element.append(f);d.innerFrame=f}d.contentWrapper=d.element},_setOption:function(e,f){var d=this;a.ui.dialog.prototype._setOption.apply(d,arguments);if(e==="captionButtons"){}else{if(e==="disabled"){d._handleDisabledOption(f,d.element)}else{if(e==="contentUrl"){if(d.innerFrame){d.innerFrame.attr("src",f)}else{d._checkUrl()}}}}},_createCaptionButtons:function(){var h=[],d=this,k=d.options,e,g={pin:{visible:false,click:d.pin,iconClassOn:"ui-icon-pin-w",iconClassOff:"ui-icon-pin-s"},refresh:{visible:false,click:d.refresh,iconClassOn:"ui-icon-refresh"},toggle:{visible:false,click:d.toggle,iconClassOn:"ui-icon-carat-1-n",iconClassOff:"ui-icon-carat-1-s"},minimize:{visible:true,click:d.minimize,iconClassOn:"ui-icon-minus"},maximize:{visible:false,click:d.maximize,iconClassOn:"ui-icon-extlink"},close:{visible:true,click:d.close,iconClassOn:"ui-icon-close"}},f=k.captionButtons,j=d.uiDialogTitlebar;j.children(".ui-dialog-titlebar-close, .compilr-dialog-captionbutton").remove();a.each(g,function(i,l){if(f&&f[i]){a.extend(l,f[i])}h.push({button:i,info:l})});d._trigger("buttonCreating",null,h);for(e=0;e<h.length;e++){d._createCaptionButton(h[e],j)}},_createCaptionButton:function(g,d,i){var l=this,f,k="compilr-dialog-titlebar-"+g.button,h=d.children("."+k),e=g.info,j=a("<span></span>");if(e.visible){if(h.size()===0){j.addClass("ui-icon "+e.iconClassOn).text(g.button);f=a('<a href="#"></a>').append(j).addClass(k+" ui-corner-all compilr-dialog-captionbutton").attr("role","button").hover(function(){f.addClass(c)},function(){f.removeClass(c)}).click(function(m){if(j.hasClass(e.iconClassOff)){j.removeClass(e.iconClassOff)}else{j.addClass(e.iconClassOff)}if(a.isFunction(e.click)){e.click.apply(l,arguments)}return false});if(i){return f}else{f.appendTo(d)}}l[g.button+"Button"]=f}else{h.remove()}},pin:function(){var d=this.uiDialog,e=this.isPin;this._enableDisableDragger(!e);this.isPin=!e},refresh:function(){var d=this.innerFrame;if(d!==undefined){d.attr("src",d.attr("src"))}},toggle:function(){var e=this,d=e.toggleButton.children("span");if(!e.minimized){if(e.collapsed===undefined||!e.collapsed){e.collapsed=true;if(!d.hasClass("ui-icon-carat-1-s")){d.addClass("ui-icon-carat-1-s")}e._collapseDialogContent(true)}else{e.collapsed=false;if(d.hasClass("ui-icon-carat-1-s")){d.removeClass("ui-icon-carat-1-s")}e._expandDialogContent(true)}}},_expandDialogContent:function(f){var e=this,g=e.options,d=g.expandingAnimation;e.uiDialog.height("auto");if(f&&d!==null){e.contentWrapper.show(d.animated,d.options,d.duration,function(h){e.uiDialog.css("height",e._toggleHeight);if(a.isFunction(d.callback)){d.callback(h)}e._enableDisableResizer(false)})}else{e.contentWrapper.show();e._enableDisableResizer(false);e.uiDialog.css("height",e.toggleHeight)}},_collapseDialogContent:function(f){var e=this,g=e.options,d=g.collapsingAnimation;e._enableDisableResizer(true);e._toggleHeight=e.uiDialog[0].style.height;e.uiDialog.height("auto");if(f&&d!==null){e.contentWrapper.hide(d.animated,d.options,d.duration)}else{e.contentWrapper.hide()}e._enableDisableDragger(e.isPin)},_enableDisableResizer:function(d){var e=this.uiDialog;e.resizable(d?"disable":"enable");if(d){e.removeClass("ui-state-disabled")}},_enableDisableDragger:function(d){var e=this.uiDialog;e.draggable(d?"disable":"enable");if(d){e.removeClass("ui-state-disabled")}},minimize:function(){var r=this,n=r.uiDialog,f=r.options,d=null,p=a("<div></div>"),m=a("<div></div>"),j,g,q,i,k={},h,s={},l="uiDialog",e;if(!r.minimized){i=r.uiDialog.position();k.width=r.uiDialog.width();k.height=r.uiDialog.height();e=r.getState();if(r.maximized){r.maximized=false;r.restoreButton.remove();a(window).unbind(".onWinResize")}else{if(r.collapsed){r._expandDialogContent(false)}r._saveNormalState()}r._enableDisableResizer(true);r._enableDisableDragger(true);if(r.collapsed){r._collapseDialogContent(false)}p.appendTo(document.body).css({top:r.uiDialog.offset().top,left:r.uiDialog.offset().left,height:r.uiDialog.innerHeight(),width:r.uiDialog.innerWidth(),position:"absolute"});r.contentWrapper.hide();if(r.uiDialogButtonPane.length){r.uiDialogButtonPane.hide()}n.height("auto");n.width("auto");r._doButtonAction(r.minimizeButton,"hide");r._restoreButton(true,r.minimizeButton,"After");r._doButtonAction(r.pinButton,"hide");r._doButtonAction(r.refreshButton,"hide");r._doButtonAction(r.toggleButton,"hide");r._doButtonAction(r.maximizeButton,"show");if(a.browser.webkit){a(".compilr-dialog-captionbutton",r.uiDialog).css("float","left")}if(r.innerFrame){l="copy";r[l]=r.uiDialog.clone();r[l].empty();r.uiDialogTitlebar.appendTo(r[l])}if(f.minimizeZoneElementId.length>0){d=a("#"+f.minimizeZoneElementId)}if(d!==null&&d.size()>0){d.append(r[l])}else{j=a("."+b);if(j.size()===0){j=a('<div class="'+b+'"></div>');a(document.body).append(j)}j.append(r[l]).css("z-index",n.css("z-index"))}r[l].css("position","static");r[l].css("float","left");if(a.browser.msie&&a.browser.version==="6.0"){g=a(document).scrollTop();q=document.documentElement.clientHeight-j.height()+g;j.css({position:"absolute",left:"0px",top:q})}m.appendTo(document.body).css({top:r[l].offset().top,left:r[l].offset().left,height:r[l].innerHeight(),width:r[l].innerWidth(),position:"absolute"});r.uiDialog.hide();if(r.innerFrame){r[l].hide()}p.effect("transfer",{to:m,className:"ui-widget-content"},100,function(){p.remove();m.remove();r[l].show();r.minimized=true;h=r.uiDialog.position();s.width=r.uiDialog.width();s.height=r.uiDialog.height();r._trigger("resize",null,{originalPosition:i,originalSize:k,position:h,size:s});r._trigger("stateChanged",null,{originalState:e,state:"minimized"})})}},_doButtonAction:function(d,e){if(d!==undefined){d.removeClass(c);d[e]()}},maximize:function(){var f=this,e=a(window),i,h={},d,g={},j;if(!f.maximized){f._enableDisableDragger(false);i=f.uiDialog.position();h.width=f.uiDialog.width();h.height=f.uiDialog.height();if(f.minimized){f.restore()}else{if(f.collapsed){f._expandDialogContent(false)}f._saveNormalState();j="normal"}f.maximized=true;if(f.maximizeButton!==undefined){f.maximizeButton.hide();f._restoreButton(true,f.maximizeButton,"Before")}if(a.browser.webkit){a(".compilr-dialog-captionbutton").css("float","")}f._onWinResize(f,e);if(f.collapsed){f._collapseDialogContent(false)}if(!f.collapsed){f._enableDisableDragger(true)}f.uiDialog.resizable("disable");f.uiDialog.removeClass("ui-state-disabled");d=f.uiDialog.position();g.width=f.uiDialog.width();g.height=f.uiDialog.height();f._trigger("resize",null,{originalPosition:i,originalSize:h,position:d,size:g});if(j=="normal"){f._trigger("stateChanged",null,{originalState:"normal",state:"maximized"})}}},_bindWindowResize:function(){var e=this,d=a(window),h,g,f;d.resize(function(){if(e.maximized){e._onWinResize(e,d)}});if(a.browser.msie&&a.browser.version==="6.0"){d.bind("scroll.dialog resize.dialog",function(){if(e.minimized){g=a(document).scrollTop();f=e.uiDialog.parent();h=document.documentElement.clientHeight-f.height()+g;f.css({top:h})}})}},_saveNormalState:function(){var d=this,e=d.uiDialog,f=d.element;if(!d.maximized){d.normalWidth=e.css("width");d.normalLeft=e.css("left");d.normalTop=e.css("top");d.normalHeight=e.css("height");d.normalInnerHeight=f.css("height");d.normalInnerWidth=f.css("width");d.normalInnerMinWidth=f.css("min-width");d.normalInnerMinHeight=f.css("min-height")}},_onWinResize:function(e,d){e.uiDialog.css("top",d.scrollTop());e.uiDialog.css("left",d.scrollLeft());e.uiDialog.setOuterWidth(d.width());e.uiDialog.setOuterHeight(d.height());e._resizeDialog(e)},_restoreButton:function(e,g,d){var f=this,i={button:"restore",info:{visible:e,click:f.restore,iconClassOn:"ui-icon-newwin"}},h=f._createCaptionButton(i,f.uiDialogTitlebar,true);if(e){h["insert"+d](g);f.restoreButton=h}},restore:function(){var l=this,j=l.uiDialog,e,g={},f,m={},k=a("<div></div>"),i=a("<div></div>"),h="uiDialog",d;if(l.minimized){l.minimized=false;l._enableDisableDragger(false);if(l.innerFrame){h="copy";if(!l[h]){h="uiDialog"}}e=l[h].position();g.width=l[h].width();g.height=l[h].height();k.appendTo(document.body).css({top:l[h].offset().top,left:l[h].offset().left,height:l[h].innerHeight(),width:l[h].innerWidth(),position:"absolute"});j.css("position","absolute");j.css("float","");if(!l.innerFrame){j.appendTo(document.body)}else{l.uiDialogTitlebar.prependTo(j);j.show()}l._enableDisableResizer(false);if(!l.isPin){l._enableDisableDragger(false)}l._restoreToNormal();l.contentWrapper.show();if(l.uiDialogButtonPane.length){l.uiDialogButtonPane.show()}i.appendTo(document.body).css({top:l.uiDialog.offset().top,left:l.uiDialog.offset().left,height:l.uiDialog.innerHeight(),width:l.uiDialog.innerWidth(),position:"absolute"});l.uiDialog.hide();k.effect("transfer",{to:i,className:"ui-widget-content"},150,function(){l.uiDialog.show();f=l.uiDialog.position();m.width=l.uiDialog.width();m.height=l.uiDialog.height();k.remove();i.remove();if(l.copy){l.copy.remove()}l._trigger("resize",null,{originalPosition:e,originalSize:g,position:f,size:m});d=l.getState();l._trigger("stateChanged",null,{originalState:"minimized",state:d})});if(l.collapsed){l._collapseDialogContent()}l._doButtonAction(l.minimizeButton,"show");l._doButtonAction(l.restoreButton,"remove");l._doButtonAction(l.pinButton,"show");l._doButtonAction(l.refreshButton,"show");l._doButtonAction(l.toggleButton,"show");if(a.browser.webkit){a(".compilr-dialog-captionbutton").css("float","")}}else{if(l.maximized){l.maximized=false;e=l.uiDialog.position();g.width=l.uiDialog.width();g.height=l.uiDialog.height();a(window).unbind(".onWinResize");if(l.collapsed){l._expandDialogContent()}l._enableDisableResizer(false);if(!l.isPin){l._enableDisableDragger(false)}l._restoreToNormal();l.contentWrapper.show();if(l.collapsed){l._collapseDialogContent()}if(l.maximizeButton!==undefined){l.maximizeButton.show();l._restoreButton(false,l.maximizeButton,"before")}f=l.uiDialog.position();m.width=l.uiDialog.width();m.height=l.uiDialog.height();l._trigger("resize",null,{originalPosition:e,originalSize:g,position:f,size:m});d=l.getState();l._trigger("stateChanged",null,{originalState:"maximized",state:d})}}},getState:function(){var d=this;return d.minimized?"minimized":(d.maximized?"maximized":"normal")},reset:function(){var d=this;d.normalWidth=d.normalLeft=d.normalTop=d.normalHeight=d.normalInnerHeight=d.normalInnerWidth=d.normalInnerMinWidth=d.normalInnerMinHeight=undefined;if(d.minimized||d.maximized){d.restore()}d._setOption("position",d.originalPosition)},open:function(){var d=this,e=d.options;if(!d.innerFrame){if(!d.minimized){a.ui.dialog.prototype.open.apply(d,arguments)}else{d.uiDialog.show()}}else{d.innerFrame.attr("src",e.contentUrl);if(!d.minimized){a.ui.dialog.prototype.open.apply(d,arguments)}else{d.uiDialogTitlebar.show()}}if(d.collapsed){d._collapseDialogContent()}if(d.disabledDiv&&e.disabled){d.disabledDiv.show()}},close:function(){var d=this,e=d.options;if(a.ui.dialog.prototype.close.apply(d,arguments)){if(d.innerFrame){d.innerFrame.attr("src","");if(d.minimized){d.uiDialogTitlebar.hide()}}if(d.disabledDiv&&e.disabled){d.disabledDiv.hide()}}},_resizeDialog:function(d){d.options.width=d.uiDialog.width();d.options.height=d.uiDialog.height();d._size()},_restoreToNormal:function(){var d=this,e=d.uiDialog,f=d.element;e.css("width",d.normalWidth);e.css("left",d.normalLeft);e.css("top",d.normalTop);e.css("height",d.normalHeight);f.css("height",d.normalInnerHeight);f.css("width",d.normalInnerWidth);f.css("min-width",d.normalInnerMinWidth);f.css("min-height",d.normalInnerMinHeight);d.options.width=d.uiDialog.width();d.options.height=d.uiDialog.height()},isMinimized:function(){return this.minimized},isMaximized:function(){return this.maximized}});a.extend(a.ui.dialog.overlay,{height:function(){var e,d;if(a.browser.msie){e=Math.max(document.documentElement.scrollHeight,document.body.scrollHeight);d=Math.max(document.documentElement.offsetHeight,document.body.offsetHeight);if(e<d){return a(window).height()+"px"}else{return e+"px"}}else{return a(document).height()+"px"}},width:function(){var d,e;if(a.browser.msie){d=Math.max(document.documentElement.scrollWidth,document.body.scrollWidth);e=Math.max(document.documentElement.offsetWidth,document.body.offsetWidth);if(d<e){return a(window).width()+"px"}else{return d+"px"}}else{return a(document).width()+"px"}}});a.widget("compilr.statusdialog",a.compilr.dialog,{options:{buttonPaneContent:"",progress:0,progressbarEasing:"linear",queueMessages:false,statusMessage:""},_messageQueue:[],_create:function(){var d=this,e=d.options;d.defaults=a.extend({},d.options);d.progressbar=a("<div></div>").progressbar({value:e.progress}).data("progressbar");d.statusMessage=a("<div>"+e.statusMessage+"</div>").addClass("compilr-statusdialog-status status");a.compilr.dialog.prototype._create.apply(d,arguments);d.uiDialog.addClass("compilr-statusdialog");d._prependToButtonPane(e.buttonPaneContent)},_prependToButtonPane:function(g){var f=this,d=f.progressbar.element,h=f.statusMessage,e=f.uiDialog.find(".ui-dialog-buttonpane");d.removeClass("ui-corner-all").find(".ui-progressbar-value").removeClass("ui-corner-left");e.prepend(g).prepend(h).prepend(d)},_setOption:function(e,f){var d=this;if(e!="buttons"){a.compilr.dialog.prototype._setOption.apply(d,arguments)}switch(e){case"statusMessage":d.updateStatusMessage(f);break;case"progress":d.updateProgressbar(f);break;case"buttons":d._createButtons(f);a.Widget.prototype._setOption.apply(d,arguments);break}},_createButtons:function(g){var f=this,d=false,e=f.uiDialog.find(".ui-dialog-buttonpane"),h=a("<div></div>").addClass("ui-dialog-buttonset"),i=e.length;if(!i){e=a("<div></div>").addClass("ui-dialog-buttonpane ui-widget-content ui-helper-clearfix");f._prependToButtonPane(f.options.buttonPaneContent)}f.uiDialog.find(".ui-dialog-buttonset").remove();if(typeof g==="object"&&g!==null){a.each(g,function(){return !(d=true)})}if(d){h.appendTo(e);a.each(g,function(j,l){l=a.isFunction(l)?{click:l,text:j}:l;var k=a('<button type="button"></button>').click(function(){l.click.apply(f.element[0],arguments)}).appendTo(h);a.each(l,function(m,n){if(m==="click"){return}if(m in a.attrFn){k[m](n)}else{k.attr(m,n)}});if(a.fn.button){k.button()}})}if(!i){e.appendTo(f.uiDialog)}},reset:function(){var d=this;d.statusMessage.html(d.defaults.statusMessage);d.progressbar.value(d.defaults.progress)},updateStatusMessage:function(e){var d=this;d.statusMessage.html(e)},updateProgressbar:function(e){var d=this;d.progressbar.value(e)},update:function(){var d=this,e=arguments;if(e.length==1){if(typeof e[0]=="object"){if(e[0].value!="undefined"){d.updateProgressbar(e[0].value)}if(e[0].message!="undefined"){d.updateStatusMessage(e[0].message)}}else{d.updateProgressbar(e[0])}}else{if(e.length==2){d.updateProgressbar(e[0]);d.updateStatusMessage(e[1])}}}})}(jQuery));(function(i,za,p){i.fn.dataTableSettings=[];var D=i.fn.dataTableSettings;i.fn.dataTableExt={};var n=i.fn.dataTableExt;n.sVersion="1.8.2";n.sErrMode="alert";n.iApiIndex=0;n.oApi={};n.afnFiltering=[];n.aoFeatures=[];n.ofnSearch={};n.afnSortData=[];n.oStdClasses={sPagePrevEnabled:"paginate_enabled_previous",sPagePrevDisabled:"paginate_disabled_previous",sPageNextEnabled:"paginate_enabled_next",sPageNextDisabled:"paginate_disabled_next",sPageJUINext:"",sPageJUIPrev:"",sPageButton:"paginate_button",sPageButtonActive:"paginate_active",sPageButtonStaticDisabled:"paginate_button paginate_button_disabled",sPageFirst:"first",sPagePrevious:"previous",sPageNext:"next",sPageLast:"last",sStripeOdd:"odd",sStripeEven:"even",sRowEmpty:"dataTables_empty",sWrapper:"dataTables_wrapper",sFilter:"dataTables_filter",sInfo:"dataTables_info",sPaging:"dataTables_paginate paging_",sLength:"dataTables_length",sProcessing:"dataTables_processing",sSortAsc:"sorting_asc",sSortDesc:"sorting_desc",sSortable:"sorting",sSortableAsc:"sorting_asc_disabled",sSortableDesc:"sorting_desc_disabled",sSortableNone:"sorting_disabled",sSortColumn:"sorting_",sSortJUIAsc:"",sSortJUIDesc:"",sSortJUI:"",sSortJUIAscAllowed:"",sSortJUIDescAllowed:"",sSortJUIWrapper:"",sSortIcon:"",sScrollWrapper:"dataTables_scroll",sScrollHead:"dataTables_scrollHead",sScrollHeadInner:"dataTables_scrollHeadInner",sScrollBody:"dataTables_scrollBody",sScrollFoot:"dataTables_scrollFoot",sScrollFootInner:"dataTables_scrollFootInner",sFooterTH:""};n.oJUIClasses={sPagePrevEnabled:"fg-button ui-button ui-state-default ui-corner-left",sPagePrevDisabled:"fg-button ui-button ui-state-default ui-corner-left ui-state-disabled",sPageNextEnabled:"fg-button ui-button ui-state-default ui-corner-right",sPageNextDisabled:"fg-button ui-button ui-state-default ui-corner-right ui-state-disabled",sPageJUINext:"ui-icon ui-icon-circle-arrow-e",sPageJUIPrev:"ui-icon ui-icon-circle-arrow-w",sPageButton:"fg-button ui-button ui-state-default",sPageButtonActive:"fg-button ui-button ui-state-default ui-state-disabled",sPageButtonStaticDisabled:"fg-button ui-button ui-state-default ui-state-disabled",sPageFirst:"first ui-corner-tl ui-corner-bl",sPagePrevious:"previous",sPageNext:"next",sPageLast:"last ui-corner-tr ui-corner-br",sStripeOdd:"odd",sStripeEven:"even",sRowEmpty:"dataTables_empty",sWrapper:"dataTables_wrapper",sFilter:"dataTables_filter",sInfo:"dataTables_info",sPaging:"dataTables_paginate fg-buttonset ui-buttonset fg-buttonset-multi ui-buttonset-multi paging_",sLength:"dataTables_length",sProcessing:"dataTables_processing",sSortAsc:"ui-state-default",sSortDesc:"ui-state-default",sSortable:"ui-state-default",sSortableAsc:"ui-state-default",sSortableDesc:"ui-state-default",sSortableNone:"ui-state-default",sSortColumn:"sorting_",sSortJUIAsc:"css_right ui-icon ui-icon-triangle-1-n",sSortJUIDesc:"css_right ui-icon ui-icon-triangle-1-s",sSortJUI:"css_right ui-icon ui-icon-carat-2-n-s",sSortJUIAscAllowed:"css_right ui-icon ui-icon-carat-1-n",sSortJUIDescAllowed:"css_right ui-icon ui-icon-carat-1-s",sSortJUIWrapper:"DataTables_sort_wrapper",sSortIcon:"DataTables_sort_icon",sScrollWrapper:"dataTables_scroll",sScrollHead:"dataTables_scrollHead ui-state-default",sScrollHeadInner:"dataTables_scrollHeadInner",sScrollBody:"dataTables_scrollBody",sScrollFoot:"dataTables_scrollFoot ui-state-default",sScrollFootInner:"dataTables_scrollFootInner",sFooterTH:"ui-state-default"};n.oPagination={two_button:{fnInit:function(g,l,s){var t,w,y;if(g.bJUI){t=p.createElement("a");w=p.createElement("a");y=p.createElement("span");y.className=g.oClasses.sPageJUINext;w.appendChild(y);y=p.createElement("span");y.className=g.oClasses.sPageJUIPrev;t.appendChild(y)}else{t=p.createElement("div");w=p.createElement("div")}t.className=g.oClasses.sPagePrevDisabled;w.className=g.oClasses.sPageNextDisabled;t.title=g.oLanguage.oPaginate.sPrevious;w.title=g.oLanguage.oPaginate.sNext;l.appendChild(t);l.appendChild(w);i(t).bind("click.DT",function(){g.oApi._fnPageChange(g,"previous")&&s(g)});i(w).bind("click.DT",function(){g.oApi._fnPageChange(g,"next")&&s(g)});i(t).bind("selectstart.DT",function(){return false});i(w).bind("selectstart.DT",function(){return false});if(g.sTableId!==""&&typeof g.aanFeatures.p=="undefined"){l.setAttribute("id",g.sTableId+"_paginate");t.setAttribute("id",g.sTableId+"_previous");w.setAttribute("id",g.sTableId+"_next")}},fnUpdate:function(g){if(g.aanFeatures.p){for(var l=g.aanFeatures.p,s=0,t=l.length;s<t;s++){if(l[s].childNodes.length!==0){l[s].childNodes[0].className=g._iDisplayStart===0?g.oClasses.sPagePrevDisabled:g.oClasses.sPagePrevEnabled;l[s].childNodes[1].className=g.fnDisplayEnd()==g.fnRecordsDisplay()?g.oClasses.sPageNextDisabled:g.oClasses.sPageNextEnabled}}}}},iFullNumbersShowPages:5,full_numbers:{fnInit:function(g,l,s){var t=p.createElement("span"),w=p.createElement("span"),y=p.createElement("span"),F=p.createElement("span"),x=p.createElement("span");t.innerHTML=g.oLanguage.oPaginate.sFirst;w.innerHTML=g.oLanguage.oPaginate.sPrevious;F.innerHTML=g.oLanguage.oPaginate.sNext;x.innerHTML=g.oLanguage.oPaginate.sLast;var v=g.oClasses;t.className=v.sPageButton+" "+v.sPageFirst;w.className=v.sPageButton+" "+v.sPagePrevious;F.className=v.sPageButton+" "+v.sPageNext;x.className=v.sPageButton+" "+v.sPageLast;l.appendChild(t);l.appendChild(w);l.appendChild(y);l.appendChild(F);l.appendChild(x);i(t).bind("click.DT",function(){g.oApi._fnPageChange(g,"first")&&s(g)});i(w).bind("click.DT",function(){g.oApi._fnPageChange(g,"previous")&&s(g)});i(F).bind("click.DT",function(){g.oApi._fnPageChange(g,"next")&&s(g)});i(x).bind("click.DT",function(){g.oApi._fnPageChange(g,"last")&&s(g)});i("span",l).bind("mousedown.DT",function(){return false}).bind("selectstart.DT",function(){return false});if(g.sTableId!==""&&typeof g.aanFeatures.p=="undefined"){l.setAttribute("id",g.sTableId+"_paginate");t.setAttribute("id",g.sTableId+"_first");w.setAttribute("id",g.sTableId+"_previous");F.setAttribute("id",g.sTableId+"_next");x.setAttribute("id",g.sTableId+"_last")}},fnUpdate:function(g,l){if(g.aanFeatures.p){var s=n.oPagination.iFullNumbersShowPages,t=Math.floor(s/2),w=Math.ceil(g.fnRecordsDisplay()/g._iDisplayLength),y=Math.ceil(g._iDisplayStart/g._iDisplayLength)+1,F="",x,v=g.oClasses;if(w<s){t=1;x=w}else{if(y<=t){t=1;x=s}else{if(y>=w-t){t=w-s+1;x=w}else{t=y-Math.ceil(s/2)+1;x=t+s-1}}}for(s=t;s<=x;s++){F+=y!=s?'<span class="'+v.sPageButton+'">'+s+"</span>":'<span class="'+v.sPageButtonActive+'">'+s+"</span>"}x=g.aanFeatures.p;var z,$=function(M){g._iDisplayStart=(this.innerHTML*1-1)*g._iDisplayLength;l(g);M.preventDefault()},X=function(){return false};s=0;for(t=x.length;s<t;s++){if(x[s].childNodes.length!==0){z=i("span:eq(2)",x[s]);z.html(F);i("span",z).bind("click.DT",$).bind("mousedown.DT",X).bind("selectstart.DT",X);z=x[s].getElementsByTagName("span");z=[z[0],z[1],z[z.length-2],z[z.length-1]];i(z).removeClass(v.sPageButton+" "+v.sPageButtonActive+" "+v.sPageButtonStaticDisabled);if(y==1){z[0].className+=" "+v.sPageButtonStaticDisabled;z[1].className+=" "+v.sPageButtonStaticDisabled}else{z[0].className+=" "+v.sPageButton;z[1].className+=" "+v.sPageButton}if(w===0||y==w||g._iDisplayLength==-1){z[2].className+=" "+v.sPageButtonStaticDisabled;z[3].className+=" "+v.sPageButtonStaticDisabled}else{z[2].className+=" "+v.sPageButton;z[3].className+=" "+v.sPageButton}}}}}}};n.oSort={"string-asc":function(g,l){if(typeof g!="string"){g=""}if(typeof l!="string"){l=""}g=g.toLowerCase();l=l.toLowerCase();return g<l?-1:g>l?1:0},"string-desc":function(g,l){if(typeof g!="string"){g=""}if(typeof l!="string"){l=""}g=g.toLowerCase();l=l.toLowerCase();return g<l?1:g>l?-1:0},"html-asc":function(g,l){g=g.replace(/<.*?>/g,"").toLowerCase();l=l.replace(/<.*?>/g,"").toLowerCase();return g<l?-1:g>l?1:0},"html-desc":function(g,l){g=g.replace(/<.*?>/g,"").toLowerCase();l=l.replace(/<.*?>/g,"").toLowerCase();return g<l?1:g>l?-1:0},"date-asc":function(g,l){g=Date.parse(g);l=Date.parse(l);if(isNaN(g)||g===""){g=Date.parse("01/01/1970 00:00:00")}if(isNaN(l)||l===""){l=Date.parse("01/01/1970 00:00:00")}return g-l},"date-desc":function(g,l){g=Date.parse(g);l=Date.parse(l);if(isNaN(g)||g===""){g=Date.parse("01/01/1970 00:00:00")}if(isNaN(l)||l===""){l=Date.parse("01/01/1970 00:00:00")}return l-g},"numeric-asc":function(g,l){return(g=="-"||g===""?0:g*1)-(l=="-"||l===""?0:l*1)},"numeric-desc":function(g,l){return(l=="-"||l===""?0:l*1)-(g=="-"||g===""?0:g*1)}};n.aTypes=[function(g){if(typeof g=="number"){return"numeric"}else{if(typeof g!="string"){return null}}var l,s=false;l=g.charAt(0);if("0123456789-".indexOf(l)==-1){return null}for(var t=1;t<g.length;t++){l=g.charAt(t);if("0123456789.".indexOf(l)==-1){return null}if(l=="."){if(s){return null}s=true}}return"numeric"},function(g){var l=Date.parse(g);if(l!==null&&!isNaN(l)||typeof g=="string"&&g.length===0){return"date"}return null},function(g){if(typeof g=="string"&&g.indexOf("<")!=-1&&g.indexOf(">")!=-1){return"html"}return null}];n.fnVersionCheck=function(g){var l=function(x,v){for(;x.length<v;){x+="0"}return x},s=n.sVersion.split(".");g=g.split(".");for(var t="",w="",y=0,F=g.length;y<F;y++){t+=l(s[y],3);w+=l(g[y],3)}return parseInt(t,10)>=parseInt(w,10)};n._oExternConfig={iNextUnique:0};i.fn.dataTable=function(g){function l(){this.fnRecordsTotal=function(){return this.oFeatures.bServerSide?parseInt(this._iRecordsTotal,10):this.aiDisplayMaster.length};this.fnRecordsDisplay=function(){return this.oFeatures.bServerSide?parseInt(this._iRecordsDisplay,10):this.aiDisplay.length};this.fnDisplayEnd=function(){return this.oFeatures.bServerSide?this.oFeatures.bPaginate===false||this._iDisplayLength==-1?this._iDisplayStart+this.aiDisplay.length:Math.min(this._iDisplayStart+this._iDisplayLength,this._iRecordsDisplay):this._iDisplayEnd};this.sInstance=this.oInstance=null;this.oFeatures={bPaginate:true,bLengthChange:true,bFilter:true,bSort:true,bInfo:true,bAutoWidth:true,bProcessing:false,bSortClasses:true,bStateSave:false,bServerSide:false,bDeferRender:false};this.oScroll={sX:"",sXInner:"",sY:"",bCollapse:false,bInfinite:false,iLoadGap:100,iBarWidth:0,bAutoCss:true};this.aanFeatures=[];this.oLanguage={sProcessing:"Processing...",sLengthMenu:"Show _MENU_ entries",sZeroRecords:"No matching records found",sEmptyTable:"No data available in table",sLoadingRecords:"Loading...",sInfo:"Showing _START_ to _END_ of _TOTAL_ entries",sInfoEmpty:"Showing 0 to 0 of 0 entries",sInfoFiltered:"(filtered from _MAX_ total entries)",sInfoPostFix:"",sInfoThousands:",",sSearch:"Search:",sUrl:"",oPaginate:{sFirst:"First",sPrevious:"Previous",sNext:"Next",sLast:"Last"},fnInfoCallback:null};this.aoData=[];this.aiDisplay=[];this.aiDisplayMaster=[];this.aoColumns=[];this.aoHeader=[];this.aoFooter=[];this.iNextId=0;this.asDataSearch=[];this.oPreviousSearch={sSearch:"",bRegex:false,bSmart:true};this.aoPreSearchCols=[];this.aaSorting=[[0,"asc",0]];this.aaSortingFixed=null;this.asStripeClasses=[];this.asDestroyStripes=[];this.sDestroyWidth=0;this.fnFooterCallback=this.fnHeaderCallback=this.fnRowCallback=null;this.aoDrawCallback=[];this.fnInitComplete=this.fnPreDrawCallback=null;this.sTableId="";this.nTableWrapper=this.nTBody=this.nTFoot=this.nTHead=this.nTable=null;this.bInitialised=this.bDeferLoading=false;this.aoOpenRows=[];this.sDom="lfrtip";this.sPaginationType="two_button";this.iCookieDuration=7200;this.sCookiePrefix="SpryMedia_DataTables_";this.fnCookieCallback=null;this.aoStateSave=[];this.aoStateLoad=[];this.sAjaxSource=this.oLoadedState=null;this.sAjaxDataProp="aaData";this.bAjaxDataGet=true;this.jqXHR=null;this.fnServerData=function(a,b,c,d){d.jqXHR=i.ajax({url:a,data:b,success:function(f){i(d.oInstance).trigger("xhr",d);c(f)},dataType:"json",cache:false,error:function(f,e){e=="parsererror"&&alert("DataTables warning: JSON data from server could not be parsed. This is caused by a JSON formatting error.")}})};this.aoServerParams=[];this.fnFormatNumber=function(a){if(a<1000){return a}else{var b=a+"";a=b.split("");var c="";b=b.length;for(var d=0;d<b;d++){if(d%3===0&&d!==0){c=this.oLanguage.sInfoThousands+c}c=a[b-d-1]+c}}return c};this.aLengthMenu=[10,25,50,100];this.bDrawing=this.iDraw=0;this.iDrawError=-1;this._iDisplayLength=10;this._iDisplayStart=0;this._iDisplayEnd=10;this._iRecordsDisplay=this._iRecordsTotal=0;this.bJUI=false;this.oClasses=n.oStdClasses;this.bSortCellsTop=this.bSorted=this.bFiltered=false;this.oInit=null;this.aoDestroyCallback=[]}function s(a){return function(){var b=[A(this[n.iApiIndex])].concat(Array.prototype.slice.call(arguments));return n.oApi[a].apply(this,b)}}function t(a){var b,c,d=a.iInitDisplayStart;if(a.bInitialised===false){setTimeout(function(){t(a)},200)}else{Aa(a);X(a);M(a,a.aoHeader);a.nTFoot&&M(a,a.aoFooter);K(a,true);a.oFeatures.bAutoWidth&&ga(a);b=0;for(c=a.aoColumns.length;b<c;b++){if(a.aoColumns[b].sWidth!==null){a.aoColumns[b].nTh.style.width=q(a.aoColumns[b].sWidth)}}if(a.oFeatures.bSort){R(a)}else{if(a.oFeatures.bFilter){N(a,a.oPreviousSearch)}else{a.aiDisplay=a.aiDisplayMaster.slice();E(a);C(a)}}if(a.sAjaxSource!==null&&!a.oFeatures.bServerSide){c=[];ha(a,c);a.fnServerData.call(a.oInstance,a.sAjaxSource,c,function(f){var e=f;if(a.sAjaxDataProp!==""){e=aa(a.sAjaxDataProp)(f)}for(b=0;b<e.length;b++){v(a,e[b])}a.iInitDisplayStart=d;if(a.oFeatures.bSort){R(a)}else{a.aiDisplay=a.aiDisplayMaster.slice();E(a);C(a)}K(a,false);w(a,f)},a)}else{if(!a.oFeatures.bServerSide){K(a,false);w(a)}}}}function w(a,b){a._bInitComplete=true;if(typeof a.fnInitComplete=="function"){typeof b!="undefined"?a.fnInitComplete.call(a.oInstance,a,b):a.fnInitComplete.call(a.oInstance,a)}}function y(a,b,c){a.oLanguage=i.extend(true,a.oLanguage,b);typeof b.sEmptyTable=="undefined"&&typeof b.sZeroRecords!="undefined"&&o(a.oLanguage,b,"sZeroRecords","sEmptyTable");typeof b.sLoadingRecords=="undefined"&&typeof b.sZeroRecords!="undefined"&&o(a.oLanguage,b,"sZeroRecords","sLoadingRecords");c&&t(a)}function F(a,b){var c=a.aoColumns.length;b={sType:null,_bAutoType:true,bVisible:true,bSearchable:true,bSortable:true,asSorting:["asc","desc"],sSortingClass:a.oClasses.sSortable,sSortingClassJUI:a.oClasses.sSortJUI,sTitle:b?b.innerHTML:"",sName:"",sWidth:null,sWidthOrig:null,sClass:null,fnRender:null,bUseRendered:true,iDataSort:c,mDataProp:c,fnGetData:null,fnSetData:null,sSortDataType:"std",sDefaultContent:null,sContentPadding:"",nTh:b?b:p.createElement("th"),nTf:null};a.aoColumns.push(b);if(typeof a.aoPreSearchCols[c]=="undefined"||a.aoPreSearchCols[c]===null){a.aoPreSearchCols[c]={sSearch:"",bRegex:false,bSmart:true}}else{if(typeof a.aoPreSearchCols[c].bRegex=="undefined"){a.aoPreSearchCols[c].bRegex=true}if(typeof a.aoPreSearchCols[c].bSmart=="undefined"){a.aoPreSearchCols[c].bSmart=true}}x(a,c,null)}function x(a,b,c){b=a.aoColumns[b];if(typeof c!="undefined"&&c!==null){if(typeof c.sType!="undefined"){b.sType=c.sType;b._bAutoType=false}o(b,c,"bVisible");o(b,c,"bSearchable");o(b,c,"bSortable");o(b,c,"sTitle");o(b,c,"sName");o(b,c,"sWidth");o(b,c,"sWidth","sWidthOrig");o(b,c,"sClass");o(b,c,"fnRender");o(b,c,"bUseRendered");o(b,c,"iDataSort");o(b,c,"mDataProp");o(b,c,"asSorting");o(b,c,"sSortDataType");o(b,c,"sDefaultContent");o(b,c,"sContentPadding")}b.fnGetData=aa(b.mDataProp);b.fnSetData=Ba(b.mDataProp);if(!a.oFeatures.bSort){b.bSortable=false}if(!b.bSortable||i.inArray("asc",b.asSorting)==-1&&i.inArray("desc",b.asSorting)==-1){b.sSortingClass=a.oClasses.sSortableNone;b.sSortingClassJUI=""}else{if(b.bSortable||i.inArray("asc",b.asSorting)==-1&&i.inArray("desc",b.asSorting)==-1){b.sSortingClass=a.oClasses.sSortable;b.sSortingClassJUI=a.oClasses.sSortJUI}else{if(i.inArray("asc",b.asSorting)!=-1&&i.inArray("desc",b.asSorting)==-1){b.sSortingClass=a.oClasses.sSortableAsc;b.sSortingClassJUI=a.oClasses.sSortJUIAscAllowed}else{if(i.inArray("asc",b.asSorting)==-1&&i.inArray("desc",b.asSorting)!=-1){b.sSortingClass=a.oClasses.sSortableDesc;b.sSortingClassJUI=a.oClasses.sSortJUIDescAllowed}}}}}function v(a,b){var c;c=i.isArray(b)?b.slice():i.extend(true,{},b);b=a.aoData.length;var d={nTr:null,_iId:a.iNextId++,_aData:c,_anHidden:[],_sRowStripe:""};a.aoData.push(d);for(var f,e=0,h=a.aoColumns.length;e<h;e++){c=a.aoColumns[e];typeof c.fnRender=="function"&&c.bUseRendered&&c.mDataProp!==null&&O(a,b,e,c.fnRender({iDataRow:b,iDataColumn:e,aData:d._aData,oSettings:a}));if(c._bAutoType&&c.sType!="string"){f=G(a,b,e,"type");if(f!==null&&f!==""){f=ia(f);if(c.sType===null){c.sType=f}else{if(c.sType!=f&&c.sType!="html"){c.sType="string"}}}}}a.aiDisplayMaster.push(b);a.oFeatures.bDeferRender||z(a,b);return b}function z(a,b){var c=a.aoData[b],d;if(c.nTr===null){c.nTr=p.createElement("tr");typeof c._aData.DT_RowId!="undefined"&&c.nTr.setAttribute("id",c._aData.DT_RowId);typeof c._aData.DT_RowClass!="undefined"&&i(c.nTr).addClass(c._aData.DT_RowClass);for(var f=0,e=a.aoColumns.length;f<e;f++){var h=a.aoColumns[f];d=p.createElement("td");d.innerHTML=typeof h.fnRender=="function"&&(!h.bUseRendered||h.mDataProp===null)?h.fnRender({iDataRow:b,iDataColumn:f,aData:c._aData,oSettings:a}):G(a,b,f,"display");if(h.sClass!==null){d.className=h.sClass}if(h.bVisible){c.nTr.appendChild(d);c._anHidden[f]=null}else{c._anHidden[f]=d}}}}function $(a){var b,c,d,f,e,h,j,k,m;if(a.bDeferLoading||a.sAjaxSource===null){j=a.nTBody.childNodes;b=0;for(c=j.length;b<c;b++){if(j[b].nodeName.toUpperCase()=="TR"){k=a.aoData.length;a.aoData.push({nTr:j[b],_iId:a.iNextId++,_aData:[],_anHidden:[],_sRowStripe:""});a.aiDisplayMaster.push(k);h=j[b].childNodes;d=e=0;for(f=h.length;d<f;d++){m=h[d].nodeName.toUpperCase();if(m=="TD"||m=="TH"){O(a,k,e,i.trim(h[d].innerHTML));e++}}}}}j=ba(a);h=[];b=0;for(c=j.length;b<c;b++){d=0;for(f=j[b].childNodes.length;d<f;d++){e=j[b].childNodes[d];m=e.nodeName.toUpperCase();if(m=="TD"||m=="TH"){h.push(e)}}}h.length!=j.length*a.aoColumns.length&&J(a,1,"Unexpected number of TD elements. Expected "+j.length*a.aoColumns.length+" and got "+h.length+". DataTables does not support rowspan / colspan in the table body, and there must be one cell for each row/column combination.");d=0;for(f=a.aoColumns.length;d<f;d++){if(a.aoColumns[d].sTitle===null){a.aoColumns[d].sTitle=a.aoColumns[d].nTh.innerHTML}j=a.aoColumns[d]._bAutoType;m=typeof a.aoColumns[d].fnRender=="function";e=a.aoColumns[d].sClass!==null;k=a.aoColumns[d].bVisible;var u,r;if(j||m||e||!k){b=0;for(c=a.aoData.length;b<c;b++){u=h[b*f+d];if(j&&a.aoColumns[d].sType!="string"){r=G(a,b,d,"type");if(r!==""){r=ia(r);if(a.aoColumns[d].sType===null){a.aoColumns[d].sType=r}else{if(a.aoColumns[d].sType!=r&&a.aoColumns[d].sType!="html"){a.aoColumns[d].sType="string"}}}}if(m){r=a.aoColumns[d].fnRender({iDataRow:b,iDataColumn:d,aData:a.aoData[b]._aData,oSettings:a});u.innerHTML=r;a.aoColumns[d].bUseRendered&&O(a,b,d,r)}if(e){u.className+=" "+a.aoColumns[d].sClass}if(k){a.aoData[b]._anHidden[d]=null}else{a.aoData[b]._anHidden[d]=u;u.parentNode.removeChild(u)}}}}}function X(a){var b,c,d;a.nTHead.getElementsByTagName("tr");if(a.nTHead.getElementsByTagName("th").length!==0){b=0;for(d=a.aoColumns.length;b<d;b++){c=a.aoColumns[b].nTh;a.aoColumns[b].sClass!==null&&i(c).addClass(a.aoColumns[b].sClass);if(a.aoColumns[b].sTitle!=c.innerHTML){c.innerHTML=a.aoColumns[b].sTitle}}}else{var f=p.createElement("tr");b=0;for(d=a.aoColumns.length;b<d;b++){c=a.aoColumns[b].nTh;c.innerHTML=a.aoColumns[b].sTitle;a.aoColumns[b].sClass!==null&&i(c).addClass(a.aoColumns[b].sClass);f.appendChild(c)}i(a.nTHead).html("")[0].appendChild(f);Y(a.aoHeader,a.nTHead)}if(a.bJUI){b=0;for(d=a.aoColumns.length;b<d;b++){c=a.aoColumns[b].nTh;f=p.createElement("div");f.className=a.oClasses.sSortJUIWrapper;i(c).contents().appendTo(f);var e=p.createElement("span");e.className=a.oClasses.sSortIcon;f.appendChild(e);c.appendChild(f)}}d=function(){this.onselectstart=function(){return false};return false};if(a.oFeatures.bSort){for(b=0;b<a.aoColumns.length;b++){if(a.aoColumns[b].bSortable!==false){ja(a,a.aoColumns[b].nTh,b);i(a.aoColumns[b].nTh).bind("mousedown.DT",d)}else{i(a.aoColumns[b].nTh).addClass(a.oClasses.sSortableNone)}}}a.oClasses.sFooterTH!==""&&i(a.nTFoot).children("tr").children("th").addClass(a.oClasses.sFooterTH);if(a.nTFoot!==null){c=S(a,null,a.aoFooter);b=0;for(d=a.aoColumns.length;b<d;b++){if(typeof c[b]!="undefined"){a.aoColumns[b].nTf=c[b]}}}}function M(a,b,c){var d,f,e,h=[],j=[],k=a.aoColumns.length;if(typeof c=="undefined"){c=false}d=0;for(f=b.length;d<f;d++){h[d]=b[d].slice();h[d].nTr=b[d].nTr;for(e=k-1;e>=0;e--){!a.aoColumns[e].bVisible&&!c&&h[d].splice(e,1)}j.push([])}d=0;for(f=h.length;d<f;d++){if(h[d].nTr){a=0;for(e=h[d].nTr.childNodes.length;a<e;a++){h[d].nTr.removeChild(h[d].nTr.childNodes[0])}}e=0;for(b=h[d].length;e<b;e++){k=c=1;if(typeof j[d][e]=="undefined"){h[d].nTr.appendChild(h[d][e].cell);for(j[d][e]=1;typeof h[d+c]!="undefined"&&h[d][e].cell==h[d+c][e].cell;){j[d+c][e]=1;c++}for(;typeof h[d][e+k]!="undefined"&&h[d][e].cell==h[d][e+k].cell;){for(a=0;a<c;a++){j[d+a][e+k]=1}k++}h[d][e].cell.rowSpan=c;h[d][e].cell.colSpan=k}}}}function C(a){var b,c,d=[],f=0,e=false;b=a.asStripeClasses.length;c=a.aoOpenRows.length;if(!(a.fnPreDrawCallback!==null&&a.fnPreDrawCallback.call(a.oInstance,a)===false)){a.bDrawing=true;if(typeof a.iInitDisplayStart!="undefined"&&a.iInitDisplayStart!=-1){a._iDisplayStart=a.oFeatures.bServerSide?a.iInitDisplayStart:a.iInitDisplayStart>=a.fnRecordsDisplay()?0:a.iInitDisplayStart;a.iInitDisplayStart=-1;E(a)}if(a.bDeferLoading){a.bDeferLoading=false;a.iDraw++}else{if(a.oFeatures.bServerSide){if(!a.bDestroying&&!Ca(a)){return}}else{a.iDraw++}}if(a.aiDisplay.length!==0){var h=a._iDisplayStart,j=a._iDisplayEnd;if(a.oFeatures.bServerSide){h=0;j=a.aoData.length}for(h=h;h<j;h++){var k=a.aoData[a.aiDisplay[h]];k.nTr===null&&z(a,a.aiDisplay[h]);var m=k.nTr;if(b!==0){var u=a.asStripeClasses[f%b];if(k._sRowStripe!=u){i(m).removeClass(k._sRowStripe).addClass(u);k._sRowStripe=u}}if(typeof a.fnRowCallback=="function"){m=a.fnRowCallback.call(a.oInstance,m,a.aoData[a.aiDisplay[h]]._aData,f,h);if(!m&&!e){J(a,0,"A node was not returned by fnRowCallback");e=true}}d.push(m);f++;if(c!==0){for(k=0;k<c;k++){m==a.aoOpenRows[k].nParent&&d.push(a.aoOpenRows[k].nTr)}}}}else{d[0]=p.createElement("tr");if(typeof a.asStripeClasses[0]!="undefined"){d[0].className=a.asStripeClasses[0]}e=a.oLanguage.sZeroRecords.replace("_MAX_",a.fnFormatNumber(a.fnRecordsTotal()));if(a.iDraw==1&&a.sAjaxSource!==null&&!a.oFeatures.bServerSide){e=a.oLanguage.sLoadingRecords}else{if(typeof a.oLanguage.sEmptyTable!="undefined"&&a.fnRecordsTotal()===0){e=a.oLanguage.sEmptyTable}}b=p.createElement("td");b.setAttribute("valign","top");b.colSpan=Z(a);b.className=a.oClasses.sRowEmpty;b.innerHTML=e;d[f].appendChild(b)}typeof a.fnHeaderCallback=="function"&&a.fnHeaderCallback.call(a.oInstance,i(a.nTHead).children("tr")[0],ca(a),a._iDisplayStart,a.fnDisplayEnd(),a.aiDisplay);typeof a.fnFooterCallback=="function"&&a.fnFooterCallback.call(a.oInstance,i(a.nTFoot).children("tr")[0],ca(a),a._iDisplayStart,a.fnDisplayEnd(),a.aiDisplay);f=p.createDocumentFragment();b=p.createDocumentFragment();if(a.nTBody){e=a.nTBody.parentNode;b.appendChild(a.nTBody);if(!a.oScroll.bInfinite||!a._bInitComplete||a.bSorted||a.bFiltered){c=a.nTBody.childNodes;for(b=c.length-1;b>=0;b--){c[b].parentNode.removeChild(c[b])}}b=0;for(c=d.length;b<c;b++){f.appendChild(d[b])}a.nTBody.appendChild(f);e!==null&&e.appendChild(a.nTBody)}for(b=a.aoDrawCallback.length-1;b>=0;b--){a.aoDrawCallback[b].fn.call(a.oInstance,a)}i(a.oInstance).trigger("draw",a);a.bSorted=false;a.bFiltered=false;a.bDrawing=false;if(a.oFeatures.bServerSide){K(a,false);typeof a._bInitComplete=="undefined"&&w(a)}}}function da(a){if(a.oFeatures.bSort){R(a,a.oPreviousSearch)}else{if(a.oFeatures.bFilter){N(a,a.oPreviousSearch)}else{E(a);C(a)}}}function Ca(a){if(a.bAjaxDataGet){a.iDraw++;K(a,true);var b=Da(a);ha(a,b);a.fnServerData.call(a.oInstance,a.sAjaxSource,b,function(c){Ea(a,c)},a);return false}else{return true}}function Da(a){var b=a.aoColumns.length,c=[],d,f;c.push({name:"sEcho",value:a.iDraw});c.push({name:"iColumns",value:b});c.push({name:"sColumns",value:ka(a)});c.push({name:"iDisplayStart",value:a._iDisplayStart});c.push({name:"iDisplayLength",value:a.oFeatures.bPaginate!==false?a._iDisplayLength:-1});for(f=0;f<b;f++){d=a.aoColumns[f].mDataProp;c.push({name:"mDataProp_"+f,value:typeof d=="function"?"function":d})}if(a.oFeatures.bFilter!==false){c.push({name:"sSearch",value:a.oPreviousSearch.sSearch});c.push({name:"bRegex",value:a.oPreviousSearch.bRegex});for(f=0;f<b;f++){c.push({name:"sSearch_"+f,value:a.aoPreSearchCols[f].sSearch});c.push({name:"bRegex_"+f,value:a.aoPreSearchCols[f].bRegex});c.push({name:"bSearchable_"+f,value:a.aoColumns[f].bSearchable})}}if(a.oFeatures.bSort!==false){d=a.aaSortingFixed!==null?a.aaSortingFixed.length:0;var e=a.aaSorting.length;c.push({name:"iSortingCols",value:d+e});for(f=0;f<d;f++){c.push({name:"iSortCol_"+f,value:a.aaSortingFixed[f][0]});c.push({name:"sSortDir_"+f,value:a.aaSortingFixed[f][1]})}for(f=0;f<e;f++){c.push({name:"iSortCol_"+(f+d),value:a.aaSorting[f][0]});c.push({name:"sSortDir_"+(f+d),value:a.aaSorting[f][1]})}for(f=0;f<b;f++){c.push({name:"bSortable_"+f,value:a.aoColumns[f].bSortable})}}return c}function ha(a,b){for(var c=0,d=a.aoServerParams.length;c<d;c++){a.aoServerParams[c].fn.call(a.oInstance,b)}}function Ea(a,b){if(typeof b.sEcho!="undefined"){if(b.sEcho*1<a.iDraw){return}else{a.iDraw=b.sEcho*1}}if(!a.oScroll.bInfinite||a.oScroll.bInfinite&&(a.bSorted||a.bFiltered)){la(a)}a._iRecordsTotal=b.iTotalRecords;a._iRecordsDisplay=b.iTotalDisplayRecords;var c=ka(a);if(c=typeof b.sColumns!="undefined"&&c!==""&&b.sColumns!=c){var d=Fa(a,b.sColumns)}b=aa(a.sAjaxDataProp)(b);for(var f=0,e=b.length;f<e;f++){if(c){for(var h=[],j=0,k=a.aoColumns.length;j<k;j++){h.push(b[f][d[j]])}v(a,h)}else{v(a,b[f])}}a.aiDisplay=a.aiDisplayMaster.slice();a.bAjaxDataGet=false;C(a);a.bAjaxDataGet=true;K(a,false)}function Aa(a){var b=p.createElement("div");a.nTable.parentNode.insertBefore(b,a.nTable);a.nTableWrapper=p.createElement("div");a.nTableWrapper.className=a.oClasses.sWrapper;a.sTableId!==""&&a.nTableWrapper.setAttribute("id",a.sTableId+"_wrapper");a.nTableReinsertBefore=a.nTable.nextSibling;for(var c=a.nTableWrapper,d=a.sDom.split(""),f,e,h,j,k,m,u,r=0;r<d.length;r++){e=0;h=d[r];if(h=="<"){j=p.createElement("div");k=d[r+1];if(k=="'"||k=='"'){m="";for(u=2;d[r+u]!=k;){m+=d[r+u];u++}if(m=="H"){m="fg-toolbar ui-toolbar ui-widget-header ui-corner-tl ui-corner-tr ui-helper-clearfix"}else{if(m=="F"){m="fg-toolbar ui-toolbar ui-widget-header ui-corner-bl ui-corner-br ui-helper-clearfix"}}if(m.indexOf(".")!=-1){k=m.split(".");j.setAttribute("id",k[0].substr(1,k[0].length-1));j.className=k[1]}else{if(m.charAt(0)=="#"){j.setAttribute("id",m.substr(1,m.length-1))}else{j.className=m}}r+=u}c.appendChild(j);c=j}else{if(h==">"){c=c.parentNode}else{if(h=="l"&&a.oFeatures.bPaginate&&a.oFeatures.bLengthChange){f=Ga(a);e=1}else{if(h=="f"&&a.oFeatures.bFilter){f=Ha(a);e=1}else{if(h=="r"&&a.oFeatures.bProcessing){f=Ia(a);e=1}else{if(h=="t"){f=Ja(a);e=1}else{if(h=="i"&&a.oFeatures.bInfo){f=Ka(a);e=1}else{if(h=="p"&&a.oFeatures.bPaginate){f=La(a);e=1}else{if(n.aoFeatures.length!==0){j=n.aoFeatures;u=0;for(k=j.length;u<k;u++){if(h==j[u].cFeature){if(f=j[u].fnInit(a)){e=1}break}}}}}}}}}}}if(e==1&&f!==null){if(typeof a.aanFeatures[h]!="object"){a.aanFeatures[h]=[]}a.aanFeatures[h].push(f);c.appendChild(f)}}b.parentNode.replaceChild(a.nTableWrapper,b)}function Ja(a){if(a.oScroll.sX===""&&a.oScroll.sY===""){return a.nTable}var b=p.createElement("div"),c=p.createElement("div"),d=p.createElement("div"),f=p.createElement("div"),e=p.createElement("div"),h=p.createElement("div"),j=a.nTable.cloneNode(false),k=a.nTable.cloneNode(false),m=a.nTable.getElementsByTagName("thead")[0],u=a.nTable.getElementsByTagName("tfoot").length===0?null:a.nTable.getElementsByTagName("tfoot")[0],r=typeof g.bJQueryUI!="undefined"&&g.bJQueryUI?n.oJUIClasses:n.oStdClasses;c.appendChild(d);e.appendChild(h);f.appendChild(a.nTable);b.appendChild(c);b.appendChild(f);d.appendChild(j);j.appendChild(m);if(u!==null){b.appendChild(e);h.appendChild(k);k.appendChild(u)}b.className=r.sScrollWrapper;c.className=r.sScrollHead;d.className=r.sScrollHeadInner;f.className=r.sScrollBody;e.className=r.sScrollFoot;h.className=r.sScrollFootInner;if(a.oScroll.bAutoCss){c.style.overflow="hidden";c.style.position="relative";e.style.overflow="hidden";f.style.overflow="auto"}c.style.border="0";c.style.width="100%";e.style.border="0";d.style.width="150%";j.removeAttribute("id");j.style.marginLeft="0";a.nTable.style.marginLeft="0";if(u!==null){k.removeAttribute("id");k.style.marginLeft="0"}d=i(a.nTable).children("caption");h=0;for(k=d.length;h<k;h++){j.appendChild(d[h])}if(a.oScroll.sX!==""){c.style.width=q(a.oScroll.sX);f.style.width=q(a.oScroll.sX);if(u!==null){e.style.width=q(a.oScroll.sX)}i(f).scroll(function(){c.scrollLeft=this.scrollLeft;if(u!==null){e.scrollLeft=this.scrollLeft}})}if(a.oScroll.sY!==""){f.style.height=q(a.oScroll.sY)}a.aoDrawCallback.push({fn:Ma,sName:"scrolling"});a.oScroll.bInfinite&&i(f).scroll(function(){if(!a.bDrawing){if(i(this).scrollTop()+i(this).height()>i(a.nTable).height()-a.oScroll.iLoadGap){if(a.fnDisplayEnd()<a.fnRecordsDisplay()){ma(a,"next");E(a);C(a)}}}});a.nScrollHead=c;a.nScrollFoot=e;return b}function Ma(a){var b=a.nScrollHead.getElementsByTagName("div")[0],c=b.getElementsByTagName("table")[0],d=a.nTable.parentNode,f,e,h,j,k,m,u,r,H=[],L=a.nTFoot!==null?a.nScrollFoot.getElementsByTagName("div")[0]:null,T=a.nTFoot!==null?L.getElementsByTagName("table")[0]:null,B=i.browser.msie&&i.browser.version<=7;h=a.nTable.getElementsByTagName("thead");h.length>0&&a.nTable.removeChild(h[0]);if(a.nTFoot!==null){k=a.nTable.getElementsByTagName("tfoot");k.length>0&&a.nTable.removeChild(k[0])}h=a.nTHead.cloneNode(true);a.nTable.insertBefore(h,a.nTable.childNodes[0]);if(a.nTFoot!==null){k=a.nTFoot.cloneNode(true);a.nTable.insertBefore(k,a.nTable.childNodes[1])}if(a.oScroll.sX===""){d.style.width="100%";b.parentNode.style.width="100%"}var U=S(a,h);f=0;for(e=U.length;f<e;f++){u=Na(a,f);U[f].style.width=a.aoColumns[u].sWidth}a.nTFoot!==null&&P(function(I){I.style.width=""},k.getElementsByTagName("tr"));f=i(a.nTable).outerWidth();if(a.oScroll.sX===""){a.nTable.style.width="100%";if(B&&(d.scrollHeight>d.offsetHeight||i(d).css("overflow-y")=="scroll")){a.nTable.style.width=q(i(a.nTable).outerWidth()-a.oScroll.iBarWidth)}}else{if(a.oScroll.sXInner!==""){a.nTable.style.width=q(a.oScroll.sXInner)}else{if(f==i(d).width()&&i(d).height()<i(a.nTable).height()){a.nTable.style.width=q(f-a.oScroll.iBarWidth);if(i(a.nTable).outerWidth()>f-a.oScroll.iBarWidth){a.nTable.style.width=q(f)}}else{a.nTable.style.width=q(f)}}}f=i(a.nTable).outerWidth();e=a.nTHead.getElementsByTagName("tr");h=h.getElementsByTagName("tr");P(function(I,na){m=I.style;m.paddingTop="0";m.paddingBottom="0";m.borderTopWidth="0";m.borderBottomWidth="0";m.height=0;r=i(I).width();na.style.width=q(r);H.push(r)},h,e);i(h).height(0);if(a.nTFoot!==null){j=k.getElementsByTagName("tr");k=a.nTFoot.getElementsByTagName("tr");P(function(I,na){m=I.style;m.paddingTop="0";m.paddingBottom="0";m.borderTopWidth="0";m.borderBottomWidth="0";m.height=0;r=i(I).width();na.style.width=q(r);H.push(r)},j,k);i(j).height(0)}P(function(I){I.innerHTML="";I.style.width=q(H.shift())},h);a.nTFoot!==null&&P(function(I){I.innerHTML="";I.style.width=q(H.shift())},j);if(i(a.nTable).outerWidth()<f){j=d.scrollHeight>d.offsetHeight||i(d).css("overflow-y")=="scroll"?f+a.oScroll.iBarWidth:f;if(B&&(d.scrollHeight>d.offsetHeight||i(d).css("overflow-y")=="scroll")){a.nTable.style.width=q(j-a.oScroll.iBarWidth)}d.style.width=q(j);b.parentNode.style.width=q(j);if(a.nTFoot!==null){L.parentNode.style.width=q(j)}if(a.oScroll.sX===""){J(a,1,"The table cannot fit into the current element which will cause column misalignment. The table has been drawn at its minimum possible width.")}else{a.oScroll.sXInner!==""&&J(a,1,"The table cannot fit into the current element which will cause column misalignment. Increase the sScrollXInner value or remove it to allow automatic calculation")}}else{d.style.width=q("100%");b.parentNode.style.width=q("100%");if(a.nTFoot!==null){L.parentNode.style.width=q("100%")}}if(a.oScroll.sY===""){if(B){d.style.height=q(a.nTable.offsetHeight+a.oScroll.iBarWidth)}}if(a.oScroll.sY!==""&&a.oScroll.bCollapse){d.style.height=q(a.oScroll.sY);B=a.oScroll.sX!==""&&a.nTable.offsetWidth>d.offsetWidth?a.oScroll.iBarWidth:0;if(a.nTable.offsetHeight<d.offsetHeight){d.style.height=q(i(a.nTable).height()+B)}}B=i(a.nTable).outerWidth();c.style.width=q(B);b.style.width=q(B+a.oScroll.iBarWidth);if(a.nTFoot!==null){L.style.width=q(a.nTable.offsetWidth+a.oScroll.iBarWidth);T.style.width=q(a.nTable.offsetWidth)}if(a.bSorted||a.bFiltered){d.scrollTop=0}}function ea(a){if(a.oFeatures.bAutoWidth===false){return false}ga(a);for(var b=0,c=a.aoColumns.length;b<c;b++){a.aoColumns[b].nTh.style.width=a.aoColumns[b].sWidth}}function Ha(a){var b=a.oLanguage.sSearch;b=b.indexOf("_INPUT_")!==-1?b.replace("_INPUT_",'<input type="text" />'):b===""?'<input type="text" />':b+' <input type="text" />';var c=p.createElement("div");c.className=a.oClasses.sFilter;c.innerHTML="<label>"+b+"</label>";a.sTableId!==""&&typeof a.aanFeatures.f=="undefined"&&c.setAttribute("id",a.sTableId+"_filter");b=i("input",c);b.val(a.oPreviousSearch.sSearch.replace('"',"&quot;"));b.bind("keyup.DT",function(){for(var d=a.aanFeatures.f,f=0,e=d.length;f<e;f++){d[f]!=i(this).parents("div.dataTables_filter")[0]&&i("input",d[f]).val(this.value)}this.value!=a.oPreviousSearch.sSearch&&N(a,{sSearch:this.value,bRegex:a.oPreviousSearch.bRegex,bSmart:a.oPreviousSearch.bSmart})});b.bind("keypress.DT",function(d){if(d.keyCode==13){return false}});return c}function N(a,b,c){Oa(a,b.sSearch,c,b.bRegex,b.bSmart);for(b=0;b<a.aoPreSearchCols.length;b++){Pa(a,a.aoPreSearchCols[b].sSearch,b,a.aoPreSearchCols[b].bRegex,a.aoPreSearchCols[b].bSmart)}n.afnFiltering.length!==0&&Qa(a);a.bFiltered=true;i(a.oInstance).trigger("filter",a);a._iDisplayStart=0;E(a);C(a);oa(a,0)}function Qa(a){for(var b=n.afnFiltering,c=0,d=b.length;c<d;c++){for(var f=0,e=0,h=a.aiDisplay.length;e<h;e++){var j=a.aiDisplay[e-f];if(!b[c](a,fa(a,j,"filter"),j)){a.aiDisplay.splice(e-f,1);f++}}}}function Pa(a,b,c,d,f){if(b!==""){var e=0;b=pa(b,d,f);for(d=a.aiDisplay.length-1;d>=0;d--){f=qa(G(a,a.aiDisplay[d],c,"filter"),a.aoColumns[c].sType);if(!b.test(f)){a.aiDisplay.splice(d,1);e++}}}}function Oa(a,b,c,d,f){var e=pa(b,d,f);if(typeof c=="undefined"||c===null){c=0}if(n.afnFiltering.length!==0){c=1}if(b.length<=0){a.aiDisplay.splice(0,a.aiDisplay.length);a.aiDisplay=a.aiDisplayMaster.slice()}else{if(a.aiDisplay.length==a.aiDisplayMaster.length||a.oPreviousSearch.sSearch.length>b.length||c==1||b.indexOf(a.oPreviousSearch.sSearch)!==0){a.aiDisplay.splice(0,a.aiDisplay.length);oa(a,1);for(c=0;c<a.aiDisplayMaster.length;c++){e.test(a.asDataSearch[c])&&a.aiDisplay.push(a.aiDisplayMaster[c])}}else{var h=0;for(c=0;c<a.asDataSearch.length;c++){if(!e.test(a.asDataSearch[c])){a.aiDisplay.splice(c-h,1);h++}}}}a.oPreviousSearch.sSearch=b;a.oPreviousSearch.bRegex=d;a.oPreviousSearch.bSmart=f}function oa(a,b){if(!a.oFeatures.bServerSide){a.asDataSearch.splice(0,a.asDataSearch.length);b=typeof b!="undefined"&&b==1?a.aiDisplayMaster:a.aiDisplay;for(var c=0,d=b.length;c<d;c++){a.asDataSearch[c]=ra(a,fa(a,b[c],"filter"))}}}function ra(a,b){var c="";if(typeof a.__nTmpFilter=="undefined"){a.__nTmpFilter=p.createElement("div")}for(var d=a.__nTmpFilter,f=0,e=a.aoColumns.length;f<e;f++){if(a.aoColumns[f].bSearchable){c+=qa(b[f],a.aoColumns[f].sType)+"  "}}if(c.indexOf("&")!==-1){d.innerHTML=c;c=d.textContent?d.textContent:d.innerText;c=c.replace(/\n/g," ").replace(/\r/g,"")}return c}function pa(a,b,c){if(c){a=b?a.split(" "):sa(a).split(" ");a="^(?=.*?"+a.join(")(?=.*?")+").*$";return new RegExp(a,"i")}else{a=b?a:sa(a);return new RegExp(a,"i")}}function qa(a,b){if(typeof n.ofnSearch[b]=="function"){return n.ofnSearch[b](a)}else{if(b=="html"){return a.replace(/\n/g," ").replace(/<.*?>/g,"")}else{if(typeof a=="string"){return a.replace(/\n/g," ")}else{if(a===null){return""}}}}return a}function R(a,b){var c,d,f,e,h=[],j=[],k=n.oSort;d=a.aoData;var m=a.aoColumns;if(!a.oFeatures.bServerSide&&(a.aaSorting.length!==0||a.aaSortingFixed!==null)){h=a.aaSortingFixed!==null?a.aaSortingFixed.concat(a.aaSorting):a.aaSorting.slice();for(c=0;c<h.length;c++){var u=h[c][0];f=ta(a,u);e=a.aoColumns[u].sSortDataType;if(typeof n.afnSortData[e]!="undefined"){var r=n.afnSortData[e](a,u,f);f=0;for(e=d.length;f<e;f++){O(a,f,u,r[f])}}}c=0;for(d=a.aiDisplayMaster.length;c<d;c++){j[a.aiDisplayMaster[c]]=c}var H=h.length;a.aiDisplayMaster.sort(function(L,T){var B,U;for(c=0;c<H;c++){B=m[h[c][0]].iDataSort;U=m[B].sType;B=k[(U?U:"string")+"-"+h[c][1]](G(a,L,B,"sort"),G(a,T,B,"sort"));if(B!==0){return B}}return k["numeric-asc"](j[L],j[T])})}if((typeof b=="undefined"||b)&&!a.oFeatures.bDeferRender){V(a)}a.bSorted=true;i(a.oInstance).trigger("sort",a);if(a.oFeatures.bFilter){N(a,a.oPreviousSearch,1)}else{a.aiDisplay=a.aiDisplayMaster.slice();a._iDisplayStart=0;E(a);C(a)}}function ja(a,b,c,d){i(b).bind("click.DT",function(f){if(a.aoColumns[c].bSortable!==false){var e=function(){var h,j;if(f.shiftKey){for(var k=false,m=0;m<a.aaSorting.length;m++){if(a.aaSorting[m][0]==c){k=true;h=a.aaSorting[m][0];j=a.aaSorting[m][2]+1;if(typeof a.aoColumns[h].asSorting[j]=="undefined"){a.aaSorting.splice(m,1)}else{a.aaSorting[m][1]=a.aoColumns[h].asSorting[j];a.aaSorting[m][2]=j}break}}k===false&&a.aaSorting.push([c,a.aoColumns[c].asSorting[0],0])}else{if(a.aaSorting.length==1&&a.aaSorting[0][0]==c){h=a.aaSorting[0][0];j=a.aaSorting[0][2]+1;if(typeof a.aoColumns[h].asSorting[j]=="undefined"){j=0}a.aaSorting[0][1]=a.aoColumns[h].asSorting[j];a.aaSorting[0][2]=j}else{a.aaSorting.splice(0,a.aaSorting.length);a.aaSorting.push([c,a.aoColumns[c].asSorting[0],0])}}R(a)};if(a.oFeatures.bProcessing){K(a,true);setTimeout(function(){e();a.oFeatures.bServerSide||K(a,false)},0)}else{e()}typeof d=="function"&&d(a)}})}function V(a){var b,c,d,f,e,h=a.aoColumns.length,j=a.oClasses;for(b=0;b<h;b++){a.aoColumns[b].bSortable&&i(a.aoColumns[b].nTh).removeClass(j.sSortAsc+" "+j.sSortDesc+" "+a.aoColumns[b].sSortingClass)}f=a.aaSortingFixed!==null?a.aaSortingFixed.concat(a.aaSorting):a.aaSorting.slice();for(b=0;b<a.aoColumns.length;b++){if(a.aoColumns[b].bSortable){e=a.aoColumns[b].sSortingClass;d=-1;for(c=0;c<f.length;c++){if(f[c][0]==b){e=f[c][1]=="asc"?j.sSortAsc:j.sSortDesc;d=c;break}}i(a.aoColumns[b].nTh).addClass(e);if(a.bJUI){c=i("span",a.aoColumns[b].nTh);c.removeClass(j.sSortJUIAsc+" "+j.sSortJUIDesc+" "+j.sSortJUI+" "+j.sSortJUIAscAllowed+" "+j.sSortJUIDescAllowed);c.addClass(d==-1?a.aoColumns[b].sSortingClassJUI:f[d][1]=="asc"?j.sSortJUIAsc:j.sSortJUIDesc)}}else{i(a.aoColumns[b].nTh).addClass(a.aoColumns[b].sSortingClass)}}e=j.sSortColumn;if(a.oFeatures.bSort&&a.oFeatures.bSortClasses){d=Q(a);if(a.oFeatures.bDeferRender){i(d).removeClass(e+"1 "+e+"2 "+e+"3")}else{if(d.length>=h){for(b=0;b<h;b++){if(d[b].className.indexOf(e+"1")!=-1){c=0;for(a=d.length/h;c<a;c++){d[h*c+b].className=i.trim(d[h*c+b].className.replace(e+"1",""))}}else{if(d[b].className.indexOf(e+"2")!=-1){c=0;for(a=d.length/h;c<a;c++){d[h*c+b].className=i.trim(d[h*c+b].className.replace(e+"2",""))}}else{if(d[b].className.indexOf(e+"3")!=-1){c=0;for(a=d.length/h;c<a;c++){d[h*c+b].className=i.trim(d[h*c+b].className.replace(" "+e+"3",""))}}}}}}}j=1;var k;for(b=0;b<f.length;b++){k=parseInt(f[b][0],10);c=0;for(a=d.length/h;c<a;c++){d[h*c+k].className+=" "+e+j}j<3&&j++}}}function La(a){if(a.oScroll.bInfinite){return null}var b=p.createElement("div");b.className=a.oClasses.sPaging+a.sPaginationType;n.oPagination[a.sPaginationType].fnInit(a,b,function(c){E(c);C(c)});typeof a.aanFeatures.p=="undefined"&&a.aoDrawCallback.push({fn:function(c){n.oPagination[c.sPaginationType].fnUpdate(c,function(d){E(d);C(d)})},sName:"pagination"});return b}function ma(a,b){var c=a._iDisplayStart;if(b=="first"){a._iDisplayStart=0}else{if(b=="previous"){a._iDisplayStart=a._iDisplayLength>=0?a._iDisplayStart-a._iDisplayLength:0;if(a._iDisplayStart<0){a._iDisplayStart=0}}else{if(b=="next"){if(a._iDisplayLength>=0){if(a._iDisplayStart+a._iDisplayLength<a.fnRecordsDisplay()){a._iDisplayStart+=a._iDisplayLength}}else{a._iDisplayStart=0}}else{if(b=="last"){if(a._iDisplayLength>=0){b=parseInt((a.fnRecordsDisplay()-1)/a._iDisplayLength,10)+1;a._iDisplayStart=(b-1)*a._iDisplayLength}else{a._iDisplayStart=0}}else{J(a,0,"Unknown paging action: "+b)}}}}i(a.oInstance).trigger("page",a);return c!=a._iDisplayStart}function Ka(a){var b=p.createElement("div");b.className=a.oClasses.sInfo;if(typeof a.aanFeatures.i=="undefined"){a.aoDrawCallback.push({fn:Ra,sName:"information"});a.sTableId!==""&&b.setAttribute("id",a.sTableId+"_info")}return b}function Ra(a){if(!(!a.oFeatures.bInfo||a.aanFeatures.i.length===0)){var b=a._iDisplayStart+1,c=a.fnDisplayEnd(),d=a.fnRecordsTotal(),f=a.fnRecordsDisplay(),e=a.fnFormatNumber(b),h=a.fnFormatNumber(c),j=a.fnFormatNumber(d),k=a.fnFormatNumber(f);if(a.oScroll.bInfinite){e=a.fnFormatNumber(1)}e=a.fnRecordsDisplay()===0&&a.fnRecordsDisplay()==a.fnRecordsTotal()?a.oLanguage.sInfoEmpty+a.oLanguage.sInfoPostFix:a.fnRecordsDisplay()===0?a.oLanguage.sInfoEmpty+" "+a.oLanguage.sInfoFiltered.replace("_MAX_",j)+a.oLanguage.sInfoPostFix:a.fnRecordsDisplay()==a.fnRecordsTotal()?a.oLanguage.sInfo.replace("_START_",e).replace("_END_",h).replace("_TOTAL_",k)+a.oLanguage.sInfoPostFix:a.oLanguage.sInfo.replace("_START_",e).replace("_END_",h).replace("_TOTAL_",k)+" "+a.oLanguage.sInfoFiltered.replace("_MAX_",a.fnFormatNumber(a.fnRecordsTotal()))+a.oLanguage.sInfoPostFix;if(a.oLanguage.fnInfoCallback!==null){e=a.oLanguage.fnInfoCallback(a,b,c,d,f,e)}a=a.aanFeatures.i;b=0;for(c=a.length;b<c;b++){i(a[b]).html(e)}}}function Ga(a){if(a.oScroll.bInfinite){return null}var b='<select size="1" '+(a.sTableId===""?"":'name="'+a.sTableId+'_length"')+">",c,d;if(a.aLengthMenu.length==2&&typeof a.aLengthMenu[0]=="object"&&typeof a.aLengthMenu[1]=="object"){c=0;for(d=a.aLengthMenu[0].length;c<d;c++){b+='<option value="'+a.aLengthMenu[0][c]+'">'+a.aLengthMenu[1][c]+"</option>"}}else{c=0;for(d=a.aLengthMenu.length;c<d;c++){b+='<option value="'+a.aLengthMenu[c]+'">'+a.aLengthMenu[c]+"</option>"}}b+="</select>";var f=p.createElement("div");a.sTableId!==""&&typeof a.aanFeatures.l=="undefined"&&f.setAttribute("id",a.sTableId+"_length");f.className=a.oClasses.sLength;f.innerHTML="<label>"+a.oLanguage.sLengthMenu.replace("_MENU_",b)+"</label>";i('select option[value="'+a._iDisplayLength+'"]',f).attr("selected",true);i("select",f).bind("change.DT",function(){var e=i(this).val(),h=a.aanFeatures.l;c=0;for(d=h.length;c<d;c++){h[c]!=this.parentNode&&i("select",h[c]).val(e)}a._iDisplayLength=parseInt(e,10);E(a);if(a.fnDisplayEnd()==a.fnRecordsDisplay()){a._iDisplayStart=a.fnDisplayEnd()-a._iDisplayLength;if(a._iDisplayStart<0){a._iDisplayStart=0}}if(a._iDisplayLength==-1){a._iDisplayStart=0}C(a)});return f}function Ia(a){var b=p.createElement("div");a.sTableId!==""&&typeof a.aanFeatures.r=="undefined"&&b.setAttribute("id",a.sTableId+"_processing");b.innerHTML=a.oLanguage.sProcessing;b.className=a.oClasses.sProcessing;a.nTable.parentNode.insertBefore(b,a.nTable);return b}function K(a,b){if(a.oFeatures.bProcessing){a=a.aanFeatures.r;for(var c=0,d=a.length;c<d;c++){a[c].style.visibility=b?"visible":"hidden"}}}function Na(a,b){for(var c=-1,d=0;d<a.aoColumns.length;d++){a.aoColumns[d].bVisible===true&&c++;if(c==b){return d}}return null}function ta(a,b){for(var c=-1,d=0;d<a.aoColumns.length;d++){a.aoColumns[d].bVisible===true&&c++;if(d==b){return a.aoColumns[d].bVisible===true?c:null}}return null}function W(a,b){var c,d;c=a._iDisplayStart;for(d=a._iDisplayEnd;c<d;c++){if(a.aoData[a.aiDisplay[c]].nTr==b){return a.aiDisplay[c]}}c=0;for(d=a.aoData.length;c<d;c++){if(a.aoData[c].nTr==b){return c}}return null}function Z(a){for(var b=0,c=0;c<a.aoColumns.length;c++){a.aoColumns[c].bVisible===true&&b++}return b}function E(a){a._iDisplayEnd=a.oFeatures.bPaginate===false?a.aiDisplay.length:a._iDisplayStart+a._iDisplayLength>a.aiDisplay.length||a._iDisplayLength==-1?a.aiDisplay.length:a._iDisplayStart+a._iDisplayLength}function Sa(a,b){if(!a||a===null||a===""){return 0}if(typeof b=="undefined"){b=p.getElementsByTagName("body")[0]}var c=p.createElement("div");c.style.width=q(a);b.appendChild(c);a=c.offsetWidth;b.removeChild(c);return a}function ga(a){var b=0,c,d=0,f=a.aoColumns.length,e,h=i("th",a.nTHead);for(e=0;e<f;e++){if(a.aoColumns[e].bVisible){d++;if(a.aoColumns[e].sWidth!==null){c=Sa(a.aoColumns[e].sWidthOrig,a.nTable.parentNode);if(c!==null){a.aoColumns[e].sWidth=q(c)}b++}}}if(f==h.length&&b===0&&d==f&&a.oScroll.sX===""&&a.oScroll.sY===""){for(e=0;e<a.aoColumns.length;e++){c=i(h[e]).width();if(c!==null){a.aoColumns[e].sWidth=q(c)}}}else{b=a.nTable.cloneNode(false);e=a.nTHead.cloneNode(true);d=p.createElement("tbody");c=p.createElement("tr");b.removeAttribute("id");b.appendChild(e);if(a.nTFoot!==null){b.appendChild(a.nTFoot.cloneNode(true));P(function(k){k.style.width=""},b.getElementsByTagName("tr"))}b.appendChild(d);d.appendChild(c);d=i("thead th",b);if(d.length===0){d=i("tbody tr:eq(0)>td",b)}h=S(a,e);for(e=d=0;e<f;e++){var j=a.aoColumns[e];if(j.bVisible&&j.sWidthOrig!==null&&j.sWidthOrig!==""){h[e-d].style.width=q(j.sWidthOrig)}else{if(j.bVisible){h[e-d].style.width=""}else{d++}}}for(e=0;e<f;e++){if(a.aoColumns[e].bVisible){d=Ta(a,e);if(d!==null){d=d.cloneNode(true);if(a.aoColumns[e].sContentPadding!==""){d.innerHTML+=a.aoColumns[e].sContentPadding}c.appendChild(d)}}}f=a.nTable.parentNode;f.appendChild(b);if(a.oScroll.sX!==""&&a.oScroll.sXInner!==""){b.style.width=q(a.oScroll.sXInner)}else{if(a.oScroll.sX!==""){b.style.width="";if(i(b).width()<f.offsetWidth){b.style.width=q(f.offsetWidth)}}else{if(a.oScroll.sY!==""){b.style.width=q(f.offsetWidth)}}}b.style.visibility="hidden";Ua(a,b);f=i("tbody tr:eq(0)",b).children();if(f.length===0){f=S(a,i("thead",b)[0])}if(a.oScroll.sX!==""){for(e=d=c=0;e<a.aoColumns.length;e++){if(a.aoColumns[e].bVisible){c+=a.aoColumns[e].sWidthOrig===null?i(f[d]).outerWidth():parseInt(a.aoColumns[e].sWidth.replace("px",""),10)+(i(f[d]).outerWidth()-i(f[d]).width());d++}}b.style.width=q(c);a.nTable.style.width=q(c)}for(e=d=0;e<a.aoColumns.length;e++){if(a.aoColumns[e].bVisible){c=i(f[d]).width();if(c!==null&&c>0){a.aoColumns[e].sWidth=q(c)}d++}}a.nTable.style.width=q(i(b).outerWidth());b.parentNode.removeChild(b)}}function Ua(a,b){if(a.oScroll.sX===""&&a.oScroll.sY!==""){i(b).width();b.style.width=q(i(b).outerWidth()-a.oScroll.iBarWidth)}else{if(a.oScroll.sX!==""){b.style.width=q(i(b).outerWidth())}}}function Ta(a,b){var c=Va(a,b);if(c<0){return null}if(a.aoData[c].nTr===null){var d=p.createElement("td");d.innerHTML=G(a,c,b,"");return d}return Q(a,c)[b]}function Va(a,b){for(var c=-1,d=-1,f=0;f<a.aoData.length;f++){var e=G(a,f,b,"display")+"";e=e.replace(/<.*?>/g,"");if(e.length>c){c=e.length;d=f}}return d}function q(a){if(a===null){return"0px"}if(typeof a=="number"){if(a<0){return"0px"}return a+"px"}var b=a.charCodeAt(a.length-1);if(b<48||b>57){return a}return a+"px"}function Za(a,b){if(a.length!=b.length){return 1}for(var c=0;c<a.length;c++){if(a[c]!=b[c]){return 2}}return 0}function ia(a){for(var b=n.aTypes,c=b.length,d=0;d<c;d++){var f=b[d](a);if(f!==null){return f}}return"string"}function A(a){for(var b=0;b<D.length;b++){if(D[b].nTable==a){return D[b]}}return null}function ca(a){for(var b=[],c=a.aoData.length,d=0;d<c;d++){b.push(a.aoData[d]._aData)}return b}function ba(a){for(var b=[],c=0,d=a.aoData.length;c<d;c++){a.aoData[c].nTr!==null&&b.push(a.aoData[c].nTr)}return b}function Q(a,b){var c=[],d,f,e,h,j;f=0;var k=a.aoData.length;if(typeof b!="undefined"){f=b;k=b+1}for(f=f;f<k;f++){j=a.aoData[f];if(j.nTr!==null){b=[];e=0;for(h=j.nTr.childNodes.length;e<h;e++){d=j.nTr.childNodes[e].nodeName.toLowerCase();if(d=="td"||d=="th"){b.push(j.nTr.childNodes[e])}}e=d=0;for(h=a.aoColumns.length;e<h;e++){if(a.aoColumns[e].bVisible){c.push(b[e-d])}else{c.push(j._anHidden[e]);d++}}}}return c}function sa(a){return a.replace(new RegExp("(\\/|\\.|\\*|\\+|\\?|\\||\\(|\\)|\\[|\\]|\\{|\\}|\\\\|\\$|\\^)","g"),"\\$1")}function ua(a,b){for(var c=-1,d=0,f=a.length;d<f;d++){if(a[d]==b){c=d}else{a[d]>b&&a[d]--}}c!=-1&&a.splice(c,1)}function Fa(a,b){b=b.split(",");for(var c=[],d=0,f=a.aoColumns.length;d<f;d++){for(var e=0;e<f;e++){if(a.aoColumns[d].sName==b[e]){c.push(e);break}}}return c}function ka(a){for(var b="",c=0,d=a.aoColumns.length;c<d;c++){b+=a.aoColumns[c].sName+","}if(b.length==d){return""}return b.slice(0,-1)}function J(a,b,c){a=a.sTableId===""?"DataTables warning: "+c:"DataTables warning (table id = '"+a.sTableId+"'): "+c;if(b===0){if(n.sErrMode=="alert"){alert(a)}else{throw a}}else{typeof console!="undefined"&&typeof console.log!="undefined"&&console.log(a)}}function la(a){a.aoData.splice(0,a.aoData.length);a.aiDisplayMaster.splice(0,a.aiDisplayMaster.length);a.aiDisplay.splice(0,a.aiDisplay.length);E(a)}function va(a){if(!(!a.oFeatures.bStateSave||typeof a.bDestroying!="undefined")){var b,c,d,f="{";f+='"iCreate":'+(new Date).getTime()+",";f+='"iStart":'+(a.oScroll.bInfinite?0:a._iDisplayStart)+",";f+='"iEnd":'+(a.oScroll.bInfinite?a._iDisplayLength:a._iDisplayEnd)+",";f+='"iLength":'+a._iDisplayLength+",";f+='"sFilter":"'+encodeURIComponent(a.oPreviousSearch.sSearch)+'",';f+='"sFilterEsc":'+!a.oPreviousSearch.bRegex+",";f+='"aaSorting":[ ';for(b=0;b<a.aaSorting.length;b++){f+="["+a.aaSorting[b][0]+',"'+a.aaSorting[b][1]+'"],'}f=f.substring(0,f.length-1);f+="],";f+='"aaSearchCols":[ ';for(b=0;b<a.aoPreSearchCols.length;b++){f+='["'+encodeURIComponent(a.aoPreSearchCols[b].sSearch)+'",'+!a.aoPreSearchCols[b].bRegex+"],"}f=f.substring(0,f.length-1);f+="],";f+='"abVisCols":[ ';for(b=0;b<a.aoColumns.length;b++){f+=a.aoColumns[b].bVisible+","}f=f.substring(0,f.length-1);f+="]";b=0;for(c=a.aoStateSave.length;b<c;b++){d=a.aoStateSave[b].fn(a,f);if(d!==""){f=d}}f+="}";Wa(a.sCookiePrefix+a.sInstance,f,a.iCookieDuration,a.sCookiePrefix,a.fnCookieCallback)}}function Xa(a,b){if(a.oFeatures.bStateSave){var c,d,f;d=wa(a.sCookiePrefix+a.sInstance);if(d!==null&&d!==""){try{c=typeof i.parseJSON=="function"?i.parseJSON(d.replace(/'/g,'"')):eval("("+d+")")}catch(e){return}d=0;for(f=a.aoStateLoad.length;d<f;d++){if(!a.aoStateLoad[d].fn(a,c)){return}}a.oLoadedState=i.extend(true,{},c);a._iDisplayStart=c.iStart;a.iInitDisplayStart=c.iStart;a._iDisplayEnd=c.iEnd;a._iDisplayLength=c.iLength;a.oPreviousSearch.sSearch=decodeURIComponent(c.sFilter);a.aaSorting=c.aaSorting.slice();a.saved_aaSorting=c.aaSorting.slice();if(typeof c.sFilterEsc!="undefined"){a.oPreviousSearch.bRegex=!c.sFilterEsc}if(typeof c.aaSearchCols!="undefined"){for(d=0;d<c.aaSearchCols.length;d++){a.aoPreSearchCols[d]={sSearch:decodeURIComponent(c.aaSearchCols[d][0]),bRegex:!c.aaSearchCols[d][1]}}}if(typeof c.abVisCols!="undefined"){b.saved_aoColumns=[];for(d=0;d<c.abVisCols.length;d++){b.saved_aoColumns[d]={};b.saved_aoColumns[d].bVisible=c.abVisCols[d]}}}}}function Wa(a,b,c,d,f){var e=new Date;e.setTime(e.getTime()+c*1000);c=za.location.pathname.split("/");a=a+"_"+c.pop().replace(/[\/:]/g,"").toLowerCase();var h;if(f!==null){h=typeof i.parseJSON=="function"?i.parseJSON(b):eval("("+b+")");b=f(a,h,e.toGMTString(),c.join("/")+"/")}else{b=a+"="+encodeURIComponent(b)+"; expires="+e.toGMTString()+"; path="+c.join("/")+"/"}f="";e=9999999999999;if((wa(a)!==null?p.cookie.length:b.length+p.cookie.length)+10>4096){a=p.cookie.split(";");for(var j=0,k=a.length;j<k;j++){if(a[j].indexOf(d)!=-1){var m=a[j].split("=");try{h=eval("("+decodeURIComponent(m[1])+")")}catch(u){continue}if(typeof h.iCreate!="undefined"&&h.iCreate<e){f=m[0];e=h.iCreate}}}if(f!==""){p.cookie=f+"=; expires=Thu, 01-Jan-1970 00:00:01 GMT; path="+c.join("/")+"/"}}p.cookie=b}function wa(a){var b=za.location.pathname.split("/");a=a+"_"+b[b.length-1].replace(/[\/:]/g,"").toLowerCase()+"=";b=p.cookie.split(";");for(var c=0;c<b.length;c++){for(var d=b[c];d.charAt(0)==" ";){d=d.substring(1,d.length)}if(d.indexOf(a)===0){return decodeURIComponent(d.substring(a.length,d.length))}}return null}function Y(a,b){b=i(b).children("tr");var c,d,f,e,h,j,k,m,u=function(L,T,B){for(;typeof L[T][B]!="undefined";){B++}return B};a.splice(0,a.length);d=0;for(j=b.length;d<j;d++){a.push([])}d=0;for(j=b.length;d<j;d++){f=0;for(k=b[d].childNodes.length;f<k;f++){c=b[d].childNodes[f];if(c.nodeName.toUpperCase()=="TD"||c.nodeName.toUpperCase()=="TH"){var r=c.getAttribute("colspan")*1,H=c.getAttribute("rowspan")*1;r=!r||r===0||r===1?1:r;H=!H||H===0||H===1?1:H;m=u(a,d,0);for(h=0;h<r;h++){for(e=0;e<H;e++){a[d+e][m+h]={cell:c,unique:r==1?true:false};a[d+e].nTr=b[d]}}}}}}function S(a,b,c){var d=[];if(typeof c=="undefined"){c=a.aoHeader;if(typeof b!="undefined"){c=[];Y(c,b)}}b=0;for(var f=c.length;b<f;b++){for(var e=0,h=c[b].length;e<h;e++){if(c[b][e].unique&&(typeof d[e]=="undefined"||!a.bSortCellsTop)){d[e]=c[b][e].cell}}}return d}function Ya(){var a=p.createElement("p"),b=a.style;b.width="100%";b.height="200px";b.padding="0px";var c=p.createElement("div");b=c.style;b.position="absolute";b.top="0px";b.left="0px";b.visibility="hidden";b.width="200px";b.height="150px";b.padding="0px";b.overflow="hidden";c.appendChild(a);p.body.appendChild(c);b=a.offsetWidth;c.style.overflow="scroll";a=a.offsetWidth;if(b==a){a=c.clientWidth}p.body.removeChild(c);return b-a}function P(a,b,c){for(var d=0,f=b.length;d<f;d++){for(var e=0,h=b[d].childNodes.length;e<h;e++){if(b[d].childNodes[e].nodeType==1){typeof c!="undefined"?a(b[d].childNodes[e],c[d].childNodes[e]):a(b[d].childNodes[e])}}}}function o(a,b,c,d){if(typeof d=="undefined"){d=c}if(typeof b[c]!="undefined"){a[d]=b[c]}}function fa(a,b,c){for(var d=[],f=0,e=a.aoColumns.length;f<e;f++){d.push(G(a,b,f,c))}return d}function G(a,b,c,d){var f=a.aoColumns[c];if((c=f.fnGetData(a.aoData[b]._aData))===undefined){if(a.iDrawError!=a.iDraw&&f.sDefaultContent===null){J(a,0,"Requested unknown parameter '"+f.mDataProp+"' from the data source for row "+b);a.iDrawError=a.iDraw}return f.sDefaultContent}if(c===null&&f.sDefaultContent!==null){c=f.sDefaultContent}else{if(typeof c=="function"){return c()}}if(d=="display"&&c===null){return""}return c}function O(a,b,c,d){a.aoColumns[c].fnSetData(a.aoData[b]._aData,d)}function aa(a){if(a===null){return function(){return null}}else{if(typeof a=="function"){return function(c){return a(c)}}else{if(typeof a=="string"&&a.indexOf(".")!=-1){var b=a.split(".");return b.length==2?function(c){return c[b[0]][b[1]]}:b.length==3?function(c){return c[b[0]][b[1]][b[2]]}:function(c){for(var d=0,f=b.length;d<f;d++){c=c[b[d]]}return c}}else{return function(c){return c[a]}}}}}function Ba(a){if(a===null){return function(){}}else{if(typeof a=="function"){return function(c,d){return a(c,d)}}else{if(typeof a=="string"&&a.indexOf(".")!=-1){var b=a.split(".");return b.length==2?function(c,d){c[b[0]][b[1]]=d}:b.length==3?function(c,d){c[b[0]][b[1]][b[2]]=d}:function(c,d){for(var f=0,e=b.length-1;f<e;f++){c=c[b[f]]}c[b[b.length-1]]=d}}else{return function(c,d){c[a]=d}}}}}this.oApi={};this.fnDraw=function(a){var b=A(this[n.iApiIndex]);if(typeof a!="undefined"&&a===false){E(b);C(b)}else{da(b)}};this.fnFilter=function(a,b,c,d,f){var e=A(this[n.iApiIndex]);if(e.oFeatures.bFilter){if(typeof c=="undefined"){c=false}if(typeof d=="undefined"){d=true}if(typeof f=="undefined"){f=true}if(typeof b=="undefined"||b===null){N(e,{sSearch:a,bRegex:c,bSmart:d},1);if(f&&typeof e.aanFeatures.f!="undefined"){b=e.aanFeatures.f;c=0;for(d=b.length;c<d;c++){i("input",b[c]).val(a)}}}else{e.aoPreSearchCols[b].sSearch=a;e.aoPreSearchCols[b].bRegex=c;e.aoPreSearchCols[b].bSmart=d;N(e,e.oPreviousSearch,1)}}};this.fnSettings=function(){return A(this[n.iApiIndex])};this.fnVersionCheck=n.fnVersionCheck;this.fnSort=function(a){var b=A(this[n.iApiIndex]);b.aaSorting=a;R(b)};this.fnSortListener=function(a,b,c){ja(A(this[n.iApiIndex]),a,b,c)};this.fnAddData=function(a,b){if(a.length===0){return[]}var c=[],d,f=A(this[n.iApiIndex]);if(typeof a[0]=="object"){for(var e=0;e<a.length;e++){d=v(f,a[e]);if(d==-1){return c}c.push(d)}}else{d=v(f,a);if(d==-1){return c}c.push(d)}f.aiDisplay=f.aiDisplayMaster.slice();if(typeof b=="undefined"||b){da(f)}return c};this.fnDeleteRow=function(a,b,c){var d=A(this[n.iApiIndex]);a=typeof a=="object"?W(d,a):a;var f=d.aoData.splice(a,1),e=i.inArray(a,d.aiDisplay);d.asDataSearch.splice(e,1);ua(d.aiDisplayMaster,a);ua(d.aiDisplay,a);typeof b=="function"&&b.call(this,d,f);if(d._iDisplayStart>=d.aiDisplay.length){d._iDisplayStart-=d._iDisplayLength;if(d._iDisplayStart<0){d._iDisplayStart=0}}if(typeof c=="undefined"||c){E(d);C(d)}return f};this.fnClearTable=function(a){var b=A(this[n.iApiIndex]);la(b);if(typeof a=="undefined"||a){C(b)}};this.fnOpen=function(a,b,c){var d=A(this[n.iApiIndex]);this.fnClose(a);var f=p.createElement("tr"),e=p.createElement("td");f.appendChild(e);e.className=c;e.colSpan=Z(d);if(typeof b.jquery!="undefined"||typeof b=="object"){e.appendChild(b)}else{e.innerHTML=b}b=i("tr",d.nTBody);i.inArray(a,b)!=-1&&i(f).insertAfter(a);d.aoOpenRows.push({nTr:f,nParent:a});return f};this.fnClose=function(a){for(var b=A(this[n.iApiIndex]),c=0;c<b.aoOpenRows.length;c++){if(b.aoOpenRows[c].nParent==a){(a=b.aoOpenRows[c].nTr.parentNode)&&a.removeChild(b.aoOpenRows[c].nTr);b.aoOpenRows.splice(c,1);return 0}}return 1};this.fnGetData=function(a,b){var c=A(this[n.iApiIndex]);if(typeof a!="undefined"){a=typeof a=="object"?W(c,a):a;if(typeof b!="undefined"){return G(c,a,b,"")}return typeof c.aoData[a]!="undefined"?c.aoData[a]._aData:null}return ca(c)};this.fnGetNodes=function(a){var b=A(this[n.iApiIndex]);if(typeof a!="undefined"){return typeof b.aoData[a]!="undefined"?b.aoData[a].nTr:null}return ba(b)};this.fnGetPosition=function(a){var b=A(this[n.iApiIndex]),c=a.nodeName.toUpperCase();if(c=="TR"){return W(b,a)}else{if(c=="TD"||c=="TH"){c=W(b,a.parentNode);for(var d=Q(b,c),f=0;f<b.aoColumns.length;f++){if(d[f]==a){return[c,ta(b,f),f]}}}}return null};this.fnUpdate=function(a,b,c,d,f){var e=A(this[n.iApiIndex]);b=typeof b=="object"?W(e,b):b;if(i.isArray(a)&&typeof a=="object"){e.aoData[b]._aData=a.slice();for(c=0;c<e.aoColumns.length;c++){this.fnUpdate(G(e,b,c),b,c,false,false)}}else{if(a!==null&&typeof a=="object"){e.aoData[b]._aData=i.extend(true,{},a);for(c=0;c<e.aoColumns.length;c++){this.fnUpdate(G(e,b,c),b,c,false,false)}}else{a=a;O(e,b,c,a);if(e.aoColumns[c].fnRender!==null){a=e.aoColumns[c].fnRender({iDataRow:b,iDataColumn:c,aData:e.aoData[b]._aData,oSettings:e});e.aoColumns[c].bUseRendered&&O(e,b,c,a)}if(e.aoData[b].nTr!==null){Q(e,b)[c].innerHTML=a}}}c=i.inArray(b,e.aiDisplay);e.asDataSearch[c]=ra(e,fa(e,b,"filter"));if(typeof f=="undefined"||f){ea(e)}if(typeof d=="undefined"||d){da(e)}return 0};this.fnSetColumnVis=function(a,b,c){var d=A(this[n.iApiIndex]),f,e;e=d.aoColumns.length;var h,j;if(d.aoColumns[a].bVisible!=b){if(b){for(f=j=0;f<a;f++){d.aoColumns[f].bVisible&&j++}j=j>=Z(d);if(!j){for(f=a;f<e;f++){if(d.aoColumns[f].bVisible){h=f;break}}}f=0;for(e=d.aoData.length;f<e;f++){if(d.aoData[f].nTr!==null){j?d.aoData[f].nTr.appendChild(d.aoData[f]._anHidden[a]):d.aoData[f].nTr.insertBefore(d.aoData[f]._anHidden[a],Q(d,f)[h])}}}else{f=0;for(e=d.aoData.length;f<e;f++){if(d.aoData[f].nTr!==null){h=Q(d,f)[a];d.aoData[f]._anHidden[a]=h;h.parentNode.removeChild(h)}}}d.aoColumns[a].bVisible=b;M(d,d.aoHeader);d.nTFoot&&M(d,d.aoFooter);f=0;for(e=d.aoOpenRows.length;f<e;f++){d.aoOpenRows[f].nTr.colSpan=Z(d)}if(typeof c=="undefined"||c){ea(d);C(d)}va(d)}};this.fnPageChange=function(a,b){var c=A(this[n.iApiIndex]);ma(c,a);E(c);if(typeof b=="undefined"||b){C(c)}};this.fnDestroy=function(){var a=A(this[n.iApiIndex]),b=a.nTableWrapper.parentNode,c=a.nTBody,d,f;a.bDestroying=true;d=0;for(f=a.aoDestroyCallback.length;d<f;d++){a.aoDestroyCallback[d].fn()}d=0;for(f=a.aoColumns.length;d<f;d++){a.aoColumns[d].bVisible===false&&this.fnSetColumnVis(d,true)}i(a.nTableWrapper).find("*").andSelf().unbind(".DT");i("tbody>tr>td."+a.oClasses.sRowEmpty,a.nTable).parent().remove();if(a.nTable!=a.nTHead.parentNode){i(a.nTable).children("thead").remove();a.nTable.appendChild(a.nTHead)}if(a.nTFoot&&a.nTable!=a.nTFoot.parentNode){i(a.nTable).children("tfoot").remove();a.nTable.appendChild(a.nTFoot)}a.nTable.parentNode.removeChild(a.nTable);i(a.nTableWrapper).remove();a.aaSorting=[];a.aaSortingFixed=[];V(a);i(ba(a)).removeClass(a.asStripeClasses.join(" "));if(a.bJUI){i("th",a.nTHead).removeClass([n.oStdClasses.sSortable,n.oJUIClasses.sSortableAsc,n.oJUIClasses.sSortableDesc,n.oJUIClasses.sSortableNone].join(" "));i("th span."+n.oJUIClasses.sSortIcon,a.nTHead).remove();i("th",a.nTHead).each(function(){var e=i("div."+n.oJUIClasses.sSortJUIWrapper,this),h=e.contents();i(this).append(h);e.remove()})}else{i("th",a.nTHead).removeClass([n.oStdClasses.sSortable,n.oStdClasses.sSortableAsc,n.oStdClasses.sSortableDesc,n.oStdClasses.sSortableNone].join(" "))}a.nTableReinsertBefore?b.insertBefore(a.nTable,a.nTableReinsertBefore):b.appendChild(a.nTable);d=0;for(f=a.aoData.length;d<f;d++){a.aoData[d].nTr!==null&&c.appendChild(a.aoData[d].nTr)}if(a.oFeatures.bAutoWidth===true){a.nTable.style.width=q(a.sDestroyWidth)}i(c).children("tr:even").addClass(a.asDestroyStripes[0]);i(c).children("tr:odd").addClass(a.asDestroyStripes[1]);d=0;for(f=D.length;d<f;d++){D[d]==a&&D.splice(d,1)}a=null};this.fnAdjustColumnSizing=function(a){var b=A(this[n.iApiIndex]);ea(b);if(typeof a=="undefined"||a){this.fnDraw(false)}else{if(b.oScroll.sX!==""||b.oScroll.sY!==""){this.oApi._fnScrollDraw(b)}}};for(var xa in n.oApi){if(xa){this[xa]=s(xa)}}this.oApi._fnExternApiFunc=s;this.oApi._fnInitialise=t;this.oApi._fnInitComplete=w;this.oApi._fnLanguageProcess=y;this.oApi._fnAddColumn=F;this.oApi._fnColumnOptions=x;this.oApi._fnAddData=v;this.oApi._fnCreateTr=z;this.oApi._fnGatherData=$;this.oApi._fnBuildHead=X;this.oApi._fnDrawHead=M;this.oApi._fnDraw=C;this.oApi._fnReDraw=da;this.oApi._fnAjaxUpdate=Ca;this.oApi._fnAjaxParameters=Da;this.oApi._fnAjaxUpdateDraw=Ea;this.oApi._fnServerParams=ha;this.oApi._fnAddOptionsHtml=Aa;this.oApi._fnFeatureHtmlTable=Ja;this.oApi._fnScrollDraw=Ma;this.oApi._fnAdjustColumnSizing=ea;this.oApi._fnFeatureHtmlFilter=Ha;this.oApi._fnFilterComplete=N;this.oApi._fnFilterCustom=Qa;this.oApi._fnFilterColumn=Pa;this.oApi._fnFilter=Oa;this.oApi._fnBuildSearchArray=oa;this.oApi._fnBuildSearchRow=ra;this.oApi._fnFilterCreateSearch=pa;this.oApi._fnDataToSearch=qa;this.oApi._fnSort=R;this.oApi._fnSortAttachListener=ja;this.oApi._fnSortingClasses=V;this.oApi._fnFeatureHtmlPaginate=La;this.oApi._fnPageChange=ma;this.oApi._fnFeatureHtmlInfo=Ka;this.oApi._fnUpdateInfo=Ra;this.oApi._fnFeatureHtmlLength=Ga;this.oApi._fnFeatureHtmlProcessing=Ia;this.oApi._fnProcessingDisplay=K;this.oApi._fnVisibleToColumnIndex=Na;this.oApi._fnColumnIndexToVisible=ta;this.oApi._fnNodeToDataIndex=W;this.oApi._fnVisbleColumns=Z;this.oApi._fnCalculateEnd=E;this.oApi._fnConvertToWidth=Sa;this.oApi._fnCalculateColumnWidths=ga;this.oApi._fnScrollingWidthAdjust=Ua;this.oApi._fnGetWidestNode=Ta;this.oApi._fnGetMaxLenString=Va;this.oApi._fnStringToCss=q;this.oApi._fnArrayCmp=Za;this.oApi._fnDetectType=ia;this.oApi._fnSettingsFromNode=A;this.oApi._fnGetDataMaster=ca;this.oApi._fnGetTrNodes=ba;this.oApi._fnGetTdNodes=Q;this.oApi._fnEscapeRegex=sa;this.oApi._fnDeleteIndex=ua;this.oApi._fnReOrderIndex=Fa;this.oApi._fnColumnOrdering=ka;this.oApi._fnLog=J;this.oApi._fnClearTable=la;this.oApi._fnSaveState=va;this.oApi._fnLoadState=Xa;this.oApi._fnCreateCookie=Wa;this.oApi._fnReadCookie=wa;this.oApi._fnDetectHeader=Y;this.oApi._fnGetUniqueThs=S;this.oApi._fnScrollBarWidth=Ya;this.oApi._fnApplyToChildren=P;this.oApi._fnMap=o;this.oApi._fnGetRowData=fa;this.oApi._fnGetCellData=G;this.oApi._fnSetCellData=O;this.oApi._fnGetObjectDataFn=aa;this.oApi._fnSetObjectDataFn=Ba;var ya=this;return this.each(function(){var a=0,b,c,d,f;a=0;for(b=D.length;a<b;a++){if(D[a].nTable==this){if(typeof g=="undefined"||typeof g.bRetrieve!="undefined"&&g.bRetrieve===true){return D[a].oInstance}else{if(typeof g.bDestroy!="undefined"&&g.bDestroy===true){D[a].oInstance.fnDestroy();break}else{J(D[a],0,"Cannot reinitialise DataTable.\n\nTo retrieve the DataTables object for this table, please pass either no arguments to the dataTable() function, or set bRetrieve to true. Alternatively, to destory the old table and create a new one, set bDestroy to true (note that a lot of changes to the configuration can be made through the API which is usually much faster).");return}}}if(D[a].sTableId!==""&&D[a].sTableId==this.getAttribute("id")){D.splice(a,1);break}}var e=new l;D.push(e);var h=false,j=false;a=this.getAttribute("id");if(a!==null){e.sTableId=a;e.sInstance=a}else{e.sInstance=n._oExternConfig.iNextUnique++}if(this.nodeName.toLowerCase()!="table"){J(e,0,"Attempted to initialise DataTables on a node which is not a table: "+this.nodeName)}else{e.nTable=this;e.oInstance=ya.length==1?ya:i(this).dataTable();e.oApi=ya.oApi;e.sDestroyWidth=i(this).width();if(typeof g!="undefined"&&g!==null){e.oInit=g;o(e.oFeatures,g,"bPaginate");o(e.oFeatures,g,"bLengthChange");o(e.oFeatures,g,"bFilter");o(e.oFeatures,g,"bSort");o(e.oFeatures,g,"bInfo");o(e.oFeatures,g,"bProcessing");o(e.oFeatures,g,"bAutoWidth");o(e.oFeatures,g,"bSortClasses");o(e.oFeatures,g,"bServerSide");o(e.oFeatures,g,"bDeferRender");o(e.oScroll,g,"sScrollX","sX");o(e.oScroll,g,"sScrollXInner","sXInner");o(e.oScroll,g,"sScrollY","sY");o(e.oScroll,g,"bScrollCollapse","bCollapse");o(e.oScroll,g,"bScrollInfinite","bInfinite");o(e.oScroll,g,"iScrollLoadGap","iLoadGap");o(e.oScroll,g,"bScrollAutoCss","bAutoCss");o(e,g,"asStripClasses","asStripeClasses");o(e,g,"asStripeClasses");o(e,g,"fnPreDrawCallback");o(e,g,"fnRowCallback");o(e,g,"fnHeaderCallback");o(e,g,"fnFooterCallback");o(e,g,"fnCookieCallback");o(e,g,"fnInitComplete");o(e,g,"fnServerData");o(e,g,"fnFormatNumber");o(e,g,"aaSorting");o(e,g,"aaSortingFixed");o(e,g,"aLengthMenu");o(e,g,"sPaginationType");o(e,g,"sAjaxSource");o(e,g,"sAjaxDataProp");o(e,g,"iCookieDuration");o(e,g,"sCookiePrefix");o(e,g,"sDom");o(e,g,"bSortCellsTop");o(e,g,"oSearch","oPreviousSearch");o(e,g,"aoSearchCols","aoPreSearchCols");o(e,g,"iDisplayLength","_iDisplayLength");o(e,g,"bJQueryUI","bJUI");o(e.oLanguage,g,"fnInfoCallback");typeof g.fnDrawCallback=="function"&&e.aoDrawCallback.push({fn:g.fnDrawCallback,sName:"user"});typeof g.fnServerParams=="function"&&e.aoServerParams.push({fn:g.fnServerParams,sName:"user"});typeof g.fnStateSaveCallback=="function"&&e.aoStateSave.push({fn:g.fnStateSaveCallback,sName:"user"});typeof g.fnStateLoadCallback=="function"&&e.aoStateLoad.push({fn:g.fnStateLoadCallback,sName:"user"});if(e.oFeatures.bServerSide&&e.oFeatures.bSort&&e.oFeatures.bSortClasses){e.aoDrawCallback.push({fn:V,sName:"server_side_sort_classes"})}else{e.oFeatures.bDeferRender&&e.aoDrawCallback.push({fn:V,sName:"defer_sort_classes"})}if(typeof g.bJQueryUI!="undefined"&&g.bJQueryUI){e.oClasses=n.oJUIClasses;if(typeof g.sDom=="undefined"){e.sDom='<"H"lfr>t<"F"ip>'}}if(e.oScroll.sX!==""||e.oScroll.sY!==""){e.oScroll.iBarWidth=Ya()}if(typeof g.iDisplayStart!="undefined"&&typeof e.iInitDisplayStart=="undefined"){e.iInitDisplayStart=g.iDisplayStart;e._iDisplayStart=g.iDisplayStart}if(typeof g.bStateSave!="undefined"){e.oFeatures.bStateSave=g.bStateSave;Xa(e,g);e.aoDrawCallback.push({fn:va,sName:"state_save"})}if(typeof g.iDeferLoading!="undefined"){e.bDeferLoading=true;e._iRecordsTotal=g.iDeferLoading;e._iRecordsDisplay=g.iDeferLoading}if(typeof g.aaData!="undefined"){j=true}if(typeof g!="undefined"&&typeof g.aoData!="undefined"){g.aoColumns=g.aoData}if(typeof g.oLanguage!="undefined"){if(typeof g.oLanguage.sUrl!="undefined"&&g.oLanguage.sUrl!==""){e.oLanguage.sUrl=g.oLanguage.sUrl;i.getJSON(e.oLanguage.sUrl,null,function(u){y(e,u,true)});h=true}else{y(e,g.oLanguage,false)}}}else{g={}}if(typeof g.asStripClasses=="undefined"&&typeof g.asStripeClasses=="undefined"){e.asStripeClasses.push(e.oClasses.sStripeOdd);e.asStripeClasses.push(e.oClasses.sStripeEven)}c=false;d=i(this).children("tbody").children("tr");a=0;for(b=e.asStripeClasses.length;a<b;a++){if(d.filter(":lt(2)").hasClass(e.asStripeClasses[a])){c=true;break}}if(c){e.asDestroyStripes=["",""];if(i(d[0]).hasClass(e.oClasses.sStripeOdd)){e.asDestroyStripes[0]+=e.oClasses.sStripeOdd+" "}if(i(d[0]).hasClass(e.oClasses.sStripeEven)){e.asDestroyStripes[0]+=e.oClasses.sStripeEven}if(i(d[1]).hasClass(e.oClasses.sStripeOdd)){e.asDestroyStripes[1]+=e.oClasses.sStripeOdd+" "}if(i(d[1]).hasClass(e.oClasses.sStripeEven)){e.asDestroyStripes[1]+=e.oClasses.sStripeEven}d.removeClass(e.asStripeClasses.join(" "))}c=[];var k;a=this.getElementsByTagName("thead");if(a.length!==0){Y(e.aoHeader,a[0]);c=S(e)}if(typeof g.aoColumns=="undefined"){k=[];a=0;for(b=c.length;a<b;a++){k.push(null)}}else{k=g.aoColumns}a=0;for(b=k.length;a<b;a++){if(typeof g.saved_aoColumns!="undefined"&&g.saved_aoColumns.length==b){if(k[a]===null){k[a]={}}k[a].bVisible=g.saved_aoColumns[a].bVisible}F(e,c?c[a]:null)}if(typeof g.aoColumnDefs!="undefined"){for(a=g.aoColumnDefs.length-1;a>=0;a--){var m=g.aoColumnDefs[a].aTargets;i.isArray(m)||J(e,1,"aTargets must be an array of targets, not a "+typeof m);c=0;for(d=m.length;c<d;c++){if(typeof m[c]=="number"&&m[c]>=0){for(;e.aoColumns.length<=m[c];){F(e)}x(e,m[c],g.aoColumnDefs[a])}else{if(typeof m[c]=="number"&&m[c]<0){x(e,e.aoColumns.length+m[c],g.aoColumnDefs[a])}else{if(typeof m[c]=="string"){b=0;for(f=e.aoColumns.length;b<f;b++){if(m[c]=="_all"||i(e.aoColumns[b].nTh).hasClass(m[c])){x(e,b,g.aoColumnDefs[a])}}}}}}}}if(typeof k!="undefined"){a=0;for(b=k.length;a<b;a++){x(e,a,k[a])}}a=0;for(b=e.aaSorting.length;a<b;a++){if(e.aaSorting[a][0]>=e.aoColumns.length){e.aaSorting[a][0]=0}k=e.aoColumns[e.aaSorting[a][0]];if(typeof e.aaSorting[a][2]=="undefined"){e.aaSorting[a][2]=0}if(typeof g.aaSorting=="undefined"&&typeof e.saved_aaSorting=="undefined"){e.aaSorting[a][1]=k.asSorting[0]}c=0;for(d=k.asSorting.length;c<d;c++){if(e.aaSorting[a][1]==k.asSorting[c]){e.aaSorting[a][2]=c;break}}}V(e);a=i(this).children("thead");if(a.length===0){a=[p.createElement("thead")];this.appendChild(a[0])}e.nTHead=a[0];a=i(this).children("tbody");if(a.length===0){a=[p.createElement("tbody")];this.appendChild(a[0])}e.nTBody=a[0];a=i(this).children("tfoot");if(a.length>0){e.nTFoot=a[0];Y(e.aoFooter,e.nTFoot)}if(j){for(a=0;a<g.aaData.length;a++){v(e,g.aaData[a])}}else{$(e)}e.aiDisplay=e.aiDisplayMaster.slice();e.bInitialised=true;h===false&&t(e)}})}})(jQuery,window,document);var swfobject=function(){var aq="undefined",aD="object",ab="Shockwave Flash",X="ShockwaveFlash.ShockwaveFlash",aE="application/x-shockwave-flash",ac="SWFObjectExprInst",ax="onreadystatechange",af=window,aL=document,aB=navigator,aa=false,Z=[aN],aG=[],ag=[],al=[],aJ,ad,ap,at,ak=false,aU=false,aH,an,aI=true,ah=function(){var a=typeof aL.getElementById!=aq&&typeof aL.getElementsByTagName!=aq&&typeof aL.createElement!=aq,e=aB.userAgent.toLowerCase(),c=aB.platform.toLowerCase(),h=c?/win/.test(c):/win/.test(e),j=c?/mac/.test(c):/mac/.test(e),g=/webkit/.test(e)?parseFloat(e.replace(/^.*webkit\/(\d+(\.\d+)?).*$/,"$1")):false,d=!+"\v1",f=[0,0,0],k=null;if(typeof aB.plugins!=aq&&typeof aB.plugins[ab]==aD){k=aB.plugins[ab].description;if(k&&!(typeof aB.mimeTypes!=aq&&aB.mimeTypes[aE]&&!aB.mimeTypes[aE].enabledPlugin)){aa=true;d=false;k=k.replace(/^.*\s+(\S+\s+\S+$)/,"$1");f[0]=parseInt(k.replace(/^(.*)\..*$/,"$1"),10);f[1]=parseInt(k.replace(/^.*\.(.*)\s.*$/,"$1"),10);f[2]=/[a-zA-Z]/.test(k)?parseInt(k.replace(/^.*[a-zA-Z]+(.*)$/,"$1"),10):0}}else{if(typeof af.ActiveXObject!=aq){try{var i=new ActiveXObject(X);if(i){k=i.GetVariable("$version");if(k){d=true;k=k.split(" ")[1].split(",");f=[parseInt(k[0],10),parseInt(k[1],10),parseInt(k[2],10)]}}}catch(b){}}}return{w3:a,pv:f,wk:g,ie:d,win:h,mac:j}}(),aK=function(){if(!ah.w3){return}if((typeof aL.readyState!=aq&&aL.readyState=="complete")||(typeof aL.readyState==aq&&(aL.getElementsByTagName("body")[0]||aL.body))){aP()}if(!ak){if(typeof aL.addEventListener!=aq){aL.addEventListener("DOMContentLoaded",aP,false)}if(ah.ie&&ah.win){aL.attachEvent(ax,function(){if(aL.readyState=="complete"){aL.detachEvent(ax,arguments.callee);aP()}});if(af==top){(function(){if(ak){return}try{aL.documentElement.doScroll("left")}catch(a){setTimeout(arguments.callee,0);return}aP()})()}}if(ah.wk){(function(){if(ak){return}if(!/loaded|complete/.test(aL.readyState)){setTimeout(arguments.callee,0);return}aP()})()}aC(aP)}}();function aP(){if(ak){return}try{var b=aL.getElementsByTagName("body")[0].appendChild(ar("span"));b.parentNode.removeChild(b)}catch(a){return}ak=true;var d=Z.length;for(var c=0;c<d;c++){Z[c]()}}function aj(a){if(ak){a()}else{Z[Z.length]=a}}function aC(a){if(typeof af.addEventListener!=aq){af.addEventListener("load",a,false)}else{if(typeof aL.addEventListener!=aq){aL.addEventListener("load",a,false)}else{if(typeof af.attachEvent!=aq){aM(af,"onload",a)}else{if(typeof af.onload=="function"){var b=af.onload;af.onload=function(){b();a()}}else{af.onload=a}}}}}function aN(){if(aa){Y()}else{am()}}function Y(){var d=aL.getElementsByTagName("body")[0];var b=ar(aD);b.setAttribute("type",aE);var a=d.appendChild(b);if(a){var c=0;(function(){if(typeof a.GetVariable!=aq){var e=a.GetVariable("$version");if(e){e=e.split(" ")[1].split(",");ah.pv=[parseInt(e[0],10),parseInt(e[1],10),parseInt(e[2],10)]}}else{if(c<10){c++;setTimeout(arguments.callee,10);return}}d.removeChild(b);a=null;am()})()}else{am()}}function am(){var g=aG.length;if(g>0){for(var h=0;h<g;h++){var c=aG[h].id;var l=aG[h].callbackFn;var a={success:false,id:c};if(ah.pv[0]>0){var i=aS(c);if(i){if(ao(aG[h].swfVersion)&&!(ah.wk&&ah.wk<312)){ay(c,true);if(l){a.success=true;a.ref=av(c);l(a)}}else{if(aG[h].expressInstall&&au()){var e={};e.data=aG[h].expressInstall;e.width=i.getAttribute("width")||"0";e.height=i.getAttribute("height")||"0";if(i.getAttribute("class")){e.styleclass=i.getAttribute("class")}if(i.getAttribute("align")){e.align=i.getAttribute("align")}var f={};var d=i.getElementsByTagName("param");var k=d.length;for(var j=0;j<k;j++){if(d[j].getAttribute("name").toLowerCase()!="movie"){f[d[j].getAttribute("name")]=d[j].getAttribute("value")}}ae(e,f,c,l)}else{aF(i);if(l){l(a)}}}}}else{ay(c,true);if(l){var b=av(c);if(b&&typeof b.SetVariable!=aq){a.success=true;a.ref=b}l(a)}}}}}function av(b){var d=null;var c=aS(b);if(c&&c.nodeName=="OBJECT"){if(typeof c.SetVariable!=aq){d=c}else{var a=c.getElementsByTagName(aD)[0];if(a){d=a}}}return d}function au(){return !aU&&ao("6.0.65")&&(ah.win||ah.mac)&&!(ah.wk&&ah.wk<312)}function ae(f,d,h,e){aU=true;ap=e||null;at={success:false,id:h};var a=aS(h);if(a){if(a.nodeName=="OBJECT"){aJ=aO(a);ad=null}else{aJ=a;ad=h}f.id=ac;if(typeof f.width==aq||(!/%$/.test(f.width)&&parseInt(f.width,10)<310)){f.width="310"}if(typeof f.height==aq||(!/%$/.test(f.height)&&parseInt(f.height,10)<137)){f.height="137"}aL.title=aL.title.slice(0,47)+" - Flash Player Installation";var b=ah.ie&&ah.win?"ActiveX":"PlugIn",c="MMredirectURL="+af.location.toString().replace(/&/g,"%26")+"&MMplayerType="+b+"&MMdoctitle="+aL.title;if(typeof d.flashvars!=aq){d.flashvars+="&"+c}else{d.flashvars=c}if(ah.ie&&ah.win&&a.readyState!=4){var g=ar("div");h+="SWFObjectNew";g.setAttribute("id",h);a.parentNode.insertBefore(g,a);a.style.display="none";(function(){if(a.readyState==4){a.parentNode.removeChild(a)}else{setTimeout(arguments.callee,10)}})()}aA(f,d,h)}}function aF(a){if(ah.ie&&ah.win&&a.readyState!=4){var b=ar("div");a.parentNode.insertBefore(b,a);b.parentNode.replaceChild(aO(a),b);a.style.display="none";(function(){if(a.readyState==4){a.parentNode.removeChild(a)}else{setTimeout(arguments.callee,10)}})()}else{a.parentNode.replaceChild(aO(a),a)}}function aO(b){var d=ar("div");if(ah.win&&ah.ie){d.innerHTML=b.innerHTML}else{var e=b.getElementsByTagName(aD)[0];if(e){var a=e.childNodes;if(a){var f=a.length;for(var c=0;c<f;c++){if(!(a[c].nodeType==1&&a[c].nodeName=="PARAM")&&!(a[c].nodeType==8)){d.appendChild(a[c].cloneNode(true))}}}}}return d}function aA(e,g,c){var d,a=aS(c);if(ah.wk&&ah.wk<312){return d}if(a){if(typeof e.id==aq){e.id=c}if(ah.ie&&ah.win){var f="";for(var i in e){if(e[i]!=Object.prototype[i]){if(i.toLowerCase()=="data"){g.movie=e[i]}else{if(i.toLowerCase()=="styleclass"){f+=' class="'+e[i]+'"'}else{if(i.toLowerCase()!="classid"){f+=" "+i+'="'+e[i]+'"'}}}}}var h="";for(var j in g){if(g[j]!=Object.prototype[j]){h+='<param name="'+j+'" value="'+g[j]+'" />'}}a.outerHTML='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'+f+">"+h+"</object>";ag[ag.length]=e.id;d=aS(e.id)}else{var b=ar(aD);b.setAttribute("type",aE);for(var k in e){if(e[k]!=Object.prototype[k]){if(k.toLowerCase()=="styleclass"){b.setAttribute("class",e[k])}else{if(k.toLowerCase()!="classid"){b.setAttribute(k,e[k])}}}}for(var l in g){if(g[l]!=Object.prototype[l]&&l.toLowerCase()!="movie"){aQ(b,l,g[l])}}a.parentNode.replaceChild(b,a);d=b}}return d}function aQ(b,d,c){var a=ar("param");a.setAttribute("name",d);a.setAttribute("value",c);b.appendChild(a)}function aw(a){var b=aS(a);if(b&&b.nodeName=="OBJECT"){if(ah.ie&&ah.win){b.style.display="none";(function(){if(b.readyState==4){aT(a)}else{setTimeout(arguments.callee,10)}})()}else{b.parentNode.removeChild(b)}}}function aT(a){var b=aS(a);if(b){for(var c in b){if(typeof b[c]=="function"){b[c]=null}}b.parentNode.removeChild(b)}}function aS(a){var c=null;try{c=aL.getElementById(a)}catch(b){}return c}function ar(a){return aL.createElement(a)}function aM(a,c,b){a.attachEvent(c,b);al[al.length]=[a,c,b]}function ao(a){var b=ah.pv,c=a.split(".");c[0]=parseInt(c[0],10);c[1]=parseInt(c[1],10)||0;c[2]=parseInt(c[2],10)||0;return(b[0]>c[0]||(b[0]==c[0]&&b[1]>c[1])||(b[0]==c[0]&&b[1]==c[1]&&b[2]>=c[2]))?true:false}function az(b,f,a,c){if(ah.ie&&ah.mac){return}var e=aL.getElementsByTagName("head")[0];if(!e){return}var g=(a&&typeof a=="string")?a:"screen";if(c){aH=null;an=null}if(!aH||an!=g){var d=ar("style");d.setAttribute("type","text/css");d.setAttribute("media",g);aH=e.appendChild(d);if(ah.ie&&ah.win&&typeof aL.styleSheets!=aq&&aL.styleSheets.length>0){aH=aL.styleSheets[aL.styleSheets.length-1]}an=g}if(ah.ie&&ah.win){if(aH&&typeof aH.addRule==aD){aH.addRule(b,f)}}else{if(aH&&typeof aL.createTextNode!=aq){aH.appendChild(aL.createTextNode(b+" {"+f+"}"))}}}function ay(a,c){if(!aI){return}var b=c?"visible":"hidden";if(ak&&aS(a)){aS(a).style.visibility=b}else{az("#"+a,"visibility:"+b)}}function ai(b){var a=/[\\\"<>\.;]/;var c=a.exec(b)!=null;return c&&typeof encodeURIComponent!=aq?encodeURIComponent(b):b}var aR=function(){if(ah.ie&&ah.win){window.attachEvent("onunload",function(){var a=al.length;for(var b=0;b<a;b++){al[b][0].detachEvent(al[b][1],al[b][2])}var d=ag.length;for(var c=0;c<d;c++){aw(ag[c])}for(var e in ah){ah[e]=null}ah=null;for(var f in swfobject){swfobject[f]=null}swfobject=null})}}();return{registerObject:function(a,e,c,b){if(ah.w3&&a&&e){var d={};d.id=a;d.swfVersion=e;d.expressInstall=c;d.callbackFn=b;aG[aG.length]=d;ay(a,false)}else{if(b){b({success:false,id:a})}}},getObjectById:function(a){if(ah.w3){return av(a)}},embedSWF:function(k,e,h,f,c,a,b,i,g,j){var d={success:false,id:e};if(ah.w3&&!(ah.wk&&ah.wk<312)&&k&&e&&h&&f&&c){ay(e,false);aj(function(){h+="";f+="";var q={};if(g&&typeof g===aD){for(var o in g){q[o]=g[o]}}q.data=k;q.width=h;q.height=f;var n={};if(i&&typeof i===aD){for(var p in i){n[p]=i[p]}}if(b&&typeof b===aD){for(var l in b){if(typeof n.flashvars!=aq){n.flashvars+="&"+l+"="+b[l]}else{n.flashvars=l+"="+b[l]}}}if(ao(c)){var m=aA(q,n,e);if(q.id==e){ay(e,true)}d.success=true;d.ref=m}else{if(a&&au()){q.data=a;ae(q,n,e,j);return}else{ay(e,true)}}if(j){j(d)}})}else{if(j){j(d)}}},switchOffAutoHideShow:function(){aI=false},ua:ah,getFlashPlayerVersion:function(){return{major:ah.pv[0],minor:ah.pv[1],release:ah.pv[2]}},hasFlashPlayerVersion:ao,createSWF:function(a,b,c){if(ah.w3){return aA(a,b,c)}else{return undefined}},showExpressInstall:function(b,a,d,c){if(ah.w3&&au()){ae(b,a,d,c)}},removeSWF:function(a){if(ah.w3){aw(a)}},createCSS:function(b,a,c,d){if(ah.w3){az(b,a,c,d)}},addDomLoadEvent:aj,addLoadEvent:aC,getQueryParamValue:function(b){var a=aL.location.search||aL.location.hash;if(a){if(/\?/.test(a)){a=a.split("?")[1]}if(b==null){return ai(a)}var c=a.split("&");for(var d=0;d<c.length;d++){if(c[d].substring(0,c[d].indexOf("="))==b){return ai(c[d].substring((c[d].indexOf("=")+1)))}}}return""},expressInstallCallback:function(){if(aU){var a=aS(ac);if(a&&aJ){a.parentNode.replaceChild(aJ,a);if(ad){ay(ad,true);if(ah.ie&&ah.win){aJ.style.display="block"}}if(ap){ap(at)}}aU=false}}}}();if(jQuery){(function(a){a.extend(a.fn,{uploadify:function(b){a(this).each(function(){var f=a.extend({id:a(this).attr("id"),uploader:"uploadify.swf",script:"uploadify.php",expressInstall:null,folder:"",height:30,width:120,cancelImg:"cancel.png",wmode:"opaque",scriptAccess:"sameDomain",fileDataName:"Filedata",method:"POST",queueSizeLimit:999,simUploadLimit:1,queueID:false,displayData:"percentage",removeCompleted:true,onInit:function(){},onSelect:function(){},onSelectOnce:function(){},onQueueFull:function(){},onCheck:function(){},onCancel:function(){},onClearQueue:function(){},onError:function(){},onProgress:function(){},onComplete:function(){},onAllComplete:function(){}},b);a(this).data("settings",f);var e=location.pathname;e=e.split("/");e.pop();e=e.join("/")+"/";var g={};g.uploadifyID=f.id;g.pagepath=e;if(f.buttonImg){g.buttonImg=escape(f.buttonImg)}if(f.buttonText){g.buttonText=escape(f.buttonText)}if(f.rollover){g.rollover=true}g.script=f.script;g.folder=escape(f.folder);if(f.scriptData){var h="";for(var d in f.scriptData){h+="&"+d+"="+f.scriptData[d]}g.scriptData=escape(h.substr(1))}g.width=f.width;g.height=f.height;g.wmode=f.wmode;g.method=f.method;g.queueSizeLimit=f.queueSizeLimit;g.simUploadLimit=f.simUploadLimit;if(f.hideButton){g.hideButton=true}if(f.fileDesc){g.fileDesc=f.fileDesc}if(f.fileExt){g.fileExt=f.fileExt}if(f.multi){g.multi=true}if(f.auto){g.auto=true}if(f.sizeLimit){g.sizeLimit=f.sizeLimit}if(f.checkScript){g.checkScript=f.checkScript}if(f.fileDataName){g.fileDataName=f.fileDataName}if(f.queueID){g.queueID=f.queueID}if(f.onInit()!==false){a(this).css("display","none");a(this).after('<div id="'+a(this).attr("id")+'Uploader"></div>');swfobject.embedSWF(f.uploader,f.id+"Uploader",f.width,f.height,"9.0.24",f.expressInstall,g,{quality:"high",wmode:f.wmode,allowScriptAccess:f.scriptAccess},{},function(i){if(typeof(f.onSWFReady)=="function"&&i.success){f.onSWFReady()}});if(f.queueID==false){a("#"+a(this).attr("id")+"Uploader").after('<div id="'+a(this).attr("id")+'Queue" class="uploadifyQueue"></div>')}else{a("#"+f.queueID).addClass("uploadifyQueue")}}if(typeof(f.onOpen)=="function"){a(this).bind("uploadifyOpen",f.onOpen)}a(this).bind("uploadifySelect",{action:f.onSelect,queueID:f.queueID},function(k,i,j){if(k.data.action(k,i,j)!==false){var l=Math.round(j.size/1024*100)*0.01;var m="KB";if(l>1000){l=Math.round(l*0.001*100)*0.01;m="MB"}var n=l.toString().split(".");if(n.length>1){l=n[0]+"."+n[1].substr(0,2)}else{l=n[0]}if(j.name.length>20){fileName=j.name.substr(0,20)+"..."}else{fileName=j.name}queue="#"+a(this).attr("id")+"Queue";if(k.data.queueID){queue="#"+k.data.queueID}a(queue).append('<div id="'+a(this).attr("id")+i+'" class="uploadifyQueueItem">								<div class="cancel">									<a href="javascript:jQuery(\'#'+a(this).attr("id")+"').uploadifyCancel('"+i+'\')"><img src="'+f.cancelImg+'" border="0" /></a>								</div>								<span class="fileName">'+fileName+" ("+l+m+')</span><span class="percentage"></span>								<div class="uploadifyProgress">									<div id="'+a(this).attr("id")+i+'ProgressBar" class="uploadifyProgressBar"><!--Progress Bar--></div>								</div>							</div>')}});a(this).bind("uploadifySelectOnce",{action:f.onSelectOnce},function(i,j){i.data.action(i,j);if(f.auto){if(f.checkScript){a(this).uploadifyUpload(null,false)}else{a(this).uploadifyUpload(null,true)}}});a(this).bind("uploadifyQueueFull",{action:f.onQueueFull},function(i,j){if(i.data.action(i,j)!==false){alert("The queue is full.  The max size is "+j+".")}});a(this).bind("uploadifyCheckExist",{action:f.onCheck},function(n,m,l,k,p){var j=new Object();j=l;j.folder=(k.substr(0,1)=="/")?k:e+k;if(p){for(var i in l){var o=i}}a.post(m,j,function(s){for(var q in s){if(n.data.action(n,s,q)!==false){var r=confirm("Do you want to replace the file "+s[q]+"?");if(!r){document.getElementById(a(n.target).attr("id")+"Uploader").cancelFileUpload(q,true,true)}}}if(p){document.getElementById(a(n.target).attr("id")+"Uploader").startFileUpload(o,true)}else{document.getElementById(a(n.target).attr("id")+"Uploader").startFileUpload(null,true)}},"json")});a(this).bind("uploadifyCancel",{action:f.onCancel},function(n,j,m,o,i,l){if(n.data.action(n,j,m,o,l)!==false){if(i){var k=(l==true)?0:250;a("#"+a(this).attr("id")+j).fadeOut(k,function(){a(this).remove()})}}});a(this).bind("uploadifyClearQueue",{action:f.onClearQueue},function(k,j){var i=(f.queueID)?f.queueID:a(this).attr("id")+"Queue";if(j){a("#"+i).find(".uploadifyQueueItem").remove()}if(k.data.action(k,j)!==false){a("#"+i).find(".uploadifyQueueItem").each(function(){var l=a(".uploadifyQueueItem").index(this);a(this).delay(l*100).fadeOut(250,function(){a(this).remove()})})}});var c=[];a(this).bind("uploadifyError",{action:f.onError},function(m,i,l,k){if(m.data.action(m,i,l,k)!==false){var j=new Array(i,l,k);c.push(j);a("#"+a(this).attr("id")+i).find(".percentage").text(" - "+k.type+" Error");a("#"+a(this).attr("id")+i).find(".uploadifyProgress").hide();a("#"+a(this).attr("id")+i).addClass("uploadifyError")}});if(typeof(f.onUpload)=="function"){a(this).bind("uploadifyUpload",f.onUpload)}a(this).bind("uploadifyProgress",{action:f.onProgress,toDisplay:f.displayData},function(k,i,j,l){if(k.data.action(k,i,j,l)!==false){a("#"+a(this).attr("id")+i+"ProgressBar").animate({width:l.percentage+"%"},250,function(){if(l.percentage==100){a(this).closest(".uploadifyProgress").fadeOut(250,function(){a(this).remove()})}});if(k.data.toDisplay=="percentage"){displayData=" - "+l.percentage+"%"}if(k.data.toDisplay=="speed"){displayData=" - "+l.speed+"KB/s"}if(k.data.toDisplay==null){displayData=" "}a("#"+a(this).attr("id")+i).find(".percentage").text(displayData)}});a(this).bind("uploadifyComplete",{action:f.onComplete},function(l,i,k,j,m){if(l.data.action(l,i,k,unescape(j),m)!==false){a("#"+a(this).attr("id")+i).find(".percentage").text(" - Completed");if(f.removeCompleted){a("#"+a(l.target).attr("id")+i).fadeOut(250,function(){a(this).remove()})}a("#"+a(l.target).attr("id")+i).addClass("completed")}});if(typeof(f.onAllComplete)=="function"){a(this).bind("uploadifyAllComplete",{action:f.onAllComplete},function(i,j){if(i.data.action(i,j)!==false){c=[]}})}})},uploadifySettings:function(f,j,c){var g=false;a(this).each(function(){if(f=="scriptData"&&j!=null){if(c){var i=j}else{var i=a.extend(a(this).data("settings").scriptData,j)}var l="";for(var k in i){l+="&"+k+"="+i[k]}j=escape(l.substr(1))}g=document.getElementById(a(this).attr("id")+"Uploader").updateSettings(f,j)});if(j==null){if(f=="scriptData"){var b=unescape(g).split("&");var e=new Object();for(var d=0;d<b.length;d++){var h=b[d].split("=");e[h[0]]=h[1]}g=e}}return g},uploadifyUpload:function(b,c){a(this).each(function(){if(!c){c=false}document.getElementById(a(this).attr("id")+"Uploader").startFileUpload(b,c)})},uploadifyCancel:function(b){a(this).each(function(){document.getElementById(a(this).attr("id")+"Uploader").cancelFileUpload(b,true,true,false)})},uploadifyClearQueue:function(){a(this).each(function(){document.getElementById(a(this).attr("id")+"Uploader").clearFileUploadQueue(false)})}})})(jQuery)};var CodeMirror=(function(){function q(aD,aA){var bN={},a9=q.defaults;for(var ap in a9){if(a9.hasOwnProperty(ap)){bN[ap]=(aA&&aA.hasOwnProperty(ap)?aA:a9)[ap]}}var cy=bN.document;var au=cy.createElement("div");au.className="CodeMirror"+(bN.lineWrapping?" CodeMirror-wrap":"");au.innerHTML='<div style="overflow: hidden; position: relative; width: 3px; height: 0px;"><textarea style="position: absolute; padding: 0; width: 1px; height: 1em" wrap="off" autocorrect="off" autocapitalize="off"></textarea></div><div class="CodeMirror-scroll" tabindex="-1"><div style="position: relative"><div style="position: relative"><div class="CodeMirror-gutter"><div class="CodeMirror-gutter-text"></div></div><div class="CodeMirror-lines"><div style="position: relative; z-index: 0"><div style="position: absolute; width: 100%; height: 0; overflow: hidden; visibility: hidden; outline: 5px auto none"></div><pre class="CodeMirror-cursor">&#160;</pre><div style="position: relative; z-index: -1"></div><div></div></div></div></div></div></div>';if(aD.appendChild){aD.appendChild(au)}else{aD(au)}var bK=au.firstChild,bc=bK.firstChild,ba=au.lastChild,bA=ba.firstChild,b2=bA.firstChild,ay=b2.firstChild,aQ=ay.firstChild,bk=ay.nextSibling.firstChild,al=bk.firstChild,a3=al.nextSibling,a7=a3.nextSibling,ah=a7.nextSibling;cp();if(o){bc.style.width="0px"}if(!e){bk.draggable=true}bk.style.outline="none";if(bN.tabindex!=null){bc.tabIndex=bN.tabindex}if(!bN.gutter&&!bN.lineNumbers){ay.style.display="none"}try{cf("x")}catch(bU){if(bU.message.match(/runtime/i)){bU=new Error("A CodeMirror inside a P-style element does not work in Internet Explorer. (innerHTML bug)")}throw bU}var bT=new v(),am=new v(),cC;var bX,ck=new g([new Z([new d("")])]),b3,b5;bG();var cK={from:{line:0,ch:0},to:{line:0,ch:0},inverted:false};var b4,bf,aR,bt=0,a2,b9=false,cd=false;var cb,bS,ar,cA,aG,a6,aJ,cm;var a4=0,cD=0,bz=0,bB=0;var bQ;var br="",aw,bj=aN();ai(function(){aO(bN.value||"");cb=false})();var a0=new i();n(ba,"mousedown",ai(b6));n(ba,"dblclick",ai(bJ));n(bk,"dragstart",az);n(bk,"selectstart",N);if(!H){n(ba,"contextmenu",aT)}n(ba,"scroll",function(){bt=ba.scrollTop;bZ([]);if(bN.fixedGutter){ay.style.left=ba.scrollLeft+"px"}if(bN.onScroll){bN.onScroll(bV)}});n(window,"resize",function(){bZ(true)});n(bc,"keyup",ai(b7));n(bc,"input",aH);n(bc,"keydown",ai(bY));n(bc,"keypress",ai(bd));n(bc,"focus",cH);n(bc,"blur",av);n(ba,"dragenter",s);n(ba,"dragover",s);n(ba,"drop",ai(af));n(ba,"paste",function(){bp();aH()});n(bc,"paste",aH);n(bc,"cut",ai(function(){if(!bN.readOnly){bh("")}}));var ci;try{ci=(cy.activeElement==bc)}catch(bU){}if(ci){setTimeout(cH,20)}else{av()}function bg(cN){return cN>=0&&cN<ck.size}var bV=au.CodeMirror={getValue:bO,setValue:ai(aO),getSelection:bP,replaceSelection:ai(bh),focus:function(){bp();cH();aH()},setOption:function(cO,cP){var cN=bN[cO];bN[cO]=cP;if(cO=="mode"||cO=="indentUnit"){bG()}else{if(cO=="readOnly"&&cP=="nocursor"){av();bc.blur()}else{if(cO=="readOnly"&&!cP){co(true)}else{if(cO=="theme"){cp()}else{if(cO=="lineWrapping"&&cN!=cP){ai(cs)()}else{if(cO=="tabSize"){ai(cI)()}}}}}}if(cO=="lineNumbers"||cO=="gutter"||cO=="firstLineNumber"||cO=="theme"){bZ(true)}},getOption:function(cN){return bN[cN]},undo:ai(cG),redo:ai(cv),indentLine:ai(function(cO,cN){if(typeof cN!="string"){if(cN==null){cN=bN.smartIndent?"smart":"prev"}else{cN=cN?"add":"subtract"}}if(bg(cO)){bo(cO,cN)}}),indentSelection:ai(cn),historySize:function(){return{undo:a0.done.length,redo:a0.undone.length}},clearHistory:function(){a0=new i()},matchBrackets:ai(function(){b0(true)}),getTokenAt:ai(function(cN){cN=aK(cN);return cr(cN.line).getTokenAt(bX,cg(cN.line),cN.ch)}),getStateAfter:function(cN){cN=bL(cN==null?ck.size-1:cN);return cg(cN+1)},cursorCoords:function(cN){if(cN==null){cN=cK.inverted}return ag(cN?cK.from:cK.to)},charCoords:function(cN){return ag(aK(cN))},coordsChar:function(cN){var cO=ac(bk);return bv(cN.x-cO.left,cN.y-cO.top)},markText:ai(bs),setBookmark:aL,setMarker:ai(bI),clearMarker:ai(ak),setLineClass:ai(bb),hideLine:ai(function(cN){return cw(cN,true)}),showLine:ai(function(cN){return cw(cN,false)}),onDeleteLine:function(cN,cO){if(typeof cN=="number"){if(!bg(cN)){return null}cN=cr(cN)}(cN.handlers||(cN.handlers=[])).push(cO);return cN},lineInfo:aM,addWidget:function(cR,cP,cT,cQ,cV){cR=cE(aK(cR));var cS=cR.yBot,cO=cR.x;cP.style.position="absolute";bA.appendChild(cP);if(cQ=="over"){cS=cR.y}else{if(cQ=="near"){var cN=Math.max(ba.offsetHeight,ck.height*bC()),cU=Math.max(bA.clientWidth,bk.clientWidth)-aX();if(cR.yBot+cP.offsetHeight>cN&&cR.y>cP.offsetHeight){cS=cR.y-cP.offsetHeight}if(cO+cP.offsetWidth>cU){cO=cU-cP.offsetWidth}}}cP.style.top=(cS+ce())+"px";cP.style.left=cP.style.right="";if(cV=="right"){cO=bA.clientWidth-cP.offsetWidth;cP.style.right="0px"}else{if(cV=="left"){cO=0}else{if(cV=="middle"){cO=(bA.clientWidth-cP.offsetWidth)/2}}cP.style.left=(cO+aX())+"px"}if(cT){aq(cO,cS,cO+cP.offsetWidth,cS+cP.offsetHeight)}},lineCount:function(){return ck.size},clipPos:aK,getCursor:function(cN){if(cN==null){cN=cK.inverted}return U(cN?cK.from:cK.to)},somethingSelected:function(){return !W(cK.from,cK.to)},setCursor:ai(function(cN,cP,cO){if(cP==null&&typeof cN.line=="number"){aY(cN.line,cN.ch,cO)}else{aY(cN,cP,cO)}}),setSelection:ai(function(cP,cO,cN){(cN?bn:bm)(aK(cP),aK(cO||cP))}),getLine:function(cN){if(bg(cN)){return cr(cN).text}},getLineHandle:function(cN){if(bg(cN)){return cr(cN)}},setLine:ai(function(cN,cO){if(bg(cN)){bD(cO,{line:cN,ch:0},{line:cN,ch:cr(cN).text.length})}}),removeLine:ai(function(cN){if(bg(cN)){bD("",{line:cN,ch:0},aK({line:cN+1,ch:0}))}}),replaceRange:ai(bD),getRange:function(cO,cN){return cB(aK(cO),aK(cN))},execCommand:function(cN){return F[cN](bV)},moveH:ai(cq),deleteH:ai(b8),moveV:ai(cj),toggleOverwrite:function(){b9=!b9},posFromIndex:function(cO){var cP=0,cN;ck.iter(0,ck.size,function(cQ){var cR=cQ.text.length+1;if(cR>cO){cN=cO;return true}cO-=cR;++cP});return aK({line:cP,ch:cN})},indexFromPos:function(cO){if(cO.line<0||cO.ch<0){return 0}var cN=cO.ch;ck.iter(0,cO.line,function(cP){cN+=cP.text.length+1});return cN},scrollTo:function(cN,cO){if(cN!=null){ba.scrollTop=cN}if(cO!=null){ba.scrollLeft=cO}bZ([])},operation:function(cN){return ai(cN)()},refresh:function(){bZ(true);if(ba.scrollHeight>bt){ba.scrollTop=bt}},getInputField:function(){return bc},getWrapperElement:function(){return au},getScrollerElement:function(){return ba},getGutterElement:function(){return ay}};function cr(cN){return x(ck,cN)}function aV(cO,cN){aJ=true;var cP=cN-cO.height;for(var cQ=cO;cQ;cQ=cQ.parent){cQ.height+=cP}}function aO(cN){var cO={line:0,ch:0};aF(cO,{line:ck.size-1,ch:cr(ck.size-1).text.length},w(cN),cO,cO);cb=true}function bO(cN){var cO=[];ck.iter(0,ck.size,function(cP){cO.push(cP.text)});return cO.join("\n")}function b6(cT){aW(u(cT,"shiftKey"));for(var cQ=h(cT);cQ!=au;cQ=cQ.parentNode){if(cQ.parentNode==bA&&cQ!=b2){return}}for(var cQ=h(cT);cQ!=au;cQ=cQ.parentNode){if(cQ.parentNode==aQ){if(bN.onGutterClick){bN.onGutterClick(bV,m(aQ.childNodes,cQ)+cD,cT)}return N(cT)}}var cN=aU(cT);switch(t(cT)){case 3:if(H&&!G){aT(cT)}return;case 2:if(cN){aY(cN.line,cN.ch,true)}return}if(!cN){if(h(cT)==ba){N(cT)}return}if(!b5){cH()}var cO=+new Date;if(aR&&aR.time>cO-400&&W(aR.pos,cN)){N(cT);setTimeout(bp,20);return aB(cN.line)}else{if(bf&&bf.time>cO-400&&W(bf.pos,cN)){aR={time:cO,pos:cN};N(cT);return bw(cN)}else{bf={time:cO,pos:cN}}}var cV=cN,cP;if(z&&!bN.readOnly&&!W(cK.from,cK.to)&&!T(cN,cK.from)&&!T(cK.to,cN)){if(e){bk.draggable=true}var cS=n(cy,"mouseup",ai(function(cW){if(e){bk.draggable=false}a2=false;cS();if(Math.abs(cT.clientX-cW.clientX)+Math.abs(cT.clientY-cW.clientY)<10){N(cW);aY(cN.line,cN.ch,true);bp()}}),true);a2=true;return}N(cT);aY(cN.line,cN.ch,true);function cU(cW){var cY=aU(cW,true);if(cY&&!W(cY,cV)){if(!b5){cH()}cV=cY;bn(cN,cY);cb=false;var cX=bq();if(cY.line>=cX.to||cY.line<cX.from){cP=setTimeout(ai(function(){cU(cW)}),150)}}}var cR=n(cy,"mousemove",ai(function(cW){clearTimeout(cP);N(cW);cU(cW)}),true);var cS=n(cy,"mouseup",ai(function(cW){clearTimeout(cP);var cX=aU(cW);if(cX){bn(cN,cX)}N(cW);bp();cb=true;cR();cS()}),true)}function bJ(cN){for(var cP=h(cN);cP!=au;cP=cP.parentNode){if(cP.parentNode==aQ){return N(cN)}}var cO=aU(cN);if(!cO){return}aR={time:+new Date,pos:cO};N(cN);bw(cO)}function af(cT){cT.preventDefault();var cU=aU(cT,true),cN=cT.dataTransfer.files;if(!cU||bN.readOnly){return}if(cN&&cN.length&&window.FileReader&&window.File){function cQ(cZ,cY){var cX=new FileReader;cX.onload=function(){cW[cY]=cX.result;if(++cO==cP){cU=aK(cU);ai(function(){var c0=bD(cW.join(""),cU,cU);bn(cU,c0)})()}};cX.readAsText(cZ)}var cP=cN.length,cW=Array(cP),cO=0;for(var cR=0;cR<cP;++cR){cQ(cN[cR],cR)}}else{try{var cW=cT.dataTransfer.getData("Text");if(cW){var cV=cK.from,cS=cK.to;bn(cU,cU);if(a2){bD("",cV,cS)}bh(cW);bp()}}catch(cT){}}}function az(cO){var cN=bP();J(cN);cO.dataTransfer.setDragImage(aa,0,0);cO.dataTransfer.setData("Text",cN)}function cx(cT){var cQ=L[u(cT,"keyCode")],cS=r[bN.keyMap].auto,cR,cN;function cP(){return cS.call?cS.call(null,bV):cS}if(cQ==null||cT.altGraphKey){if(cS){bN.keyMap=cP()}return null}if(u(cT,"altKey")){cQ="Alt-"+cQ}if(u(cT,"ctrlKey")){cQ="Ctrl-"+cQ}if(u(cT,"metaKey")){cQ="Cmd-"+cQ}if(u(cT,"shiftKey")&&(cR=j("Shift-"+cQ,bN.extraKeys,bN.keyMap))){cN=true}else{cR=j(cQ,bN.extraKeys,bN.keyMap)}if(typeof cR=="string"){if(F.propertyIsEnumerable(cR)){cR=F[cR]}else{cR=null}}if(cS&&(cR||!K(cT))){bN.keyMap=cP()}if(!cR){return false}var cO=b4;try{if(bN.readOnly){cd=true}if(cN){b4=null}cR(bV)}finally{b4=cO;cd=false}N(cT);return true}var cu=null;function bY(cP){if(!b5){cH()}if(C&&cP.keyCode==27){cP.returnValue=false}if(bN.onKeyEvent&&bN.onKeyEvent(bV,I(cP))){return}var cN=u(cP,"keyCode");aW(cN==16||u(cP,"shiftKey"));var cO=cx(cP);if(window.opera){cu=cO?cN:null;if(!cO&&cN==88&&u(cP,G?"metaKey":"ctrlKey")){bh("")}}}function bd(cQ){var cP=u(cQ,"keyCode"),cN=u(cQ,"charCode");if(window.opera&&cP==cu){cu=null;N(cQ);return}if(bN.onKeyEvent&&bN.onKeyEvent(bV,I(cQ))){return}if(window.opera&&!cQ.which&&cx(cQ)){return}if(bN.electricChars&&bX.electricChars&&bN.smartIndent&&!bN.readOnly){var cO=String.fromCharCode(cN==null?cP:cN);if(bX.electricChars.indexOf(cO)>-1){setTimeout(ai(function(){bo(cK.to.line,"smart")}),75)}}aH()}function b7(cN){if(bN.onKeyEvent&&bN.onKeyEvent(bV,I(cN))){return}if(u(cN,"keyCode")==16){b4=null}}function cH(){if(bN.readOnly=="nocursor"){return}if(!b5){if(bN.onFocus){bN.onFocus(bV)}b5=true;if(au.className.search(/\bCodeMirror-focused\b/)==-1){au.className+=" CodeMirror-focused"}if(!a6){co(true)}}ae();cz()}function av(){if(b5){if(bN.onBlur){bN.onBlur(bV)}b5=false;if(bQ){ai(function(){if(bQ){bQ();bQ=null}})()}au.className=au.className.replace(" CodeMirror-focused","")}clearInterval(cC);setTimeout(function(){if(!b5){b4=null}},150)}function aF(cS,cR,cQ,cO,cN){if(cd){return}if(a0){var cP=[];ck.iter(cS.line,cR.line+1,function(cT){cP.push(cT.text)});a0.addChange(cS.line,cQ.length,cP);while(a0.done.length>bN.undoDepth){a0.done.shift()}}aj(cS,cR,cQ,cO,cN)}function bW(cV,cW,cN){var cX=cV.pop(),cR=cX?cX.length:0,cP=[];for(var cQ=cN>0?0:cR-1,cS=cN>0?cR:-1;cQ!=cS;cQ+=cN){var cU=cX[cQ];var cY=[],cO=cU.start+cU.added;ck.iter(cU.start,cO,function(cZ){cY.push(cZ.text)});cP.push({start:cU.start,added:cU.old.length,old:cY});var cT=aK({line:cU.start+cU.old.length-1,ch:Q(cY[cY.length-1],cU.old[cU.old.length-1])});aj({line:cU.start,ch:0},{line:cO-1,ch:cr(cO-1).text.length},cU.old,cT,cT)}cb=true;cW.push(cP)}function cG(){bW(a0.done,a0.undone,-1)}function cv(){bW(a0.undone,a0.done,1)}function aj(c2,cR,c8,cN,c9){if(cd){return}var c7=false,cQ=br.length;if(!bN.lineWrapping){ck.iter(c2.line,cR.line,function(da){if(da.text.length==cQ){c7=true;return true}})}if(c2.line!=cR.line||c8.length>1){aJ=true}var cZ=cR.line-c2.line,cY=cr(c2.line),cO=cr(cR.line);if(c2.ch==0&&cR.ch==0&&c8[c8.length-1]==""){var cW=[],cX=null;if(c2.line){cX=cr(c2.line-1);cX.fixMarkEnds(cO)}else{cO.fixMarkStarts()}for(var c4=0,c6=c8.length-1;c4<c6;++c4){cW.push(d.inheritMarks(c8[c4],cX))}if(cZ){ck.remove(c2.line,cZ,cm)}if(cW.length){ck.insert(c2.line,cW)}}else{if(cY==cO){if(c8.length==1){cY.replace(c2.ch,cR.ch,c8[0])}else{cO=cY.split(cR.ch,c8[c8.length-1]);cY.replace(c2.ch,null,c8[0]);cY.fixMarkEnds(cO);var cW=[];for(var c4=1,c6=c8.length-1;c4<c6;++c4){cW.push(d.inheritMarks(c8[c4],cY))}cW.push(cO);ck.insert(c2.line+1,cW)}}else{if(c8.length==1){cY.replace(c2.ch,null,c8[0]);cO.replace(null,cR.ch,"");cY.append(cO);ck.remove(c2.line+1,cZ,cm)}else{var cW=[];cY.replace(c2.ch,null,c8[0]);cO.replace(null,cR.ch,c8[c8.length-1]);cY.fixMarkEnds(cO);for(var c4=1,c6=c8.length-1;c4<c6;++c4){cW.push(d.inheritMarks(c8[c4],cY))}if(cZ>1){ck.remove(c2.line+1,cZ-1,cm)}ck.insert(c2.line+1,cW)}}}if(bN.lineWrapping){var cT=ba.clientWidth/a8()-3;ck.iter(c2.line,c2.line+c8.length,function(da){if(da.hidden){return}var db=Math.ceil(da.text.length/cT)||1;if(db!=da.height){aV(da,db)}})}else{ck.iter(c2.line,c4+c8.length,function(db){var da=db.text;if(da.length>cQ){br=da;cQ=da.length;aw=null;c7=false}});if(c7){cQ=0;br="";aw=null;ck.iter(0,ck.size,function(db){var da=db.text;if(da.length>cQ){cQ=da.length;br=da}})}}var cP=[],cV=c8.length-cZ-1;for(var c4=0,c1=b3.length;c4<c1;++c4){var c5=b3[c4];if(c5<c2.line){cP.push(c5)}else{if(c5>cR.line){cP.push(c5+cV)}}}var c3=c2.line+Math.min(c8.length,500);ct(c2.line,c3);cP.push(c3);b3=cP;bu(100);ar.push({from:c2.line,to:cR.line+1,diff:cV});var cU={from:c2,to:cR,text:c8};if(cA){for(var cS=cA;cS.next;cS=cS.next){}cS.next=cU}else{cA=cU}function c0(da){return da<=Math.min(cR.line,cR.line+cV)?da:da+cV}bm(cN,c9,c0(cK.from.line),c0(cK.to.line));if(ba.clientHeight){bA.style.height=(ck.height*bC()+2*ce())+"px"}}function bD(cO,cR,cQ){cR=aK(cR);if(!cQ){cQ=cR}else{cQ=aK(cQ)}cO=w(cO);function cP(cU){if(T(cU,cR)){return cU}if(!T(cQ,cU)){return cN}var cS=cU.line+cO.length-(cQ.line-cR.line)-1;var cT=cU.ch;if(cU.line==cQ.line){cT+=cO[cO.length-1].length-(cQ.ch-(cQ.line==cR.line?cR.ch:0))}return{line:cS,ch:cT}}var cN;at(cO,cR,cQ,function(cS){cN=cS;return{from:cP(cK.from),to:cP(cK.to)}});return cN}function bh(cN,cO){at(w(cN),cK.from,cK.to,function(cP){if(cO=="end"){return{from:cP,to:cP}}else{if(cO=="start"){return{from:cK.from,to:cK.from}}else{return{from:cK.from,to:cP}}}})}function at(cQ,cS,cR,cN){var cP=cQ.length==1?cQ[0].length+cS.ch:cQ[cQ.length-1].length;var cO=cN({line:cS.line+cQ.length-1,ch:cP});aF(cS,cR,cQ,cO.from,cO.to)}function cB(cR,cQ){var cO=cR.line,cN=cQ.line;if(cO==cN){return cr(cO).text.slice(cR.ch,cQ.ch)}var cP=[cr(cO).text.slice(cR.ch)];ck.iter(cO+1,cN,function(cS){cP.push(cS.text)});cP.push(cr(cN).text.slice(0,cQ.ch));return cP.join("\n")}function bP(){return cB(cK.from,cK.to)}var bi=false;function ae(){if(bi){return}bT.set(bN.pollInterval,function(){aE();by();if(b5){ae()}ao()})}function aH(){var cN=false;bi=true;function cO(){aE();var cP=by();if(!cP&&!cN){cN=true;bT.set(60,cO)}else{bi=false;ae()}ao()}bT.set(20,cO)}var a1="";function by(){if(a6||!b5||X(bc)||bN.readOnly){return false}var cO=bc.value;if(cO==a1){return false}b4=null;var cP=0,cN=Math.min(a1.length,cO.length);while(cP<cN&&a1[cP]==cO[cP]){++cP}if(cP<a1.length){cK.from={line:cK.from.line,ch:cK.from.ch-(a1.length-cP)}}else{if(b9&&W(cK.from,cK.to)){cK.to={line:cK.to.line,ch:Math.min(cr(cK.to.line).text.length,cK.to.ch+(cO.length-cP))}}}bh(cO.slice(cP),"end");a1=cO;return true}function co(cN){if(!W(cK.from,cK.to)){a1="";bc.value=bP();bc.select()}else{if(cN){a1=bc.value=""}}}function bp(){if(bN.readOnly!="nocursor"){bc.focus()}}function cM(){if(!a3.getBoundingClientRect){return}var cN=a3.getBoundingClientRect();if(C&&cN.top==cN.bottom){return}var cO=window.innerHeight||Math.max(document.body.offsetHeight,document.documentElement.offsetHeight);if(cN.top<0||cN.bottom>cO){a3.scrollIntoView()}}function b1(){var cO=cE(cK.inverted?cK.from:cK.to);var cN=bN.lineWrapping?Math.min(cO.x,bk.offsetWidth):cO.x;return aq(cN,cO.y,cN,cO.yBot)}function aq(cP,cU,cN,cT){var cR=aX(),c0=ce(),cW=bC();cU+=c0;cT+=c0;cP+=cR;cN+=cR;var cX=ba.clientHeight,cQ=ba.scrollTop,cO=false,cZ=true;if(cU<cQ){ba.scrollTop=Math.max(0,cU-2*cW);cO=true}else{if(cT>cQ+cX){ba.scrollTop=cT+cW-cX;cO=true}}var cV=ba.clientWidth,cY=ba.scrollLeft;var cS=bN.fixedGutter?ay.clientWidth:0;if(cP<cY+cS){if(cP<50){cP=0}ba.scrollLeft=Math.max(0,cP-10-cS);cO=true}else{if(cN>cV+cY-3){ba.scrollLeft=cN+10-cV;cO=true;if(cN>bA.clientWidth){cZ=false}}}if(cO&&bN.onScroll){bN.onScroll(bV)}return cZ}function bq(){var cO=bC(),cQ=ba.scrollTop-ce();var cN=Math.max(0,Math.floor(cQ/cO));var cP=Math.ceil((cQ+ba.clientHeight)/cO);return{from:R(ck,cN),to:R(ck,cP)}}function bZ(cX,cS){if(!ba.clientWidth){cD=bz=a4=0;return}var cQ=bq();if(cX!==true&&cX.length==0&&cQ.from>cD&&cQ.to<bz){return}var cY=Math.max(cQ.from-100,0),cZ=Math.min(ck.size,cQ.to+100);if(cD<cY&&cY-cD<20){cY=cD}if(bz>cZ&&bz-cZ<20){cZ=Math.min(ck.size,bz)}var c0=cX===true?[]:bM([{from:cD,to:bz,domStart:0}],cX);var cW=0;for(var cT=0;cT<c0.length;++cT){var cU=c0[cT];if(cU.from<cY){cU.domStart+=(cY-cU.from);cU.from=cY}if(cU.to>cZ){cU.to=cZ}if(cU.from>=cU.to){c0.splice(cT--,1)}else{cW+=cU.to-cU.from}}if(cW==cZ-cY){return}c0.sort(function(c2,c1){return c2.domStart-c1.domStart});var cP=bC(),cN=ay.style.display;ah.style.display="none";aI(cY,cZ,c0);ah.style.display=ay.style.display="";var cO=cY!=cD||cZ!=bz||bB!=ba.clientHeight+cP;if(cO){bB=ba.clientHeight+cP}cD=cY;bz=cZ;a4=f(ck,cY);b2.style.top=(a4*cP)+"px";if(ba.clientHeight){bA.style.height=(ck.height*cP+2*ce())+"px"}if(ah.childNodes.length!=bz-cD){throw new Error("BAD PATCH! "+JSON.stringify(c0)+" size="+(bz-cD)+" nodes="+ah.childNodes.length)}if(bN.lineWrapping){aw=ba.clientWidth;var cR=ah.firstChild,cV=false;ck.iter(cD,bz,function(c2){if(!c2.hidden){var c1=Math.round(cR.offsetHeight/cP)||1;if(c2.height!=c1){aV(c2,c1);aJ=cV=true}}cR=cR.nextSibling});if(cV){bA.style.height=(ck.height*cP+2*ce())+"px"}}else{if(aw==null){aw=cf(br)}if(aw>ba.clientWidth){bk.style.width=aw+"px";bA.style.width="";bA.style.width=ba.scrollWidth+"px"}else{bk.style.width=bA.style.width=""}}ay.style.display=cN;if(cO||aJ){aC()}cJ();if(!cS&&bN.onUpdate){bN.onUpdate(bV)}return true}function bM(cW,cU){for(var cR=0,cP=cU.length||0;cR<cP;++cR){var cT=cU[cR],cN=[],cV=cT.diff||0;for(var cQ=0,cO=cW.length;cQ<cO;++cQ){var cS=cW[cQ];if(cT.to<=cS.from&&cT.diff){cN.push({from:cS.from+cV,to:cS.to+cV,domStart:cS.domStart})}else{if(cT.to<=cS.from||cT.from>=cS.to){cN.push(cS)}else{if(cT.from>cS.from){cN.push({from:cS.from,to:cT.from,domStart:cS.domStart})}if(cT.to<cS.to){cN.push({from:cT.to+cV,to:cS.to+cV,domStart:cS.domStart+(cT.to-cS.from)})}}}}cW=cN}return cW}function aI(cX,cY,c0){if(!c0.length){ah.innerHTML=""}else{function cN(c2){var c1=c2.nextSibling;c2.parentNode.removeChild(c2);return c1}var cS=0,cQ=ah.firstChild,cO;for(var cT=0;cT<c0.length;++cT){var cZ=c0[cT];while(cZ.domStart>cS){cQ=cN(cQ);cS++}for(var cR=0,cV=cZ.to-cZ.from;cR<cV;++cR){cQ=cQ.nextSibling;cS++}}while(cQ){cQ=cN(cQ)}}var cU=c0.shift(),cQ=ah.firstChild,cR=cX;var cW=cy.createElement("div"),cP;ck.iter(cX,cY,function(c1){if(cU&&cU.to==cR){cU=c0.shift()}if(!cU||cU.from>cR){if(c1.hidden){var c2=cW.innerHTML="<pre></pre>"}else{var c2="<pre>"+c1.getHTML(bj)+"</pre>";if(c1.className){c2='<div style="position: relative"><pre class="'+c1.className+'" style="position: absolute; left: 0; right: 0; top: 0; bottom: 0; z-index: -2">&#160;</pre>'+c2+"</div>"}}cW.innerHTML=c2;ah.insertBefore(cW.firstChild,cQ)}else{cQ=cQ.nextSibling}++cR})}function aC(){if(!bN.gutter&&!bN.lineNumbers){return}var cN=b2.offsetHeight,cU=ba.clientHeight;ay.style.height=(cN-cU<2?cU:cN)+"px";var cP=[],cO=cD;ck.iter(cD,Math.max(bz,cD+1),function(cW){if(cW.hidden){cP.push("<pre></pre>")}else{var cV=cW.gutterMarker;var cY=bN.lineNumbers?cO+bN.firstLineNumber:null;if(cV&&cV.text){cY=cV.text.replace("%N%",cY!=null?cY:"")}else{if(cY==null){cY="\u00a0"}}cP.push((cV&&cV.style?'<pre class="'+cV.style+'">':"<pre>"),cY);for(var cX=1;cX<cW.height;++cX){cP.push("<br/>&#160;")}cP.push("</pre>")}++cO});ay.style.display="none";aQ.innerHTML=cP.join("");var cT=String(ck.size).length,cR=aQ.firstChild,cS=B(cR),cQ="";while(cS.length+cQ.length<cT){cQ+="\u00a0"}if(cQ){cR.insertBefore(cy.createTextNode(cQ),cR.firstChild)}ay.style.display="";bk.style.marginLeft=ay.offsetWidth+"px";aJ=false}function cJ(){var cQ=W(cK.from,cK.to);var cZ=cE(cK.from,true);var cV=cQ?cZ:cE(cK.to,true);var cT=cK.inverted?cZ:cV,cO=bC();var cN=ac(au),cP=ac(ah);bK.style.top=Math.max(0,Math.min(ba.offsetHeight,cT.y+cP.top-cN.top))+"px";bK.style.left=Math.max(0,Math.min(ba.offsetWidth,cT.x+cP.left-cN.left))+"px";if(cQ){a3.style.top=cT.y+"px";a3.style.left=(bN.lineWrapping?Math.min(cT.x,bk.offsetWidth):cT.x)+"px";a3.style.display="";a7.style.display="none"}else{var cX=cZ.y==cV.y,cS="";function cY(c3,c2,c1,c0){cS+='<div class="CodeMirror-selected" style="position: absolute; left: '+c3+"px; top: "+c2+"px; right: "+c1+"px; height: "+c0+'px"></div>'}if(cK.from.ch&&cZ.y>=0){var cW=cX?bk.clientWidth-cV.x:0;cY(cZ.x,cZ.y,cW,cO)}var cR=Math.max(0,cZ.y+(cK.from.ch?cO:0));var cU=Math.min(cV.y,bk.clientHeight)-cR;if(cU>0.2*cO){cY(0,cR,0,cU)}if((!cX||!cK.from.ch)&&cV.y<bk.clientHeight-0.5*cO){cY(0,cV.y,bk.clientWidth-cV.x,cO)}a7.innerHTML=cS;a3.style.display="none";a7.style.display=""}}function aW(cN){if(cN){b4=b4||(cK.inverted?cK.to:cK.from)}else{b4=null}}function bn(cP,cO){var cN=b4&&aK(b4);if(cN){if(T(cN,cP)){cP=cN}else{if(T(cO,cN)){cO=cN}}}bm(cP,cO);bS=true}function bm(cR,cQ,cN,cP){ch=null;if(cN==null){cN=cK.from.line;cP=cK.to.line}if(W(cK.from,cR)&&W(cK.to,cQ)){return}if(T(cQ,cR)){var cO=cQ;cQ=cR;cR=cO}if(cR.line!=cN){cR=bE(cR,cN,cK.from.ch)}if(cQ.line!=cP){cQ=bE(cQ,cP,cK.to.ch)}if(W(cR,cQ)){cK.inverted=false}else{if(W(cR,cK.to)){cK.inverted=false}else{if(W(cQ,cK.from)){cK.inverted=true}}}cK.from=cR;cK.to=cQ;aG=true}function bE(cR,cO,cP){function cQ(cU){var cW=cR.line+cU,cT=cU==1?ck.size:-1;while(cW!=cT){var cS=cr(cW);if(!cS.hidden){var cV=cR.ch;if(cV>cP||cV>cS.text.length){cV=cS.text.length}return{line:cW,ch:cV}}cW+=cU}}var cN=cr(cR.line);if(!cN.hidden){return cR}if(cR.line>=cO){return cQ(1)||cQ(-1)}else{return cQ(-1)||cQ(1)}}function aY(cN,cP,cO){var cQ=aK({line:cN,ch:cP||0});(cO?bn:bm)(cQ,cQ)}function bL(cN){return Math.max(0,Math.min(cN,ck.size-1))}function aK(cP){if(cP.line<0){return{line:0,ch:0}}if(cP.line>=ck.size){return{line:ck.size-1,ch:cr(ck.size-1).text.length}}var cN=cP.ch,cO=cr(cP.line).text.length;if(cN==null||cN>cO){return{line:cP.line,ch:cO}}else{if(cN<0){return{line:cP.line,ch:0}}else{return cP}}}function ca(cQ,cU){var cR=cK.inverted?cK.from:cK.to,cV=cR.line,cN=cR.ch;var cT=cr(cV);function cO(){for(var cW=cV+cQ,cY=cQ<0?-1:ck.size;cW!=cY;cW+=cQ){var cX=cr(cW);if(!cX.hidden){cV=cW;cT=cX;return true}}}function cS(cW){if(cN==(cQ<0?0:cT.text.length)){if(!cW&&cO()){cN=cQ<0?cT.text.length:0}else{return false}}else{cN+=cQ}return true}if(cU=="char"){cS()}else{if(cU=="column"){cS(true)}else{if(cU=="word"){var cP=false;for(;;){if(cQ<0){if(!cS()){break}}if(Y(cT.text.charAt(cN))){cP=true}else{if(cP){if(cQ<0){cQ=1;cS()}break}}if(cQ>0){if(!cS()){break}}}}}}return{line:cV,ch:cN}}function cq(cN,cO){var cP=cN<0?cK.from:cK.to;if(b4||W(cK.from,cK.to)){cP=ca(cN,cO)}aY(cP.line,cP.ch,true)}function b8(cN,cO){if(!W(cK.from,cK.to)){bD("",cK.from,cK.to)}else{if(cN<0){bD("",ca(cN,cO),cK.to)}else{bD("",cK.from,ca(cN,cO))}}bS=true}var ch=null;function cj(cN,cO){var cQ=0,cR=cE(cK.inverted?cK.from:cK.to,true);if(ch!=null){cR.x=ch}if(cO=="page"){cQ=Math.min(ba.clientHeight,window.innerHeight||document.documentElement.clientHeight)}else{if(cO=="line"){cQ=bC()}}var cP=bv(cR.x,cR.y+cQ*cN+2);aY(cP.line,cP.ch,true);ch=cR.x}function bw(cQ){var cO=cr(cQ.line).text;var cP=cQ.ch,cN=cQ.ch;while(cP>0&&Y(cO.charAt(cP-1))){--cP}while(cN<cO.length&&Y(cO.charAt(cN))){++cN}bn({line:cQ.line,ch:cP},{line:cQ.line,ch:cN})}function aB(cN){bn({line:cN,ch:0},{line:cN,ch:cr(cN).text.length})}function cn(cP){if(W(cK.from,cK.to)){return bo(cK.from.line,cP)}var cO=cK.to.line-(cK.to.ch?0:1);for(var cN=cK.from.line;cN<=cO;++cN){bo(cN,cP)}}function bo(cP,cW){if(!cW){cW="add"}if(cW=="smart"){if(!bX.indent){cW="prev"}else{var cN=cg(cP)}}var cX=cr(cP),cR=cX.indentation(bN.tabSize),cO=cX.text.match(/^\s*/)[0],cT;if(cW=="prev"){if(cP){cT=cr(cP-1).indentation(bN.tabSize)}else{cT=0}}else{if(cW=="smart"){cT=bX.indent(cN,cX.text.slice(cO.length),cX.text)}else{if(cW=="add"){cT=cR+bN.indentUnit}else{if(cW=="subtract"){cT=cR-bN.indentUnit}}}}cT=Math.max(0,cT);var cV=cT-cR;if(!cV){if(cK.from.line!=cP&&cK.to.line!=cP){return}var cU=cO}else{var cU="",cS=0;if(bN.indentWithTabs){for(var cQ=Math.floor(cT/bN.tabSize);cQ;--cQ){cS+=bN.tabSize;cU+="\t"}}while(cS<cT){++cS;cU+=" "}}bD(cU,{line:cP,ch:0},{line:cP,ch:cO.length})}function bG(){bX=q.getMode(bN,bN.mode);ck.iter(0,ck.size,function(cN){cN.stateAfter=null});b3=[0];bu()}function a5(){var cN=bN.gutter||bN.lineNumbers;ay.style.display=cN?"":"none";if(cN){aJ=true}else{ah.parentNode.style.marginLeft=0}}function cs(cP,cO){if(bN.lineWrapping){au.className+=" CodeMirror-wrap";var cN=ba.clientWidth/a8()-3;ck.iter(0,ck.size,function(cQ){if(cQ.hidden){return}var cR=Math.ceil(cQ.text.length/cN)||1;if(cR!=1){aV(cQ,cR)}});bk.style.width=bA.style.width=""}else{au.className=au.className.replace(" CodeMirror-wrap","");aw=null;br="";ck.iter(0,ck.size,function(cQ){if(cQ.height!=1&&!cQ.hidden){aV(cQ,1)}if(cQ.text.length>br.length){br=cQ.text}})}ar.push({from:0,to:ck.size})}function aN(){for(var cO='<span class="cm-tab">',cN=0;cN<bN.tabSize;++cN){cO+=" "}return cO+"</span>"}function cI(){bj=aN();bZ(true)}function cp(){ba.className=ba.className.replace(/\s*cm-s-\w+/g,"")+bN.theme.replace(/(^|\s)\s*/g," cm-s-")}function cL(){this.set=[]}cL.prototype.clear=ai(function(){var cS=Infinity,cO=-Infinity;for(var cR=0,cU=this.set.length;cR<cU;++cR){var cP=this.set[cR],cN=cP.marked;if(!cN||!cP.parent){continue}var cT=S(cP);cS=Math.min(cS,cT);cO=Math.max(cO,cT);for(var cQ=0;cQ<cN.length;++cQ){if(cN[cQ].set==this.set){cN.splice(cQ--,1)}}}if(cS!=Infinity){ar.push({from:cS,to:cO+1})}});cL.prototype.find=function(){var cS,cT;for(var cP=0,cR=this.set.length;cP<cR;++cP){var cV=this.set[cP],cQ=cV.marked;for(var cO=0;cO<cQ.length;++cO){var cN=cQ[cO];if(cN.set==this.set){if(cN.from!=null||cN.to!=null){var cU=S(cV);if(cU!=null){if(cN.from!=null){cS={line:cU,ch:cN.from}}if(cN.to!=null){cT={line:cU,ch:cN.to}}}}}}}return{from:cS,to:cT}};function bs(cT,cS,cP){cT=aK(cT);cS=aK(cS);var cN=new cL();function cR(cU,cX,cW,cV){cr(cU).addMark(new E(cX,cW,cV,cN.set))}if(cT.line==cS.line){cR(cT.line,cT.ch,cS.ch,cP)}else{cR(cT.line,cT.ch,null,cP);for(var cO=cT.line+1,cQ=cS.line;cO<cQ;++cO){cR(cO,null,null,cP)}cR(cS.line,null,cS.ch,cP)}ar.push({from:cT.line,to:cS.line+1});return cN}function aL(cO){cO=aK(cO);var cN=new A(cO.ch);cr(cO.line).addMark(cN);return cN}function bI(cN,cP,cO){if(typeof cN=="number"){cN=cr(bL(cN))}cN.gutterMarker={text:cP,style:cO};aJ=true;return cN}function ak(cN){if(typeof cN=="number"){cN=cr(bL(cN))}cN.gutterMarker=null;aJ=true}function aP(cO,cQ){var cP=cO,cN=cO;if(typeof cO=="number"){cN=cr(bL(cO))}else{cP=S(cO)}if(cP==null){return null}if(cQ(cN,cP)){ar.push({from:cP,to:cP+1})}else{return null}return cN}function bb(cO,cN){return aP(cO,function(cP){if(cP.className!=cN){cP.className=cN;return true}})}function cw(cO,cN){return aP(cO,function(cP,cS){if(cP.hidden!=cN){cP.hidden=cN;aV(cP,cN?0:1);var cR=cK.from.line,cQ=cK.to.line;if(cN&&(cR==cS||cQ==cS)){var cU=cR==cS?bE({line:cR,ch:0},cR,0):cK.from;var cT=cQ==cS?bE({line:cQ,ch:0},cQ,0):cK.to;bm(cU,cT)}return(aJ=true)}})}function aM(cO){if(typeof cO=="number"){if(!bg(cO)){return null}var cP=cO;cO=cr(cO);if(!cO){return null}}else{var cP=S(cO);if(cP==null){return null}}var cN=cO.gutterMarker;return{line:cP,handle:cO,text:cO.text,markerText:cN&&cN.text,markerClass:cN&&cN.style,lineClass:cO.className}}function cf(cN){al.innerHTML="<pre><span>x</span></pre>";al.firstChild.firstChild.firstChild.nodeValue=cN;return al.firstChild.firstChild.offsetWidth||10}function ax(cZ,cT){if(cT<=0){return 0}var cQ=cr(cZ),cW=cQ.text;function cX(c0){al.innerHTML="<pre><span>"+cQ.getHTML(bj,c0)+"</span></pre>";return al.firstChild.firstChild.offsetWidth}var cU=0,cS=0,cV=cW.length,cR;var cO=Math.min(cV,Math.ceil(cT/a8()));for(;;){var cP=cX(cO);if(cP<=cT&&cO<cV){cO=Math.min(cV,Math.ceil(cO*1.2))}else{cR=cP;cV=cO;break}}if(cT>cR){return cV}cO=Math.floor(cV*0.8);cP=cX(cO);if(cP<cT){cU=cO;cS=cP}for(;;){if(cV-cU<=1){return(cR-cT>cT-cS)?cU:cV}var cY=Math.ceil((cU+cV)/2),cN=cX(cY);if(cN>cT){cV=cY;cR=cN}else{cU=cY;cS=cN}}}var cl=Math.floor(Math.random()*16777215).toString(16);function bR(cP,cS){if(cS==0){return{top:0,left:0}}var cN="";if(bN.lineWrapping){var cO=cP.text.indexOf(" ",cS+2);cN=J(cP.text.slice(cS+1,cO<0?cP.text.length:cO+(C?5:0)))}al.innerHTML="<pre>"+cP.getHTML(bj,cS)+'<span id="CodeMirror-temp-'+cl+'">'+J(cP.text.charAt(cS)||" ")+"</span>"+cN+"</pre>";var cR=document.getElementById("CodeMirror-temp-"+cl);var cU=cR.offsetTop,cT=cR.offsetLeft;if(C&&cU==0&&cT==0){var cQ=document.createElement("span");cQ.innerHTML="x";cR.parentNode.insertBefore(cQ,cR.nextSibling);cU=cQ.offsetTop}return{top:cU,left:cT}}function cE(cS,cQ){var cN,cO=bC(),cR=cO*(f(ck,cS.line)-(cQ?a4:0));if(cS.ch==0){cN=0}else{var cP=bR(cr(cS.line),cS.ch);cN=cP.left;if(bN.lineWrapping){cR+=Math.max(0,cP.top)}}return{x:cN,y:cR,yBot:cR+cO}}function bv(cW,cV){if(cV<0){cV=0}var cT=bC(),cR=a8(),c2=a4+Math.floor(cV/cT);var cX=R(ck,c2);if(cX>=ck.size){return{line:ck.size-1,ch:cr(ck.size-1).text.length}}var cO=cr(cX),cZ=cO.text;var c4=bN.lineWrapping,cU=c4?c2-f(ck,cX):0;if(cW<=0&&cU==0){return{line:cX,ch:0}}function c3(c6){var c7=bR(cO,c6);if(c4){var c8=Math.round(c7.top/cT);return Math.max(0,c7.left+(c8-cU)*ba.clientWidth)}return c7.left}var c1=0,c0=0,cP=cZ.length,cN;var cY=Math.min(cP,Math.ceil((cW+cU*ba.clientWidth*0.9)/cR));for(;;){var cS=c3(cY);if(cS<=cW&&cY<cP){cY=Math.min(cP,Math.ceil(cY*1.2))}else{cN=cS;cP=cY;break}}if(cW>cN){return{line:cX,ch:cP}}cY=Math.floor(cP*0.8);cS=c3(cY);if(cS<cW){c1=cY;c0=cS}for(;;){if(cP-c1<=1){return{line:cX,ch:(cN-cW>cW-c0)?c1:cP}}var c5=Math.ceil((c1+cP)/2),cQ=c3(c5);if(cQ>cW){cP=c5;cN=cQ}else{c1=c5;c0=cQ}}}function ag(cP){var cN=cE(cP,true),cO=ac(bk);return{x:cO.left+cN.x,y:cO.top+cN.y,yBot:cO.top+cN.yBot}}var aS,an,bH;function bC(){if(bH==null){bH="<pre>";for(var cO=0;cO<49;++cO){bH+="x<br/>"}bH+="x</pre>"}var cN=ah.clientHeight;if(cN==an){return aS}an=cN;al.innerHTML=bH;aS=al.firstChild.offsetHeight/50||1;al.innerHTML="";return aS}var cF,bl=0;function a8(){if(ba.clientWidth==bl){return cF}bl=ba.clientWidth;return(cF=cf("x"))}function ce(){return bk.offsetTop}function aX(){return bk.offsetLeft}function aU(cR,cQ){var cP=ac(ba,true),cN,cS;try{cN=cR.clientX;cS=cR.clientY}catch(cR){return null}if(!cQ&&(cN-cP.left>ba.clientWidth||cS-cP.top>ba.clientHeight)){return null}var cO=ac(bk,true);return bv(cN-cO.left,cS-cO.top)}function aT(cO){var cS=aU(cO);if(!cS||window.opera){return}if(W(cK.from,cK.to)||T(cS,cK.from)||!T(cS,cK.to)){ai(aY)(cS.line,cS.ch)}var cR=bc.style.cssText;bK.style.position="absolute";bc.style.cssText="position: fixed; width: 30px; height: 30px; top: "+(cO.clientY-5)+"px; left: "+(cO.clientX-5)+"px; z-index: 1000; background: white; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);";a6=true;var cQ=bc.value=bP();bp();bc.select();function cN(){var cT=w(bc.value).join("\n");if(cT!=cQ){ai(bh)(cT,"end")}bK.style.position="relative";bc.style.cssText=cR;a6=false;co(true);ae()}if(H){s(cO);var cP=n(window,"mouseup",function(){cP();setTimeout(cN,20)},true)}else{setTimeout(cN,50)}}function cz(){clearInterval(cC);var cN=true;a3.style.visibility="";cC=setInterval(function(){a3.style.visibility=(cN=!cN)?"":"hidden"},650)}var be={"(":")>",")":"(<","[":"]>","]":"[<","{":"}>","}":"{<"};function b0(cT){var cN=cK.inverted?cK.from:cK.to,cV=cr(cN.line),cO=cN.ch-1;var cS=(cO>=0&&be[cV.text.charAt(cO)])||be[cV.text.charAt(++cO)];if(!cS){return}var cW=cS.charAt(0),cU=cS.charAt(1)==">",c6=cU?1:-1,c1=cV.styles;for(var c7=cO+1,c3=0,c5=c1.length;c3<c5;c3+=2){if((c7-=c1[c3].length)<=0){var c4=c1[c3+1];break}}var cQ=[cV.text.charAt(cO)],c0=/[(){}[\]]/;function cY(dj,de,df){if(!dj.text){return}var di=dj.styles,dd=cU?0:dj.text.length-1,dg;for(var da=cU?0:di.length-2,dc=cU?di.length:-2;da!=dc;da+=2*c6){var dh=di[da];if(di[da+1]!=null&&di[da+1]!=c4){dd+=c6*dh.length;continue}for(var c9=cU?0:dh.length-1,c8=cU?dh.length:-1;c9!=c8;c9+=c6,dd+=c6){if(dd>=de&&dd<df&&c0.test(dg=dh.charAt(c9))){var db=be[dg];if(db.charAt(1)==">"==cU){cQ.push(dg)}else{if(cQ.pop()!=db.charAt(0)){return{pos:dd,match:false}}else{if(!cQ.length){return{pos:dd,match:true}}}}}}}}for(var c3=cN.line,c5=cU?Math.min(c3+100,ck.size):Math.max(-1,c3-100);c3!=c5;c3+=c6){var cV=cr(c3),cR=c3==cN.line;var cX=cY(cV,cR&&cU?cO+1:0,cR&&!cU?cO:cV.text.length);if(cX){break}}if(!cX){cX={pos:null,match:false}}var c4=cX.match?"CodeMirror-matchingbracket":"CodeMirror-nonmatchingbracket";var c2=bs({line:cN.line,ch:cO},{line:cN.line,ch:cO+1},c4),cP=cX.pos!=null&&bs({line:c3,ch:cX.pos},{line:c3,ch:cX.pos+1},c4);var cZ=ai(function(){c2.clear();cP&&cP.clear()});if(cT){setTimeout(cZ,800)}else{bQ=cZ}}function aZ(cT){var cS,cP;for(var cO=cT,cQ=cT-40;cO>cQ;--cO){if(cO==0){return 0}var cN=cr(cO-1);if(cN.stateAfter){return cO}var cR=cN.indentation(bN.tabSize);if(cP==null||cS>cR){cP=cO-1;cS=cR}}return cP}function cg(cP){var cO=aZ(cP),cN=cO&&cr(cO-1).stateAfter;if(!cN){cN=P(bX)}else{cN=l(bX,cN)}ck.iter(cO,cP,function(cQ){cQ.highlight(bX,cN,bN.tabSize);cQ.stateAfter=l(bX,cN)});if(cO<cP){ar.push({from:cO,to:cP})}if(cP<ck.size&&!cr(cP).stateAfter){b3.push(cP)}return cN}function ct(cP,cN){var cO=cg(cP);ck.iter(cP,cN,function(cQ){cQ.highlight(bX,cO,bN.tabSize);cQ.stateAfter=l(bX,cO)})}function bF(){var cT=+new Date+bN.workTime;var cW=b3.length;while(b3.length){if(!cr(cD).stateAfter){var cQ=cD}else{var cQ=b3.pop()}if(cQ>=ck.size){continue}var cO=aZ(cQ),cN=cO&&cr(cO-1).stateAfter;if(cN){cN=l(bX,cN)}else{cN=P(bX)}var cS=0,cP=bX.compareStates,cV=false,cU=cO,cR=false;ck.iter(cU,ck.size,function(cX){var cY=cX.stateAfter;if(+new Date>cT){b3.push(cU);bu(bN.workDelay);if(cV){ar.push({from:cQ,to:cU+1})}return(cR=true)}var cZ=cX.highlight(bX,cN,bN.tabSize);if(cZ){cV=true}cX.stateAfter=l(bX,cN);if(cP){if(cY&&cP(cY,cN)){return true}}else{if(cZ!==false||!cY){cS=0}else{if(++cS>3&&(!bX.indent||bX.indent(cY,"")==bX.indent(cN,""))){return true}}}++cU});if(cR){return}if(cV){ar.push({from:cQ,to:cU+1})}}if(cW&&bN.onHighlightComplete){bN.onHighlightComplete(bV)}}function bu(cN){if(!b3.length){return}am.set(cN,ai(bF))}function aE(){cb=bS=cA=null;ar=[];aG=false;cm=[]}function ao(){var cR=false,cO;if(aG){cR=!b1()}if(ar.length){cO=bZ(ar,true)}else{if(aG){cJ()}if(aJ){aC()}}if(cR){b1()}if(aG){cM();cz()}if(b5&&!a6&&(cb===true||(cb!==false&&aG))){co(bS)}if(aG&&bN.matchBrackets){setTimeout(ai(function(){if(bQ){bQ();bQ=null}if(W(cK.from,cK.to)){b0(false)}}),20)}var cN=cA,cP=cm;if(aG&&bN.onCursorActivity){bN.onCursorActivity(bV)}if(cN&&bN.onChange&&bV){bN.onChange(bV,cN)}for(var cQ=0;cQ<cP.length;++cQ){cP[cQ](bV)}if(cO&&bN.onUpdate){bN.onUpdate(bV)}}var cc=0;function ai(cN){return function(){if(!cc++){aE()}try{var cO=cN.apply(this,arguments)}finally{if(!--cc){ao()}}return cO}}for(var bx in V){if(V.propertyIsEnumerable(bx)&&!bV.propertyIsEnumerable(bx)){bV[bx]=V[bx]}}return bV}q.defaults={value:"",mode:null,theme:"default",indentUnit:2,indentWithTabs:false,smartIndent:true,tabSize:4,keyMap:"default",extraKeys:null,electricChars:true,onKeyEvent:null,lineWrapping:false,lineNumbers:false,gutter:false,fixedGutter:false,firstLineNumber:1,readOnly:false,onChange:null,onCursorActivity:null,onGutterClick:null,onHighlightComplete:null,onUpdate:null,onFocus:null,onBlur:null,onScroll:null,matchBrackets:false,workTime:100,workDelay:200,pollInterval:100,undoDepth:40,tabindex:null,document:window.document};var o=/AppleWebKit/.test(navigator.userAgent)&&/Mobile\/\w+/.test(navigator.userAgent);var G=o||/Mac/.test(navigator.platform);var O=/Win/.test(navigator.platform);var ab={},M={};q.defineMode=function(ae,af){if(!q.defaults.mode&&ae!="null"){q.defaults.mode=ae}ab[ae]=af};q.defineMIME=function(af,ae){M[af]=ae};q.getMode=function(ag,ae){if(typeof ae=="string"&&M.hasOwnProperty(ae)){ae=M[ae]}if(typeof ae=="string"){var ai=ae,af={}}else{if(ae!=null){var ai=ae.name,af=ae}}var ah=ab[ai];if(!ah){if(window.console){console.warn("No mode "+ai+" found, falling back to plain text.")}return q.getMode(ag,"text/plain")}return ah(ag,af||{})};q.listModes=function(){var af=[];for(var ae in ab){if(ab.propertyIsEnumerable(ae)){af.push(ae)}}return af};q.listMIMEs=function(){var af=[];for(var ae in M){if(M.propertyIsEnumerable(ae)){af.push({mime:ae,mode:M[ae]})}}return af};var V=q.extensions={};q.defineExtension=function(ae,af){V[ae]=af};var F=q.commands={selectAll:function(ae){ae.setSelection({line:0,ch:0},{line:ae.lineCount()-1})},killLine:function(ae){var ah=ae.getCursor(true),ag=ae.getCursor(false),af=!W(ah,ag);if(!af&&ae.getLine(ah.line).length==ah.ch){ae.replaceRange("",ah,{line:ah.line+1,ch:0})}else{ae.replaceRange("",ah,af?ag:{line:ah.line})}},deleteLine:function(ae){var af=ae.getCursor().line;ae.replaceRange("",{line:af,ch:0},{line:af})},undo:function(ae){ae.undo()},redo:function(ae){ae.redo()},goDocStart:function(ae){ae.setCursor(0,0,true)},goDocEnd:function(ae){ae.setSelection({line:ae.lineCount()-1},null,true)},goLineStart:function(ae){ae.setCursor(ae.getCursor().line,0,true)},goLineStartSmart:function(ae){var ah=ae.getCursor();var ag=ae.getLine(ah.line),af=Math.max(0,ag.search(/\S/));ae.setCursor(ah.line,ah.ch<=af&&ah.ch?0:af,true)},goLineEnd:function(ae){ae.setSelection({line:ae.getCursor().line},null,true)},goLineUp:function(ae){ae.moveV(-1,"line")},goLineDown:function(ae){ae.moveV(1,"line")},goPageUp:function(ae){ae.moveV(-1,"page")},goPageDown:function(ae){ae.moveV(1,"page")},goCharLeft:function(ae){ae.moveH(-1,"char")},goCharRight:function(ae){ae.moveH(1,"char")},goColumnLeft:function(ae){ae.moveH(-1,"column")},goColumnRight:function(ae){ae.moveH(1,"column")},goWordLeft:function(ae){ae.moveH(-1,"word")},goWordRight:function(ae){ae.moveH(1,"word")},delCharLeft:function(ae){ae.deleteH(-1,"char")},delCharRight:function(ae){ae.deleteH(1,"char")},delWordLeft:function(ae){ae.deleteH(-1,"word")},delWordRight:function(ae){ae.deleteH(1,"word")},indentAuto:function(ae){ae.indentSelection("smart")},indentMore:function(ae){ae.indentSelection("add")},indentLess:function(ae){ae.indentSelection("subtract")},insertTab:function(ae){ae.replaceSelection("\t","end")},transposeChars:function(ae){var ag=ae.getCursor(),af=ae.getLine(ag.line);if(ag.ch>0&&ag.ch<af.length-1){ae.replaceRange(af.charAt(ag.ch)+af.charAt(ag.ch-1),{line:ag.line,ch:ag.ch-1},{line:ag.line,ch:ag.ch+1})}},newlineAndIndent:function(ae){ae.replaceSelection("\n","end");ae.indentLine(ae.getCursor().line)},toggleOverwrite:function(ae){ae.toggleOverwrite()}};var r=q.keyMap={};r.basic={Left:"goCharLeft",Right:"goCharRight",Up:"goLineUp",Down:"goLineDown",End:"goLineEnd",Home:"goLineStartSmart",PageUp:"goPageUp",PageDown:"goPageDown",Delete:"delCharRight",Backspace:"delCharLeft",Tab:"indentMore","Shift-Tab":"indentLess",Enter:"newlineAndIndent",Insert:"toggleOverwrite"};r.pcDefault={"Ctrl-A":"selectAll","Ctrl-D":"deleteLine","Ctrl-Z":"undo","Shift-Ctrl-Z":"redo","Ctrl-Y":"redo","Ctrl-Home":"goDocStart","Alt-Up":"goDocStart","Ctrl-End":"goDocEnd","Ctrl-Down":"goDocEnd","Ctrl-Left":"goWordLeft","Ctrl-Right":"goWordRight","Alt-Left":"goLineStart","Alt-Right":"goLineEnd","Ctrl-Backspace":"delWordLeft","Ctrl-Delete":"delWordRight","Ctrl-S":"save","Ctrl-F":"find","Ctrl-G":"findNext","Shift-Ctrl-G":"findPrev","Shift-Ctrl-F":"replace","Shift-Ctrl-R":"replaceAll",fallthrough:"basic"};r.macDefault={"Cmd-A":"selectAll","Cmd-D":"deleteLine","Cmd-Z":"undo","Shift-Cmd-Z":"redo","Cmd-Y":"redo","Cmd-Up":"goDocStart","Cmd-End":"goDocEnd","Cmd-Down":"goDocEnd","Alt-Left":"goWordLeft","Alt-Right":"goWordRight","Cmd-Left":"goLineStart","Cmd-Right":"goLineEnd","Alt-Backspace":"delWordLeft","Ctrl-Alt-Backspace":"delWordRight","Alt-Delete":"delWordRight","Cmd-S":"save","Cmd-F":"find","Cmd-G":"findNext","Shift-Cmd-G":"findPrev","Cmd-Alt-F":"replace","Shift-Cmd-Alt-F":"replaceAll",fallthrough:["basic","emacsy"]};r["default"]=G?r.macDefault:r.pcDefault;r.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Alt-F":"goWordRight","Alt-B":"goWordLeft","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageUp","Shift-Ctrl-V":"goPageDown","Ctrl-D":"delCharRight","Ctrl-H":"delCharLeft","Alt-D":"delWordRight","Alt-Backspace":"delWordLeft","Ctrl-K":"killLine","Ctrl-T":"transposeChars"};function j(af,ae,ah){function ag(ai,am,an){var ak=am[ai];if(ak!=null){return ak}if(an==null){an=am.fallthrough}if(an==null){return am.catchall}if(typeof an=="string"){return ag(ai,r[an])}for(var aj=0,al=an.length;aj<al;++aj){ak=ag(ai,r[an[aj]]);if(ak!=null){return ak}}return null}return ae?ag(af,ae,ah):ag(af,r[ah])}function K(af){var ae=L[u(af,"keyCode")];return ae=="Ctrl"||ae=="Alt"||ae=="Shift"||ae=="Mod"}q.fromTextArea=function(af,ah){if(!ah){ah={}}ah.value=af.value;if(!ah.tabindex&&af.tabindex){ah.tabindex=af.tabindex}function aj(){af.value=ae.getValue()}if(af.form){var ai=n(af.form,"submit",aj,true);if(typeof af.form.submit=="function"){var ag=af.form.submit;function ak(){aj();af.form.submit=ag;af.form.submit();af.form.submit=ak}af.form.submit=ak}}af.style.display="none";var ae=q(function(al){af.parentNode.insertBefore(al,af.nextSibling)},ah);ae.save=aj;ae.getTextArea=function(){return af};ae.toTextArea=function(){aj();af.parentNode.removeChild(ae.getWrapperElement());af.style.display="";if(af.form){ai();if(typeof af.form.submit=="function"){af.form.submit=ag}}};return ae};function l(ah,ae){if(ae===true){return ae}if(ah.copyState){return ah.copyState(ae)}var ag={};for(var ai in ae){var af=ae[ai];if(af instanceof Array){af=af.concat([])}ag[ai]=af}return ag}q.copyState=l;function P(ag,af,ae){return ag.startState?ag.startState(af,ae):true}q.startState=P;function b(ae,af){this.pos=this.start=0;this.string=ae;this.tabSize=af||8}b.prototype={eol:function(){return this.pos>=this.string.length},sol:function(){return this.pos==0},peek:function(){return this.string.charAt(this.pos)},next:function(){if(this.pos<this.string.length){return this.string.charAt(this.pos++)}},eat:function(ae){var ag=this.string.charAt(this.pos);if(typeof ae=="string"){var af=ag==ae}else{var af=ag&&(ae.test?ae.test(ag):ae(ag))}if(af){++this.pos;return ag}},eatWhile:function(ae){var af=this.pos;while(this.eat(ae)){}return this.pos>af},eatSpace:function(){var ae=this.pos;while(/[\s\u00a0]/.test(this.string.charAt(this.pos))){++this.pos}return this.pos>ae},skipToEnd:function(){this.pos=this.string.length},skipTo:function(ae){var af=this.string.indexOf(ae,this.pos);if(af>-1){this.pos=af;return true}},backUp:function(ae){this.pos-=ae},column:function(){return k(this.string,this.start,this.tabSize)},indentation:function(){return k(this.string,null,this.tabSize)},match:function(ah,af,ae){if(typeof ah=="string"){function ai(aj){return ae?aj.toLowerCase():aj}if(ai(this.string).indexOf(ai(ah),this.pos)==this.pos){if(af!==false){this.pos+=ah.length}return true}}else{var ag=this.string.slice(this.pos).match(ah);if(ag&&af!==false){this.pos+=ag[0].length}return ag}},current:function(){return this.string.slice(this.start,this.pos)}};q.StringStream=b;function E(ah,ag,ae,af){this.from=ah;this.to=ag;this.style=ae;this.set=af}E.prototype={attach:function(ae){this.set.push(ae)},detach:function(af){var ae=m(this.set,af);if(ae>-1){this.set.splice(ae,1)}},split:function(ah,ae){if(this.to<=ah&&this.to!=null){return null}var ag=this.from<ah||this.from==null?null:this.from-ah+ae;var af=this.to==null?null:this.to-ah+ae;return new E(ag,af,this.style,this.set)},dup:function(){return new E(null,null,this.style,this.set)},clipTo:function(af,ai,ae,ah,ag){if(this.from!=null&&this.from>=ai){this.from=Math.max(ah,this.from)+ag}if(this.to!=null&&this.to>ai){this.to=ah<this.to?this.to+ag:ai}if(af&&ah>this.from&&(ah<this.to||this.to==null)){this.from=null}if(ae&&(ai<this.to||this.to==null)&&(ai>this.from||this.from==null)){this.to=null}},isDead:function(){return this.from!=null&&this.to!=null&&this.from>=this.to},sameSet:function(ae){return this.set==ae.set}};function A(ae){this.from=ae;this.to=ae;this.line=null}A.prototype={attach:function(ae){this.line=ae},detach:function(ae){if(this.line==ae){this.line=null}},split:function(af,ae){if(af<this.from){this.from=this.to=(this.from-af)+ae;return this}},isDead:function(){return this.from>this.to},clipTo:function(af,ai,ae,ah,ag){if((af||ai<this.from)&&(ae||ah>this.to)){this.from=0;this.to=-1}else{if(this.from>ai){this.from=this.to=Math.max(ah,this.from)+ag}}},sameSet:function(ae){return false},find:function(){if(!this.line||!this.line.parent){return null}return{line:S(this.line),ch:this.from}},clear:function(){if(this.line){var ae=m(this.line.marked,this);if(ae!=-1){this.line.marked.splice(ae,1)}this.line=null}}};function d(af,ae){this.styles=ae||[af,null];this.text=af;this.height=1;this.marked=this.gutterMarker=this.className=this.handlers=null;this.stateAfter=this.parent=this.hidden=null}d.inheritMarks=function(ai,al){var ah=new d(ai),ae=al&&al.marked;if(ae){for(var ag=0;ag<ae.length;++ag){if(ae[ag].to==null&&ae[ag].style){var af=ah.marked||(ah.marked=[]),ak=ae[ag];var aj=ak.dup();af.push(aj);aj.attach(ah)}}}return ah};d.prototype={replace:function(ai,ah,al){var am=[],ag=this.marked,aj=ah==null?this.text.length:ah;ad(0,ai,this.styles,am);if(al){am.push(al,null)}ad(aj,this.text.length,this.styles,am);this.styles=am;this.text=this.text.slice(0,ai)+al+this.text.slice(aj);this.stateAfter=null;if(ag){var ak=al.length-(aj-ai);for(var af=0;af<ag.length;++af){var ae=ag[af];ae.clipTo(ai==null,ai||0,ah==null,aj,ak);if(ae.isDead()){ae.detach(this);ag.splice(af--,1)}}}},split:function(al,aj){var ah=[aj,null],af=this.marked;ad(al,this.text.length,this.styles,ah);var ag=new d(aj+this.text.slice(al),ah);if(af){for(var ai=0;ai<af.length;++ai){var ak=af[ai];var ae=ak.split(al,aj.length);if(ae){if(!ag.marked){ag.marked=[]}ag.marked.push(ae);ae.attach(ag)}}}return ag},append:function(af){var ak=this.text.length,ae=af.marked,ai=this.marked;this.text+=af.text;ad(0,af.text.length,af.styles,this.styles);if(ai){for(var aj=0;aj<ai.length;++aj){if(ai[aj].to==null){ai[aj].to=ak}}}if(ae&&ae.length){if(!ai){this.marked=ai=[]}outer:for(var aj=0;aj<ae.length;++aj){var al=ae[aj];if(!al.from){for(var ah=0;ah<ai.length;++ah){var ag=ai[ah];if(ag.to==ak&&ag.sameSet(al)){ag.to=al.to==null?null:al.to+ak;if(ag.isDead()){ag.detach(this);ae.splice(aj--,1)}continue outer}}}ai.push(al);al.attach(this);al.from+=ak;if(al.to!=null){al.to+=ak}}}},fixMarkEnds:function(af){var ae=this.marked,ai=af.marked;if(!ae){return}for(var ah=0;ah<ae.length;++ah){var ak=ae[ah],aj=ak.to==null;if(aj&&ai){for(var ag=0;ag<ai.length;++ag){if(ai[ag].sameSet(ak)){aj=false;break}}}if(aj){ak.to=this.text.length}}},fixMarkStarts:function(){var ae=this.marked;if(!ae){return}for(var af=0;af<ae.length;++af){if(ae[af].from==null){ae[af].from=0}}},addMark:function(ae){ae.attach(this);if(this.marked==null){this.marked=[]}this.marked.push(ae);this.marked.sort(function(ag,af){return(ag.from||0)-(af.from||0)})},highlight:function(aj,af,ak){var an=new b(this.text,ak),ao=this.styles,al=0;var ai=false,ag=ao[0],am;if(this.text==""&&aj.blankLine){aj.blankLine(af)}while(!an.eol()){var ae=aj.token(an,af);var ah=this.text.slice(an.start,an.pos);an.start=an.pos;if(al&&ao[al-1]==ae){ao[al-2]+=ah}else{if(ah){if(!ai&&(ao[al+1]!=ae||(al&&ao[al-2]!=am))){ai=true}ao[al++]=ah;ao[al++]=ae;am=ag;ag=ao[al]}}if(an.pos>5000){ao[al++]=this.text.slice(an.pos);ao[al++]=null;break}}if(ao.length!=al){ao.length=al;ai=true}if(al&&ao[al-2]!=am){ai=true}return ai||(ao.length<5&&this.text.length<10?null:false)},getTokenAt:function(aj,ah,ag){var ae=this.text,ai=new b(ae);while(ai.pos<ag&&!ai.eol()){ai.start=ai.pos;var af=aj.token(ai,ah)}return{start:ai.start,end:ai.pos,string:ai.current(),className:af||null,state:ah}},indentation:function(ae){return k(this.text,null,ae)},getHTML:function(ao,au){var ak=[],ai=true;function ay(aH,aG){if(!aH){return}if(ai&&C&&aH.charAt(0)==" "){aH="\u00a0"+aH.slice(1)}ai=false;if(aG){ak.push('<span class="',aG,'">',J(aH).replace(/\t/g,ao),"</span>")}else{ak.push(J(aH).replace(/\t/g,ao))}}var ar=this.styles,aj=this.text,ap=this.marked;var aB=aj.length;if(au!=null){aB=Math.min(au,aB)}function ag(aG){if(!aG){return null}return"cm-"+aG.replace(/ +/g," cm-")}if(!aj&&au==null){ay(" ")}else{if(!ap||!ap.length){for(var az=0,al=0;al<aB;az+=2){var at=ar[az],aC=ar[az+1],av=at.length;if(al+av>aB){at=at.slice(0,aB-al)}al+=av;ay(at,ag(aC))}}else{var ah=0,az=0,an="",aC,aF=0;var aE=ap[0].from||0,ax=[],aD=0;function aA(){var aG;while(aD<ap.length&&((aG=ap[aD]).from==ah||aG.from==null)){if(aG.style!=null){ax.push(aG)}++aD}aE=aD<ap.length?ap[aD].from:Infinity;for(var aH=0;aH<ax.length;++aH){var aI=ax[aH].to||Infinity;if(aI==ah){ax.splice(aH--,1)}else{aE=Math.min(aI,aE)}}}var aq=0;while(ah<aB){if(aE==ah){aA()}var am=Math.min(aB,aE);while(true){if(an){var af=ah+an.length;var ae=aC;for(var aw=0;aw<ax.length;++aw){ae=(ae?ae+" ":"")+ax[aw].style}ay(af>am?an.slice(0,am-ah):an,ae);if(af>=am){an=an.slice(am-ah);ah=am;break}ah=af}an=ar[az++];aC=ag(ar[az++])}}}}return ak.join("")},cleanUp:function(){this.parent=null;if(this.marked){for(var ae=0,af=this.marked.length;ae<af;++ae){this.marked[ae].detach(this)}}}};function ad(ak,al,ae,am){for(var ai=0,aj=0,af=0;aj<al;ai+=2){var ag=ae[ai],ah=aj+ag.length;if(af==0){if(ah>ak){am.push(ag.slice(ak-aj,Math.min(ag.length,al-aj)),ae[ai+1])}if(ah>=ak){af=1}}else{if(af==1){if(ah>al){am.push(ag.slice(0,al-aj),ae[ai+1])}else{am.push(ag,ae[ai+1])}}}aj=ah}}function Z(af){this.lines=af;this.parent=null;for(var ag=0,ah=af.length,ae=0;ag<ah;++ag){af[ag].parent=this;ae+=af[ag].height}this.height=ae}Z.prototype={chunkSize:function(){return this.lines.length},remove:function(ae,ak,ai){for(var ah=ae,aj=ae+ak;ah<aj;++ah){var af=this.lines[ah];this.height-=af.height;af.cleanUp();if(af.handlers){for(var ag=0;ag<af.handlers.length;++ag){ai.push(af.handlers[ag])}}}this.lines.splice(ae,ak)},collapse:function(ae){ae.splice.apply(ae,[ae.length,0].concat(this.lines))},insertHeight:function(af,ag,ae){this.height+=ae;this.lines.splice.apply(this.lines,[af,0].concat(ag));for(var ah=0,ai=ag.length;ah<ai;++ah){ag[ah].parent=this}},iterN:function(ae,ah,ag){for(var af=ae+ah;ae<af;++ae){if(ag(this.lines[ae])){return true}}}};function g(ah){this.children=ah;var ag=0,ae=0;for(var af=0,aj=ah.length;af<aj;++af){var ai=ah[af];ag+=ai.chunkSize();ae+=ai.height;ai.parent=this}this.size=ag;this.height=ae;this.parent=null}g.prototype={chunkSize:function(){return this.size},remove:function(ag,af,aj){this.size-=af;for(var ah=0;ah<this.children.length;++ah){var ae=this.children[ah],ak=ae.chunkSize();if(ag<ak){var ai=Math.min(af,ak-ag),al=ae.height;ae.remove(ag,ai,aj);this.height-=al-ae.height;if(ak==ai){this.children.splice(ah--,1);ae.parent=null}if((af-=ai)==0){break}ag=0}else{ag-=ak}}if(this.size-af<25){var am=[];this.collapse(am);this.children=[new Z(am)];this.children[0].parent=this}},collapse:function(ae){for(var af=0,ag=this.children.length;af<ag;++af){this.children[af].collapse(ae)}},insert:function(af,ag){var ae=0;for(var ah=0,ai=ag.length;ah<ai;++ah){ae+=ag[ah].height}this.insertHeight(af,ag,ae)},insertHeight:function(af,am,al){this.size+=am.length;this.height+=al;for(var ag=0,ai=this.children.length;ag<ai;++ag){var ae=this.children[ag],aj=ae.chunkSize();if(af<=aj){ae.insertHeight(af,am,al);if(ae.lines&&ae.lines.length>50){while(ae.lines.length>50){var ah=ae.lines.splice(ae.lines.length-25,25);var ak=new Z(ah);ae.height-=ak.height;this.children.splice(ag+1,0,ak);ak.parent=this}this.maybeSpill()}break}af-=aj}},maybeSpill:function(){if(this.children.length<=10){return}var ah=this;do{var af=ah.children.splice(ah.children.length-5,5);var ag=new g(af);if(!ah.parent){var ai=new g(ah.children);ai.parent=ah;ah.children=[ai,ag];ah=ai}else{ah.size-=ag.size;ah.height-=ag.height;var ae=m(ah.parent.children,ah);ah.parent.children.splice(ae+1,0,ag)}ag.parent=ah.parent}while(ah.children.length>10);ah.parent.maybeSpill()},iter:function(ag,af,ae){this.iterN(ag,af-ag,ae)},iterN:function(ae,al,ak){for(var af=0,ai=this.children.length;af<ai;++af){var aj=this.children[af],ah=aj.chunkSize();if(ae<ah){var ag=Math.min(al,ah-ae);if(aj.iterN(ae,ag,ak)){return true}if((al-=ag)==0){break}ae=0}else{ae-=ah}}}};function x(ae,ai){while(!ae.lines){for(var af=0;;++af){var ah=ae.children[af],ag=ah.chunkSize();if(ai<ag){ae=ah;break}ai-=ag}}return ae.lines[ai]}function S(ae){if(ae.parent==null){return null}var aj=ae.parent,ai=m(aj.lines,ae);for(var af=aj.parent;af;aj=af,af=af.parent){for(var ag=0,ah=af.children.length;;++ag){if(af.children[ag]==aj){break}ai+=af.children[ag].chunkSize()}}return ai}function R(ak,ai){var ag=0;outer:do{for(var ah=0,aj=ak.children.length;ah<aj;++ah){var af=ak.children[ah],ae=af.height;if(ai<ae){ak=af;continue outer}ai-=ae;ag+=af.chunkSize()}return ag}while(!ak.lines);for(var ah=0,aj=ak.lines.length;ah<aj;++ah){var am=ak.lines[ah],al=am.height;if(ai<al){break}ai-=al}return ag+ah}function f(ae,ak){var ag=0;outer:do{for(var af=0,ai=ae.children.length;af<ai;++af){var aj=ae.children[af],ah=aj.chunkSize();if(ak<ah){ae=aj;continue outer}ak-=ah;ag+=aj.height}return ag}while(!ae.lines);for(var af=0;af<ak;++af){ag+=ae.lines[af].height}return ag}function i(){this.time=0;this.done=[];this.undone=[]}i.prototype={addChange:function(ae,ak,af){this.undone.length=0;var ag=+new Date,am=this.done[this.done.length-1],an=am&&am[am.length-1];var ai=ag-this.time;if(ai>400||!an){this.done.push([{start:ae,added:ak,old:af}])}else{if(an.start>ae+ak||an.start+an.added<ae-an.added+an.old.length){am.push({start:ae,added:ak,old:af})}else{var al=0;if(ae<an.start){for(var ah=an.start-ae-1;ah>=0;--ah){an.old.unshift(af[ah])}an.added+=an.start-ae;an.start=ae}else{if(an.start<ae){al=ae-an.start;ak+=al}}for(var ah=an.added-al,aj=af.length;ah<aj;++ah){an.old.push(af[ah])}if(an.added<ak){an.added=ak}}}this.time=ag}};function D(){s(this)}function I(ae){if(!ae.stop){ae.stop=D}return ae}function N(ae){if(ae.preventDefault){ae.preventDefault()}else{ae.returnValue=false}}function y(ae){if(ae.stopPropagation){ae.stopPropagation()}else{ae.cancelBubble=true}}function s(ae){N(ae);y(ae)}q.e_stop=s;q.e_preventDefault=N;q.e_stopPropagation=y;function h(ae){return ae.target||ae.srcElement}function t(ae){if(ae.which){return ae.which}else{if(ae.button&1){return 1}else{if(ae.button&2){return 3}else{if(ae.button&4){return 2}}}}}function u(af,ag){var ae=af.override&&af.override.hasOwnProperty(ag);return ae?af.override[ag]:af[ag]}function n(ah,ag,af,ae){if(typeof ah.addEventListener=="function"){ah.addEventListener(ag,af,false);if(ae){return function(){ah.removeEventListener(ag,af,false)}}}else{var ai=function(aj){af(aj||window.event)};ah.attachEvent("on"+ag,ai);if(ae){return function(){ah.detachEvent("on"+ag,ai)}}}}q.connect=n;function v(){this.id=null}v.prototype={set:function(ae,af){clearTimeout(this.id);this.id=setTimeout(af,ae)}};var z=function(){if(/MSIE [1-8]\b/.test(navigator.userAgent)){return false}var ae=document.createElement("div");return"draggable" in ae}();var H=/gecko\/\d{7}/i.test(navigator.userAgent);var C=/MSIE \d/.test(navigator.userAgent);var e=/WebKit\//.test(navigator.userAgent);var c="\n";(function(){var ae=document.createElement("textarea");ae.value="foo\nbar";if(ae.value.indexOf("\r")>-1){c="\r\n"}}());function k(af,ae,ah){if(ae==null){ae=af.search(/[^\s\u00a0]/);if(ae==-1){ae=af.length}}for(var ag=0,ai=0;ag<ae;++ag){if(af.charAt(ag)=="\t"){ai+=ah-(ai%ah)}else{++ai}}return ai}function p(ae){if(ae.currentStyle){return ae.currentStyle}return window.getComputedStyle(ae,null)}function ac(af,an){var ah=af.ownerDocument.body;var am=0,al=0,aj=false;for(var ae=af;ae;ae=ae.offsetParent){var ak=ae.offsetLeft,ag=ae.offsetTop;if(ae==ah){am+=Math.abs(ak);al+=Math.abs(ag)}else{am+=ak,al+=ag}if(an&&p(ae).position=="fixed"){aj=true}}var ai=an&&!aj?null:ah;for(var ae=af.parentNode;ae!=ai;ae=ae.parentNode){if(ae.scrollLeft!=null){am-=ae.scrollLeft;al-=ae.scrollTop}}return{left:am,top:al}}if(document.documentElement.getBoundingClientRect!=null){ac=function(ah,ae){try{var ag=ah.getBoundingClientRect();ag={top:ag.top,left:ag.left}}catch(ai){ag={top:0,left:0}}if(!ae){if(window.pageYOffset==null){var af=document.documentElement||document.body.parentNode;if(af.scrollTop==null){af=document.body}ag.top+=af.scrollTop;ag.left+=af.scrollLeft}else{ag.top+=window.pageYOffset;ag.left+=window.pageXOffset}}return ag}}function B(ae){return ae.textContent||ae.innerText||ae.nodeValue||""}function a(ae){if(o){ae.selectionStart=0;ae.selectionEnd=ae.value.length}else{ae.select()}}function W(af,ae){return af.line==ae.line&&af.ch==ae.ch}function T(af,ae){return af.line<ae.line||(af.line==ae.line&&af.ch<ae.ch)}function U(ae){return{line:ae.line,ch:ae.ch}}var aa=document.createElement("pre");function J(ae){aa.textContent=ae;return aa.innerHTML}if(J("a")=="\na"){J=function(ae){aa.textContent=ae;return aa.innerHTML.slice(1)}}else{if(J("\t")!="\t"){J=function(ae){aa.innerHTML="";aa.appendChild(document.createTextNode(ae));return aa.innerHTML}}}q.htmlEscape=J;function Q(ah,ag){if(!ag){return 0}if(!ah){return ag.length}for(var af=ah.length,ae=ag.length;af>=0&&ae>=0;--af,--ae){if(ah.charAt(af)!=ag.charAt(ae)){break}}return ae+1}function m(ah,ae){if(ah.indexOf){return ah.indexOf(ae)}for(var af=0,ag=ah.length;af<ag;++af){if(ah[af]==ae){return af}}return -1}function Y(ae){return/\w/.test(ae)||ae.toUpperCase()!=ae.toLowerCase()}var w="\n\nb".split(/\n/).length!=3?function(ag){var ah=0,af,ae=[];while((af=ag.indexOf("\n",ah))>-1){ae.push(ag.slice(ah,ag.charAt(af-1)=="\r"?af-1:af));ah=af+1}ae.push(ag.slice(ah));return ae}:function(ae){return ae.split(/\r?\n/)};q.splitLines=w;var X=window.getSelection?function(af){try{return af.selectionStart!=af.selectionEnd}catch(ae){return false}}:function(ag){try{var ae=ag.ownerDocument.selection.createRange()}catch(af){}if(!ae||ae.parentElement()!=ag){return false}return ae.compareEndPoints("StartToEnd",ae)!=0};q.defineMode("null",function(){return{token:function(ae){ae.skipToEnd()}}});q.defineMIME("text/plain","null");var L={3:"Enter",8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"CapsLock",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"PrintScrn",45:"Insert",46:"Delete",59:";",91:"Mod",92:"Mod",93:"Mod",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",63276:"PageUp",63277:"PageDown",63275:"End",63273:"Home",63234:"Left",63232:"Up",63235:"Right",63233:"Down",63302:"Insert",63272:"Delete"};q.keyNames=L;(function(){for(var ae=0;ae<10;ae++){L[ae+48]=String(ae)}for(var ae=65;ae<=90;ae++){L[ae]=String.fromCharCode(ae)}for(var ae=1;ae<=12;ae++){L[ae+111]=L[ae+63235]="F"+ae}})();return q})();(function(){function a(b,e){var d=b.getWrapperElement();var c=d.insertBefore(document.createElement("div"),d.firstChild);c.className="CodeMirror-dialog";c.innerHTML="<div>"+e+"</div>";return c}CodeMirror.defineExtension("openDialog",function(d,h){var c=a(this,d);var b=false,f=this;function g(){if(b){return}b=true;c.parentNode.removeChild(c)}var e=c.getElementsByTagName("input")[0];if(e){CodeMirror.connect(e,"keydown",function(i){if(i.keyCode==13||i.keyCode==27){CodeMirror.e_stop(i);g();f.focus();if(i.keyCode==13){h(e.value)}}});e.focus();CodeMirror.connect(e,"blur",g)}return g});CodeMirror.defineExtension("openConfirm",function(l,f){var g=a(this,l);var h=g.getElementsByTagName("button");var e=false,j=this,c=1;function m(){if(e){return}e=true;g.parentNode.removeChild(g);j.focus()}h[0].focus();for(var d=0;d<h.length;++d){var k=h[d];(function(b){CodeMirror.connect(k,"click",function(i){CodeMirror.e_preventDefault(i);m();if(b){b(j)}})})(f[d]);CodeMirror.connect(k,"blur",function(){--c;setTimeout(function(){if(c<=0){m()}},200)});CodeMirror.connect(k,"focus",function(){++c})}})})();(function(){function a(b,e,g,d){this.atOccurrence=false;this.cm=b;if(d==null){d=typeof e=="string"&&e==e.toLowerCase()}g=g?b.clipPos(g):{line:0,ch:0};this.pos={from:g,to:g};if(typeof e!="string"){this.matches=function(j,n){if(j){var h=b.getLine(n.line).slice(0,n.ch),i=h.match(e),m=0;while(i){var k=h.indexOf(i[0]);m+=k;h=h.slice(k+1);var l=h.match(e);if(l){i=l}else{break}m++}}else{var h=b.getLine(n.line).slice(n.ch),i=h.match(e),m=i&&n.ch+h.indexOf(i[0])}if(i){return{from:{line:n.line,ch:m},to:{line:n.line,ch:m+i[0].length},match:i}}}}else{if(d){e=e.toLowerCase()}var c=d?function(h){return h.toLowerCase()}:function(h){return h};var f=e.split("\n");if(f.length==1){this.matches=function(k,l){var i=c(b.getLine(l.line)),h=e.length,j;if(k?(l.ch>=h&&(j=i.lastIndexOf(e,l.ch-h))!=-1):(j=i.indexOf(e,l.ch))!=-1){return{from:{line:l.line,ch:j},to:{line:l.line,ch:j+h}}}}}else{this.matches=function(m,o){var n=o.line,p=(m?f.length-1:0),k=f[p],q=c(b.getLine(n));var l=(m?q.indexOf(k)+k.length:q.lastIndexOf(k));if(m?l>=o.ch||l!=k.length:l<=o.ch||l!=q.length-k.length){return}for(;;){if(m?!n:n==b.lineCount()-1){return}q=c(b.getLine(n+=m?-1:1));k=f[m?--p:++p];if(p>0&&p<f.length-1){if(q!=k){return}else{continue}}var j=(m?q.lastIndexOf(k):q.indexOf(k)+k.length);if(m?j!=q.length-k.length:j!=k.length){return}var h={line:o.line,ch:l},i={line:n,ch:j};return{from:m?i:h,to:m?h:i}}}}}}a.prototype={findNext:function(){return this.find(false)},findPrevious:function(){return this.find(true)},find:function(c){var b=this,f=this.cm.clipPos(c?this.pos.from:this.pos.to);function d(g){var h={line:g,ch:0};b.pos={from:h,to:h};b.atOccurrence=false;return false}for(;;){if(this.pos=this.matches(c,f)){this.atOccurrence=true;return this.pos.match||true}if(c){if(!f.line){return d(0)}f={line:f.line-1,ch:this.cm.getLine(f.line-1).length}}else{var e=this.cm.lineCount();if(f.line==e-1){return d(e)}f={line:f.line+1,ch:0}}}},from:function(){if(this.atOccurrence){return this.pos.from}},to:function(){if(this.atOccurrence){return this.pos.to}},replace:function(c){var b=this;if(this.atOccurrence){b.pos.to=this.cm.replaceRange(c,b.pos.from,b.pos.to)}}};CodeMirror.defineExtension("getSearchCursor",function(c,d,b){return new a(this,c,d,b)})})();(function(){function k(){this.posFrom=this.posTo=this.query=null;this.marked=[]}function f(n){return n._searchState||(n._searchState=new k())}function j(n,q,o,p){if(n.openDialog){n.openDialog(q,p)}else{p(prompt(o,""))}}function m(o,q,p,n){if(o.openConfirm){o.openConfirm(q,n)}else{if(confirm(p)){n[0]()}}}function c(o){var n=o.match(/^\/(.*)\/$/);return n?new RegExp(n[1]):o}var b='Search: <input type="text" style="width: 10em"> <span style="color: #888">(Use /re/ syntax for regexp search)</span>';function i(n,o){var p=f(n);if(p.query){return g(n,o)}j(n,b,"Search for:",function(q){n.operation(function(){if(!q||p.query){return}p.query=c(q);if(n.lineCount()<2000){for(var r=n.getSearchCursor(q);r.findNext();){p.marked.push(n.markText(r.from(),r.to(),"CodeMirror-searching"))}}p.posFrom=p.posTo=n.getCursor();g(n,o)})})}function g(n,o){n.operation(function(){var p=f(n);var q=n.getSearchCursor(p.query,o?p.posFrom:p.posTo);if(!q.find(o)){q=n.getSearchCursor(p.query,o?{line:n.lineCount()-1}:{line:0,ch:0});if(!q.find(o)){return}}n.setSelection(q.from(),q.to());p.posFrom=q.from();p.posTo=q.to()})}function l(n){n.operation(function(){var p=f(n);if(!p.query){return}p.query=null;for(var o=0;o<p.marked.length;++o){p.marked[o].clear()}p.marked.length=0})}var e='Replace: <input type="text" style="width: 10em"> <span style="color: #888">(Use /re/ syntax for regexp search)</span>';var h='With: <input type="text" style="width: 10em">';var d="Replace? <button>Yes</button> <button>No</button> <button>Stop</button>";function a(n,o){j(n,e,"Replace:",function(p){if(!p){return}p=c(p);j(n,h,"Replace with:",function(t){if(o){n.operation(function(){for(var v=n.getSearchCursor(p);v.findNext();){if(typeof p!="string"){var u=n.getRange(v.from(),v.to()).match(p);v.replace(t.replace(/\$(\d)/,function(x,y){return u[y]}))}else{v.replace(t)}}})}else{l(n);var s=n.getSearchCursor(p,n.getCursor());function r(){var v=s.from(),u;if(!(u=s.findNext())){s=n.getSearchCursor(p);if(!(u=s.findNext())||(s.from().line==v.line&&s.from().ch==v.ch)){return}}n.setSelection(s.from(),s.to());m(n,d,"Replace?",[function(){q(u)},r])}function q(u){s.replace(typeof p=="string"?t:t.replace(/\$(\d)/,function(v,x){return u[x]}));r()}r()}})})}CodeMirror.commands.find=function(n){l(n);i(n)};CodeMirror.commands.findNext=i;CodeMirror.commands.findPrev=function(n){i(n,true)};CodeMirror.commands.clearSearch=l;CodeMirror.commands.replace=a;CodeMirror.commands.replaceAll=function(n){a(n,true)}})();var Drupal=Drupal||{settings:{},behaviors:{},themes:{},locale:{}};Drupal.jsEnabled=document.getElementsByTagName&&document.createElement&&document.createTextNode&&document.documentElement&&document.getElementById;Drupal.attachBehaviors=function(a){a=a||document;if(Drupal.jsEnabled){jQuery.each(Drupal.behaviors,function(){this(a)})}};Drupal.checkPlain=function(d){d=String(d);var a={"&":"&amp;",'"':"&quot;","<":"&lt;",">":"&gt;"};for(var c in a){var b=new RegExp(c,"g");d=d.replace(b,a[c])}return d};Drupal.t=function(c,a){if(Drupal.locale.strings&&Drupal.locale.strings[c]){c=Drupal.locale.strings[c]}if(a){for(var b in a){switch(b.charAt(0)){case"@":a[b]=Drupal.checkPlain(a[b]);break;case"!":break;case"%":default:a[b]=Drupal.theme("placeholder",a[b]);break}c=c.replace(b,a[b])}}return c};Drupal.formatPlural=function(e,d,c,b){var b=b||{};b["@count"]=e;var a=Drupal.locale.pluralFormula?Drupal.locale.pluralFormula(b["@count"]):((b["@count"]==1)?0:1);if(a==0){return Drupal.t(d,b)}else{if(a==1){return Drupal.t(c,b)}else{b["@count["+a+"]"]=b["@count"];delete b["@count"];return Drupal.t(c.replace("@count","@count["+a+"]"),b)}}};Drupal.theme=function(c){for(var b=1,a=[];b<arguments.length;b++){a.push(arguments[b])}return(Drupal.theme[c]||Drupal.theme.prototype[c]).apply(this,a)};Drupal.parseJson=function(data){if((data.substring(0,1)!="{")&&(data.substring(0,1)!="[")){return{status:0,data:data.length?data:Drupal.t("Unspecified error")}}return eval("("+data+");")};Drupal.freezeHeight=function(){Drupal.unfreezeHeight();var a=document.createElement("div");$(a).css({position:"absolute",top:"0px",left:"0px",width:"1px",height:$("body").css("height")}).attr("id","freeze-height");$("body").append(a)};Drupal.unfreezeHeight=function(){$("#freeze-height").remove()};Drupal.encodeURIComponent=function(b,a){a=a||location.href;b=encodeURIComponent(b).replace(/%2F/g,"/");return(a.indexOf("?q=")!=-1)?b:b.replace(/%26/g,"%2526").replace(/%23/g,"%2523").replace(/\/\//g,"/%252F")};Drupal.getSelection=function(d){if(typeof(d.selectionStart)!="number"&&document.selection){var c=document.selection.createRange();var a=c.duplicate();a.moveToElementText(d);a.setEndPoint("EndToEnd",c);var e=a.text.length-c.text.length;var b=e+c.text.length;return{start:e,end:b}}return{start:d.selectionStart,end:d.selectionEnd}};Drupal.ahahError=function(a,c){if(a.status==200){if(jQuery.trim($(a.responseText).text())){var b=Drupal.t("An error occurred. \n@uri\n@text",{"@uri":c,"@text":a.responseText})}else{var b=Drupal.t("An error occurred. \n@uri\n(no information available).",{"@uri":c,"@text":a.responseText})}}else{var b=Drupal.t("An HTTP error @status occurred. \n@uri",{"@uri":c,"@status":a.status})}return b};if(Drupal.jsEnabled){$(document.documentElement).addClass("js");document.cookie="has_js=1; path=/";$(document).ready(function(){Drupal.attachBehaviors(this)})}Drupal.theme.prototype={placeholder:function(a){return"<em>"+Drupal.checkPlain(a)+"</em>"}};function IdPath(a){this.Id=a}IdPath.prototype.Id=null;IdPath.CreateRoot=function(b,a,c){return new IdPath(a+"_"+(c?"w":"ro")+"_p"+b)};IdPath.prototype.sanitize=function(){this.Id=this.Id.toLowerCase();return this.Id};IdPath.prototype.getTreeId=function(){return this.Id.substring(0,this.Id.indexOf("_",0))};IdPath.prototype.isWritable=function(){return this.Id.substring(this.Id.indexOf("_",0)+1,this.Id.indexOf("_p",0))=="w"};IdPath.prototype.getProjectId=function(){var b=this.Id.indexOf("_p",0);var a=this.Id.indexOf("-",b);if(a<=b){a=this.Id.length}if(b>0&&a>b+2){return parseInt(this.Id.substring(b+2,a))}else{return -1}};IdPath.prototype.getParentId=function(){var a=this.Id.lastIndexOf("-");return this.Id.substr(0,a)};IdPath.prototype.getItemType=function(){var a=this.Id.lastIndexOf("-");if(a==-1){if(this.getProjectId()>0){return"o"}else{return"x"}}return this.Id.substr(a+1,1)};IdPath.prototype.isRoot=function(){return this.getItemType()=="o"};IdPath.prototype.isFile=function(){return this.getItemType()=="f"};IdPath.prototype.isDirectory=function(){return this.getItemType()=="d"};IdPath.prototype.isReference=function(){return this.getItemType()=="r"};IdPath.prototype.isContainer=function(){return this.getItemType()=="n"};IdPath.prototype.isReferenceContainer=function(){return this.isContainer()&&(this.getRealName().toLowerCase()=="references")};IdPath.prototype.isContentContainer=function(){return this.isContainer()&&(this.getRealName().toLowerCase()=="content")};IdPath.prototype.isLibraryContainer=function(){return this.isContainer()&&(this.getRealName().toLowerCase()=="libraries")};IdPath.EncodeNameForFileSystem=function(b){var c,e,a,d;e=b.match(/[^a-zA-Z0-9]/g);if(e==null){return b}e=e.filter(function(h,g,f){return h!="_"});b=b.replace(/_/g,"_5f");for(c=0;c<e.length;c++){a=e[c].charCodeAt(0);d=a.toString(16);if(a<=16){d="0"+d}b=b.replace(e[c],"_"+d)}return b};IdPath.EncodeName=function(a){return IdPath.EncodeNameForFileSystem(a).toLowerCase()};IdPath.DecodeRealName=function(a){var d=-1,b,c;while((d=a.indexOf("_",d+1))>=0){b=a.substr(d+1,2);if(b!="5f"){c=String.fromCharCode(parseInt(b,16));a=a.replace("_"+b,c)}}a=a.replace(/_5f/g,"_");return a};IdPath.prototype.getRealName=function(){var b=this.Id.lastIndexOf("-");var a=this.Id.substring(b+2);return IdPath.DecodeRealName(a)};IdPath.prototype.alterPrefix=function(a){this.Id=a+this.Id.substr(this.Id.indexOf("_"));return this.Id};IdPath.prototype.setRealName=function(a){var c=this.Id.lastIndexOf("-");var b=this.Id.substr(0,c+2);this.Id=b+IdPath.EncodeNameForFileSystem(a);return this};IdPath.prototype.canHoldFiles=function(){var a;return this.isDirectory()||this.isRoot()||(this.isContainer()&&((a=this.getRealName().toLowerCase())=="content"||a=="libraries"))};IdPath.ValidatePathIsDirectory=function(b){if(typeof(b)!=="string"){return false}else{var a=new IdPath(b);return a.canHoldFiles()}};IdPath.ValidatePathIsFile=function(b){if(typeof(b)!=="string"){return false}else{var a=new IdPath(b);return a.isFile()}};IdPath.ValidateFileName=function(b){if(b.indexOf("..")===0){return false}var a=/^[0-9a-zA-Z|\x20|\x21|\x23|\x24|\x25|\x26|\x27|\x28|\x29|\x2B|\x2C|\x2D|\x2E|\x3D|\x40|\x5B|\x5D|\x5e|\x5f|\x7b|\x7d|\x7E]{1,50}$/;return a.test(b)};IdPath.MoveToPath=function(b,a){return a+b.substr(b.lastIndexOf("-"))};IdPath.prototype.moveThisToPath=function(a){return IdPath.MoveToPath(this.Id,a)};IdPath.GetFileSyntax=function(b){var a=IdPath.GetFileExtension(b);switch(a){case"cs":return{mode:"text/x-csharp",files:["clike"]};case"vb":return{mode:"text/x-vb",files:["vb"]};case"java":return{mode:"text/x-java",files:["clike"]};case"js":return{mode:"text/javascript",files:["javascript"]};case"py":return{mode:"text/x-python",files:["python"]};case"aspx":return{mode:"application/x-aspx",files:["xml","javascript","css","htmlmixed","htmlembedded"]};case"php":return{mode:"application/x-httpd-php",files:["xml","javascript","css","clike","php"]};case"rb":return{mode:"text/x-ruby",files:["ruby"]};case"c":return{mode:"text/x-csrc",files:["clike"]};case"cpp":case"h":return{mode:"text/x-c++src",files:["clike"]};case"sql":return{mode:"text/x-mysql",files:["mysql"]};case"htm":case"html":case"xhtml":return{mode:"text/html",files:["xml","javascript","css","htmlmixed"]};case"css":return{mode:"text/css",files:["css"]};case"spritefont":case"xml":return{mode:"text/xml",files:["xmlpure"]};case"gif":case"png":case"bmp":case"jpeg":case"jpg":case"tga":return{mode:"image",files:[]};default:return{mode:"text/plain",files:[]}}};IdPath.prototype.getFileSyntax=function(){return IdPath.GetFileSyntax(this.Id)};IdPath.EncodeRealFileName=function(a){return"-f"+IdPath.EncodeName(a)};IdPath.EncodeRealDirectoryName=function(a){return"-d"+IdPath.EncodeName(a)};IdPath.EncodeRealReferenceName=function(a){return"-r"+a};IdPath.GetFileExtension=function(b){var a=b.lastIndexOf("_2e");if(a>=0){return b.substr(a+3)}else{return""}};IdPath.prototype.getFileExtension=function(){return IdPath.GetFileExtension(this.Id)};IdPath.prototype.getIconClass=function(){if(this.isFile()){return IdPath.GetIconClass(this.getFileExtension())}else{if(this.isReference()){return"icon-ref"}else{return"dir"}}};IdPath.GetIconClass=function(a){switch(a){case"rb":return("icon-ruby");case"php":return("icon-php");case"c":return("icon-c");case"cpp":return("icon-cpp");case"cs":return("icon-cs");case"png":case"bmp":case"jpeg":case"jpg":case"tga":case"gif":return("icon-gif");case"h":return("icon-h");case"java":return("icon-java");case"js":return("icon-js");case"py":return("icon-py");case"vb":return("icon-vb");default:return("icon-txt")}};var project={expandFileObject:function(d,a){var e,b;if(typeof(d)==="object"){e=new IdPath(a.Id+d.i);var f=[];for(var c=0;c<d.c.length;c++){f.push(this.expandFileObject(d.c[c],e))}b={data:{title:e.getRealName(),icon:e.isContainer()?"jstree-icon-folder-blue":"dir"},attr:{id:e.sanitize()},children:f}}else{e=new IdPath(a.Id+d);b={data:{title:e.isReference()?compilr.corerefs[this.platform][e.getRealName()]:e.getRealName(),icon:e.getIconClass()},attr:{id:e.sanitize()}}}return b},init:function(){this.isReadOnly=!(!this.isReadOnly);var b=IdPath.CreateRoot(this.id,"ft",!this.isReadOnly),a,c=[];for(a=0;a<this.files.length;a++){c.push(this.expandFileObject(this.files[a],b))}this.files={data:{title:this.name,icon:this.isReadOnly?"jstree-icon-folder-gray":(this.state==1?"jstree-icon-public":(this.state==2?"jstree-icon-archive":"dir"))},attr:{id:b.Id},children:c}},newFile:function(c,b,a){if(!IdPath.ValidateFileName(c)){return false}compilr.apiCall({action:"newFile",name:c,parent:b},a);return true},newFolder:function(a,c,b){if(!IdPath.ValidateFileName(a)){return false}compilr.apiCall({action:"newFolder",name:a,parent:c},b);return true},deleteFile:function(a,b){compilr.apiCall({action:"delete",fid:a},b);return true},saveFile:function(a,b,c){compilr.apiCall({action:"saveFile",fid:a,dat:b},c,true);return true},renameFile:function(b,a,c){compilr.apiCall({action:"rename",fid:b,dat:a},c);return true},moveFile:function(b,d,e){var c=new IdPath(b);var a=new IdPath(d);if(!c.isFile()&&!c.isDirectory()){return false}if(!a.canHoldFiles()){return false}compilr.apiCall({action:"move",fid:b,did:d},e);return true},exportFiles:function(a){compilr.apiCall({action:"export",pid:this.id},a);return true},saveReferences:function(b,a){compilr.apiCall({action:"setrefs",pid:this.id,ref:b},a);return true},getRootNodeId:function(){return this.files.attr.id},getRootNode:function(){return $("#"+this.getRootNodeId())},getReferenceNode:function(){return $("#"+this.getRootNodeId()+"-nreferences")},getContentNode:function(){return $("#"+this.getRootNodeId()+"-ncontent")},build:function(){},hasExistingBuild:function(){return this.buildExists},isDownloadable:function(){return this.buildExists},download:function(){window.location=("/ide/download.php?projectId="+this.id)}};var compilr=compilr||{init:function(){var b=this,c=arguments;$.extend(true,b,c[0]);for(var a in this.projects){$.extend(true,this.projects[a],project);this.projects[a].init();if(!this.currentProject||this.projects[a].isReadOnly){this.currentProject=this.projects[a]}}},getProjectsFiles:function(){var a=[];for(var b in this.projects){if(this.projects[b].isReadOnly){a.push(this.projects[b].files)}}for(var b in this.projects){if(!this.projects[b].isReadOnly){a.push(this.projects[b].files)}}return a},addProject:function(a,b){$.extend(true,a,project);a.init();this.projects[a.id]=a;$(window).trigger("compilr.addproject",[a,b])},apiCall:function(c,d,b,a){$.ajax({type:b?"POST":"GET",cache:false,data:c,dataType:"json",url:a?a:"/IDE/handler.php"}).success(function(f,g,e){d(f)}).error(function(e,g,f){d({s:false,m:"Server Error: "+g})})},getProjectWizard:function(){return $("#projectwizard")},updateProjectWizard:function(c){var d=compilr.getProjectWizard(),b=d.find("#scope-public"),a=d.find("#scope-private");b.siblings("small").html(c._public+" Remaining").attr("class",c._public?"info":"warning");a.siblings("small").html(c._private+" Remaining").attr("class",c._private?"info":"warning");if(c._public){b.removeAttr("disabled").closest(".form-field").find("label.error").remove()}else{b.attr("disabled","disabled")}if(c._private){a.removeAttr("disabled").closest(".form-field").find("label.error").remove()}else{a.attr("disabled","disabled")}},openDialogProjectWizard:function(){var c=$("#projectwizard");if(c.data("dialog")){c.dialog("open").dialog("restore");c.dialog("widget").effect("shake",{},50);return}var b=function(d,e){if(d.which){c.jWizard("destroy").dialog("destroy")}else{if(c.dialog("isOpen")){c.dialog("close")}}c.find(":radio, :checkbox").removeAttr("checked").removeAttr("selected");c.find(":text").not('[type="hidden"]').val("");c.find("select").val("").trigger("change")},a=function(d,e){c.dialog("disable");$.ajax({beforeSend:function(){$(window).trigger("loading")},cache:false,data:c.serialize()+"&action=createProject",dataType:"json",type:"POST",url:"/ide/handler.php"}).success(function(f){if(f.s){c.dialog("close").jWizard("destroy").dialog("destroy");for(var g in f.corerefs){compilr.corerefs[g]=f.corerefs[g]}compilr.addProject(f.project,true);compilr.updateProjectWizard(f)}else{if(f.e){c.dialog("enable");c.validate().showErrors(f.e);c.jWizard("changeStep",c.find(":input.error").first().closest("fieldset"))}else{if(f.m){c.dialog("close").jWizard("destroy").dialog("destroy");AlertDialog("Notice",f.m)}}}}).error(function(f,h,g){c.dialog("close").dialog("destroy");AlertDialog("Server Error","<p>An error occured while attempting to create your project. If the problem persists, please contact our technical support team.</p>")}).complete(function(){$(window).trigger("loadingcomplete")})};c.dialog({close:b,modal:false,resizable:false,title:"Project Wizard",width:650}).jWizard({debug:true,cancel:b,finish:a,effects:{enable:true,step:{enable:true},menu:{enable:false}},menuEnable:true,titleHide:true}).bind("jwizardchangestep",function(e,f){if(f.type!=="manual"&&f.type!="previous"){var g=c.find(".jw-step:eq("+f.currentStepIndex+")"),d=g.find(":input");if(d.length>0&&!d.valid()){g.find("label.error:visible").effect("highlight");return false}}})},openDialogLoginSignup:function(){var a=$("#dialog-login-signup");if(a.data("dialog")){a.dialog("open");a.dialog("widget").effect("shake",{},50);return}this._initDialogFormLogin(a);this._initDialogFormSignup(a);a.dialog({captionButtons:{minimize:{visible:false}},close:function(){$("#dialog-login").validate().resetForm();$("#dialog-signup").validate().resetForm();$(this).dialog("destroy")},modal:true,width:650});$("#dialog-login-signup").find("fieldset").matchHeight()},openDialogLogin:function(){var a=$("#dialog-login");if(a.data("dialog")){a.dialog("open");a.dialog("widget").effect("shake",{},50);return}this._initDialogFormLogin(a);a.dialog({captionButtons:{minimize:{visible:false}},close:function(){$("#dialog-login").validate().resetForm();$(this).dialog("destroy");$("#dialog-login").appendTo("#dialog-login-login ul.two-up > li:last").removeAttr("style")},modal:true,width:368})},openDialogSignup:function(){var a=$("#dialog-signup");if(a.data("dialog")){a.dialog("open");a.dialog("widget").effect("shake",{},50);return}this._initDialogFormSignup(a);a.dialog({captionButtons:{minimize:{visible:false}},close:function(){$("#dialog-signup").validate().resetForm();$(this).dialog("destroy");$("#dialog-signup").appendTo("#dialog-login-signup ul.two-up > li:last").removeAttr("style")},modal:true,width:368})},user:{id:0,name:"Guest",isGuest:function(){return this.id==0}},track:function(a){pageTracker._trackPageview(a)},version:function(){return""},_initDialogFormLogin:function(a){if(!$("#dialog-login").data("validate")){$("#dialog-login").validate({rules:{username:{required:true},password:{required:true}},errorPlacement:function(b,c){if(c.attr("name")=="password"&&c.not(":password")){c.closest(":password").after(b)}else{c.after(b)}}});if(!$("#login-password").data("showpassword")){$("#login-password").showpassword({parent:"#dialog-login .show-password-group"});$("#dialog-login button:submit").click(function(){return compilr._handleDialogFormSubmit(a,a.is("form")?a:a.find("#dialog-login"))})}}},_initDialogFormSignup:function(a){if(!$("#dialog-signup").data("validate")){$("#dialog-signup").validate({rules:{email:{required:true,email:true,maxlength:64},username:{required:true,maxlength:30,minlength:6,pattern:new RegExp(/^[A-Za-z0-9\._]+$/),pattern2:new RegExp(/^[A-Za-z0-9]+/),pattern3:new RegExp(/[A-Za-z0-9]+$/),pattern4:new RegExp(/^(?!.*\.{2}|.*_{2})/)},password:{required:true,minlength:6,maxlength:64,notEqualTo:"#signup-username"},vpassword:{required:true,equalTo:"#signup-password"}},messages:{username:{minlength:"Please use between 6 and 30 characters",pattern:"Please use only letters (a-z), numbers, periods and underscores.",pattern2:"The first character of your username should be a letter (a-z) or number.",pattern3:"The last character of your username should be a letter (a-z) or number.",pattern4:"A fan of punctuation! Alas, usernames can't have consecutive periods or underscores."},password:{notEqualTo:"Password cannot be the same as your user name.",pattern:"Password must contain at least one number, one uppercase and one lowercase letter."},vpassword:{equalTo:"Your passwords don't match. Try again."}}});$("#dialog-signup button:submit").off("click.signup").on("click.signup",function(){return compilr._handleDialogFormSubmit(a,a.is("form")?a:a.find("#dialog-signup"))})}},_handleDialogFormSubmit:function(b,a){if(a.valid()){b.dialog("disable");b.find("div.error").fadeOut().remove();$.ajax({cache:false,beforeSend:function(){$(window).trigger("loading")},type:"POST",url:a.attr("action"),data:a.serialize(),dataType:"json"}).success(function(d){$(window).trigger("loadingcomplete");if(d.s){b.dialog("close").dialog("destroy");d.redirect?(location=d.redirect):location.reload(true)}else{if(d.e){b.dialog("enable");a.validate().showErrors(d.e)}}if(d.m){var c=$('<div class="error" />').html(d.m);b.prepend(c);if(!d.s){b.dialog("enable")}}}).error(function(){$(window).trigger("loadingcomplete");AlertDialog("Server Error","An error occured while communicating with the server. Please try again later, if the problem persists please contact our technical support team.");b.dialog("enable")})}return false},utils:{slugify:function(b){var a=b.toLowerCase().replace(/(c\+\+)/g,"c-plus-plus").replace(/(c#)/g,"c-sharp").replace(/^\s+|\s+$/g,"").replace(/[_|\s]+/g,"-").replace(/[^a-z0-9-]+/g,"").replace(/[-]+/g,"-").replace(/^-+|-+$/g,"");return a}}};settings={onPlatformChange:function(a){var b,f=false,e=a.options[a.selectedIndex].value,c=$(a).closest("form"),d=c.find('select[name="xnaprofile"]').closest("tr");b=c.find('select[name="outputtype"]');if(e==8){b.children().each(function(g){if(this.value=="exe"){if(this.selected){b.children()[g==0?1:0].selected=true}$(this).remove()}});d.show()}else{b.children().each(function(){if(this.value=="exe"){f=this}});if(!f){b.append('<option value="exe">Console Application</option>')}d.hide()}},submitForm:function(e,a){var d=$(e).serialize(),g,c,f=-1,b="platform=";g=d.indexOf(b);if(g>-1){g+=b.length;c=d.indexOf("&",g);if(c>-1){f=parseInt(d.substring(g,c))}else{f=parseInt(d.substring(g))}}if(f>-1&&f!=compilr.projects[a].platform){ConfirmDialog("Are you sure?","Are you sure you want to continue?<br />Changing the platform will clear all your selected references.",function(h){if(h){settings.doSubmitForm(e,a,f)}})}else{settings.doSubmitForm(e,a,f)}return false},doSubmitForm:function(b,a,c){return settings.submitObject($(b).serialize()+"&pid="+a,function(d){if(d.s){var e=compilr.projects[a];if(c>-1&&c!=e.platform){e.platform=c;e.getReferenceNode().children("ul").children("li").each(function(){ProjectTree.jstree("delete_node","#"+this.id)});if(c==8&&e.getContentNode().length==0){ProjectTree.jstree("create_node",e.getReferenceNode(),"after",{data:{title:"content",icon:"jstree-icon-folder-blue"},attr:{id:e.getRootNodeId()+"-ncontent"}})}}}else{AlertDialog("Error",d.m)}})},submitObject:function(a,b){$(window).trigger("loading");compilr.apiCall(a,function(c){$(window).trigger("loadingcomplete");b(c)},true,"/IDE/settingshandler.php");return false},switchVisibility:function(a){var d=$("#projectTypeSwitch"+a),c=d.children("span"),e=d.children("a").children("span"),b=$.trim(c.text().toLowerCase());settings.submitObject({pid:a,v:b=="public"?0:1},function(f){if(f.s){var g=compilr.projects[a].getRootNode();if(b=="public"){c.text("Private");e.text("public");tabs.updateTabAndTreeIcon(g,"dir");$("#ratingDiv"+a).parent().hide()}else{c.text("Public");e.text("private");tabs.updateTabAndTreeIcon(g,"jstree-icon-public");$("#ratingDiv"+a).parent().show()}}else{AlertDialog("Error",f.m)}})},deleteProject:function(a){var c=compilr.projects[a].getRootNode(),b=c.attr("id");if(c.length>0){if(settings.confirmDelete()){AppDeleteProjectFiles(c)}}else{AlertDialog("???","Project does not exist.")}},confirmDelete:function(){if(confirm("Are you sure? Deleting your project is permanent and cannot be undone!")){if(confirm("Are you REALLY sure you want to DELETE your project?")){return confirm("This is your last chance to click Cancel.")}}return false},editSummary:function(c){var a="#descriptionContainer"+c,d="#editSummaryLink"+c,b="#summaryDiv"+c;if($(a+":visible").length>0){settings.submitObject({pid:c,desc:$(a).children("textarea").val()},function(e){if(e.s){$(b).html($("<div/>").text($(a).children("textarea").val()).html().replace(/\n/g,"<br>"));$(a).hide();$(d).html("Edit Description")}else{AlertDialog("Error",e.m)}})}else{$(a).children("textarea").html($(b).html().replace(/<br>/g,"\n"));$(a).show();$(d).html("Save Description")}},starOver:function(a,b){var e=parseInt(a);var d=$("#ratingDiv"+b);for(var c=0;c<=e;c++){d.find("img")[c].src="/modules/compilr/images/star.png"}for(c=e+1;c<10;c++){d.find("img")[c].src="/modules/compilr/images/starnegative.png"}},starOut:function(a){var d=$("#ratingDiv"+a);var c=parseInt($(d).attr("data"));for(var b=0;b<c;b++){d.find("img")[b].src="/modules/compilr/images/star.png"}for(b=c;b<10;b++){d.find("img")[b].src="/modules/compilr/images/starnegative.png"}},starClick:function(b,c){var a=parseInt(b)+1;settings.submitObject({pid:c,rt:a},function(d){if(d.s){var e=$("#ratingDiv"+c);e.attr("data",a);if(!e.children("span").attr("voted")){e.children("span").attr("voted","true").html(parseInt(e.children("span").html())+1)}settings.starOut(c)}else{AlertDialog("Error",d.m)}})}};var buildWindow={getDownloadButton:function(){$download=$("#dialog-build_button-download");if($download.length>0){return $download}else{return $download=$('<button id="dialog-build_button-download">Download</button>').button().click(function(){App.ProjectDownload(buildWindow.buildingProjectId)})}},checkBuildStatus:function(){$.ajax({type:"GET",cache:false,data:{pid:buildWindow.buildingProjectId},dataType:"json",url:"/IDE/compile.php"}).success(function(c,d,b){if(c.s||c.f){if(c.f){if(c.s){$(".ui-progressbar").css("backgroundColor","#00CC33");buildWindow.updateBuildStatus("Project built successfully!",true);$("#dialog-build").parent().find(".ui-dialog-buttonset").append(buildWindow.getDownloadButton())}else{$(".ui-progressbar").css("backgroundColor","#FF0000");buildWindow.updateBuildStatus("Error building project, please check the error panel for more details.",true);centerLayout.open("south")}compilr.projects[buildWindow.buildingProjectId].buildExists=c.s;$(window).trigger("compilr.buildcomplete",[c.s]);if(typeof c.e!=="undefined"){AppSetErrors(c.e)}}else{if(typeof c.q!=="undefined"){buildWindow.updateBuildStatus("Waiting for build server, in queue at position "+c.q+"...",false,c.p)}else{if(c.p==2){buildWindow.updateBuildStatus("Project is building, please wait...",false,c.p)}else{buildWindow.updateBuildStatus("Unknown Build status, please wait...",false,c.p)}}}var a=buildWindow.dialog();if(!c.f&&a.isOpen()){setTimeout(buildWindow.checkBuildStatus,1000)}}else{buildWindow.updateBuildStatus(c.m,true)}}).error(function(a,c,b){buildWindow.updateBuildStatus("Server Error: "+c,true)})},updateBuildStatus:function(e,b,a){var d=buildWindow.dialog(),c=b?0:(a*25);d.update(c,e);if(b){d.option("title","Build Complete");if(!d.isOpen()){d.option("position","center");d.open()}if(d.isMinimized){d.restore()}$(d.element).bind("statusdialogclose",function(){d.destroy();$(d.element).find(".overlay").remove();$(d.element).unbind("statusdialogclose").remove()})}},dialog:function(){var a=$("#dialog-build");if(!a.length){a=$('<div id="dialog-build" title="Building Project..." class="buildstatus" />').html('<h3 class="subtitle">Building Project...</h3>').appendTo("body")}else{if(a.data("statusdialog")){return a.data("statusdialog")}}a.statusdialog({autoOpen:false,buttons:{Close:function(){a.data("statusdialog").close()}},buttonPaneContent:$("ul.dialog.social").clone(),captionButtons:{minimize:{visible:false}},dialogClass:"buildstatus",close:function(b){$.ajax({type:"GET",cache:false,data:{pid:buildWindow.buildingProjectId,kill:true},dataType:"json",url:"/IDE/compile.php"});$(".ui-progressbar").css("backgroundColor","#969696")},resizable:false,stack:false,statusMessage:"...",width:"auto",modal:true});a.after('<div class="overlay"></div>');return a.data("statusdialog")},build:function(a,b){buildWindow.buildingProjectId=a;if(!b&&tabs.getUnsavedTabsCount()>0){ConfirmDialog("Save Changes?","You have unsaved changes. Would you like to save before building?",function(c){if(c){AppSaveAllOpenFiles(function(d){if(d){buildWindow.doBuild()}})}else{buildWindow.doBuild()}})}else{buildWindow.doBuild()}},doBuild:function(){var a=buildWindow.dialog();if($("#dialog-build_button-download").length>0){$("#dialog-build_button-download").detach()}$(window).trigger("build");a.open();buildWindow.updateBuildStatus("Starting build for "+project.name+"...");buildWindow.checkBuildStatus()}};jsconsole={show:function(){if(jsconsole.tab==null){$("#south-tabs").data("tabs").add("#jsconsole","JS Console");jsconsole.tab=$("#jsconsole");jsconsole.tab.append('<div><div class="JSLogCommandText">&gt; Type text in the textbox below...</div></div><input type="text" class="input-text" /><button class="nice small radius red button">Clear Console</button><iframe></iframe>');JSFrame=jsconsole.tab.children("iframe")[0];JSInput=jsconsole.tab.children("input[type=text]")[0];JSLog=jsconsole.tab.children("div").children("div").first()[0];$(JSInput).keyup(JSsubmitCommand);$(JSInput).focus(JSonFocus);jsconsole.tab.children("button").click(jsconsole.clearConsole)}$("#south-tabs").data("tabs").select("#jsconsole")},hide:function(){},clearConsole:function(){JSLog.innerHTML="";JSCurrentLogPosition=0;JSCommandArray=new Array()}};var JSFrameScript=null;var JSFrame=null;var JSInput=null;var JSLog=null;var JSCurrentLogPosition=0;var JSCommandArray=new Array();function JShtmlDecode(a){return $("<div/>").html(a).text()}function JSonFocus(){var a,e,d,b;JSFrame=jsconsole.tab.children("iframe")[0];a=tabs.getActiveTabId();if(a){e=new IdPath(a);if(e.isContainer()&&e.getRealName()=="preview"){e=new IdPath(e.getParentId());if(e.isFile()){b=e.getFileSyntax().mode;if(b=="text/javascript"||b=="text/html"){JSFrame=$(tabs.index[a]).find("iframe")[0]}}}else{if(e.isFile()){d=tabs.getFileContentById(a);b=e.getFileSyntax().mode;if((b=="text/javascript"||b=="text/html")&&d&&JSFrameScript!=d){JSFrameScript=d;JSFrame.src="about:blank";var c=JSFrame.contentWindow;if(b=="text/javascript"){c.document.open();c.document.write('<html><head><script type="text/javascript">');c.document.write(JSFrameScript);c.document.write("<\/script></head><body></body></html>");c.document.close()}else{c.document.open();c.document.write(JSFrameScript);c.document.close()}}}}}if(JSFrameScript===null&&!JSFrame.src){JSFrame.src="about:blank"}}function JSsubmitCommand(d){var c=d.which;if(c==13){var f=JSInput.value;JSCommandArray.push(f);JSCurrentLogPosition=0;f=$.trim(f);JSLog.innerHTML+='<div class="JSLogCommandText">&gt; '+$("<div/>").text(f).html()+"</div>";try{JSLog.innerHTML+='<div class="JSLogCommandResult">'+JSevalIframe(f)+"</div>"}catch(b){JSLog.innerHTML+='<div class="JSLogCommandError">'+b.description+"</div>"}JSLog.scrollTop=JSLog.scrollHeight;JSInput.value=""}else{if(c==38||c==40){if(c==38){JSCurrentLogPosition++}else{JSCurrentLogPosition--}if(JSCommandArray.length>0){JSCurrentLogPosition=Math.min(JSCommandArray.length,Math.max(1,JSCurrentLogPosition));var a=Math.abs(JSCurrentLogPosition-JSCommandArray.length);JSInput.value=JSCommandArray[a]}else{JSCurrentLogPosition=0}}}}function JSevalIframe(command){var iframeWindow=JSFrame.contentWindow;if(!iframeWindow.eval&&iframeWindow.execScript){iframeWindow.execScript("null")}return iframeWindow.eval(command)};function Editor(d,e,b,c,a){this.element=d;this.tabSelector=c;this.code=e;this.currentCode=e;this.changed=false;this.history={undo:0,redo:0};this.onCodeChange=a;this.getSyntaxThenDo(b,Editor._construct)}Editor._construct=function(b,a){b.element.children().remove();b.element.closest("div.splash-screen").removeClass("splash-screen");if(b.onCodeChange){b.mirror=CodeMirror(b.element[0],{value:b.code,lineNumbers:true,mode:a.mode,onChange:Editor.onMirrorChange})}else{b.mirror=CodeMirror(b.element[0],{value:b.code,lineNumbers:true,mode:a.mode,readOnly:true})}b.mirror.mirror=b;b.history=b.mirror.historySize()};Editor.loadedSyntax={};Editor.prototype.getSyntaxThenDo=function(a,d,c){if(typeof c==="undefined"){c=this}if(a.files.length>0){var b=a.files.pop();if(Editor.loadedSyntax[b]){return c.getSyntaxThenDo(a,d,c)}else{$.ajax({dataType:"script",url:"/sites/all/themes/compilr/js/libs/codemirror/mode/"+b+"/"+b+".js",complete:function(e,f){Editor.loadedSyntax[b]=true;c.getSyntaxThenDo(a,d,c)}})}return true}else{return d(c,a)}};Editor.prototype.canUndo=function(){return this.history.undo>0};Editor.prototype.canRedo=function(){return this.history.redo>0};Editor.prototype.undo=function(){this.mirror.undo()};Editor.prototype.redo=function(){this.mirror.redo()};Editor._setSyntax=function(b,a){b.mirror.setOption("mode",a.mode)};Editor.prototype.setSyntax=function(a){this.getSyntaxThenDo(a,Editor._setSyntax)};Editor.prototype.makeCurrentAsOriginal=function(){this.code=this.currentCode;this.changed=false;this.onCodeChange(this.tabSelector,this,false)};Editor.onMirrorChange=function(d,c){var b=d.mirror,a=b.mirror.historySize(),e=(a.redo==0&&b.history.redo>=1)||(a.redo>=1&&b.history.redo==0)||(a.undo==0&&b.history.undo>=1)||(a.undo>=1&&b.history.undo==0);b.currentCode=d.getValue();b.history=a;if(b.code.length==b.currentCode.length&&b.code==b.currentCode){b.changed=false;b.onCodeChange(b.tabSelector,b,false)}else{if(e||!b.changed){b.changed=true;b.onCodeChange(b.tabSelector,b,true)}}};var mobile=(/iphone|ipad|ipod|android|blackberry|playbook|mini|windows\sce|palm/i.test(navigator.userAgent.toLowerCase()));if(mobile){$(window).one("compilr.initialized",function(){var a=$("head").append('<style type="text/css"></style>').children("style").last();a.append(".jstree ul > li, .jstree-default .jstree-leaf > ins {background: none repeat scroll 0 0 transparent !important;}");a.append(".jstree a {height: 0.8cm !important; font-size: 16px !important; line-height: 0.8cm;}");a.append(".jstree a ins {line-height: 18px;} .jstree li > ins {margin: 0 0.2cm 0 0.2cm;}");a.append(".jstree-default .jstree-closed > ins {background-position: 0 0; !important}");a.append(".jstree-default .jstree-open > ins {background-position: -18px 0; !important}");ProjectTree.unbind("select_node.jstree");ProjectTree.bind("select_node.jstree",function(c,d){if(typeof ProjectTree.ClickResult==="undefined"||ProjectTree.ClickResult!==d.rslt.obj[0]){$(ProjectTree.ClickResult).children("input").blur();ProjectTree.ClickResult=d.rslt.obj[0];var b=(new IdPath(ProjectTree.ClickResult.id)).getProjectId();if(b!=compilr.currentProject.id){$(window).trigger("compilr.projectChanged",b)}}else{ProjectTree.OpenNode(ProjectTree.ClickResult,new IdPath(ProjectTree.ClickResult.id))}})})};var currentTime=new Date();var startTime=currentTime.getTime();function AppOpenProjectWizardDialog(){if(typeof ClickTaleExec=="function"){ClickTaleExec("AppOpenProjectWizardDialog()")}compilr.openDialogProjectWizard()}function AppOpenSignupDialog(){if(typeof ClickTaleExec=="function"){ClickTaleExec("AppOpenSignupDialog()")}compilr.openDialogSignup()}function AppOpenLoginDialog(){if(typeof ClickTaleExec=="function"){ClickTaleExec("AppOpenLoginDialog()")}compilr.openDialogLogin()}function AppOpenLoginSignupDialog(){if(typeof ClickTaleExec=="function"){ClickTaleExec("AppOpenLoginSignupDialog()")}compilr.openDialogLoginSignup()}function AppDeleteProjectFiles(b){var a={projects:[],directories:[],files:[]};b.each(function(){var c=new IdPath(this.id);if(c.isRoot()){a.projects.push(this.id)}else{if(c.isDirectory()){a.directories.push(this.id)}else{if(c.isFile()){a.files.push(this.id)}}}});if(a.projects.length||a.files.length||a.directories.length){ConfirmDialog("Confirm Delete","Are you sure you want to delete the selected files?",function(c){if(c){$(window).trigger("loading");compilr.apiCall({projects:a.projects,directories:a.directories,files:a.files,action:"delete"},function(k){if(k.s){var l,g,d,j,e=false,f,h=App.currentProjectSelect[0];for(l in k.projects){if(k.projects[l].s){$('[id^="'+l+'"]').each(function(){tabs.closeTab(this.id)});ProjectTree.jstree("delete_node","#"+l);j=new IdPath(l);e=j.getProjectId();for(f=0;f<h.options.length;f++){if(h.options[f].value==e){$(h.options[f]).remove();break}}}}compilr.updateProjectWizard(k);if(e){if(h.options.length>0){App.SetCurrentProject(h.options[0].value,true)}else{App.SetCurrentProject(null)}}for(g in k.files){if(k.files[g].s){ProjectTree.jstree("delete_node","#"+g);tabs.closeTab(g)}}for(d in k.directories){if(k.directories[d].s){ProjectTree.jstree("delete_node","#"+d)}}}$(window).trigger("loadingcomplete");if(k.m){AlertDialog(k.s?"Notice":"Warning",k.m)}},true)}})}}function AppCurrentProjectSaveFile(){if(!AppCurrentProjectSaveFileById(tabs.getActiveTabId())){AlertDialog("Invalid File","Please select a file tab you have write access to.")}}function AppCurrentProjectSaveFileById(c,a){var b=new IdPath(c);if(b.isFile()&&b.isWritable()){compilr.currentProject.saveFile(c,tabs.getFileContentById(c),function(d){if(d.s){$(tabs.index[c]).data("code").makeCurrentAsOriginal();if(typeof a=="function"){a(true)}}else{if(d.m){AlertDialog("Error","Error saving file:\n"+d.m);if(typeof a=="function"){a(false)}}else{AlertDialog("Server Error","Error while communicating with server to save your file.");if(typeof a=="function"){a(false)}}}});return true}else{if(typeof a=="function"){a(false)}}return false}function AppCurrentProjectExportFiles(){if(typeof ClickTaleExec=="function"){ClickTaleExec("AppCurrentProjectExportFiles()")}var a=ProgressDialog("Compressing Files","Please wait while we compress your files for you to download.","icon-dialog-files");compilr.currentProject.exportFiles(function(b){if(b.s){a.dialog("close");window.location.href="/IDE/zip.php?id="+compilr.currentProject.id}else{if(b.m){AlertDialog("Error","Error while compressing files:\n"+b.m)}else{AlertDialog("Server Error","Error while communicating with server to compress your files.")}}})}var Import={ScourTree:function(c){var a=new IdPath(c.attr("id"));if(a.canHoldFiles()&&a.isWritable()){var b={data:{title:$.trim(c.children("a").text()),icon:"dir"},attr:{id:a.alterPrefix("impt")}};b.children=[];c.children("ul").children("li").each(function(e){var d=Import.ScourTree($(this));if(d){b.children.push(d)}});return b}return false}};function AppCurrentProjectImportFiles(a){if(typeof ClickTaleExec=="function"){ClickTaleExec("AppCurrentProjectImportFiles()")}var c=[];ProjectTree.children("ul").children("li").each(function(e){var d=Import.ScourTree($(this));if(d){c.push(d)}});if(typeof(Import.Dialog)==="undefined"){Import.Dialog=$('<div id="importFilesDialog" title="Import Files"><div class="top-pane"></div><div class="left-pane"></div><div class="right-pane"><div></div></div><br/><button>Ok</button></div>').dialog({minWidth:585,minHeight:450,modal:true});Import.Dialog.find(".top-pane").text("Please select a directory on the left, then select your files to begin the upload.");Import.Dialog.find("button").button().on("click",function(){Import.Dialog.dialog("close")});var b=Import.Dialog.find(".right-pane");b.append('<form id="importFilesDialogForm" action="/IDE/upload.php" method="post" enctype="multipart/form-data"><p><input type="file" name="file" id="file" /></p><p><input type="submit" name="submit" value="Upload" /></p></form>');b.children("#importFilesDialogForm").uploadify({uploader:"/assets/js/jquery/plugins/uploadify/uploadify.swf",script:"/IDE/upload.php",multi:true,auto:true,height:"36",width:"115",buttonImg:"/sites/all/themes/compilr/images/misc/upload.png",onSelectOnce:function(e,f){var d=Import.FolderTree.jstree("get_Selected").data.ui.selected;if(d.length>0){Import.SelectedFolderId=d.attr("id");b.children("#importFilesDialogForm").uploadifySettings("scriptData",{dir:Import.SelectedFolderId,sid:compilr.user.sid});Import.Dialog.find(".right-pane").find(".spinner-bar").css("display","inline-block");return true}b.children("#importFilesDialogForm").uploadifyClearQueue();AlertDialog("Warning","Please select a directory to upload to.");return false},onComplete:function(j,e,i,g,k){var h=$.parseJSON(g);if(h.s){var d=new IdPath(Import.SelectedFolderId);var f=new IdPath(Import.SelectedFolderId+IdPath.EncodeRealFileName(h.m));ProjectTree.jstree("create",$("#"+d.alterPrefix("ft")),"last",{attr:{id:f.alterPrefix("ft")},data:{title:h.m,icon:f.getIconClass()}},false,true)}else{AlertDialog("Error uploading file","Error while uploading: "+i.name+"<br/>"+h.m)}},onAllComplete:function(){Import.Dialog.find(".right-pane").find(".spinner-bar").css("display","none")}});b.append('<span class="spinner-bar"></span>')}else{Import.FolderTree.jstree("destroy");Import.Dialog.dialog("open")}Import.FolderTree=Import.Dialog.find(".left-pane").jstree({core:{animation:0},json_data:{data:c},plugins:["themes","json_data","ui"]});if(typeof a==="string"){Import.FolderTree.one("loaded.jstree",function(){Import.FolderTree.jstree("select_node","#"+(new IdPath(a)).alterPrefix("impt"),true)})}}var saveAllOpenFiles={recursiveSave:function(a){if(!a||saveAllOpenFiles.FileIds.length==0){saveAllOpenFiles.progDiag.dialog("close");if(typeof saveAllOpenFiles.completeCallback=="function"){saveAllOpenFiles.completeCallback(a)}}else{AppCurrentProjectSaveFileById(saveAllOpenFiles.FileIds.pop(),saveAllOpenFiles.recursiveSave)}}};function AppSaveAllOpenFiles(a){saveAllOpenFiles.completeCallback=a;saveAllOpenFiles.FileIds=tabs.getUnsavedTabFileIds();if(saveAllOpenFiles.FileIds.length>0){saveAllOpenFiles.progDiag=ProgressDialog("Saving Files","Please wait while your file changes are saved...","icon-dialog-files");AppCurrentProjectSaveFileById(saveAllOpenFiles.FileIds.pop(),saveAllOpenFiles.recursiveSave)}}function AppCurrentProjectBuild(){if(typeof ClickTaleExec=="function"){ClickTaleExec("AppCurrentProjectBuild()")}buildWindow.build(compilr.currentProject.id,false)}function AppCurrentProjectDoDownload(b,a){if(a){window.location.href="/IDE/download.php?p="+compilr.currentProject.id}$(window).unbind("compilr.buildcomplete",AppCurrentProjectDoDownload)}function AppSetErrors(a){var b=$("#errors").dataTable();b.fnClearTable();b.fnAddData(a);if(a.length){centerLayout.open("south")}}var App={ProjectDownload:function(a){if(typeof a!=="string"&&typeof a!=="number"){a=compilr.currentProject.id}if(compilr.projects[a].buildExists){window.location.href="/IDE/download.php?p="+a}else{ConfirmDialog("Needs Build","Your project needs to be built before it can be downloaded. Would you like to build it now?",function(b){if(b){$(window).unbind("compilr.buildcomplete",AppCurrentProjectDoDownload);$(window).bind("compilr.buildcomplete",AppCurrentProjectDoDownload);AppCurrentProjectBuild()}})}},DeleteSelectedNodes:function(){$nodes=ProjectTree.jstree("get_selected");if($nodes.length>0){AppDeleteProjectFiles($nodes)}else{AlertDialog("No Selection","Please select a file or folder to delete.")}},RenameSelectedNode:function(){var a=ProjectTree.jstree("get_selected");if(a.length>0){a=a.first();ProjectTree.OldName=$.trim(a.children("a").text());ProjectTree.jstree("rename",a)}else{AlertDialog("No Selection","Please select a file or folder to rename.")}},RenameNode:function(c,b){var a=new IdPath(c.attr("id"));if(!a.isWritable()){c.children("a:eq(0)").contents().filter(function(){return this.nodeType==3})[0].nodeValue=ProjectTree.OldName;AlertDialog("You do not have access","You do not have access to that item.<br/><br/>Please only attempt to rename items you own.")}else{if(a.isFile()&&!IdPath.ValidateFileName(b)){c.children("a:eq(0)").contents().filter(function(){return this.nodeType==3})[0].nodeValue=ProjectTree.OldName;AlertDialog("Invalid Name","Invalid file name, only letters, numbers and underscores are allowed in the file name. The file name must be followed with a period and file extension consisting of only letters and numbers.<br/><br/>Example: file_1.ex1")}else{if(a.isDirectory()&&!IdPath.ValidateFileName(b)){c.children("a:eq(0)").contents().filter(function(){return this.nodeType==3})[0].nodeValue=ProjectTree.OldName;AlertDialog("Invalid Name","Invalid directory name, only letters, numbers and spaces are allowed in the directory name.<br/><br/>Example: My 1st Folder")}else{if(ProjectTree.OldName!=b){compilr.currentProject.renameFile(a.Id,b,function(e){if(e.s){var i=a.Id;var h=a.getFileExtension();var d=a.setRealName(b).sanitize();c.attr("id",d);if(a.isFile()){if(tabs.updateTabId(i,d)){tabs.updateTabText(d,b)}if(h!=a.getFileExtension()){tabs.updateTabAndTreeIcon(c,a.getIconClass());if(tabs.index[d]){$(tabs.index[d]).data("code").setSyntax(a.getFileSyntax())}}}else{var g=i.length;var f=c.find('li[id^="'+i+'"]');f.each(function(j){var k=d+this.id.substr(g);tabs.updateTabId(this.id,k);this.id=k})}}else{if(typeof ProjectTree.OldName==="string"&&$.trim(ProjectTree.OldName).length>0){c.children("a:eq(0)").contents().filter(function(){return this.nodeType==3})[0].nodeValue=ProjectTree.OldName}AlertDialog("Error","Error renaming file:\n"+e.m)}})}}}}},CurrentProjectSettings:function(){tabs.loadProjectSettings(new IdPath(compilr.currentProject.getRootNodeId()))},SetCurrentProject:function(e,g){if(e==null){compilr.currentProject=null;build_menu({newfile:{enabled:false,click:0},newfolder:{enabled:false,click:0},rename:{enabled:false,click:0},"delete":{enabled:false,click:0},build:{enabled:false,click:0},"import":{enabled:false,click:0},"export":{enabled:false,click:0},download:{enabled:false,click:0},preview:{enabled:false,click:0},settings:{enabled:false,click:0}});tab_specific_menu(false);return}for(var d=0;d<App.currentProjectSelect[0].options.length;d++){if(App.currentProjectSelect[0].options[d].value==e){App.currentProjectSelect[0].options[d].selected=true;break}}if(compilr.currentProject){compilr.currentProject.getRootNode().removeClass("current-project")}compilr.currentProject=compilr.projects[e];var h=compilr.currentProject.getRootNode().addClass("current-project");if(g){ProjectTree.jstree("deselect_all");ProjectTree.jstree("select_node",h,true)}var j=new IdPath(compilr.currentProject.getRootNodeId()),c=j.isWritable(),b=compilr.currentProject.language,a=b==3||b==1||b==2,f={newfile:{enabled:c,click:c?App.NewFile:0},newfolder:{enabled:c,click:c?App.NewFolder:0},rename:{enabled:c,click:c?App.RenameSelectedNode:0},"delete":{enabled:c,click:c?App.DeleteSelectedNodes:0},build:{enabled:c&&a,click:c&&a?AppCurrentProjectBuild:0},"import":{enabled:c,click:c?AppCurrentProjectImportFiles:0},"export":{enabled:true,click:AppCurrentProjectExportFiles},download:{enabled:c&&a,click:c&&a?App.ProjectDownload:0},preview:{enabled:b==3,click:App.Preview},settings:{enabled:true,click:App.CurrentProjectSettings}},k=tabs.getActiveTabId();$(".action-settings a span span").text(c?"Settings":"Details");build_menu(f);if(k){k=new IdPath(k);tab_specific_menu(k)}},EditProjectReferences:function(f){var a=compilr.projects[f].getReferenceNode();if(a.length==0){AlertDialog("Error","The specified project does not support platform library references.");return}if(typeof(App.referenceDialog)==="undefined"){App.referenceDialog=$('<div title="Edit References" class="reference-dialog"><div></div><button class="save">Save</button><button class="cancel">Cancel</button></div>').dialog({minWidth:250,minHeight:400,captionButtons:{maximize:{visible:true}}});App.referenceDialog.find("button").first().button().on("click",function(){var m="",l,k=compilr.corerefs[compilr.projects[f].platform],n;App.referenceDialog.selectedRefs=App.referenceDialog.find("div").children("button").filter(function(){return $(this).data("Clicked")});for(l=0;l<App.referenceDialog.selectedRefs.length;l++){m+=App.referenceDialog.selectedRefs[l].value;if(l<App.referenceDialog.selectedRefs.length-1){m+="-"}}compilr.currentProject.saveReferences(m,function(o){if(o.s){App.referenceDialog.referencesFolder.children("ul").children("li").each(function(){ProjectTree.jstree("delete_node","#"+this.id)});App.referenceDialog.selectedRefs.each(function(){n=this.value;ProjectTree.jstree("create_node",App.referenceDialog.referencesFolder,"last",{data:{title:k[n],icon:"icon-ref"},attr:{id:App.referenceDialog.referencesFolder.attr("id")+IdPath.EncodeRealReferenceName(n)}})});ProjectTree.jstree("open_node",App.referenceDialog.referencesFolder);App.referenceDialog.dialog("close")}else{if(o.m){AlertDialog("Error","Error while updating references:\n"+o.m)}else{AlertDialog("Server Error","Error while communicating with server to update your project's references.")}}})});App.referenceDialog.find("button").last().button().on("click",function(){App.referenceDialog.dialog("close")});App.referenceDialog.refClicked=function(k){$(this).data("Clicked",!$(this).data("Clicked"))};App.referenceDialog.refMouseOut=function(k){if($(this).data("Clicked")){$(this).addClass("ui-state-active")}else{$(this).removeClass("ui-state-focus")}}}else{App.referenceDialog.dialog("open")}App.referenceDialog.referencesFolder=a;var g=App.referenceDialog.find("div");g.empty();var h=compilr.corerefs[compilr.projects[f].platform],d,j=0,i;for(var b in h){d=$('<button value="'+b+'">'+h[b]+"</button>").button();g.append(d);i=d.width();if(i>j){j=i}}var e=a.children("ul"),c="#"+a.attr("id")+"-r";g.children("button").each(function(k){if(e.children(c+this.value).length>0){$(this).data("Clicked",true).addClass("ui-state-active")}$(this).width(j).removeClass("ui-corner-all").on("click",App.referenceDialog.refClicked).on("mouseout",App.referenceDialog.refMouseOut)});g.children("button:first").addClass("ui-corner-top");g.children("button:last").addClass("ui-corner-bottom");App.referenceDialog.parent().width(j+40)},NewFile:function(a){if(typeof a!=="string"){$SelectedNode=ProjectTree.jstree("get_selected");if($SelectedNode.length>0){a=$SelectedNode.first().attr("id");var b=new IdPath(a);if(b.isFile()){a=b.getParentId()}}}if(IdPath.ValidatePathIsDirectory(a)){TextInputDialog("New File","Enter a name for your new file:",function(c){if(!compilr.currentProject.newFile(c,a,function(e){if(e.s){var d=new IdPath(a+e.id);ProjectTree.jstree("create_node","#"+a,"last",{data:{title:c,icon:d.getIconClass()},attr:{id:d.Id}})}else{if(e.m){AlertDialog("Error","Error creating new file:\n"+e.m)}else{AlertDialog("Server Error","Error while communicating with server to create your new file.")}}})){AlertDialog("Invalid File Name","Please enter a valid filename in the form of file_name.extension")}})}else{AlertDialog("Invalid Directory","Please select a directory that is capable of holding files.")}},NewFolder:function(a){if(typeof a!=="string"){$SelectedNode=ProjectTree.jstree("get_selected");if($SelectedNode.length>0){a=$SelectedNode.first().attr("id");var b=new IdPath(a);if(b.isFile()){a=b.getParentId()}}}if(IdPath.ValidatePathIsDirectory(a)){TextInputDialog("New Folder","Enter a name for your new folder:",function(c){if(!compilr.currentProject.newFolder(c,a,function(d){if(d.s){ProjectTree.jstree("create_node","#"+a,"last",{data:{title:c,icon:"dir"},state:"open",attr:{id:a+d.id}})}else{if(d.m){AlertDialog("Error","Error creating new directory:\n"+d.m)}else{AlertDialog("Server Error","Error while communicating with server to create your new directory.")}}})){AlertDialog("Invalid Folder Name","Please enter a valid folder name that only contains characters, numbers and spaces.")}})}else{AlertDialog("Invalid Directory","Please select a directory that is capable of holding a folder.")}},Preview:function(){var a=tabs.getActiveTabId(),c,b;if(a){c=new IdPath(a);b=c.getFileSyntax().mode;if(b=="text/javascript"||b=="text/html"){tabs.loadFilePreview(c.Id,b);return}}if(compilr.currentProject.language==3){tabs.loadTab(compilr.currentProject.getRootNodeId()+"-njavapreview","/IDE/preview.php?projectId="+compilr.currentProject.id,"Applet Preview","jstree-icon icon-ref",false)}else{AlertDialog("Error","Your current project does not support previews, please select a java applet project.")}},CurrentFileRedo:function(){$(tabs.getActiveTabHRef()).data("code").redo()},CurrentFileUndo:function(){$(tabs.getActiveTabHRef()).data("code").undo()}};var progressDialog;function ProgressDialog(c,b,a){if(typeof(progressDialog)==="undefined"){progressDialog=$('<div title="'+c+'"><div style="float: left; width: 160px;"><p>'+b+'</p></div><div style="float: left;"><span class="progress-dialog-icon '+a+'"></span></div><span class="spinner-bar"></span></div>').dialog({modal:true,minWidth:250})}else{progressDialog.parent("div").find(".ui-dialog-title").text(c);progressDialog.find("p").html(b);progressDialog.find(".progress-dialog-icon").removeClass().addClass("progress-dialog-icon").addClass(a);progressDialog.dialog("open")}return progressDialog}function Dialog(f,d,b){var e={buttons:{Ok:function(){$(this).dialog("close")}},captionButtons:{minimize:{visible:false}},modal:true,title:f,width:500};var c=$("#ui-dialog-alert");if(!c.length){c=$('<div id="ui-dialog-alert" style="display: none;" />');c.appendTo("body")}if(c.data("dialog")){if(!c.data("nextalert")){c.data("nextalert",[])}c.data("nextalert").push(arguments)}else{c.html(d);b=$.extend({},e,b||{});var a=b.close;b.close=function(g,h){$(this).dialog("destroy");if(typeof a==="function"){a(g,h)}if($(this).data("nextalert")&&($next=$(this).data("nextalert").shift())){AlertDialog.apply(this,$next)}};c.dialog(b)}}function AlertDialog(c,b,a){Dialog.apply(this,arguments)}function ConfirmDialog(d,b,e,a){var c={buttons:{Ok:function(){$(this).dialog("close");if(typeof e==="function"){e(true)}return true},Cancel:function(){$(this).dialog("close");if(typeof e==="function"){e(false)}return false}},captionButtons:{minimize:{visible:false}},modal:true,title:d,width:500};a=$.extend({},c,a);Dialog.apply(this,[d,b,a])}var textInputDialog;function TextInputDialog(d,c,a,b){if(typeof(textInputDialog)==="undefined"){textInputDialog=$('<div title="'+d+'"><p>'+c+'</p><input id="textInputDialogInput" type="text" />&nbsp;<button>Ok</button></div>').dialog();textInputDialog.find("button").button().on("click",function(){var e=$("#textInputDialogInput").val();if(typeof(textInputDialog.Validator)!=="function"||textInputDialog.Validator(e)){if(typeof(textInputDialog.Callback)==="function"){textInputDialog.Callback(e)}textInputDialog.dialog("close")}})}else{textInputDialog.parent("div").find(".ui-dialog-title").text(d);textInputDialog.find("p").html(c);textInputDialog.find("input").val("");textInputDialog.dialog("open")}textInputDialog.Callback=a;textInputDialog.Validator=b;return textInputDialog}$(window).unload(function(){if(compilrData.user.id!=0){var b=new Date();$.ajax({cache:false,data:{uid:compilrData.user.id,time:(b.getTime()-startTime),action:"stats",name:"time_onsite"},dataType:"text",url:"/IDE/handler.php"})}var a=new Date(),c=365;a.setDate(a.getDate()+c);layoutState.save("layout",null,{expires:a})});var layout;var centerLayout;function ReverseTabMapLookup(b){for(var a in tabs.index){if(tabs.index[a]==b){return a}}return false}var tabs={count:0,index:{},updateTabId:function(b,a){if(typeof(tabs.index[b])!=="undefined"&&tabs.index[b]!=null){tabs.index[a]=tabs.index[b];delete tabs.index[b];return true}return false},updateTabText:function(c,b){if(typeof(tabs.index[c])!=="undefined"&&tabs.index[c]!=null){var a=$("#center-tabs").data("tabs").anchors.filter("[href$="+tabs.index[c]+"]").children("span");a.contents().filter(function(){return this.nodeType==3})[0].nodeValue=b;return true}return false},getActiveTabHRef:function(){var a=$("#center-tabs").find("ul.ui-tabs-nav").find("li.ui-tabs-selected").find("a");if(a.length>0){return a.attr("href")}else{return false}},getActiveTabId:function(){var a=tabs.getActiveTabHRef();if(a){return ReverseTabMapLookup(a)}else{return false}},getFileContentById:function(a){return $(tabs.index[a]).data("code").currentCode},getUnsavedTabsCount:function(){return tabs.center.anchors.find(".unsaved").length},getUnsavedTabFileIds:function(){var a=new Array();tabs.center.anchors.find(".unsaved").closest("a").each(function(){a.push(ReverseTabMapLookup($(this).attr("href")))});return a},fileTabChange:function(d,c,g){var b=tabs.center.anchors.filter("[href$="+d+"]"),e=c.canUndo(),f=c.canRedo(),a={save:{enabled:g,click:g?AppCurrentProjectSaveFile:0},undo:{enabled:e,click:e?App.CurrentFileUndo:0},redo:{enabled:f,click:f?App.CurrentFileRedo:0}};if(g){b.find(".asterisk").removeClass().addClass("unsaved")}else{b.find(".unsaved").removeClass().addClass("asterisk")}build_menu(a)},getNextTabId:function(){return ++tabs.count},initPreloadedFiles:function(){tabs.center.element.find(".ui-tabs-panel.file").each(function(){a($(this).attr("id"))});function a(d){if(!tabs.index[d]){var c="#"+d,g=$(c).closest(":ui-tabs"),k=g.find('a[href="'+c+'"]'),m=$(c),l=new IdPath(d),b=k.text(),i=l.getIconClass(),h=l.isWritable(),j;tabs.index[c.replace(/^(#panel-)/,"")]=c;j='<span class="ui-icon jstree-icon '+i+'">&nbsp;</span>';j+=h?'<span class="asterisk">*</span>'+b:'<span class="readonly-tab-text">'+b+"</span>";j+='<span class="ui-icon ui-icon-close">&nbsp;</span>';k.children("span").html(j);k.find(".ui-icon-close").on("click",tabs.removeTab);var e=l.getFileSyntax();if(e.mode!="image"){var n=m,f=n.children("pre").remove().text();if(!h){m.append('<div class="readonly">Public projects can only be edited by the owner.</div>');m.append('<div class="readonlywrapper"></div>');n=m.children("div").last()}m.data("code",new Editor(n,f,e,tabs.index[d],h?tabs.fileTabChange:false))}}}},loadFile:function(d,b,h){if(!tabs.index[d]){var f=tabs.center.anchors.length,k=new IdPath(d),c,i,j,g=k.isWritable();i='<span class="ui-icon '+h+'">&nbsp;</span>';i+=g?'<span class="asterisk">*</span>'+b:'<span class="readonly-tab-text">'+b+"</span>";i+='<span class="ui-icon ui-icon-close">&nbsp;</span>';c="#file-panel-"+tabs.getNextTabId();tabs.center.add(c,i);j=$(tabs.center.anchors[f]);tabs.index[d]=$(tabs.center.anchors[f]).attr("href");var l=$(tabs.index[d]);var e=k.getFileSyntax();if(e.mode!="image"){var a=l;j.addClass("loading");if(!g){a.append('<div class="readonly">Public projects can only be edited by the owner.</div>');a.append('<div class="readonlywrapper"></div>');a=a.children("div").last()}$.ajax({cache:false,data:{id:d},dataType:"text",url:"/IDE/getfile.php"}).success(function(m){l.data("code",new Editor(a,m,e,tabs.index[d],g?tabs.fileTabChange:false))}).error(function(m,o,n){AlertDialog("Server Error","Error loading file: "+o)}).complete(function(){j.removeClass("loading")})}else{$(tabs.index[d]).append('<img src="/IDE/getimage.php?f='+d+'" alt="'+k.getRealName()+'" /> ')}}tabs.center.select(tabs.index[d]);return tabs.index[d]},loadFilePreview:function(b,e){var h=b+"-npreview",a="#"+h,c,g,d,f;if(!tabs.index[h]){tabs.center.add(a,'<span class="jstree-icon icon-ref">&nbsp;</span><span class="asterisk">*</span>Javascript Preview<span class="ui-icon ui-icon-close">&nbsp;</span>');tabs.index[h]=a;c=$(a).appendTo("#center-tabs .ui-panels");g=tabs.center.anchors.filter("[href$="+a+"]");g.find(".ui-icon-close").on("click",tabs.removeTab);d=c.append('<iframe src="about:blank"></iframe>').children("iframe")[0].contentWindow}else{d=$(a).find("iframe")[0].contentWindow}f=tabs.getFileContentById(b);if(e=="text/javascript"){d.document.open();d.document.write('<html><head><script type="text/javascript">');d.document.write(f);d.document.write("<\/script></head><body></body></html>");d.document.close()}else{d.document.open();d.document.write(f);d.document.close()}tabs.center.select(a);return a},loadMSDN:function(a){var b=compilr.corerefs[compilr.projects[a.getProjectId()].platform][a.getRealName()];tabs.loadTab(a.Id,"http://msdn.microsoft.com/en-us/library/"+b+".aspx",b,"jstree-icon icon-ref",true)},loadTab:function(h,d,c,f,e){if(!tabs.index[h]){var b=tabs.center.anchors.length;var a='<span class="icon-tab"><span class="'+f+'">&nbsp;</span>'+c+'<span class="ui-icon ui-icon-close">&nbsp;</span></span>';tabs.center.add(e?"#iframe-panel-"+tabs.getNextTabId():d,a);tabs.index[h]=$(tabs.center.anchors[b]).attr("href");if(e){var g=$(tabs.index[h]);g.appendTo("#center-tabs .ui-panels");g.html('<iframe src="'+d+'" class="ui-tabs-iframe"></iframe>').addClass("ui-with-iframe");tabs.center.anchors.filter("[href$="+tabs.index[h]+"]").find(".ui-icon-close").off("click").on("click",tabs.removeTab)}}tabs.center.select(tabs.index[h]);return tabs.index[h]},loadProjectSettings:function(b){var c=$("#"+b.Id),a=compilr.projects[b.getProjectId()];tabs.loadTab(b.Id,(a.url?a.url:"/"+a.user)+"?ajax=true",ProjectTree.GetNodeText(c),c.children("a").children("ins").attr("class"),false)},closeTab:function(a){if(tabs.index[a]){tabs.center.remove(tabs.index[a])}},removeTab:function(b){var a=$(b.target).parents("a").attr("href");$(b.target).closest(".ui-tabs").data("tabs").remove(a);return false},updateTabAndTreeIcon:function(b,a){if(typeof b==="string"){b=$(b)}b.children("a").children("ins").removeClass().addClass("jstree-icon").addClass(a);if(tabs.index[b.attr("id")]){tabs.center.anchors.filter("[href$="+tabs.index[b.attr("id")]+"]").find("span.jstree-icon").removeClass().addClass("jstree-icon").addClass(a)}}};jQuery(document).ready(function(d){compilr.init(compilrData);a();d("#main").find(".loading").delay(100).removeClass("loading");b();e();f();h();function a(){layout=d("#main").layout({center__paneSelector:"#center",center__size:200,east__paneSelector:"#east",initClosed:false});centerLayout=d("#center").layout({center__paneSelector:"#center-inner",center__onresize:function(){d(window).resize()},south__paneSelector:"#south",south__size:164,south__initClosed:true})}function b(){var o={add:function(p,q){d(q.tab).find(".ui-icon-close").off("click").on("click",tabs.removeTab);k(d(".ui-tabs-nav li"))},tabTemplate:'<li class="ui-closable"><a href="#{href}" class="ui-tab ui-with-icon"><span>#{label}</span></a></li>',panelContainer:"div.ui-panels",panelTemplate:'<div class="ui-tabs-panel"></div>',scrollable:true,offsetTL:15};var m=d("#center-tabs").tabs(d.extend({},o,{cache:true,remove:function(q,r){var p=ReverseTabMapLookup(d(r.tab).attr("href"));if(p){delete tabs.index[p]}},load:function(p,q){d(q.tab).find(".ui-icon-close").on("click",tabs.removeTab)},select:function(r,t){d(window).trigger("tabselect");var q=ReverseTabMapLookup("#"+t.panel.id);if(q){var s=new IdPath(q);var p=s.getProjectId();if(p!=compilr.currentProject.id){d(window).trigger("compilr.projectChanged",p)}tab_specific_menu(s)}else{tab_specific_menu(false)}},ajaxOptions:{error:function(s,p,r,q){d(q.hash).html("Couldn't load this tab. This could be because of a lost connection or problem on our end.")}}}));var l=d("#south-tabs").tabs(d.extend({},o));var n=d("#east-tabs").tabs(d.extend({},o));d(".ui-tabs-nav").sortable({axis:"x",delay:250,update:function(p,q){k(q.item.siblings().andSelf());d(q.item).closest(":ui-tabs").data("tabs").refresh()}});d(".ui-tabs-nav").find(".ui-icon-close").on("click",tabs.removeTab).closest("li").addClass("ui-closable");d(".ui-tabs-panel").removeClass("ui-corner-bottom");k(d(".ui-tabs-nav li"));tabs.center=m.data("tabs");tabs.south=l.data("tabs");tabs.east=n.data("tabs");tabs.initPreloadedFiles();function k(q){var p=q.length;q.each(function(){d(this).css("z-index",p);p--})}}function e(){d("#errors").dataTable({bPaginate:false,bLengthChange:false,bFilter:false,bSort:true,bInfo:false,bAutoWidth:false,bJQueryUI:false,oLanguage:{sEmptyTable:""},aoColumns:[{sTitle:"Type",mDataProp:"w",sWidth:"23px",fnRender:function(k){if(k.aData.w=="1"){return'<img src="/IDE/images/warning.png" alt="Warning" />'}else{return'<img src="/IDE/images/error.png" alt="Error" />'}}},{sTitle:"File",mDataProp:"f",sWidth:"200px"},{sTitle:"Line",mDataProp:"l",sWidth:"35px"},{sTitle:"Column",mDataProp:"c",sWidth:"35px"},{sTitle:"Description",mDataProp:"d"}]});if(typeof compilr.currentProject!=="undefined"&&compilr.currentProject!=null){AppSetErrors(compilr.currentProject.errors)}}function f(){loadTree(compilr.getProjectsFiles())}function h(){window.onbeforeunload=function(){if(tabs.getUnsavedTabsCount()>0){ConfirmDialog("Unsaved Changes","You have unsaved changes to your files, would you like to save?",function(k){if(k){AppSaveAllOpenFiles()}});return"You have unsaved changes, are you sure you want to leave the page?"}};d(window).on("compilr.addproject",function(l,n,m){var k=d.jstree._reference(ProjectTree)._parse_json(n.files).children();ProjectTree.children("ul:first").append(k);ProjectTree.jstree("clean_node",-1);ProjectTree.jstree("open_node",k);App.currentProjectSelect.append('<option value="'+n.id+'">'+n.name+"</option>");if(m){App.SetCurrentProject(n.id,true)}})}var c=compilr.user.isGuest();var i={newproject:{enabled:true,click:c?AppOpenLoginSignupDialog:AppOpenProjectWizardDialog},open:{enabled:true,click:c?AppOpenLoginSignupDialog:0},openrecentproject:{enabled:!c,click:0},undo:{enabled:false,click:0},redo:{enabled:false,click:0},copy:{enabled:false,click:0},paste:{enabled:false,click:0},cut:{enabled:false,click:0},projects:{enabled:true,click:function(){layout.toggle("east")}},errors:{enabled:true,click:function(){centerLayout.toggle("south")}}};build_menu(i);App.currentProjectSelect=d("#current-project");for(var g in compilr.projects){App.currentProjectSelect.append('<option value="'+g+'">'+compilr.projects[g].name+"</option>")}App.currentProjectSelect.change(function(){var k=this.options[this.selectedIndex].value;App.SetCurrentProject(k,true)});d(window).on("compilr.projectChanged",function(l,k){App.SetCurrentProject(k,false)});ProjectTree.on("loaded.jstree",function(){if(typeof compilr.currentProject==="object"&&compilr.currentProject!=null){App.SetCurrentProject(compilr.currentProject.id,true);ProjectTree.jstree("open_node",compilr.currentProject.getRootNode())}});d(window).trigger("compilr.initialized");var j=window.location.pathname;if((/^(\/new\/user)$/).test(j)){AppOpenSignupDialog()}else{if((/^(\/new\/project)$/).test(j)){compilr.user.isGuest()?AppOpenLoginSignupDialog():AppOpenProjectWizardDialog()}}});function tab_specific_menu(g){var c=typeof compilr.currentProject!=="undefined"&&compilr.currentProject!=null?compilr.currentProject.language:-1,f=g&&g.isFile(),e=f?g.getFileSyntax().mode:"",h=f&&(e=="text/javascript"||e=="text/html"),b=f?$(tabs.index[g.Id]).data("code"):false,j=b&&g.isWritable()?b.changed:false,a=b?b.canUndo():false,i=b?b.canRedo():false,d={save:{enabled:j,click:j?AppCurrentProjectSaveFile:0},saveall:{enabled:f,click:f?AppSaveAllOpenFiles:0},undo:{enabled:a,click:a?App.CurrentFileUndo:0},redo:{enabled:i,click:i?App.CurrentFileRedo:0},preview:{enabled:c==3||h,click:App.Preview}};if(h){jsconsole.show()}else{jsconsole.hide()}build_menu(d)}function build_menu(a){for(var b in a){if(a[b].enabled){$(".menu li.action-"+b).each(function(){$(this).removeClass("disabled").find("a:first, button:first").removeClass("disabled").removeAttr("disabled").off("click").on("click",(typeof a[b].click==="function")?a[b].click:function(){})})}else{if(a[b].enabled==false){$(".menu li.action-"+b).each(function(){$(this).addClass("disabled").find("a:first, button:first").addClass("disabled").attr("disabled","disabled").off("click")})}}}}var ProjectTree;function loadTree(a){jQuery.jstree._fn.show_contextmenu_orig=jQuery.jstree._fn.show_contextmenu;jQuery.jstree._fn.show_contextmenu=function(e,b,f){e=this._get_node(e);var c=this._get_settings().contextmenu;var d=new IdPath(e.attr("id"));if(d.isFile()){c.items=ProjectTree.menus.file}else{if(d.isDirectory()){c.items=ProjectTree.menus.directory}else{if(d.isRoot()){ProjectTree.menus.project.settings.label=d.isWritable()?"Settings":"View Details";c.items=ProjectTree.menus.project}else{if(d.isContentContainer()){c.items=ProjectTree.menus.staticDirectory}else{if(d.isReference()){c.items=ProjectTree.menus.referenceNode}else{if(d.isReferenceContainer()){c.items=ProjectTree.menus.referenceFolder}else{if(d.isLibraryContainer()){c.items=ProjectTree.menus.libraryFolder}else{return false}}}}}}}this.show_contextmenu_orig(e,b,f)};jQuery.jstree._fn.dnd_finish_orig=jQuery.jstree._fn.dnd_finish;jQuery.jstree._fn.dnd_finish=function(j){var c=this._get_move();var f=c.o;if(typeof f==="undefined"){return false}var h=f.attr("id"),d=new IdPath(h),g=c.np,i=g.attr("id"),b=new IdPath(i);if(i!=c.op.attr("id")){if(!d.isWritable()){AlertDialog("Error","Invalid Move: You do not have write access to this item.");return false}if(!b.isWritable()){AlertDialog("Error","Invalid Move: You do not have write access to the destination.");return false}h=d.setRealName(ProjectTree.GetNodeText(f)).Id;compilr.currentProject.moveFile(h,i,function(k){if(k.s){h=d.sanitize();var e=d.moveThisToPath(i);f.attr("id",e);if(d.isFile()){tabs.updateTabId(h,e)}else{var m=h.length;var l=f.find('li[id^="'+h+'"]');l.each(function(){var n=e+this.id.substr(m);tabs.updateTabId(this.id,n);this.id=n})}ProjectTree.jstree("move_node",f,g,"inside",false,false,true)}else{AlertDialog("Error","Error moving file:\n"+k.m)}})}else{this.dnd_finish_orig(j)}};ProjectTree=$("#east-tabs div.project-file-tree").jstree({core:{animation:0},json_data:{data:a},crrm:{move:{check_move:function(b){if(b.p=="inside"){var d=new IdPath(b.o.attr("id"));if(!d.isWritable()){b.cy=true}if(!(d.isFile()||d.isDirectory())){return false}var c=new IdPath(b.np.attr("id"));if(c.isWritable()&&c.canHoldFiles()){return true}}return false}}},plugins:mobile?["themes","json_data","crrm","ui"]:["themes","json_data","crrm","dnd","ui","contextmenu"]});ProjectTree.DoubleClickTimeout=700;ProjectTree.NewSelection=false;ProjectTree.FirstClick=false;ProjectTree.SecondClick=false;ProjectTree.GetNodeText=function(b){return $(b).children("a").contents().filter(function(){return this.nodeType==3})[0].nodeValue},ProjectTree.OpenNode=function(c,b){if(b.isFile()){tabs.loadFile(b.Id,ProjectTree.GetNodeText(c),$(c).children("a").children("ins").attr("class"))}else{if(b.isReference()){tabs.loadMSDN(b)}else{if(b.isDirectory()||b.isContainer()||b.isRoot()){$(".jstree").jstree("toggle_node",$(c))}else{alert("Sorry you have an unknown object in your file tree and we don't know what to do when you click it.")}}}};ProjectTree.ClickTimeout=function(){var c=ProjectTree.ClickResult,b=new IdPath(c.id);if(ProjectTree.FirstClick&&ProjectTree.SecondClick&&(ProjectTree.SecondClick-ProjectTree.FirstClick)<=ProjectTree.DoubleClickTimeout){ProjectTree.OpenNode(c,b)}else{if(!(ProjectTree.NewSelection&&!ProjectTree.SecondClick)&&(b.isFile()||b.isDirectory())){ProjectTree.OldName=$.trim($(c).children("a").text());ProjectTree.jstree("rename",c)}}ProjectTree.NewSelection=false;ProjectTree.FirstClick=false;ProjectTree.SecondClick=false};ProjectTree.bind("select_node.jstree",function(c,d){var f=new Date().getTime();if(ProjectTree.FirstClick&&(f-ProjectTree.FirstClick)>=ProjectTree.DoubleClickTimeout*2){ProjectTree.NewSelection=false;ProjectTree.FirstClick=false;ProjectTree.SecondClick=false}if(!ProjectTree.NewSelection){ProjectTree.NewSelection=(ProjectTree.ClickResult!==d.rslt.obj[0]);if(ProjectTree.NewSelection&&typeof(ProjectTree.ClickResult)!=="undefined"){$(ProjectTree.ClickResult).children("input").blur()}}var e=ProjectTree.ClickResult!=d.rslt.obj[0];ProjectTree.ClickResult=d.rslt.obj[0];var b=(new IdPath(ProjectTree.ClickResult.id)).getProjectId();if(b!=compilr.currentProject.id){$(window).trigger("compilr.projectChanged",b)}if(!ProjectTree.FirstClick){ProjectTree.FirstClick=f;window.setTimeout(ProjectTree.ClickTimeout,ProjectTree.DoubleClickTimeout)}else{if(!ProjectTree.SecondClick&&!e){ProjectTree.SecondClick=f}}});ProjectTree.bind("rename_node.jstree",function(b,c){var e=c.rslt.obj;var d=$.trim(c.rslt.name);App.RenameNode(e,d)});ProjectTree.menus={file:{rename:{label:"Rename",action:function(b){ProjectTree.OldName=$.trim(b.children("a").text());ProjectTree.jstree("rename",b)},_disabled:false,_class:"class",separator_before:false,separator_after:false,icon:false},deleteitem:{label:"Delete",action:function(b){AppDeleteProjectFiles(b)},_disabled:false,_class:"class",separator_before:false,separator_after:false,icon:false}},staticDirectory:{newFolder:{label:"New Folder",action:function(b){App.NewFolder(b.attr("id"))},_disabled:false,_class:"class",separator_before:false,separator_after:false,icon:false},newFile:{label:"New File",action:function(b){App.NewFile(b.attr("id"))},_disabled:false,_class:"class",separator_before:false,separator_after:false,icon:false}},project:{settings:{label:"Settings",action:function(b){tabs.loadProjectSettings(new IdPath(b.attr("id")))},_disabled:false,_class:"class",separator_before:false,separator_after:false,icon:false}},directory:{},referenceFolder:{edit:{label:"Edit",action:function(b){App.EditProjectReferences(new IdPath(b.attr("id")).getProjectId())},_disabled:false,_class:"class",separator_before:false,separator_after:false,icon:false}},referenceNode:{},libraryFolder:{upload:{label:"Upload Libraries",action:function(b){AppCurrentProjectImportFiles(b.attr("id"))},_disabled:false,_class:"class",separator_before:false,separator_after:false,icon:false}}};$.extend(true,ProjectTree.menus.project,ProjectTree.menus.staticDirectory);$.extend(true,ProjectTree.menus.directory,ProjectTree.menus.staticDirectory);$.extend(true,ProjectTree.menus.directory,ProjectTree.menus.file);$.extend(true,ProjectTree.menus.referenceNode,ProjectTree.menus.referenceFolder)};
