From 421d469ec0f077252edbdf9e552e0422634c72d3 Mon Sep 17 00:00:00 2001 From: harris wong Date: Tue, 13 Sep 2011 17:27:29 +0000 Subject: [PATCH] 4837: Upgraded infusion library to 1.4 as of Sep 13, 2011. --- docs/jscripts/infusion/InfusionAll.js | 4 +- .../uiOptions/css/FatPanelUIOptionsFrame.css | 5 +-- .../uiOptions/css/FullNoPreviewUIOptions.css | 4 +- .../uiOptions/css/FullPreviewUIOptions.css | 4 +- .../uiOptions/css/FullUIOptions.css | 12 +++--- .../components/uiOptions/css/UIOptions.css | 14 +++---- .../uiOptions/css/fss/fss-theme-bw-uio.css | 16 +++---- .../uiOptions/css/fss/fss-theme-by-uio.css | 16 +++---- .../uiOptions/css/fss/fss-theme-coal-uio.css | 42 ++++++++++--------- .../uiOptions/css/fss/fss-theme-mist-uio.css | 38 +++++++++-------- .../uiOptions/css/fss/fss-theme-rust-uio.css | 3 +- .../uiOptions/css/fss/fss-theme-slate-uio.css | 38 +++++++++-------- .../uiOptions/css/fss/fss-theme-wb-uio.css | 16 +++---- .../uiOptions/css/fss/fss-theme-yb-uio.css | 16 +++---- .../html/FatPanelUIOptionsFrame.html | 8 +--- .../html/UIOptionsTemplate-layout.html | 4 +- .../html/UIOptionsTemplate-links.html | 6 +-- .../uiOptions/js/FatPanelUIOptions.js | 2 +- .../uiOptions/js/FullNoPreviewUIOptions.js | 2 +- .../uiOptions/js/FullPreviewUIOptions.js | 2 +- .../components/uiOptions/js/UIEnhancer.js | 2 +- .../components/uiOptions/js/UIOptions.js | 2 +- .../components/uploader/html/Uploader.html | 2 +- .../infusion/framework/core/js/FluidIoC.js | 2 +- .../framework/fss/css/fss-reset-context.css | 3 +- .../framework/fss/css/fss-reset-global.css | 3 +- .../framework/fss/css/fss-theme-bw.css | 2 +- .../framework/fss/css/fss-theme-by.css | 2 +- .../framework/fss/css/fss-theme-coal.css | 2 +- .../framework/fss/css/fss-theme-mist.css | 2 +- .../framework/fss/css/fss-theme-slate.css | 2 +- .../framework/fss/css/fss-theme-wb.css | 2 +- .../framework/fss/css/fss-theme-yb.css | 2 +- 33 files changed, 140 insertions(+), 140 deletions(-) diff --git a/docs/jscripts/infusion/InfusionAll.js b/docs/jscripts/infusion/InfusionAll.js index d416c4782..f42284997 100644 --- a/docs/jscripts/infusion/InfusionAll.js +++ b/docs/jscripts/infusion/InfusionAll.js @@ -59,7 +59,7 @@ * For information on copyright, see the individual Infusion source code files: * https://github.com/fluid-project/infusion/ */ -var fluid_1_4=fluid_1_4||{};var fluid=fluid||fluid_1_4;(function($,fluid){fluid.version="Infusion 1.3";fluid.environment={fluid:fluid};var globalObject=window||{};var softFailure=[false];fluid.describeActivity=function(){return[]};fluid.fail=function(message){fluid.setLogging(true);fluid.log.apply(null,["ASSERTION FAILED: "].concat(fluid.makeArray(arguments)).concat(fluid.describeActivity()));if(softFailure[0]){throw new Error(message)}else{message.fail()}};fluid.pushSoftFailure=function(condition){if(typeof (condition)==="boolean"){softFailure.unshift(condition)}else{if(condition===-1){softFailure.shift()}}};fluid.notrycatch=false;fluid.tryCatch=function(tryfun,catchfun,finallyfun){finallyfun=finallyfun||fluid.identity;if(fluid.notrycatch){var togo=tryfun();finallyfun();return togo}else{try{return tryfun()}catch(e){if(catchfun){catchfun(e)}else{throw (e)}}finally{finallyfun()}}};fluid.expect=function(name,members,target){fluid.transform(fluid.makeArray(members),function(key){if(typeof target[key]==="undefined"){fluid.fail(name+" missing required parameter "+key)}})};var logging;fluid.isLogging=function(){return logging};fluid.setLogging=function(enabled){if(typeof enabled==="boolean"){logging=enabled}else{logging=false}};fluid.applyHostFunction=function(obj,func,args){if(func.apply){func.apply(obj,args)}else{var applier=Function.prototype.bind.call(func,obj);applier.apply(obj,args)}};fluid.log=function(message){if(logging){var arg0=fluid.renderTimestamp(new Date())+": ";var args=[arg0].concat(fluid.makeArray(arguments));var str=args.join("");if(typeof (console)!=="undefined"){if(console.debug){fluid.applyHostFunction(console,console.debug,args)}else{if(typeof (console.log)==="function"){fluid.applyHostFunction(console,console.log,args)}else{console.log(str)}}}else{if(typeof (YAHOO)!=="undefined"){YAHOO.log(str)}else{if(typeof (opera)!=="undefined"){opera.postError(str)}}}}};fluid.wrap=function(obj){return((!obj||obj.jquery)?obj:$(obj))};fluid.unwrap=function(obj){return obj&&obj.jquery&&obj.length===1?obj[0]:obj};fluid.identity=function(arg){return arg};fluid.isValue=function(value){return value!==undefined&&value!==null};fluid.isPrimitive=function(value){var valueType=typeof (value);return !value||valueType==="string"||valueType==="boolean"||valueType==="number"||valueType==="function"};fluid.isDOMNode=function(obj){return obj&&typeof (obj.nodeType)==="number"};fluid.isArrayable=function(totest){return totest&&!fluid.isPrimitive(totest)&&typeof (totest.length)==="number"};fluid.freshContainer=function(tocopy){return fluid.isArrayable(tocopy)?[]:{}};fluid.copy=function(tocopy){if(fluid.isPrimitive(tocopy)){return tocopy}return $.extend(true,fluid.freshContainer(tocopy),tocopy)};fluid.makeArray=function(arg){if(arg===null||arg===undefined){return[]}else{return $.makeArray(arg)}};function transformInternal(source,togo,key,args){var transit=source[key];for(var j=0;j=0;--i){if(extraArgs[i]&&extraArgs[i].transformOptions){return extraArgs[i].transformOptions}}};fluid.mergeComponentOptions=function(that,componentName,userOptions,localOptions){var defaults=fluid.defaults(componentName);var mergePolicy=$.extend({},fluid.rootMergePolicy,defaults?defaults.mergePolicy:{});var defaultGrades=defaults&&defaults.gradeNames;var mergeArgs;if(!defaultGrades){defaults=fluid.censorKeys(defaults,fluid.keys(fluid.lifecycleFunctions));mergeArgs=[mergePolicy,localOptions]}else{mergeArgs=[mergePolicy]}var extraArgs;if(fluid.expandComponentOptions){extraArgs=fluid.expandComponentOptions(defaults,userOptions,that)}else{extraArgs=[defaults,userOptions]}var transRec=fluid.lastTransformationRecord(extraArgs);if(transRec){extraArgs=fluid.transformOptions(extraArgs,transRec)}mergeArgs=mergeArgs.concat(extraArgs);that.options=fluid.merge.apply(null,mergeArgs)};fluid.COMPONENT_OPTIONS={type:"fluid.marker",value:"COMPONENT_OPTIONS"};fluid.emptySubcomponent=function(options){var that={};options=$.makeArray(options);var empty=function(){};for(var i=0;i1?"More than one ("+count+") container elements were":"No container element was")+" found for selector "+containerSpec)}if(!fluid.isDOMNode(container[0])){fluid.fail("fluid.container was supplied a non-jQueryable element")}return container};fluid.createDomBinder=function(container,selectors){var cache={},that={};function cacheKey(name,thisContainer){return fluid.allocateSimpleId(thisContainer)+"-"+name}function record(name,thisContainer,result){cache[cacheKey(name,thisContainer)]=result}that.locate=function(name,localContainer){var selector,thisContainer,togo;selector=selectors[name];thisContainer=localContainer?localContainer:container;if(!thisContainer){fluid.fail("DOM binder invoked for selector "+name+" without container")}if(!selector){return thisContainer}if(typeof (selector)==="function"){togo=$(selector.call(null,fluid.unwrap(thisContainer)))}else{togo=$(selector,thisContainer)}if(togo.get(0)===document){togo=[]}if(!togo.selector){togo.selector=selector;togo.context=thisContainer}togo.selectorName=name;record(name,thisContainer,togo);return togo};that.fastLocate=function(name,localContainer){var thisContainer=localContainer?localContainer:container;var key=cacheKey(name,thisContainer);var togo=cache[key];return togo?togo:that.locate(name,localContainer)};that.clear=function(){cache={}};that.refresh=function(names,localContainer){var thisContainer=localContainer?localContainer:container;if(typeof names==="string"){names=[names]}if(thisContainer.length===undefined){thisContainer=[thisContainer]}for(var i=0;i=0&¤tNode.depth1){node=node[0];multiple=true}if("input"!==node.nodeName.toLowerCase()||!/radio|checkbox/.test(node.type)){return newValue===undefined?$(node).val():$(node).val(newValue)}var name=node.name;if(name===undefined){fluid.fail("Cannot acquire value from node "+fluid.dumpEl(node)+" which does not have name attribute set")}var elements;if(multiple){elements=nodeIn}else{elements=document.getElementsByName(name);var scope=fluid.findForm(node);elements=$.grep(elements,function(element){if(element.name!==name){return false}return !scope||fluid.dom.isContainer(scope,element)})}if(newValue!==undefined){if(typeof (newValue)==="boolean"){newValue=(newValue?"true":"false")}$.each(elements,function(){this.checked=(newValue instanceof Array?$.inArray(this.value,newValue)!==-1:newValue===this.value)})}else{var checked=$.map(elements,function(element){return element.checked?element.value:null});return node.type==="radio"?checked[0]:checked}};fluid.applyChange=function(node,newValue,applier){node=fluid.unwrap(node);if(newValue===undefined){newValue=fluid.value(node)}if(node.nodeType===undefined&&node.length>0){node=node[0]}var root=fluid.findData(node,fluid.BINDING_ROOT_KEY);if(!root){fluid.fail("Bound data could not be discovered in any node above "+fluid.dumpEl(node))}var name=node.name;var fossil=root.fossils[name];if(!fossil){fluid.fail("No fossil discovered for name "+name+" in fossil record above "+fluid.dumpEl(node))}if(typeof (fossil.oldvalue)==="boolean"){newValue=newValue[0]?true:false}var EL=root.fossils[name].EL;if(applier){applier.fireChangeRequest({path:EL,value:newValue,source:node.id})}else{fluid.set(root.data,EL,newValue)}};fluid.pathUtil={};var getPathSegmentImpl=function(accept,path,i){var segment=null;if(accept){segment=""}var escaped=false;var limit=path.length;for(;i0){var ation=that.initiate();ation.fireChangeRequest(changeRequest,guardFireSpec);ation.commit()}else{if(!defeatGuards){var prevent=fireFromSpec("guards",guardFireSpec,[model,changeRequest,bareApplier],"listeners");if(prevent===false){return false}}var oldModel=model;if(!options.thin){oldModel={};fluid.model.copyModel(oldModel,model)}fluid.model.applyChangeRequest(model,changeRequest,options.resolverSetConfig);fireEvent("modelChanged",changeRequest.path,[model,oldModel,[changeRequest]])}};bindRequestChange(that);function fireAgglomerated(eventName,formName,changes,args,accpos){var fireSpec=makeFireSpec();for(var i=0;i=elements.length){sc_that.activeItemIndex=0}if(sc_that.activeItemIndex<0&&sc_that.activeItemIndex!==NO_SELECTION){sc_that.activeItemIndex=elements.length-1}if(sc_that.activeItemIndex>=0){fluid.focus(elements[sc_that.activeItemIndex])}};var prepareShift=function(selectionContext){var selElm=selectionContext.selectedElement();if(selElm){fluid.blur(selElm)}unselectElement(selectionContext.selectedElement(),selectionContext);if(selectionContext.activeItemIndex===NO_SELECTION){selectionContext.activeItemIndex=-1}};var focusNextElement=function(selectionContext){prepareShift(selectionContext);++selectionContext.activeItemIndex;reifyIndex(selectionContext)};var focusPreviousElement=function(selectionContext){prepareShift(selectionContext);--selectionContext.activeItemIndex;reifyIndex(selectionContext)};var arrowKeyHandler=function(selectionContext,keyMap,userHandlers){return function(evt){if(evt.which===keyMap.next){focusNextElement(selectionContext);evt.preventDefault()}else{if(evt.which===keyMap.previous){focusPreviousElement(selectionContext);evt.preventDefault()}}}};var getKeyMapForDirection=function(direction){var keyMap;if(direction===fluid.a11y.orientation.HORIZONTAL){keyMap=LEFT_RIGHT_KEYMAP}else{if(direction===fluid.a11y.orientation.VERTICAL){keyMap=UP_DOWN_KEYMAP}}return keyMap};var tabKeyHandler=function(selectionContext){return function(evt){if(evt.which!==$.ui.keyCode.TAB){return }cleanUpWhenLeavingContainer(selectionContext);if(evt.shiftKey){selectionContext.focusIsLeavingContainer=true}}};var containerFocusHandler=function(selectionContext){return function(evt){var shouldOrig=selectionContext.options.autoSelectFirstItem;var shouldSelect=typeof (shouldOrig)==="function"?shouldOrig():shouldOrig;if(selectionContext.focusIsLeavingContainer){shouldSelect=false}if(shouldSelect&&evt.target===selectionContext.container.get(0)){if(selectionContext.activeItemIndex===NO_SELECTION){selectionContext.activeItemIndex=0}fluid.focus(selectionContext.selectables[selectionContext.activeItemIndex])}return evt.stopPropagation()}};var containerBlurHandler=function(selectionContext){return function(evt){selectionContext.focusIsLeavingContainer=false;return evt.stopPropagation()}};var makeElementsSelectable=function(container,defaults,userOptions){var options=$.extend(true,{},defaults,userOptions);var keyMap=getKeyMapForDirection(options.direction);var selectableElements=options.selectableElements?options.selectableElements:container.find(options.selectableSelector);var that={container:container,activeItemIndex:NO_SELECTION,selectables:selectableElements,focusIsLeavingContainer:false,options:options};that.selectablesUpdated=function(focusedItem){if(typeof (that.options.selectablesTabindex)==="number"){that.selectables.fluid("tabindex",that.options.selectablesTabindex)}that.selectables.unbind("focus."+CONTEXT_KEY);that.selectables.unbind("blur."+CONTEXT_KEY);that.selectables.bind("focus."+CONTEXT_KEY,selectableFocusHandler(that));that.selectables.bind("blur."+CONTEXT_KEY,selectableBlurHandler(that));if(keyMap&&that.options.noBubbleListeners){that.selectables.unbind("keydown."+CONTEXT_KEY);that.selectables.bind("keydown."+CONTEXT_KEY,arrowKeyHandler(that,keyMap))}if(focusedItem){selectElement(focusedItem,that)}else{reifyIndex(that)}};that.refresh=function(){if(!that.options.selectableSelector){throw ("Cannot refresh selectable context which was not initialised by a selector")}that.selectables=container.find(options.selectableSelector);that.selectablesUpdated()};that.selectedElement=function(){return that.activeItemIndex<0?null:that.selectables[that.activeItemIndex]};if(keyMap&&!that.options.noBubbleListeners){container.keydown(arrowKeyHandler(that,keyMap))}container.keydown(tabKeyHandler(that));container.focus(containerFocusHandler(that));container.blur(containerBlurHandler(that));that.selectablesUpdated();return that};fluid.selectable=function(target,options){target=$(target);var that=makeElementsSelectable(target,fluid.selectable.defaults,options);fluid.setScopedData(target,CONTEXT_KEY,that);return that};fluid.selectable.select=function(target,toSelect){fluid.focus(toSelect)};fluid.selectable.selectNext=function(target){target=$(target);focusNextElement(fluid.getScopedData(target,CONTEXT_KEY))};fluid.selectable.selectPrevious=function(target){target=$(target);focusPreviousElement(fluid.getScopedData(target,CONTEXT_KEY))};fluid.selectable.currentSelection=function(target){target=$(target);var that=fluid.getScopedData(target,CONTEXT_KEY);return $(that.selectedElement())};fluid.selectable.defaults={direction:fluid.a11y.orientation.VERTICAL,selectablesTabindex:-1,autoSelectFirstItem:true,rememberSelectionState:true,selectableSelector:".selectable",selectableElements:null,onSelect:null,onUnselect:null,onLeaveContainer:null};var checkForModifier=function(binding,evt){if(!binding.modifier){return true}var modifierKey=binding.modifier;var isCtrlKeyPresent=modifierKey&&evt.ctrlKey;var isAltKeyPresent=modifierKey&&evt.altKey;var isShiftKeyPresent=modifierKey&&evt.shiftKey;return isCtrlKeyPresent||isAltKeyPresent||isShiftKeyPresent};var makeActivationHandler=function(binding){return function(evt){var target=evt.target;if(!fluid.enabled(evt.target)){return }var code=evt.which?evt.which:evt.keyCode;if(code===binding.key&&binding.activateHandler&&checkForModifier(binding,evt)){var event=$.Event("fluid-activate");$(evt.target).trigger(event,[binding.activateHandler]);if(event.isDefaultPrevented()){evt.preventDefault()}}}};var makeElementsActivatable=function(elements,onActivateHandler,defaultKeys,options){var bindings=[];$(defaultKeys).each(function(index,key){bindings.push({modifier:null,key:key,activateHandler:onActivateHandler})});if(options&&options.additionalBindings){bindings=bindings.concat(options.additionalBindings)}fluid.initEnablement(elements);for(var i=0;i',liveRegionId:"fluid-ariaLabeller-liveRegion",invokers:{generateLiveElement:{funcName:"fluid.ariaLabeller.generateLiveElement",args:["{ariaLabeller}"]}}});fluid.ariaLabeller=function(element,options){var that=fluid.initView("fluid.ariaLabeller",element,options);fluid.initDependents(that);that.update=function(newOptions){newOptions=newOptions||that.options;that.container.attr(that.options.labelAttribute,newOptions.text);if(newOptions.dynamicLabel){var live=fluid.jById(that.options.liveRegionId);if(live.length===0){live=that.generateLiveElement()}live.text(newOptions.text)}};that.update();return that};fluid.ariaLabeller.generateLiveElement=function(that){var liveEl=$(that.options.liveRegionMarkup);liveEl.prop("id",that.options.liveRegionId);$("body").append(liveEl);return liveEl};var LABEL_KEY="aria-labelling";fluid.getAriaLabeller=function(element){element=$(element);var that=fluid.getScopedData(element,LABEL_KEY);return that};fluid.updateAriaLabel=function(element,text,options){options=$.extend({},options||{},{text:text});var that=fluid.getAriaLabeller(element);if(!that){that=fluid.ariaLabeller(element,options);fluid.setScopedData(element,LABEL_KEY,that)}else{that.update(options)}return that};fluid.deadMansBlur=function(control,options){var that=fluid.initLittleComponent("fluid.deadMansBlur",options);that.blurPending=false;that.lastCancel=0;$(control).bind("focusout",function(event){fluid.log("Starting blur timer for element "+fluid.dumpEl(event.target));var now=new Date().getTime();fluid.log("back delay: "+(now-that.lastCancel));if(now-that.lastCancel>that.options.backDelay){that.blurPending=true}setTimeout(function(){if(that.blurPending){that.options.handler(control)}},that.options.delay)});that.canceller=function(event){fluid.log("Cancellation through "+event.type+" on "+fluid.dumpEl(event.target));that.lastCancel=new Date().getTime();that.blurPending=false};fluid.each(that.options.exclusions,function(exclusion){exclusion=$(exclusion);fluid.each(exclusion,function(excludeEl){$(excludeEl).bind("focusin",that.canceller).bind("fluid-focus",that.canceller).click(that.canceller).mousedown(that.canceller)})});return that};fluid.defaults("fluid.deadMansBlur",{delay:150,backDelay:100})})(jQuery,fluid_1_4);var fluid_1_4=fluid_1_4||{};(function($,fluid){var inCreationMarker="__CURRENTLY_IN_CREATION__";fluid.isFireBreak=function(component){return component.options&&component.options["fluid.visitComponents.fireBreak"]};fluid.visitComponentChildren=function(that,visitor,options,up,down){options=options||{};for(var name in that){var component=that[name];if(!component||!component.typeName||(component.id&&options.visited&&options.visited[component.id])){continue}if(options.visited){options.visited[component.id]=true}if(visitor(component,name,options,up,down)){return true}if(!fluid.isFireBreak(component)&&!options.flat){fluid.visitComponentChildren(component,visitor,options,up,down+1)}}};var visitComponents=function(thatStack,visitor,options){options=options||{visited:{},flat:true};var up=0;for(var i=thatStack.length-1;i>=0;--i){var that=thatStack[i];if(fluid.isFireBreak(that)){return }if(that.typeName){options.visited[that.id]=true;if(visitor(that,"",options,0,0)){return }}if(fluid.visitComponentChildren(that,visitor,options,up,1)){return }++up}};function makeGingerStrategy(instantiator,that,thatStack){return function(component,thisSeg){var atval=component[thisSeg];if(atval===undefined){var parentPath=instantiator.idToPath[component.id];atval=instantiator.pathToComponent[fluid.composePath(parentPath,thisSeg)];if(atval){atval[inCreationMarker]=true}}if(atval!==undefined){if(atval[inCreationMarker]){fluid.fail("Component "+fluid.dumpThat(atval)+' at path "'+thisSeg+'" of parent '+fluid.dumpThat(component)+" cannot be used for lookup since it is still in creation. Please reorganise your dependencies so that they no longer contain circular references")}}else{if(fluid.get(component,fluid.path("options","components",thisSeg,"type"))){fluid.initDependent(component,thisSeg);atval=component[thisSeg]}}return atval}}fluid.dumpThat=function(that,instantiator){return'{ typeName: "'+that.typeName+'" id: '+that.id+"}"};fluid.dumpThatStack=function(thatStack,instantiator){var togo=fluid.transform(thatStack,function(that){var path=instantiator.idToPath[that.id];return fluid.dumpThat(that)+(path?(" - path: "+path):"")});return togo.join("\n")};fluid.describeActivity=function(){return fluid.threadLocal().activityStack||[]};fluid.pushActivity=function(func,message){if(!message){return func()}var root=fluid.threadLocal();if(!root.activityStack){root.activityStack=[]}var frames=fluid.makeArray(message);frames.push("\n");frames.unshift("\n");root.activityStack=frames.concat(root.activityStack);return fluid.tryCatch(func,null,function(){root.activityStack=root.activityStack.slice(frames.length)})};fluid.wrapActivity=function(func,messageSpec){return function(){var args=fluid.makeArray(arguments);var message=fluid.transform(fluid.makeArray(messageSpec),function(specEl){if(specEl.indexOf("arguments.")===0){var el=specEl.substring("arguments.".length);return fluid.get(args,el)}else{return specEl}});return fluid.pushActivity(function(){return func.apply(null,args)},message)}};var localRecordExpected=/arguments|options|container/;function makeStackFetcher(instantiator,parentThat,localRecord,expandOptions){expandOptions=expandOptions||{};var thatStack=instantiator.getFullStack(parentThat);var fetchStrategies=[fluid.model.funcResolverStrategy,makeGingerStrategy(instantiator,parentThat,thatStack)];var fetcher=function(parsed){var context=parsed.context;if(localRecord&&localRecordExpected.test(context)){var fetched=fluid.get(localRecord[context],parsed.path);return(context==="arguments"||expandOptions.direct)?fetched:{marker:context==="options"?fluid.EXPAND:fluid.EXPAND_NOW,value:fetched}}var foundComponent;visitComponents(thatStack,function(component,name,options,up,down){if(context===name||context===component.typeName||context===component.nickName){foundComponent=component;if(down>1){fluid.log("***WARNING: value resolution for context "+context+" found at depth "+down+": this may not be supported in future")}return true}if(fluid.get(component,fluid.path("options","components",context,"type"))&&!component[context]){foundComponent=fluid.get(component,context,{strategies:fetchStrategies});return true}});if(!foundComponent&&parsed.path!==""){var ref=fluid.renderContextReference(parsed);fluid.log("Failed to resolve reference "+ref+": thatStack contains\n"+fluid.dumpThatStack(thatStack,instantiator));fluid.fail("Failed to resolve reference "+ref+" - could not match context with name "+context+" from component root of type "+thatStack[0].typeName)}return fluid.get(foundComponent,parsed.path,fetchStrategies)};return fetcher}function makeStackResolverOptions(instantiator,parentThat,localRecord,expandOptions){return $.extend({},fluid.defaults("fluid.resolveEnvironment"),{fetcher:makeStackFetcher(instantiator,parentThat,localRecord,expandOptions)})}fluid.instantiator=function(freeInstantiator){var preThat={options:{"fluid.visitComponents.fireBreak":true},idToPath:{},pathToComponent:{},stackCount:0,nickName:"instantiator"};var that=fluid.typeTag("fluid.instantiator");that=$.extend(that,preThat);that.stack=function(count){return that.stackCount+=count};that.getThatStack=function(component){var path=that.idToPath[component.id]||"";var parsed=fluid.model.parseEL(path);var togo=fluid.transform(parsed,function(value,i){var parentPath=fluid.model.composeSegments.apply(null,parsed.slice(0,i+1));return that.pathToComponent[parentPath]});var root=that.pathToComponent[""];if(root){togo.unshift(root)}return togo};that.getEnvironmentalStack=function(){var togo=[fluid.staticEnvironment];if(!freeInstantiator){togo.push(fluid.threadLocal())}return togo};that.getFullStack=function(component){var thatStack=component?that.getThatStack(component):[];return that.getEnvironmentalStack().concat(thatStack)};function recordComponent(component,path){that.idToPath[component.id]=path;if(that.pathToComponent[path]){fluid.fail("Error during instantiation - path "+path+" which has just created component "+fluid.dumpThat(component)+" has already been used for component "+fluid.dumpThat(that.pathToComponent[path])+" - this is a circular instantiation or other oversight. Please clear the component using instantiator.clearComponent() before reusing the path.")}that.pathToComponent[path]=component}that.recordRoot=function(component){if(component&&component.id&&!that.pathToComponent[""]){recordComponent(component,"")}};that.pushUpcomingInstantiation=function(parent,name){that.expectedParent=parent;that.expectedName=name};that.recordComponent=function(component){if(that.expectedName){that.recordKnownComponent(that.expectedParent,component,that.expectedName);delete that.expectedName;delete that.expectedParent}else{that.recordRoot(component)}};that.clearComponent=function(component,name,child,options,noModTree){options=options||{visited:{},flat:true};child=child||component[name];fluid.visitComponentChildren(child,function(gchild,gchildname){that.clearComponent(child,gchildname,null,options,noModTree)},options);var path=that.idToPath[child.id];delete that.idToPath[child.id];delete that.pathToComponent[path];if(!noModTree){delete component[name]}};that.recordKnownComponent=function(parent,component,name){var parentPath=that.idToPath[parent.id]||"";var path=fluid.model.composePath(parentPath,name);recordComponent(component,path)};return that};fluid.freeInstantiator=fluid.instantiator(true);fluid.argMapToDemands=function(argMap){var togo=[];fluid.each(argMap,function(value,key){togo[value]="{"+key+"}"});return togo};fluid.makePassArgsSpec=function(initArgs){return fluid.transform(initArgs,function(arg,index){return"{arguments}."+index})};function mergeToMergeAll(options){if(options&&options.mergeOptions){options.mergeAllOptions=["{options}"].concat(fluid.makeArray(options.mergeOptions))}}function upgradeMergeOptions(demandspec){mergeToMergeAll(demandspec);if(demandspec.mergeAllOptions){if(demandspec.options){fluid.fail("demandspec ",demandspec," is invalid - cannot specify literal options together with mergeOptions or mergeAllOptions")}demandspec.options={mergeAllOptions:demandspec.mergeAllOptions}}if(demandspec.options){delete demandspec.options.mergeOptions}}fluid.embodyDemands=function(instantiator,parentThat,demandspec,initArgs,options){options=options||{};upgradeMergeOptions(demandspec);var oldOptions=fluid.get(options,"componentRecord.options");options.componentRecord=$.extend(true,{},options.componentRecord,fluid.censorKeys(demandspec,["args","funcName","registeredFrom"]));var mergeAllZero=fluid.get(options,"componentRecord.options.mergeAllOptions.0");if(mergeAllZero==="{options}"){fluid.set(options,"componentRecord.options.mergeAllOptions.0",oldOptions)}var demands=$.makeArray(demandspec.args);var upDefaults=fluid.defaults(demandspec.funcName);var argMap=upDefaults?upDefaults.argumentMap:null;var inferMap=false;if(!argMap&&(upDefaults||(options&&options.componentRecord))&&!options.passArgs){inferMap=true;if(demands.length<2){argMap=fluid.rawDefaults("fluid.littleComponent").argumentMap}else{argMap={options:demands.length-1}}}options=options||{};if(demands.length===0){if(options.componentRecord&&argMap){demands=fluid.argMapToDemands(argMap)}else{if(options.passArgs){demands=fluid.makePassArgsSpec(initArgs)}}}var localRecord=$.extend({arguments:initArgs},fluid.censorKeys(options.componentRecord,["type"]));fluid.each(argMap,function(index,name){if(initArgs.length>0){localRecord[name]=localRecord.arguments[index]}if(demandspec[name]!==undefined&&localRecord[name]===undefined){localRecord[name]=demandspec[name]}});mergeToMergeAll(localRecord.options);mergeToMergeAll(argMap&&demands[argMap.options]);var upstreamLocalRecord=$.extend({},localRecord);if(options.componentRecord.options!==undefined){upstreamLocalRecord.options=options.componentRecord.options}var expandOptions=makeStackResolverOptions(instantiator,parentThat,localRecord);var args=[];if(demands){for(var i=0;i",iB);if(iE==-1){return fluid.XMLP._setErr(that,fluid.XMLP.ERR_CLOSE_CDATA)}fluid.XMLP._setContent(that,fluid.XMLP._CONT_XML,iB,iE);that.m_iP=iE+3;return fluid.XMLP._CDATA};fluid.XMLP._parseComment=function(that,iB){var iE=that.m_xml.indexOf("-->",iB);if(iE==-1){return fluid.XMLP._setErr(that,fluid.XMLP.ERR_CLOSE_COMMENT)}fluid.XMLP._setContent(that,fluid.XMLP._CONT_XML,iB-4,iE+3);that.m_iP=iE+3;return fluid.XMLP._COMMENT};fluid.XMLP._parseDTD=function(that,iB){var iE,strClose,iInt,iLast;iE=that.m_xml.indexOf(">",iB);if(iE==-1){return fluid.XMLP._setErr(that,fluid.XMLP.ERR_CLOSE_DTD)}iInt=that.m_xml.indexOf("[",iB);strClose=((iInt!=-1)&&(iInt":">";while(true){if(iE==iLast){return fluid.XMLP._setErr(that,fluid.XMLP.ERR_INFINITELOOP)}iLast=iE;iE=that.m_xml.indexOf(strClose,iB);if(iE==-1){return fluid.XMLP._setErr(that,fluid.XMLP.ERR_CLOSE_DTD)}if(that.m_xml.substring(iE-1,iE+2)!="]]>"){break}}that.m_iP=iE+strClose.length;return fluid.XMLP._DTD};fluid.XMLP._parsePI=function(that,iB){var iE,iTB,iTE,iCB,iCE;iE=that.m_xml.indexOf("?>",iB);if(iE==-1){return fluid.XMLP._setErr(that,fluid.XMLP.ERR_CLOSE_PI)}iTB=fluid.SAXStrings.indexOfNonWhitespace(that.m_xml,iB,iE);if(iTB==-1){return fluid.XMLP._setErr(that,fluid.XMLP.ERR_PI_TARGET)}iTE=fluid.SAXStrings.indexOfWhitespace(that.m_xml,iTB,iE);if(iTE==-1){iTE=iE}iCB=fluid.SAXStrings.indexOfNonWhitespace(that.m_xml,iTE,iE);if(iCB==-1){iCB=iE}iCE=fluid.SAXStrings.lastIndexOfNonWhitespace(that.m_xml,iCB,iE);if(iCE==-1){iCE=iE-1}that.m_name=that.m_xml.substring(iTB,iTE);fluid.XMLP._setContent(that,fluid.XMLP._CONT_XML,iCB,iCE+1);that.m_iP=iE+2;return fluid.XMLP._PI};fluid.XMLP._parseText=function(that,iB){var iE=that.m_xml.indexOf("<",iB);if(iE==-1){iE=that.m_xml.length}fluid.XMLP._setContent(that,fluid.XMLP._CONT_XML,iB,iE);that.m_iP=iE;return fluid.XMLP._TEXT};fluid.XMLP._setContent=function(that,iSrc){var args=arguments;if(fluid.XMLP._CONT_XML==iSrc){that.m_cAlt=null;that.m_cB=args[2];that.m_cE=args[3]}else{that.m_cAlt=args[2];that.m_cB=0;that.m_cE=args[2].length}that.m_cSrc=iSrc};fluid.XMLP._setErr=function(that,iErr){var strErr=fluid.XMLP._errs[iErr];that.m_cAlt=strErr;that.m_cB=0;that.m_cE=strErr.length;that.m_cSrc=fluid.XMLP._CONT_ALT;return fluid.XMLP._ERROR};fluid.XMLP._parseElement=function(that,iB){var iE,iDE,iRet;var iType,strN,iLast;iDE=iE=that.m_xml.indexOf(">",iB);if(iE==-1){return that._setErr(that,fluid.XMLP.ERR_CLOSE_ELM)}if(that.m_xml.charAt(iB)=="/"){iType=fluid.XMLP._ELM_E;iB++}else{iType=fluid.XMLP._ELM_B}if(that.m_xml.charAt(iE-1)=="/"){if(iType==fluid.XMLP._ELM_E){return fluid.XMLP._setErr(that,fluid.XMLP.ERR_ELM_EMPTY)}iType=fluid.XMLP._ELM_EMP;iDE--}that.nameRegex.lastIndex=iB;var nameMatch=that.nameRegex.exec(that.m_xml);if(!nameMatch){return fluid.XMLP._setErr(that,fluid.XMLP.ERR_ELM_NAME)}strN=nameMatch[1].toLowerCase();if("li"===strN&&iType!==fluid.XMLP._ELM_E&&that.m_stack.length>0&&that.m_stack[that.m_stack.length-1]==="li"&&!that.m_emitSynthetic){that.m_name="li";that.m_emitSynthetic=true;return fluid.XMLP._ELM_E}that.m_attributes={};that.m_cAlt="";if(that.nameRegex.lastIndex]+)/g;that.attrStartRegex=/\s*([\w:_][\w:_\-\.]*)/gm;that.attrValRegex=/\"([^\"]*)\"\s*/gm;that.attrValIERegex=/([^\>\s]+)\s*/gm;that.closeRegex=/\s*<\//g;return that};fluid.SAXStrings={};fluid.SAXStrings.WHITESPACE=" \t\n\r";fluid.SAXStrings.QUOTES="\"'";fluid.SAXStrings.getColumnNumber=function(strD,iP){if(!strD){return -1}iP=iP||strD.length;var arrD=strD.substring(0,iP).split("\n");arrD.length--;var iLinePos=arrD.join("\n").length;return iP-iLinePos};fluid.SAXStrings.getLineNumber=function(strD,iP){if(!strD){return -1}iP=iP||strD.length;return strD.substring(0,iP).split("\n").length};fluid.SAXStrings.indexOfNonWhitespace=function(strD,iB,iE){if(!strD){return -1}iB=iB||0;iE=iE||strD.length;for(var i=iB;i=iB;i--){if(fluid.SAXStrings.WHITESPACE.indexOf(strD.charAt(i))==-1){return i}}return -1};fluid.SAXStrings.replace=function(strD,iB,iE,strF,strR){if(!strD){return""}iB=iB||0;iE=iE||strD.length;return strD.substring(iB,iE).split(strF).join(strR)}})(jQuery,fluid_1_4);fluid_1_4=fluid_1_4||{};(function($,fluid){fluid.parseTemplate=function(template,baseURL,scanStart,cutpoints_in,opts){opts=opts||{};if(!template){fluid.fail("empty template supplied to fluid.parseTemplate")}var t;var parser;var tagstack;var lumpindex=0;var nestingdepth=0;var justended=false;var defstart=-1;var defend=-1;var debugMode=false;var cutpoints=[];var simpleClassCutpoints={};var cutstatus=[];var XMLLump=function(lumpindex,nestingdepth){return{nestingdepth:nestingdepth,lumpindex:lumpindex,parent:t}};function isSimpleClassCutpoint(tree){return tree.length===1&&tree[0].predList.length===1&&tree[0].predList[0].clazz}function init(baseURLin,debugModeIn,cutpointsIn){t.rootlump=XMLLump(0,-1);tagstack=[t.rootlump];lumpindex=0;nestingdepth=0;justended=false;defstart=-1;defend=-1;baseURL=baseURLin;debugMode=debugModeIn;if(cutpointsIn){for(var i=0;i=0;--i){var lump=tagstack[i];if(lump.rsfID!==undefined){return lump}}return t.rootlump}function newLump(){var togo=XMLLump(lumpindex,nestingdepth);if(debugMode){togo.line=parser.getLineNumber();togo.column=parser.getColumnNumber()}t.lumps[lumpindex]=togo;++lumpindex;return togo}function addLump(mmap,ID,lump){var list=mmap[ID];if(!list){list=[];mmap[ID]=list}list[list.length]=lump}function checkContribute(ID,lump){if(ID.indexOf("scr=contribute-")!==-1){var scr=ID.substring("scr=contribute-".length);addLump(t.collectmap,scr,lump)}}function debugLump(lump){return"<"+lump.tagname+">"}function hasCssClass(clazz,totest){if(!totest){return false}return(" "+totest+" ").indexOf(" "+clazz+" ")!==-1}function matchNode(term,headlump,headclazz){if(term.predList){for(var i=0;i0){if(cut.tree[nextterm-1].child&&cutstat[nextterm-1]!==headlump.nestingdepth-1){continue}}var isMatch=matchNode(term,headlump,headclazz);if(isMatch){cutstat[cutstat.length]=headlump.nestingdepth;if(cutstat.length===cut.tree.length){if(togo!==undefined){fluid.fail("Cutpoint specification error - node "+debugLump(headlump)+" has already matched with rsf:id of "+togo)}if(cut.id===undefined||cut.id===null){fluid.fail("Error in cutpoints list - entry at position "+i+" does not have an id set")}togo=cut.id}}}}return togo}function tagEndCut(){if(cutpoints){for(var i=0;i0&&cutstat[cutstat.length-1]===nestingdepth){cutstat.length--}}}}function processTagEnd(){tagEndCut();var endlump=newLump();--nestingdepth;endlump.text="";var oldtop=tagstack[tagstack.length-1];oldtop.close_tag=t.lumps[lumpindex-1];tagstack.length--;justended=true}function processTagStart(isempty,text){++nestingdepth;if(justended){justended=false;var backlump=newLump();backlump.nestingdepth--}if(t.firstdocumentindex===-1){t.firstdocumentindex=lumpindex}var headlump=newLump();var stacktop=tagstack[tagstack.length-1];headlump.uplump=stacktop;var tagname=parser.getName();headlump.tagname=tagname;var attrs=headlump.attributemap=parser.m_attributes;var ID=attrs[fluid.ID_ATTRIBUTE];if(ID===undefined){ID=tagStartCut(headlump)}for(var attrname in attrs){if(ID===undefined){if(/href|src|codebase|action/.test(attrname)){ID="scr=rewrite-url"}else{if(ID===undefined&&/for|headers/.test(attrname)){ID="scr=null"}}}}if(ID){if(ID.charCodeAt(0)===126){ID=ID.substring(1);headlump.elide=true}checkContribute(ID,headlump);headlump.rsfID=ID;var downreg=findTopContainer();if(!downreg.downmap){downreg.downmap={}}while(downreg){if(downreg.downmap){addLump(downreg.downmap,ID,headlump)}downreg=downreg.uplump}addLump(t.globalmap,ID,headlump);var colpos=ID.indexOf(":");if(colpos!==-1){var prefix=ID.substring(0,colpos);if(!stacktop.finallump){stacktop.finallump={}}stacktop.finallump[prefix]=headlump}}headlump.text="<"+tagname+fluid.dumpAttributes(attrs)+(isempty&&!ID?"/>":">");tagstack[tagstack.length]=headlump;if(isempty){if(ID){processTagEnd()}else{--nestingdepth;tagstack.length--}}}function processDefaultTag(){if(defstart!==-1){if(t.firstdocumentindex===-1){t.firstdocumentindex=lumpindex}var text=parser.getContent().substr(defstart,defend-defstart);justended=false;var newlump=newLump();newlump.text=text;defstart=-1}}t=fluid.XMLViewTemplate();init(baseURL,opts.debugMode,cutpoints_in);var idpos=template.indexOf(fluid.ID_ATTRIBUTE);if(scanStart){var brackpos=template.indexOf(">",idpos);parser=fluid.XMLP(template.substring(brackpos+1))}else{parser=fluid.XMLP(template)}parseloop:while(true){var iEvent=parser.next();switch(iEvent){case fluid.XMLP._ELM_B:processDefaultTag();processTagStart(false,"");break;case fluid.XMLP._ELM_E:processDefaultTag();processTagEnd();break;case fluid.XMLP._ELM_EMP:processDefaultTag();processTagStart(true,"");break;case fluid.XMLP._PI:case fluid.XMLP._DTD:defstart=-1;continue;case fluid.XMLP._TEXT:case fluid.XMLP._ENTITY:case fluid.XMLP._CDATA:case fluid.XMLP._COMMENT:if(defstart===-1){defstart=parser.m_cB}defend=parser.m_cE;break;case fluid.XMLP._ERROR:fluid.setLogging(true);var message="Error parsing template: "+parser.m_cAlt+" at line "+parser.getLineNumber();fluid.log(message);fluid.log("Just read: "+parser.m_xml.substring(parser.m_iP-30,parser.m_iP));fluid.log("Still to read: "+parser.m_xml.substring(parser.m_iP,parser.m_iP+30));fluid.fail(message);break parseloop;case fluid.XMLP._NONE:break parseloop}}processDefaultTag();var excess=tagstack.length-1;if(excess){fluid.fail("Error parsing template - unclosed tag(s) of depth "+(excess)+": "+fluid.transform(tagstack.splice(1,excess),function(lump){return debugLump(lump)}).join(", "))}return t};fluid.debugLump=function(lump){var togo=lump.text;togo+=" at ";togo+="lump line "+lump.line+" column "+lump.column+" index "+lump.lumpindex;togo+=lump.parent.href===null?"":" in file "+lump.parent.href;return togo};fluid.ID_ATTRIBUTE="rsf:id";fluid.getPrefix=function(id){var colpos=id.indexOf(":");return colpos===-1?id:id.substring(0,colpos)};fluid.SplitID=function(id){var that={};var colpos=id.indexOf(":");if(colpos===-1){that.prefix=id}else{that.prefix=id.substring(0,colpos);that.suffix=id.substring(colpos+1)}return that};fluid.XMLViewTemplate=function(){return{globalmap:{},collectmap:{},lumps:[],firstdocumentindex:-1}};fluid.XMLEncode=function(text){return text.replace(/&/g,"&").replace(//g,">").replace(/\"/g,""")};fluid.dumpAttributes=function(attrcopy){var togo="";for(var attrname in attrcopy){var attrvalue=attrcopy[attrname];if(attrvalue!==null&&attrvalue!==undefined){togo+=" "+attrname+'="'+attrvalue+'"'}}return togo};fluid.aggregateMMap=function(target,source){for(var key in source){var targhas=target[key];if(!targhas){target[key]=[]}target[key]=target[key].concat(source[key])}};fluid.parseTemplates=function(resourceSpec,templateList,opts){var togo=[];opts=opts||{};togo.globalmap={};for(var i=0;i)?\\s*","g");fluid.parseSelector=function(selstring){var togo=[];selstring=$.trim(selstring);quickClass.lastIndex=0;var lastIndex=0;while(true){var atNode=[];while(true){var segMatch=quickClass.exec(selstring);if(!segMatch||segMatch.index!==lastIndex){break}var thisNode={};var text=segMatch[2];if(segMatch[1]===""){thisNode.tag=text}else{if(segMatch[1]==="#"){thisNode.id=text}else{if(segMatch[1]==="."){thisNode.clazz=text}}}atNode[atNode.length]=thisNode;lastIndex=quickClass.lastIndex}childSeg.lastIndex=lastIndex;var fullAtNode={predList:atNode};var childMatch=childSeg.exec(selstring);if(!childMatch||childMatch.index!==lastIndex){var remainder=selstring.substring(lastIndex);fluid.fail("Error in selector string - can not match child selector expression at "+remainder)}if(childMatch[1]===">"){fullAtNode.child=true}togo[togo.length]=fullAtNode;if(childSeg.lastIndex>=selstring.length){break}lastIndex=childSeg.lastIndex;quickClass.lastIndex=childSeg.lastIndex}return togo}})(jQuery,fluid_1_4);fluid_1_4=fluid_1_4||{};(function($,fluid){function debugPosition(component){return"as child of "+(component.parent.fullID?"component with full ID "+component.parent.fullID:"root")}function computeFullID(component){var togo="";var move=component;if(component.children===undefined){togo=component.ID+(component.localID!==undefined?component.localID:"");move=component.parent}while(move.parent){var parent=move.parent;if(move.fullID!==undefined){togo=move.fullID+togo;return togo}if(move.noID===undefined){var ID=move.ID;if(ID===undefined){fluid.fail("Error in component tree - component found with no ID "+debugPosition(parent)+": please check structure")}var colpos=ID.indexOf(":");var prefix=colpos===-1?ID:ID.substring(0,colpos);togo=prefix+":"+(move.localID===undefined?"":move.localID)+":"+togo}move=parent}return togo}var renderer={};renderer.isBoundPrimitive=function(value){return fluid.isPrimitive(value)||value instanceof Array&&(value.length===0||typeof (value[0])==="string")};var unzipComponent;function processChild(value,key){if(renderer.isBoundPrimitive(value)){return{componentType:"UIBound",value:value,ID:key}}else{var unzip=unzipComponent(value);if(unzip.ID){return{ID:key,componentType:"UIContainer",children:[unzip]}}else{unzip.ID=key;return unzip}}}function fixChildren(children){if(!(children instanceof Array)){var togo=[];for(var key in children){var value=children[key];if(value instanceof Array){for(var i=0;ibasedepth+(closeparent?0:1)){fluid.log("Error in component tree - leaf component found to contain further components - at "+lump.toString())}else{break}}++renderindex}if(!closeparent&&(renderindex===lumps.length||!lumps[renderindex].rsfID)){--renderindex}dumpTillLump(lumps,start,renderindex);return renderindex}function isPlaceholder(value){return false}function isValue(value){return value!==null&&value!==undefined&&!isPlaceholder(value)}var trc={};function openTag(){if(!trc.iselide){out+="<"+trc.uselump.tagname}}function closeTag(){if(!trc.iselide){out+=""}}function renderUnchanged(){dumpTillLump(trc.uselump.parent.lumps,trc.uselump.lumpindex+1,trc.close.lumpindex+(trc.iselide?0:1))}function isSelfClose(){return trc.endopen.lumpindex===trc.close.lumpindex&&fluid.XMLP.closedTags[trc.uselump.tagname]}function dumpTemplateBody(){if(isSelfClose()){if(!trc.iselide){out+="/>"}}else{if(!trc.iselide){out+=">"}dumpTillLump(trc.uselump.parent.lumps,trc.endopen.lumpindex,trc.close.lumpindex+(trc.iselide?0:1))}}function replaceAttributes(){if(!trc.iselide){out+=fluid.dumpAttributes(trc.attrcopy)}dumpTemplateBody()}function replaceAttributesOpen(){if(trc.iselide){replaceAttributes()}else{out+=fluid.dumpAttributes(trc.attrcopy);var selfClose=isSelfClose();out+=selfClose?"/>":">";trc.nextpos=selfClose?trc.close.lumpindex+1:trc.endopen.lumpindex}}function replaceBody(value){out+=fluid.dumpAttributes(trc.attrcopy);if(!trc.iselide){out+=">"}out+=fluid.XMLEncode(value.toString());closeTag()}function rewriteLeaf(value){if(isValue(value)){replaceBody(value)}else{replaceAttributes()}}function rewriteLeafOpen(value){if(trc.iselide){rewriteLeaf(trc.value)}else{if(isValue(value)){replaceBody(value)}else{replaceAttributesOpen()}}}function rewriteUrl(template,url){if(renderOptions.urlRewriter){var rewritten=renderOptions.urlRewriter(url);if(rewritten){return rewritten}}if(!renderOptions.rebaseURLs){return url}var protpos=url.indexOf(":/");if(url.charAt(0)==="/"||protpos!==-1&&protpos<7){return url}else{return renderOptions.baseURL+url}}function dumpHiddenField(todump){out+='\n"}var outDecoratorsImpl;function applyAutoBind(torender,finalID){if(!finalID){return }var tagname=trc.uselump.tagname;var applier=renderOptions.applier;function applyFunc(){fluid.applyChange(fluid.byId(finalID),undefined,applier)}if(renderOptions.autoBind&&/input|select|textarea/.test(tagname)&&!renderedbindings[finalID]){var decorators=[{jQuery:["change",applyFunc]}];if($.browser.msie&&tagname==="input"&&/radio|checkbox/.test(trc.attrcopy.type)){decorators.push({jQuery:["click",applyFunc]})}if($.browser.safari&&tagname==="input"&&trc.attrcopy.type==="radio"){decorators.push({jQuery:["keyup",applyFunc]})}outDecoratorsImpl(torender,decorators,trc.attrcopy,finalID)}}function dumpBoundFields(torender,parent){if(torender){var holder=parent?parent:torender;if(directFossils&&holder.valuebinding){var fossilKey=holder.submittingname||torender.finalID;directFossils[fossilKey]={name:fossilKey,EL:holder.valuebinding,oldvalue:holder.value};applyAutoBind(torender,torender.finalID)}if(torender.fossilizedbinding){dumpHiddenField(torender.fossilizedbinding)}if(torender.fossilizedshaper){dumpHiddenField(torender.fossilizedshaper)}}}function dumpSelectionBindings(uiselect){if(!renderedbindings[uiselect.selection.fullID]){renderedbindings[uiselect.selection.fullID]=true;dumpBoundFields(uiselect.selection);dumpBoundFields(uiselect.optionlist);dumpBoundFields(uiselect.optionnames)}}function isSelectedValue(torender,value){var selection=torender.selection;return selection.value&&typeof (selection.value)!=="string"&&typeof (selection.value.length)==="number"?$.inArray(value,selection.value,value)!==-1:selection.value===value}function getRelativeComponent(component,relativeID){component=component.parent;while(relativeID.indexOf("..::")===0){relativeID=relativeID.substring(4);component=component.parent}return component.childmap[relativeID]}function adjustForID(attrcopy,component,late,forceID){if(!late){delete attrcopy["rsf:id"]}if(component.finalID!==undefined){attrcopy.id=component.finalID}else{if(forceID!==undefined){attrcopy.id=forceID}else{if(attrcopy.id||late){attrcopy.id=component.fullID}}}var count=1;var baseid=attrcopy.id;while(renderOptions.document.getElementById(attrcopy.id)||usedIDs[attrcopy.id]){attrcopy.id=baseid+"-"+(count++)}component.finalID=attrcopy.id;return attrcopy.id}function assignSubmittingName(attrcopy,component,parent){var submitting=parent||component;adjustForID(attrcopy,component,true,component.fullID);if(submitting.submittingname===undefined&&submitting.willinput!==false){submitting.submittingname=submitting.finalID||submitting.fullID}return submitting.submittingname}function explodeDecorators(decorators){var togo=[];if(decorators.type){togo[0]=decorators}else{for(var key in decorators){if(key==="$"){key="jQuery"}var value=decorators[key];var decorator={type:key};if(key==="jQuery"){decorator.func=value[0];decorator.args=value.slice(1)}else{if(key==="addClass"||key==="removeClass"){decorator.classes=value}else{if(key==="attrs"){decorator.attributes=value}else{if(key==="identify"){decorator.key=value}}}}togo[togo.length]=decorator}}return togo}outDecoratorsImpl=function(torender,decorators,attrcopy,finalID){renderOptions.idMap=renderOptions.idMap||{};for(var i=0;i"}function resolveArgs(args){if(!args){return args}return fluid.transform(args,function(arg,index){upgradeBound(args,index,renderOptions.model,renderOptions.resolverGetConfig);return args[index].value})}function degradeMessage(torender){if(torender.componentType==="UIMessage"){torender.componentType="UIBound";if(!renderOptions.messageLocator){torender.value="[No messageLocator is configured in options - please consult documentation on options.messageSource]"}else{upgradeBound(torender,"messagekey",renderOptions.model,renderOptions.resolverGetConfig);var resArgs=resolveArgs(torender.args);torender.value=renderOptions.messageLocator(torender.messagekey.value,resArgs)}}}function renderComponent(torender){var attrcopy=trc.attrcopy;degradeMessage(torender);var componentType=torender.componentType;var tagname=trc.uselump.tagname;outDecorators(torender,attrcopy);function makeFail(torender,end){fluid.fail("Error in component tree - UISelectChoice with id "+torender.fullID+end)}if(componentType==="UIBound"||componentType==="UISelectChoice"){var parent;if(torender.choiceindex!==undefined){if(torender.parentRelativeID!==undefined){parent=getRelativeComponent(torender,torender.parentRelativeID);if(!parent){makeFail(torender," has parentRelativeID of "+torender.parentRelativeID+" which cannot be resolved")}}else{makeFail(torender," does not have parentRelativeID set")}assignSubmittingName(attrcopy,torender,parent.selection);dumpSelectionBindings(parent)}var submittingname=parent?parent.selection.submittingname:torender.submittingname;if(!parent&&torender.valuebinding){submittingname=assignSubmittingName(attrcopy,torender)}if(tagname==="input"||tagname==="textarea"){if(submittingname!==undefined){attrcopy.name=submittingname}}dumpBoundFields(torender,parent?parent.selection:null);if(typeof (torender.value)==="boolean"||attrcopy.type==="radio"||attrcopy.type==="checkbox"){var underlyingValue;var directValue=torender.value;if(torender.choiceindex!==undefined){if(!parent.optionlist.value){fluid.fail("Error in component tree - selection control with full ID "+parent.fullID+" has no values")}underlyingValue=parent.optionlist.value[torender.choiceindex];directValue=isSelectedValue(parent,underlyingValue)}if(isValue(directValue)){if(directValue){attrcopy.checked="checked"}else{delete attrcopy.checked}}attrcopy.value=fluid.XMLEncode(underlyingValue?underlyingValue:"true");rewriteLeaf(null)}else{if(torender.value instanceof Array){renderUnchanged()}else{var value=parent?parent[tagname==="textarea"||tagname==="input"?"optionlist":"optionnames"].value[torender.choiceindex]:torender.value;if(tagname==="textarea"){if(isPlaceholder(value)&&torender.willinput){value=""}rewriteLeaf(value)}else{if(tagname==="input"){if(torender.willinput||isValue(value)){attrcopy.value=fluid.XMLEncode(String(value))}rewriteLeaf(null)}else{delete attrcopy.name;rewriteLeafOpen(value)}}}}}else{if(componentType==="UISelect"){var ishtmlselect=tagname==="select";var ismultiple=false;if(torender.selection.value instanceof Array){ismultiple=true;if(ishtmlselect){attrcopy.multiple="multiple"}}var oldid=attrcopy.id;assignSubmittingName(attrcopy,torender.selection);if(oldid!==undefined){attrcopy.id=oldid}if(ishtmlselect){if(torender.selection.willinput!==false){attrcopy.name=torender.selection.submittingname}applyAutoBind(torender,attrcopy.id)}out+=fluid.dumpAttributes(attrcopy);if(ishtmlselect){out+=">";var values=torender.optionlist.value;var names=torender.optionnames===null||torender.optionnames===undefined||!torender.optionnames.value?values:torender.optionnames.value;if(!names||!names.length){fluid.fail("Error in component tree - UISelect component with fullID "+torender.fullID+" does not have optionnames set")}for(var i=0;i';out+=fluid.XMLEncode(names[i]);out+="\n"}closeTag()}else{dumpTemplateBody()}dumpSelectionBindings(torender)}else{if(componentType==="UILink"){var attrname=LINK_ATTRIBUTES[tagname];if(attrname){degradeMessage(torender.target);var target=torender.target.value;if(!isValue(target)){target=attrcopy[attrname]}target=rewriteUrl(trc.uselump.parent,target);attrcopy[attrname]=fluid.XMLEncode(target)}var value;if(torender.linktext){degradeMessage(torender.linktext);value=torender.linktext.value}if(!isValue(value)){replaceAttributesOpen()}else{rewriteLeaf(value)}}else{if(torender.markup!==undefined){degradeMessage(torender.markup);var rendered=torender.markup.value;if(rendered===null){out+=fluid.dumpAttributes(attrcopy);out+=">";renderUnchanged()}else{if(!trc.iselide){out+=fluid.dumpAttributes(attrcopy);out+=">"}out+=rendered;closeTag()}}}}}if(attrcopy.id!==undefined){usedIDs[attrcopy.id]=true}}function rewriteIDRelation(context){var attrname;var attrval=trc.attrcopy["for"];if(attrval!==undefined){attrname="for"}else{attrval=trc.attrcopy.headers;if(attrval!==undefined){attrname="headers"}}if(!attrname){return }var tagname=trc.uselump.tagname;if(attrname==="for"&&tagname!=="label"){return }if(attrname==="headers"&&tagname!=="td"&&tagname!=="th"){return }var rewritten=rewritemap[getRewriteKey(trc.uselump.parent,context,attrval)];if(rewritten!==undefined){trc.attrcopy[attrname]=rewritten}}function renderComment(message){out+=("")}function renderDebugMessage(message){out+='';out+=message;out+="
"}function reportPath(branch){var path=branch.fullID;return !path?"component tree root":"full path "+path}function renderComponentSystem(context,torendero,lump){var lumpindex=lump.lumpindex;var lumps=lump.parent.lumps;var nextpos=-1;var outerendopen=lumps[lumpindex+1];var outerclose=lump.close_tag;nextpos=outerclose.lumpindex+1;var payloadlist=lump.downmap?lump.downmap["payload-component"]:null;var payload=payloadlist?payloadlist[0]:null;var iselide=lump.rsfID.charCodeAt(0)===126;var endopen=outerendopen;var close=outerclose;var uselump=lump;var attrcopy={};$.extend(true,attrcopy,(payload===null?lump:payload).attributemap);trc.attrcopy=attrcopy;trc.uselump=uselump;trc.endopen=endopen;trc.close=close;trc.nextpos=nextpos;trc.iselide=iselide;rewriteIDRelation(context);if(torendero===null){if(lump.rsfID.indexOf("scr=")===(iselide?1:0)){var scrname=lump.rsfID.substring(4+(iselide?1:0));if(scrname==="ignore"){nextpos=trc.close.lumpindex+1}else{if(scrname==="rewrite-url"){torendero={componentType:"UILink",target:{}}}else{openTag();replaceAttributesOpen();nextpos=trc.endopen.lumpindex}}}}if(torendero!==null){if(payload){trc.endopen=lumps[payload.lumpindex+1];trc.close=payload.close_tag;trc.uselump=payload;dumpTillLump(lumps,lumpindex,payload.lumpindex);lumpindex=payload.lumpindex}adjustForID(attrcopy,torendero);openTag();renderComponent(torendero);if(payload!==null){if(trc.nextpos===nextpos){dumpTillLump(lumps,trc.close.lumpindex+1,outerclose.lumpindex+1)}}nextpos=trc.nextpos}return nextpos}var renderRecurse;function renderContainer(child,targetlump){var t2=targetlump.parent;var firstchild=t2.lumps[targetlump.lumpindex+1];if(child.children!==undefined){dumpBranchHead(child,targetlump)}else{renderComponentSystem(child.parent,child,targetlump)}renderRecurse(child,targetlump,firstchild)}fetchComponent=function(basecontainer,id,lump){if(id.indexOf("msg=")===0){var key=id.substring(4);return{componentType:"UIMessage",messagekey:key}}while(basecontainer){var togo=basecontainer.childmap[id];if(togo){return togo}basecontainer=basecontainer.parent}return null};function fetchComponents(basecontainer,id){var togo;while(basecontainer){togo=basecontainer.childmap[id];if(togo){break}basecontainer=basecontainer.parent}return togo}function findChild(sourcescope,child){var split=fluid.SplitID(child.ID);var headlumps=sourcescope.downmap[child.ID];if(!headlumps){headlumps=sourcescope.downmap[split.prefix+":"]}return headlumps?headlumps[0]:null}renderRecurse=function(basecontainer,parentlump,baselump){var renderindex=baselump.lumpindex;var basedepth=parentlump.nestingdepth;var t1=parentlump.parent;var rendered;if(debugMode){rendered={}}while(true){renderindex=dumpScan(t1.lumps,renderindex,basedepth,!parentlump.elide,false);if(renderindex===t1.lumps.length){break}var lump=t1.lumps[renderindex];var id=lump.rsfID;if(lump.nestingdepth=targetlump.nestingdepth;var newbase=child.children?child:basecontainer;if(wasopentag){renderRecurse(newbase,targetlump,t1.lumps[renderend]);renderend=targetlump.close_tag.lumpindex+1}if(i!==children.length-1){if(renderend")}if(options.model){fluid.bindFossils(node,options.model,fossils)}if($.browser.msie){$(node).html(rendered)}else{node.innerHTML=rendered}renderer.processDecoratorQueue();if(lastId){var element=fluid.byId(lastId);if(element){$(element).focus()}}return templates};function findNodeValue(rootNode){var node=fluid.dom.iterateDom(rootNode,function(node){return node.nodeType===8||node.nodeType===4?"stop":null},true);var value=node.nodeValue;if(value.indexOf("[CDATA[")===0){return value.substring(6,value.length-2)}else{return value}}fluid.extractTemplate=function(node,armouring){if(!armouring){return node.innerHTML}else{return findNodeValue(node)}};fluid.render=function(source,target,tree,options){options=options||{};var template=source;if(typeof (source)==="object"){template=fluid.extractTemplate(fluid.unwrap(source.node),source.armouring)}target=fluid.unwrap(target);var resourceSpec={base:{resourceText:template,href:".",resourceKey:".",cutpoints:options.cutpoints}};var templates=fluid.parseTemplates(resourceSpec,["base"],options);return fluid.reRender(templates,target,tree,options)};fluid.selfRender=function(node,tree,options){options=options||{};return fluid.render({node:node,armouring:options.armouring},node,tree,options)}})(jQuery,fluid_1_4);fluid_1_4=fluid_1_4||{};(function($,fluid){if(!fluid.renderer){fluid.fail("fluidRenderer.js is a necessary dependency of RendererUtilities")}fluid.iota=function(count,first){first=first||0;var togo=[];for(var i=0;i0){expanded.push({children:expandrow})}}else{if(expandrow!==fluid.renderer.NO_COMPONENT){expanded.push(expandrow)}}});var repeatID=options.repeatID;if(repeatID.indexOf(":")===-1){repeatID=repeatID+":"}fluid.each(expanded,function(entry){entry.ID=repeatID});return expanded};fluid.renderer.condition=function(options,container,key,config){fluid.expect("Selection to condition expander",["condition"],options);var condition;if(options.condition.funcName){var args=config.expandLight(options.condition.args);condition=fluid.invoke(options.condition.funcName,args)}else{if(options.condition.expander){condition=config.expander(options.condition)}else{condition=config.expandLight(options.condition)}}var tree=(condition?options.trueTree:options.falseTree);if(!tree){tree=fluid.renderer.NO_COMPONENT}return config.expander(tree)};fluid.extractContextualPath=function(string,options,env){var parsed=fluid.extractELWithContext(string,options);if(parsed){if(parsed.context){var fetched=env[parsed.context];if(typeof (fetched)!=="string"){fluid.fail("Could not look up context path named "+parsed.context+" to string value")}return fluid.model.composePath(fetched,parsed.path)}else{return parsed.path}}};fluid.renderer.makeProtoExpander=function(expandOptions){var options=$.extend({ELstyle:"${}"},expandOptions);options.fetcher=fluid.makeEnvironmentFetcher("rendererEnvironment",options.model);var IDescape=options.IDescape||"\\";function fetchEL(string){var env=fluid.threadLocal().rendererEnvironment;return fluid.extractContextualPath(string,options,env)}var expandLight=function(source){return fluid.resolveEnvironment(source,options)};var expandBound=function(value,concrete){if(value.messagekey!==undefined){return{componentType:"UIMessage",messagekey:expandBound(value.messagekey),args:expandLight(value.args)}}var proto;if(!fluid.isPrimitive(value)&&!fluid.isArrayable(value)){proto=$.extend({},value);if(proto.decorators){proto.decorators=expandLight(proto.decorators)}value=proto.value;delete proto.value}else{proto={}}var EL=typeof (value)==="string"?fetchEL(value):null;if(EL){proto.valuebinding=EL}else{if(value!==undefined){proto.value=value}}if(options.model&&proto.valuebinding&&proto.value===undefined){proto.value=fluid.get(options.model,proto.valuebinding,options.resolverGetConfig)}if(concrete){proto.componentType="UIBound"}return proto};options.filter=fluid.expander.lightFilter;var expandCond;var expandLeafOrCond;var expandEntry=function(entry){var comp=[];expandCond(entry,comp);return{children:comp}};var expandExternal=function(entry){if(entry===fluid.renderer.NO_COMPONENT){return entry}var singleTarget;var target=[];var pusher=function(comp){singleTarget=comp};expandLeafOrCond(entry,target,pusher);return singleTarget||target};var expandConfig={model:options.model,resolverGetConfig:options.resolverGetConfig,resolverSetConfig:options.resolverSetConfig,expander:expandExternal,expandLight:expandLight};var expandLeaf=function(leaf,componentType){var togo={componentType:componentType};var map=fluid.renderer.boundMap[componentType]||{};for(var key in leaf){if(/decorators|args/.test(key)){togo[key]=expandLight(leaf[key]);continue}else{if(map[key]){togo[key]=expandBound(leaf[key])}else{togo[key]=leaf[key]}}}return togo};var expandChildren=function(entry,pusher){var children=entry.children;for(var i=0;icond transition")}expandCond(entry,target)}};expandCond=function(proto,target){for(var key in proto){var entry=proto[key];if(key.charAt(0)===IDescape){key=key.substring(1)}if(key==="expander"){var expanders=fluid.makeArray(entry);fluid.each(expanders,function(expander){var expanded=fluid.invokeGlobalFunction(expander.type,[expander,proto,key,expandConfig]);if(expanded!==fluid.renderer.NO_COMPONENT){fluid.each(expanded,function(el){target[target.length]=el})}})}else{if(entry){var condPusher=function(comp){comp.ID=key;target[target.length]=comp};if(entry.children){if(key.indexOf(":")===-1){key=key+":"}expandChildren(entry,condPusher)}else{if(fluid.renderer.isBoundPrimitive(entry)){condPusher(expandBound(entry,true))}else{expandLeafOrCond(entry,null,condPusher)}}}}}};return function(entry){var initEnvironment=$.extend({},options.envAdd);return fluid.withEnvironment({rendererEnvironment:initEnvironment},function(){return expandEntry(entry)})}}})(jQuery,fluid_1_4);var fluid_1_4=fluid_1_4||{};(function($,fluid){fluid.registerNamespace("fluid.browser");fluid.browser.binaryXHR=function(){var canSendBinary=window.FormData||(window.XMLHttpRequest&&window.XMLHttpRequest.prototype&&window.XMLHttpRequest.prototype.sendAsBinary);return canSendBinary?fluid.typeTag("fluid.browser.supportsBinaryXHR"):undefined};fluid.browser.formData=function(){return window.FormData?fluid.typeTag("fluid.browser.supportsFormData"):undefined};fluid.browser.flash=function(){var hasModernFlash=(typeof (swfobject)!=="undefined")&&(swfobject.getFlashPlayerVersion().major>8);return hasModernFlash?fluid.typeTag("fluid.browser.supportsFlash"):undefined};fluid.progressiveChecker=function(options){var that=fluid.initLittleComponent("fluid.progressiveChecker",options);return fluid.typeTag(fluid.find(that.options.checks,function(check){if(check.feature){return check.contextName}},that.options.defaultContextName))};fluid.defaults("fluid.progressiveChecker",{gradeNames:"fluid.typeFount",checks:[],defaultContextName:undefined});fluid.progressiveCheckerForComponent=function(options){var that=fluid.initLittleComponent("fluid.progressiveCheckerForComponent",options);var defaults=fluid.defaults(that.options.componentName);return fluid.progressiveChecker(fluid.expandOptions(defaults.progressiveCheckerOptions,that))};fluid.defaults("fluid.progressiveCheckerForComponent",{gradeNames:"fluid.typeFount"});$("head").append("");var features={supportsBinaryXHR:fluid.browser.binaryXHR(),supportsFormData:fluid.browser.formData(),supportsFlash:fluid.browser.flash()};fluid.merge(null,fluid.staticEnvironment,features)})(jQuery,fluid_1_4);(function($){var increments=0;$.widget("ui.tooltip",{options:{items:"[title]",content:function(){return $(this).attr("title")},position:{my:"left center",at:"right center",offset:"15 0"}},_create:function(){var self=this;this.tooltip=$("
").attr("id","ui-tooltip-"+increments++).attr("role","tooltip").attr("aria-hidden","true").addClass("ui-tooltip ui-widget ui-corner-all ui-widget-content").appendTo(document.body).hide();this.tooltipContent=$("
").addClass("ui-tooltip-content").appendTo(this.tooltip);this.opacity=this.tooltip.css("opacity");this.element.bind("focus.tooltip mouseover.tooltip",function(event){self.open(event)}).bind("blur.tooltip mouseout.tooltip",function(event){self.close(event)})},enable:function(){this.options.disabled=false},disable:function(){this.options.disabled=true},destroy:function(){this.tooltip.remove();$.Widget.prototype.destroy.apply(this,arguments)},widget:function(){return this.element.pushStack(this.tooltip.get())},open:function(event){var target=$(event&&event.target||this.element).closest(this.options.items);if(this.current&&this.current[0]==target[0]){return }var self=this;this.current=target;this.currentTitle=target.attr("title");var content=this.options.content.call(target[0],function(response){setTimeout(function(){if(self.current==target){self._show(event,target,response)}},13)});if(content){self._show(event,target,content)}},_show:function(event,target,content){if(!content){return }target.attr("title","");if(this.options.disabled){return }this.tooltipContent.html(content);this.tooltip.css({top:0,left:0}).show().position($.extend({of:target},this.options.position)).hide();this.tooltip.attr("aria-hidden","false");target.attr("aria-describedby",this.tooltip.attr("id"));this.tooltip.stop(false,true).fadeIn();this._trigger("open",event)},close:function(event){if(!this.current){return }var current=this.current;this.current=null;current.attr("title",this.currentTitle);if(this.options.disabled){return }current.removeAttr("aria-describedby");this.tooltip.attr("aria-hidden","true");this.tooltip.stop(false,true).fadeOut();this._trigger("close",event)}})})(jQuery);var fluid_1_4=fluid_1_4||{};(function($,fluid){var STATE_INITIAL="state_initial",STATE_CHANGED="state_changed",STATE_REVERTED="state_reverted";function defaultRenderer(that,targetContainer){var str=that.options.strings;var markup=""+str.undo+""+str.redo+"";var markupNode=$(markup).attr({role:"region","aria-live":"polite","aria-relevant":"all"});targetContainer.append(markupNode);return markupNode}function refreshView(that){if(that.state===STATE_INITIAL){that.locate("undoContainer").hide();that.locate("redoContainer").hide()}else{if(that.state===STATE_CHANGED){that.locate("undoContainer").show();that.locate("redoContainer").hide()}else{if(that.state===STATE_REVERTED){that.locate("undoContainer").hide();that.locate("redoContainer").show()}}}}var bindHandlers=function(that){that.locate("undoControl").click(function(){if(that.state!==STATE_REVERTED){fluid.model.copyModel(that.extremalModel,that.component.model);that.component.updateModel(that.initialModel,that);that.state=STATE_REVERTED;refreshView(that);that.locate("redoControl").focus()}return false});that.locate("redoControl").click(function(){if(that.state!==STATE_CHANGED){that.component.updateModel(that.extremalModel,that);that.state=STATE_CHANGED;refreshView(that);that.locate("undoControl").focus()}return false});return{modelChanged:function(newModel,oldModel,source){if(source!==that){that.state=STATE_CHANGED;fluid.model.copyModel(that.initialModel,oldModel);refreshView(that)}}}};fluid.undoDecorator=function(component,userOptions){var that=fluid.initLittleComponent("undo",userOptions);that.container=that.options.renderer(that,component.container);fluid.initDomBinder(that);fluid.tabindex(that.locate("undoControl"),0);fluid.tabindex(that.locate("redoControl"),0);that.component=component;that.initialModel={};that.extremalModel={};fluid.model.copyModel(that.initialModel,component.model);fluid.model.copyModel(that.extremalModel,component.model);that.state=STATE_INITIAL;refreshView(that);var listeners=bindHandlers(that);that.returnedOptions={listeners:listeners};return that};fluid.defaults("undo",{selectors:{undoContainer:".flc-undo-undoControl",undoControl:".flc-undo-undoControl",redoContainer:".flc-undo-redoControl",redoControl:".flc-undo-redoControl"},strings:{undo:"undo edit",redo:"redo edit"},renderer:defaultRenderer})})(jQuery,fluid_1_4);var fluid_1_4=fluid_1_4||{};(function($,fluid){var createContentFunc=function(content){return typeof content==="function"?content:function(){return content}};var setup=function(that){that.container.tooltip({content:createContentFunc(that.options.content),position:that.options.position,items:that.options.items,open:function(event){var tt=$(event.target).tooltip("widget");tt.stop(false,true);tt.hide();if(that.options.delay){tt.delay(that.options.delay).fadeIn("default",that.events.afterOpen.fire())}else{tt.show();that.events.afterOpen.fire()}},close:function(event){var tt=$(event.target).tooltip("widget");tt.stop(false,true);tt.hide();tt.clearQueue();that.events.afterClose.fire()}});that.elm=that.container.tooltip("widget");that.elm.addClass(that.options.styles.tooltip)};fluid.tooltip=function(container,options){var that=fluid.initView("fluid.tooltip",container,options);that.updateContent=function(content){that.container.tooltip("option","content",createContentFunc(content))};that.destroy=function(){that.container.tooltip("destroy")};that.open=function(){that.container.tooltip("open")};that.close=function(){that.container.tooltip("close")};setup(that);return that};fluid.defaults("fluid.tooltip",{styles:{tooltip:""},events:{afterOpen:null,afterClose:null},content:"",position:{my:"left top",at:"left bottom",offset:"0 5"},items:"*",delay:300})})(jQuery,fluid_1_4);var fluid_1_4=fluid_1_4||{};(function($,fluid){function sendKey(control,event,virtualCode,charCode){var kE=document.createEvent("KeyEvents");kE.initKeyEvent(event,1,1,null,0,0,0,0,virtualCode,charCode);control.dispatchEvent(kE)}fluid.setCaretToEnd=function(control,value){var pos=value?value.length:0;try{control.focus();if(control.setSelectionRange){control.setSelectionRange(pos,pos);if($.browser.mozilla&&pos>0){sendKey(control,"keypress",92,92);sendKey(control,"keydown",8,0);sendKey(control,"keypress",8,0)}}else{if(control.createTextRange){var range=control.createTextRange();range.move("character",pos);range.select()}}}catch(e){}};var switchToViewMode=function(that){that.editContainer.hide();that.displayModeRenderer.show()};var cancel=function(that){if(that.isEditing()){setTimeout(function(){that.editView.value(that.model.value)},1);switchToViewMode(that);that.events.afterFinishEdit.fire(that.model.value,that.model.value,that.editField[0],that.viewEl[0])}};var finish=function(that){var newValue=that.editView.value();var oldValue=that.model.value;var viewNode=that.viewEl[0];var editNode=that.editField[0];var ret=that.events.onFinishEdit.fire(newValue,oldValue,editNode,viewNode);if(ret===false){return }that.updateModelValue(newValue);that.events.afterFinishEdit.fire(newValue,oldValue,editNode,viewNode);switchToViewMode(that)};var bindEditFinish=function(that){if(that.options.submitOnEnter===undefined){that.options.submitOnEnter="textarea"!==fluid.unwrap(that.editField).nodeName.toLowerCase()}function keyCode(evt){return evt.keyCode?evt.keyCode:(evt.which?evt.which:0)}var escHandler=function(evt){var code=keyCode(evt);if(code===$.ui.keyCode.ESCAPE){that.textEditButton.focus(0);cancel(that);return false}};var finishHandler=function(evt){var code=keyCode(evt);if(code!==$.ui.keyCode.ENTER){that.textEditButton.blur();return true}else{finish(that);that.textEditButton.focus(0)}return false};if(that.options.submitOnEnter){that.editContainer.keypress(finishHandler)}that.editContainer.keydown(escHandler)};var bindBlurHandler=function(that){if(that.options.blurHandlerBinder){that.options.blurHandlerBinder(that)}else{var blurHandler=function(evt){if(that.isEditing()){finish(that)}return false};that.editField.blur(blurHandler)}};var initializeEditView=function(that,initial){if(!that.editInitialized){fluid.inlineEdit.renderEditContainer(that,!that.options.lazyEditView||!initial);if(!that.options.lazyEditView||!initial){that.editView=fluid.initSubcomponent(that,"editView",that.editField);$.extend(true,that.editView,fluid.initSubcomponent(that,"editAccessor",that.editField));bindEditFinish(that);bindBlurHandler(that);that.editView.refreshView(that);that.editInitialized=true}}};var edit=function(that){initializeEditView(that,false);var viewEl=that.viewEl;var displayText=that.displayView.value();that.updateModelValue(that.model.value===""?"":displayText);if(that.options.applyEditPadding){that.editField.width(Math.max(viewEl.width()+that.options.paddings.edit,that.options.paddings.minimumEdit))}that.displayModeRenderer.hide();that.editContainer.show();setTimeout(function(){fluid.setCaretToEnd(that.editField[0],that.editView.value());if(that.options.selectOnEdit){that.editField[0].select()}},0);that.events.afterBeginEdit.fire()};var clearEmptyViewStyles=function(textEl,styles,originalViewPadding){textEl.removeClass(styles.defaultViewStyle);textEl.css("padding-right",originalViewPadding);textEl.removeClass(styles.emptyDefaultViewText)};var showDefaultViewText=function(that){that.displayView.value(that.options.defaultViewText);that.viewEl.css("padding-right",that.existingPadding);that.viewEl.addClass(that.options.styles.defaultViewStyle)};var showNothing=function(that){that.displayView.value("");if($.browser.msie){if(that.viewEl.css("display")==="inline"){that.viewEl.css("display","inline-block")}}};var showEditedText=function(that){that.displayView.value(that.model.value);clearEmptyViewStyles(that.viewEl,that.options.styles,that.existingPadding)};var refreshView=function(that,source){that.displayView.refreshView(that,source);if(that.editView){that.editView.refreshView(that,source)}};var initModel=function(that,value){that.model.value=value;that.refreshView()};var updateModelValue=function(that,newValue,source){var comparator=that.options.modelComparator;var unchanged=comparator?comparator(that.model.value,newValue):that.model.value===newValue;if(!unchanged){var oldModel=$.extend(true,{},that.model);that.model.value=newValue;that.events.modelChanged.fire(that.model,oldModel,source);that.refreshView(source)}};var makeIsEditing=function(that){var isEditing=false;that.events.onBeginEdit.addListener(function(){isEditing=true});that.events.afterFinishEdit.addListener(function(){isEditing=false});return function(){return isEditing}};var makeEditHandler=function(that){return function(){var prevent=that.events.onBeginEdit.fire();if(prevent===false){return false}edit(that);return true}};var initTooltips=function(that){var tooltipOptions={content:that.options.tooltipText,position:{my:"left top",at:"left bottom",offset:"0 5"},target:"*",delay:that.options.tooltipDelay,styles:{tooltip:that.options.styles.tooltip}};fluid.tooltip(that.viewEl,tooltipOptions);if(that.textEditButton){fluid.tooltip(that.textEditButton,tooltipOptions)}};var calculateInitialPadding=function(viewEl){var padding=viewEl.css("padding-right");return padding?parseFloat(padding):0};var setupInlineEdit=function(componentContainer,that){if(that.editContainer){that.editContainer.hide()}if(that.tooltipEnabled()){initTooltips(that)}that.decorators=fluid.initSubcomponents(that,"componentDecorators",[that,fluid.COMPONENT_OPTIONS])};var setupInlineEdits=function(editables,options){var editors=[];editables.each(function(idx,editable){editors.push(fluid.inlineEdit($(editable),options))});return editors};fluid.inlineEdit=function(componentContainer,userOptions){var that=fluid.initView("inlineEdit",componentContainer,userOptions);that.viewEl=fluid.inlineEdit.setupDisplayText(that);that.displayView=fluid.initSubcomponent(that,"displayView",that.viewEl);$.extend(true,that.displayView,fluid.initSubcomponent(that,"displayAccessor",that.viewEl));that.model={value:""};that.edit=makeEditHandler(that);that.isEditing=makeIsEditing(that);that.finish=function(){finish(that)};that.cancel=function(){cancel(that)};that.tooltipEnabled=function(){return that.options.useTooltip&&$.fn.tooltip};that.refreshView=function(source){refreshView(that,source)};that.updateModelValue=function(newValue,source){updateModelValue(that,newValue,source)};that.updateModel=function(newModel,source){updateModelValue(that,newModel.value,source)};that.existingPadding=calculateInitialPadding(that.viewEl);initModel(that,that.displayView.value());that.displayModeRenderer=that.options.displayModeRenderer(that);initializeEditView(that,true);setupInlineEdit(componentContainer,that);return that};fluid.inlineEdit.setupEditField=function(editStyle,editField){var eField=$(editField);eField=eField.length?eField:$("");eField.addClass(editStyle);return eField};fluid.inlineEdit.setupEditContainer=function(displayContainer,editField,editContainer){var eContainer=$(editContainer);eContainer=eContainer.length?eContainer:$("");displayContainer.after(eContainer);eContainer.append(editField);return eContainer};fluid.inlineEdit.defaultEditModeRenderer=function(that){var editField=fluid.inlineEdit.setupEditField(that.options.styles.edit,that.editField);var editContainer=fluid.inlineEdit.setupEditContainer(that.displayModeRenderer,editField,that.editContainer);var editModeInstruction=fluid.inlineEdit.setupEditModeInstruction(that.options.styles.editModeInstruction,that.options.strings.editModeInstruction);var id=fluid.allocateSimpleId(editModeInstruction);editField.attr("aria-describedby",id);fluid.inlineEdit.positionEditModeInstruction(editModeInstruction,editContainer,editField);return{container:editContainer,field:editField}};fluid.inlineEdit.renderEditContainer=function(that,lazyEditView){that.editContainer=that.locate("editContainer");that.editField=that.locate("edit");if(that.editContainer.length!==1){if(that.editContainer.length>1){fluid.fail("InlineEdit did not find a unique container for selector "+that.options.selectors.editContainer+": "+fluid.dumpEl(that.editContainer))}}if(!lazyEditView){return }var editElms=that.options.editModeRenderer(that);if(editElms){that.editContainer=editElms.container;that.editField=editElms.field}};fluid.inlineEdit.setupEditModeInstruction=function(editModeInstructionStyle,editModeInstructionText){var editModeInstruction=$("

");editModeInstruction.addClass(editModeInstructionStyle);editModeInstruction.text(editModeInstructionText);return editModeInstruction};fluid.inlineEdit.positionEditModeInstruction=function(editModeInstruction,editContainer,editField){editContainer.append(editModeInstruction);editField.focus(function(){editModeInstruction.show();var editFieldPosition=editField.offset();editModeInstruction.css({left:editFieldPosition.left});editModeInstruction.css({top:editFieldPosition.top+editField.height()+5})})};fluid.inlineEdit.setupDisplayModeContainer=function(styles,displayModeWrapper){var displayModeContainer=$(displayModeWrapper);displayModeContainer=displayModeContainer.length?displayModeContainer:$("");displayModeContainer.addClass(styles.displayView);return displayModeContainer};fluid.inlineEdit.setupDisplayText=function(that){var viewEl=that.locate("text");viewEl.attr("tabindex","-1");viewEl.addClass(that.options.styles.text);return viewEl};fluid.inlineEdit.setupTextEditButton=function(that){var opts=that.options;var textEditButton=that.locate("textEditButton");if(textEditButton.length===0){var markup=$("");markup.addClass(opts.styles.textEditButton);markup.text(opts.tooltipText);fluid.inlineEdit.updateTextEditButton(markup,that.model.value||opts.defaultViewText,opts.strings.textEditButton);that.events.modelChanged.addListener(function(){fluid.inlineEdit.updateTextEditButton(markup,that.model.value||opts.defaultViewText,opts.strings.textEditButton)});that.locate("text").after(markup);textEditButton=that.locate("textEditButton")}return textEditButton};fluid.inlineEdit.updateTextEditButton=function(textEditButton,value,stringTemplate){var buttonText=fluid.stringTemplate(stringTemplate,{text:value});textEditButton.text(buttonText)};fluid.inlineEdit.bindHoverHandlers=function(displayModeRenderer,invitationStyle){var over=function(evt){displayModeRenderer.addClass(invitationStyle)};var out=function(evt){displayModeRenderer.removeClass(invitationStyle)};displayModeRenderer.hover(over,out)};fluid.inlineEdit.bindHighlightHandler=function(element,displayModeRenderer,styles){element=$(element);var focusOn=function(){displayModeRenderer.addClass(styles.focus);displayModeRenderer.addClass(styles.invitation)};var focusOff=function(){displayModeRenderer.removeClass(styles.focus);displayModeRenderer.removeClass(styles.invitation)};element.focus(focusOn);element.blur(focusOff)};fluid.inlineEdit.bindMouseHandlers=function(element,edit){element=$(element);var triggerGuard=fluid.inlineEdit.makeEditTriggerGuard(element,edit);element.click(function(e){triggerGuard(e);return false})};fluid.inlineEdit.bindKeyboardHandlers=function(element,edit){element=$(element);element.attr("role","button");var guard=fluid.inlineEdit.makeEditTriggerGuard(element,edit);fluid.activatable(element,function(event){return guard(event)})};fluid.inlineEdit.makeEditTriggerGuard=function(element,edit){var selector=fluid.unwrap(element);return function(event){var outer=fluid.findAncestor(event.target,function(elem){if(/input|select|textarea|button|a/i.test(elem.nodeName)||elem===selector){return true}});if(outer===selector){edit();return false}}};fluid.inlineEdit.defaultDisplayModeRenderer=function(that){var styles=that.options.styles;var displayModeWrapper=fluid.inlineEdit.setupDisplayModeContainer(styles);var displayModeRenderer=that.viewEl.wrap(displayModeWrapper).parent();that.textEditButton=fluid.inlineEdit.setupTextEditButton(that);displayModeRenderer.append(that.textEditButton);fluid.inlineEdit.bindHoverHandlers(displayModeRenderer,styles.invitation);fluid.inlineEdit.bindMouseHandlers(that.viewEl,that.edit);fluid.inlineEdit.bindMouseHandlers(that.textEditButton,that.edit);fluid.inlineEdit.bindKeyboardHandlers(that.textEditButton,that.edit);fluid.inlineEdit.bindHighlightHandler(that.viewEl,displayModeRenderer,styles);fluid.inlineEdit.bindHighlightHandler(that.textEditButton,displayModeRenderer,styles);return displayModeRenderer};fluid.inlineEdit.standardAccessor=function(element){var nodeName=element.nodeName.toLowerCase();return{value:function(newValue){return"input"===nodeName||"textarea"===nodeName?fluid.value($(element),newValue):$(element).text(newValue)}}};fluid.inlineEdit.standardDisplayView=function(viewEl){var that={refreshView:function(componentThat,source){if(componentThat.model.value){showEditedText(componentThat)}else{if(componentThat.options.defaultViewText){showDefaultViewText(componentThat)}else{showNothing(componentThat)}}if($.trim(componentThat.viewEl.text()).length===0){componentThat.viewEl.addClass(componentThat.options.styles.emptyDefaultViewText);if(componentThat.existingPadding/g,function(match){return match.toLowerCase()});return togo};fluid.inlineEdit.htmlComparator=function(el1,el2){return fluid.inlineEdit.normalizeHTML(el1)===fluid.inlineEdit.normalizeHTML(el2)};fluid.inlineEdit.bindRichTextHighlightHandler=function(element,displayModeRenderer,invitationStyle){element=$(element);var focusOn=function(){displayModeRenderer.addClass(invitationStyle)};var focusOff=function(){displayModeRenderer.removeClass(invitationStyle)};element.focus(focusOn);element.blur(focusOff)};fluid.inlineEdit.setupRichTextEditButton=function(that){var opts=that.options;var textEditButton=that.locate("textEditButton");if(textEditButton.length===0){var markup=$("");markup.text(opts.strings.textEditButton);that.locate("text").after(markup);textEditButton=that.locate("textEditButton")}return textEditButton};fluid.inlineEdit.richTextDisplayModeRenderer=function(that){var styles=that.options.styles;var displayModeWrapper=fluid.inlineEdit.setupDisplayModeContainer(styles);var displayModeRenderer=that.viewEl.wrap(displayModeWrapper).parent();that.textEditButton=fluid.inlineEdit.setupRichTextEditButton(that);displayModeRenderer.append(that.textEditButton);displayModeRenderer.addClass(styles.focus);fluid.inlineEdit.bindHoverHandlers(displayModeRenderer,styles.invitation);fluid.inlineEdit.bindMouseHandlers(that.textEditButton,that.edit);fluid.inlineEdit.bindKeyboardHandlers(that.textEditButton,that.edit);fluid.inlineEdit.bindRichTextHighlightHandler(that.viewEl,displayModeRenderer,styles.invitation);fluid.inlineEdit.bindRichTextHighlightHandler(that.textEditButton,displayModeRenderer,styles.invitation);return displayModeRenderer};fluid.inlineEdit.tinyMCE=function(container,options){var inlineEditor=configureInlineEdit("fluid.inlineEdit.tinyMCE",container,options);tinyMCE.init(inlineEditor.options.tinyMCE);return inlineEditor};fluid.inlineEdit.tinyMCE.getEditor=function(editField){return tinyMCE.get(editField.id)};fluid.inlineEdit.tinyMCE.setValue=function(editField,editor,value){$(editField).val(value);editor.setContent(value,{format:"raw"})};fluid.inlineEdit.tinyMCE.getValue=function(editor){return editor.getContent()};var flTinyMCE=fluid.inlineEdit.tinyMCE;flTinyMCE.viewAccessor=fluid.inlineEdit.makeViewAccessor(flTinyMCE.getEditor,flTinyMCE.setValue,flTinyMCE.getValue);fluid.inlineEdit.tinyMCE.blurHandlerBinder=function(that){function focusEditor(editor){setTimeout(function(){tinyMCE.execCommand("mceFocus",false,that.editField[0].id);if($.browser.mozilla&&$.browser.version.substring(0,3)==="1.8"){return }editor.selection.select(editor.getBody(),1);editor.selection.collapse(0)},10)}that.events.afterInitEdit.addListener(function(editor){focusEditor(editor);var editorBody=editor.getBody();fluid.deadMansBlur(that.editField,{exclusions:{body:$(editorBody)},handler:function(){that.cancel()}})});that.events.afterBeginEdit.addListener(function(){var editor=tinyMCE.get(that.editField[0].id);if(editor){focusEditor(editor)}})};fluid.inlineEdit.tinyMCE.editModeRenderer=function(that){var options=that.options.tinyMCE;options.elements=fluid.allocateSimpleId(that.editField);var oldinit=options.init_instance_callback;options.init_instance_callback=function(instance){that.events.afterInitEdit.fire(instance);if(oldinit){oldinit()}};tinyMCE.init(options)};fluid.defaults("fluid.inlineEdit.tinyMCE",{tinyMCE:{mode:"exact",theme:"simple"},useTooltip:true,selectors:{edit:"textarea"},styles:{invitation:"fl-inlineEdit-richText-invitation",displayView:"fl-inlineEdit-textContainer",text:""},strings:{textEditButton:"Edit"},displayAccessor:{type:"fluid.inlineEdit.richTextViewAccessor"},editAccessor:{type:"fluid.inlineEdit.tinyMCE.viewAccessor"},lazyEditView:true,defaultViewText:"Click Edit",modelComparator:fluid.inlineEdit.htmlComparator,blurHandlerBinder:fluid.inlineEdit.tinyMCE.blurHandlerBinder,displayModeRenderer:fluid.inlineEdit.richTextDisplayModeRenderer,editModeRenderer:fluid.inlineEdit.tinyMCE.editModeRenderer});fluid.inlineEdit.CKEditor=function(container,options){return configureInlineEdit("fluid.inlineEdit.CKEditor",container,options)};fluid.inlineEdit.CKEditor.getEditor=function(editField){return CKEDITOR.instances[editField.id]};fluid.inlineEdit.CKEditor.setValue=function(editField,editor,value){editor.setData(value)};fluid.inlineEdit.CKEditor.getValue=function(editor){return editor.getData()};var flCKEditor=fluid.inlineEdit.CKEditor;flCKEditor.viewAccessor=fluid.inlineEdit.makeViewAccessor(flCKEditor.getEditor,flCKEditor.setValue,flCKEditor.getValue);fluid.inlineEdit.CKEditor.focus=function(editor){setTimeout(function(){editor.focus()},0)};fluid.inlineEdit.CKEditor.normalizeHTML=function(value){var togo=fluid.inlineEdit.normalizeHTML(value);var angpos=togo.indexOf(">");if(angpos!==-1&&angpos';return this.each(function(){if($("> iframe.bgiframe",this).length==0){this.insertBefore(document.createElement(html),this.firstChild)}})}return this};if(!$.browser.version){$.browser.version=navigator.userAgent.toLowerCase().match(/.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/)[1]}})(jQuery);var fluid_1_4=fluid_1_4||{};(function($,fluid){function updateStyles(pageListThat,newModel,oldModel){if(!pageListThat.pageLinks){return }if(oldModel.pageIndex!==undefined){var oldLink=pageListThat.pageLinks.eq(oldModel.pageIndex);oldLink.removeClass(pageListThat.options.styles.currentPage)}var pageLink=pageListThat.pageLinks.eq(newModel.pageIndex);pageLink.addClass(pageListThat.options.styles.currentPage)}function bindLinkClick(link,events,eventArg){link.unbind("click.fluid.pager");link.bind("click.fluid.pager",function(){events.initiatePageChange.fire(eventArg)})}function computePageCount(model){model.pageCount=Math.max(1,Math.floor((model.totalRange-1)/model.pageSize)+1)}fluid.pager=function(){return fluid.pagerImpl.apply(null,arguments)};fluid.pager.computePageLimit=function(model){return Math.min(model.totalRange,(model.pageIndex+1)*model.pageSize)};fluid.pager.directPageList=function(container,events,options){var that=fluid.initView("fluid.pager.directPageList",container,options);that.pageLinks=that.locate("pageLinks");for(var i=0;i=mid-midLocality&&i<=mid+midLocality)){togo[j++]=i;lastSkip=false}else{if(!lastSkip){togo[j++]=-1;lastSkip=true}}}return togo}};fluid.pager.consistentGappedPageStrategy=function(endLinkCount,midLinkCount){if(!endLinkCount){endLinkCount=1}if(!midLinkCount){midLinkCount=endLinkCount}var endWidth=endLinkCount+2+midLinkCount;return function(count,first,mid){var pages=[];var anchoredLeft=mid=count-endWidth;var anchoredEndWidth=endWidth+midLinkCount;var midStart=mid-midLinkCount;var midEnd=mid+midLinkCount;var lastSkip=false;for(var page=0;page=count-anchoredEndWidth)||(page>=midStart&&page<=midEnd)){pages.push(page);lastSkip=false}else{if(!lastSkip){pages.push(-1);lastSkip=true}}}return pages}};fluid.pager.renderedPageList=function(container,events,pagerBarOptions,options,strings){options=$.extend(true,pagerBarOptions,options);var that=fluid.initView("fluid.pager.renderedPageList",container,options);options=that.options;var idMap={};var renderOptions={cutpoints:[{id:"page-link:link",selector:pagerBarOptions.selectors.pageLinks},{id:"page-link:skip",selector:pagerBarOptions.selectors.pageLinkSkip}],idMap:idMap};if(options.linkBody){renderOptions.cutpoints[renderOptions.cutpoints.length]={id:"payload-component",selector:options.linkBody}}var assembleComponent=function(page,isCurrent){var obj={ID:"page-link:link",localID:page+1,value:page+1,pageIndex:page,decorators:[{type:"jQuery",func:"click",args:function(event){events.initiatePageChange.fire({pageIndex:page});event.preventDefault()}}]};if(isCurrent){obj.current=true;obj.decorators=obj.decorators.concat([{type:"addClass",classes:that.options.styles.currentPage},{type:"jQuery",func:"attr",args:["aria-label",that.options.strings.currentPageIndexMsg]}])}return obj};function pageToComponent(current){return function(page){return page===-1?{ID:"page-link:skip"}:assembleComponent(page,page===current)}}var root=that.locate("root");fluid.expectFilledSelector(root,"Error finding root template for fluid.pager.renderedPageList");var template=fluid.selfRender(root,{},renderOptions);events.onModelChange.addListener(function(newModel,oldModel){var pages=that.options.pageStrategy(newModel.pageCount,0,newModel.pageIndex);var pageTree=fluid.transform(pages,pageToComponent(newModel.pageIndex));if(pageTree.length>1){pageTree[pageTree.length-1].value=pageTree[pageTree.length-1].value+strings.last}events.onRenderPageLinks.fire(pageTree,newModel);$.each(idMap,function(key,id){var pageLink=fluid.jById(id);if(pageLink.tooltip){pageLink.tooltip("destroy")}});fluid.reRender(template,root,pageTree,renderOptions);updateStyles(that,newModel,oldModel)});return that};fluid.defaults("fluid.pager.renderedPageList",{selectors:{root:".flc-pager-links"},linkBody:"a",pageStrategy:fluid.pager.everyPageStrategy});var updatePreviousNext=function(that,options,newModel){if(newModel.pageIndex===0){that.previous.addClass(options.styles.disabled)}else{that.previous.removeClass(options.styles.disabled)}if(newModel.pageIndex===newModel.pageCount-1){that.next.addClass(options.styles.disabled)}else{that.next.removeClass(options.styles.disabled)}};fluid.pager.previousNext=function(container,events,options){var that=fluid.initView("fluid.pager.previousNext",container,options);that.previous=that.locate("previous");bindLinkClick(that.previous,events,{relativePage:-1});that.next=that.locate("next");bindLinkClick(that.next,events,{relativePage:+1});events.onModelChange.addListener(function(newModel,oldModel,overallThat){updatePreviousNext(that,options,newModel)});return that};fluid.pager.pagerBar=function(events,container,options,strings){var that=fluid.initView("fluid.pager.pagerBar",container,options);that.pageList=fluid.initSubcomponent(that,"pageList",[container,events,that.options,fluid.COMPONENT_OPTIONS,strings]);that.previousNext=fluid.initSubcomponent(that,"previousNext",[container,events,that.options,fluid.COMPONENT_OPTIONS,strings]);return that};fluid.defaults("fluid.pager.pagerBar",{previousNext:{type:"fluid.pager.previousNext"},pageList:{type:"fluid.pager.renderedPageList",options:{pageStrategy:fluid.pager.gappedPageStrategy(3,1)}},selectors:{pageLinks:".flc-pager-pageLink",pageLinkSkip:".flc-pager-pageLink-skip",previous:".flc-pager-previous",next:".flc-pager-next"},styles:{currentPage:"fl-pager-currentPage",disabled:"fl-pager-disabled"},strings:{currentPageIndexMsg:"Current page"}});function getColumnDefs(that){return that.options.columnDefs}fluid.pager.findColumnDef=function(columnDefs,key){var columnDef=$.grep(columnDefs,function(def){return def.key===key})[0];return columnDef};function getRoots(target,overallThat,index){var cellRoot=(overallThat.options.dataOffset?overallThat.options.dataOffset+".":"");target.shortRoot=index;target.longRoot=cellRoot+target.shortRoot}function expandPath(EL,shortRoot,longRoot){if(EL.charAt(0)==="*"){return longRoot+EL.substring(1)}else{return EL.replace("*",shortRoot)}}fluid.pager.fetchValue=function(that,dataModel,index,valuebinding,roots){getRoots(roots,that,index);var path=expandPath(valuebinding,roots.shortRoot,roots.longRoot);return fluid.get(dataModel,path)};fluid.pager.basicSorter=function(overallThat,model){var dataModel=overallThat.options.dataModel;var roots={};var columnDefs=getColumnDefs(overallThat);var columnDef=fluid.pager.findColumnDef(columnDefs,model.sortKey);var sortrecs=[];for(var i=0;ib?model.sortDir:-model.sortDir)}sortrecs.sort(sortfunc);return fluid.transform(sortrecs,function(row){return row.index})};fluid.pager.directModelFilter=function(model,pagerModel,perm){var togo=[];var limit=fluid.pager.computePageLimit(pagerModel);for(var i=pagerModel.pageIndex*pagerModel.pageSize;i=newModel.pageCount){newModel.pageIndex=newModel.pageCount-1}if(forceUpdate||newModel.pageIndex!==that.model.pageIndex||newModel.pageSize!==that.model.pageSize||newModel.sortKey!==that.model.sortKey||newModel.sortDir!==that.model.sortDir){var sorted=isCurrentColumnSortable(getColumnDefs(that),newModel)?that.options.sorter(that,newModel):null;that.permutation=sorted;that.events.onModelChange.fire(newModel,that.model,that);fluid.model.copyModel(that.model,newModel)}}function generateColumnClick(overallThat,columnDef,opts){return function(){if(columnDef.sortable===true){var model=overallThat.model;var newModel=fluid.copy(model);var styles=overallThat.options.styles;var oldKey=model.sortKey;if(columnDef.key!==model.sortKey){newModel.sortKey=columnDef.key;newModel.sortDir=1;var oldBig=bigHeaderForKey(oldKey,opts);if(oldBig){setSortHeaderClass(styles,oldBig,0)}}else{if(newModel.sortKey===columnDef.key){newModel.sortDir=-1*newModel.sortDir}else{return false}}newModel.pageIndex=0;fireModelChange(overallThat,newModel,true);setModelSortHeaderClass(newModel,opts)}return false}}function fetchHeaderDecorators(decorators,columnDef){return decorators[columnDef.sortable?"sortableHeader":"unsortableHeader"]}function generateHeader(overallThat,newModel,columnDefs,opts){var sortableColumnTxt=opts.options.strings.sortableColumnText;if(newModel.sortDir===1){sortableColumnTxt=opts.options.strings.sortableColumnTextAsc}else{if(newModel.sortDir===-1){sortableColumnTxt=opts.options.strings.sortableColumnTextDesc}}return{children:fluid.transform(columnDefs,function(columnDef){return{ID:iDforColumn(columnDef,opts),value:columnDef.label,decorators:[{jQuery:["click",generateColumnClick(overallThat,columnDef,opts)]},{identify:"header:"+columnDef.key},{type:"attrs",attributes:{title:(columnDef.key===newModel.sortKey)?sortableColumnTxt:opts.options.strings.sortableColumnText}}].concat(fetchHeaderDecorators(opts.overallOptions.decorators,columnDef))}})}}fluid.pager.selfRender=function(overallThat,inOptions){var that=fluid.initView("fluid.pager.selfRender",overallThat.container,inOptions);var options=that.options;options.renderOptions.idMap=options.renderOptions.idMap||{};var idMap=options.renderOptions.idMap;var root=that.locate("root");var template=fluid.selfRender(root,{},options.renderOptions);root.addClass(options.styles.root);var columnDefs=getColumnDefs(overallThat);var expOpts={options:options,columnDefs:columnDefs,overallOptions:overallThat.options,dataModel:overallThat.options.dataModel,idMap:idMap};var directModel=fetchModel(overallThat);return{returnedOptions:{listeners:{onModelChange:function(newModel,oldModel){var filtered=overallThat.options.modelFilter(directModel,newModel,overallThat.permutation);var tree=fluid.transform(filtered,function(filteredRow){getRoots(expOpts,overallThat,filteredRow.index);if(columnDefs==="explode"){return fluid.explode(filteredRow.row,expOpts.longRoot)}else{if(columnDefs.length){return expandColumnDefs(filteredRow,expOpts)}}});var fullTree={};fullTree[options.row]=tree;if(typeof (columnDefs)==="object"){fullTree[options.header]=generateHeader(overallThat,newModel,columnDefs,expOpts)}options.renderOptions=options.renderOptions||{};options.renderOptions.model=expOpts.dataModel;fluid.reRender(template,root,fullTree,options.renderOptions);overallThat.events.afterRender.fire(overallThat);setModelSortHeaderClass(newModel,expOpts)}}}}};fluid.defaults("fluid.pager.selfRender",{selectors:{root:".flc-pager-body-template"},styles:{root:"fl-pager"},keyStrategy:"id",keyPrefix:"",row:"row:",header:"header:",strings:{sortableColumnText:"Select to sort",sortableColumnTextDesc:"Select to sort in ascending, currently in descending order.",sortableColumnTextAsc:"Select to sort in descending, currently in ascending order."},renderOptions:{}});fluid.pager.summaryAria=function(element){element.attr({"aria-relevant":"all","aria-atomic":"false","aria-live":"assertive",role:"status"})};fluid.pager.summary=function(dom,options){var node=dom.locate("summary");fluid.pager.summaryAria(node);return{returnedOptions:{listeners:{onModelChange:function(newModel,oldModel){var text=fluid.stringTemplate(options.message,{first:newModel.pageIndex*newModel.pageSize+1,last:fluid.pager.computePageLimit(newModel),total:newModel.totalRange,currentPage:newModel.pageIndex+1});if(node.length>0){node.text(text)}}}}}};fluid.pager.directPageSize=function(that){var node=that.locate("pageSize");if(node.length>0){that.events.onModelChange.addListener(function(newModel,oldModel){if(node.val()!==newModel.pageSize){node.val(newModel.pageSize)}});node.change(function(){that.events.initiatePageSizeChange.fire(node.val())})}};fluid.pager.rangeAnnotator=function(that,options){var roots={};that.events.onRenderPageLinks.addListener(function(tree,newModel){var column=that.options.annotateColumnRange;var dataModel=that.options.dataModel;var columnDefs=getColumnDefs(that);if(!column||!dataModel||!columnDefs){return }var columnDef=fluid.pager.findColumnDef(columnDefs,column);function fetchValue(index){index=that.permutation?that.permutation[index]:index;return fluid.pager.fetchValue(that,dataModel,index,columnDef.valuebinding,roots)}var tModel={};fluid.model.copyModel(tModel,newModel);fluid.transform(tree,function(cell){if(cell.ID==="page-link:link"){var page=cell.pageIndex;var start=page*tModel.pageSize;tModel.pageIndex=page;var limit=fluid.pager.computePageLimit(tModel);var iValue=fetchValue(start);var lValue=fetchValue(limit-1);var tooltipOpts=fluid.copy(that.options.tooltip.options)||{};if(!tooltipOpts.content){tooltipOpts.content=function(){return fluid.stringTemplate(that.options.markup.rangeAnnotation,{first:iValue,last:lValue})}}if(!cell.current){var decorators=[{type:"fluid",func:that.options.tooltip.type,options:tooltipOpts},{identify:page}];cell.decorators=cell.decorators.concat(decorators)}}})})};fluid.pagerImpl=function(container,options){var that=fluid.initView("fluid.pager",container,options);that.container.attr("role","application");that.events.initiatePageChange.addListener(function(arg){var newModel=fluid.copy(that.model);if(arg.relativePage!==undefined){newModel.pageIndex=that.model.pageIndex+arg.relativePage}else{newModel.pageIndex=arg.pageIndex}if(newModel.pageIndex===undefined||newModel.pageIndex<0){newModel.pageIndex=0}fireModelChange(that,newModel,arg.forceUpdate)});that.events.initiatePageSizeChange.addListener(function(arg){var newModel=fluid.copy(that.model);newModel.pageSize=arg;fireModelChange(that,newModel)});var pagerBarElement=that.locate("pagerBar");if(pagerBarElement.length>0){that.pagerBar=fluid.initSubcomponent(that,"pagerBar",[that.events,pagerBarElement,fluid.COMPONENT_OPTIONS,that.options.strings])}var pagerBarSecondaryElement=that.locate("pagerBarSecondary");if(pagerBarSecondaryElement.length>0){that.pagerBarSecondary=fluid.initSubcomponent(that,"pagerBar",[that.events,pagerBarSecondaryElement,fluid.COMPONENT_OPTIONS,that.options.strings])}that.bodyRenderer=fluid.initSubcomponent(that,"bodyRenderer",[that,fluid.COMPONENT_OPTIONS]);that.summary=fluid.initSubcomponent(that,"summary",[that.dom,fluid.COMPONENT_OPTIONS]);that.pageSize=fluid.initSubcomponent(that,"pageSize",[that]);that.rangeAnnotator=fluid.initSubcomponent(that,"rangeAnnotator",[that,fluid.COMPONENT_OPTIONS]);that.model=fluid.copy(that.options.model);var dataModel=fetchModel(that);if(dataModel){that.model.totalRange=dataModel.length}if(that.model.totalRange===undefined){if(!that.pagerBar){fluid.fail("Error in Pager configuration - cannot determine total range, since not configured in model.totalRange and no PagerBar is configured")}that.model=that.pagerBar.pageList.defaultModel}that.applier=fluid.makeChangeApplier(that.model);that.events.initiatePageChange.fire({pageIndex:that.model.pageIndex?that.model.pageIndex:0,forceUpdate:true});return that};fluid.defaults("fluid.pager",{mergePolicy:{dataModel:"preserve",model:"preserve"},pagerBar:{type:"fluid.pager.pagerBar"},summary:{type:"fluid.pager.summary",options:{message:"Viewing page %currentPage. Showing records %first - %last of %total items."}},pageSize:{type:"fluid.pager.directPageSize"},modelFilter:fluid.pager.directModelFilter,sorter:fluid.pager.basicSorter,bodyRenderer:{type:"fluid.pager.selfRender"},model:{pageIndex:undefined,pageSize:10,totalRange:undefined},dataModel:undefined,dataOffset:"",columnDefs:[],annotateColumnRange:undefined,tooltip:{type:"fluid.tooltip"},rangeAnnotator:{type:"fluid.pager.rangeAnnotator"},selectors:{pagerBar:".flc-pager-top",pagerBarSecondary:".flc-pager-bottom",summary:".flc-pager-summary",pageSize:".flc-pager-page-size",headerSortStylisticOffset:".flc-pager-sort-header"},styles:{ascendingHeader:"fl-pager-asc",descendingHeader:"fl-pager-desc"},decorators:{sortableHeader:[],unsortableHeader:[]},strings:{last:" (last)"},events:{initiatePageChange:null,initiatePageSizeChange:null,onModelChange:null,onRenderPageLinks:null,afterRender:null},markup:{rangeAnnotation:" %first

%last "}})})(jQuery,fluid_1_4);var fluid_1_4=fluid_1_4||{};(function($,fluid){var animateDisplay=function(elm,animation,defaultAnimation){animation=(animation)?animation:defaultAnimation;elm.animate(animation.params,animation.duration,animation.callback)};var animateProgress=function(elm,width,speed){elm.queue("fx",[]);elm.animate({width:width,queue:false},speed)};var showProgress=function(that,animation){if(animation===false){that.displayElement.show()}else{animateDisplay(that.displayElement,animation,that.options.showAnimation)}};var hideProgress=function(that,delay,animation){delay=(delay===null||isNaN(delay))?that.options.delay:delay;if(delay){var timeOut=setTimeout(function(){hideProgress(that,0,animation)},delay)}else{if(animation===false){that.displayElement.hide()}else{animateDisplay(that.displayElement,animation,that.options.hideAnimation)}}};var updateWidth=function(that,newWidth,dontAnimate){dontAnimate=dontAnimate||false;var currWidth=that.indicator.width();var direction=that.options.animate;if((newWidth>currWidth)&&(direction==="both"||direction==="forward")&&!dontAnimate){animateProgress(that.indicator,newWidth,that.options.speed)}else{if((newWidth0;that.ariaElement.attr("aria-busy",busy);that.ariaElement.attr("aria-valuenow",percent);if(str.ariaBusyText){if(busy){var busyString=fluid.stringTemplate(str.ariaBusyText,{percentComplete:percent});that.ariaElement.attr("aria-valuetext",busyString)}else{if(percent===100){that.ariaElement.attr("aria-valuetext",str.ariaDoneText)}}}};var updateText=function(label,value){label.html(value)};var repositionIndicator=function(that){that.indicator.css("top",that.progressBar.position().top).css("left",0).height(that.progressBar.height());refreshRelativeWidth(that)};var updateProgress=function(that,percent,labelText,animationForShow){showProgress(that,animationForShow);if(percent!==null){that.storedPercent=percent;var pixels=Math.max(percentToPixels(that,parseFloat(percent)),that.options.minWidth);updateWidth(that,pixels)}if(labelText!==null){updateText(that.label,labelText)}if(that.ariaElement){updateARIA(that,percent)}};var setupProgress=function(that){that.displayElement=that.locate("displayElement");if(that.options.initiallyHidden){that.displayElement.hide()}that.progressBar=that.locate("progressBar");that.label=that.locate("label");that.indicator=that.locate("indicator");that.ariaElement=that.locate("ariaElement");that.indicator.width(that.options.minWidth);that.storedPercent=0;if(that.ariaElement){initARIA(that.ariaElement,that.options.strings.ariaBusyText)}if(that.options.hideAnimation.callback){that.events.afterProgressHidden.addListener(that.options.hideAnimation.callback)}that.options.hideAnimation.callback=that.events.afterProgressHidden.fire;if(that.options.showAnimation.callback){that.events.onProgressBegin.addListener(that.options.showAnimation.callback)}that.options.showAnimation.callback=that.events.onProgressBegin.fire};fluid.progress=function(container,options){var that=fluid.initView("fluid.progress",container,options);setupProgress(that);that.show=function(animation){showProgress(that,animation)};that.hide=function(delay,animation){hideProgress(that,delay,animation)};that.update=function(percentage,labelValue,animationForShow){updateProgress(that,percentage,labelValue,animationForShow)};that.refreshView=function(){repositionIndicator(that)};return that};fluid.defaults("fluid.progress",{gradeNames:"fluid.viewComponent",selectors:{displayElement:".flc-progress",progressBar:".flc-progress-bar",indicator:".flc-progress-indicator",label:".flc-progress-label",ariaElement:".flc-progress-bar"},strings:{ariaBusyText:"Progress is %percentComplete percent complete",ariaDoneText:"Progress is complete."},showAnimation:{params:{opacity:"show"},duration:"slow",callback:null},hideAnimation:{params:{opacity:"hide"},duration:"slow",callback:null},events:{onProgressBegin:null,afterProgressHidden:null},minWidth:5,delay:0,speed:200,animate:"forward",initiallyHidden:true,updatePosition:false})})(jQuery,fluid_1_4);(function($,undefined){$.widget("ui.draggable",$.ui.mouse,{widgetEventPrefix:"drag",options:{addClasses:true,appendTo:"parent",axis:false,connectToSortable:false,containment:false,cursor:"auto",cursorAt:false,grid:false,handle:false,helper:"original",iframeFix:false,opacity:false,refreshPositions:false,revert:false,revertDuration:500,scope:"default",scroll:true,scrollSensitivity:20,scrollSpeed:20,snap:false,snapMode:"both",snapTolerance:20,stack:false,zIndex:false},_create:function(){if(this.options.helper=="original"&&!(/^(?:r|a|f)/).test(this.element.css("position"))){this.element[0].style.position="relative"}(this.options.addClasses&&this.element.addClass("ui-draggable"));(this.options.disabled&&this.element.addClass("ui-draggable-disabled"));this._mouseInit()},destroy:function(){if(!this.element.data("draggable")){return }this.element.removeData("draggable").unbind(".draggable").removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled");this._mouseDestroy();return this},_mouseCapture:function(event){var o=this.options;if(this.helper||o.disabled||$(event.target).is(".ui-resizable-handle")){return false}this.handle=this._getHandle(event);if(!this.handle){return false}return true},_mouseStart:function(event){var o=this.options;this.helper=this._createHelper(event);this._cacheHelperProportions();if($.ui.ddmanager){$.ui.ddmanager.current=this}this._cacheMargins();this.cssPosition=this.helper.css("position");this.scrollParent=this.helper.scrollParent();this.offset=this.positionAbs=this.element.offset();this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left};$.extend(this.offset,{click:{left:event.pageX-this.offset.left,top:event.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()});this.originalPosition=this.position=this._generatePosition(event);this.originalPageX=event.pageX;this.originalPageY=event.pageY;(o.cursorAt&&this._adjustOffsetFromHelper(o.cursorAt));if(o.containment){this._setContainment()}if(this._trigger("start",event)===false){this._clear();return false}this._cacheHelperProportions();if($.ui.ddmanager&&!o.dropBehaviour){$.ui.ddmanager.prepareOffsets(this,event)}this.helper.addClass("ui-draggable-dragging");this._mouseDrag(event,true);return true},_mouseDrag:function(event,noPropagation){this.position=this._generatePosition(event);this.positionAbs=this._convertPositionTo("absolute");if(!noPropagation){var ui=this._uiHash();if(this._trigger("drag",event,ui)===false){this._mouseUp({});return false}this.position=ui.position}if(!this.options.axis||this.options.axis!="y"){this.helper[0].style.left=this.position.left+"px"}if(!this.options.axis||this.options.axis!="x"){this.helper[0].style.top=this.position.top+"px"}if($.ui.ddmanager){$.ui.ddmanager.drag(this,event)}return false},_mouseStop:function(event){var dropped=false;if($.ui.ddmanager&&!this.options.dropBehaviour){dropped=$.ui.ddmanager.drop(this,event)}if(this.dropped){dropped=this.dropped;this.dropped=false}if((!this.element[0]||!this.element[0].parentNode)&&this.options.helper=="original"){return false}if((this.options.revert=="invalid"&&!dropped)||(this.options.revert=="valid"&&dropped)||this.options.revert===true||($.isFunction(this.options.revert)&&this.options.revert.call(this.element,dropped))){var self=this;$(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){if(self._trigger("stop",event)!==false){self._clear()}})}else{if(this._trigger("stop",event)!==false){this._clear()}}return false},cancel:function(){if(this.helper.is(".ui-draggable-dragging")){this._mouseUp({})}else{this._clear()}return this},_getHandle:function(event){var handle=!this.options.handle||!$(this.options.handle,this.element).length?true:false;$(this.options.handle,this.element).find("*").andSelf().each(function(){if(this==event.target){handle=true}});return handle},_createHelper:function(event){var o=this.options;var helper=$.isFunction(o.helper)?$(o.helper.apply(this.element[0],[event])):(o.helper=="clone"?this.element.clone():this.element);if(!helper.parents("body").length){helper.appendTo((o.appendTo=="parent"?this.element[0].parentNode:o.appendTo))}if(helper[0]!=this.element[0]&&!(/(fixed|absolute)/).test(helper.css("position"))){helper.css("position","absolute")}return helper},_adjustOffsetFromHelper:function(obj){if(typeof obj=="string"){obj=obj.split(" ")}if($.isArray(obj)){obj={left:+obj[0],top:+obj[1]||0}}if("left" in obj){this.offset.click.left=obj.left+this.margins.left}if("right" in obj){this.offset.click.left=this.helperProportions.width-obj.right+this.margins.left}if("top" in obj){this.offset.click.top=obj.top+this.margins.top}if("bottom" in obj){this.offset.click.top=this.helperProportions.height-obj.bottom+this.margins.top}},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var po=this.offsetParent.offset();if(this.cssPosition=="absolute"&&this.scrollParent[0]!=document&&$.ui.contains(this.scrollParent[0],this.offsetParent[0])){po.left+=this.scrollParent.scrollLeft();po.top+=this.scrollParent.scrollTop()}if((this.offsetParent[0]==document.body)||(this.offsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase()=="html"&&$.browser.msie)){po={top:0,left:0}}return{top:po.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:po.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if(this.cssPosition=="relative"){var p=this.element.position();return{top:p.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:p.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}else{return{top:0,left:0}}},_cacheMargins:function(){this.margins={left:(parseInt(this.element.css("marginLeft"),10)||0),top:(parseInt(this.element.css("marginTop"),10)||0),right:(parseInt(this.element.css("marginRight"),10)||0),bottom:(parseInt(this.element.css("marginBottom"),10)||0)}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var o=this.options;if(o.containment=="parent"){o.containment=this.helper[0].parentNode}if(o.containment=="document"||o.containment=="window"){this.containment=[(o.containment=="document"?0:$(window).scrollLeft())-this.offset.relative.left-this.offset.parent.left,(o.containment=="document"?0:$(window).scrollTop())-this.offset.relative.top-this.offset.parent.top,(o.containment=="document"?0:$(window).scrollLeft())+$(o.containment=="document"?document:window).width()-this.helperProportions.width-this.margins.left,(o.containment=="document"?0:$(window).scrollTop())+($(o.containment=="document"?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]}if(!(/^(document|window|parent)$/).test(o.containment)&&o.containment.constructor!=Array){var ce=$(o.containment)[0];if(!ce){return }var co=$(o.containment).offset();var over=($(ce).css("overflow")!="hidden");this.containment=[co.left+(parseInt($(ce).css("borderLeftWidth"),10)||0)+(parseInt($(ce).css("paddingLeft"),10)||0),co.top+(parseInt($(ce).css("borderTopWidth"),10)||0)+(parseInt($(ce).css("paddingTop"),10)||0),co.left+(over?Math.max(ce.scrollWidth,ce.offsetWidth):ce.offsetWidth)-(parseInt($(ce).css("borderLeftWidth"),10)||0)-(parseInt($(ce).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left-this.margins.right,co.top+(over?Math.max(ce.scrollHeight,ce.offsetHeight):ce.offsetHeight)-(parseInt($(ce).css("borderTopWidth"),10)||0)-(parseInt($(ce).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top-this.margins.bottom]}else{if(o.containment.constructor==Array){this.containment=o.containment}}},_convertPositionTo:function(d,pos){if(!pos){pos=this.position}var mod=d=="absolute"?1:-1;var o=this.options,scroll=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&$.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,scrollIsRootNode=(/(html|body)/i).test(scroll[0].tagName);return{top:(pos.top+this.offset.relative.top*mod+this.offset.parent.top*mod-($.browser.safari&&$.browser.version<526&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():(scrollIsRootNode?0:scroll.scrollTop()))*mod)),left:(pos.left+this.offset.relative.left*mod+this.offset.parent.left*mod-($.browser.safari&&$.browser.version<526&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():scrollIsRootNode?0:scroll.scrollLeft())*mod))}},_generatePosition:function(event){var o=this.options,scroll=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&$.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,scrollIsRootNode=(/(html|body)/i).test(scroll[0].tagName);var pageX=event.pageX;var pageY=event.pageY;if(this.originalPosition){if(this.containment){if(event.pageX-this.offset.click.leftthis.containment[2]){pageX=this.containment[2]+this.offset.click.left}if(event.pageY-this.offset.click.top>this.containment[3]){pageY=this.containment[3]+this.offset.click.top}}if(o.grid){var top=this.originalPageY+Math.round((pageY-this.originalPageY)/o.grid[1])*o.grid[1];pageY=this.containment?(!(top-this.offset.click.topthis.containment[3])?top:(!(top-this.offset.click.topthis.containment[2])?left:(!(left-this.offset.click.left').css({width:this.offsetWidth+"px",height:this.offsetHeight+"px",position:"absolute",opacity:"0.001",zIndex:1000}).css($(this).offset()).appendTo("body")})},stop:function(event,ui){$("div.ui-draggable-iframeFix").each(function(){this.parentNode.removeChild(this)})}});$.ui.plugin.add("draggable","opacity",{start:function(event,ui){var t=$(ui.helper),o=$(this).data("draggable").options;if(t.css("opacity")){o._opacity=t.css("opacity")}t.css("opacity",o.opacity)},stop:function(event,ui){var o=$(this).data("draggable").options;if(o._opacity){$(ui.helper).css("opacity",o._opacity)}}});$.ui.plugin.add("draggable","scroll",{start:function(event,ui){var i=$(this).data("draggable");if(i.scrollParent[0]!=document&&i.scrollParent[0].tagName!="HTML"){i.overflowOffset=i.scrollParent.offset()}},drag:function(event,ui){var i=$(this).data("draggable"),o=i.options,scrolled=false;if(i.scrollParent[0]!=document&&i.scrollParent[0].tagName!="HTML"){if(!o.axis||o.axis!="x"){if((i.overflowOffset.top+i.scrollParent[0].offsetHeight)-event.pageY=0;i--){var l=inst.snapElements[i].left,r=l+inst.snapElements[i].width,t=inst.snapElements[i].top,b=t+inst.snapElements[i].height;if(!((l-d")).appendTo(document.body).hide().addClass(uiDialogClasses+options.dialogClass).css({zIndex:options.zIndex}).attr("tabIndex",-1).css("outline",0).keydown(function(event){if(options.closeOnEscape&&event.keyCode&&event.keyCode===$.ui.keyCode.ESCAPE){self.close(event);event.preventDefault()}}).attr({role:"dialog","aria-labelledby":titleId}).mousedown(function(event){self.moveToTop(false,event)}),uiDialogContent=self.element.show().removeAttr("title").addClass("ui-dialog-content ui-widget-content").appendTo(uiDialog),uiDialogTitlebar=(self.uiDialogTitlebar=$("
")).addClass("ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix").prependTo(uiDialog),uiDialogTitlebarClose=$('').addClass("ui-dialog-titlebar-close ui-corner-all").attr("role","button").hover(function(){uiDialogTitlebarClose.addClass("ui-state-hover")},function(){uiDialogTitlebarClose.removeClass("ui-state-hover")}).focus(function(){uiDialogTitlebarClose.addClass("ui-state-focus")}).blur(function(){uiDialogTitlebarClose.removeClass("ui-state-focus")}).click(function(event){self.close(event);return false}).appendTo(uiDialogTitlebar),uiDialogTitlebarCloseText=(self.uiDialogTitlebarCloseText=$("")).addClass("ui-icon ui-icon-closethick").text(options.closeText).appendTo(uiDialogTitlebarClose),uiDialogTitle=$("").addClass("ui-dialog-title").attr("id",titleId).html(title).prependTo(uiDialogTitlebar);if($.isFunction(options.beforeclose)&&!$.isFunction(options.beforeClose)){options.beforeClose=options.beforeclose}uiDialogTitlebar.find("*").add(uiDialogTitlebar).disableSelection();if(options.draggable&&$.fn.draggable){self._makeDraggable()}if(options.resizable&&$.fn.resizable){self._makeResizable()}self._createButtons(options.buttons);self._isOpen=false;if($.fn.bgiframe){uiDialog.bgiframe()}},_init:function(){if(this.options.autoOpen){this.open()}},destroy:function(){var self=this;if(self.overlay){self.overlay.destroy()}self.uiDialog.hide();self.element.unbind(".dialog").removeData("dialog").removeClass("ui-dialog-content ui-widget-content").hide().appendTo("body");self.uiDialog.remove();if(self.originalTitle){self.element.attr("title",self.originalTitle)}return self},widget:function(){return this.uiDialog},close:function(event){var self=this,maxZ,thisZ;if(false===self._trigger("beforeClose",event)){return }if(self.overlay){self.overlay.destroy()}self.uiDialog.unbind("keypress.ui-dialog");self._isOpen=false;if(self.options.hide){self.uiDialog.hide(self.options.hide,function(){self._trigger("close",event)})}else{self.uiDialog.hide();self._trigger("close",event)}$.ui.dialog.overlay.resize();if(self.options.modal){maxZ=0;$(".ui-dialog").each(function(){if(this!==self.uiDialog[0]){thisZ=$(this).css("z-index");if(!isNaN(thisZ)){maxZ=Math.max(maxZ,thisZ)}}});$.ui.dialog.maxZ=maxZ}return self},isOpen:function(){return this._isOpen},moveToTop:function(force,event){var self=this,options=self.options,saveScroll;if((options.modal&&!force)||(!options.stack&&!options.modal)){return self._trigger("focus",event)}if(options.zIndex>$.ui.dialog.maxZ){$.ui.dialog.maxZ=options.zIndex}if(self.overlay){$.ui.dialog.maxZ+=1;self.overlay.$el.css("z-index",$.ui.dialog.overlay.maxZ=$.ui.dialog.maxZ)}saveScroll={scrollTop:self.element.attr("scrollTop"),scrollLeft:self.element.attr("scrollLeft")};$.ui.dialog.maxZ+=1;self.uiDialog.css("z-index",$.ui.dialog.maxZ);self.element.attr(saveScroll);self._trigger("focus",event);return self},open:function(){if(this._isOpen){return }var self=this,options=self.options,uiDialog=self.uiDialog;self.overlay=options.modal?new $.ui.dialog.overlay(self):null;self._size();self._position(options.position);uiDialog.show(options.show);self.moveToTop(true);if(options.modal){uiDialog.bind("keypress.ui-dialog",function(event){if(event.keyCode!==$.ui.keyCode.TAB){return }var tabbables=$(":tabbable",this),first=tabbables.filter(":first"),last=tabbables.filter(":last");if(event.target===last[0]&&!event.shiftKey){first.focus(1);return false}else{if(event.target===first[0]&&event.shiftKey){last.focus(1);return false}}})}$(self.element.find(":tabbable").get().concat(uiDialog.find(".ui-dialog-buttonpane :tabbable").get().concat(uiDialog.get()))).eq(0).focus();self._isOpen=true;self._trigger("open");return self},_createButtons:function(buttons){var self=this,hasButtons=false,uiDialogButtonPane=$("
").addClass("ui-dialog-buttonpane ui-widget-content ui-helper-clearfix"),uiButtonSet=$("
").addClass("ui-dialog-buttonset").appendTo(uiDialogButtonPane);self.uiDialog.find(".ui-dialog-buttonpane").remove();if(typeof buttons==="object"&&buttons!==null){$.each(buttons,function(){return !(hasButtons=true)})}if(hasButtons){$.each(buttons,function(name,props){props=$.isFunction(props)?{click:props,text:name}:props;var button=$('').click(function(){props.click.apply(self.element[0],arguments)}).appendTo(uiButtonSet);$.each(props,function(key,value){if(key==="click"){return }if(key in attrFn){button[key](value)}else{button.attr(key,value)}});if($.fn.button){button.button()}});uiDialogButtonPane.appendTo(self.uiDialog)}},_makeDraggable:function(){var self=this,options=self.options,doc=$(document),heightBeforeDrag;function filteredUi(ui){return{position:ui.position,offset:ui.offset}}self.uiDialog.draggable({cancel:".ui-dialog-content, .ui-dialog-titlebar-close",handle:".ui-dialog-titlebar",containment:"document",start:function(event,ui){heightBeforeDrag=options.height==="auto"?"auto":$(this).height();$(this).height($(this).height()).addClass("ui-dialog-dragging");self._trigger("dragStart",event,filteredUi(ui))},drag:function(event,ui){self._trigger("drag",event,filteredUi(ui))},stop:function(event,ui){options.position=[ui.position.left-doc.scrollLeft(),ui.position.top-doc.scrollTop()];$(this).removeClass("ui-dialog-dragging").height(heightBeforeDrag);self._trigger("dragStop",event,filteredUi(ui));$.ui.dialog.overlay.resize()}})},_makeResizable:function(handles){handles=(handles===undefined?this.options.resizable:handles);var self=this,options=self.options,position=self.uiDialog.css("position"),resizeHandles=(typeof handles==="string"?handles:"n,e,s,w,se,sw,ne,nw");function filteredUi(ui){return{originalPosition:ui.originalPosition,originalSize:ui.originalSize,position:ui.position,size:ui.size}}self.uiDialog.resizable({cancel:".ui-dialog-content",containment:"document",alsoResize:self.element,maxWidth:options.maxWidth,maxHeight:options.maxHeight,minWidth:options.minWidth,minHeight:self._minHeight(),handles:resizeHandles,start:function(event,ui){$(this).addClass("ui-dialog-resizing");self._trigger("resizeStart",event,filteredUi(ui))},resize:function(event,ui){self._trigger("resize",event,filteredUi(ui))},stop:function(event,ui){$(this).removeClass("ui-dialog-resizing");options.height=$(this).height();options.width=$(this).width();self._trigger("resizeStop",event,filteredUi(ui));$.ui.dialog.overlay.resize()}}).css("position",position).find(".ui-resizable-se").addClass("ui-icon ui-icon-grip-diagonal-se")},_minHeight:function(){var options=this.options;if(options.height==="auto"){return options.minHeight}else{return Math.min(options.minHeight,options.height)}},_position:function(position){var myAt=[],offset=[0,0],isVisible;if(position){if(typeof position==="string"||(typeof position==="object"&&"0" in position)){myAt=position.split?position.split(" "):[position[0],position[1]];if(myAt.length===1){myAt[1]=myAt[0]}$.each(["left","top"],function(i,offsetPosition){if(+myAt[i]===myAt[i]){offset[i]=myAt[i];myAt[i]=offsetPosition}});position={my:myAt.join(" "),at:myAt.join(" "),offset:offset.join(" ")}}position=$.extend({},$.ui.dialog.prototype.options.position,position)}else{position=$.ui.dialog.prototype.options.position}isVisible=this.uiDialog.is(":visible");if(!isVisible){this.uiDialog.show()}this.uiDialog.css({top:0,left:0}).position($.extend({of:window},position));if(!isVisible){this.uiDialog.hide()}},_setOptions:function(options){var self=this,resizableOptions={},resize=false;$.each(options,function(key,value){self._setOption(key,value);if(key in sizeRelatedOptions){resize=true}if(key in resizableRelatedOptions){resizableOptions[key]=value}});if(resize){this._size()}if(this.uiDialog.is(":data(resizable)")){this.uiDialog.resizable("option",resizableOptions)}},_setOption:function(key,value){var self=this,uiDialog=self.uiDialog;switch(key){case"beforeclose":key="beforeClose";break;case"buttons":self._createButtons(value);break;case"closeText":self.uiDialogTitlebarCloseText.text(""+value);break;case"dialogClass":uiDialog.removeClass(self.options.dialogClass).addClass(uiDialogClasses+value);break;case"disabled":if(value){uiDialog.addClass("ui-dialog-disabled")}else{uiDialog.removeClass("ui-dialog-disabled")}break;case"draggable":var isDraggable=uiDialog.is(":data(draggable)");if(isDraggable&&!value){uiDialog.draggable("destroy")}if(!isDraggable&&value){self._makeDraggable()}break;case"position":self._position(value);break;case"resizable":var isResizable=uiDialog.is(":data(resizable)");if(isResizable&&!value){uiDialog.resizable("destroy")}if(isResizable&&typeof value==="string"){uiDialog.resizable("option","handles",value)}if(!isResizable&&value!==false){self._makeResizable(value)}break;case"title":$(".ui-dialog-title",self.uiDialogTitlebar).html(""+(value||" "));break}$.Widget.prototype._setOption.apply(self,arguments)},_size:function(){var options=this.options,nonContentHeight,minContentHeight,isVisible=this.uiDialog.is(":visible");this.element.show().css({width:"auto",minHeight:0,height:0});if(options.minWidth>options.width){options.width=options.minWidth}nonContentHeight=this.uiDialog.css({height:"auto",width:options.width}).height();minContentHeight=Math.max(0,options.minHeight-nonContentHeight);if(options.height==="auto"){if($.support.minHeight){this.element.css({minHeight:minContentHeight,height:"auto"})}else{this.uiDialog.show();var autoHeight=this.element.css("height","auto").height();if(!isVisible){this.uiDialog.hide()}this.element.height(Math.max(autoHeight,minContentHeight))}}else{this.element.height(Math.max(options.height-nonContentHeight,0))}if(this.uiDialog.is(":data(resizable)")){this.uiDialog.resizable("option","minHeight",this._minHeight())}}});$.extend($.ui.dialog,{version:"1.8.12",uuid:0,maxZ:0,getTitleId:function($el){var id=$el.attr("id");if(!id){this.uuid+=1;id=this.uuid}return"ui-dialog-title-"+id},overlay:function(dialog){this.$el=$.ui.dialog.overlay.create(dialog)}});$.extend($.ui.dialog.overlay,{instances:[],oldInstances:[],maxZ:0,events:$.map("focus,mousedown,mouseup,keydown,keypress,click".split(","),function(event){return event+".dialog-overlay"}).join(" "),create:function(dialog){if(this.instances.length===0){setTimeout(function(){if($.ui.dialog.overlay.instances.length){$(document).bind($.ui.dialog.overlay.events,function(event){if($(event.target).zIndex()<$.ui.dialog.overlay.maxZ){return false}})}},1);$(document).bind("keydown.dialog-overlay",function(event){if(dialog.options.closeOnEscape&&event.keyCode&&event.keyCode===$.ui.keyCode.ESCAPE){dialog.close(event);event.preventDefault()}});$(window).bind("resize.dialog-overlay",$.ui.dialog.overlay.resize)}var $el=(this.oldInstances.pop()||$("
").addClass("ui-widget-overlay")).appendTo(document.body).css({width:this.width(),height:this.height()});if($.fn.bgiframe){$el.bgiframe()}this.instances.push($el);return $el},destroy:function($el){var indexOf=$.inArray($el,this.instances);if(indexOf!=-1){this.oldInstances.push(this.instances.splice(indexOf,1)[0])}if(this.instances.length===0){$([document,window]).unbind(".dialog-overlay")}$el.remove();var maxZ=0;$.each(this.instances,function(){maxZ=Math.max(maxZ,this.css("z-index"))});this.maxZ=maxZ},height:function(){var scrollHeight,offsetHeight;if($.browser.msie&&$.browser.version<7){scrollHeight=Math.max(document.documentElement.scrollHeight,document.body.scrollHeight);offsetHeight=Math.max(document.documentElement.offsetHeight,document.body.offsetHeight);if(scrollHeight");if(!o.values){o.values=[this._valueMin(),this._valueMin()]}if(o.values.length&&o.values.length!==2){o.values=[o.values[0],o.values[0]]}}else{this.range=$("
")}this.range.appendTo(this.element).addClass("ui-slider-range");if(o.range==="min"||o.range==="max"){this.range.addClass("ui-slider-range-"+o.range)}this.range.addClass("ui-widget-header")}if($(".ui-slider-handle",this.element).length===0){$("").appendTo(this.element).addClass("ui-slider-handle")}if(o.values&&o.values.length){while($(".ui-slider-handle",this.element).length").appendTo(this.element).addClass("ui-slider-handle")}}this.handles=$(".ui-slider-handle",this.element).addClass("ui-state-default ui-corner-all");this.handle=this.handles.eq(0);this.handles.add(this.range).filter("a").click(function(event){event.preventDefault()}).hover(function(){if(!o.disabled){$(this).addClass("ui-state-hover")}},function(){$(this).removeClass("ui-state-hover")}).focus(function(){if(!o.disabled){$(".ui-slider .ui-state-focus").removeClass("ui-state-focus");$(this).addClass("ui-state-focus")}else{$(this).blur()}}).blur(function(){$(this).removeClass("ui-state-focus")});this.handles.each(function(i){$(this).data("index.ui-slider-handle",i)});this.handles.keydown(function(event){var ret=true,index=$(this).data("index.ui-slider-handle"),allowed,curVal,newVal,step;if(self.options.disabled){return }switch(event.keyCode){case $.ui.keyCode.HOME:case $.ui.keyCode.END:case $.ui.keyCode.PAGE_UP:case $.ui.keyCode.PAGE_DOWN:case $.ui.keyCode.UP:case $.ui.keyCode.RIGHT:case $.ui.keyCode.DOWN:case $.ui.keyCode.LEFT:ret=false;if(!self._keySliding){self._keySliding=true;$(this).addClass("ui-state-active");allowed=self._start(event,index);if(allowed===false){return }}break}step=self.options.step;if(self.options.values&&self.options.values.length){curVal=newVal=self.values(index)}else{curVal=newVal=self.value()}switch(event.keyCode){case $.ui.keyCode.HOME:newVal=self._valueMin();break;case $.ui.keyCode.END:newVal=self._valueMax();break;case $.ui.keyCode.PAGE_UP:newVal=self._trimAlignValue(curVal+((self._valueMax()-self._valueMin())/numPages));break;case $.ui.keyCode.PAGE_DOWN:newVal=self._trimAlignValue(curVal-((self._valueMax()-self._valueMin())/numPages));break;case $.ui.keyCode.UP:case $.ui.keyCode.RIGHT:if(curVal===self._valueMax()){return }newVal=self._trimAlignValue(curVal+step);break;case $.ui.keyCode.DOWN:case $.ui.keyCode.LEFT:if(curVal===self._valueMin()){return }newVal=self._trimAlignValue(curVal-step);break}self._slide(event,index,newVal);return ret}).keyup(function(event){var index=$(this).data("index.ui-slider-handle");if(self._keySliding){self._keySliding=false;self._stop(event,index);self._change(event,index);$(this).removeClass("ui-state-active")}});this._refreshValue();this._animateOff=false},destroy:function(){this.handles.remove();this.range.remove();this.element.removeClass("ui-slider ui-slider-horizontal ui-slider-vertical ui-slider-disabled ui-widget ui-widget-content ui-corner-all").removeData("slider").unbind(".slider");this._mouseDestroy();return this},_mouseCapture:function(event){var o=this.options,position,normValue,distance,closestHandle,self,index,allowed,offset,mouseOverHandle;if(o.disabled){return false}this.elementSize={width:this.element.outerWidth(),height:this.element.outerHeight()};this.elementOffset=this.element.offset();position={x:event.pageX,y:event.pageY};normValue=this._normValueFromMouse(position);distance=this._valueMax()-this._valueMin()+1;self=this;this.handles.each(function(i){var thisDistance=Math.abs(normValue-self.values(i));if(distance>thisDistance){distance=thisDistance;closestHandle=$(this);index=i}});if(o.range===true&&this.values(1)===o.min){index+=1;closestHandle=$(this.handles[index])}allowed=this._start(event,index);if(allowed===false){return false}this._mouseSliding=true;self._handleIndex=index;closestHandle.addClass("ui-state-active").focus();offset=closestHandle.offset();mouseOverHandle=!$(event.target).parents().andSelf().is(".ui-slider-handle");this._clickOffset=mouseOverHandle?{left:0,top:0}:{left:event.pageX-offset.left-(closestHandle.width()/2),top:event.pageY-offset.top-(closestHandle.height()/2)-(parseInt(closestHandle.css("borderTopWidth"),10)||0)-(parseInt(closestHandle.css("borderBottomWidth"),10)||0)+(parseInt(closestHandle.css("marginTop"),10)||0)};if(!this.handles.hasClass("ui-state-hover")){this._slide(event,index,normValue)}this._animateOff=true;return true},_mouseStart:function(event){return true},_mouseDrag:function(event){var position={x:event.pageX,y:event.pageY},normValue=this._normValueFromMouse(position);this._slide(event,this._handleIndex,normValue);return false},_mouseStop:function(event){this.handles.removeClass("ui-state-active");this._mouseSliding=false;this._stop(event,this._handleIndex);this._change(event,this._handleIndex);this._handleIndex=null;this._clickOffset=null;this._animateOff=false;return false},_detectOrientation:function(){this.orientation=(this.options.orientation==="vertical")?"vertical":"horizontal"},_normValueFromMouse:function(position){var pixelTotal,pixelMouse,percentMouse,valueTotal,valueMouse;if(this.orientation==="horizontal"){pixelTotal=this.elementSize.width;pixelMouse=position.x-this.elementOffset.left-(this._clickOffset?this._clickOffset.left:0)}else{pixelTotal=this.elementSize.height;pixelMouse=position.y-this.elementOffset.top-(this._clickOffset?this._clickOffset.top:0)}percentMouse=(pixelMouse/pixelTotal);if(percentMouse>1){percentMouse=1}if(percentMouse<0){percentMouse=0}if(this.orientation==="vertical"){percentMouse=1-percentMouse}valueTotal=this._valueMax()-this._valueMin();valueMouse=this._valueMin()+percentMouse*valueTotal;return this._trimAlignValue(valueMouse)},_start:function(event,index){var uiHash={handle:this.handles[index],value:this.value()};if(this.options.values&&this.options.values.length){uiHash.value=this.values(index);uiHash.values=this.values()}return this._trigger("start",event,uiHash)},_slide:function(event,index,newVal){var otherVal,newValues,allowed;if(this.options.values&&this.options.values.length){otherVal=this.values(index?0:1);if((this.options.values.length===2&&this.options.range===true)&&((index===0&&newVal>otherVal)||(index===1&&newVal1){this.options.values[index]=this._trimAlignValue(newValue);this._refreshValue();this._change(null,index);return }if(arguments.length){if($.isArray(arguments[0])){vals=this.options.values;newValues=arguments[0];for(i=0;i=this._valueMax()){return this._valueMax()}var step=(this.options.step>0)?this.options.step:1,valModStep=(val-this._valueMin())%step;alignValue=val-valModStep;if(Math.abs(valModStep)*2>=step){alignValue+=(valModStep>0)?step:(-step)}return parseFloat(alignValue.toFixed(5))},_valueMin:function(){return this.options.min},_valueMax:function(){return this.options.max},_refreshValue:function(){var oRange=this.options.range,o=this.options,self=this,animate=(!this._animateOff)?o.animate:false,valPercent,_set={},lastValPercent,value,valueMin,valueMax;if(this.options.values&&this.options.values.length){this.handles.each(function(i,j){valPercent=(self.values(i)-self._valueMin())/(self._valueMax()-self._valueMin())*100;_set[self.orientation==="horizontal"?"left":"bottom"]=valPercent+"%";$(this).stop(1,1)[animate?"animate":"css"](_set,o.animate);if(self.options.range===true){if(self.orientation==="horizontal"){if(i===0){self.range.stop(1,1)[animate?"animate":"css"]({left:valPercent+"%"},o.animate)}if(i===1){self.range[animate?"animate":"css"]({width:(valPercent-lastValPercent)+"%"},{queue:false,duration:o.animate})}}else{if(i===0){self.range.stop(1,1)[animate?"animate":"css"]({bottom:(valPercent)+"%"},o.animate)}if(i===1){self.range[animate?"animate":"css"]({height:(valPercent-lastValPercent)+"%"},{queue:false,duration:o.animate})}}}lastValPercent=valPercent})}else{value=this.value();valueMin=this._valueMin();valueMax=this._valueMax();valPercent=(valueMax!==valueMin)?(value-valueMin)/(valueMax-valueMin)*100:0;_set[self.orientation==="horizontal"?"left":"bottom"]=valPercent+"%";this.handle.stop(1,1)[animate?"animate":"css"](_set,o.animate);if(oRange==="min"&&this.orientation==="horizontal"){this.range.stop(1,1)[animate?"animate":"css"]({width:valPercent+"%"},o.animate)}if(oRange==="max"&&this.orientation==="horizontal"){this.range[animate?"animate":"css"]({width:(100-valPercent)+"%"},{queue:false,duration:o.animate})}if(oRange==="min"&&this.orientation==="vertical"){this.range.stop(1,1)[animate?"animate":"css"]({height:valPercent+"%"},o.animate)}if(oRange==="max"&&this.orientation==="vertical"){this.range[animate?"animate":"css"]({height:(100-valPercent)+"%"},{queue:false,duration:o.animate})}}}});$.extend($.ui.slider,{version:"1.8.12"})}(jQuery));(function($,undefined){var tabId=0,listId=0;function getNextTabId(){return ++tabId}function getNextListId(){return ++listId}$.widget("ui.tabs",{options:{add:null,ajaxOptions:null,cache:false,cookie:null,collapsible:false,disable:null,disabled:[],enable:null,event:"click",fx:null,idPrefix:"ui-tabs-",load:null,panelTemplate:"
",remove:null,select:null,show:null,spinner:"Loading…",tabTemplate:"
  • #{label}
  • "},_create:function(){this._tabify(true)},_setOption:function(key,value){if(key=="selected"){if(this.options.collapsible&&value==this.options.selected){return }this.select(value)}else{this.options[key]=value;this._tabify()}},_tabId:function(a){return a.title&&a.title.replace(/\s/g,"_").replace(/[^\w\u00c0-\uFFFF-]/g,"")||this.options.idPrefix+getNextTabId()},_sanitizeSelector:function(hash){return hash.replace(/:/g,"\\:")},_cookie:function(){var cookie=this.cookie||(this.cookie=this.options.cookie.name||"ui-tabs-"+getNextListId());return $.cookie.apply(null,[cookie].concat($.makeArray(arguments)))},_ui:function(tab,panel){return{tab:tab,panel:panel,index:this.anchors.index(tab)}},_cleanup:function(){this.lis.filter(".ui-state-processing").removeClass("ui-state-processing").find("span:data(label.tabs)").each(function(){var el=$(this);el.html(el.data("label.tabs")).removeData("label.tabs")})},_tabify:function(init){var self=this,o=this.options,fragmentId=/^#.+/;this.list=this.element.find("ol,ul").eq(0);this.lis=$(" > li:has(a[href])",this.list);this.anchors=this.lis.map(function(){return $("a",this)[0]});this.panels=$([]);this.anchors.each(function(i,a){var href=$(a).attr("href");var hrefBase=href.split("#")[0],baseEl;if(hrefBase&&(hrefBase===location.toString().split("#")[0]||(baseEl=$("base")[0])&&hrefBase===baseEl.href)){href=a.hash;a.href=href}if(fragmentId.test(href)){self.panels=self.panels.add(self.element.find(self._sanitizeSelector(href)))}else{if(href&&href!=="#"){$.data(a,"href.tabs",href);$.data(a,"load.tabs",href.replace(/#.*$/,""));var id=self._tabId(a);a.href="#"+id;var $panel=self.element.find("#"+id);if(!$panel.length){$panel=$(o.panelTemplate).attr("id",id).addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").insertAfter(self.panels[i-1]||self.list);$panel.data("destroy.tabs",true)}self.panels=self.panels.add($panel)}else{o.disabled.push(i)}}});if(init){this.element.addClass("ui-tabs ui-widget ui-widget-content ui-corner-all");this.list.addClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all");this.lis.addClass("ui-state-default ui-corner-top");this.panels.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom");if(o.selected===undefined){if(location.hash){this.anchors.each(function(i,a){if(a.hash==location.hash){o.selected=i;return false}})}if(typeof o.selected!=="number"&&o.cookie){o.selected=parseInt(self._cookie(),10)}if(typeof o.selected!=="number"&&this.lis.filter(".ui-tabs-selected").length){o.selected=this.lis.index(this.lis.filter(".ui-tabs-selected"))}o.selected=o.selected||(this.lis.length?0:-1)}else{if(o.selected===null){o.selected=-1}}o.selected=((o.selected>=0&&this.anchors[o.selected])||o.selected<0)?o.selected:0;o.disabled=$.unique(o.disabled.concat($.map(this.lis.filter(".ui-state-disabled"),function(n,i){return self.lis.index(n)}))).sort();if($.inArray(o.selected,o.disabled)!=-1){o.disabled.splice($.inArray(o.selected,o.disabled),1)}this.panels.addClass("ui-tabs-hide");this.lis.removeClass("ui-tabs-selected ui-state-active");if(o.selected>=0&&this.anchors.length){self.element.find(self._sanitizeSelector(self.anchors[o.selected].hash)).removeClass("ui-tabs-hide");this.lis.eq(o.selected).addClass("ui-tabs-selected ui-state-active");self.element.queue("tabs",function(){self._trigger("show",null,self._ui(self.anchors[o.selected],self.element.find(self._sanitizeSelector(self.anchors[o.selected].hash))[0]))});this.load(o.selected)}$(window).bind("unload",function(){self.lis.add(self.anchors).unbind(".tabs");self.lis=self.anchors=self.panels=null})}else{o.selected=this.lis.index(this.lis.filter(".ui-tabs-selected"))}this.element[o.collapsible?"addClass":"removeClass"]("ui-tabs-collapsible");if(o.cookie){this._cookie(o.selected,o.cookie)}for(var i=0,li;(li=this.lis[i]);i++){$(li)[$.inArray(i,o.disabled)!=-1&&!$(li).hasClass("ui-tabs-selected")?"addClass":"removeClass"]("ui-state-disabled")}if(o.cache===false){this.anchors.removeData("cache.tabs")}this.lis.add(this.anchors).unbind(".tabs");if(o.event!=="mouseover"){var addState=function(state,el){if(el.is(":not(.ui-state-disabled)")){el.addClass("ui-state-"+state)}};var removeState=function(state,el){el.removeClass("ui-state-"+state)};this.lis.bind("mouseover.tabs",function(){addState("hover",$(this))});this.lis.bind("mouseout.tabs",function(){removeState("hover",$(this))});this.anchors.bind("focus.tabs",function(){addState("focus",$(this).closest("li"))});this.anchors.bind("blur.tabs",function(){removeState("focus",$(this).closest("li"))})}var hideFx,showFx;if(o.fx){if($.isArray(o.fx)){hideFx=o.fx[0];showFx=o.fx[1]}else{hideFx=showFx=o.fx}}function resetStyle($el,fx){$el.css("display","");if(!$.support.opacity&&fx.opacity){$el[0].style.removeAttribute("filter")}}var showTab=showFx?function(clicked,$show){$(clicked).closest("li").addClass("ui-tabs-selected ui-state-active");$show.hide().removeClass("ui-tabs-hide").animate(showFx,showFx.duration||"normal",function(){resetStyle($show,showFx);self._trigger("show",null,self._ui(clicked,$show[0]))})}:function(clicked,$show){$(clicked).closest("li").addClass("ui-tabs-selected ui-state-active");$show.removeClass("ui-tabs-hide");self._trigger("show",null,self._ui(clicked,$show[0]))};var hideTab=hideFx?function(clicked,$hide){$hide.animate(hideFx,hideFx.duration||"normal",function(){self.lis.removeClass("ui-tabs-selected ui-state-active");$hide.addClass("ui-tabs-hide");resetStyle($hide,hideFx);self.element.dequeue("tabs")})}:function(clicked,$hide,$show){self.lis.removeClass("ui-tabs-selected ui-state-active");$hide.addClass("ui-tabs-hide");self.element.dequeue("tabs")};this.anchors.bind(o.event+".tabs",function(){var el=this,$li=$(el).closest("li"),$hide=self.panels.filter(":not(.ui-tabs-hide)"),$show=self.element.find(self._sanitizeSelector(el.hash));if(($li.hasClass("ui-tabs-selected")&&!o.collapsible)||$li.hasClass("ui-state-disabled")||$li.hasClass("ui-state-processing")||self.panels.filter(":animated").length||self._trigger("select",null,self._ui(this,$show[0]))===false){this.blur();return false}o.selected=self.anchors.index(this);self.abort();if(o.collapsible){if($li.hasClass("ui-tabs-selected")){o.selected=-1;if(o.cookie){self._cookie(o.selected,o.cookie)}self.element.queue("tabs",function(){hideTab(el,$hide)}).dequeue("tabs");this.blur();return false}else{if(!$hide.length){if(o.cookie){self._cookie(o.selected,o.cookie)}self.element.queue("tabs",function(){showTab(el,$show)});self.load(self.anchors.index(this));this.blur();return false}}}if(o.cookie){self._cookie(o.selected,o.cookie)}if($show.length){if($hide.length){self.element.queue("tabs",function(){hideTab(el,$hide)})}self.element.queue("tabs",function(){showTab(el,$show)});self.load(self.anchors.index(this))}else{throw"jQuery UI Tabs: Mismatching fragment identifier."}if($.browser.msie){this.blur()}});this.anchors.bind("click.tabs",function(){return false})},_getIndex:function(index){if(typeof index=="string"){index=this.anchors.index(this.anchors.filter("[href$="+index+"]"))}return index},destroy:function(){var o=this.options;this.abort();this.element.unbind(".tabs").removeClass("ui-tabs ui-widget ui-widget-content ui-corner-all ui-tabs-collapsible").removeData("tabs");this.list.removeClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all");this.anchors.each(function(){var href=$.data(this,"href.tabs");if(href){this.href=href}var $this=$(this).unbind(".tabs");$.each(["href","load","cache"],function(i,prefix){$this.removeData(prefix+".tabs")})});this.lis.unbind(".tabs").add(this.panels).each(function(){if($.data(this,"destroy.tabs")){$(this).remove()}else{$(this).removeClass(["ui-state-default","ui-corner-top","ui-tabs-selected","ui-state-active","ui-state-hover","ui-state-focus","ui-state-disabled","ui-tabs-panel","ui-widget-content","ui-corner-bottom","ui-tabs-hide"].join(" "))}});if(o.cookie){this._cookie(null,o.cookie)}return this},add:function(url,label,index){if(index===undefined){index=this.anchors.length}var self=this,o=this.options,$li=$(o.tabTemplate.replace(/#\{href\}/g,url).replace(/#\{label\}/g,label)),id=!url.indexOf("#")?url.replace("#",""):this._tabId($("a",$li)[0]);$li.addClass("ui-state-default ui-corner-top").data("destroy.tabs",true);var $panel=self.element.find("#"+id);if(!$panel.length){$panel=$(o.panelTemplate).attr("id",id).data("destroy.tabs",true)}$panel.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom ui-tabs-hide");if(index>=this.lis.length){$li.appendTo(this.list);$panel.appendTo(this.list[0].parentNode)}else{$li.insertBefore(this.lis[index]);$panel.insertBefore(this.panels[index])}o.disabled=$.map(o.disabled,function(n,i){return n>=index?++n:n});this._tabify();if(this.anchors.length==1){o.selected=0;$li.addClass("ui-tabs-selected ui-state-active");$panel.removeClass("ui-tabs-hide");this.element.queue("tabs",function(){self._trigger("show",null,self._ui(self.anchors[0],self.panels[0]))});this.load(0)}this._trigger("add",null,this._ui(this.anchors[index],this.panels[index]));return this},remove:function(index){index=this._getIndex(index);var o=this.options,$li=this.lis.eq(index).remove(),$panel=this.panels.eq(index).remove();if($li.hasClass("ui-tabs-selected")&&this.anchors.length>1){this.select(index+(index+1=index?--n:n});this._tabify();this._trigger("remove",null,this._ui($li.find("a")[0],$panel[0]));return this},enable:function(index){index=this._getIndex(index);var o=this.options;if($.inArray(index,o.disabled)==-1){return }this.lis.eq(index).removeClass("ui-state-disabled");o.disabled=$.grep(o.disabled,function(n,i){return n!=index});this._trigger("enable",null,this._ui(this.anchors[index],this.panels[index]));return this},disable:function(index){index=this._getIndex(index);var self=this,o=this.options;if(index!=o.selected){this.lis.eq(index).addClass("ui-state-disabled");o.disabled.push(index);o.disabled.sort();this._trigger("disable",null,this._ui(this.anchors[index],this.panels[index]))}return this},select:function(index){index=this._getIndex(index);if(index==-1){if(this.options.collapsible&&this.options.selected!=-1){index=this.options.selected}else{return this}}this.anchors.eq(index).trigger(this.options.event+".tabs");return this},load:function(index){index=this._getIndex(index);var self=this,o=this.options,a=this.anchors.eq(index)[0],url=$.data(a,"load.tabs");this.abort();if(!url||this.element.queue("tabs").length!==0&&$.data(a,"cache.tabs")){this.element.dequeue("tabs");return }this.lis.eq(index).addClass("ui-state-processing");if(o.spinner){var span=$("span",a);span.data("label.tabs",span.html()).html(o.spinner)}this.xhr=$.ajax($.extend({},o.ajaxOptions,{url:url,success:function(r,s){self.element.find(self._sanitizeSelector(a.hash)).html(r);self._cleanup();if(o.cache){$.data(a,"cache.tabs",true)}self._trigger("load",null,self._ui(self.anchors[index],self.panels[index]));try{o.ajaxOptions.success(r,s)}catch(e){}},error:function(xhr,s,e){self._cleanup();self._trigger("load",null,self._ui(self.anchors[index],self.panels[index]));try{o.ajaxOptions.error(xhr,s,index,a)}catch(e){}}}));self.element.dequeue("tabs");return this},abort:function(){this.element.queue([]);this.panels.stop(false,true);this.element.queue("tabs",this.element.queue("tabs").splice(-2,2));if(this.xhr){this.xhr.abort();delete this.xhr}this._cleanup();return this},url:function(index,url){this.anchors.eq(index).removeData("cache.tabs").data("load.tabs",url);return this},length:function(){return this.anchors.length}});$.extend($.ui.tabs,{version:"1.8.12"});$.extend($.ui.tabs.prototype,{rotation:null,rotate:function(ms,continuing){var self=this,o=this.options;var rotate=self._rotate||(self._rotate=function(e){clearTimeout(self.rotation);self.rotation=setTimeout(function(){var t=o.selected;self.select(++t=sourcei?fluid.position.AFTER:fluid.position.BEFORE}return position};fluid.permuteDom=function(element,target,position,sourceelements,targetelements){element=fluid.unwrap(element);target=fluid.unwrap(target);var sourcei=$.inArray(element,sourceelements);if(sourcei===-1){fluid.fail("Error in permuteDom: source element "+fluid.dumpEl(element)+" not found in source list "+fluid.dumpEl(sourceelements))}var targeti=$.inArray(target,targetelements);if(targeti===-1){fluid.fail("Error in permuteDom: target element "+fluid.dumpEl(target)+" not found in source list "+fluid.dumpEl(targetelements))}var samespan=sourceelements===targetelements;position=fluid.normalisePosition(position,samespan,targeti,sourcei);var oldn={};oldn[fluid.position.AFTER]=element.nextSibling;oldn[fluid.position.BEFORE]=element.previousSibling;fluid.moveDom(sourceelements[sourcei],targetelements[targeti],position);var frontlimit=samespan?targeti-1:sourceelements.length-2;var i;if(position===fluid.position.BEFORE&&samespan){frontlimit--}if(!samespan||targeti>sourcei){for(i=frontlimit;i>sourcei;--i){fluid.moveDom(sourceelements[i+1],sourceelements[i],fluid.position.AFTER)}if(sourcei+1=0&&backlimit=mindistance){minlockedelem=blankHolder}if(lastClosest&&lastClosest.position===minelem.position&&fluid.unwrap(lastClosest.element)===fluid.unwrap(minelem.element)&&fluid.unwrap(lastClosest.lockedelem)===fluid.unwrap(minlockedelem.element)){return fluid.dropManager.NO_CHANGE}return{position:minelem.position,element:minelem.element,lockedelem:minlockedelem.element}};that.shuffleProjectFrom=function(element,direction,includeLocked,disableWrap){var togo=that.projectFrom(element,direction,includeLocked,disableWrap);if(togo){togo.position=fluid.position.REPLACE}return togo};that.projectFrom=function(element,direction,includeLocked,disableWrap){that.updateGeometry(lastGeometry);var cacheelem=cache[fluid.dropManager.cacheKey(element)];var projected=fluid.geom.projectFrom(cacheelem.rect,direction,targets,includeLocked,disableWrap);if(!projected.cacheelem){return null}var retpos=projected.cacheelem.position;return{element:projected.cacheelem.element,position:retpos?retpos:fluid.position.BEFORE}};that.logicalFrom=function(element,direction,includeLocked,disableWrap){var orderables=that.getOwningSpan(element,fluid.position.INTERLEAVED,includeLocked);return{element:fluid.dropManager.getRelativeElement(element,direction,orderables,disableWrap),position:fluid.position.REPLACE}};that.lockedWrapFrom=function(element,direction,includeLocked,disableWrap){var base=that.logicalFrom(element,direction,includeLocked,disableWrap);var selectables=that.getOwningSpan(element,fluid.position.INTERLEAVED,includeLocked);var allElements=cache[fluid.dropManager.cacheKey(element)].owner.elements;if(includeLocked||selectables[0]===allElements[0]){return base}var directElement=fluid.dropManager.getRelativeElement(element,direction,allElements,disableWrap);if(lastGeometry.elementMapper(directElement)==="locked"){base.element=null;base.clazz="locked"}return base};that.getOwningSpan=function(element,position,includeLocked){var owner=cache[fluid.dropManager.cacheKey(element)].owner;var elements=position===fluid.position.INSIDE?[owner.parentElement]:owner.elements;if(!includeLocked&&lastGeometry.elementMapper){elements=$.makeArray(elements);fluid.remove_if(elements,function(element){return lastGeometry.elementMapper(element)==="locked"})}return elements};that.geometricMove=function(element,target,position){var sourceElements=that.getOwningSpan(element,null,true);var targetElements=that.getOwningSpan(target,position,true);fluid.permuteDom(element,target,position,sourceElements,targetElements)};return that};fluid.dropManager.NO_CHANGE="no change";fluid.dropManager.cacheKey=function(element){return fluid.allocateSimpleId(element)};fluid.dropManager.sentinelizeElement=function(targets,sides,cacheelem,fc,disposition,clazz){var elemCopy=$.extend(true,{},cacheelem);elemCopy.rect[sides[fc]]=elemCopy.rect[sides[1-fc]]+(fc?1:-1);elemCopy.rect[sides[1-fc]]=(fc?-1:1)*SENTINEL_DIMENSION;elemCopy.position=disposition===fluid.position.INSIDE?disposition:(fc?fluid.position.BEFORE:fluid.position.AFTER);elemCopy.clazz=clazz;targets[targets.length]=elemCopy};fluid.dropManager.splitElement=function(targets,sides,cacheelem,disposition,clazz1,clazz2){var elem1=$.extend(true,{},cacheelem);var elem2=$.extend(true,{},cacheelem);var midpoint=(elem1.rect[sides[0]]+elem1.rect[sides[1]])/2;elem1.rect[sides[1]]=midpoint;elem1.position=fluid.position.BEFORE;elem2.rect[sides[0]]=midpoint;elem2.position=fluid.position.AFTER;elem1.clazz=clazz1;elem2.clazz=clazz2;targets[targets.length]=elem1;targets[targets.length]=elem2};fluid.dropManager.getRelativeClass=function(thisElements,index,relative,thisclazz,mapper){index+=relative;if(index<0&&thisclazz==="locked"){return"locked"}if(index>=thisElements.length||mapper===null){return null}else{relative=thisElements[index];return mapper(relative)==="locked"&&thisclazz==="locked"?"locked":null}};fluid.dropManager.getRelativeElement=function(element,direction,elements,disableWrap){var folded=fluid.directionSign(direction);var index=$(elements).index(element)+folded;if(index<0){index+=elements.length}if(disableWrap){if(index===elements.length||index===(elements.length+folded)){return element}}index%=elements.length;return elements[index]};fluid.geom=fluid.geom||{};fluid.geom.minPointRectangle=function(x,y,rectangle){var dx=xrectangle.right?(x-rectangle.right):0);var dy=yrectangle.bottom?(y-rectangle.bottom):0);return dx*dx+dy*dy};fluid.geom.minRectRect=function(rect1,rect2){var dx=rect1.right=0){if(pdist===collect.mindist&&rdist*backSign>collect.minrdist){return }collect.minrdist=rdist*backSign;collect.mindist=pdist;collect.minelem=cacheelem}}var collect=makePenCollect();var backcollect=makePenCollect();var lockedcollect=makePenCollect();for(var i=0;i=0};var setDropEffects=function(value){thatReorderer.dom.fastLocate("dropTargets").attr("aria-dropeffect",value)};var styles=options.styles;var noModifier=function(evt){return(!evt.ctrlKey&&!evt.altKey&&!evt.shiftKey&&!evt.metaKey)};var handleDirectionKeyDown=function(evt){var item=thatReorderer.activeItem;if(!item){return true}var keysets=options.keysets;for(var i=0;i0){if(relativeItem.clazz==="locked"){thatReorderer.events.onShowKeyboardDropWarning.fire(item,kbDropWarning);kbDropWarning.show()}else{kbDropWarning.hide()}}if(relativeItem.element){thatReorderer.requestMovement(relativeItem,item)}}else{if(noModifier(evt)){item.blur();$(relativeItem.element).focus()}}return false}return true};thatReorderer.handleKeyDown=function(evt){if(!thatReorderer.activeItem||thatReorderer.activeItem!==evt.target){return true}var jActiveItem=$(thatReorderer.activeItem);if(!jActiveItem.hasClass(styles.dragging)&&isMove(evt)){if(isActiveItemMovable()){jActiveItem.removeClass(styles.selected);jActiveItem.addClass(styles.dragging);jActiveItem.attr("aria-grabbed","true");setDropEffects("move")}return false}return handleDirectionKeyDown(evt)};thatReorderer.handleKeyUp=function(evt){if(!thatReorderer.activeItem||thatReorderer.activeItem!==evt.target){return true}var jActiveItem=$(thatReorderer.activeItem);if(jActiveItem.hasClass(styles.dragging)&&!isMove(evt)){if(kbDropWarning){kbDropWarning.hide()}jActiveItem.removeClass(styles.dragging);jActiveItem.addClass(styles.selected);jActiveItem.attr("aria-grabbed","false");setDropEffects("none");return false}return false};var dropMarker;var createDropMarker=function(tagName){var dropMarker=$(document.createElement(tagName));dropMarker.addClass(options.styles.dropMarker);dropMarker.hide();return dropMarker};thatReorderer.requestMovement=function(requestedPosition,item){item=fluid.unwrap(item);if(!requestedPosition||fluid.unwrap(requestedPosition.element)===item){return }var activeItem=$(thatReorderer.activeItem);activeItem.unbind("blur.fluid.reorderer");thatReorderer.events.onMove.fire(item,requestedPosition);dropManager.geometricMove(item,requestedPosition.element,requestedPosition.position);activeItem.focus();thatReorderer.refresh();dropManager.updateGeometry(thatReorderer.layoutHandler.getGeometricInfo());thatReorderer.events.afterMove.fire(item,requestedPosition,thatReorderer.dom.fastLocate("movables"))};var hoverStyleHandler=function(item,state){thatReorderer.dom.fastLocate("grabHandle",item)[state?"addClass":"removeClass"](styles.hover)};function initMovable(item){var styles=options.styles;item.attr("aria-grabbed","false");item.mouseover(function(){thatReorderer.events.onHover.fire(item,true)});item.mouseout(function(){thatReorderer.events.onHover.fire(item,false)});var avatar;thatReorderer.dom.fastLocate("grabHandle",item).draggable({refreshPositions:false,scroll:true,helper:function(){var dropWarningEl;if(mouseDropWarning){dropWarningEl=mouseDropWarning[0]}avatar=$(options.avatarCreator(item[0],styles.avatar,dropWarningEl));avatar.prop("id",createAvatarId(thatReorderer.container.id));return avatar},start:function(e,ui){var prevent=thatReorderer.events.onBeginMove.fire(item);if(prevent===false){return false}var handle=thatReorderer.dom.fastLocate("grabHandle",item)[0];var handlePos=fluid.dom.computeAbsolutePosition(handle);var handleWidth=handle.offsetWidth;var handleHeight=handle.offsetHeight;item.focus();item.removeClass(options.styles.selected);item.addClass(options.styles.mouseDrag);item.attr("aria-grabbed","true");setDropEffects("move");dropManager.startDrag(e,handlePos,handleWidth,handleHeight);avatar.show()},stop:function(e,ui){item.removeClass(options.styles.mouseDrag);item.addClass(options.styles.selected);$(thatReorderer.activeItem).attr("aria-grabbed","false");var markerNode=fluid.unwrap(dropMarker);if(markerNode.parentNode){markerNode.parentNode.removeChild(markerNode)}avatar.hide();ui.helper=null;setDropEffects("none");dropManager.endDrag();thatReorderer.requestMovement(dropManager.lastPosition(),item);thatReorderer.activeItem.focus()},handle:thatReorderer.dom.fastLocate("grabHandle",item)})}function changeSelectedToDefault(jItem,styles){jItem.removeClass(styles.selected);jItem.removeClass(styles.dragging);jItem.addClass(styles.defaultStyle);jItem.attr("aria-selected","false")}var selectItem=function(anItem){thatReorderer.events.onSelect.fire(anItem);var styles=options.styles;if(thatReorderer.activeItem&&thatReorderer.activeItem!==anItem){changeSelectedToDefault($(thatReorderer.activeItem),styles)}thatReorderer.activeItem=anItem;var jItem=$(anItem);jItem.removeClass(styles.defaultStyle);jItem.addClass(styles.selected);jItem.attr("aria-selected","true")};var initSelectables=function(){var handleBlur=function(evt){changeSelectedToDefault($(this),options.styles);return evt.stopPropagation()};var handleFocus=function(evt){selectItem(this);return evt.stopPropagation()};var selectables=thatReorderer.dom.fastLocate("selectables");for(var i=0;i0&&!dropMarker){dropMarker=createDropMarker(movables[0].tagName)}dropManager.updateGeometry(thatReorderer.layoutHandler.getGeometricInfo());dropManager.dropChangeFirer.addListener(dropChangeListener,"fluid.Reorderer");dropTargets.attr("aria-dropeffect","none")};if(thatReorderer.container){bindHandlersToContainer(thatReorderer.container,thatReorderer.handleKeyDown,thatReorderer.handleKeyUp);addRolesToContainer(thatReorderer);fluid.tabbable(thatReorderer.container);initItems()}if(options.afterMoveCallbackUrl){thatReorderer.events.afterMove.addListener(function(){var layoutHandler=thatReorderer.layoutHandler;var model=layoutHandler.getModel?layoutHandler.getModel():options.acquireModel(thatReorderer);$.post(options.afterMoveCallbackUrl,JSON.stringify(model))},"postModel")}thatReorderer.events.onHover.addListener(hoverStyleHandler,"style");thatReorderer.refresh=function(){thatReorderer.dom.refresh("movables");thatReorderer.dom.refresh("selectables");thatReorderer.dom.refresh("grabHandle",thatReorderer.dom.fastLocate("movables"));thatReorderer.dom.refresh("stylisticOffset",thatReorderer.dom.fastLocate("movables"));thatReorderer.dom.refresh("dropTargets");thatReorderer.events.onRefresh.fire();initItems();thatReorderer.selectableContext.selectables=thatReorderer.dom.fastLocate("selectables");thatReorderer.selectableContext.selectablesUpdated(thatReorderer.activeItem)};fluid.initDependents(thatReorderer);thatReorderer.refresh();return thatReorderer};fluid.reorderer.keys={TAB:9,ENTER:13,SHIFT:16,CTRL:17,ALT:18,META:19,SPACE:32,LEFT:37,UP:38,RIGHT:39,DOWN:40,i:73,j:74,k:75,m:77};fluid.reorderer.defaultKeysets=[{modifier:function(evt){return evt.ctrlKey},up:fluid.reorderer.keys.UP,down:fluid.reorderer.keys.DOWN,right:fluid.reorderer.keys.RIGHT,left:fluid.reorderer.keys.LEFT},{modifier:function(evt){return evt.ctrlKey},up:fluid.reorderer.keys.i,down:fluid.reorderer.keys.m,right:fluid.reorderer.keys.k,left:fluid.reorderer.keys.j}];fluid.reorderer.roles={GRID:{container:"grid",item:"gridcell"},LIST:{container:"list",item:"listitem"},REGIONS:{container:"main",item:"article"}};var simpleInit=function(container,layoutHandler,options){options=options||{};options.layoutHandler=layoutHandler;return fluid.reorderer(container,options)};fluid.reorderList=function(container,options){return simpleInit(container,"fluid.listLayoutHandler",options)};fluid.reorderGrid=function(container,options){return simpleInit(container,"fluid.gridLayoutHandler",options)};fluid.reorderer.SHUFFLE_GEOMETRIC_STRATEGY="shuffleProjectFrom";fluid.reorderer.GEOMETRIC_STRATEGY="projectFrom";fluid.reorderer.LOGICAL_STRATEGY="logicalFrom";fluid.reorderer.WRAP_LOCKED_STRATEGY="lockedWrapFrom";fluid.reorderer.NO_STRATEGY=null;fluid.reorderer.relativeInfoGetter=function(orientation,coStrategy,contraStrategy,dropManager,dom,disableWrap){return function(item,direction,forSelection){var dirorient=fluid.directionOrientation(direction);var strategy=dirorient===orientation?coStrategy:contraStrategy;return strategy!==null?dropManager[strategy](item,direction,forSelection,disableWrap):null}};fluid.defaults("fluid.reorderer",{styles:{defaultStyle:"fl-reorderer-movable-default",selected:"fl-reorderer-movable-selected",dragging:"fl-reorderer-movable-dragging",mouseDrag:"fl-reorderer-movable-dragging",hover:"fl-reorderer-movable-hover",dropMarker:"fl-reorderer-dropMarker",avatar:"fl-reorderer-avatar"},selectors:{dropWarning:".flc-reorderer-dropWarning",movables:".flc-reorderer-movable",grabHandle:"",stylisticOffset:""},avatarCreator:defaultAvatarCreator,keysets:fluid.reorderer.defaultKeysets,layoutHandler:{type:"fluid.listLayoutHandler"},events:{onShowKeyboardDropWarning:null,onSelect:null,onBeginMove:"preventable",onMove:null,afterMove:null,onHover:null,onRefresh:null},mergePolicy:{keysets:"replace","selectors.labelSource":"selectors.grabHandle","selectors.selectables":"selectors.movables","selectors.dropTargets":"selectors.movables"},components:{labeller:{type:"fluid.reorderer.labeller",options:{dom:"{reorderer}.dom",getGeometricInfo:"{reorderer}.layoutHandler.getGeometricInfo",orientation:"{reorderer}.options.orientation",layoutType:"{reorderer}.options.layoutHandler"}}},disableWrap:false});fluid.reorderer.makeGeometricInfoGetter=function(orientation,sentinelize,dom){return function(){var that={sentinelize:sentinelize,extents:[{orientation:orientation,elements:dom.fastLocate("dropTargets")}],elementMapper:function(element){return $.inArray(element,dom.fastLocate("movables"))===-1?"locked":null},elementIndexer:function(element){var selectables=dom.fastLocate("selectables");return{elementClass:that.elementMapper(element),index:$.inArray(element,selectables),length:selectables.length}}};return that}};fluid.defaults(true,"fluid.listLayoutHandler",{orientation:fluid.orientation.VERTICAL,containerRole:fluid.reorderer.roles.LIST,selectablesTabindex:-1,sentinelize:true});fluid.listLayoutHandler=function(container,options,dropManager,dom){var that={};that.getRelativePosition=fluid.reorderer.relativeInfoGetter(options.orientation,fluid.reorderer.LOGICAL_STRATEGY,null,dropManager,dom,options.disableWrap);that.getGeometricInfo=fluid.reorderer.makeGeometricInfoGetter(options.orientation,options.sentinelize,dom);return that};fluid.defaults(true,"fluid.gridLayoutHandler",{orientation:fluid.orientation.HORIZONTAL,containerRole:fluid.reorderer.roles.GRID,selectablesTabindex:-1,sentinelize:false});fluid.gridLayoutHandler=function(container,options,dropManager,dom){var that={};that.getRelativePosition=fluid.reorderer.relativeInfoGetter(options.orientation,options.disableWrap?fluid.reorderer.SHUFFLE_GEOMETRIC_STRATEGY:fluid.reorderer.LOGICAL_STRATEGY,fluid.reorderer.SHUFFLE_GEOMETRIC_STRATEGY,dropManager,dom,options.disableWrap);that.getGeometricInfo=fluid.reorderer.makeGeometricInfoGetter(options.orientation,options.sentinelize,dom);return that};fluid.defaults("fluid.reorderer.labeller",{strings:{overallTemplate:"%recentStatus %item %position %movable",position:"%index of %length",position_moduleLayoutHandler:"%index of %length in %moduleCell %moduleIndex of %moduleLength",moduleCell_0:"row",moduleCell_1:"column",movable:"movable",fixed:"fixed",recentStatus:"moved from position %position"},components:{resolver:{type:"fluid.messageResolver",options:{messageBase:"{labeller}.options.strings"}}},invokers:{renderLabel:{funcName:"fluid.reorderer.labeller.renderLabel",args:["{labeller}","@0","@1"]}}});fluid.reorderer.indexRebaser=function(indices){indices.index++;if(indices.moduleIndex!==undefined){indices.moduleIndex++}return indices};fluid.reorderer.labeller=function(options){var that=fluid.initLittleComponent("fluid.reorderer.labeller",options);fluid.initDependents(that);that.dom=that.options.dom;that.moduleCell=that.resolver.resolve("moduleCell_"+that.options.orientation);var layoutType=fluid.computeNickName(that.options.layoutType);that.positionTemplate=that.resolver.lookup(["position_"+layoutType,"position"]);var movedMap={};that.returnedOptions={listeners:{onRefresh:function(){var selectables=that.dom.locate("selectables");fluid.each(selectables,function(selectable){var labelOptions={};var id=fluid.allocateSimpleId(selectable);var moved=movedMap[id];var label=that.renderLabel(selectable);var plainLabel=label;if(moved){moved.newRender=plainLabel;label=that.renderLabel(selectable,moved.oldRender.position);$(selectable).one("focusout",function(){if(movedMap[id]){var oldLabel=movedMap[id].newRender.label;delete movedMap[id];fluid.updateAriaLabel(selectable,oldLabel)}});labelOptions.dynamicLabel=true}fluid.updateAriaLabel(selectable,label.label,labelOptions)})},onMove:function(item,newPosition){fluid.clear(movedMap);var movingId=fluid.allocateSimpleId(item);movedMap[movingId]={oldRender:that.renderLabel(item)}}}};return that};fluid.reorderer.labeller.renderLabel=function(that,selectable,recentPosition){var geom=that.options.getGeometricInfo();var indices=fluid.reorderer.indexRebaser(geom.elementIndexer(selectable));indices.moduleCell=that.moduleCell;var elementClass=geom.elementMapper(selectable);var labelSource=that.dom.locate("labelSource",selectable);var recentStatus;if(recentPosition){recentStatus=that.resolver.resolve("recentStatus",{position:recentPosition})}var topModel={item:typeof (labelSource)==="string"?labelSource:fluid.dom.getElementText(fluid.unwrap(labelSource)),position:that.positionTemplate.resolveFunc(that.positionTemplate.template,indices),movable:that.resolver.resolve(elementClass==="locked"?"fixed":"movable"),recentStatus:recentStatus||""};var template=that.resolver.lookup(["overallTemplate"]);var label=template.resolveFunc(template.template,topModel);return{position:topModel.position,label:label}}})(jQuery,fluid_1_4);var fluid_1_4=fluid_1_4||{};(function($,fluid){var deriveLightboxCellBase=function(namebase,index){return namebase+"lightbox-cell:"+index+":"};var addThumbnailActivateHandler=function(container){var enterKeyHandler=function(evt){if(evt.which===fluid.reorderer.keys.ENTER){var thumbnailAnchors=$("a",evt.target);document.location=thumbnailAnchors.attr("href")}};container.keypress(enterKeyHandler)};var seekNodesById=function(rootnode,tagname,idmatch){var inputs=rootnode.getElementsByTagName(tagname);var togo=[];for(var i=0;i=0;--i){if(extraArgs[i]&&extraArgs[i].transformOptions){return extraArgs[i].transformOptions}}};fluid.mergeComponentOptions=function(that,componentName,userOptions,localOptions){var defaults=fluid.defaults(componentName);var mergePolicy=$.extend({},fluid.rootMergePolicy,defaults?defaults.mergePolicy:{});var defaultGrades=defaults&&defaults.gradeNames;var mergeArgs;if(!defaultGrades){defaults=fluid.censorKeys(defaults,fluid.keys(fluid.lifecycleFunctions));mergeArgs=[mergePolicy,localOptions]}else{mergeArgs=[mergePolicy]}var extraArgs;if(fluid.expandComponentOptions){extraArgs=fluid.expandComponentOptions(defaults,userOptions,that)}else{extraArgs=[defaults,userOptions]}var transRec=fluid.lastTransformationRecord(extraArgs);if(transRec){extraArgs=fluid.transformOptions(extraArgs,transRec)}mergeArgs=mergeArgs.concat(extraArgs);that.options=fluid.merge.apply(null,mergeArgs)};fluid.COMPONENT_OPTIONS={type:"fluid.marker",value:"COMPONENT_OPTIONS"};fluid.emptySubcomponent=function(options){var that={};options=$.makeArray(options);var empty=function(){};for(var i=0;i1?"More than one ("+count+") container elements were":"No container element was")+" found for selector "+containerSpec)}if(!fluid.isDOMNode(container[0])){fluid.fail("fluid.container was supplied a non-jQueryable element")}return container};fluid.createDomBinder=function(container,selectors){var cache={},that={};function cacheKey(name,thisContainer){return fluid.allocateSimpleId(thisContainer)+"-"+name}function record(name,thisContainer,result){cache[cacheKey(name,thisContainer)]=result}that.locate=function(name,localContainer){var selector,thisContainer,togo;selector=selectors[name];thisContainer=localContainer?localContainer:container;if(!thisContainer){fluid.fail("DOM binder invoked for selector "+name+" without container")}if(!selector){return thisContainer}if(typeof (selector)==="function"){togo=$(selector.call(null,fluid.unwrap(thisContainer)))}else{togo=$(selector,thisContainer)}if(togo.get(0)===document){togo=[]}if(!togo.selector){togo.selector=selector;togo.context=thisContainer}togo.selectorName=name;record(name,thisContainer,togo);return togo};that.fastLocate=function(name,localContainer){var thisContainer=localContainer?localContainer:container;var key=cacheKey(name,thisContainer);var togo=cache[key];return togo?togo:that.locate(name,localContainer)};that.clear=function(){cache={}};that.refresh=function(names,localContainer){var thisContainer=localContainer?localContainer:container;if(typeof names==="string"){names=[names]}if(thisContainer.length===undefined){thisContainer=[thisContainer]}for(var i=0;i=0&¤tNode.depth1){node=node[0];multiple=true}if("input"!==node.nodeName.toLowerCase()||!/radio|checkbox/.test(node.type)){return newValue===undefined?$(node).val():$(node).val(newValue)}var name=node.name;if(name===undefined){fluid.fail("Cannot acquire value from node "+fluid.dumpEl(node)+" which does not have name attribute set")}var elements;if(multiple){elements=nodeIn}else{elements=document.getElementsByName(name);var scope=fluid.findForm(node);elements=$.grep(elements,function(element){if(element.name!==name){return false}return !scope||fluid.dom.isContainer(scope,element)})}if(newValue!==undefined){if(typeof (newValue)==="boolean"){newValue=(newValue?"true":"false")}$.each(elements,function(){this.checked=(newValue instanceof Array?$.inArray(this.value,newValue)!==-1:newValue===this.value)})}else{var checked=$.map(elements,function(element){return element.checked?element.value:null});return node.type==="radio"?checked[0]:checked}};fluid.applyChange=function(node,newValue,applier){node=fluid.unwrap(node);if(newValue===undefined){newValue=fluid.value(node)}if(node.nodeType===undefined&&node.length>0){node=node[0]}var root=fluid.findData(node,fluid.BINDING_ROOT_KEY);if(!root){fluid.fail("Bound data could not be discovered in any node above "+fluid.dumpEl(node))}var name=node.name;var fossil=root.fossils[name];if(!fossil){fluid.fail("No fossil discovered for name "+name+" in fossil record above "+fluid.dumpEl(node))}if(typeof (fossil.oldvalue)==="boolean"){newValue=newValue[0]?true:false}var EL=root.fossils[name].EL;if(applier){applier.fireChangeRequest({path:EL,value:newValue,source:node.id})}else{fluid.set(root.data,EL,newValue)}};fluid.pathUtil={};var getPathSegmentImpl=function(accept,path,i){var segment=null;if(accept){segment=""}var escaped=false;var limit=path.length;for(;i0){var ation=that.initiate();ation.fireChangeRequest(changeRequest,guardFireSpec);ation.commit()}else{if(!defeatGuards){var prevent=fireFromSpec("guards",guardFireSpec,[model,changeRequest,bareApplier],"listeners");if(prevent===false){return false}}var oldModel=model;if(!options.thin){oldModel={};fluid.model.copyModel(oldModel,model)}fluid.model.applyChangeRequest(model,changeRequest,options.resolverSetConfig);fireEvent("modelChanged",changeRequest.path,[model,oldModel,[changeRequest]])}};bindRequestChange(that);function fireAgglomerated(eventName,formName,changes,args,accpos){var fireSpec=makeFireSpec();for(var i=0;i=elements.length){sc_that.activeItemIndex=0}if(sc_that.activeItemIndex<0&&sc_that.activeItemIndex!==NO_SELECTION){sc_that.activeItemIndex=elements.length-1}if(sc_that.activeItemIndex>=0){fluid.focus(elements[sc_that.activeItemIndex])}};var prepareShift=function(selectionContext){var selElm=selectionContext.selectedElement();if(selElm){fluid.blur(selElm)}unselectElement(selectionContext.selectedElement(),selectionContext);if(selectionContext.activeItemIndex===NO_SELECTION){selectionContext.activeItemIndex=-1}};var focusNextElement=function(selectionContext){prepareShift(selectionContext);++selectionContext.activeItemIndex;reifyIndex(selectionContext)};var focusPreviousElement=function(selectionContext){prepareShift(selectionContext);--selectionContext.activeItemIndex;reifyIndex(selectionContext)};var arrowKeyHandler=function(selectionContext,keyMap,userHandlers){return function(evt){if(evt.which===keyMap.next){focusNextElement(selectionContext);evt.preventDefault()}else{if(evt.which===keyMap.previous){focusPreviousElement(selectionContext);evt.preventDefault()}}}};var getKeyMapForDirection=function(direction){var keyMap;if(direction===fluid.a11y.orientation.HORIZONTAL){keyMap=LEFT_RIGHT_KEYMAP}else{if(direction===fluid.a11y.orientation.VERTICAL){keyMap=UP_DOWN_KEYMAP}}return keyMap};var tabKeyHandler=function(selectionContext){return function(evt){if(evt.which!==$.ui.keyCode.TAB){return }cleanUpWhenLeavingContainer(selectionContext);if(evt.shiftKey){selectionContext.focusIsLeavingContainer=true}}};var containerFocusHandler=function(selectionContext){return function(evt){var shouldOrig=selectionContext.options.autoSelectFirstItem;var shouldSelect=typeof (shouldOrig)==="function"?shouldOrig():shouldOrig;if(selectionContext.focusIsLeavingContainer){shouldSelect=false}if(shouldSelect&&evt.target===selectionContext.container.get(0)){if(selectionContext.activeItemIndex===NO_SELECTION){selectionContext.activeItemIndex=0}fluid.focus(selectionContext.selectables[selectionContext.activeItemIndex])}return evt.stopPropagation()}};var containerBlurHandler=function(selectionContext){return function(evt){selectionContext.focusIsLeavingContainer=false;return evt.stopPropagation()}};var makeElementsSelectable=function(container,defaults,userOptions){var options=$.extend(true,{},defaults,userOptions);var keyMap=getKeyMapForDirection(options.direction);var selectableElements=options.selectableElements?options.selectableElements:container.find(options.selectableSelector);var that={container:container,activeItemIndex:NO_SELECTION,selectables:selectableElements,focusIsLeavingContainer:false,options:options};that.selectablesUpdated=function(focusedItem){if(typeof (that.options.selectablesTabindex)==="number"){that.selectables.fluid("tabindex",that.options.selectablesTabindex)}that.selectables.unbind("focus."+CONTEXT_KEY);that.selectables.unbind("blur."+CONTEXT_KEY);that.selectables.bind("focus."+CONTEXT_KEY,selectableFocusHandler(that));that.selectables.bind("blur."+CONTEXT_KEY,selectableBlurHandler(that));if(keyMap&&that.options.noBubbleListeners){that.selectables.unbind("keydown."+CONTEXT_KEY);that.selectables.bind("keydown."+CONTEXT_KEY,arrowKeyHandler(that,keyMap))}if(focusedItem){selectElement(focusedItem,that)}else{reifyIndex(that)}};that.refresh=function(){if(!that.options.selectableSelector){throw ("Cannot refresh selectable context which was not initialised by a selector")}that.selectables=container.find(options.selectableSelector);that.selectablesUpdated()};that.selectedElement=function(){return that.activeItemIndex<0?null:that.selectables[that.activeItemIndex]};if(keyMap&&!that.options.noBubbleListeners){container.keydown(arrowKeyHandler(that,keyMap))}container.keydown(tabKeyHandler(that));container.focus(containerFocusHandler(that));container.blur(containerBlurHandler(that));that.selectablesUpdated();return that};fluid.selectable=function(target,options){target=$(target);var that=makeElementsSelectable(target,fluid.selectable.defaults,options);fluid.setScopedData(target,CONTEXT_KEY,that);return that};fluid.selectable.select=function(target,toSelect){fluid.focus(toSelect)};fluid.selectable.selectNext=function(target){target=$(target);focusNextElement(fluid.getScopedData(target,CONTEXT_KEY))};fluid.selectable.selectPrevious=function(target){target=$(target);focusPreviousElement(fluid.getScopedData(target,CONTEXT_KEY))};fluid.selectable.currentSelection=function(target){target=$(target);var that=fluid.getScopedData(target,CONTEXT_KEY);return $(that.selectedElement())};fluid.selectable.defaults={direction:fluid.a11y.orientation.VERTICAL,selectablesTabindex:-1,autoSelectFirstItem:true,rememberSelectionState:true,selectableSelector:".selectable",selectableElements:null,onSelect:null,onUnselect:null,onLeaveContainer:null};var checkForModifier=function(binding,evt){if(!binding.modifier){return true}var modifierKey=binding.modifier;var isCtrlKeyPresent=modifierKey&&evt.ctrlKey;var isAltKeyPresent=modifierKey&&evt.altKey;var isShiftKeyPresent=modifierKey&&evt.shiftKey;return isCtrlKeyPresent||isAltKeyPresent||isShiftKeyPresent};var makeActivationHandler=function(binding){return function(evt){var target=evt.target;if(!fluid.enabled(evt.target)){return }var code=evt.which?evt.which:evt.keyCode;if(code===binding.key&&binding.activateHandler&&checkForModifier(binding,evt)){var event=$.Event("fluid-activate");$(evt.target).trigger(event,[binding.activateHandler]);if(event.isDefaultPrevented()){evt.preventDefault()}}}};var makeElementsActivatable=function(elements,onActivateHandler,defaultKeys,options){var bindings=[];$(defaultKeys).each(function(index,key){bindings.push({modifier:null,key:key,activateHandler:onActivateHandler})});if(options&&options.additionalBindings){bindings=bindings.concat(options.additionalBindings)}fluid.initEnablement(elements);for(var i=0;i',liveRegionId:"fluid-ariaLabeller-liveRegion",invokers:{generateLiveElement:{funcName:"fluid.ariaLabeller.generateLiveElement",args:["{ariaLabeller}"]}}});fluid.ariaLabeller=function(element,options){var that=fluid.initView("fluid.ariaLabeller",element,options);fluid.initDependents(that);that.update=function(newOptions){newOptions=newOptions||that.options;that.container.attr(that.options.labelAttribute,newOptions.text);if(newOptions.dynamicLabel){var live=fluid.jById(that.options.liveRegionId);if(live.length===0){live=that.generateLiveElement()}live.text(newOptions.text)}};that.update();return that};fluid.ariaLabeller.generateLiveElement=function(that){var liveEl=$(that.options.liveRegionMarkup);liveEl.prop("id",that.options.liveRegionId);$("body").append(liveEl);return liveEl};var LABEL_KEY="aria-labelling";fluid.getAriaLabeller=function(element){element=$(element);var that=fluid.getScopedData(element,LABEL_KEY);return that};fluid.updateAriaLabel=function(element,text,options){options=$.extend({},options||{},{text:text});var that=fluid.getAriaLabeller(element);if(!that){that=fluid.ariaLabeller(element,options);fluid.setScopedData(element,LABEL_KEY,that)}else{that.update(options)}return that};fluid.deadMansBlur=function(control,options){var that=fluid.initLittleComponent("fluid.deadMansBlur",options);that.blurPending=false;that.lastCancel=0;$(control).bind("focusout",function(event){fluid.log("Starting blur timer for element "+fluid.dumpEl(event.target));var now=new Date().getTime();fluid.log("back delay: "+(now-that.lastCancel));if(now-that.lastCancel>that.options.backDelay){that.blurPending=true}setTimeout(function(){if(that.blurPending){that.options.handler(control)}},that.options.delay)});that.canceller=function(event){fluid.log("Cancellation through "+event.type+" on "+fluid.dumpEl(event.target));that.lastCancel=new Date().getTime();that.blurPending=false};fluid.each(that.options.exclusions,function(exclusion){exclusion=$(exclusion);fluid.each(exclusion,function(excludeEl){$(excludeEl).bind("focusin",that.canceller).bind("fluid-focus",that.canceller).click(that.canceller).mousedown(that.canceller)})});return that};fluid.defaults("fluid.deadMansBlur",{delay:150,backDelay:100})})(jQuery,fluid_1_4);var fluid_1_4=fluid_1_4||{};(function($,fluid){var inCreationMarker="__CURRENTLY_IN_CREATION__";fluid.isFireBreak=function(component){return component.options&&component.options["fluid.visitComponents.fireBreak"]};fluid.visitComponentChildren=function(that,visitor,options,up,down){options=options||{};for(var name in that){var component=that[name];if(!component||!component.typeName||(component.id&&options.visited&&options.visited[component.id])){continue}if(options.visited){options.visited[component.id]=true}if(visitor(component,name,options,up,down)){return true}if(!fluid.isFireBreak(component)&&!options.flat){fluid.visitComponentChildren(component,visitor,options,up,down+1)}}};var visitComponents=function(thatStack,visitor,options){options=options||{visited:{},flat:true};var up=0;for(var i=thatStack.length-1;i>=0;--i){var that=thatStack[i];if(fluid.isFireBreak(that)){return }if(that.typeName){options.visited[that.id]=true;if(visitor(that,"",options,0,0)){return }}if(fluid.visitComponentChildren(that,visitor,options,up,1)){return }++up}};function makeGingerStrategy(instantiator,that,thatStack){return function(component,thisSeg){var atval=component[thisSeg];if(atval===undefined){var parentPath=instantiator.idToPath[component.id];atval=instantiator.pathToComponent[fluid.composePath(parentPath,thisSeg)];if(atval){atval[inCreationMarker]=true}}if(atval!==undefined){if(atval[inCreationMarker]){fluid.fail("Component "+fluid.dumpThat(atval)+' at path "'+thisSeg+'" of parent '+fluid.dumpThat(component)+" cannot be used for lookup since it is still in creation. Please reorganise your dependencies so that they no longer contain circular references")}}else{if(fluid.get(component,fluid.path("options","components",thisSeg,"type"))){fluid.initDependent(component,thisSeg);atval=component[thisSeg]}}return atval}}fluid.dumpThat=function(that,instantiator){return'{ typeName: "'+that.typeName+'" id: '+that.id+"}"};fluid.dumpThatStack=function(thatStack,instantiator){var togo=fluid.transform(thatStack,function(that){var path=instantiator.idToPath[that.id];return fluid.dumpThat(that)+(path?(" - path: "+path):"")});return togo.join("\n")};fluid.describeActivity=function(){return fluid.threadLocal().activityStack||[]};fluid.pushActivity=function(func,message){if(!message){return func()}var root=fluid.threadLocal();if(!root.activityStack){root.activityStack=[]}var frames=fluid.makeArray(message);frames.push("\n");frames.unshift("\n");root.activityStack=frames.concat(root.activityStack);return fluid.tryCatch(func,null,function(){root.activityStack=root.activityStack.slice(frames.length)})};fluid.wrapActivity=function(func,messageSpec){return function(){var args=fluid.makeArray(arguments);var message=fluid.transform(fluid.makeArray(messageSpec),function(specEl){if(specEl.indexOf("arguments.")===0){var el=specEl.substring("arguments.".length);return fluid.get(args,el)}else{return specEl}});return fluid.pushActivity(function(){return func.apply(null,args)},message)}};var localRecordExpected=/arguments|options|container/;function makeStackFetcher(instantiator,parentThat,localRecord,expandOptions){expandOptions=expandOptions||{};var thatStack=instantiator.getFullStack(parentThat);var fetchStrategies=[fluid.model.funcResolverStrategy,makeGingerStrategy(instantiator,parentThat,thatStack)];var fetcher=function(parsed){var context=parsed.context;if(localRecord&&localRecordExpected.test(context)){var fetched=fluid.get(localRecord[context],parsed.path);return(context==="arguments"||expandOptions.direct)?fetched:{marker:context==="options"?fluid.EXPAND:fluid.EXPAND_NOW,value:fetched}}var foundComponent;visitComponents(thatStack,function(component,name,options,up,down){if(context===name||context===component.typeName||context===component.nickName){foundComponent=component;if(down>1){fluid.log("***WARNING: value resolution for context "+context+" found at depth "+down+": this may not be supported in future")}return true}if(fluid.get(component,fluid.path("options","components",context,"type"))&&!component[context]){foundComponent=fluid.get(component,context,{strategies:fetchStrategies});return true}});if(!foundComponent&&parsed.path!==""){var ref=fluid.renderContextReference(parsed);fluid.log("Failed to resolve reference "+ref+": thatStack contains\n"+fluid.dumpThatStack(thatStack,instantiator));fluid.fail("Failed to resolve reference "+ref+" - could not match context with name "+context+" from component root of type "+thatStack[0].typeName,"\ninstantiator contents: ",instantiator)}return fluid.get(foundComponent,parsed.path,fetchStrategies)};return fetcher}function makeStackResolverOptions(instantiator,parentThat,localRecord,expandOptions){return $.extend({},fluid.defaults("fluid.resolveEnvironment"),{fetcher:makeStackFetcher(instantiator,parentThat,localRecord,expandOptions)})}fluid.instantiator=function(freeInstantiator){var preThat={options:{"fluid.visitComponents.fireBreak":true},idToPath:{},pathToComponent:{},stackCount:0,nickName:"instantiator"};var that=fluid.typeTag("fluid.instantiator");that=$.extend(that,preThat);that.stack=function(count){return that.stackCount+=count};that.getThatStack=function(component){var path=that.idToPath[component.id]||"";var parsed=fluid.model.parseEL(path);var togo=fluid.transform(parsed,function(value,i){var parentPath=fluid.model.composeSegments.apply(null,parsed.slice(0,i+1));return that.pathToComponent[parentPath]});var root=that.pathToComponent[""];if(root){togo.unshift(root)}return togo};that.getEnvironmentalStack=function(){var togo=[fluid.staticEnvironment];if(!freeInstantiator){togo.push(fluid.threadLocal())}return togo};that.getFullStack=function(component){var thatStack=component?that.getThatStack(component):[];return that.getEnvironmentalStack().concat(thatStack)};function recordComponent(component,path){that.idToPath[component.id]=path;if(that.pathToComponent[path]){fluid.fail("Error during instantiation - path "+path+" which has just created component "+fluid.dumpThat(component)+" has already been used for component "+fluid.dumpThat(that.pathToComponent[path])+" - this is a circular instantiation or other oversight. Please clear the component using instantiator.clearComponent() before reusing the path.")}that.pathToComponent[path]=component}that.recordRoot=function(component){if(component&&component.id&&!that.pathToComponent[""]){recordComponent(component,"")}};that.pushUpcomingInstantiation=function(parent,name){that.expectedParent=parent;that.expectedName=name};that.recordComponent=function(component){if(that.expectedName){that.recordKnownComponent(that.expectedParent,component,that.expectedName);delete that.expectedName;delete that.expectedParent}else{that.recordRoot(component)}};that.clearComponent=function(component,name,child,options,noModTree){options=options||{visited:{},flat:true};child=child||component[name];fluid.visitComponentChildren(child,function(gchild,gchildname){that.clearComponent(child,gchildname,null,options,noModTree)},options);var path=that.idToPath[child.id];delete that.idToPath[child.id];delete that.pathToComponent[path];if(!noModTree){delete component[name]}};that.recordKnownComponent=function(parent,component,name){var parentPath=that.idToPath[parent.id]||"";var path=fluid.model.composePath(parentPath,name);recordComponent(component,path)};return that};fluid.freeInstantiator=fluid.instantiator(true);fluid.argMapToDemands=function(argMap){var togo=[];fluid.each(argMap,function(value,key){togo[value]="{"+key+"}"});return togo};fluid.makePassArgsSpec=function(initArgs){return fluid.transform(initArgs,function(arg,index){return"{arguments}."+index})};function mergeToMergeAll(options){if(options&&options.mergeOptions){options.mergeAllOptions=["{options}"].concat(fluid.makeArray(options.mergeOptions))}}function upgradeMergeOptions(demandspec){mergeToMergeAll(demandspec);if(demandspec.mergeAllOptions){if(demandspec.options){fluid.fail("demandspec ",demandspec," is invalid - cannot specify literal options together with mergeOptions or mergeAllOptions")}demandspec.options={mergeAllOptions:demandspec.mergeAllOptions}}if(demandspec.options){delete demandspec.options.mergeOptions}}fluid.embodyDemands=function(instantiator,parentThat,demandspec,initArgs,options){options=options||{};upgradeMergeOptions(demandspec);var oldOptions=fluid.get(options,"componentRecord.options");options.componentRecord=$.extend(true,{},options.componentRecord,fluid.censorKeys(demandspec,["args","funcName","registeredFrom"]));var mergeAllZero=fluid.get(options,"componentRecord.options.mergeAllOptions.0");if(mergeAllZero==="{options}"){fluid.set(options,"componentRecord.options.mergeAllOptions.0",oldOptions)}var demands=$.makeArray(demandspec.args);var upDefaults=fluid.defaults(demandspec.funcName);var argMap=upDefaults?upDefaults.argumentMap:null;var inferMap=false;if(!argMap&&(upDefaults||(options&&options.componentRecord))&&!options.passArgs){inferMap=true;if(demands.length<2){argMap=fluid.rawDefaults("fluid.littleComponent").argumentMap}else{argMap={options:demands.length-1}}}options=options||{};if(demands.length===0){if(options.componentRecord&&argMap){demands=fluid.argMapToDemands(argMap)}else{if(options.passArgs){demands=fluid.makePassArgsSpec(initArgs)}}}var localRecord=$.extend({arguments:initArgs},fluid.censorKeys(options.componentRecord,["type"]));fluid.each(argMap,function(index,name){if(initArgs.length>0){localRecord[name]=localRecord.arguments[index]}if(demandspec[name]!==undefined&&localRecord[name]===undefined){localRecord[name]=demandspec[name]}});mergeToMergeAll(localRecord.options);mergeToMergeAll(argMap&&demands[argMap.options]);var upstreamLocalRecord=$.extend({},localRecord);if(options.componentRecord.options!==undefined){upstreamLocalRecord.options=options.componentRecord.options}var expandOptions=makeStackResolverOptions(instantiator,parentThat,localRecord);var args=[];if(demands){for(var i=0;i",iB);if(iE==-1){return fluid.XMLP._setErr(that,fluid.XMLP.ERR_CLOSE_CDATA)}fluid.XMLP._setContent(that,fluid.XMLP._CONT_XML,iB,iE);that.m_iP=iE+3;return fluid.XMLP._CDATA};fluid.XMLP._parseComment=function(that,iB){var iE=that.m_xml.indexOf("-->",iB);if(iE==-1){return fluid.XMLP._setErr(that,fluid.XMLP.ERR_CLOSE_COMMENT)}fluid.XMLP._setContent(that,fluid.XMLP._CONT_XML,iB-4,iE+3);that.m_iP=iE+3;return fluid.XMLP._COMMENT};fluid.XMLP._parseDTD=function(that,iB){var iE,strClose,iInt,iLast;iE=that.m_xml.indexOf(">",iB);if(iE==-1){return fluid.XMLP._setErr(that,fluid.XMLP.ERR_CLOSE_DTD)}iInt=that.m_xml.indexOf("[",iB);strClose=((iInt!=-1)&&(iInt":">";while(true){if(iE==iLast){return fluid.XMLP._setErr(that,fluid.XMLP.ERR_INFINITELOOP)}iLast=iE;iE=that.m_xml.indexOf(strClose,iB);if(iE==-1){return fluid.XMLP._setErr(that,fluid.XMLP.ERR_CLOSE_DTD)}if(that.m_xml.substring(iE-1,iE+2)!="]]>"){break}}that.m_iP=iE+strClose.length;return fluid.XMLP._DTD};fluid.XMLP._parsePI=function(that,iB){var iE,iTB,iTE,iCB,iCE;iE=that.m_xml.indexOf("?>",iB);if(iE==-1){return fluid.XMLP._setErr(that,fluid.XMLP.ERR_CLOSE_PI)}iTB=fluid.SAXStrings.indexOfNonWhitespace(that.m_xml,iB,iE);if(iTB==-1){return fluid.XMLP._setErr(that,fluid.XMLP.ERR_PI_TARGET)}iTE=fluid.SAXStrings.indexOfWhitespace(that.m_xml,iTB,iE);if(iTE==-1){iTE=iE}iCB=fluid.SAXStrings.indexOfNonWhitespace(that.m_xml,iTE,iE);if(iCB==-1){iCB=iE}iCE=fluid.SAXStrings.lastIndexOfNonWhitespace(that.m_xml,iCB,iE);if(iCE==-1){iCE=iE-1}that.m_name=that.m_xml.substring(iTB,iTE);fluid.XMLP._setContent(that,fluid.XMLP._CONT_XML,iCB,iCE+1);that.m_iP=iE+2;return fluid.XMLP._PI};fluid.XMLP._parseText=function(that,iB){var iE=that.m_xml.indexOf("<",iB);if(iE==-1){iE=that.m_xml.length}fluid.XMLP._setContent(that,fluid.XMLP._CONT_XML,iB,iE);that.m_iP=iE;return fluid.XMLP._TEXT};fluid.XMLP._setContent=function(that,iSrc){var args=arguments;if(fluid.XMLP._CONT_XML==iSrc){that.m_cAlt=null;that.m_cB=args[2];that.m_cE=args[3]}else{that.m_cAlt=args[2];that.m_cB=0;that.m_cE=args[2].length}that.m_cSrc=iSrc};fluid.XMLP._setErr=function(that,iErr){var strErr=fluid.XMLP._errs[iErr];that.m_cAlt=strErr;that.m_cB=0;that.m_cE=strErr.length;that.m_cSrc=fluid.XMLP._CONT_ALT;return fluid.XMLP._ERROR};fluid.XMLP._parseElement=function(that,iB){var iE,iDE,iRet;var iType,strN,iLast;iDE=iE=that.m_xml.indexOf(">",iB);if(iE==-1){return that._setErr(that,fluid.XMLP.ERR_CLOSE_ELM)}if(that.m_xml.charAt(iB)=="/"){iType=fluid.XMLP._ELM_E;iB++}else{iType=fluid.XMLP._ELM_B}if(that.m_xml.charAt(iE-1)=="/"){if(iType==fluid.XMLP._ELM_E){return fluid.XMLP._setErr(that,fluid.XMLP.ERR_ELM_EMPTY)}iType=fluid.XMLP._ELM_EMP;iDE--}that.nameRegex.lastIndex=iB;var nameMatch=that.nameRegex.exec(that.m_xml);if(!nameMatch){return fluid.XMLP._setErr(that,fluid.XMLP.ERR_ELM_NAME)}strN=nameMatch[1].toLowerCase();if("li"===strN&&iType!==fluid.XMLP._ELM_E&&that.m_stack.length>0&&that.m_stack[that.m_stack.length-1]==="li"&&!that.m_emitSynthetic){that.m_name="li";that.m_emitSynthetic=true;return fluid.XMLP._ELM_E}that.m_attributes={};that.m_cAlt="";if(that.nameRegex.lastIndex]+)/g;that.attrStartRegex=/\s*([\w:_][\w:_\-\.]*)/gm;that.attrValRegex=/\"([^\"]*)\"\s*/gm;that.attrValIERegex=/([^\>\s]+)\s*/gm;that.closeRegex=/\s*<\//g;return that};fluid.SAXStrings={};fluid.SAXStrings.WHITESPACE=" \t\n\r";fluid.SAXStrings.QUOTES="\"'";fluid.SAXStrings.getColumnNumber=function(strD,iP){if(!strD){return -1}iP=iP||strD.length;var arrD=strD.substring(0,iP).split("\n");arrD.length--;var iLinePos=arrD.join("\n").length;return iP-iLinePos};fluid.SAXStrings.getLineNumber=function(strD,iP){if(!strD){return -1}iP=iP||strD.length;return strD.substring(0,iP).split("\n").length};fluid.SAXStrings.indexOfNonWhitespace=function(strD,iB,iE){if(!strD){return -1}iB=iB||0;iE=iE||strD.length;for(var i=iB;i=iB;i--){if(fluid.SAXStrings.WHITESPACE.indexOf(strD.charAt(i))==-1){return i}}return -1};fluid.SAXStrings.replace=function(strD,iB,iE,strF,strR){if(!strD){return""}iB=iB||0;iE=iE||strD.length;return strD.substring(iB,iE).split(strF).join(strR)}})(jQuery,fluid_1_4);fluid_1_4=fluid_1_4||{};(function($,fluid){fluid.parseTemplate=function(template,baseURL,scanStart,cutpoints_in,opts){opts=opts||{};if(!template){fluid.fail("empty template supplied to fluid.parseTemplate")}var t;var parser;var tagstack;var lumpindex=0;var nestingdepth=0;var justended=false;var defstart=-1;var defend=-1;var debugMode=false;var cutpoints=[];var simpleClassCutpoints={};var cutstatus=[];var XMLLump=function(lumpindex,nestingdepth){return{nestingdepth:nestingdepth,lumpindex:lumpindex,parent:t}};function isSimpleClassCutpoint(tree){return tree.length===1&&tree[0].predList.length===1&&tree[0].predList[0].clazz}function init(baseURLin,debugModeIn,cutpointsIn){t.rootlump=XMLLump(0,-1);tagstack=[t.rootlump];lumpindex=0;nestingdepth=0;justended=false;defstart=-1;defend=-1;baseURL=baseURLin;debugMode=debugModeIn;if(cutpointsIn){for(var i=0;i=0;--i){var lump=tagstack[i];if(lump.rsfID!==undefined){return lump}}return t.rootlump}function newLump(){var togo=XMLLump(lumpindex,nestingdepth);if(debugMode){togo.line=parser.getLineNumber();togo.column=parser.getColumnNumber()}t.lumps[lumpindex]=togo;++lumpindex;return togo}function addLump(mmap,ID,lump){var list=mmap[ID];if(!list){list=[];mmap[ID]=list}list[list.length]=lump}function checkContribute(ID,lump){if(ID.indexOf("scr=contribute-")!==-1){var scr=ID.substring("scr=contribute-".length);addLump(t.collectmap,scr,lump)}}function debugLump(lump){return"<"+lump.tagname+">"}function hasCssClass(clazz,totest){if(!totest){return false}return(" "+totest+" ").indexOf(" "+clazz+" ")!==-1}function matchNode(term,headlump,headclazz){if(term.predList){for(var i=0;i0){if(cut.tree[nextterm-1].child&&cutstat[nextterm-1]!==headlump.nestingdepth-1){continue}}var isMatch=matchNode(term,headlump,headclazz);if(isMatch){cutstat[cutstat.length]=headlump.nestingdepth;if(cutstat.length===cut.tree.length){if(togo!==undefined){fluid.fail("Cutpoint specification error - node "+debugLump(headlump)+" has already matched with rsf:id of "+togo)}if(cut.id===undefined||cut.id===null){fluid.fail("Error in cutpoints list - entry at position "+i+" does not have an id set")}togo=cut.id}}}}return togo}function tagEndCut(){if(cutpoints){for(var i=0;i0&&cutstat[cutstat.length-1]===nestingdepth){cutstat.length--}}}}function processTagEnd(){tagEndCut();var endlump=newLump();--nestingdepth;endlump.text="";var oldtop=tagstack[tagstack.length-1];oldtop.close_tag=t.lumps[lumpindex-1];tagstack.length--;justended=true}function processTagStart(isempty,text){++nestingdepth;if(justended){justended=false;var backlump=newLump();backlump.nestingdepth--}if(t.firstdocumentindex===-1){t.firstdocumentindex=lumpindex}var headlump=newLump();var stacktop=tagstack[tagstack.length-1];headlump.uplump=stacktop;var tagname=parser.getName();headlump.tagname=tagname;var attrs=headlump.attributemap=parser.m_attributes;var ID=attrs[fluid.ID_ATTRIBUTE];if(ID===undefined){ID=tagStartCut(headlump)}for(var attrname in attrs){if(ID===undefined){if(/href|src|codebase|action/.test(attrname)){ID="scr=rewrite-url"}else{if(ID===undefined&&/for|headers/.test(attrname)){ID="scr=null"}}}}if(ID){if(ID.charCodeAt(0)===126){ID=ID.substring(1);headlump.elide=true}checkContribute(ID,headlump);headlump.rsfID=ID;var downreg=findTopContainer();if(!downreg.downmap){downreg.downmap={}}while(downreg){if(downreg.downmap){addLump(downreg.downmap,ID,headlump)}downreg=downreg.uplump}addLump(t.globalmap,ID,headlump);var colpos=ID.indexOf(":");if(colpos!==-1){var prefix=ID.substring(0,colpos);if(!stacktop.finallump){stacktop.finallump={}}stacktop.finallump[prefix]=headlump}}headlump.text="<"+tagname+fluid.dumpAttributes(attrs)+(isempty&&!ID?"/>":">");tagstack[tagstack.length]=headlump;if(isempty){if(ID){processTagEnd()}else{--nestingdepth;tagstack.length--}}}function processDefaultTag(){if(defstart!==-1){if(t.firstdocumentindex===-1){t.firstdocumentindex=lumpindex}var text=parser.getContent().substr(defstart,defend-defstart);justended=false;var newlump=newLump();newlump.text=text;defstart=-1}}t=fluid.XMLViewTemplate();init(baseURL,opts.debugMode,cutpoints_in);var idpos=template.indexOf(fluid.ID_ATTRIBUTE);if(scanStart){var brackpos=template.indexOf(">",idpos);parser=fluid.XMLP(template.substring(brackpos+1))}else{parser=fluid.XMLP(template)}parseloop:while(true){var iEvent=parser.next();switch(iEvent){case fluid.XMLP._ELM_B:processDefaultTag();processTagStart(false,"");break;case fluid.XMLP._ELM_E:processDefaultTag();processTagEnd();break;case fluid.XMLP._ELM_EMP:processDefaultTag();processTagStart(true,"");break;case fluid.XMLP._PI:case fluid.XMLP._DTD:defstart=-1;continue;case fluid.XMLP._TEXT:case fluid.XMLP._ENTITY:case fluid.XMLP._CDATA:case fluid.XMLP._COMMENT:if(defstart===-1){defstart=parser.m_cB}defend=parser.m_cE;break;case fluid.XMLP._ERROR:fluid.setLogging(true);var message="Error parsing template: "+parser.m_cAlt+" at line "+parser.getLineNumber();fluid.log(message);fluid.log("Just read: "+parser.m_xml.substring(parser.m_iP-30,parser.m_iP));fluid.log("Still to read: "+parser.m_xml.substring(parser.m_iP,parser.m_iP+30));fluid.fail(message);break parseloop;case fluid.XMLP._NONE:break parseloop}}processDefaultTag();var excess=tagstack.length-1;if(excess){fluid.fail("Error parsing template - unclosed tag(s) of depth "+(excess)+": "+fluid.transform(tagstack.splice(1,excess),function(lump){return debugLump(lump)}).join(", "))}return t};fluid.debugLump=function(lump){var togo=lump.text;togo+=" at ";togo+="lump line "+lump.line+" column "+lump.column+" index "+lump.lumpindex;togo+=lump.parent.href===null?"":" in file "+lump.parent.href;return togo};fluid.ID_ATTRIBUTE="rsf:id";fluid.getPrefix=function(id){var colpos=id.indexOf(":");return colpos===-1?id:id.substring(0,colpos)};fluid.SplitID=function(id){var that={};var colpos=id.indexOf(":");if(colpos===-1){that.prefix=id}else{that.prefix=id.substring(0,colpos);that.suffix=id.substring(colpos+1)}return that};fluid.XMLViewTemplate=function(){return{globalmap:{},collectmap:{},lumps:[],firstdocumentindex:-1}};fluid.XMLEncode=function(text){return text.replace(/&/g,"&").replace(//g,">").replace(/\"/g,""")};fluid.dumpAttributes=function(attrcopy){var togo="";for(var attrname in attrcopy){var attrvalue=attrcopy[attrname];if(attrvalue!==null&&attrvalue!==undefined){togo+=" "+attrname+'="'+attrvalue+'"'}}return togo};fluid.aggregateMMap=function(target,source){for(var key in source){var targhas=target[key];if(!targhas){target[key]=[]}target[key]=target[key].concat(source[key])}};fluid.parseTemplates=function(resourceSpec,templateList,opts){var togo=[];opts=opts||{};togo.globalmap={};for(var i=0;i)?\\s*","g");fluid.parseSelector=function(selstring){var togo=[];selstring=$.trim(selstring);quickClass.lastIndex=0;var lastIndex=0;while(true){var atNode=[];while(true){var segMatch=quickClass.exec(selstring);if(!segMatch||segMatch.index!==lastIndex){break}var thisNode={};var text=segMatch[2];if(segMatch[1]===""){thisNode.tag=text}else{if(segMatch[1]==="#"){thisNode.id=text}else{if(segMatch[1]==="."){thisNode.clazz=text}}}atNode[atNode.length]=thisNode;lastIndex=quickClass.lastIndex}childSeg.lastIndex=lastIndex;var fullAtNode={predList:atNode};var childMatch=childSeg.exec(selstring);if(!childMatch||childMatch.index!==lastIndex){var remainder=selstring.substring(lastIndex);fluid.fail("Error in selector string - can not match child selector expression at "+remainder)}if(childMatch[1]===">"){fullAtNode.child=true}togo[togo.length]=fullAtNode;if(childSeg.lastIndex>=selstring.length){break}lastIndex=childSeg.lastIndex;quickClass.lastIndex=childSeg.lastIndex}return togo}})(jQuery,fluid_1_4);fluid_1_4=fluid_1_4||{};(function($,fluid){function debugPosition(component){return"as child of "+(component.parent.fullID?"component with full ID "+component.parent.fullID:"root")}function computeFullID(component){var togo="";var move=component;if(component.children===undefined){togo=component.ID+(component.localID!==undefined?component.localID:"");move=component.parent}while(move.parent){var parent=move.parent;if(move.fullID!==undefined){togo=move.fullID+togo;return togo}if(move.noID===undefined){var ID=move.ID;if(ID===undefined){fluid.fail("Error in component tree - component found with no ID "+debugPosition(parent)+": please check structure")}var colpos=ID.indexOf(":");var prefix=colpos===-1?ID:ID.substring(0,colpos);togo=prefix+":"+(move.localID===undefined?"":move.localID)+":"+togo}move=parent}return togo}var renderer={};renderer.isBoundPrimitive=function(value){return fluid.isPrimitive(value)||value instanceof Array&&(value.length===0||typeof (value[0])==="string")};var unzipComponent;function processChild(value,key){if(renderer.isBoundPrimitive(value)){return{componentType:"UIBound",value:value,ID:key}}else{var unzip=unzipComponent(value);if(unzip.ID){return{ID:key,componentType:"UIContainer",children:[unzip]}}else{unzip.ID=key;return unzip}}}function fixChildren(children){if(!(children instanceof Array)){var togo=[];for(var key in children){var value=children[key];if(value instanceof Array){for(var i=0;ibasedepth+(closeparent?0:1)){fluid.log("Error in component tree - leaf component found to contain further components - at "+lump.toString())}else{break}}++renderindex}if(!closeparent&&(renderindex===lumps.length||!lumps[renderindex].rsfID)){--renderindex}dumpTillLump(lumps,start,renderindex);return renderindex}function isPlaceholder(value){return false}function isValue(value){return value!==null&&value!==undefined&&!isPlaceholder(value)}var trc={};function openTag(){if(!trc.iselide){out+="<"+trc.uselump.tagname}}function closeTag(){if(!trc.iselide){out+=""}}function renderUnchanged(){dumpTillLump(trc.uselump.parent.lumps,trc.uselump.lumpindex+1,trc.close.lumpindex+(trc.iselide?0:1))}function isSelfClose(){return trc.endopen.lumpindex===trc.close.lumpindex&&fluid.XMLP.closedTags[trc.uselump.tagname]}function dumpTemplateBody(){if(isSelfClose()){if(!trc.iselide){out+="/>"}}else{if(!trc.iselide){out+=">"}dumpTillLump(trc.uselump.parent.lumps,trc.endopen.lumpindex,trc.close.lumpindex+(trc.iselide?0:1))}}function replaceAttributes(){if(!trc.iselide){out+=fluid.dumpAttributes(trc.attrcopy)}dumpTemplateBody()}function replaceAttributesOpen(){if(trc.iselide){replaceAttributes()}else{out+=fluid.dumpAttributes(trc.attrcopy);var selfClose=isSelfClose();out+=selfClose?"/>":">";trc.nextpos=selfClose?trc.close.lumpindex+1:trc.endopen.lumpindex}}function replaceBody(value){out+=fluid.dumpAttributes(trc.attrcopy);if(!trc.iselide){out+=">"}out+=fluid.XMLEncode(value.toString());closeTag()}function rewriteLeaf(value){if(isValue(value)){replaceBody(value)}else{replaceAttributes()}}function rewriteLeafOpen(value){if(trc.iselide){rewriteLeaf(trc.value)}else{if(isValue(value)){replaceBody(value)}else{replaceAttributesOpen()}}}function rewriteUrl(template,url){if(renderOptions.urlRewriter){var rewritten=renderOptions.urlRewriter(url);if(rewritten){return rewritten}}if(!renderOptions.rebaseURLs){return url}var protpos=url.indexOf(":/");if(url.charAt(0)==="/"||protpos!==-1&&protpos<7){return url}else{return renderOptions.baseURL+url}}function dumpHiddenField(todump){out+='\n"}var outDecoratorsImpl;function applyAutoBind(torender,finalID){if(!finalID){return }var tagname=trc.uselump.tagname;var applier=renderOptions.applier;function applyFunc(){fluid.applyChange(fluid.byId(finalID),undefined,applier)}if(renderOptions.autoBind&&/input|select|textarea/.test(tagname)&&!renderedbindings[finalID]){var decorators=[{jQuery:["change",applyFunc]}];if($.browser.msie&&tagname==="input"&&/radio|checkbox/.test(trc.attrcopy.type)){decorators.push({jQuery:["click",applyFunc]})}if($.browser.safari&&tagname==="input"&&trc.attrcopy.type==="radio"){decorators.push({jQuery:["keyup",applyFunc]})}outDecoratorsImpl(torender,decorators,trc.attrcopy,finalID)}}function dumpBoundFields(torender,parent){if(torender){var holder=parent?parent:torender;if(directFossils&&holder.valuebinding){var fossilKey=holder.submittingname||torender.finalID;directFossils[fossilKey]={name:fossilKey,EL:holder.valuebinding,oldvalue:holder.value};applyAutoBind(torender,torender.finalID)}if(torender.fossilizedbinding){dumpHiddenField(torender.fossilizedbinding)}if(torender.fossilizedshaper){dumpHiddenField(torender.fossilizedshaper)}}}function dumpSelectionBindings(uiselect){if(!renderedbindings[uiselect.selection.fullID]){renderedbindings[uiselect.selection.fullID]=true;dumpBoundFields(uiselect.selection);dumpBoundFields(uiselect.optionlist);dumpBoundFields(uiselect.optionnames)}}function isSelectedValue(torender,value){var selection=torender.selection;return selection.value&&typeof (selection.value)!=="string"&&typeof (selection.value.length)==="number"?$.inArray(value,selection.value,value)!==-1:selection.value===value}function getRelativeComponent(component,relativeID){component=component.parent;while(relativeID.indexOf("..::")===0){relativeID=relativeID.substring(4);component=component.parent}return component.childmap[relativeID]}function adjustForID(attrcopy,component,late,forceID){if(!late){delete attrcopy["rsf:id"]}if(component.finalID!==undefined){attrcopy.id=component.finalID}else{if(forceID!==undefined){attrcopy.id=forceID}else{if(attrcopy.id||late){attrcopy.id=component.fullID}}}var count=1;var baseid=attrcopy.id;while(renderOptions.document.getElementById(attrcopy.id)||usedIDs[attrcopy.id]){attrcopy.id=baseid+"-"+(count++)}component.finalID=attrcopy.id;return attrcopy.id}function assignSubmittingName(attrcopy,component,parent){var submitting=parent||component;adjustForID(attrcopy,component,true,component.fullID);if(submitting.submittingname===undefined&&submitting.willinput!==false){submitting.submittingname=submitting.finalID||submitting.fullID}return submitting.submittingname}function explodeDecorators(decorators){var togo=[];if(decorators.type){togo[0]=decorators}else{for(var key in decorators){if(key==="$"){key="jQuery"}var value=decorators[key];var decorator={type:key};if(key==="jQuery"){decorator.func=value[0];decorator.args=value.slice(1)}else{if(key==="addClass"||key==="removeClass"){decorator.classes=value}else{if(key==="attrs"){decorator.attributes=value}else{if(key==="identify"){decorator.key=value}}}}togo[togo.length]=decorator}}return togo}outDecoratorsImpl=function(torender,decorators,attrcopy,finalID){renderOptions.idMap=renderOptions.idMap||{};for(var i=0;i"}function resolveArgs(args){if(!args){return args}return fluid.transform(args,function(arg,index){upgradeBound(args,index,renderOptions.model,renderOptions.resolverGetConfig);return args[index].value})}function degradeMessage(torender){if(torender.componentType==="UIMessage"){torender.componentType="UIBound";if(!renderOptions.messageLocator){torender.value="[No messageLocator is configured in options - please consult documentation on options.messageSource]"}else{upgradeBound(torender,"messagekey",renderOptions.model,renderOptions.resolverGetConfig);var resArgs=resolveArgs(torender.args);torender.value=renderOptions.messageLocator(torender.messagekey.value,resArgs)}}}function renderComponent(torender){var attrcopy=trc.attrcopy;degradeMessage(torender);var componentType=torender.componentType;var tagname=trc.uselump.tagname;outDecorators(torender,attrcopy);function makeFail(torender,end){fluid.fail("Error in component tree - UISelectChoice with id "+torender.fullID+end)}if(componentType==="UIBound"||componentType==="UISelectChoice"){var parent;if(torender.choiceindex!==undefined){if(torender.parentRelativeID!==undefined){parent=getRelativeComponent(torender,torender.parentRelativeID);if(!parent){makeFail(torender," has parentRelativeID of "+torender.parentRelativeID+" which cannot be resolved")}}else{makeFail(torender," does not have parentRelativeID set")}assignSubmittingName(attrcopy,torender,parent.selection);dumpSelectionBindings(parent)}var submittingname=parent?parent.selection.submittingname:torender.submittingname;if(!parent&&torender.valuebinding){submittingname=assignSubmittingName(attrcopy,torender)}if(tagname==="input"||tagname==="textarea"){if(submittingname!==undefined){attrcopy.name=submittingname}}dumpBoundFields(torender,parent?parent.selection:null);if(typeof (torender.value)==="boolean"||attrcopy.type==="radio"||attrcopy.type==="checkbox"){var underlyingValue;var directValue=torender.value;if(torender.choiceindex!==undefined){if(!parent.optionlist.value){fluid.fail("Error in component tree - selection control with full ID "+parent.fullID+" has no values")}underlyingValue=parent.optionlist.value[torender.choiceindex];directValue=isSelectedValue(parent,underlyingValue)}if(isValue(directValue)){if(directValue){attrcopy.checked="checked"}else{delete attrcopy.checked}}attrcopy.value=fluid.XMLEncode(underlyingValue?underlyingValue:"true");rewriteLeaf(null)}else{if(torender.value instanceof Array){renderUnchanged()}else{var value=parent?parent[tagname==="textarea"||tagname==="input"?"optionlist":"optionnames"].value[torender.choiceindex]:torender.value;if(tagname==="textarea"){if(isPlaceholder(value)&&torender.willinput){value=""}rewriteLeaf(value)}else{if(tagname==="input"){if(torender.willinput||isValue(value)){attrcopy.value=fluid.XMLEncode(String(value))}rewriteLeaf(null)}else{delete attrcopy.name;rewriteLeafOpen(value)}}}}}else{if(componentType==="UISelect"){var ishtmlselect=tagname==="select";var ismultiple=false;if(torender.selection.value instanceof Array){ismultiple=true;if(ishtmlselect){attrcopy.multiple="multiple"}}var oldid=attrcopy.id;assignSubmittingName(attrcopy,torender.selection);if(oldid!==undefined){attrcopy.id=oldid}if(ishtmlselect){if(torender.selection.willinput!==false){attrcopy.name=torender.selection.submittingname}applyAutoBind(torender,attrcopy.id)}out+=fluid.dumpAttributes(attrcopy);if(ishtmlselect){out+=">";var values=torender.optionlist.value;var names=torender.optionnames===null||torender.optionnames===undefined||!torender.optionnames.value?values:torender.optionnames.value;if(!names||!names.length){fluid.fail("Error in component tree - UISelect component with fullID "+torender.fullID+" does not have optionnames set")}for(var i=0;i';out+=fluid.XMLEncode(names[i]);out+="\n"}closeTag()}else{dumpTemplateBody()}dumpSelectionBindings(torender)}else{if(componentType==="UILink"){var attrname=LINK_ATTRIBUTES[tagname];if(attrname){degradeMessage(torender.target);var target=torender.target.value;if(!isValue(target)){target=attrcopy[attrname]}target=rewriteUrl(trc.uselump.parent,target);attrcopy[attrname]=fluid.XMLEncode(target)}var value;if(torender.linktext){degradeMessage(torender.linktext);value=torender.linktext.value}if(!isValue(value)){replaceAttributesOpen()}else{rewriteLeaf(value)}}else{if(torender.markup!==undefined){degradeMessage(torender.markup);var rendered=torender.markup.value;if(rendered===null){out+=fluid.dumpAttributes(attrcopy);out+=">";renderUnchanged()}else{if(!trc.iselide){out+=fluid.dumpAttributes(attrcopy);out+=">"}out+=rendered;closeTag()}}}}}if(attrcopy.id!==undefined){usedIDs[attrcopy.id]=true}}function rewriteIDRelation(context){var attrname;var attrval=trc.attrcopy["for"];if(attrval!==undefined){attrname="for"}else{attrval=trc.attrcopy.headers;if(attrval!==undefined){attrname="headers"}}if(!attrname){return }var tagname=trc.uselump.tagname;if(attrname==="for"&&tagname!=="label"){return }if(attrname==="headers"&&tagname!=="td"&&tagname!=="th"){return }var rewritten=rewritemap[getRewriteKey(trc.uselump.parent,context,attrval)];if(rewritten!==undefined){trc.attrcopy[attrname]=rewritten}}function renderComment(message){out+=("")}function renderDebugMessage(message){out+='';out+=message;out+="
    "}function reportPath(branch){var path=branch.fullID;return !path?"component tree root":"full path "+path}function renderComponentSystem(context,torendero,lump){var lumpindex=lump.lumpindex;var lumps=lump.parent.lumps;var nextpos=-1;var outerendopen=lumps[lumpindex+1];var outerclose=lump.close_tag;nextpos=outerclose.lumpindex+1;var payloadlist=lump.downmap?lump.downmap["payload-component"]:null;var payload=payloadlist?payloadlist[0]:null;var iselide=lump.rsfID.charCodeAt(0)===126;var endopen=outerendopen;var close=outerclose;var uselump=lump;var attrcopy={};$.extend(true,attrcopy,(payload===null?lump:payload).attributemap);trc.attrcopy=attrcopy;trc.uselump=uselump;trc.endopen=endopen;trc.close=close;trc.nextpos=nextpos;trc.iselide=iselide;rewriteIDRelation(context);if(torendero===null){if(lump.rsfID.indexOf("scr=")===(iselide?1:0)){var scrname=lump.rsfID.substring(4+(iselide?1:0));if(scrname==="ignore"){nextpos=trc.close.lumpindex+1}else{if(scrname==="rewrite-url"){torendero={componentType:"UILink",target:{}}}else{openTag();replaceAttributesOpen();nextpos=trc.endopen.lumpindex}}}}if(torendero!==null){if(payload){trc.endopen=lumps[payload.lumpindex+1];trc.close=payload.close_tag;trc.uselump=payload;dumpTillLump(lumps,lumpindex,payload.lumpindex);lumpindex=payload.lumpindex}adjustForID(attrcopy,torendero);openTag();renderComponent(torendero);if(payload!==null){if(trc.nextpos===nextpos){dumpTillLump(lumps,trc.close.lumpindex+1,outerclose.lumpindex+1)}}nextpos=trc.nextpos}return nextpos}var renderRecurse;function renderContainer(child,targetlump){var t2=targetlump.parent;var firstchild=t2.lumps[targetlump.lumpindex+1];if(child.children!==undefined){dumpBranchHead(child,targetlump)}else{renderComponentSystem(child.parent,child,targetlump)}renderRecurse(child,targetlump,firstchild)}fetchComponent=function(basecontainer,id,lump){if(id.indexOf("msg=")===0){var key=id.substring(4);return{componentType:"UIMessage",messagekey:key}}while(basecontainer){var togo=basecontainer.childmap[id];if(togo){return togo}basecontainer=basecontainer.parent}return null};function fetchComponents(basecontainer,id){var togo;while(basecontainer){togo=basecontainer.childmap[id];if(togo){break}basecontainer=basecontainer.parent}return togo}function findChild(sourcescope,child){var split=fluid.SplitID(child.ID);var headlumps=sourcescope.downmap[child.ID];if(!headlumps){headlumps=sourcescope.downmap[split.prefix+":"]}return headlumps?headlumps[0]:null}renderRecurse=function(basecontainer,parentlump,baselump){var renderindex=baselump.lumpindex;var basedepth=parentlump.nestingdepth;var t1=parentlump.parent;var rendered;if(debugMode){rendered={}}while(true){renderindex=dumpScan(t1.lumps,renderindex,basedepth,!parentlump.elide,false);if(renderindex===t1.lumps.length){break}var lump=t1.lumps[renderindex];var id=lump.rsfID;if(lump.nestingdepth=targetlump.nestingdepth;var newbase=child.children?child:basecontainer;if(wasopentag){renderRecurse(newbase,targetlump,t1.lumps[renderend]);renderend=targetlump.close_tag.lumpindex+1}if(i!==children.length-1){if(renderend")}if(options.model){fluid.bindFossils(node,options.model,fossils)}if($.browser.msie){$(node).html(rendered)}else{node.innerHTML=rendered}renderer.processDecoratorQueue();if(lastId){var element=fluid.byId(lastId);if(element){$(element).focus()}}return templates};function findNodeValue(rootNode){var node=fluid.dom.iterateDom(rootNode,function(node){return node.nodeType===8||node.nodeType===4?"stop":null},true);var value=node.nodeValue;if(value.indexOf("[CDATA[")===0){return value.substring(6,value.length-2)}else{return value}}fluid.extractTemplate=function(node,armouring){if(!armouring){return node.innerHTML}else{return findNodeValue(node)}};fluid.render=function(source,target,tree,options){options=options||{};var template=source;if(typeof (source)==="object"){template=fluid.extractTemplate(fluid.unwrap(source.node),source.armouring)}target=fluid.unwrap(target);var resourceSpec={base:{resourceText:template,href:".",resourceKey:".",cutpoints:options.cutpoints}};var templates=fluid.parseTemplates(resourceSpec,["base"],options);return fluid.reRender(templates,target,tree,options)};fluid.selfRender=function(node,tree,options){options=options||{};return fluid.render({node:node,armouring:options.armouring},node,tree,options)}})(jQuery,fluid_1_4);fluid_1_4=fluid_1_4||{};(function($,fluid){if(!fluid.renderer){fluid.fail("fluidRenderer.js is a necessary dependency of RendererUtilities")}fluid.iota=function(count,first){first=first||0;var togo=[];for(var i=0;i0){expanded.push({children:expandrow})}}else{if(expandrow!==fluid.renderer.NO_COMPONENT){expanded.push(expandrow)}}});var repeatID=options.repeatID;if(repeatID.indexOf(":")===-1){repeatID=repeatID+":"}fluid.each(expanded,function(entry){entry.ID=repeatID});return expanded};fluid.renderer.condition=function(options,container,key,config){fluid.expect("Selection to condition expander",["condition"],options);var condition;if(options.condition.funcName){var args=config.expandLight(options.condition.args);condition=fluid.invoke(options.condition.funcName,args)}else{if(options.condition.expander){condition=config.expander(options.condition)}else{condition=config.expandLight(options.condition)}}var tree=(condition?options.trueTree:options.falseTree);if(!tree){tree=fluid.renderer.NO_COMPONENT}return config.expander(tree)};fluid.extractContextualPath=function(string,options,env){var parsed=fluid.extractELWithContext(string,options);if(parsed){if(parsed.context){var fetched=env[parsed.context];if(typeof (fetched)!=="string"){fluid.fail("Could not look up context path named "+parsed.context+" to string value")}return fluid.model.composePath(fetched,parsed.path)}else{return parsed.path}}};fluid.renderer.makeProtoExpander=function(expandOptions){var options=$.extend({ELstyle:"${}"},expandOptions);options.fetcher=fluid.makeEnvironmentFetcher("rendererEnvironment",options.model);var IDescape=options.IDescape||"\\";function fetchEL(string){var env=fluid.threadLocal().rendererEnvironment;return fluid.extractContextualPath(string,options,env)}var expandLight=function(source){return fluid.resolveEnvironment(source,options)};var expandBound=function(value,concrete){if(value.messagekey!==undefined){return{componentType:"UIMessage",messagekey:expandBound(value.messagekey),args:expandLight(value.args)}}var proto;if(!fluid.isPrimitive(value)&&!fluid.isArrayable(value)){proto=$.extend({},value);if(proto.decorators){proto.decorators=expandLight(proto.decorators)}value=proto.value;delete proto.value}else{proto={}}var EL=typeof (value)==="string"?fetchEL(value):null;if(EL){proto.valuebinding=EL}else{if(value!==undefined){proto.value=value}}if(options.model&&proto.valuebinding&&proto.value===undefined){proto.value=fluid.get(options.model,proto.valuebinding,options.resolverGetConfig)}if(concrete){proto.componentType="UIBound"}return proto};options.filter=fluid.expander.lightFilter;var expandCond;var expandLeafOrCond;var expandEntry=function(entry){var comp=[];expandCond(entry,comp);return{children:comp}};var expandExternal=function(entry){if(entry===fluid.renderer.NO_COMPONENT){return entry}var singleTarget;var target=[];var pusher=function(comp){singleTarget=comp};expandLeafOrCond(entry,target,pusher);return singleTarget||target};var expandConfig={model:options.model,resolverGetConfig:options.resolverGetConfig,resolverSetConfig:options.resolverSetConfig,expander:expandExternal,expandLight:expandLight};var expandLeaf=function(leaf,componentType){var togo={componentType:componentType};var map=fluid.renderer.boundMap[componentType]||{};for(var key in leaf){if(/decorators|args/.test(key)){togo[key]=expandLight(leaf[key]);continue}else{if(map[key]){togo[key]=expandBound(leaf[key])}else{togo[key]=leaf[key]}}}return togo};var expandChildren=function(entry,pusher){var children=entry.children;for(var i=0;icond transition")}expandCond(entry,target)}};expandCond=function(proto,target){for(var key in proto){var entry=proto[key];if(key.charAt(0)===IDescape){key=key.substring(1)}if(key==="expander"){var expanders=fluid.makeArray(entry);fluid.each(expanders,function(expander){var expanded=fluid.invokeGlobalFunction(expander.type,[expander,proto,key,expandConfig]);if(expanded!==fluid.renderer.NO_COMPONENT){fluid.each(expanded,function(el){target[target.length]=el})}})}else{if(entry){var condPusher=function(comp){comp.ID=key;target[target.length]=comp};if(entry.children){if(key.indexOf(":")===-1){key=key+":"}expandChildren(entry,condPusher)}else{if(fluid.renderer.isBoundPrimitive(entry)){condPusher(expandBound(entry,true))}else{expandLeafOrCond(entry,null,condPusher)}}}}}};return function(entry){var initEnvironment=$.extend({},options.envAdd);return fluid.withEnvironment({rendererEnvironment:initEnvironment},function(){return expandEntry(entry)})}}})(jQuery,fluid_1_4);var fluid_1_4=fluid_1_4||{};(function($,fluid){fluid.registerNamespace("fluid.browser");fluid.browser.binaryXHR=function(){var canSendBinary=window.FormData||(window.XMLHttpRequest&&window.XMLHttpRequest.prototype&&window.XMLHttpRequest.prototype.sendAsBinary);return canSendBinary?fluid.typeTag("fluid.browser.supportsBinaryXHR"):undefined};fluid.browser.formData=function(){return window.FormData?fluid.typeTag("fluid.browser.supportsFormData"):undefined};fluid.browser.flash=function(){var hasModernFlash=(typeof (swfobject)!=="undefined")&&(swfobject.getFlashPlayerVersion().major>8);return hasModernFlash?fluid.typeTag("fluid.browser.supportsFlash"):undefined};fluid.progressiveChecker=function(options){var that=fluid.initLittleComponent("fluid.progressiveChecker",options);return fluid.typeTag(fluid.find(that.options.checks,function(check){if(check.feature){return check.contextName}},that.options.defaultContextName))};fluid.defaults("fluid.progressiveChecker",{gradeNames:"fluid.typeFount",checks:[],defaultContextName:undefined});fluid.progressiveCheckerForComponent=function(options){var that=fluid.initLittleComponent("fluid.progressiveCheckerForComponent",options);var defaults=fluid.defaults(that.options.componentName);return fluid.progressiveChecker(fluid.expandOptions(defaults.progressiveCheckerOptions,that))};fluid.defaults("fluid.progressiveCheckerForComponent",{gradeNames:"fluid.typeFount"});$("head").append("");var features={supportsBinaryXHR:fluid.browser.binaryXHR(),supportsFormData:fluid.browser.formData(),supportsFlash:fluid.browser.flash()};fluid.merge(null,fluid.staticEnvironment,features)})(jQuery,fluid_1_4);(function($){var increments=0;$.widget("ui.tooltip",{options:{items:"[title]",content:function(){return $(this).attr("title")},position:{my:"left center",at:"right center",offset:"15 0"}},_create:function(){var self=this;this.tooltip=$("
    ").attr("id","ui-tooltip-"+increments++).attr("role","tooltip").attr("aria-hidden","true").addClass("ui-tooltip ui-widget ui-corner-all ui-widget-content").appendTo(document.body).hide();this.tooltipContent=$("
    ").addClass("ui-tooltip-content").appendTo(this.tooltip);this.opacity=this.tooltip.css("opacity");this.element.bind("focus.tooltip mouseover.tooltip",function(event){self.open(event)}).bind("blur.tooltip mouseout.tooltip",function(event){self.close(event)})},enable:function(){this.options.disabled=false},disable:function(){this.options.disabled=true},destroy:function(){this.tooltip.remove();$.Widget.prototype.destroy.apply(this,arguments)},widget:function(){return this.element.pushStack(this.tooltip.get())},open:function(event){var target=$(event&&event.target||this.element).closest(this.options.items);if(this.current&&this.current[0]==target[0]){return }var self=this;this.current=target;this.currentTitle=target.attr("title");var content=this.options.content.call(target[0],function(response){setTimeout(function(){if(self.current==target){self._show(event,target,response)}},13)});if(content){self._show(event,target,content)}},_show:function(event,target,content){if(!content){return }target.attr("title","");if(this.options.disabled){return }this.tooltipContent.html(content);this.tooltip.css({top:0,left:0}).show().position($.extend({of:target},this.options.position)).hide();this.tooltip.attr("aria-hidden","false");target.attr("aria-describedby",this.tooltip.attr("id"));this.tooltip.stop(false,true).fadeIn();this._trigger("open",event)},close:function(event){if(!this.current){return }var current=this.current;this.current=null;current.attr("title",this.currentTitle);if(this.options.disabled){return }current.removeAttr("aria-describedby");this.tooltip.attr("aria-hidden","true");this.tooltip.stop(false,true).fadeOut();this._trigger("close",event)}})})(jQuery);var fluid_1_4=fluid_1_4||{};(function($,fluid){var STATE_INITIAL="state_initial",STATE_CHANGED="state_changed",STATE_REVERTED="state_reverted";function defaultRenderer(that,targetContainer){var str=that.options.strings;var markup=""+str.undo+""+str.redo+"";var markupNode=$(markup).attr({role:"region","aria-live":"polite","aria-relevant":"all"});targetContainer.append(markupNode);return markupNode}function refreshView(that){if(that.state===STATE_INITIAL){that.locate("undoContainer").hide();that.locate("redoContainer").hide()}else{if(that.state===STATE_CHANGED){that.locate("undoContainer").show();that.locate("redoContainer").hide()}else{if(that.state===STATE_REVERTED){that.locate("undoContainer").hide();that.locate("redoContainer").show()}}}}var bindHandlers=function(that){that.locate("undoControl").click(function(){if(that.state!==STATE_REVERTED){fluid.model.copyModel(that.extremalModel,that.component.model);that.component.updateModel(that.initialModel,that);that.state=STATE_REVERTED;refreshView(that);that.locate("redoControl").focus()}return false});that.locate("redoControl").click(function(){if(that.state!==STATE_CHANGED){that.component.updateModel(that.extremalModel,that);that.state=STATE_CHANGED;refreshView(that);that.locate("undoControl").focus()}return false});return{modelChanged:function(newModel,oldModel,source){if(source!==that){that.state=STATE_CHANGED;fluid.model.copyModel(that.initialModel,oldModel);refreshView(that)}}}};fluid.undoDecorator=function(component,userOptions){var that=fluid.initLittleComponent("undo",userOptions);that.container=that.options.renderer(that,component.container);fluid.initDomBinder(that);fluid.tabindex(that.locate("undoControl"),0);fluid.tabindex(that.locate("redoControl"),0);that.component=component;that.initialModel={};that.extremalModel={};fluid.model.copyModel(that.initialModel,component.model);fluid.model.copyModel(that.extremalModel,component.model);that.state=STATE_INITIAL;refreshView(that);var listeners=bindHandlers(that);that.returnedOptions={listeners:listeners};return that};fluid.defaults("undo",{selectors:{undoContainer:".flc-undo-undoControl",undoControl:".flc-undo-undoControl",redoContainer:".flc-undo-redoControl",redoControl:".flc-undo-redoControl"},strings:{undo:"undo edit",redo:"redo edit"},renderer:defaultRenderer})})(jQuery,fluid_1_4);var fluid_1_4=fluid_1_4||{};(function($,fluid){var createContentFunc=function(content){return typeof content==="function"?content:function(){return content}};var setup=function(that){that.container.tooltip({content:createContentFunc(that.options.content),position:that.options.position,items:that.options.items,open:function(event){var tt=$(event.target).tooltip("widget");tt.stop(false,true);tt.hide();if(that.options.delay){tt.delay(that.options.delay).fadeIn("default",that.events.afterOpen.fire())}else{tt.show();that.events.afterOpen.fire()}},close:function(event){var tt=$(event.target).tooltip("widget");tt.stop(false,true);tt.hide();tt.clearQueue();that.events.afterClose.fire()}});that.elm=that.container.tooltip("widget");that.elm.addClass(that.options.styles.tooltip)};fluid.tooltip=function(container,options){var that=fluid.initView("fluid.tooltip",container,options);that.updateContent=function(content){that.container.tooltip("option","content",createContentFunc(content))};that.destroy=function(){that.container.tooltip("destroy")};that.open=function(){that.container.tooltip("open")};that.close=function(){that.container.tooltip("close")};setup(that);return that};fluid.defaults("fluid.tooltip",{styles:{tooltip:""},events:{afterOpen:null,afterClose:null},content:"",position:{my:"left top",at:"left bottom",offset:"0 5"},items:"*",delay:300})})(jQuery,fluid_1_4);var fluid_1_4=fluid_1_4||{};(function($,fluid){function sendKey(control,event,virtualCode,charCode){var kE=document.createEvent("KeyEvents");kE.initKeyEvent(event,1,1,null,0,0,0,0,virtualCode,charCode);control.dispatchEvent(kE)}fluid.setCaretToEnd=function(control,value){var pos=value?value.length:0;try{control.focus();if(control.setSelectionRange){control.setSelectionRange(pos,pos);if($.browser.mozilla&&pos>0){sendKey(control,"keypress",92,92);sendKey(control,"keydown",8,0);sendKey(control,"keypress",8,0)}}else{if(control.createTextRange){var range=control.createTextRange();range.move("character",pos);range.select()}}}catch(e){}};var switchToViewMode=function(that){that.editContainer.hide();that.displayModeRenderer.show()};var cancel=function(that){if(that.isEditing()){setTimeout(function(){that.editView.value(that.model.value)},1);switchToViewMode(that);that.events.afterFinishEdit.fire(that.model.value,that.model.value,that.editField[0],that.viewEl[0])}};var finish=function(that){var newValue=that.editView.value();var oldValue=that.model.value;var viewNode=that.viewEl[0];var editNode=that.editField[0];var ret=that.events.onFinishEdit.fire(newValue,oldValue,editNode,viewNode);if(ret===false){return }that.updateModelValue(newValue);that.events.afterFinishEdit.fire(newValue,oldValue,editNode,viewNode);switchToViewMode(that)};var bindEditFinish=function(that){if(that.options.submitOnEnter===undefined){that.options.submitOnEnter="textarea"!==fluid.unwrap(that.editField).nodeName.toLowerCase()}function keyCode(evt){return evt.keyCode?evt.keyCode:(evt.which?evt.which:0)}var escHandler=function(evt){var code=keyCode(evt);if(code===$.ui.keyCode.ESCAPE){that.textEditButton.focus(0);cancel(that);return false}};var finishHandler=function(evt){var code=keyCode(evt);if(code!==$.ui.keyCode.ENTER){that.textEditButton.blur();return true}else{finish(that);that.textEditButton.focus(0)}return false};if(that.options.submitOnEnter){that.editContainer.keypress(finishHandler)}that.editContainer.keydown(escHandler)};var bindBlurHandler=function(that){if(that.options.blurHandlerBinder){that.options.blurHandlerBinder(that)}else{var blurHandler=function(evt){if(that.isEditing()){finish(that)}return false};that.editField.blur(blurHandler)}};var initializeEditView=function(that,initial){if(!that.editInitialized){fluid.inlineEdit.renderEditContainer(that,!that.options.lazyEditView||!initial);if(!that.options.lazyEditView||!initial){that.editView=fluid.initSubcomponent(that,"editView",that.editField);$.extend(true,that.editView,fluid.initSubcomponent(that,"editAccessor",that.editField));bindEditFinish(that);bindBlurHandler(that);that.editView.refreshView(that);that.editInitialized=true}}};var edit=function(that){initializeEditView(that,false);var viewEl=that.viewEl;var displayText=that.displayView.value();that.updateModelValue(that.model.value===""?"":displayText);if(that.options.applyEditPadding){that.editField.width(Math.max(viewEl.width()+that.options.paddings.edit,that.options.paddings.minimumEdit))}that.displayModeRenderer.hide();that.editContainer.show();setTimeout(function(){fluid.setCaretToEnd(that.editField[0],that.editView.value());if(that.options.selectOnEdit){that.editField[0].select()}},0);that.events.afterBeginEdit.fire()};var clearEmptyViewStyles=function(textEl,styles,originalViewPadding){textEl.removeClass(styles.defaultViewStyle);textEl.css("padding-right",originalViewPadding);textEl.removeClass(styles.emptyDefaultViewText)};var showDefaultViewText=function(that){that.displayView.value(that.options.defaultViewText);that.viewEl.css("padding-right",that.existingPadding);that.viewEl.addClass(that.options.styles.defaultViewStyle)};var showNothing=function(that){that.displayView.value("");if($.browser.msie){if(that.viewEl.css("display")==="inline"){that.viewEl.css("display","inline-block")}}};var showEditedText=function(that){that.displayView.value(that.model.value);clearEmptyViewStyles(that.viewEl,that.options.styles,that.existingPadding)};var refreshView=function(that,source){that.displayView.refreshView(that,source);if(that.editView){that.editView.refreshView(that,source)}};var initModel=function(that,value){that.model.value=value;that.refreshView()};var updateModelValue=function(that,newValue,source){var comparator=that.options.modelComparator;var unchanged=comparator?comparator(that.model.value,newValue):that.model.value===newValue;if(!unchanged){var oldModel=$.extend(true,{},that.model);that.model.value=newValue;that.events.modelChanged.fire(that.model,oldModel,source);that.refreshView(source)}};var makeIsEditing=function(that){var isEditing=false;that.events.onBeginEdit.addListener(function(){isEditing=true});that.events.afterFinishEdit.addListener(function(){isEditing=false});return function(){return isEditing}};var makeEditHandler=function(that){return function(){var prevent=that.events.onBeginEdit.fire();if(prevent===false){return false}edit(that);return true}};var initTooltips=function(that){var tooltipOptions={content:that.options.tooltipText,position:{my:"left top",at:"left bottom",offset:"0 5"},target:"*",delay:that.options.tooltipDelay,styles:{tooltip:that.options.styles.tooltip}};fluid.tooltip(that.viewEl,tooltipOptions);if(that.textEditButton){fluid.tooltip(that.textEditButton,tooltipOptions)}};var calculateInitialPadding=function(viewEl){var padding=viewEl.css("padding-right");return padding?parseFloat(padding):0};var setupInlineEdit=function(componentContainer,that){if(that.editContainer){that.editContainer.hide()}if(that.tooltipEnabled()){initTooltips(that)}that.decorators=fluid.initSubcomponents(that,"componentDecorators",[that,fluid.COMPONENT_OPTIONS])};var setupInlineEdits=function(editables,options){var editors=[];editables.each(function(idx,editable){editors.push(fluid.inlineEdit($(editable),options))});return editors};fluid.inlineEdit=function(componentContainer,userOptions){var that=fluid.initView("inlineEdit",componentContainer,userOptions);that.viewEl=fluid.inlineEdit.setupDisplayText(that);that.displayView=fluid.initSubcomponent(that,"displayView",that.viewEl);$.extend(true,that.displayView,fluid.initSubcomponent(that,"displayAccessor",that.viewEl));that.model={value:""};that.edit=makeEditHandler(that);that.isEditing=makeIsEditing(that);that.finish=function(){finish(that)};that.cancel=function(){cancel(that)};that.tooltipEnabled=function(){return that.options.useTooltip&&$.fn.tooltip};that.refreshView=function(source){refreshView(that,source)};that.updateModelValue=function(newValue,source){updateModelValue(that,newValue,source)};that.updateModel=function(newModel,source){updateModelValue(that,newModel.value,source)};that.existingPadding=calculateInitialPadding(that.viewEl);initModel(that,that.displayView.value());that.displayModeRenderer=that.options.displayModeRenderer(that);initializeEditView(that,true);setupInlineEdit(componentContainer,that);return that};fluid.inlineEdit.setupEditField=function(editStyle,editField){var eField=$(editField);eField=eField.length?eField:$("");eField.addClass(editStyle);return eField};fluid.inlineEdit.setupEditContainer=function(displayContainer,editField,editContainer){var eContainer=$(editContainer);eContainer=eContainer.length?eContainer:$("");displayContainer.after(eContainer);eContainer.append(editField);return eContainer};fluid.inlineEdit.defaultEditModeRenderer=function(that){var editField=fluid.inlineEdit.setupEditField(that.options.styles.edit,that.editField);var editContainer=fluid.inlineEdit.setupEditContainer(that.displayModeRenderer,editField,that.editContainer);var editModeInstruction=fluid.inlineEdit.setupEditModeInstruction(that.options.styles.editModeInstruction,that.options.strings.editModeInstruction);var id=fluid.allocateSimpleId(editModeInstruction);editField.attr("aria-describedby",id);fluid.inlineEdit.positionEditModeInstruction(editModeInstruction,editContainer,editField);return{container:editContainer,field:editField}};fluid.inlineEdit.renderEditContainer=function(that,lazyEditView){that.editContainer=that.locate("editContainer");that.editField=that.locate("edit");if(that.editContainer.length!==1){if(that.editContainer.length>1){fluid.fail("InlineEdit did not find a unique container for selector "+that.options.selectors.editContainer+": "+fluid.dumpEl(that.editContainer))}}if(!lazyEditView){return }var editElms=that.options.editModeRenderer(that);if(editElms){that.editContainer=editElms.container;that.editField=editElms.field}};fluid.inlineEdit.setupEditModeInstruction=function(editModeInstructionStyle,editModeInstructionText){var editModeInstruction=$("

    ");editModeInstruction.addClass(editModeInstructionStyle);editModeInstruction.text(editModeInstructionText);return editModeInstruction};fluid.inlineEdit.positionEditModeInstruction=function(editModeInstruction,editContainer,editField){editContainer.append(editModeInstruction);editField.focus(function(){editModeInstruction.show();var editFieldPosition=editField.offset();editModeInstruction.css({left:editFieldPosition.left});editModeInstruction.css({top:editFieldPosition.top+editField.height()+5})})};fluid.inlineEdit.setupDisplayModeContainer=function(styles,displayModeWrapper){var displayModeContainer=$(displayModeWrapper);displayModeContainer=displayModeContainer.length?displayModeContainer:$("");displayModeContainer.addClass(styles.displayView);return displayModeContainer};fluid.inlineEdit.setupDisplayText=function(that){var viewEl=that.locate("text");viewEl.attr("tabindex","-1");viewEl.addClass(that.options.styles.text);return viewEl};fluid.inlineEdit.setupTextEditButton=function(that){var opts=that.options;var textEditButton=that.locate("textEditButton");if(textEditButton.length===0){var markup=$("");markup.addClass(opts.styles.textEditButton);markup.text(opts.tooltipText);fluid.inlineEdit.updateTextEditButton(markup,that.model.value||opts.defaultViewText,opts.strings.textEditButton);that.events.modelChanged.addListener(function(){fluid.inlineEdit.updateTextEditButton(markup,that.model.value||opts.defaultViewText,opts.strings.textEditButton)});that.locate("text").after(markup);textEditButton=that.locate("textEditButton")}return textEditButton};fluid.inlineEdit.updateTextEditButton=function(textEditButton,value,stringTemplate){var buttonText=fluid.stringTemplate(stringTemplate,{text:value});textEditButton.text(buttonText)};fluid.inlineEdit.bindHoverHandlers=function(displayModeRenderer,invitationStyle){var over=function(evt){displayModeRenderer.addClass(invitationStyle)};var out=function(evt){displayModeRenderer.removeClass(invitationStyle)};displayModeRenderer.hover(over,out)};fluid.inlineEdit.bindHighlightHandler=function(element,displayModeRenderer,styles){element=$(element);var focusOn=function(){displayModeRenderer.addClass(styles.focus);displayModeRenderer.addClass(styles.invitation)};var focusOff=function(){displayModeRenderer.removeClass(styles.focus);displayModeRenderer.removeClass(styles.invitation)};element.focus(focusOn);element.blur(focusOff)};fluid.inlineEdit.bindMouseHandlers=function(element,edit){element=$(element);var triggerGuard=fluid.inlineEdit.makeEditTriggerGuard(element,edit);element.click(function(e){triggerGuard(e);return false})};fluid.inlineEdit.bindKeyboardHandlers=function(element,edit){element=$(element);element.attr("role","button");var guard=fluid.inlineEdit.makeEditTriggerGuard(element,edit);fluid.activatable(element,function(event){return guard(event)})};fluid.inlineEdit.makeEditTriggerGuard=function(element,edit){var selector=fluid.unwrap(element);return function(event){var outer=fluid.findAncestor(event.target,function(elem){if(/input|select|textarea|button|a/i.test(elem.nodeName)||elem===selector){return true}});if(outer===selector){edit();return false}}};fluid.inlineEdit.defaultDisplayModeRenderer=function(that){var styles=that.options.styles;var displayModeWrapper=fluid.inlineEdit.setupDisplayModeContainer(styles);var displayModeRenderer=that.viewEl.wrap(displayModeWrapper).parent();that.textEditButton=fluid.inlineEdit.setupTextEditButton(that);displayModeRenderer.append(that.textEditButton);fluid.inlineEdit.bindHoverHandlers(displayModeRenderer,styles.invitation);fluid.inlineEdit.bindMouseHandlers(that.viewEl,that.edit);fluid.inlineEdit.bindMouseHandlers(that.textEditButton,that.edit);fluid.inlineEdit.bindKeyboardHandlers(that.textEditButton,that.edit);fluid.inlineEdit.bindHighlightHandler(that.viewEl,displayModeRenderer,styles);fluid.inlineEdit.bindHighlightHandler(that.textEditButton,displayModeRenderer,styles);return displayModeRenderer};fluid.inlineEdit.standardAccessor=function(element){var nodeName=element.nodeName.toLowerCase();return{value:function(newValue){return"input"===nodeName||"textarea"===nodeName?fluid.value($(element),newValue):$(element).text(newValue)}}};fluid.inlineEdit.standardDisplayView=function(viewEl){var that={refreshView:function(componentThat,source){if(componentThat.model.value){showEditedText(componentThat)}else{if(componentThat.options.defaultViewText){showDefaultViewText(componentThat)}else{showNothing(componentThat)}}if($.trim(componentThat.viewEl.text()).length===0){componentThat.viewEl.addClass(componentThat.options.styles.emptyDefaultViewText);if(componentThat.existingPadding/g,function(match){return match.toLowerCase()});return togo};fluid.inlineEdit.htmlComparator=function(el1,el2){return fluid.inlineEdit.normalizeHTML(el1)===fluid.inlineEdit.normalizeHTML(el2)};fluid.inlineEdit.bindRichTextHighlightHandler=function(element,displayModeRenderer,invitationStyle){element=$(element);var focusOn=function(){displayModeRenderer.addClass(invitationStyle)};var focusOff=function(){displayModeRenderer.removeClass(invitationStyle)};element.focus(focusOn);element.blur(focusOff)};fluid.inlineEdit.setupRichTextEditButton=function(that){var opts=that.options;var textEditButton=that.locate("textEditButton");if(textEditButton.length===0){var markup=$("");markup.text(opts.strings.textEditButton);that.locate("text").after(markup);textEditButton=that.locate("textEditButton")}return textEditButton};fluid.inlineEdit.richTextDisplayModeRenderer=function(that){var styles=that.options.styles;var displayModeWrapper=fluid.inlineEdit.setupDisplayModeContainer(styles);var displayModeRenderer=that.viewEl.wrap(displayModeWrapper).parent();that.textEditButton=fluid.inlineEdit.setupRichTextEditButton(that);displayModeRenderer.append(that.textEditButton);displayModeRenderer.addClass(styles.focus);fluid.inlineEdit.bindHoverHandlers(displayModeRenderer,styles.invitation);fluid.inlineEdit.bindMouseHandlers(that.textEditButton,that.edit);fluid.inlineEdit.bindKeyboardHandlers(that.textEditButton,that.edit);fluid.inlineEdit.bindRichTextHighlightHandler(that.viewEl,displayModeRenderer,styles.invitation);fluid.inlineEdit.bindRichTextHighlightHandler(that.textEditButton,displayModeRenderer,styles.invitation);return displayModeRenderer};fluid.inlineEdit.tinyMCE=function(container,options){var inlineEditor=configureInlineEdit("fluid.inlineEdit.tinyMCE",container,options);tinyMCE.init(inlineEditor.options.tinyMCE);return inlineEditor};fluid.inlineEdit.tinyMCE.getEditor=function(editField){return tinyMCE.get(editField.id)};fluid.inlineEdit.tinyMCE.setValue=function(editField,editor,value){$(editField).val(value);editor.setContent(value,{format:"raw"})};fluid.inlineEdit.tinyMCE.getValue=function(editor){return editor.getContent()};var flTinyMCE=fluid.inlineEdit.tinyMCE;flTinyMCE.viewAccessor=fluid.inlineEdit.makeViewAccessor(flTinyMCE.getEditor,flTinyMCE.setValue,flTinyMCE.getValue);fluid.inlineEdit.tinyMCE.blurHandlerBinder=function(that){function focusEditor(editor){setTimeout(function(){tinyMCE.execCommand("mceFocus",false,that.editField[0].id);if($.browser.mozilla&&$.browser.version.substring(0,3)==="1.8"){return }editor.selection.select(editor.getBody(),1);editor.selection.collapse(0)},10)}that.events.afterInitEdit.addListener(function(editor){focusEditor(editor);var editorBody=editor.getBody();fluid.deadMansBlur(that.editField,{exclusions:{body:$(editorBody)},handler:function(){that.cancel()}})});that.events.afterBeginEdit.addListener(function(){var editor=tinyMCE.get(that.editField[0].id);if(editor){focusEditor(editor)}})};fluid.inlineEdit.tinyMCE.editModeRenderer=function(that){var options=that.options.tinyMCE;options.elements=fluid.allocateSimpleId(that.editField);var oldinit=options.init_instance_callback;options.init_instance_callback=function(instance){that.events.afterInitEdit.fire(instance);if(oldinit){oldinit()}};tinyMCE.init(options)};fluid.defaults("fluid.inlineEdit.tinyMCE",{tinyMCE:{mode:"exact",theme:"simple"},useTooltip:true,selectors:{edit:"textarea"},styles:{invitation:"fl-inlineEdit-richText-invitation",displayView:"fl-inlineEdit-textContainer",text:""},strings:{textEditButton:"Edit"},displayAccessor:{type:"fluid.inlineEdit.richTextViewAccessor"},editAccessor:{type:"fluid.inlineEdit.tinyMCE.viewAccessor"},lazyEditView:true,defaultViewText:"Click Edit",modelComparator:fluid.inlineEdit.htmlComparator,blurHandlerBinder:fluid.inlineEdit.tinyMCE.blurHandlerBinder,displayModeRenderer:fluid.inlineEdit.richTextDisplayModeRenderer,editModeRenderer:fluid.inlineEdit.tinyMCE.editModeRenderer});fluid.inlineEdit.CKEditor=function(container,options){return configureInlineEdit("fluid.inlineEdit.CKEditor",container,options)};fluid.inlineEdit.CKEditor.getEditor=function(editField){return CKEDITOR.instances[editField.id]};fluid.inlineEdit.CKEditor.setValue=function(editField,editor,value){editor.setData(value)};fluid.inlineEdit.CKEditor.getValue=function(editor){return editor.getData()};var flCKEditor=fluid.inlineEdit.CKEditor;flCKEditor.viewAccessor=fluid.inlineEdit.makeViewAccessor(flCKEditor.getEditor,flCKEditor.setValue,flCKEditor.getValue);fluid.inlineEdit.CKEditor.focus=function(editor){setTimeout(function(){editor.focus()},0)};fluid.inlineEdit.CKEditor.normalizeHTML=function(value){var togo=fluid.inlineEdit.normalizeHTML(value);var angpos=togo.indexOf(">");if(angpos!==-1&&angpos';return this.each(function(){if($("> iframe.bgiframe",this).length==0){this.insertBefore(document.createElement(html),this.firstChild)}})}return this};if(!$.browser.version){$.browser.version=navigator.userAgent.toLowerCase().match(/.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/)[1]}})(jQuery);var fluid_1_4=fluid_1_4||{};(function($,fluid){function updateStyles(pageListThat,newModel,oldModel){if(!pageListThat.pageLinks){return }if(oldModel.pageIndex!==undefined){var oldLink=pageListThat.pageLinks.eq(oldModel.pageIndex);oldLink.removeClass(pageListThat.options.styles.currentPage)}var pageLink=pageListThat.pageLinks.eq(newModel.pageIndex);pageLink.addClass(pageListThat.options.styles.currentPage)}function bindLinkClick(link,events,eventArg){link.unbind("click.fluid.pager");link.bind("click.fluid.pager",function(){events.initiatePageChange.fire(eventArg)})}function computePageCount(model){model.pageCount=Math.max(1,Math.floor((model.totalRange-1)/model.pageSize)+1)}fluid.pager=function(){return fluid.pagerImpl.apply(null,arguments)};fluid.pager.computePageLimit=function(model){return Math.min(model.totalRange,(model.pageIndex+1)*model.pageSize)};fluid.pager.directPageList=function(container,events,options){var that=fluid.initView("fluid.pager.directPageList",container,options);that.pageLinks=that.locate("pageLinks");for(var i=0;i=mid-midLocality&&i<=mid+midLocality)){togo[j++]=i;lastSkip=false}else{if(!lastSkip){togo[j++]=-1;lastSkip=true}}}return togo}};fluid.pager.consistentGappedPageStrategy=function(endLinkCount,midLinkCount){if(!endLinkCount){endLinkCount=1}if(!midLinkCount){midLinkCount=endLinkCount}var endWidth=endLinkCount+2+midLinkCount;return function(count,first,mid){var pages=[];var anchoredLeft=mid=count-endWidth;var anchoredEndWidth=endWidth+midLinkCount;var midStart=mid-midLinkCount;var midEnd=mid+midLinkCount;var lastSkip=false;for(var page=0;page=count-anchoredEndWidth)||(page>=midStart&&page<=midEnd)){pages.push(page);lastSkip=false}else{if(!lastSkip){pages.push(-1);lastSkip=true}}}return pages}};fluid.pager.renderedPageList=function(container,events,pagerBarOptions,options,strings){options=$.extend(true,pagerBarOptions,options);var that=fluid.initView("fluid.pager.renderedPageList",container,options);options=that.options;var idMap={};var renderOptions={cutpoints:[{id:"page-link:link",selector:pagerBarOptions.selectors.pageLinks},{id:"page-link:skip",selector:pagerBarOptions.selectors.pageLinkSkip}],idMap:idMap};if(options.linkBody){renderOptions.cutpoints[renderOptions.cutpoints.length]={id:"payload-component",selector:options.linkBody}}var assembleComponent=function(page,isCurrent){var obj={ID:"page-link:link",localID:page+1,value:page+1,pageIndex:page,decorators:[{type:"jQuery",func:"click",args:function(event){events.initiatePageChange.fire({pageIndex:page});event.preventDefault()}}]};if(isCurrent){obj.current=true;obj.decorators=obj.decorators.concat([{type:"addClass",classes:that.options.styles.currentPage},{type:"jQuery",func:"attr",args:["aria-label",that.options.strings.currentPageIndexMsg]}])}return obj};function pageToComponent(current){return function(page){return page===-1?{ID:"page-link:skip"}:assembleComponent(page,page===current)}}var root=that.locate("root");fluid.expectFilledSelector(root,"Error finding root template for fluid.pager.renderedPageList");var template=fluid.selfRender(root,{},renderOptions);events.onModelChange.addListener(function(newModel,oldModel){var pages=that.options.pageStrategy(newModel.pageCount,0,newModel.pageIndex);var pageTree=fluid.transform(pages,pageToComponent(newModel.pageIndex));if(pageTree.length>1){pageTree[pageTree.length-1].value=pageTree[pageTree.length-1].value+strings.last}events.onRenderPageLinks.fire(pageTree,newModel);$.each(idMap,function(key,id){var pageLink=fluid.jById(id);if(pageLink.tooltip){pageLink.tooltip("destroy")}});fluid.reRender(template,root,pageTree,renderOptions);updateStyles(that,newModel,oldModel)});return that};fluid.defaults("fluid.pager.renderedPageList",{selectors:{root:".flc-pager-links"},linkBody:"a",pageStrategy:fluid.pager.everyPageStrategy});var updatePreviousNext=function(that,options,newModel){if(newModel.pageIndex===0){that.previous.addClass(options.styles.disabled)}else{that.previous.removeClass(options.styles.disabled)}if(newModel.pageIndex===newModel.pageCount-1){that.next.addClass(options.styles.disabled)}else{that.next.removeClass(options.styles.disabled)}};fluid.pager.previousNext=function(container,events,options){var that=fluid.initView("fluid.pager.previousNext",container,options);that.previous=that.locate("previous");bindLinkClick(that.previous,events,{relativePage:-1});that.next=that.locate("next");bindLinkClick(that.next,events,{relativePage:+1});events.onModelChange.addListener(function(newModel,oldModel,overallThat){updatePreviousNext(that,options,newModel)});return that};fluid.pager.pagerBar=function(events,container,options,strings){var that=fluid.initView("fluid.pager.pagerBar",container,options);that.pageList=fluid.initSubcomponent(that,"pageList",[container,events,that.options,fluid.COMPONENT_OPTIONS,strings]);that.previousNext=fluid.initSubcomponent(that,"previousNext",[container,events,that.options,fluid.COMPONENT_OPTIONS,strings]);return that};fluid.defaults("fluid.pager.pagerBar",{previousNext:{type:"fluid.pager.previousNext"},pageList:{type:"fluid.pager.renderedPageList",options:{pageStrategy:fluid.pager.gappedPageStrategy(3,1)}},selectors:{pageLinks:".flc-pager-pageLink",pageLinkSkip:".flc-pager-pageLink-skip",previous:".flc-pager-previous",next:".flc-pager-next"},styles:{currentPage:"fl-pager-currentPage",disabled:"fl-pager-disabled"},strings:{currentPageIndexMsg:"Current page"}});function getColumnDefs(that){return that.options.columnDefs}fluid.pager.findColumnDef=function(columnDefs,key){var columnDef=$.grep(columnDefs,function(def){return def.key===key})[0];return columnDef};function getRoots(target,overallThat,index){var cellRoot=(overallThat.options.dataOffset?overallThat.options.dataOffset+".":"");target.shortRoot=index;target.longRoot=cellRoot+target.shortRoot}function expandPath(EL,shortRoot,longRoot){if(EL.charAt(0)==="*"){return longRoot+EL.substring(1)}else{return EL.replace("*",shortRoot)}}fluid.pager.fetchValue=function(that,dataModel,index,valuebinding,roots){getRoots(roots,that,index);var path=expandPath(valuebinding,roots.shortRoot,roots.longRoot);return fluid.get(dataModel,path)};fluid.pager.basicSorter=function(overallThat,model){var dataModel=overallThat.options.dataModel;var roots={};var columnDefs=getColumnDefs(overallThat);var columnDef=fluid.pager.findColumnDef(columnDefs,model.sortKey);var sortrecs=[];for(var i=0;ib?model.sortDir:-model.sortDir)}sortrecs.sort(sortfunc);return fluid.transform(sortrecs,function(row){return row.index})};fluid.pager.directModelFilter=function(model,pagerModel,perm){var togo=[];var limit=fluid.pager.computePageLimit(pagerModel);for(var i=pagerModel.pageIndex*pagerModel.pageSize;i=newModel.pageCount){newModel.pageIndex=newModel.pageCount-1}if(forceUpdate||newModel.pageIndex!==that.model.pageIndex||newModel.pageSize!==that.model.pageSize||newModel.sortKey!==that.model.sortKey||newModel.sortDir!==that.model.sortDir){var sorted=isCurrentColumnSortable(getColumnDefs(that),newModel)?that.options.sorter(that,newModel):null;that.permutation=sorted;that.events.onModelChange.fire(newModel,that.model,that);fluid.model.copyModel(that.model,newModel)}}function generateColumnClick(overallThat,columnDef,opts){return function(){if(columnDef.sortable===true){var model=overallThat.model;var newModel=fluid.copy(model);var styles=overallThat.options.styles;var oldKey=model.sortKey;if(columnDef.key!==model.sortKey){newModel.sortKey=columnDef.key;newModel.sortDir=1;var oldBig=bigHeaderForKey(oldKey,opts);if(oldBig){setSortHeaderClass(styles,oldBig,0)}}else{if(newModel.sortKey===columnDef.key){newModel.sortDir=-1*newModel.sortDir}else{return false}}newModel.pageIndex=0;fireModelChange(overallThat,newModel,true);setModelSortHeaderClass(newModel,opts)}return false}}function fetchHeaderDecorators(decorators,columnDef){return decorators[columnDef.sortable?"sortableHeader":"unsortableHeader"]}function generateHeader(overallThat,newModel,columnDefs,opts){var sortableColumnTxt=opts.options.strings.sortableColumnText;if(newModel.sortDir===1){sortableColumnTxt=opts.options.strings.sortableColumnTextAsc}else{if(newModel.sortDir===-1){sortableColumnTxt=opts.options.strings.sortableColumnTextDesc}}return{children:fluid.transform(columnDefs,function(columnDef){return{ID:iDforColumn(columnDef,opts),value:columnDef.label,decorators:[{jQuery:["click",generateColumnClick(overallThat,columnDef,opts)]},{identify:"header:"+columnDef.key},{type:"attrs",attributes:{title:(columnDef.key===newModel.sortKey)?sortableColumnTxt:opts.options.strings.sortableColumnText}}].concat(fetchHeaderDecorators(opts.overallOptions.decorators,columnDef))}})}}fluid.pager.selfRender=function(overallThat,inOptions){var that=fluid.initView("fluid.pager.selfRender",overallThat.container,inOptions);var options=that.options;options.renderOptions.idMap=options.renderOptions.idMap||{};var idMap=options.renderOptions.idMap;var root=that.locate("root");var template=fluid.selfRender(root,{},options.renderOptions);root.addClass(options.styles.root);var columnDefs=getColumnDefs(overallThat);var expOpts={options:options,columnDefs:columnDefs,overallOptions:overallThat.options,dataModel:overallThat.options.dataModel,idMap:idMap};var directModel=fetchModel(overallThat);return{returnedOptions:{listeners:{onModelChange:function(newModel,oldModel){var filtered=overallThat.options.modelFilter(directModel,newModel,overallThat.permutation);var tree=fluid.transform(filtered,function(filteredRow){getRoots(expOpts,overallThat,filteredRow.index);if(columnDefs==="explode"){return fluid.explode(filteredRow.row,expOpts.longRoot)}else{if(columnDefs.length){return expandColumnDefs(filteredRow,expOpts)}}});var fullTree={};fullTree[options.row]=tree;if(typeof (columnDefs)==="object"){fullTree[options.header]=generateHeader(overallThat,newModel,columnDefs,expOpts)}options.renderOptions=options.renderOptions||{};options.renderOptions.model=expOpts.dataModel;fluid.reRender(template,root,fullTree,options.renderOptions);overallThat.events.afterRender.fire(overallThat);setModelSortHeaderClass(newModel,expOpts)}}}}};fluid.defaults("fluid.pager.selfRender",{selectors:{root:".flc-pager-body-template"},styles:{root:"fl-pager"},keyStrategy:"id",keyPrefix:"",row:"row:",header:"header:",strings:{sortableColumnText:"Select to sort",sortableColumnTextDesc:"Select to sort in ascending, currently in descending order.",sortableColumnTextAsc:"Select to sort in descending, currently in ascending order."},renderOptions:{}});fluid.pager.summaryAria=function(element){element.attr({"aria-relevant":"all","aria-atomic":"false","aria-live":"assertive",role:"status"})};fluid.pager.summary=function(dom,options){var node=dom.locate("summary");fluid.pager.summaryAria(node);return{returnedOptions:{listeners:{onModelChange:function(newModel,oldModel){var text=fluid.stringTemplate(options.message,{first:newModel.pageIndex*newModel.pageSize+1,last:fluid.pager.computePageLimit(newModel),total:newModel.totalRange,currentPage:newModel.pageIndex+1});if(node.length>0){node.text(text)}}}}}};fluid.pager.directPageSize=function(that){var node=that.locate("pageSize");if(node.length>0){that.events.onModelChange.addListener(function(newModel,oldModel){if(node.val()!==newModel.pageSize){node.val(newModel.pageSize)}});node.change(function(){that.events.initiatePageSizeChange.fire(node.val())})}};fluid.pager.rangeAnnotator=function(that,options){var roots={};that.events.onRenderPageLinks.addListener(function(tree,newModel){var column=that.options.annotateColumnRange;var dataModel=that.options.dataModel;var columnDefs=getColumnDefs(that);if(!column||!dataModel||!columnDefs){return }var columnDef=fluid.pager.findColumnDef(columnDefs,column);function fetchValue(index){index=that.permutation?that.permutation[index]:index;return fluid.pager.fetchValue(that,dataModel,index,columnDef.valuebinding,roots)}var tModel={};fluid.model.copyModel(tModel,newModel);fluid.transform(tree,function(cell){if(cell.ID==="page-link:link"){var page=cell.pageIndex;var start=page*tModel.pageSize;tModel.pageIndex=page;var limit=fluid.pager.computePageLimit(tModel);var iValue=fetchValue(start);var lValue=fetchValue(limit-1);var tooltipOpts=fluid.copy(that.options.tooltip.options)||{};if(!tooltipOpts.content){tooltipOpts.content=function(){return fluid.stringTemplate(that.options.markup.rangeAnnotation,{first:iValue,last:lValue})}}if(!cell.current){var decorators=[{type:"fluid",func:that.options.tooltip.type,options:tooltipOpts},{identify:page}];cell.decorators=cell.decorators.concat(decorators)}}})})};fluid.pagerImpl=function(container,options){var that=fluid.initView("fluid.pager",container,options);that.container.attr("role","application");that.events.initiatePageChange.addListener(function(arg){var newModel=fluid.copy(that.model);if(arg.relativePage!==undefined){newModel.pageIndex=that.model.pageIndex+arg.relativePage}else{newModel.pageIndex=arg.pageIndex}if(newModel.pageIndex===undefined||newModel.pageIndex<0){newModel.pageIndex=0}fireModelChange(that,newModel,arg.forceUpdate)});that.events.initiatePageSizeChange.addListener(function(arg){var newModel=fluid.copy(that.model);newModel.pageSize=arg;fireModelChange(that,newModel)});var pagerBarElement=that.locate("pagerBar");if(pagerBarElement.length>0){that.pagerBar=fluid.initSubcomponent(that,"pagerBar",[that.events,pagerBarElement,fluid.COMPONENT_OPTIONS,that.options.strings])}var pagerBarSecondaryElement=that.locate("pagerBarSecondary");if(pagerBarSecondaryElement.length>0){that.pagerBarSecondary=fluid.initSubcomponent(that,"pagerBar",[that.events,pagerBarSecondaryElement,fluid.COMPONENT_OPTIONS,that.options.strings])}that.bodyRenderer=fluid.initSubcomponent(that,"bodyRenderer",[that,fluid.COMPONENT_OPTIONS]);that.summary=fluid.initSubcomponent(that,"summary",[that.dom,fluid.COMPONENT_OPTIONS]);that.pageSize=fluid.initSubcomponent(that,"pageSize",[that]);that.rangeAnnotator=fluid.initSubcomponent(that,"rangeAnnotator",[that,fluid.COMPONENT_OPTIONS]);that.model=fluid.copy(that.options.model);var dataModel=fetchModel(that);if(dataModel){that.model.totalRange=dataModel.length}if(that.model.totalRange===undefined){if(!that.pagerBar){fluid.fail("Error in Pager configuration - cannot determine total range, since not configured in model.totalRange and no PagerBar is configured")}that.model=that.pagerBar.pageList.defaultModel}that.applier=fluid.makeChangeApplier(that.model);that.events.initiatePageChange.fire({pageIndex:that.model.pageIndex?that.model.pageIndex:0,forceUpdate:true});return that};fluid.defaults("fluid.pager",{mergePolicy:{dataModel:"preserve",model:"preserve"},pagerBar:{type:"fluid.pager.pagerBar"},summary:{type:"fluid.pager.summary",options:{message:"Viewing page %currentPage. Showing records %first - %last of %total items."}},pageSize:{type:"fluid.pager.directPageSize"},modelFilter:fluid.pager.directModelFilter,sorter:fluid.pager.basicSorter,bodyRenderer:{type:"fluid.pager.selfRender"},model:{pageIndex:undefined,pageSize:10,totalRange:undefined},dataModel:undefined,dataOffset:"",columnDefs:[],annotateColumnRange:undefined,tooltip:{type:"fluid.tooltip"},rangeAnnotator:{type:"fluid.pager.rangeAnnotator"},selectors:{pagerBar:".flc-pager-top",pagerBarSecondary:".flc-pager-bottom",summary:".flc-pager-summary",pageSize:".flc-pager-page-size",headerSortStylisticOffset:".flc-pager-sort-header"},styles:{ascendingHeader:"fl-pager-asc",descendingHeader:"fl-pager-desc"},decorators:{sortableHeader:[],unsortableHeader:[]},strings:{last:" (last)"},events:{initiatePageChange:null,initiatePageSizeChange:null,onModelChange:null,onRenderPageLinks:null,afterRender:null},markup:{rangeAnnotation:" %first

    %last "}})})(jQuery,fluid_1_4);var fluid_1_4=fluid_1_4||{};(function($,fluid){var animateDisplay=function(elm,animation,defaultAnimation){animation=(animation)?animation:defaultAnimation;elm.animate(animation.params,animation.duration,animation.callback)};var animateProgress=function(elm,width,speed){elm.queue("fx",[]);elm.animate({width:width,queue:false},speed)};var showProgress=function(that,animation){if(animation===false){that.displayElement.show()}else{animateDisplay(that.displayElement,animation,that.options.showAnimation)}};var hideProgress=function(that,delay,animation){delay=(delay===null||isNaN(delay))?that.options.delay:delay;if(delay){var timeOut=setTimeout(function(){hideProgress(that,0,animation)},delay)}else{if(animation===false){that.displayElement.hide()}else{animateDisplay(that.displayElement,animation,that.options.hideAnimation)}}};var updateWidth=function(that,newWidth,dontAnimate){dontAnimate=dontAnimate||false;var currWidth=that.indicator.width();var direction=that.options.animate;if((newWidth>currWidth)&&(direction==="both"||direction==="forward")&&!dontAnimate){animateProgress(that.indicator,newWidth,that.options.speed)}else{if((newWidth0;that.ariaElement.attr("aria-busy",busy);that.ariaElement.attr("aria-valuenow",percent);if(str.ariaBusyText){if(busy){var busyString=fluid.stringTemplate(str.ariaBusyText,{percentComplete:percent});that.ariaElement.attr("aria-valuetext",busyString)}else{if(percent===100){that.ariaElement.attr("aria-valuetext",str.ariaDoneText)}}}};var updateText=function(label,value){label.html(value)};var repositionIndicator=function(that){that.indicator.css("top",that.progressBar.position().top).css("left",0).height(that.progressBar.height());refreshRelativeWidth(that)};var updateProgress=function(that,percent,labelText,animationForShow){showProgress(that,animationForShow);if(percent!==null){that.storedPercent=percent;var pixels=Math.max(percentToPixels(that,parseFloat(percent)),that.options.minWidth);updateWidth(that,pixels)}if(labelText!==null){updateText(that.label,labelText)}if(that.ariaElement){updateARIA(that,percent)}};var setupProgress=function(that){that.displayElement=that.locate("displayElement");if(that.options.initiallyHidden){that.displayElement.hide()}that.progressBar=that.locate("progressBar");that.label=that.locate("label");that.indicator=that.locate("indicator");that.ariaElement=that.locate("ariaElement");that.indicator.width(that.options.minWidth);that.storedPercent=0;if(that.ariaElement){initARIA(that.ariaElement,that.options.strings.ariaBusyText)}if(that.options.hideAnimation.callback){that.events.afterProgressHidden.addListener(that.options.hideAnimation.callback)}that.options.hideAnimation.callback=that.events.afterProgressHidden.fire;if(that.options.showAnimation.callback){that.events.onProgressBegin.addListener(that.options.showAnimation.callback)}that.options.showAnimation.callback=that.events.onProgressBegin.fire};fluid.progress=function(container,options){var that=fluid.initView("fluid.progress",container,options);setupProgress(that);that.show=function(animation){showProgress(that,animation)};that.hide=function(delay,animation){hideProgress(that,delay,animation)};that.update=function(percentage,labelValue,animationForShow){updateProgress(that,percentage,labelValue,animationForShow)};that.refreshView=function(){repositionIndicator(that)};return that};fluid.defaults("fluid.progress",{gradeNames:"fluid.viewComponent",selectors:{displayElement:".flc-progress",progressBar:".flc-progress-bar",indicator:".flc-progress-indicator",label:".flc-progress-label",ariaElement:".flc-progress-bar"},strings:{ariaBusyText:"Progress is %percentComplete percent complete",ariaDoneText:"Progress is complete."},showAnimation:{params:{opacity:"show"},duration:"slow",callback:null},hideAnimation:{params:{opacity:"hide"},duration:"slow",callback:null},events:{onProgressBegin:null,afterProgressHidden:null},minWidth:5,delay:0,speed:200,animate:"forward",initiallyHidden:true,updatePosition:false})})(jQuery,fluid_1_4);(function($,undefined){$.widget("ui.draggable",$.ui.mouse,{widgetEventPrefix:"drag",options:{addClasses:true,appendTo:"parent",axis:false,connectToSortable:false,containment:false,cursor:"auto",cursorAt:false,grid:false,handle:false,helper:"original",iframeFix:false,opacity:false,refreshPositions:false,revert:false,revertDuration:500,scope:"default",scroll:true,scrollSensitivity:20,scrollSpeed:20,snap:false,snapMode:"both",snapTolerance:20,stack:false,zIndex:false},_create:function(){if(this.options.helper=="original"&&!(/^(?:r|a|f)/).test(this.element.css("position"))){this.element[0].style.position="relative"}(this.options.addClasses&&this.element.addClass("ui-draggable"));(this.options.disabled&&this.element.addClass("ui-draggable-disabled"));this._mouseInit()},destroy:function(){if(!this.element.data("draggable")){return }this.element.removeData("draggable").unbind(".draggable").removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled");this._mouseDestroy();return this},_mouseCapture:function(event){var o=this.options;if(this.helper||o.disabled||$(event.target).is(".ui-resizable-handle")){return false}this.handle=this._getHandle(event);if(!this.handle){return false}return true},_mouseStart:function(event){var o=this.options;this.helper=this._createHelper(event);this._cacheHelperProportions();if($.ui.ddmanager){$.ui.ddmanager.current=this}this._cacheMargins();this.cssPosition=this.helper.css("position");this.scrollParent=this.helper.scrollParent();this.offset=this.positionAbs=this.element.offset();this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left};$.extend(this.offset,{click:{left:event.pageX-this.offset.left,top:event.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()});this.originalPosition=this.position=this._generatePosition(event);this.originalPageX=event.pageX;this.originalPageY=event.pageY;(o.cursorAt&&this._adjustOffsetFromHelper(o.cursorAt));if(o.containment){this._setContainment()}if(this._trigger("start",event)===false){this._clear();return false}this._cacheHelperProportions();if($.ui.ddmanager&&!o.dropBehaviour){$.ui.ddmanager.prepareOffsets(this,event)}this.helper.addClass("ui-draggable-dragging");this._mouseDrag(event,true);return true},_mouseDrag:function(event,noPropagation){this.position=this._generatePosition(event);this.positionAbs=this._convertPositionTo("absolute");if(!noPropagation){var ui=this._uiHash();if(this._trigger("drag",event,ui)===false){this._mouseUp({});return false}this.position=ui.position}if(!this.options.axis||this.options.axis!="y"){this.helper[0].style.left=this.position.left+"px"}if(!this.options.axis||this.options.axis!="x"){this.helper[0].style.top=this.position.top+"px"}if($.ui.ddmanager){$.ui.ddmanager.drag(this,event)}return false},_mouseStop:function(event){var dropped=false;if($.ui.ddmanager&&!this.options.dropBehaviour){dropped=$.ui.ddmanager.drop(this,event)}if(this.dropped){dropped=this.dropped;this.dropped=false}if((!this.element[0]||!this.element[0].parentNode)&&this.options.helper=="original"){return false}if((this.options.revert=="invalid"&&!dropped)||(this.options.revert=="valid"&&dropped)||this.options.revert===true||($.isFunction(this.options.revert)&&this.options.revert.call(this.element,dropped))){var self=this;$(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){if(self._trigger("stop",event)!==false){self._clear()}})}else{if(this._trigger("stop",event)!==false){this._clear()}}return false},cancel:function(){if(this.helper.is(".ui-draggable-dragging")){this._mouseUp({})}else{this._clear()}return this},_getHandle:function(event){var handle=!this.options.handle||!$(this.options.handle,this.element).length?true:false;$(this.options.handle,this.element).find("*").andSelf().each(function(){if(this==event.target){handle=true}});return handle},_createHelper:function(event){var o=this.options;var helper=$.isFunction(o.helper)?$(o.helper.apply(this.element[0],[event])):(o.helper=="clone"?this.element.clone():this.element);if(!helper.parents("body").length){helper.appendTo((o.appendTo=="parent"?this.element[0].parentNode:o.appendTo))}if(helper[0]!=this.element[0]&&!(/(fixed|absolute)/).test(helper.css("position"))){helper.css("position","absolute")}return helper},_adjustOffsetFromHelper:function(obj){if(typeof obj=="string"){obj=obj.split(" ")}if($.isArray(obj)){obj={left:+obj[0],top:+obj[1]||0}}if("left" in obj){this.offset.click.left=obj.left+this.margins.left}if("right" in obj){this.offset.click.left=this.helperProportions.width-obj.right+this.margins.left}if("top" in obj){this.offset.click.top=obj.top+this.margins.top}if("bottom" in obj){this.offset.click.top=this.helperProportions.height-obj.bottom+this.margins.top}},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var po=this.offsetParent.offset();if(this.cssPosition=="absolute"&&this.scrollParent[0]!=document&&$.ui.contains(this.scrollParent[0],this.offsetParent[0])){po.left+=this.scrollParent.scrollLeft();po.top+=this.scrollParent.scrollTop()}if((this.offsetParent[0]==document.body)||(this.offsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase()=="html"&&$.browser.msie)){po={top:0,left:0}}return{top:po.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:po.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if(this.cssPosition=="relative"){var p=this.element.position();return{top:p.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:p.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}else{return{top:0,left:0}}},_cacheMargins:function(){this.margins={left:(parseInt(this.element.css("marginLeft"),10)||0),top:(parseInt(this.element.css("marginTop"),10)||0),right:(parseInt(this.element.css("marginRight"),10)||0),bottom:(parseInt(this.element.css("marginBottom"),10)||0)}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var o=this.options;if(o.containment=="parent"){o.containment=this.helper[0].parentNode}if(o.containment=="document"||o.containment=="window"){this.containment=[(o.containment=="document"?0:$(window).scrollLeft())-this.offset.relative.left-this.offset.parent.left,(o.containment=="document"?0:$(window).scrollTop())-this.offset.relative.top-this.offset.parent.top,(o.containment=="document"?0:$(window).scrollLeft())+$(o.containment=="document"?document:window).width()-this.helperProportions.width-this.margins.left,(o.containment=="document"?0:$(window).scrollTop())+($(o.containment=="document"?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]}if(!(/^(document|window|parent)$/).test(o.containment)&&o.containment.constructor!=Array){var ce=$(o.containment)[0];if(!ce){return }var co=$(o.containment).offset();var over=($(ce).css("overflow")!="hidden");this.containment=[co.left+(parseInt($(ce).css("borderLeftWidth"),10)||0)+(parseInt($(ce).css("paddingLeft"),10)||0),co.top+(parseInt($(ce).css("borderTopWidth"),10)||0)+(parseInt($(ce).css("paddingTop"),10)||0),co.left+(over?Math.max(ce.scrollWidth,ce.offsetWidth):ce.offsetWidth)-(parseInt($(ce).css("borderLeftWidth"),10)||0)-(parseInt($(ce).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left-this.margins.right,co.top+(over?Math.max(ce.scrollHeight,ce.offsetHeight):ce.offsetHeight)-(parseInt($(ce).css("borderTopWidth"),10)||0)-(parseInt($(ce).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top-this.margins.bottom]}else{if(o.containment.constructor==Array){this.containment=o.containment}}},_convertPositionTo:function(d,pos){if(!pos){pos=this.position}var mod=d=="absolute"?1:-1;var o=this.options,scroll=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&$.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,scrollIsRootNode=(/(html|body)/i).test(scroll[0].tagName);return{top:(pos.top+this.offset.relative.top*mod+this.offset.parent.top*mod-($.browser.safari&&$.browser.version<526&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():(scrollIsRootNode?0:scroll.scrollTop()))*mod)),left:(pos.left+this.offset.relative.left*mod+this.offset.parent.left*mod-($.browser.safari&&$.browser.version<526&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():scrollIsRootNode?0:scroll.scrollLeft())*mod))}},_generatePosition:function(event){var o=this.options,scroll=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&$.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,scrollIsRootNode=(/(html|body)/i).test(scroll[0].tagName);var pageX=event.pageX;var pageY=event.pageY;if(this.originalPosition){if(this.containment){if(event.pageX-this.offset.click.leftthis.containment[2]){pageX=this.containment[2]+this.offset.click.left}if(event.pageY-this.offset.click.top>this.containment[3]){pageY=this.containment[3]+this.offset.click.top}}if(o.grid){var top=this.originalPageY+Math.round((pageY-this.originalPageY)/o.grid[1])*o.grid[1];pageY=this.containment?(!(top-this.offset.click.topthis.containment[3])?top:(!(top-this.offset.click.topthis.containment[2])?left:(!(left-this.offset.click.left').css({width:this.offsetWidth+"px",height:this.offsetHeight+"px",position:"absolute",opacity:"0.001",zIndex:1000}).css($(this).offset()).appendTo("body")})},stop:function(event,ui){$("div.ui-draggable-iframeFix").each(function(){this.parentNode.removeChild(this)})}});$.ui.plugin.add("draggable","opacity",{start:function(event,ui){var t=$(ui.helper),o=$(this).data("draggable").options;if(t.css("opacity")){o._opacity=t.css("opacity")}t.css("opacity",o.opacity)},stop:function(event,ui){var o=$(this).data("draggable").options;if(o._opacity){$(ui.helper).css("opacity",o._opacity)}}});$.ui.plugin.add("draggable","scroll",{start:function(event,ui){var i=$(this).data("draggable");if(i.scrollParent[0]!=document&&i.scrollParent[0].tagName!="HTML"){i.overflowOffset=i.scrollParent.offset()}},drag:function(event,ui){var i=$(this).data("draggable"),o=i.options,scrolled=false;if(i.scrollParent[0]!=document&&i.scrollParent[0].tagName!="HTML"){if(!o.axis||o.axis!="x"){if((i.overflowOffset.top+i.scrollParent[0].offsetHeight)-event.pageY=0;i--){var l=inst.snapElements[i].left,r=l+inst.snapElements[i].width,t=inst.snapElements[i].top,b=t+inst.snapElements[i].height;if(!((l-d")).appendTo(document.body).hide().addClass(uiDialogClasses+options.dialogClass).css({zIndex:options.zIndex}).attr("tabIndex",-1).css("outline",0).keydown(function(event){if(options.closeOnEscape&&event.keyCode&&event.keyCode===$.ui.keyCode.ESCAPE){self.close(event);event.preventDefault()}}).attr({role:"dialog","aria-labelledby":titleId}).mousedown(function(event){self.moveToTop(false,event)}),uiDialogContent=self.element.show().removeAttr("title").addClass("ui-dialog-content ui-widget-content").appendTo(uiDialog),uiDialogTitlebar=(self.uiDialogTitlebar=$("
    ")).addClass("ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix").prependTo(uiDialog),uiDialogTitlebarClose=$('').addClass("ui-dialog-titlebar-close ui-corner-all").attr("role","button").hover(function(){uiDialogTitlebarClose.addClass("ui-state-hover")},function(){uiDialogTitlebarClose.removeClass("ui-state-hover")}).focus(function(){uiDialogTitlebarClose.addClass("ui-state-focus")}).blur(function(){uiDialogTitlebarClose.removeClass("ui-state-focus")}).click(function(event){self.close(event);return false}).appendTo(uiDialogTitlebar),uiDialogTitlebarCloseText=(self.uiDialogTitlebarCloseText=$("")).addClass("ui-icon ui-icon-closethick").text(options.closeText).appendTo(uiDialogTitlebarClose),uiDialogTitle=$("").addClass("ui-dialog-title").attr("id",titleId).html(title).prependTo(uiDialogTitlebar);if($.isFunction(options.beforeclose)&&!$.isFunction(options.beforeClose)){options.beforeClose=options.beforeclose}uiDialogTitlebar.find("*").add(uiDialogTitlebar).disableSelection();if(options.draggable&&$.fn.draggable){self._makeDraggable()}if(options.resizable&&$.fn.resizable){self._makeResizable()}self._createButtons(options.buttons);self._isOpen=false;if($.fn.bgiframe){uiDialog.bgiframe()}},_init:function(){if(this.options.autoOpen){this.open()}},destroy:function(){var self=this;if(self.overlay){self.overlay.destroy()}self.uiDialog.hide();self.element.unbind(".dialog").removeData("dialog").removeClass("ui-dialog-content ui-widget-content").hide().appendTo("body");self.uiDialog.remove();if(self.originalTitle){self.element.attr("title",self.originalTitle)}return self},widget:function(){return this.uiDialog},close:function(event){var self=this,maxZ,thisZ;if(false===self._trigger("beforeClose",event)){return }if(self.overlay){self.overlay.destroy()}self.uiDialog.unbind("keypress.ui-dialog");self._isOpen=false;if(self.options.hide){self.uiDialog.hide(self.options.hide,function(){self._trigger("close",event)})}else{self.uiDialog.hide();self._trigger("close",event)}$.ui.dialog.overlay.resize();if(self.options.modal){maxZ=0;$(".ui-dialog").each(function(){if(this!==self.uiDialog[0]){thisZ=$(this).css("z-index");if(!isNaN(thisZ)){maxZ=Math.max(maxZ,thisZ)}}});$.ui.dialog.maxZ=maxZ}return self},isOpen:function(){return this._isOpen},moveToTop:function(force,event){var self=this,options=self.options,saveScroll;if((options.modal&&!force)||(!options.stack&&!options.modal)){return self._trigger("focus",event)}if(options.zIndex>$.ui.dialog.maxZ){$.ui.dialog.maxZ=options.zIndex}if(self.overlay){$.ui.dialog.maxZ+=1;self.overlay.$el.css("z-index",$.ui.dialog.overlay.maxZ=$.ui.dialog.maxZ)}saveScroll={scrollTop:self.element.attr("scrollTop"),scrollLeft:self.element.attr("scrollLeft")};$.ui.dialog.maxZ+=1;self.uiDialog.css("z-index",$.ui.dialog.maxZ);self.element.attr(saveScroll);self._trigger("focus",event);return self},open:function(){if(this._isOpen){return }var self=this,options=self.options,uiDialog=self.uiDialog;self.overlay=options.modal?new $.ui.dialog.overlay(self):null;self._size();self._position(options.position);uiDialog.show(options.show);self.moveToTop(true);if(options.modal){uiDialog.bind("keypress.ui-dialog",function(event){if(event.keyCode!==$.ui.keyCode.TAB){return }var tabbables=$(":tabbable",this),first=tabbables.filter(":first"),last=tabbables.filter(":last");if(event.target===last[0]&&!event.shiftKey){first.focus(1);return false}else{if(event.target===first[0]&&event.shiftKey){last.focus(1);return false}}})}$(self.element.find(":tabbable").get().concat(uiDialog.find(".ui-dialog-buttonpane :tabbable").get().concat(uiDialog.get()))).eq(0).focus();self._isOpen=true;self._trigger("open");return self},_createButtons:function(buttons){var self=this,hasButtons=false,uiDialogButtonPane=$("
    ").addClass("ui-dialog-buttonpane ui-widget-content ui-helper-clearfix"),uiButtonSet=$("
    ").addClass("ui-dialog-buttonset").appendTo(uiDialogButtonPane);self.uiDialog.find(".ui-dialog-buttonpane").remove();if(typeof buttons==="object"&&buttons!==null){$.each(buttons,function(){return !(hasButtons=true)})}if(hasButtons){$.each(buttons,function(name,props){props=$.isFunction(props)?{click:props,text:name}:props;var button=$('').click(function(){props.click.apply(self.element[0],arguments)}).appendTo(uiButtonSet);$.each(props,function(key,value){if(key==="click"){return }if(key in attrFn){button[key](value)}else{button.attr(key,value)}});if($.fn.button){button.button()}});uiDialogButtonPane.appendTo(self.uiDialog)}},_makeDraggable:function(){var self=this,options=self.options,doc=$(document),heightBeforeDrag;function filteredUi(ui){return{position:ui.position,offset:ui.offset}}self.uiDialog.draggable({cancel:".ui-dialog-content, .ui-dialog-titlebar-close",handle:".ui-dialog-titlebar",containment:"document",start:function(event,ui){heightBeforeDrag=options.height==="auto"?"auto":$(this).height();$(this).height($(this).height()).addClass("ui-dialog-dragging");self._trigger("dragStart",event,filteredUi(ui))},drag:function(event,ui){self._trigger("drag",event,filteredUi(ui))},stop:function(event,ui){options.position=[ui.position.left-doc.scrollLeft(),ui.position.top-doc.scrollTop()];$(this).removeClass("ui-dialog-dragging").height(heightBeforeDrag);self._trigger("dragStop",event,filteredUi(ui));$.ui.dialog.overlay.resize()}})},_makeResizable:function(handles){handles=(handles===undefined?this.options.resizable:handles);var self=this,options=self.options,position=self.uiDialog.css("position"),resizeHandles=(typeof handles==="string"?handles:"n,e,s,w,se,sw,ne,nw");function filteredUi(ui){return{originalPosition:ui.originalPosition,originalSize:ui.originalSize,position:ui.position,size:ui.size}}self.uiDialog.resizable({cancel:".ui-dialog-content",containment:"document",alsoResize:self.element,maxWidth:options.maxWidth,maxHeight:options.maxHeight,minWidth:options.minWidth,minHeight:self._minHeight(),handles:resizeHandles,start:function(event,ui){$(this).addClass("ui-dialog-resizing");self._trigger("resizeStart",event,filteredUi(ui))},resize:function(event,ui){self._trigger("resize",event,filteredUi(ui))},stop:function(event,ui){$(this).removeClass("ui-dialog-resizing");options.height=$(this).height();options.width=$(this).width();self._trigger("resizeStop",event,filteredUi(ui));$.ui.dialog.overlay.resize()}}).css("position",position).find(".ui-resizable-se").addClass("ui-icon ui-icon-grip-diagonal-se")},_minHeight:function(){var options=this.options;if(options.height==="auto"){return options.minHeight}else{return Math.min(options.minHeight,options.height)}},_position:function(position){var myAt=[],offset=[0,0],isVisible;if(position){if(typeof position==="string"||(typeof position==="object"&&"0" in position)){myAt=position.split?position.split(" "):[position[0],position[1]];if(myAt.length===1){myAt[1]=myAt[0]}$.each(["left","top"],function(i,offsetPosition){if(+myAt[i]===myAt[i]){offset[i]=myAt[i];myAt[i]=offsetPosition}});position={my:myAt.join(" "),at:myAt.join(" "),offset:offset.join(" ")}}position=$.extend({},$.ui.dialog.prototype.options.position,position)}else{position=$.ui.dialog.prototype.options.position}isVisible=this.uiDialog.is(":visible");if(!isVisible){this.uiDialog.show()}this.uiDialog.css({top:0,left:0}).position($.extend({of:window},position));if(!isVisible){this.uiDialog.hide()}},_setOptions:function(options){var self=this,resizableOptions={},resize=false;$.each(options,function(key,value){self._setOption(key,value);if(key in sizeRelatedOptions){resize=true}if(key in resizableRelatedOptions){resizableOptions[key]=value}});if(resize){this._size()}if(this.uiDialog.is(":data(resizable)")){this.uiDialog.resizable("option",resizableOptions)}},_setOption:function(key,value){var self=this,uiDialog=self.uiDialog;switch(key){case"beforeclose":key="beforeClose";break;case"buttons":self._createButtons(value);break;case"closeText":self.uiDialogTitlebarCloseText.text(""+value);break;case"dialogClass":uiDialog.removeClass(self.options.dialogClass).addClass(uiDialogClasses+value);break;case"disabled":if(value){uiDialog.addClass("ui-dialog-disabled")}else{uiDialog.removeClass("ui-dialog-disabled")}break;case"draggable":var isDraggable=uiDialog.is(":data(draggable)");if(isDraggable&&!value){uiDialog.draggable("destroy")}if(!isDraggable&&value){self._makeDraggable()}break;case"position":self._position(value);break;case"resizable":var isResizable=uiDialog.is(":data(resizable)");if(isResizable&&!value){uiDialog.resizable("destroy")}if(isResizable&&typeof value==="string"){uiDialog.resizable("option","handles",value)}if(!isResizable&&value!==false){self._makeResizable(value)}break;case"title":$(".ui-dialog-title",self.uiDialogTitlebar).html(""+(value||" "));break}$.Widget.prototype._setOption.apply(self,arguments)},_size:function(){var options=this.options,nonContentHeight,minContentHeight,isVisible=this.uiDialog.is(":visible");this.element.show().css({width:"auto",minHeight:0,height:0});if(options.minWidth>options.width){options.width=options.minWidth}nonContentHeight=this.uiDialog.css({height:"auto",width:options.width}).height();minContentHeight=Math.max(0,options.minHeight-nonContentHeight);if(options.height==="auto"){if($.support.minHeight){this.element.css({minHeight:minContentHeight,height:"auto"})}else{this.uiDialog.show();var autoHeight=this.element.css("height","auto").height();if(!isVisible){this.uiDialog.hide()}this.element.height(Math.max(autoHeight,minContentHeight))}}else{this.element.height(Math.max(options.height-nonContentHeight,0))}if(this.uiDialog.is(":data(resizable)")){this.uiDialog.resizable("option","minHeight",this._minHeight())}}});$.extend($.ui.dialog,{version:"1.8.12",uuid:0,maxZ:0,getTitleId:function($el){var id=$el.attr("id");if(!id){this.uuid+=1;id=this.uuid}return"ui-dialog-title-"+id},overlay:function(dialog){this.$el=$.ui.dialog.overlay.create(dialog)}});$.extend($.ui.dialog.overlay,{instances:[],oldInstances:[],maxZ:0,events:$.map("focus,mousedown,mouseup,keydown,keypress,click".split(","),function(event){return event+".dialog-overlay"}).join(" "),create:function(dialog){if(this.instances.length===0){setTimeout(function(){if($.ui.dialog.overlay.instances.length){$(document).bind($.ui.dialog.overlay.events,function(event){if($(event.target).zIndex()<$.ui.dialog.overlay.maxZ){return false}})}},1);$(document).bind("keydown.dialog-overlay",function(event){if(dialog.options.closeOnEscape&&event.keyCode&&event.keyCode===$.ui.keyCode.ESCAPE){dialog.close(event);event.preventDefault()}});$(window).bind("resize.dialog-overlay",$.ui.dialog.overlay.resize)}var $el=(this.oldInstances.pop()||$("
    ").addClass("ui-widget-overlay")).appendTo(document.body).css({width:this.width(),height:this.height()});if($.fn.bgiframe){$el.bgiframe()}this.instances.push($el);return $el},destroy:function($el){var indexOf=$.inArray($el,this.instances);if(indexOf!=-1){this.oldInstances.push(this.instances.splice(indexOf,1)[0])}if(this.instances.length===0){$([document,window]).unbind(".dialog-overlay")}$el.remove();var maxZ=0;$.each(this.instances,function(){maxZ=Math.max(maxZ,this.css("z-index"))});this.maxZ=maxZ},height:function(){var scrollHeight,offsetHeight;if($.browser.msie&&$.browser.version<7){scrollHeight=Math.max(document.documentElement.scrollHeight,document.body.scrollHeight);offsetHeight=Math.max(document.documentElement.offsetHeight,document.body.offsetHeight);if(scrollHeight");if(!o.values){o.values=[this._valueMin(),this._valueMin()]}if(o.values.length&&o.values.length!==2){o.values=[o.values[0],o.values[0]]}}else{this.range=$("
    ")}this.range.appendTo(this.element).addClass("ui-slider-range");if(o.range==="min"||o.range==="max"){this.range.addClass("ui-slider-range-"+o.range)}this.range.addClass("ui-widget-header")}if($(".ui-slider-handle",this.element).length===0){$("").appendTo(this.element).addClass("ui-slider-handle")}if(o.values&&o.values.length){while($(".ui-slider-handle",this.element).length").appendTo(this.element).addClass("ui-slider-handle")}}this.handles=$(".ui-slider-handle",this.element).addClass("ui-state-default ui-corner-all");this.handle=this.handles.eq(0);this.handles.add(this.range).filter("a").click(function(event){event.preventDefault()}).hover(function(){if(!o.disabled){$(this).addClass("ui-state-hover")}},function(){$(this).removeClass("ui-state-hover")}).focus(function(){if(!o.disabled){$(".ui-slider .ui-state-focus").removeClass("ui-state-focus");$(this).addClass("ui-state-focus")}else{$(this).blur()}}).blur(function(){$(this).removeClass("ui-state-focus")});this.handles.each(function(i){$(this).data("index.ui-slider-handle",i)});this.handles.keydown(function(event){var ret=true,index=$(this).data("index.ui-slider-handle"),allowed,curVal,newVal,step;if(self.options.disabled){return }switch(event.keyCode){case $.ui.keyCode.HOME:case $.ui.keyCode.END:case $.ui.keyCode.PAGE_UP:case $.ui.keyCode.PAGE_DOWN:case $.ui.keyCode.UP:case $.ui.keyCode.RIGHT:case $.ui.keyCode.DOWN:case $.ui.keyCode.LEFT:ret=false;if(!self._keySliding){self._keySliding=true;$(this).addClass("ui-state-active");allowed=self._start(event,index);if(allowed===false){return }}break}step=self.options.step;if(self.options.values&&self.options.values.length){curVal=newVal=self.values(index)}else{curVal=newVal=self.value()}switch(event.keyCode){case $.ui.keyCode.HOME:newVal=self._valueMin();break;case $.ui.keyCode.END:newVal=self._valueMax();break;case $.ui.keyCode.PAGE_UP:newVal=self._trimAlignValue(curVal+((self._valueMax()-self._valueMin())/numPages));break;case $.ui.keyCode.PAGE_DOWN:newVal=self._trimAlignValue(curVal-((self._valueMax()-self._valueMin())/numPages));break;case $.ui.keyCode.UP:case $.ui.keyCode.RIGHT:if(curVal===self._valueMax()){return }newVal=self._trimAlignValue(curVal+step);break;case $.ui.keyCode.DOWN:case $.ui.keyCode.LEFT:if(curVal===self._valueMin()){return }newVal=self._trimAlignValue(curVal-step);break}self._slide(event,index,newVal);return ret}).keyup(function(event){var index=$(this).data("index.ui-slider-handle");if(self._keySliding){self._keySliding=false;self._stop(event,index);self._change(event,index);$(this).removeClass("ui-state-active")}});this._refreshValue();this._animateOff=false},destroy:function(){this.handles.remove();this.range.remove();this.element.removeClass("ui-slider ui-slider-horizontal ui-slider-vertical ui-slider-disabled ui-widget ui-widget-content ui-corner-all").removeData("slider").unbind(".slider");this._mouseDestroy();return this},_mouseCapture:function(event){var o=this.options,position,normValue,distance,closestHandle,self,index,allowed,offset,mouseOverHandle;if(o.disabled){return false}this.elementSize={width:this.element.outerWidth(),height:this.element.outerHeight()};this.elementOffset=this.element.offset();position={x:event.pageX,y:event.pageY};normValue=this._normValueFromMouse(position);distance=this._valueMax()-this._valueMin()+1;self=this;this.handles.each(function(i){var thisDistance=Math.abs(normValue-self.values(i));if(distance>thisDistance){distance=thisDistance;closestHandle=$(this);index=i}});if(o.range===true&&this.values(1)===o.min){index+=1;closestHandle=$(this.handles[index])}allowed=this._start(event,index);if(allowed===false){return false}this._mouseSliding=true;self._handleIndex=index;closestHandle.addClass("ui-state-active").focus();offset=closestHandle.offset();mouseOverHandle=!$(event.target).parents().andSelf().is(".ui-slider-handle");this._clickOffset=mouseOverHandle?{left:0,top:0}:{left:event.pageX-offset.left-(closestHandle.width()/2),top:event.pageY-offset.top-(closestHandle.height()/2)-(parseInt(closestHandle.css("borderTopWidth"),10)||0)-(parseInt(closestHandle.css("borderBottomWidth"),10)||0)+(parseInt(closestHandle.css("marginTop"),10)||0)};if(!this.handles.hasClass("ui-state-hover")){this._slide(event,index,normValue)}this._animateOff=true;return true},_mouseStart:function(event){return true},_mouseDrag:function(event){var position={x:event.pageX,y:event.pageY},normValue=this._normValueFromMouse(position);this._slide(event,this._handleIndex,normValue);return false},_mouseStop:function(event){this.handles.removeClass("ui-state-active");this._mouseSliding=false;this._stop(event,this._handleIndex);this._change(event,this._handleIndex);this._handleIndex=null;this._clickOffset=null;this._animateOff=false;return false},_detectOrientation:function(){this.orientation=(this.options.orientation==="vertical")?"vertical":"horizontal"},_normValueFromMouse:function(position){var pixelTotal,pixelMouse,percentMouse,valueTotal,valueMouse;if(this.orientation==="horizontal"){pixelTotal=this.elementSize.width;pixelMouse=position.x-this.elementOffset.left-(this._clickOffset?this._clickOffset.left:0)}else{pixelTotal=this.elementSize.height;pixelMouse=position.y-this.elementOffset.top-(this._clickOffset?this._clickOffset.top:0)}percentMouse=(pixelMouse/pixelTotal);if(percentMouse>1){percentMouse=1}if(percentMouse<0){percentMouse=0}if(this.orientation==="vertical"){percentMouse=1-percentMouse}valueTotal=this._valueMax()-this._valueMin();valueMouse=this._valueMin()+percentMouse*valueTotal;return this._trimAlignValue(valueMouse)},_start:function(event,index){var uiHash={handle:this.handles[index],value:this.value()};if(this.options.values&&this.options.values.length){uiHash.value=this.values(index);uiHash.values=this.values()}return this._trigger("start",event,uiHash)},_slide:function(event,index,newVal){var otherVal,newValues,allowed;if(this.options.values&&this.options.values.length){otherVal=this.values(index?0:1);if((this.options.values.length===2&&this.options.range===true)&&((index===0&&newVal>otherVal)||(index===1&&newVal1){this.options.values[index]=this._trimAlignValue(newValue);this._refreshValue();this._change(null,index);return }if(arguments.length){if($.isArray(arguments[0])){vals=this.options.values;newValues=arguments[0];for(i=0;i=this._valueMax()){return this._valueMax()}var step=(this.options.step>0)?this.options.step:1,valModStep=(val-this._valueMin())%step;alignValue=val-valModStep;if(Math.abs(valModStep)*2>=step){alignValue+=(valModStep>0)?step:(-step)}return parseFloat(alignValue.toFixed(5))},_valueMin:function(){return this.options.min},_valueMax:function(){return this.options.max},_refreshValue:function(){var oRange=this.options.range,o=this.options,self=this,animate=(!this._animateOff)?o.animate:false,valPercent,_set={},lastValPercent,value,valueMin,valueMax;if(this.options.values&&this.options.values.length){this.handles.each(function(i,j){valPercent=(self.values(i)-self._valueMin())/(self._valueMax()-self._valueMin())*100;_set[self.orientation==="horizontal"?"left":"bottom"]=valPercent+"%";$(this).stop(1,1)[animate?"animate":"css"](_set,o.animate);if(self.options.range===true){if(self.orientation==="horizontal"){if(i===0){self.range.stop(1,1)[animate?"animate":"css"]({left:valPercent+"%"},o.animate)}if(i===1){self.range[animate?"animate":"css"]({width:(valPercent-lastValPercent)+"%"},{queue:false,duration:o.animate})}}else{if(i===0){self.range.stop(1,1)[animate?"animate":"css"]({bottom:(valPercent)+"%"},o.animate)}if(i===1){self.range[animate?"animate":"css"]({height:(valPercent-lastValPercent)+"%"},{queue:false,duration:o.animate})}}}lastValPercent=valPercent})}else{value=this.value();valueMin=this._valueMin();valueMax=this._valueMax();valPercent=(valueMax!==valueMin)?(value-valueMin)/(valueMax-valueMin)*100:0;_set[self.orientation==="horizontal"?"left":"bottom"]=valPercent+"%";this.handle.stop(1,1)[animate?"animate":"css"](_set,o.animate);if(oRange==="min"&&this.orientation==="horizontal"){this.range.stop(1,1)[animate?"animate":"css"]({width:valPercent+"%"},o.animate)}if(oRange==="max"&&this.orientation==="horizontal"){this.range[animate?"animate":"css"]({width:(100-valPercent)+"%"},{queue:false,duration:o.animate})}if(oRange==="min"&&this.orientation==="vertical"){this.range.stop(1,1)[animate?"animate":"css"]({height:valPercent+"%"},o.animate)}if(oRange==="max"&&this.orientation==="vertical"){this.range[animate?"animate":"css"]({height:(100-valPercent)+"%"},{queue:false,duration:o.animate})}}}});$.extend($.ui.slider,{version:"1.8.12"})}(jQuery));(function($,undefined){var tabId=0,listId=0;function getNextTabId(){return ++tabId}function getNextListId(){return ++listId}$.widget("ui.tabs",{options:{add:null,ajaxOptions:null,cache:false,cookie:null,collapsible:false,disable:null,disabled:[],enable:null,event:"click",fx:null,idPrefix:"ui-tabs-",load:null,panelTemplate:"
    ",remove:null,select:null,show:null,spinner:"Loading…",tabTemplate:"
  • #{label}
  • "},_create:function(){this._tabify(true)},_setOption:function(key,value){if(key=="selected"){if(this.options.collapsible&&value==this.options.selected){return }this.select(value)}else{this.options[key]=value;this._tabify()}},_tabId:function(a){return a.title&&a.title.replace(/\s/g,"_").replace(/[^\w\u00c0-\uFFFF-]/g,"")||this.options.idPrefix+getNextTabId()},_sanitizeSelector:function(hash){return hash.replace(/:/g,"\\:")},_cookie:function(){var cookie=this.cookie||(this.cookie=this.options.cookie.name||"ui-tabs-"+getNextListId());return $.cookie.apply(null,[cookie].concat($.makeArray(arguments)))},_ui:function(tab,panel){return{tab:tab,panel:panel,index:this.anchors.index(tab)}},_cleanup:function(){this.lis.filter(".ui-state-processing").removeClass("ui-state-processing").find("span:data(label.tabs)").each(function(){var el=$(this);el.html(el.data("label.tabs")).removeData("label.tabs")})},_tabify:function(init){var self=this,o=this.options,fragmentId=/^#.+/;this.list=this.element.find("ol,ul").eq(0);this.lis=$(" > li:has(a[href])",this.list);this.anchors=this.lis.map(function(){return $("a",this)[0]});this.panels=$([]);this.anchors.each(function(i,a){var href=$(a).attr("href");var hrefBase=href.split("#")[0],baseEl;if(hrefBase&&(hrefBase===location.toString().split("#")[0]||(baseEl=$("base")[0])&&hrefBase===baseEl.href)){href=a.hash;a.href=href}if(fragmentId.test(href)){self.panels=self.panels.add(self.element.find(self._sanitizeSelector(href)))}else{if(href&&href!=="#"){$.data(a,"href.tabs",href);$.data(a,"load.tabs",href.replace(/#.*$/,""));var id=self._tabId(a);a.href="#"+id;var $panel=self.element.find("#"+id);if(!$panel.length){$panel=$(o.panelTemplate).attr("id",id).addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").insertAfter(self.panels[i-1]||self.list);$panel.data("destroy.tabs",true)}self.panels=self.panels.add($panel)}else{o.disabled.push(i)}}});if(init){this.element.addClass("ui-tabs ui-widget ui-widget-content ui-corner-all");this.list.addClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all");this.lis.addClass("ui-state-default ui-corner-top");this.panels.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom");if(o.selected===undefined){if(location.hash){this.anchors.each(function(i,a){if(a.hash==location.hash){o.selected=i;return false}})}if(typeof o.selected!=="number"&&o.cookie){o.selected=parseInt(self._cookie(),10)}if(typeof o.selected!=="number"&&this.lis.filter(".ui-tabs-selected").length){o.selected=this.lis.index(this.lis.filter(".ui-tabs-selected"))}o.selected=o.selected||(this.lis.length?0:-1)}else{if(o.selected===null){o.selected=-1}}o.selected=((o.selected>=0&&this.anchors[o.selected])||o.selected<0)?o.selected:0;o.disabled=$.unique(o.disabled.concat($.map(this.lis.filter(".ui-state-disabled"),function(n,i){return self.lis.index(n)}))).sort();if($.inArray(o.selected,o.disabled)!=-1){o.disabled.splice($.inArray(o.selected,o.disabled),1)}this.panels.addClass("ui-tabs-hide");this.lis.removeClass("ui-tabs-selected ui-state-active");if(o.selected>=0&&this.anchors.length){self.element.find(self._sanitizeSelector(self.anchors[o.selected].hash)).removeClass("ui-tabs-hide");this.lis.eq(o.selected).addClass("ui-tabs-selected ui-state-active");self.element.queue("tabs",function(){self._trigger("show",null,self._ui(self.anchors[o.selected],self.element.find(self._sanitizeSelector(self.anchors[o.selected].hash))[0]))});this.load(o.selected)}$(window).bind("unload",function(){self.lis.add(self.anchors).unbind(".tabs");self.lis=self.anchors=self.panels=null})}else{o.selected=this.lis.index(this.lis.filter(".ui-tabs-selected"))}this.element[o.collapsible?"addClass":"removeClass"]("ui-tabs-collapsible");if(o.cookie){this._cookie(o.selected,o.cookie)}for(var i=0,li;(li=this.lis[i]);i++){$(li)[$.inArray(i,o.disabled)!=-1&&!$(li).hasClass("ui-tabs-selected")?"addClass":"removeClass"]("ui-state-disabled")}if(o.cache===false){this.anchors.removeData("cache.tabs")}this.lis.add(this.anchors).unbind(".tabs");if(o.event!=="mouseover"){var addState=function(state,el){if(el.is(":not(.ui-state-disabled)")){el.addClass("ui-state-"+state)}};var removeState=function(state,el){el.removeClass("ui-state-"+state)};this.lis.bind("mouseover.tabs",function(){addState("hover",$(this))});this.lis.bind("mouseout.tabs",function(){removeState("hover",$(this))});this.anchors.bind("focus.tabs",function(){addState("focus",$(this).closest("li"))});this.anchors.bind("blur.tabs",function(){removeState("focus",$(this).closest("li"))})}var hideFx,showFx;if(o.fx){if($.isArray(o.fx)){hideFx=o.fx[0];showFx=o.fx[1]}else{hideFx=showFx=o.fx}}function resetStyle($el,fx){$el.css("display","");if(!$.support.opacity&&fx.opacity){$el[0].style.removeAttribute("filter")}}var showTab=showFx?function(clicked,$show){$(clicked).closest("li").addClass("ui-tabs-selected ui-state-active");$show.hide().removeClass("ui-tabs-hide").animate(showFx,showFx.duration||"normal",function(){resetStyle($show,showFx);self._trigger("show",null,self._ui(clicked,$show[0]))})}:function(clicked,$show){$(clicked).closest("li").addClass("ui-tabs-selected ui-state-active");$show.removeClass("ui-tabs-hide");self._trigger("show",null,self._ui(clicked,$show[0]))};var hideTab=hideFx?function(clicked,$hide){$hide.animate(hideFx,hideFx.duration||"normal",function(){self.lis.removeClass("ui-tabs-selected ui-state-active");$hide.addClass("ui-tabs-hide");resetStyle($hide,hideFx);self.element.dequeue("tabs")})}:function(clicked,$hide,$show){self.lis.removeClass("ui-tabs-selected ui-state-active");$hide.addClass("ui-tabs-hide");self.element.dequeue("tabs")};this.anchors.bind(o.event+".tabs",function(){var el=this,$li=$(el).closest("li"),$hide=self.panels.filter(":not(.ui-tabs-hide)"),$show=self.element.find(self._sanitizeSelector(el.hash));if(($li.hasClass("ui-tabs-selected")&&!o.collapsible)||$li.hasClass("ui-state-disabled")||$li.hasClass("ui-state-processing")||self.panels.filter(":animated").length||self._trigger("select",null,self._ui(this,$show[0]))===false){this.blur();return false}o.selected=self.anchors.index(this);self.abort();if(o.collapsible){if($li.hasClass("ui-tabs-selected")){o.selected=-1;if(o.cookie){self._cookie(o.selected,o.cookie)}self.element.queue("tabs",function(){hideTab(el,$hide)}).dequeue("tabs");this.blur();return false}else{if(!$hide.length){if(o.cookie){self._cookie(o.selected,o.cookie)}self.element.queue("tabs",function(){showTab(el,$show)});self.load(self.anchors.index(this));this.blur();return false}}}if(o.cookie){self._cookie(o.selected,o.cookie)}if($show.length){if($hide.length){self.element.queue("tabs",function(){hideTab(el,$hide)})}self.element.queue("tabs",function(){showTab(el,$show)});self.load(self.anchors.index(this))}else{throw"jQuery UI Tabs: Mismatching fragment identifier."}if($.browser.msie){this.blur()}});this.anchors.bind("click.tabs",function(){return false})},_getIndex:function(index){if(typeof index=="string"){index=this.anchors.index(this.anchors.filter("[href$="+index+"]"))}return index},destroy:function(){var o=this.options;this.abort();this.element.unbind(".tabs").removeClass("ui-tabs ui-widget ui-widget-content ui-corner-all ui-tabs-collapsible").removeData("tabs");this.list.removeClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all");this.anchors.each(function(){var href=$.data(this,"href.tabs");if(href){this.href=href}var $this=$(this).unbind(".tabs");$.each(["href","load","cache"],function(i,prefix){$this.removeData(prefix+".tabs")})});this.lis.unbind(".tabs").add(this.panels).each(function(){if($.data(this,"destroy.tabs")){$(this).remove()}else{$(this).removeClass(["ui-state-default","ui-corner-top","ui-tabs-selected","ui-state-active","ui-state-hover","ui-state-focus","ui-state-disabled","ui-tabs-panel","ui-widget-content","ui-corner-bottom","ui-tabs-hide"].join(" "))}});if(o.cookie){this._cookie(null,o.cookie)}return this},add:function(url,label,index){if(index===undefined){index=this.anchors.length}var self=this,o=this.options,$li=$(o.tabTemplate.replace(/#\{href\}/g,url).replace(/#\{label\}/g,label)),id=!url.indexOf("#")?url.replace("#",""):this._tabId($("a",$li)[0]);$li.addClass("ui-state-default ui-corner-top").data("destroy.tabs",true);var $panel=self.element.find("#"+id);if(!$panel.length){$panel=$(o.panelTemplate).attr("id",id).data("destroy.tabs",true)}$panel.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom ui-tabs-hide");if(index>=this.lis.length){$li.appendTo(this.list);$panel.appendTo(this.list[0].parentNode)}else{$li.insertBefore(this.lis[index]);$panel.insertBefore(this.panels[index])}o.disabled=$.map(o.disabled,function(n,i){return n>=index?++n:n});this._tabify();if(this.anchors.length==1){o.selected=0;$li.addClass("ui-tabs-selected ui-state-active");$panel.removeClass("ui-tabs-hide");this.element.queue("tabs",function(){self._trigger("show",null,self._ui(self.anchors[0],self.panels[0]))});this.load(0)}this._trigger("add",null,this._ui(this.anchors[index],this.panels[index]));return this},remove:function(index){index=this._getIndex(index);var o=this.options,$li=this.lis.eq(index).remove(),$panel=this.panels.eq(index).remove();if($li.hasClass("ui-tabs-selected")&&this.anchors.length>1){this.select(index+(index+1=index?--n:n});this._tabify();this._trigger("remove",null,this._ui($li.find("a")[0],$panel[0]));return this},enable:function(index){index=this._getIndex(index);var o=this.options;if($.inArray(index,o.disabled)==-1){return }this.lis.eq(index).removeClass("ui-state-disabled");o.disabled=$.grep(o.disabled,function(n,i){return n!=index});this._trigger("enable",null,this._ui(this.anchors[index],this.panels[index]));return this},disable:function(index){index=this._getIndex(index);var self=this,o=this.options;if(index!=o.selected){this.lis.eq(index).addClass("ui-state-disabled");o.disabled.push(index);o.disabled.sort();this._trigger("disable",null,this._ui(this.anchors[index],this.panels[index]))}return this},select:function(index){index=this._getIndex(index);if(index==-1){if(this.options.collapsible&&this.options.selected!=-1){index=this.options.selected}else{return this}}this.anchors.eq(index).trigger(this.options.event+".tabs");return this},load:function(index){index=this._getIndex(index);var self=this,o=this.options,a=this.anchors.eq(index)[0],url=$.data(a,"load.tabs");this.abort();if(!url||this.element.queue("tabs").length!==0&&$.data(a,"cache.tabs")){this.element.dequeue("tabs");return }this.lis.eq(index).addClass("ui-state-processing");if(o.spinner){var span=$("span",a);span.data("label.tabs",span.html()).html(o.spinner)}this.xhr=$.ajax($.extend({},o.ajaxOptions,{url:url,success:function(r,s){self.element.find(self._sanitizeSelector(a.hash)).html(r);self._cleanup();if(o.cache){$.data(a,"cache.tabs",true)}self._trigger("load",null,self._ui(self.anchors[index],self.panels[index]));try{o.ajaxOptions.success(r,s)}catch(e){}},error:function(xhr,s,e){self._cleanup();self._trigger("load",null,self._ui(self.anchors[index],self.panels[index]));try{o.ajaxOptions.error(xhr,s,index,a)}catch(e){}}}));self.element.dequeue("tabs");return this},abort:function(){this.element.queue([]);this.panels.stop(false,true);this.element.queue("tabs",this.element.queue("tabs").splice(-2,2));if(this.xhr){this.xhr.abort();delete this.xhr}this._cleanup();return this},url:function(index,url){this.anchors.eq(index).removeData("cache.tabs").data("load.tabs",url);return this},length:function(){return this.anchors.length}});$.extend($.ui.tabs,{version:"1.8.12"});$.extend($.ui.tabs.prototype,{rotation:null,rotate:function(ms,continuing){var self=this,o=this.options;var rotate=self._rotate||(self._rotate=function(e){clearTimeout(self.rotation);self.rotation=setTimeout(function(){var t=o.selected;self.select(++t=sourcei?fluid.position.AFTER:fluid.position.BEFORE}return position};fluid.permuteDom=function(element,target,position,sourceelements,targetelements){element=fluid.unwrap(element);target=fluid.unwrap(target);var sourcei=$.inArray(element,sourceelements);if(sourcei===-1){fluid.fail("Error in permuteDom: source element "+fluid.dumpEl(element)+" not found in source list "+fluid.dumpEl(sourceelements))}var targeti=$.inArray(target,targetelements);if(targeti===-1){fluid.fail("Error in permuteDom: target element "+fluid.dumpEl(target)+" not found in source list "+fluid.dumpEl(targetelements))}var samespan=sourceelements===targetelements;position=fluid.normalisePosition(position,samespan,targeti,sourcei);var oldn={};oldn[fluid.position.AFTER]=element.nextSibling;oldn[fluid.position.BEFORE]=element.previousSibling;fluid.moveDom(sourceelements[sourcei],targetelements[targeti],position);var frontlimit=samespan?targeti-1:sourceelements.length-2;var i;if(position===fluid.position.BEFORE&&samespan){frontlimit--}if(!samespan||targeti>sourcei){for(i=frontlimit;i>sourcei;--i){fluid.moveDom(sourceelements[i+1],sourceelements[i],fluid.position.AFTER)}if(sourcei+1=0&&backlimit=mindistance){minlockedelem=blankHolder}if(lastClosest&&lastClosest.position===minelem.position&&fluid.unwrap(lastClosest.element)===fluid.unwrap(minelem.element)&&fluid.unwrap(lastClosest.lockedelem)===fluid.unwrap(minlockedelem.element)){return fluid.dropManager.NO_CHANGE}return{position:minelem.position,element:minelem.element,lockedelem:minlockedelem.element}};that.shuffleProjectFrom=function(element,direction,includeLocked,disableWrap){var togo=that.projectFrom(element,direction,includeLocked,disableWrap);if(togo){togo.position=fluid.position.REPLACE}return togo};that.projectFrom=function(element,direction,includeLocked,disableWrap){that.updateGeometry(lastGeometry);var cacheelem=cache[fluid.dropManager.cacheKey(element)];var projected=fluid.geom.projectFrom(cacheelem.rect,direction,targets,includeLocked,disableWrap);if(!projected.cacheelem){return null}var retpos=projected.cacheelem.position;return{element:projected.cacheelem.element,position:retpos?retpos:fluid.position.BEFORE}};that.logicalFrom=function(element,direction,includeLocked,disableWrap){var orderables=that.getOwningSpan(element,fluid.position.INTERLEAVED,includeLocked);return{element:fluid.dropManager.getRelativeElement(element,direction,orderables,disableWrap),position:fluid.position.REPLACE}};that.lockedWrapFrom=function(element,direction,includeLocked,disableWrap){var base=that.logicalFrom(element,direction,includeLocked,disableWrap);var selectables=that.getOwningSpan(element,fluid.position.INTERLEAVED,includeLocked);var allElements=cache[fluid.dropManager.cacheKey(element)].owner.elements;if(includeLocked||selectables[0]===allElements[0]){return base}var directElement=fluid.dropManager.getRelativeElement(element,direction,allElements,disableWrap);if(lastGeometry.elementMapper(directElement)==="locked"){base.element=null;base.clazz="locked"}return base};that.getOwningSpan=function(element,position,includeLocked){var owner=cache[fluid.dropManager.cacheKey(element)].owner;var elements=position===fluid.position.INSIDE?[owner.parentElement]:owner.elements;if(!includeLocked&&lastGeometry.elementMapper){elements=$.makeArray(elements);fluid.remove_if(elements,function(element){return lastGeometry.elementMapper(element)==="locked"})}return elements};that.geometricMove=function(element,target,position){var sourceElements=that.getOwningSpan(element,null,true);var targetElements=that.getOwningSpan(target,position,true);fluid.permuteDom(element,target,position,sourceElements,targetElements)};return that};fluid.dropManager.NO_CHANGE="no change";fluid.dropManager.cacheKey=function(element){return fluid.allocateSimpleId(element)};fluid.dropManager.sentinelizeElement=function(targets,sides,cacheelem,fc,disposition,clazz){var elemCopy=$.extend(true,{},cacheelem);elemCopy.rect[sides[fc]]=elemCopy.rect[sides[1-fc]]+(fc?1:-1);elemCopy.rect[sides[1-fc]]=(fc?-1:1)*SENTINEL_DIMENSION;elemCopy.position=disposition===fluid.position.INSIDE?disposition:(fc?fluid.position.BEFORE:fluid.position.AFTER);elemCopy.clazz=clazz;targets[targets.length]=elemCopy};fluid.dropManager.splitElement=function(targets,sides,cacheelem,disposition,clazz1,clazz2){var elem1=$.extend(true,{},cacheelem);var elem2=$.extend(true,{},cacheelem);var midpoint=(elem1.rect[sides[0]]+elem1.rect[sides[1]])/2;elem1.rect[sides[1]]=midpoint;elem1.position=fluid.position.BEFORE;elem2.rect[sides[0]]=midpoint;elem2.position=fluid.position.AFTER;elem1.clazz=clazz1;elem2.clazz=clazz2;targets[targets.length]=elem1;targets[targets.length]=elem2};fluid.dropManager.getRelativeClass=function(thisElements,index,relative,thisclazz,mapper){index+=relative;if(index<0&&thisclazz==="locked"){return"locked"}if(index>=thisElements.length||mapper===null){return null}else{relative=thisElements[index];return mapper(relative)==="locked"&&thisclazz==="locked"?"locked":null}};fluid.dropManager.getRelativeElement=function(element,direction,elements,disableWrap){var folded=fluid.directionSign(direction);var index=$(elements).index(element)+folded;if(index<0){index+=elements.length}if(disableWrap){if(index===elements.length||index===(elements.length+folded)){return element}}index%=elements.length;return elements[index]};fluid.geom=fluid.geom||{};fluid.geom.minPointRectangle=function(x,y,rectangle){var dx=xrectangle.right?(x-rectangle.right):0);var dy=yrectangle.bottom?(y-rectangle.bottom):0);return dx*dx+dy*dy};fluid.geom.minRectRect=function(rect1,rect2){var dx=rect1.right=0){if(pdist===collect.mindist&&rdist*backSign>collect.minrdist){return }collect.minrdist=rdist*backSign;collect.mindist=pdist;collect.minelem=cacheelem}}var collect=makePenCollect();var backcollect=makePenCollect();var lockedcollect=makePenCollect();for(var i=0;i=0};var setDropEffects=function(value){thatReorderer.dom.fastLocate("dropTargets").attr("aria-dropeffect",value)};var styles=options.styles;var noModifier=function(evt){return(!evt.ctrlKey&&!evt.altKey&&!evt.shiftKey&&!evt.metaKey)};var handleDirectionKeyDown=function(evt){var item=thatReorderer.activeItem;if(!item){return true}var keysets=options.keysets;for(var i=0;i0){if(relativeItem.clazz==="locked"){thatReorderer.events.onShowKeyboardDropWarning.fire(item,kbDropWarning);kbDropWarning.show()}else{kbDropWarning.hide()}}if(relativeItem.element){thatReorderer.requestMovement(relativeItem,item)}}else{if(noModifier(evt)){item.blur();$(relativeItem.element).focus()}}return false}return true};thatReorderer.handleKeyDown=function(evt){if(!thatReorderer.activeItem||thatReorderer.activeItem!==evt.target){return true}var jActiveItem=$(thatReorderer.activeItem);if(!jActiveItem.hasClass(styles.dragging)&&isMove(evt)){if(isActiveItemMovable()){jActiveItem.removeClass(styles.selected);jActiveItem.addClass(styles.dragging);jActiveItem.attr("aria-grabbed","true");setDropEffects("move")}return false}return handleDirectionKeyDown(evt)};thatReorderer.handleKeyUp=function(evt){if(!thatReorderer.activeItem||thatReorderer.activeItem!==evt.target){return true}var jActiveItem=$(thatReorderer.activeItem);if(jActiveItem.hasClass(styles.dragging)&&!isMove(evt)){if(kbDropWarning){kbDropWarning.hide()}jActiveItem.removeClass(styles.dragging);jActiveItem.addClass(styles.selected);jActiveItem.attr("aria-grabbed","false");setDropEffects("none");return false}return false};var dropMarker;var createDropMarker=function(tagName){var dropMarker=$(document.createElement(tagName));dropMarker.addClass(options.styles.dropMarker);dropMarker.hide();return dropMarker};thatReorderer.requestMovement=function(requestedPosition,item){item=fluid.unwrap(item);if(!requestedPosition||fluid.unwrap(requestedPosition.element)===item){return }var activeItem=$(thatReorderer.activeItem);activeItem.unbind("blur.fluid.reorderer");thatReorderer.events.onMove.fire(item,requestedPosition);dropManager.geometricMove(item,requestedPosition.element,requestedPosition.position);activeItem.focus();thatReorderer.refresh();dropManager.updateGeometry(thatReorderer.layoutHandler.getGeometricInfo());thatReorderer.events.afterMove.fire(item,requestedPosition,thatReorderer.dom.fastLocate("movables"))};var hoverStyleHandler=function(item,state){thatReorderer.dom.fastLocate("grabHandle",item)[state?"addClass":"removeClass"](styles.hover)};function initMovable(item){var styles=options.styles;item.attr("aria-grabbed","false");item.mouseover(function(){thatReorderer.events.onHover.fire(item,true)});item.mouseout(function(){thatReorderer.events.onHover.fire(item,false)});var avatar;thatReorderer.dom.fastLocate("grabHandle",item).draggable({refreshPositions:false,scroll:true,helper:function(){var dropWarningEl;if(mouseDropWarning){dropWarningEl=mouseDropWarning[0]}avatar=$(options.avatarCreator(item[0],styles.avatar,dropWarningEl));avatar.prop("id",createAvatarId(thatReorderer.container.id));return avatar},start:function(e,ui){var prevent=thatReorderer.events.onBeginMove.fire(item);if(prevent===false){return false}var handle=thatReorderer.dom.fastLocate("grabHandle",item)[0];var handlePos=fluid.dom.computeAbsolutePosition(handle);var handleWidth=handle.offsetWidth;var handleHeight=handle.offsetHeight;item.focus();item.removeClass(options.styles.selected);item.addClass(options.styles.mouseDrag);item.attr("aria-grabbed","true");setDropEffects("move");dropManager.startDrag(e,handlePos,handleWidth,handleHeight);avatar.show()},stop:function(e,ui){item.removeClass(options.styles.mouseDrag);item.addClass(options.styles.selected);$(thatReorderer.activeItem).attr("aria-grabbed","false");var markerNode=fluid.unwrap(dropMarker);if(markerNode.parentNode){markerNode.parentNode.removeChild(markerNode)}avatar.hide();ui.helper=null;setDropEffects("none");dropManager.endDrag();thatReorderer.requestMovement(dropManager.lastPosition(),item);thatReorderer.activeItem.focus()},handle:thatReorderer.dom.fastLocate("grabHandle",item)})}function changeSelectedToDefault(jItem,styles){jItem.removeClass(styles.selected);jItem.removeClass(styles.dragging);jItem.addClass(styles.defaultStyle);jItem.attr("aria-selected","false")}var selectItem=function(anItem){thatReorderer.events.onSelect.fire(anItem);var styles=options.styles;if(thatReorderer.activeItem&&thatReorderer.activeItem!==anItem){changeSelectedToDefault($(thatReorderer.activeItem),styles)}thatReorderer.activeItem=anItem;var jItem=$(anItem);jItem.removeClass(styles.defaultStyle);jItem.addClass(styles.selected);jItem.attr("aria-selected","true")};var initSelectables=function(){var handleBlur=function(evt){changeSelectedToDefault($(this),options.styles);return evt.stopPropagation()};var handleFocus=function(evt){selectItem(this);return evt.stopPropagation()};var selectables=thatReorderer.dom.fastLocate("selectables");for(var i=0;i0&&!dropMarker){dropMarker=createDropMarker(movables[0].tagName)}dropManager.updateGeometry(thatReorderer.layoutHandler.getGeometricInfo());dropManager.dropChangeFirer.addListener(dropChangeListener,"fluid.Reorderer");dropTargets.attr("aria-dropeffect","none")};if(thatReorderer.container){bindHandlersToContainer(thatReorderer.container,thatReorderer.handleKeyDown,thatReorderer.handleKeyUp);addRolesToContainer(thatReorderer);fluid.tabbable(thatReorderer.container);initItems()}if(options.afterMoveCallbackUrl){thatReorderer.events.afterMove.addListener(function(){var layoutHandler=thatReorderer.layoutHandler;var model=layoutHandler.getModel?layoutHandler.getModel():options.acquireModel(thatReorderer);$.post(options.afterMoveCallbackUrl,JSON.stringify(model))},"postModel")}thatReorderer.events.onHover.addListener(hoverStyleHandler,"style");thatReorderer.refresh=function(){thatReorderer.dom.refresh("movables");thatReorderer.dom.refresh("selectables");thatReorderer.dom.refresh("grabHandle",thatReorderer.dom.fastLocate("movables"));thatReorderer.dom.refresh("stylisticOffset",thatReorderer.dom.fastLocate("movables"));thatReorderer.dom.refresh("dropTargets");thatReorderer.events.onRefresh.fire();initItems();thatReorderer.selectableContext.selectables=thatReorderer.dom.fastLocate("selectables");thatReorderer.selectableContext.selectablesUpdated(thatReorderer.activeItem)};fluid.initDependents(thatReorderer);thatReorderer.refresh();return thatReorderer};fluid.reorderer.keys={TAB:9,ENTER:13,SHIFT:16,CTRL:17,ALT:18,META:19,SPACE:32,LEFT:37,UP:38,RIGHT:39,DOWN:40,i:73,j:74,k:75,m:77};fluid.reorderer.defaultKeysets=[{modifier:function(evt){return evt.ctrlKey},up:fluid.reorderer.keys.UP,down:fluid.reorderer.keys.DOWN,right:fluid.reorderer.keys.RIGHT,left:fluid.reorderer.keys.LEFT},{modifier:function(evt){return evt.ctrlKey},up:fluid.reorderer.keys.i,down:fluid.reorderer.keys.m,right:fluid.reorderer.keys.k,left:fluid.reorderer.keys.j}];fluid.reorderer.roles={GRID:{container:"grid",item:"gridcell"},LIST:{container:"list",item:"listitem"},REGIONS:{container:"main",item:"article"}};var simpleInit=function(container,layoutHandler,options){options=options||{};options.layoutHandler=layoutHandler;return fluid.reorderer(container,options)};fluid.reorderList=function(container,options){return simpleInit(container,"fluid.listLayoutHandler",options)};fluid.reorderGrid=function(container,options){return simpleInit(container,"fluid.gridLayoutHandler",options)};fluid.reorderer.SHUFFLE_GEOMETRIC_STRATEGY="shuffleProjectFrom";fluid.reorderer.GEOMETRIC_STRATEGY="projectFrom";fluid.reorderer.LOGICAL_STRATEGY="logicalFrom";fluid.reorderer.WRAP_LOCKED_STRATEGY="lockedWrapFrom";fluid.reorderer.NO_STRATEGY=null;fluid.reorderer.relativeInfoGetter=function(orientation,coStrategy,contraStrategy,dropManager,dom,disableWrap){return function(item,direction,forSelection){var dirorient=fluid.directionOrientation(direction);var strategy=dirorient===orientation?coStrategy:contraStrategy;return strategy!==null?dropManager[strategy](item,direction,forSelection,disableWrap):null}};fluid.defaults("fluid.reorderer",{styles:{defaultStyle:"fl-reorderer-movable-default",selected:"fl-reorderer-movable-selected",dragging:"fl-reorderer-movable-dragging",mouseDrag:"fl-reorderer-movable-dragging",hover:"fl-reorderer-movable-hover",dropMarker:"fl-reorderer-dropMarker",avatar:"fl-reorderer-avatar"},selectors:{dropWarning:".flc-reorderer-dropWarning",movables:".flc-reorderer-movable",grabHandle:"",stylisticOffset:""},avatarCreator:defaultAvatarCreator,keysets:fluid.reorderer.defaultKeysets,layoutHandler:{type:"fluid.listLayoutHandler"},events:{onShowKeyboardDropWarning:null,onSelect:null,onBeginMove:"preventable",onMove:null,afterMove:null,onHover:null,onRefresh:null},mergePolicy:{keysets:"replace","selectors.labelSource":"selectors.grabHandle","selectors.selectables":"selectors.movables","selectors.dropTargets":"selectors.movables"},components:{labeller:{type:"fluid.reorderer.labeller",options:{dom:"{reorderer}.dom",getGeometricInfo:"{reorderer}.layoutHandler.getGeometricInfo",orientation:"{reorderer}.options.orientation",layoutType:"{reorderer}.options.layoutHandler"}}},disableWrap:false});fluid.reorderer.makeGeometricInfoGetter=function(orientation,sentinelize,dom){return function(){var that={sentinelize:sentinelize,extents:[{orientation:orientation,elements:dom.fastLocate("dropTargets")}],elementMapper:function(element){return $.inArray(element,dom.fastLocate("movables"))===-1?"locked":null},elementIndexer:function(element){var selectables=dom.fastLocate("selectables");return{elementClass:that.elementMapper(element),index:$.inArray(element,selectables),length:selectables.length}}};return that}};fluid.defaults(true,"fluid.listLayoutHandler",{orientation:fluid.orientation.VERTICAL,containerRole:fluid.reorderer.roles.LIST,selectablesTabindex:-1,sentinelize:true});fluid.listLayoutHandler=function(container,options,dropManager,dom){var that={};that.getRelativePosition=fluid.reorderer.relativeInfoGetter(options.orientation,fluid.reorderer.LOGICAL_STRATEGY,null,dropManager,dom,options.disableWrap);that.getGeometricInfo=fluid.reorderer.makeGeometricInfoGetter(options.orientation,options.sentinelize,dom);return that};fluid.defaults(true,"fluid.gridLayoutHandler",{orientation:fluid.orientation.HORIZONTAL,containerRole:fluid.reorderer.roles.GRID,selectablesTabindex:-1,sentinelize:false});fluid.gridLayoutHandler=function(container,options,dropManager,dom){var that={};that.getRelativePosition=fluid.reorderer.relativeInfoGetter(options.orientation,options.disableWrap?fluid.reorderer.SHUFFLE_GEOMETRIC_STRATEGY:fluid.reorderer.LOGICAL_STRATEGY,fluid.reorderer.SHUFFLE_GEOMETRIC_STRATEGY,dropManager,dom,options.disableWrap);that.getGeometricInfo=fluid.reorderer.makeGeometricInfoGetter(options.orientation,options.sentinelize,dom);return that};fluid.defaults("fluid.reorderer.labeller",{strings:{overallTemplate:"%recentStatus %item %position %movable",position:"%index of %length",position_moduleLayoutHandler:"%index of %length in %moduleCell %moduleIndex of %moduleLength",moduleCell_0:"row",moduleCell_1:"column",movable:"movable",fixed:"fixed",recentStatus:"moved from position %position"},components:{resolver:{type:"fluid.messageResolver",options:{messageBase:"{labeller}.options.strings"}}},invokers:{renderLabel:{funcName:"fluid.reorderer.labeller.renderLabel",args:["{labeller}","@0","@1"]}}});fluid.reorderer.indexRebaser=function(indices){indices.index++;if(indices.moduleIndex!==undefined){indices.moduleIndex++}return indices};fluid.reorderer.labeller=function(options){var that=fluid.initLittleComponent("fluid.reorderer.labeller",options);fluid.initDependents(that);that.dom=that.options.dom;that.moduleCell=that.resolver.resolve("moduleCell_"+that.options.orientation);var layoutType=fluid.computeNickName(that.options.layoutType);that.positionTemplate=that.resolver.lookup(["position_"+layoutType,"position"]);var movedMap={};that.returnedOptions={listeners:{onRefresh:function(){var selectables=that.dom.locate("selectables");fluid.each(selectables,function(selectable){var labelOptions={};var id=fluid.allocateSimpleId(selectable);var moved=movedMap[id];var label=that.renderLabel(selectable);var plainLabel=label;if(moved){moved.newRender=plainLabel;label=that.renderLabel(selectable,moved.oldRender.position);$(selectable).one("focusout",function(){if(movedMap[id]){var oldLabel=movedMap[id].newRender.label;delete movedMap[id];fluid.updateAriaLabel(selectable,oldLabel)}});labelOptions.dynamicLabel=true}fluid.updateAriaLabel(selectable,label.label,labelOptions)})},onMove:function(item,newPosition){fluid.clear(movedMap);var movingId=fluid.allocateSimpleId(item);movedMap[movingId]={oldRender:that.renderLabel(item)}}}};return that};fluid.reorderer.labeller.renderLabel=function(that,selectable,recentPosition){var geom=that.options.getGeometricInfo();var indices=fluid.reorderer.indexRebaser(geom.elementIndexer(selectable));indices.moduleCell=that.moduleCell;var elementClass=geom.elementMapper(selectable);var labelSource=that.dom.locate("labelSource",selectable);var recentStatus;if(recentPosition){recentStatus=that.resolver.resolve("recentStatus",{position:recentPosition})}var topModel={item:typeof (labelSource)==="string"?labelSource:fluid.dom.getElementText(fluid.unwrap(labelSource)),position:that.positionTemplate.resolveFunc(that.positionTemplate.template,indices),movable:that.resolver.resolve(elementClass==="locked"?"fixed":"movable"),recentStatus:recentStatus||""};var template=that.resolver.lookup(["overallTemplate"]);var label=template.resolveFunc(template.template,topModel);return{position:topModel.position,label:label}}})(jQuery,fluid_1_4);var fluid_1_4=fluid_1_4||{};(function($,fluid){var deriveLightboxCellBase=function(namebase,index){return namebase+"lightbox-cell:"+index+":"};var addThumbnailActivateHandler=function(container){var enterKeyHandler=function(evt){if(evt.which===fluid.reorderer.keys.ENTER){var thumbnailAnchors=$("a",evt.target);document.location=thumbnailAnchors.attr("href")}};container.keypress(enterKeyHandler)};var seekNodesById=function(rootnode,tagname,idmatch){var inputs=rootnode.getElementsByTagName(tagname);var togo=[];for(var i=0;iform #virtualBufferForm").parent().remove();this._original_destroy()},_updateVirtualBuffer:function(){var form=$("body>form #virtualBufferForm");if(form.length){if(form.val()=="1"){form.val("0")}else{form.val("1")}if(form.hasClass("ui-accessibility-odd")){form.addClass("ui-accessibility-even").removeClass("ui-accessibility-odd")}else{form.addClass("ui-accessibility-odd").removeClass("ui-accessibility-even")}}else{$("body").append('
    ')}}})})(jQuery);var fluid_1_4=fluid_1_4||{};(function($,fluid){fluid.defaults("fluid.tabs",{gradeNames:["fluid.viewComponent","autoInit"],tabOptions:{},events:{tabsselect:"preventable",tabsload:null,tabsshow:null},finalInitFunction:"fluid.tabs.finalInit"});fluid.tabs.finalInit=function(that){that.container.tabs(that.options.tabOptions);fluid.each(that.options.events,function(value,eventName){that.container.bind(eventName,function(event,ui){return that.events[eventName].fire(that,event,ui)})})}})(jQuery,fluid_1_4);var fluid_1_4=fluid_1_4||{};(function($,fluid){fluid.registerNamespace("fluid.tableOfContents");fluid.tableOfContents.insertAnchor=function(name,element){$("",{name:name,id:name}).insertBefore(element)};fluid.tableOfContents.generateGUID=function(){return fluid.allocateSimpleId()};fluid.tableOfContents.filterHeadings=function(headings){return headings.filter(":visible")};fluid.tableOfContents.finalInit=function(that){var headings=that.filterHeadings(that.locate("headings"));that.headingTextToAnchor=function(heading){var guid=that.generateGUID();var anchorInfo={id:guid,url:"#"+guid};that.insertAnchor(anchorInfo.id,heading);return anchorInfo};that.anchorInfo=fluid.transform(headings,function(heading){return that.headingTextToAnchor(heading)});that.hide=function(){that.locate("tocContainer").hide()};that.show=function(){that.locate("tocContainer").show()};that.model=that.modelBuilder.assembleModel(headings,that.anchorInfo);that.events.onReady.fire()};fluid.defaults("fluid.tableOfContents",{gradeNames:["fluid.viewComponent","autoInit"],finalInitFunction:"fluid.tableOfContents.finalInit",components:{levels:{type:"fluid.tableOfContents.levels",container:"{tableOfContents}.dom.tocContainer",createOnEvent:"onReady",options:{model:{headings:"{tableOfContents}.model"},events:{afterRender:"{tableOfContents}.events.afterRender"}}},modelBuilder:{type:"fluid.tableOfContents.modelBuilder"}},invokers:{insertAnchor:"fluid.tableOfContents.insertAnchor",generateGUID:"fluid.tableOfContents.generateGUID",filterHeadings:"fluid.tableOfContents.filterHeadings"},selectors:{headings:":header",tocContainer:".flc-toc-tocContainer"},events:{onReady:null,afterRender:null}});fluid.registerNamespace("fluid.tableOfContents.modelBuilder");fluid.tableOfContents.modelBuilder.toModel=function(headingInfo,modelLevelFn){var headings=fluid.copy(headingInfo);var buildModelLevel=function(headings,level){var modelLevel=[];while(headings.length>0){var heading=headings[0];if(heading.levellevel){var subHeadings=buildModelLevel(headings,level+1);if(modelLevel.length>0){modelLevel[modelLevel.length-1].headings=subHeadings}else{modelLevel=modelLevelFn(modelLevel,subHeadings)}}if(heading.level===level){modelLevel.push(heading);headings.shift()}}return modelLevel};return buildModelLevel(headings,1)};fluid.tableOfContents.modelBuilder.gradualModelLevelFn=function(modelLevel,subHeadings){var subHeadingsClone=fluid.copy(subHeadings);subHeadingsClone[0].level--;return subHeadingsClone};fluid.tableOfContents.modelBuilder.skippedModelLevelFn=function(modelLevel,subHeadings){modelLevel.push({headings:subHeadings});return modelLevel};fluid.tableOfContents.modelBuilder.finalInit=function(that){that.convertToHeadingObjects=function(headings,anchorInfo){headings=$(headings);return fluid.transform(headings,function(heading,index){return{level:that.headingCalculator.getHeadingLevel(heading),text:$(heading).text(),url:anchorInfo[index].url}})};that.assembleModel=function(headings,anchorInfo){var headingInfo=that.convertToHeadingObjects(headings,anchorInfo);return that.toModel(headingInfo)}};fluid.defaults("fluid.tableOfContents.modelBuilder",{gradeNames:["fluid.littleComponent","autoInit"],finalInitFunction:"fluid.tableOfContents.modelBuilder.finalInit",components:{headingCalculator:{type:"fluid.tableOfContents.modelBuilder.headingCalculator"}},invokers:{toModel:{funcName:"fluid.tableOfContents.modelBuilder.toModel",args:["{arguments}.0","{modelBuilder}.modelLevelFn"]},modelLevelFn:"fluid.tableOfContents.modelBuilder.gradualModelLevelFn"}});fluid.registerNamespace("fluid.tableOfContents.modelBuilder.headingCalculator");fluid.tableOfContents.modelBuilder.headingCalculator.finalInit=function(that){that.getHeadingLevel=function(heading){return $.inArray(heading.tagName,that.options.levels)+1}};fluid.defaults("fluid.tableOfContents.modelBuilder.headingCalculator",{gradeNames:["fluid.littleComponent","autoInit"],finalInitFunction:"fluid.tableOfContents.modelBuilder.headingCalculator.finalInit",levels:["H1","H2","H3","H4","H5","H6"]});fluid.registerNamespace("fluid.tableOfContents.levels");fluid.tableOfContents.levels.finalInit=function(that){fluid.fetchResources(that.options.resources,function(){that.container.append(that.options.resources.template.resourceText);that.refreshView()})};fluid.tableOfContents.levels.objModel=function(type,ID){var objModel={ID:type+ID+":",children:[]};return objModel};fluid.tableOfContents.levels.handleEmptyItemObj=function(itemObj){itemObj.decorators=[{type:"addClass",classes:"fl-tableOfContents-hide-bullet"}]};fluid.tableOfContents.levels.generateTree=function(headingsModel,currentLevel){currentLevel=currentLevel||0;var levelObj=fluid.tableOfContents.levels.objModel("level",currentLevel);if(headingsModel.headings.length===0){return[]}if(currentLevel===0){var tree={children:[fluid.tableOfContents.levels.generateTree(headingsModel,currentLevel+1)]};return tree}$.each(headingsModel.headings,function(index,model){var itemObj=fluid.tableOfContents.levels.objModel("items",currentLevel);var linkObj={ID:"link"+currentLevel,target:model.url,linktext:model.text};if(!model.level){fluid.tableOfContents.levels.handleEmptyItemObj(itemObj)}else{itemObj.children.push(linkObj)}if(model.headings){itemObj.children.push(fluid.tableOfContents.levels.generateTree(model,currentLevel+1))}levelObj.children.push(itemObj)});return levelObj};fluid.tableOfContents.levels.produceTree=function(that){return fluid.tableOfContents.levels.generateTree(that.model)};fluid.defaults("fluid.tableOfContents.levels",{gradeNames:["fluid.rendererComponent","autoInit"],finalInitFunction:"fluid.tableOfContents.levels.finalInit",produceTree:"fluid.tableOfContents.levels.produceTree",selectors:{level1:".flc-toc-levels-level1",level2:".flc-toc-levels-level2",level3:".flc-toc-levels-level3",level4:".flc-toc-levels-level4",level5:".flc-toc-levels-level5",level6:".flc-toc-levels-level6",items1:".flc-toc-levels-items1",items2:".flc-toc-levels-items2",items3:".flc-toc-levels-items3",items4:".flc-toc-levels-items4",items5:".flc-toc-levels-items5",items6:".flc-toc-levels-items6",link1:".flc-toc-levels-link1",link2:".flc-toc-levels-link2",link3:".flc-toc-levels-link3",link4:".flc-toc-levels-link4",link5:".flc-toc-levels-link5",link6:".flc-toc-levels-link6"},repeatingSelectors:["level1","level2","level3","level4","level5","level6","items1","items2","items3","items4","items5","items6"],model:{headings:[]},resources:{template:{forceCache:true,url:"../html/TableOfContents.html"}},rendererFnOptions:{noexpand:true},rendererOptions:{debugMode:false}})})(jQuery,fluid_1_4);var fluid_1_4=fluid_1_4||{};(function($,fluid){fluid.generate=function(n,generator){var togo=[];for(var i=0;i0){var top=segs.length-1;var dotpos=segs[top].indexOf(".");if(dotpos!==-1){togo.extension=segs[top].substring(dotpos+1);segs[top]=segs[top].substring(0,dotpos)}}togo.pathInfo=segs;return togo};fluid.url.parsePathInfoTrim=function(pathInfo){var togo=fluid.url.parsePathInfo(pathInfo);if(togo.pathInfo[togo.pathInfo.length-1]===""){togo.pathInfo.length--}return togo};fluid.url.collapseSegs=function(segs,from,to){var togo="";if(from===undefined){from=0}if(to===undefined){to=segs.length}for(var i=from;ifrom){togo+=segs[to-1]}return togo};fluid.url.makeRelPath=function(parsed,index){var togo=fluid.kettle.collapseSegs(parsed.pathInfo,index);if(parsed.extension){togo+="."+parsed.extension}return togo};fluid.url.cononocolosePath=function(pathInfo){var consume=0;for(var i=0;i0){startIndex=cookie.indexOf(cookiePrefix);if(startIndex>-1){startIndex=startIndex+cookiePrefix.length;endIndex=cookie.indexOf(";",startIndex);if(endIndex0){that.container.css("font-size",that.initialSize*times+"px")}}};fluid.uiEnhancer.textSizer.calcInitSize=function(that){that.initialSize=fluid.uiEnhancer.getTextSize(that.container)};fluid.defaults("fluid.uiEnhancer.classSwapper",{gradeNames:["fluid.viewComponent","autoInit"],invokers:{clearClasses:{funcName:"fluid.uiEnhancer.classSwapper.clearClasses",args:["{classSwapper}"]},swap:{funcName:"fluid.uiEnhancer.classSwapper.swap",args:["@0","{classSwapper}"]}},classes:{},finalInitFunction:"fluid.uiEnhancer.classSwapper.finalInit"});fluid.uiEnhancer.classSwapper.finalInit=function(that){that.classSelector="";that.classStr="";fluid.each(that.options.classes,function(className){if(className){that.classSelector+=that.classSelector?", ."+className:"."+className;that.classStr+=that.classStr?" "+className:className}})};fluid.uiEnhancer.classSwapper.clearClasses=function(that){$(that.classSelector,that.container).add(that.container).removeClass(that.classStr)};fluid.uiEnhancer.classSwapper.swap=function(classname,that){that.clearClasses(that);that.container.addClass(that.options.classes[classname])};fluid.defaults("fluid.uiEnhancer.lineSpacer",{gradeNames:["fluid.viewComponent","autoInit"],invokers:{set:{funcName:"fluid.uiEnhancer.lineSpacer.set",args:["@0","{lineSpacer}"]},calcInitSize:{funcName:"fluid.uiEnhancer.lineSpacer.calcInitSize",args:["{lineSpacer}"]}}});fluid.uiEnhancer.lineSpacer.set=function(times,that){if(!that.initialSize){that.calcInitSize()}var newLineSpacing=times===""||times===1?that.initialSize:times*that.initialSize;that.container.css("line-height",newLineSpacing+"em")};fluid.uiEnhancer.lineSpacer.calcInitSize=function(that){var lineHeight=that.container.css("lineHeight");if(lineHeight==="normal"){return 1}if($.browser.msie){var lineHeightInIE;lineHeightInIE=that.container[0].currentStyle.lineHeight;if(lineHeightInIE.match(/[0-9]$/)){return lineHeightInIE}}that.initialSize=Math.round(parseFloat(lineHeight)/fluid.uiEnhancer.getTextSize(that.container)*100)/100};fluid.pageEnhancer=function(uiEnhancerOptions){var that=fluid.initLittleComponent("fluid.pageEnhancer");that.uiEnhancerOptions=uiEnhancerOptions;fluid.initDependents(that);fluid.staticEnvironment.uiEnhancer=that.uiEnhancer;return that};fluid.defaults("fluid.pageEnhancer",{gradeNames:["fluid.littleComponent"],components:{uiEnhancer:{type:"fluid.uiEnhancer",container:"body",options:"{pageEnhancer}.uiEnhancerOptions"}}});fluid.demands("fluid.uiOptions.store",["fluid.uiEnhancer"],{funcName:"fluid.cookieStore"})})(jQuery,fluid_1_4);var fluid_1_4=fluid_1_4||{};(function($,fluid){fluid.defaults("fluid.textfieldSlider",{gradeNames:["fluid.viewComponent","autoInit"],components:{textfield:{type:"fluid.textfieldSlider.textfield",container:"{textfieldSlider}.dom.textfield",options:{model:"{textfieldSlider}.model",applier:"{textfieldSlider}.applier"}},slider:{type:"fluid.textfieldSlider.slider",container:"{textfieldSlider}.dom.slider",options:{model:"{textfieldSlider}.model",applier:"{textfieldSlider}.applier"}}},selectors:{textfield:".flc-textfieldSlider-field",slider:".flc-textfieldSlider-slider"},events:{modelChanged:null},model:{value:null,min:0,max:100},sliderOptions:{orientation:"horizontal",step:0.1},finalInitFunction:"fluid.textfieldSlider.finalInit"});fluid.textfieldSlider.finalInit=function(that){var sliderOptions=$.extend(true,{},that.options.sliderOptions,that.model);that.slider.initSlider(sliderOptions);that.refreshView=function(){var val=that.model.value;that.textfield.container.val(val);that.slider.setSliderValue(val);that.slider.setSliderAria(val)};that.applier.modelChanged.addListener("value",function(newModel){that.events.modelChanged.fire(newModel.value)});that.events.modelChanged.addListener(that.refreshView);that.refreshView()};fluid.defaults("fluid.textfieldSlider.textfield",{gradeNames:["fluid.viewComponent","autoInit"],finalInitFunction:"fluid.textfieldSlider.textfield.finalInit"});fluid.textfieldSlider.validateValue=function(model,changeRequest,applier){var oldValue=model.value;var newValue=changeRequest.value;var isValidNum=!isNaN(parseInt(newValue,10));if(isValidNum){if(newValuemodel.max){newValue=model.max}}changeRequest.value=newValue}else{changeRequest.value=oldValue}};fluid.textfieldSlider.textfield.finalInit=function(that){that.applier.guards.addListener({path:"value",transactional:true},fluid.textfieldSlider.validateValue);that.container.change(function(source){that.applier.requestChange("value",source.target.value)})};fluid.defaults("fluid.textfieldSlider.slider",{gradeNames:["fluid.viewComponent","autoInit"],finalInitFunction:"fluid.textfieldSlider.slider.finalInit",selectors:{thumb:".ui-slider-handle"}});var initSliderAria=function(thumb,opts){var ariaDefaults={role:"slider","aria-valuenow":opts.value,"aria-valuemin":opts.min,"aria-valuemax":opts.max};thumb.attr(ariaDefaults)};fluid.textfieldSlider.slider.finalInit=function(that){that.slider=that.container.slider(that.model);that.initSlider=function(sliderOptions){var slider=that.slider.slider(sliderOptions);initSliderAria(that.locate("thumb"),sliderOptions)};that.setSliderValue=function(value){that.slider.slider("value",value)};that.setSliderAria=function(value){that.locate("thumb").attr("aria-valuenow",value)};that.slider.bind("slide",function(e,ui){that.applier.requestChange("value",ui.value)})}})(jQuery,fluid_1_4);(function($,fluid){fluid.defaults("fluid.uiOptions.inline",{gradeNames:["fluid.viewComponent"],components:{uiOptionsLoader:{type:"fluid.uiOptions.loader"},templateLoader:{priority:"first",type:"fluid.uiOptions.templateLoader"}},uiOptionsTransform:{transformer:"fluid.uiOptions.mapOptions",config:{"*.templateLoader":"templateLoader","*.templateLoader.*.templatePath.options.value":"prefix","*.uiOptionsLoader.container":"container","*.uiOptionsLoader.*.uiOptions":"uiOptions","*.uiOptionsLoader.*.uiOptions.*.textControls":"textControls","*.uiOptionsLoader.*.uiOptions.*.layoutControls":"layoutControls","*.uiOptionsLoader.*.uiOptions.*.linksControls":"linksControls","*.uiOptionsLoader.*.uiOptions.*.preview":"preview","*.uiOptionsLoader.*.uiOptions.*.preview.*.enhancer":"previewEnhancer"}}});fluid.uiOptions.sortByKeyLength=function(inObject){var keys=[];var outObject={};for(var k in inObject){keys.push(k)}keys.sort(function(a,b){if(a.length>b.length){return 1}else{if(a.length0){saveButton.click(that.saveAndApply);var form=fluid.findForm(saveButton);$(form).submit(function(){that.saveAndApply()})}that.locate("reset").click(that.reset);that.locate("cancel").click(that.cancel)};var bindEventHandlers=function(that){that.events.onAutoSave.addListener(function(){that.save()})};fluid.fetchResources(that.options.resources,function(){that.container.append(that.options.resources.template.resourceText);bindHandlers(that);bindEventHandlers(that);that.events.onUIOptionsComponentReady.fire(that)})};fluid.defaults("fluid.uiOptions.eventBinder",{gradeNames:["fluid.eventedComponent","autoInit"]});var initModel=function(that){fluid.each(that.options.controlValues,function(item,key){that.applier.requestChange("labelMap."+key,{values:that.options.controlValues[key],names:that.options.strings[key],classes:that.options.classnameMap[key]})})};var createSliderNode=function(that,item){return{decorators:{type:"fluid",func:"fluid.textfieldSlider",options:{listeners:{modelChanged:function(value){that.applier.requestChange("selections."+item,value)}},model:{min:that.options[item].min,max:that.options[item].max,value:that.model.selections[item]}}}}};fluid.uiOptions.controlsFinalInit=function(that){initModel(that);that.refreshView()};fluid.uiOptions.lateRefreshViewBinder=function(that){that.refreshView=function(){that.renderer.refreshView()}};fluid.defaults("fluid.uiOptions.textControls",{gradeNames:["fluid.rendererComponent","autoInit"],strings:{textFont:["Default","Times New Roman","Comic Sans","Arial","Verdana"],theme:["Default","Black on white","White on black","Black on yellow","Yellow on black"]},controlValues:{textFont:["default","times","comic","arial","verdana"],theme:["default","bw","wb","by","yb"]},textSize:{min:1,max:2},lineSpacing:{min:1,max:2},selectors:{textFont:".flc-uiOptions-text-font",theme:".flc-uiOptions-theme",textSize:".flc-uiOptions-min-text-size",lineSpacing:".flc-uiOptions-line-spacing"},events:{onUIOptionsRefresh:null},listeners:{onUIOptionsRefresh:"{textControls}.refreshView"},preInitFunction:"fluid.uiOptions.lateRefreshViewBinder",finalInitFunction:"fluid.uiOptions.controlsFinalInit",produceTree:"fluid.uiOptions.textControls.produceTree",resources:{template:"{templateLoader}.resources.textControls"}});fluid.uiOptions.textControls.produceTree=function(that){var tree={};for(var item in that.model.selections){if(item==="textFont"||item==="theme"){tree[item]={optionnames:"${labelMap."+item+".names}",optionlist:"${labelMap."+item+".values}",selection:"${selections."+item+"}",decorators:{type:"fluid",func:"fluid.uiOptions.selectDecorator",options:{styles:that.options.classnameMap[item]}}}}else{if(item==="textSize"||item==="lineSpacing"){tree[item]=createSliderNode(that,item)}}}return tree};fluid.demands("fluid.uiOptions.selectDecorator","fluid.uiOptions",{container:"{arguments}.0"});fluid.defaults("fluid.uiOptions.selectDecorator",{gradeNames:["fluid.viewComponent","autoInit"],finalInitFunction:"fluid.uiOptions.selectDecorator.finalInit"});fluid.uiOptions.selectDecorator.finalInit=function(that){fluid.each($("option",that.container),function(option){option.className=that.options.styles[fluid.value(option)]})};fluid.defaults("fluid.uiOptions.layoutControls",{gradeNames:["fluid.rendererComponent","autoInit"],selectors:{layout:".flc-uiOptions-layout",toc:".flc-uiOptions-toc"},events:{onUIOptionsRefresh:null},listeners:{onUIOptionsRefresh:"{layoutControls}.refreshView"},preInitFunction:"fluid.uiOptions.lateRefreshViewBinder",finalInitFunction:"fluid.uiOptions.controlsFinalInit",produceTree:"fluid.uiOptions.layoutControls.produceTree",resources:{template:"{templateLoader}.resources.layoutControls"}});fluid.uiOptions.layoutControls.produceTree=function(that){var tree={};for(var item in that.model.selections){if(item==="layout"||item==="toc"){tree[item]="${selections."+item+"}"}}return tree};fluid.defaults("fluid.uiOptions.linksControls",{gradeNames:["fluid.rendererComponent","autoInit"],selectors:{links:".flc-uiOptions-links",inputsLarger:".flc-uiOptions-inputs-larger"},events:{onUIOptionsRefresh:null},listeners:{onUIOptionsRefresh:"{linksControls}.refreshView"},preInitFunction:"fluid.uiOptions.lateRefreshViewBinder",finalInitFunction:"fluid.uiOptions.controlsFinalInit",produceTree:"fluid.uiOptions.linksControls.produceTree",resources:{template:"{templateLoader}.resources.linksControls"}});fluid.uiOptions.linksControls.produceTree=function(that){var tree={};for(var item in that.model.selections){if(item==="links"||item==="inputsLarger"){tree[item]="${selections."+item+"}"}}return tree};fluid.defaults("fluid.uiOptions.preview",{gradeNames:["fluid.viewComponent","autoInit"],components:{enhancer:{type:"fluid.uiEnhancer",createOnEvent:"onReady",options:{settingsStore:{type:"fluid.uiEnhancer.tempStore"}}},eventBinder:{type:"fluid.uiOptions.preview.eventBinder",createOnEvent:"onReady"}},invokers:{updateModel:{funcName:"fluid.uiOptions.preview.updateModel",args:["{preview}","{uiOptions}.model.selections"]}},finalInitFunction:"fluid.uiOptions.preview.finalInit",events:{onReady:null},templateUrl:"UIOptionsPreview.html"});fluid.uiOptions.preview.updateModel=function(that,selections){setTimeout(function(){if(that.enhancer){that.enhancer.updateModel(selections)}},0)};fluid.uiOptions.preview.finalInit=function(that){that.container.attr("src",that.options.templateUrl);that.container.load(function(){that.enhancerContainer=$("body",that.container.contents());that.events.onReady.fire()})};fluid.demands("fluid.uiEnhancer","fluid.uiOptions.preview",{funcName:"fluid.uiEnhancer",args:["{preview}.enhancerContainer","{options}"]});fluid.defaults("fluid.uiOptions.preview.eventBinder",{gradeNames:["fluid.eventedComponent","autoInit"]});fluid.demands("fluid.uiOptions.preview.eventBinder",["fluid.uiOptions.preview","fluid.uiOptions"],{options:{listeners:{"{uiOptions}.events.modelChanged":"{preview}.updateModel"}}})})(jQuery,fluid_1_4);var fluid_1_4=fluid_1_4||{};(function($,fluid){fluid.defaults("fluid.uiOptions.fatPanelEventBinder",{gradeNames:["fluid.eventedComponent","autoInit"],finalInitFunction:"fluid.uiOptions.fatPanelEventBinder.finalInit",components:{uiOptionsLoader:{type:"fluid.uiOptions.loader"},slidingPanel:{type:"fluid.slidingPanel"}}});fluid.defaults("fluid.uiOptions.fatPanelEventBinder.binder",{gradeNames:["fluid.eventedComponent","autoInit"]});fluid.registerNamespace("fluid.dom");fluid.dom.getDocumentHeight=function(dokkument){var body=$("body",dokkument)[0];return body.offsetHeight};fluid.uiOptions.fatPanelEventBinder.updateView=function(uiOptions){uiOptions.uiEnhancer.updateFromSettingsStore();uiOptions.events.onSignificantDOMChange.fire()};fluid.uiOptions.fatPanelEventBinder.bindLateEvents=function(uiOptions,eventBinder,fatPanel){eventBinder.uiOptions=uiOptions;uiOptions.events.modelChanged.addListener(function(model){eventBinder.uiEnhancer.updateModel(model.selections);uiOptions.save()});uiOptions.events.onReset.addListener(function(uiOptions){fluid.uiOptions.fatPanelEventBinder.updateView(uiOptions)});uiOptions.events.onSignificantDOMChange.addListener(function(){var dokkument=uiOptions.container[0].ownerDocument;var height=fluid.dom.getDocumentHeight(dokkument);var iframe=fatPanel.markupRenderer.iframe;var attrs={height:height+15};iframe.animate(attrs,400)});fatPanel.slidingPanel.events.afterPanelHide.addListener(function(){fatPanel.markupRenderer.iframe.height(0)})};fluid.uiOptions.fatPanelEventBinder.finalInit=function(that){that.slidingPanel.events.afterPanelShow.addListener(function(){fluid.uiOptions.fatPanelEventBinder.updateView(that.uiOptions)})};fluid.uiOptions.fatPanelEventBinder.showPanel=function(panel,callback){panel.show();callback()};fluid.defaults("fluid.uiOptions.fatPanel",{gradeNames:["fluid.viewComponent"],selectors:{iframe:".flc-uiOptions-iframe"},relativePrefix:"./",components:{slidingPanel:{type:"fluid.slidingPanel",container:"{fatPanel}.container",options:{invokers:{operateShow:{funcName:"fluid.uiOptions.fatPanelEventBinder.showPanel"}}},createOnEvent:"afterRender"},markupRenderer:{type:"fluid.uiOptions.renderIframe",container:"{fatPanel}.dom.iframe",options:{markupProps:{src:"%prefix/FatPanelUIOptionsFrame.html"},events:{afterRender:"{fatPanel}.events.afterRender"}}},uiEnhancer:"{uiEnhancer}",eventBinder:{type:"fluid.uiOptions.fatPanelEventBinder",options:{components:{uiEnhancer:"{fatPanel}.uiEnhancer",uiOptionsLoader:"{fatPanel}.bridge.uiOptionsLoader",slidingPanel:"{fatPanel}.slidingPanel",binder:{type:"fluid.uiOptions.fatPanelEventBinder.binder",priority:"last",options:{events:{onUIOptionsComponentReady:{event:"{uiOptionsLoader}.events.onUIOptionsComponentReady",args:["{arguments}.0","{fluid.uiOptions.fatPanelEventBinder}","{fatPanel}"]}},listeners:{onUIOptionsComponentReady:fluid.uiOptions.fatPanelEventBinder.bindLateEvents}}}}},createOnEvent:"afterRender",priority:"last"},bridge:{type:"fluid.uiOptions.bridge",createOnEvent:"afterRender",priority:"first",options:{components:{markupRenderer:"{fatPanel}.markupRenderer"}}}},uiOptionsTransform:{transformer:"fluid.uiOptions.mapOptions",config:{"*.slidingPanel":"slidingPanel","*.markupRenderer":"markupRenderer","*.markupRenderer.options.prefix":"prefix","*.eventBinder":"eventBinder","selectors.iframe":"iframe","*.bridge.options.templateLoader":"templateLoader","*.bridge.options.prefix":"relativePrefix","*.bridge.options.uiOptions":"uiOptions","*.bridge.options.textControls":"textControls","*.bridge.options.layoutControls":"layoutControls","*.bridge.options.linksControls":"linksControls"}},events:{afterRender:null}});fluid.defaults("fluid.uiOptions.renderIframe",{gradeNames:["fluid.viewComponent","autoInit"],finalInitFunction:"fluid.uiOptions.renderIframe.finalInit",events:{afterRender:null},styles:{containerFlex:"fl-container-flex",container:"fl-uiOptions-fatPanel-iframe"},prefix:"./",markupProps:{style:"overflow-x:hidden; overflow-y:auto;","class":"flc-iframe",src:"%prefix/uiOptionsIframe.html"}});fluid.uiOptions.renderIframe.finalInit=function(that){var styles=that.options.styles;that.options.markupProps=fluid.uiOptions.transformUrls(that.options.markupProps,that.options.prefix);that.iframeSrc=that.options.markupProps.src;that.iframe=$("