text: /*!
   * Fluid Infusion v1.3
   *
   * Infusion is distributed under the Educational Community License 2.0 and new BSD licenses: 
   * http://wiki.fluidproject.org/display/fluid/Fluid+Licensing
   *
   * For information on copyright, see the individual Infusion source code files: 
   * https://source.fluidproject.org/svn/fluid/infusion/
   */
  var fluid_1_4=fluid_1_4||{};var fluid=fluid||fluid_1_4;(function(a,b){b.version="Infusion 1.3";b.environment={fluid:b};var c=window||{};var e=[false];b.describeActivity=function(){return[]};b.fail=function(l){b.setLogging(true);b.log.apply(null,["ASSERTION FAILED: "].concat(b.makeArray(arguments)).concat(b.describeActivity()));if(e[0]){throw new Error(l)}else{l.fail()}};b.pushSoftFailure=function(l){if(typeof(l)==="boolean"){e.unshift(l)}else{if(l===-1){e.shift()}}};b.notrycatch=false;b.tryCatch=function(p,l,n){n=n||b.identity;if(b.notrycatch){var m=p();n();return m}else{try{return p()}catch(o){if(l){l(o)}else{throw (o)}}finally{n()}}};b.expect=function(m,l,n){b.transform(b.makeArray(l),function(o){if(typeof n[o]==="undefined"){b.fail(m+" missing required parameter "+o)}})};var k;b.isLogging=function(){return k};b.setLogging=function(l){if(typeof l==="boolean"){k=l}else{k=false}};b.applyHostFunction=function(o,n,m){if(n.apply){n.apply(o,m)}else{var l=Function.prototype.bind.call(n,o);l.apply(o,m)}};b.log=function(n){if(k){var m=b.renderTimestamp(new Date())+":  ";var l=[m].concat(b.makeArray(arguments));var o=l.join("");if(typeof(console)!=="undefined"){if(console.debug){b.applyHostFunction(console,console.debug,l)}else{if(typeof(console.log)==="function"){b.applyHostFunction(console,console.log,l)}else{console.log(o)}}}else{if(typeof(YAHOO)!=="undefined"){YAHOO.log(o)}else{if(typeof(opera)!=="undefined"){opera.postError(o)}}}}};b.wrap=function(l){return((!l||l.jquery)?l:a(l))};b.unwrap=function(l){return l&&l.jquery&&l.length===1?l[0]:l};b.freshContainer=function(l){return b.isArrayable(l)?[]:{}};b.copy=function(l){if(b.isPrimitive(l)){return l}return a.extend(true,b.freshContainer(l),l)};b.identity=function(l){return l};b.isValue=function(l){return l!==undefined&&l!==null};b.isPrimitive=function(l){var m=typeof(l);return !l||m==="string"||m==="boolean"||m==="number"||m==="function"};b.isDOMNode=function(l){return l&&typeof(l.nodeType)==="number"};b.isArrayable=function(l){return l&&!b.isPrimitive(l)&&typeof(l.length)==="number"};b.makeArray=function(l){if(l===null||l===undefined){return[]}else{return a.makeArray(l)}};function i(q,p,o,n){var l=q[o];for(var m=0;m<n.length-1;++m){l=n[m+1](l,o)}p[o]=l}b.transform=function(o){var n=b.freshContainer(o);if(b.isArrayable(o)){for(var m=0;m<o.length;++m){i(o,n,m,arguments)}}else{for(var l in o){i(o,n,l,arguments)}}return n};b.each=function(o,n){if(b.isArrayable(o)){for(var m=0;m<o.length;++m){n(o[m],m)}}else{for(var l in o){n(o[l],l)}}};b.find=function(p,o,q){var l;if(b.isArrayable(p)){for(var n=0;n<p.length;++n){l=o(p[n],n);if(l!==undefined){return l}}}else{for(var m in p){l=o(p[m],m);if(l!==undefined){return l}}}return q};b.accumulate=function(o,n,l){for(var m=0;m<o.length;++m){l=n(o[m],l,m)}return l};b.remove_if=function(o,n){if(b.isArrayable(o)){for(var m=0;m<o.length;++m){if(n(o[m],m)){o.splice(m,1);--m}}}else{for(var l in o){if(n(o[l],l)){delete o[l]}}}return o};b.filterKeys=function(n,m,l){return b.remove_if(a.extend({},n),function(p,o){return l^(a.inArray(o,m)===-1)})};b.censorKeys=function(l,m){return b.filterKeys(l,m,true)};b.keys=function(m){var l=[];b.each(m,function(o,n){l.push(n)});return l};b.contains=function(m,l){return m?b.find(m,function(n,o){if(l===n){return true}}):undefined};b.keyForValue=function(m,l){return b.find(m,function(n,o){if(l===n){return o}})};b.findKeyInObject=b.keyForValue;b.arrayToHash=function(m){var l={};b.each(m,function(n){l[n]=true});return l};b.clear=function(m){if(m instanceof Array){m.length=0}else{for(var l in m){delete m[l]}}};b.model={};b.VALUE={type:"fluid.marker",value:"VALUE"};b.NO_VALUE={type:"fluid.marker",value:"NO_VALUE"};b.EXPAND={type:"fluid.marker",value:"EXPAND"};b.EXPAND_NOW={type:"fluid.marker",value:"EXPAND_NOW"};b.isMarker=function(l,m){if(!l||typeof(l)!=="object"||l.type!=="fluid.marker"){return false}if(!m){return true}return l===m};b.model.copyModel=function(m,l){b.clear(m);a.extend(true,m,l)};b.model.parseEL=function(l){return l===""?[]:String(l).split(".")};b.model.composePath=function(l,m){return l===""?m:(m===""?l:l+"."+m)};b.model.composeSegments=function(){return a.makeArray(arguments).join(".")};b.path=b.model.composeSegments;b.composePath=b.model.composePath;b.model.environmentStrategy=function(l){return{init:function(){var m=l;return function(n,q,o){var p;if(m&&m[q]){p=m[q]}m=null;return p}}}};b.model.defaultCreatorStrategy=function(l,m){if(l[m]===undefined){l[m]={};return l[m]}};b.model.defaultFetchStrategy=function(l,m){return m===""?l:l[m]};b.model.funcResolverStrategy=function(l,m){if(l.resolvePathSegment){return l.resolvePathSegment(m)}};b.model.applyStrategy=function(o,l,n,m){if(typeof(o)==="function"){return o(l,n,m)}else{if(o&&o.next){return o.next(l,n,m)}}};b.model.initStrategy=function(m,l,n){return m.init?m.init(n?n[l]:undefined):m};b.model.makeTrundler=function(l,m,o){var n={root:l,strategies:b.isArrayable(m)?m:b.transform(m.strategies,function(q,p){return b.model.initStrategy(q,p,o)})};n.trundle=function(r,p){p=p||0;var q=b.model.makeTrundler(n.root,m,n.strategies);q.segs=b.model.parseEL(r);q.index=0;q.step(q.segs.length-p);return q};n.next=function(){if(!n.root){return}var r;for(var p=0;p<n.strategies.length;++p){var q=b.model.applyStrategy(n.strategies[p],n.root,n.segs[n.index],n.index);if(r===undefined){r=q}}if(r===b.NO_VALUE){r=undefined}n.root=r;++n.index};n.step=function(p){for(var q=0;q<p;++q){n.next()}n.last=n.segs[n.index]};return n};b.model.defaultSetConfig={strategies:[b.model.funcResolverStrategy,b.model.defaultFetchStrategy,b.model.defaultCreatorStrategy]};b.model.trundleImpl=function(m,p,n,l){if(typeof(p)==="string"){m=m.trundle(p,l)}else{var o=p.type||"default";var q=n.resolvers[o];if(!q){b.fail("Unable to find resolver of type "+o)}m=q(p,m)||{};if(p.path&&m.trundle&&m.root!==undefined){m=b.model.trundleImpl(m,p.path,n,l)}}return m};b.model.trundle=function(l,p,o,n){p=p||"";o=o||b.model.defaultGetConfig;var m=b.model.makeTrundler(l,o);return b.model.trundleImpl(m,p,o,n)};b.model.getPenultimate=function(l,n,m){return b.model.trundle(l,n,m,1)};b.set=function(l,o,p,n){n=n||b.model.defaultSetConfig;var m=b.model.getPenultimate(l,o,n);m.root[m.last]=p};b.model.defaultGetConfig={strategies:[b.model.funcResolverStrategy,b.model.defaultFetchStrategy]};b.get=function(l,n,m){return b.model.trundle(l,n,m).root};b.model.setBeanValue=b.set;b.model.getBeanValue=b.get;b.getGlobalValue=function(n,m){if(n){m=m||b.environment;var l=b.model.environmentStrategy(m);return b.get(c,n,{strategies:[l].concat(b.model.defaultGetConfig.strategies)})}};b.invokeGlobalFunction=function(m,n,l){var o=b.getGlobalValue(m,l);if(!o){b.fail("Error invoking global function: "+m+" could not be located")}else{return o.apply(null,n)}};b.registerGlobalFunction=function(m,o,n){n=n||b.environment;var l=b.model.environmentStrategy(n);b.set(c,m,o,{strategies:[l].concat(b.model.defaultSetConfig.strategies)})};b.setGlobalValue=b.registerGlobalFunction;b.registerNamespace=function(n,l){l=l||b.environment;var m=b.getGlobalValue(n,l);if(!m){m={};b.setGlobalValue(n,m,l)}return m};b.dumpEl=b.identity;b.renderTimestamp=b.identity;b.registerNamespace("fluid.event");var f=1;b.allocateGuid=function(){return f++};b.event.identifyListener=function(l){if(typeof(l)==="string"){return l}if(!l.$$guid){l.$$guid=b.allocateGuid()}return l.$$guid};b.event.mapPriority=function(l,m){return(l===null||l===undefined?-m:(l==="last"?-Number.MAX_VALUE:(l==="first"?Number.MAX_VALUE:l)))};b.event.listenerComparator=function(m,l){return l.priority-m.priority};b.event.sortListeners=function(l){var m=[];b.each(l,function(n){m.push(n)});return m.sort(b.event.listenerComparator)};b.event.getEventFirer=function(n,o){var m={};var l=[];function p(t,r,x){for(var s in t){var q=t[s];var v=q.listener;if(typeof(v)==="string"){var w=b.getGlobalValue(v);if(!w){b.fail("Unable to look up name "+v+" as a global function")}else{v=q.listener=w}}if(q.predicate&&!q.predicate(v,r)){continue}var u=b.tryCatch(function(){var y=(x?x(v):v).apply(null,r);if(o&&y===false){return false}if(n){return y}},function(y){b.log("FireEvent received exception "+y.message+" e "+y+" firing to listener "+s);throw (y)});if(u!==undefined){return u}}}return{addListener:function(t,s,q,r){if(!t){return}if(n){s="unicast"}if(!s){s=b.event.identifyListener(t)}m[s]={listener:t,predicate:q,priority:b.event.mapPriority(r,l.length)};l=b.event.sortListeners(m)},removeListener:function(q){if(typeof(q)==="string"){delete m[q]}else{if(q.$$guid){delete m[q.$$guid]}}l=b.event.sortListeners(m)},fireToListeners:function(r,q,s){return p(r,q,s)},fire:function(){return p(l,arguments)}}};b.event.addListenerToFirer=function(n,o,m){if(b.isArrayable(o)){for(var l=0;l<o.length;++l){b.event.addListenerToFirer(n,o[l],m)}}else{if(typeof(o)==="function"||typeof(o)==="string"){n.addListener(o,m)}else{if(o&&typeof(o)==="object"){n.addListener(o.listener,m||o.namespace,o.predicate,o.priority)}}}};b.mergeListeners=function(n,l,m){b.each(m,function(r,o){var q,p;if(o.charAt(0)==="{"){if(!b.expandOptions){b.fail("fluid.expandOptions could not be loaded - please include FluidIoC.js in order to operate IoC-driven event with descriptor "+o)}q=b.expandOptions(o,n)}else{var s=o.indexOf(".");if(s!==-1){p=o.substring(s+1);o=o.substring(0,s)}if(!l[o]){b.fail("Listener registered for event "+o+" which is not defined for this component");l[o]=b.event.getEventFirer()}q=l[o]}b.event.addListenerToFirer(q,r,p)})};function h(n,l,m){b.each(l,function(o,p){var r=o&&(typeof(o)!=="string"||o.charAt(0)==="{");var q;if(r&&m==="IoC"){if(!b.event.resolveEvent){b.fail("fluid.event.resolveEvent could not be loaded - please include FluidIoC.js in order to operate IoC-driven event with descriptor ",o)
  }else{q=b.event.resolveEvent(n,p,o)}}else{if(m==="flat"){q=b.event.getEventFirer(o==="unicast",o==="preventable")}}if(q){n.events[p]=q}})}b.instantiateFirers=function(n,l){n.events={};h(n,l.events,"flat");h(n,l.events,"IoC");var m=b.expandOptions?b.expandOptions(l.listeners,n):l.listeners;b.mergeListeners(n,n.events,m)};b.mergeListenersPolicy=function(n,m){var l=n||{};b.each(m,function(p,o){l[o]=b.makeArray(m[o]).concat(b.makeArray(p))});return l};var g={};var j=function(l,m){m=b.makeArray(m);b.each(m,function(o){var n=b.rawDefaults(o)||{};l.gradeHash[o]=true;l.gradeChain.push(o);l.optionsChain.push(n);b.each(n.gradeNames,function(p){if(!l.gradeHash[p]){j(l,p)}})});return l};b.resolveGradeStructure=function(l){var m={gradeChain:[],gradeHash:{},optionsChain:[]};return j(m,l)};b.lifecycleFunctions={preInitFunction:true,postInitFunction:true,finalInitFunction:true};b.mergeLifecycleFunction=function(m,l){b.event.addListenerToFirer(m,l);return m};b.rootMergePolicy=b.transform(b.lifecycleFunctions,function(){return b.mergeLifecycleFunction});b.makeLifecycleFirers=function(){return b.transform(b.lifecycleFunctions,function(){return b.event.getEventFirer()})};b.resolveGrade=function(o,m){var p=[o];if(m){var n=b.resolveGradeStructure(m);p=n.optionsChain.reverse().concat(p).concat({gradeNames:n.gradeChain})}p=[b.rootMergePolicy,b.makeLifecycleFirers()].concat(p);var l=b.merge.apply(null,p);return l};b.resolveGradedOptions=function(l){var m=b.rawDefaults(l);if(!m){return m}else{return b.resolveGrade(m,m.gradeNames)}};b.rawDefaults=function(l,m){if(m===undefined){return g[l]}else{g[l]=m}};b.hasGrade=function(l,m){return !l||!l.gradeNames?false:b.contains(l.gradeNames,m)};b.defaults=function(){var n=0;if(typeof arguments[0]==="boolean"){n=1}var l=(n===0?"":"*.global-")+arguments[n];var m=arguments[n+1];if(m===undefined){return b.resolveGradedOptions(l)}else{b.rawDefaults(l,m);if(b.hasGrade(m,"autoInit")){b.makeComponent(l,b.resolveGradedOptions(l))}}};b.makeComponent=function(l,m){if(!m.initFunction||!m.gradeNames){b.fail("Cannot autoInit component "+l+" which does not have an initFunction and gradeName defined")}var n=function(){return b.initComponent(l,arguments)};var o=b.getGlobalValue(l);if(o){a.extend(n,o)}b.setGlobalValue(l,n)};b.makeComponents=function(m,l){b.each(m,function(p,o){var n={gradeNames:b.makeArray(p).concat(["autoInit"])};b.defaults(o,n)})};b.defaults("fluid.littleComponent",{initFunction:"fluid.initLittleComponent",argumentMap:{options:0}});b.defaults("fluid.eventedComponent",{gradeNames:["fluid.littleComponent"],mergePolicy:{listeners:"fluid.mergeListenersPolicy"}});b.preInitModelComponent=function(l){l.model=l.options.model||{};l.applier=l.options.applier||b.makeChangeApplier(l.model,l.options.changeApplierOptions)};b.defaults("fluid.modelComponent",{gradeNames:["fluid.littleComponent"],preInitFunction:{namespace:"preInitModelComponent",listener:"fluid.preInitModelComponent"},mergePolicy:{model:"preserve",applier:"nomerge"}});b.defaults("fluid.viewComponent",{gradeNames:["fluid.littleComponent","fluid.modelComponent","fluid.eventedComponent"],initFunction:"fluid.initView",argumentMap:{container:0,options:1}});b.guardCircularity=function(o,n,m,l){if(n&&n.id){if(!o[n.id]){o[n.id]=n}else{if(o[n.id]===n){b.fail("Circularity in options "+m+" - component with typename "+n.typeName+" and id "+n.id+" has already been seen"+l)}}}};b.mergePolicyIs=function(l,m){return typeof(l)==="string"&&a.inArray(m,l.split(/\s*,\s*/))!==-1};function d(r,u,q,l,v,p){if(typeof(v)==="function"){v.call(null,q,l);return q}if(b.mergePolicyIs(v,"replace")){b.clear(q)}b.guardCircularity(p.seenIds,l,"merging"," when evaluating path "+u+' - please protect components from merging using the "nomerge" merge policy');for(var n in l){var w=(u?u+".":"")+n;var s=r&&typeof(r)!=="string"?r[w]:r;var t=q[n];var o=l[n];var m=b.isPrimitive(t);if(o!==undefined){if(o!==null&&typeof(o)==="object"&&!b.isDOMNode(o)&&!o.jquery&&o!==b.VALUE&&!b.mergePolicyIs(s,"preserve")&&!b.mergePolicyIs(s,"nomerge")&&!b.mergePolicyIs(s,"noexpand")){if(m){q[n]=t=o instanceof Array?[]:{}}d(r,w,t,o,s,p)}else{if(typeof(s)==="function"){q[n]=s.call(null,t,o,n)}else{if(!b.isValue(t)||!b.mergePolicyIs(s,"reverse")){q[n]=b.isValue(t)&&b.mergePolicyIs(s,"preserve")?b.model.mergeModel(t,o):o}}}}}return q}b.merge=function(p,o){var t="";for(var n=2;n<arguments.length;++n){var l=arguments[n];if(l!==null&&l!==undefined){d(p,t,o,l,p?p[""]:null,{seenIds:{}})}}if(p&&typeof(p)!=="string"){for(var r in p){var s=p[r];if(typeof(s)==="string"&&s!=="replace"&&s!=="preserve"){var m=b.get(o,r);if(m===null||m===undefined){var q=b.get(o,s);b.set(o,r,q)}}}}return o};b.transformOptions=function(o,n){b.expect("Options transformation record",["transformer","config"],n);var l=b.getGlobalValue(n.transformer);var m=b.transform(o,function(q,p){return p===0?q:l.call(null,q,n.config)});return m};b.lastTransformationRecord=function(l){for(var m=l.length-1;m>=0;--m){if(l[m]&&l[m].transformOptions){return l[m].transformOptions}}};b.mergeComponentOptions=function(s,u,p,n){var m=b.defaults(u);var q=a.extend({},b.rootMergePolicy,m?m.mergePolicy:{});var l=m&&m.gradeNames;var t;if(!l){m=b.censorKeys(m,b.keys(b.lifecycleFunctions));t=[q,n]}else{t=[q]}var o;if(b.expandComponentOptions){o=b.expandComponentOptions(m,p,s)}else{o=[m,p]}var r=b.lastTransformationRecord(o);if(r){o=b.transformOptions(o,r)}t=t.concat(o);s.options=b.merge.apply(null,t)};b.COMPONENT_OPTIONS={type:"fluid.marker",value:"COMPONENT_OPTIONS"};b.emptySubcomponent=function(l){var n={};l=a.makeArray(l);var o=function(){};for(var m=0;m<l.length;++m){n[l[m]]=o}return n};b.computeNickName=function(m){var l=b.model.parseEL(m);return l[l.length-1]};b.typeTag=function(l){return l?{typeName:l,id:b.allocateGuid()}:null};b.typeFount=function(l){var m=b.initLittleComponent("fluid.typeFount",l);return b.typeTag(m.options.targetTypeName)};b.initLittleComponent=function(m,l,o){var n=b.typeTag(m);n.nickName=l&&l.nickName?l.nickName:b.computeNickName(n.typeName);o=o||{gradeNames:"fluid.littleComponent"};o=b.resolveGrade({},o.gradeNames);b.mergeComponentOptions(n,m,l,o);n.options.preInitFunction.fire(n);if(b.hasGrade(n.options,"fluid.eventedComponent")){b.instantiateFirers(n,n.options)}if(!b.hasGrade(n.options,"autoInit")){b.clearLifecycleFunctions(n.options)}return n};b.clearLifecycleFunctions=function(l){b.each(b.lifecycleFunctions,function(n,m){delete l[m]});delete l.initFunction};b.initComponent=function(l,p){var n=b.defaults(l);if(!n.gradeNames){b.fail("Cannot initialise component "+l+" which has no gradeName registered")}var m=[l].concat(b.makeArray(p));var o=b.invokeGlobalFunction(n.initFunction,m);o.options.postInitFunction.fire(o);if(b.initDependents){b.initDependents(o)}o.options.finalInitFunction.fire(o);b.clearLifecycleFunctions(o.options);return o.options.returnedPath?b.get(o,o.options.returnedPath):o};b.initSubcomponentImpl=function(q,p,n){var o;if(typeof(p)!=="function"){var r=typeof(p)==="string"?p:p.type;var l=b.defaults(true,r);b.merge("reverse",q.options,l);o=r==="fluid.emptySubcomponent"?b.emptySubcomponent(p.options):b.invokeGlobalFunction(r,n)}else{o=p.apply(null,n)}var m=o?o.returnedOptions:null;if(m){b.merge(q.options.mergePolicy,q.options,m);if(m.listeners){b.mergeListeners(q,q.events,m.listeners)}}return o};b.initSubcomponents=function(r,o,m){var q=r.options[o];if(!q){return}var l=a.makeArray(q);var s=-1;var p=[];m=a.makeArray(m);for(var n=0;n<m.length;++n){if(m[n]===b.COMPONENT_OPTIONS){s=n}}for(n=0;n<l.length;++n){q=l[n];if(s!==-1){m[s]=q.options}p[n]=b.initSubcomponentImpl(r,q,m)}return p};b.initSubcomponent=function(n,m,l){return b.initSubcomponents(n,m,l)[0]};b.checkTryCatchParameter=function(){var l=window.location||{search:"",protocol:"file:"};var m=l.search.slice(1).split("&");return b.contains(m,"notrycatch")};b.notrycatch=b.checkTryCatchParameter();b.container=function(n,o){var l=b.wrap(n);if(o&&(!l||l.length===0)){return null}if(!l||!l.jquery||l.length!==1){if(typeof(n)!=="string"){n=l.selector}var m=l.length!==undefined?l.length:0;b.fail((m>1?"More than one ("+m+") container elements were":"No container element was")+" found for selector "+n)}if(!b.isDOMNode(l[0])){b.fail("fluid.container was supplied a non-jQueryable element")}return l};b.createDomBinder=function(m,o){var n={},p={};function q(s,r){return b.allocateSimpleId(r)+"-"+s}function l(t,s,r){n[q(t,s)]=r}p.locate=function(t,v){var r,s,u;r=o[t];s=v?v:m;if(!s){b.fail("DOM binder invoked for selector "+t+" without container")}if(!r){return s}if(typeof(r)==="function"){u=a(r.call(null,b.unwrap(s)))}else{u=a(r,s)}if(u.get(0)===document){u=[]}if(!u.selector){u.selector=r;u.context=s}u.selectorName=t;l(t,s,u);return u};p.fastLocate=function(s,v){var r=v?v:m;var t=q(s,r);var u=n[t];return u?u:p.locate(s,v)};p.clear=function(){n={}};p.refresh=function(u,v){var s=v?v:m;if(typeof u==="string"){u=[u]}if(s.length===undefined){s=[s]}for(var t=0;t<u.length;++t){for(var r=0;r<s.length;++r){p.locate(u[t],s[r])}}};p.resolvePathSegment=p.locate;return p};b.expectFilledSelector=function(l,m){if(l&&l.length===0&&l.jquery){b.fail(m+': selector "'+l.selector+'" with name '+l.selectorName+" returned no results in context "+b.dumpEl(l.context))}};b.initView=function(m,l,p,o){b.expectFilledSelector(l,'Error instantiating component with name "'+m);l=b.container(l,true);if(!l){return null}var n=b.initLittleComponent(m,p,o||{gradeNames:["fluid.viewComponent"]});n.container=l;b.initDomBinder(n);return n};b.initDomBinder=function(l){l.dom=b.createDomBinder(l.container,l.options.selectors);l.locate=l.dom.locate};b.findAncestor=function(l,m){l=b.unwrap(l);while(l){if(m(l)){return l}l=l.parentNode}};b.jById=function(o,n){n=n&&n.nodeType===9?n:document;var l=b.byId(o,n);var m=l?a(l):[];m.selector="#"+o;m.context=n;return m};b.byId=function(n,m){m=m&&m.nodeType===9?m:document;var l=m.getElementById(n);if(l){if(l.id!==n){b.fail("Problem in document structure - picked up element "+b.dumpEl(l)+" for id "+n+" without this id - most likely the element has a name which conflicts with this id")
  }return l}else{return null}};b.getId=function(l){return b.unwrap(l).id};b.allocateSimpleId=function(l){l=b.unwrap(l);if(!l.id){l.id="fluid-id-"+b.allocateGuid()}return l.id};b.stringTemplate=function(p,m){var o=p;for(var n in m){var l="%"+n;o=o.replace(l,m[n])}return o};b.messageResolver=function(l){var m=b.initLittleComponent("fluid.messageResolver",l);m.messageBase=m.options.parseFunc(m.options.messageBase);m.lookup=function(o){var n=b.messageResolver.resolveOne(m.messageBase,o);if(n===undefined){return b.find(m.options.parents,function(p){return p.lookup(o)})}else{return{template:n,resolveFunc:m.options.resolveFunc}}};m.resolve=function(n,o){if(!n){return"[No messagecodes provided]"}n=b.makeArray(n);var p=m.lookup(n);return p?p.resolveFunc(p.template,o):"[Message string for key "+n[0]+" not found]"};return m};b.defaults("fluid.messageResolver",{mergePolicy:{messageBase:"preserve"},resolveFunc:b.stringTemplate,parseFunc:b.identity,messageBase:{},parents:[]});b.messageResolver.resolveOne=function(p,l){for(var m=0;m<l.length;++m){var o=l[m];var n=p[o];if(n!==undefined){return n}}};b.messageLocator=function(m,l){var n=b.messageResolver({messageBase:m,resolveFunc:l});return function(o,p){return n.resolve(o,p)}}})(jQuery,fluid_1_4);var fluid_1_4=fluid_1_4||{};(function(f,d){var a="fluid-scoped-data";d.getScopedData=function(i,g){var h=f(i).data(a);return h?h[g]:undefined};d.setScopedData=function(i,g,h){f(i).each(function(){var j=f.data(this,a)||{};j[g]=h;f.data(this,a,j)})};var b=null;f(document).bind("focusin",function(g){b=g.target});d.getLastFocusedElement=function(){return b};var c="enablement";d.enabled=function(h,g){h=f(h);if(g===undefined){return d.getScopedData(h,c)!==false}else{f("*",h).add(h).each(function(){if(d.getScopedData(this,c)!==undefined){d.setScopedData(this,c,g)}else{if(/select|textarea|input/i.test(this.nodeName)){f(this).prop("disabled",!g)}}});d.setScopedData(h,c,g)}};d.initEnablement=function(g){d.setScopedData(g,c,true)};function e(h,g){h=f(h);h.trigger("fluid-"+g);h[g]()}f.each(["focus","blur"],function(h,g){d[g]=function(i){e(i,g)}})})(jQuery,fluid_1_4);var fluid_1_4=fluid_1_4||{};(function(c,b){b.dom=b.dom||{};var a=function(d){if(d.node.firstChild){d.node=d.node.firstChild;d.depth+=1;return d}while(d.node){if(d.node.nextSibling){d.node=d.node.nextSibling;return d}d.node=d.node.parentNode;d.depth-=1}return d};b.dom.iterateDom=function(h,g,f){var e={node:h,depth:0};var d=h;var i;while(e.node!==null&&e.depth>=0&&e.depth<b.dom.iterateDom.DOM_BAIL_DEPTH){i=null;if(e.node.nodeType===1||f){i=g(e.node,e.depth)}if(i){if(i==="delete"){e.node.parentNode.removeChild(e.node);e.node=d}else{if(i==="stop"){return e.node}}}d=e.node;e=a(e)}};b.dom.iterateDom.DOM_BAIL_DEPTH=256;b.dom.isContainer=function(d,e){for(;e;e=e.parentNode){if(d===e){return true}}return false};b.dom.getElementText=function(f){var d=f.childNodes;var g="";for(var e=0;e<d.length;++e){var h=d[e];if(h.nodeType===3){g=g+h.nodeValue}}return g}})(jQuery,fluid_1_4);fluid_1_4=fluid_1_4||{};(function(c,b){var d=/(\\u[\dabcdef]{4}|\\x[\dabcdef]{2})/g;b.unescapeProperties=function(f){f=f.replace(d,function(j){var k=j.substring(2);var i=parseInt(k,16);return String.fromCharCode(i)});var h=0;while(true){var e=f.indexOf("\\",h);if(e===-1){break}if(e===f.length-1){return[f.substring(0,f.length-1),true]}var g=f.charAt(e+1);if(g==="n"){g="\n"}if(g==="r"){g="\r"}if(g==="t"){g="\t"}f=f.substring(0,e)+g+f.substring(e+2);h=e+1}return[f,false]};var a=/[^\\][\s:=]/;b.parseJavaProperties=function(l){var f={};l=l.replace(/\r\n/g,"\n");l=l.replace(/\r/g,"\n");lines=l.split("\n");var m,k,e,o,j;for(var g=0;g<lines.length;++g){var n=c.trim(lines[g]);if(!n||n.charAt(0)==="#"||n.charAt(0)==="!"){continue}if(!m){e="";var h=n.search(a);if(h===-1){k=n;o=""}else{k=c.trim(n.substring(0,h+1));o=c.trim(n.substring(h+2));if(o.charAt(0)===":"||o.charAt(0)==="="){o=c.trim(o.substring(1))}}k=b.unescapeProperties(k)[0];j=b.unescapeProperties(o)}else{j=b.unescapeProperties(n)}m=j[1];if(!j[1]){f[k]=e+j[0]}else{e+=j[0]}}return f};b.formatMessage=function(g,e){if(!e){return g}if(typeof(e)==="string"){e=[e]}for(var f=0;f<e.length;++f){g=g.replace("{"+f+"}",e[f])}return g}})(jQuery,fluid_1_4);var fluid_1_4=fluid_1_4||{};var fluid=fluid||fluid_1_4;(function(d,c){c.renderTimestamp=function(f){var g=function(i,j){if(!j){j=2}var h=(i==undefined?"":i.toString());return"00000".substring(5-j+h.length)+h};return g(f.getHours())+":"+g(f.getMinutes())+":"+g(f.getSeconds())+"."+g(f.getMilliseconds(),3)};c.detectStackStyle=function(g){var f="other";var h={offset:0};if(g["arguments"]){f="chrome"}else{if(typeof window!=="undefined"&&window.opera&&g.stacktrace){f="opera10"}else{if(g.stack){f="firefox";h.offset=g.stack.indexOf("Trace exception")===-1?1:0}else{if(typeof window!=="undefined"&&window.opera&&!("stacktrace" in g)){f="opera"}}}}h.style=f;return h};c.obtainException=function(){try{throw new Error("Trace exception")}catch(f){return f}};var e=c.detectStackStyle(c.obtainException());c.registerNamespace("fluid.exceptionDecoders");c.decodeStack=function(){if(e.style!=="firefox"){return null}var f=c.obtainException();return c.exceptionDecoders[e.style](f)};c.exceptionDecoders.firefox=function(g){var f=g.stack.replace(/(?:\n@:0)?\s+$/m,"").replace(/^\(/gm,"{anonymous}(").split("\n");return c.transform(f,function(h){var i=h.indexOf("@");return i===-1?[h]:[h.substring(i+1),h.substring(0,i)]})};c.getCallerInfo=function(g){g=(g||3)-e.offset;var f=c.decodeStack();return f?f[g][0]:null};function a(j,h){var g="";for(var f=0;f<h;++f){g+=j}return g}function b(m,l,h){var f=l+h.indentChars;if(m===null){return"null"}else{if(c.isPrimitive(m)){return JSON.stringify(m)}else{var g=[];if(c.isArrayable(m)){if(m.length===0){return"[]"}for(var k=0;k<m.length;++k){g[k]=b(m[k],f,h)}return"[\n"+f+g.join(",\n"+f)+"\n"+l+"]"}else{var k=0;c.each(m,function(j,i){g[k++]=JSON.stringify(i)+": "+b(j,f,h)});return"{\n"+f+g.join(",\n"+f)+"\n"+l+"}"}}}}c.prettyPrintJSON=function(g,f){f=d.extend({indent:4},f);f.indentChars=a(" ",f.indent);return b(g,"",f)};c.dumpEl=function(g){var h;if(!g){return"null"}if(g.nodeType===3||g.nodeType===8){return"[data: "+g.data+"]"}if(g.nodeType===9){return"[document: location "+g.location+"]"}if(!g.nodeType&&c.isArrayable(g)){h="[";for(var f=0;f<g.length;++f){h+=c.dumpEl(g[f]);if(f<g.length-1){h+=", "}}return h+"]"}g=d(g);h=g.get(0).tagName;if(g.id){h+="#"+g.id}if(g.attr("class")){h+="."+g.attr("class")}return h}})(jQuery,fluid_1_4);var fluid_1_4=fluid_1_4||{};(function(e,d){d.BINDING_ROOT_KEY="fluid-binding-root";d.findData=function(i,h){while(i){var j=e.data(i,h);if(j){return j}i=i.parentNode}};d.bindFossils=function(i,j,h){e.data(i,d.BINDING_ROOT_KEY,{data:j,fossils:h})};d.boundPathForNode=function(k,j){k=d.unwrap(k);var i=k.name||k.id;var h=j[i];return h?h.EL:null};d.findForm=function(h){return d.findAncestor(h,function(i){return i.nodeName.toLowerCase()==="form"})};d.value=function(o,n){var l=d.unwrap(o);var h=false;if(l.nodeType===undefined&&l.length>1){l=l[0];h=true}if("input"!==l.nodeName.toLowerCase()||!/radio|checkbox/.test(l.type)){return n===undefined?e(l).val():e(l).val(n)}var i=l.name;if(i===undefined){d.fail("Cannot acquire value from node "+d.dumpEl(l)+" which does not have name attribute set")}var m;if(h){m=o}else{m=document.getElementsByName(i);var j=d.findForm(l);m=e.grep(m,function(p){if(p.name!==i){return false}return !j||d.dom.isContainer(j,p)})}if(n!==undefined){if(typeof(n)==="boolean"){n=(n?"true":"false")}e.each(m,function(){this.checked=(n instanceof Array?e.inArray(this.value,n)!==-1:n===this.value)})}else{var k=e.map(m,function(p){return p.checked?p.value:null});return l.type==="radio"?k[0]:k}};d.applyChange=function(m,n,j){m=d.unwrap(m);if(n===undefined){n=d.value(m)}if(m.nodeType===undefined&&m.length>0){m=m[0]}var h=d.findData(m,d.BINDING_ROOT_KEY);if(!h){d.fail("Bound data could not be discovered in any node above "+d.dumpEl(m))}var i=m.name;var k=h.fossils[i];if(!k){d.fail("No fossil discovered for name "+i+" in fossil record above "+d.dumpEl(m))}if(typeof(k.oldvalue)==="boolean"){n=n[0]?true:false}var l=h.fossils[i].EL;if(j){j.fireChangeRequest({path:l,value:n,source:m.id})}else{d.set(h.data,l,n)}};d.pathUtil={};var g=function(k,n,j){var l=null;if(k){l=""}var m=false;var h=n.length;for(;j<h;++j){var o=n.charAt(j);if(!m){if(o==="."){break}else{if(o==="\\"){m=true}else{if(l!==null){l+=o}}}}else{m=false;if(l!==null){k+=o}}}if(l!==null){k[0]=l}return j};var a=[];d.pathUtil.getPathSegment=function(j,h){g(a,j,h);return a[0]};d.pathUtil.getHeadPath=function(h){return d.pathUtil.getPathSegment(h,0)};d.pathUtil.getFromHeadPath=function(i){var h=g(null,i,0);return h===i.length?null:i.substring(h+1)};function f(h){return h.lastIndexOf(".")}d.pathUtil.getToTailPath=function(i){var h=f(i);return h===-1?null:i.substring(0,h)};d.pathUtil.getTailPath=function(i){var h=f(i);return d.pathUtil.getPathSegment(i,h+1)};var c=function(k,j){for(var h=0;h<j.length;++h){var l=j.charAt(h);if(l==="."||l==="\\"||l==="}"){k+="\\"}k+=l}return k};d.pathUtil.composePath=function(h,i){if(h.length!==0){h+="."}return c(h,i)};d.pathUtil.matchPath=function(h,k){var j="";while(true){if(!h||k===""){break}if(!k){return null}var i=d.pathUtil.getHeadPath(h);var l=d.pathUtil.getHeadPath(k);if(i!=="*"&&i!==l){return null}j=d.pathUtil.composePath(j,l);h=d.pathUtil.getFromHeadPath(h);k=d.pathUtil.getFromHeadPath(k)}return j};d.model.mergeModel=function(k,j,i){var h=d.copy(j);i=i||d.makeChangeApplier(j);if(!d.isPrimitive(k)){i.fireChangeRequest({type:"ADD",path:"",value:k})}i.fireChangeRequest({type:"MERGE",path:"",value:h});return j};d.model.isNullChange=function(i,k,h){if(k.type==="ADD"){var j=d.get(i,k.path,h);if(j===k.value){return true}}};d.model.applyChangeRequest=function(h,k,j){var i=d.model.getPenultimate(h,k.path,j||d.model.defaultSetConfig);if(k.type==="ADD"||k.type==="MERGE"){if(k.path===""||k.type==="MERGE"){if(k.type==="ADD"){d.clear(i.root)}e.extend(true,k.path===""?i.root:i.root[i.last],k.value)
  }else{i.root[i.last]=k.value}}else{if(k.type==="DELETE"){if(k.path===""){d.clear(i.root)}else{delete i.root[i.last]}}}};function b(h){h.requestChange=function(l,k,i){var j={path:l,value:k,type:i};h.fireChangeRequest(j)}}d.makeChangeApplier=function(n,w){w=w||{};var m={guards:d.event.getEventFirer(false,true),postGuards:d.event.getEventFirer(false,true),modelChanged:d.event.getEventFirer(false,false)};var q={model:n};function i(y){if(!y){return null}var x=function(z){return function(A,B,D){var C=z(A,B,D);if(C===false){return false}else{if(d.model.isNullChange(A,B)){x.culled=true;return false}}}};return x}function v(B,x){var z=x;var A=false;var y=Number.MAX_VALUE;if(typeof(x)!=="string"){z=x.path;A=x.transactional;if(x.priority!==undefined){y=x.priority}}else{if(z.charAt(0)==="!"){A=true;z=z.substring(1)}}return function(H,G,D){var F=d.event.identifyListener(B);var I=G.guids[F];if(!I){var E=d.pathUtil.matchPath(z,H);if(E!==null){var C={changePath:H,pathSpec:z,listener:B,priority:y,transactional:A};if(D){C.accumulate=[D]}G.guids[F]=C;var J=A?"transListeners":"listeners";G[J].push(C);G.all.push(C)}}else{if(D){if(!I.accumulate){I.accumulate=[]}I.accumulate.push(D)}}}}function p(z,y,x,A,B){return m[z].fireToListeners(y[A],x,B)}function k(y,x){return y.priority-x.priority}function l(A,z,y,x){m[A].fire(z,y,x);y.all.sort(k);y.listeners.sort(k);y.transListeners.sort(k)}function s(){return{guids:{},all:[],listeners:[],transListeners:[]}}function o(z,y){var x=s();l(z,y,x);return x}function u(A,z,y,B){var x=o(A,z);return p(A,x,y,"all",B)}function j(y,x){y[x]={addListener:function(z,B,A){m[x].addListener(v(B,z),A)},removeListener:function(z){m[x].removeListener(z)}}}j(q,"guards");j(q,"postGuards");j(q,"modelChanged");function h(x){if(!x.type){x.type="ADD"}}var t={fireChangeRequest:function(x){q.fireChangeRequest(x,true)}};b(t);q.fireChangeRequest=function(z,C){h(z);var A=C?null:o("guards",z.path);if(A&&A.transListeners.length>0){var y=q.initiate();y.fireChangeRequest(z,A);y.commit()}else{if(!C){var x=p("guards",A,[n,z,t],"listeners");if(x===false){return false}}var B=n;if(!w.thin){B={};d.model.copyModel(B,n)}d.model.applyChangeRequest(n,z,w.resolverSetConfig);u("modelChanged",z.path,[n,B,[z]])}};b(q);function r(B,G,E,D,y){var x=s();for(var A=0;A<E.length;++A){l(B,E[A].path,x,E[A])}for(var z=0;z<x[G].length;++z){var F=x[G][z];if(y){D[y]=F.accumulate}var C=F.listener.apply(null,D);if(C===false){return false}}}q.initiate=function(y){var A=false;var z=[];if(w.thin){y=n}else{y=y||{};d.model.copyModel(y,n)}var B={fireChangeRequest:function(C){h(C);d.model.applyChangeRequest(y,C,w.resolverSetConfig);z.push(C)}};b(B);var x={commit:function(){var D;if(A){return false}var C=r("postGuards","transListeners",z,[y,null,B],1);if(C===false){return false}if(w.thin){D=n}else{D={};d.model.copyModel(D,n);d.clear(n);d.model.copyModel(n,y)}r("modelChanged","all",z,[n,D,null],2)},fireChangeRequest:function(D){h(D);if(w.cullUnchanged&&d.model.isNullChange(n,D,w.resolverGetConfig)){return}var E=i(w.cullUnchanged);var C=u("guards",D.path,[y,D,B],E);if(C===false&&!(E&&E.culled)){A=true}if(!A){if(!(E&&E.culled)){d.model.applyChangeRequest(y,D,w.resolverSetConfig);z.push(D)}}}};b(x);return x};return q};d.makeSuperApplier=function(){var i=[];var h={};h.addSubApplier=function(j,k){i.push({path:j,subApplier:k})};h.fireChangeRequest=function(m){for(var l=0;l<i.length;++l){var n=i[l].path;if(m.path.indexOf(n)===0){var k=m.path.substring(n.length+1);var j=d.copy(m);j.path=k;i[l].subApplier.fireChangeRequest(j)}}};b(h);return h};d.attachModel=function(h,o,m){var k=d.model.parseEL(o);for(var n=0;n<k.length-1;++n){var j=k[n];var l=h[j];if(!l){h[j]=l={}}h=l}h[k[k.length-1]]=m};d.assembleModel=function(h){var i={};var k=d.makeSuperApplier();var j={model:i,applier:k};for(var l in h){var m=h[l];d.attachModel(i,l,m.model);if(m.applier){k.addSubApplier(l,m.applier)}}return j}})(jQuery,fluid_1_4);var fluid_1_4=fluid_1_4||{};var fluid=fluid||fluid_1_4;(function(j,n){n.thatistBridge=function(G,I){var H=function(J){var L=J.split(".");var K=I;for(var O=0;O<L.length;++O){K=K[L[O]]}var N=[this];if(arguments.length===2){N=N.concat(j.makeArray(arguments[1]))}var M=K.apply(null,N);this.that=function(){return M};var P=typeof(M);return !M||P==="string"||P==="number"||P==="boolean"||M&&M.length!==undefined?M:this};j.fn[G]=H;return H};n.thatistBridge("fluid",n);n.thatistBridge("fluid_1_4",fluid_1_4);var k=function(){return j.browser.msie?"tabIndex":"tabindex"};var p=function(G){if(G.length<=0){return false}return j(G[0]).is("a, input, button, select, area, textarea, object")};var g=function(H){if(H.length<=0){return undefined}if(!n.tabindex.hasAttr(H)){return p(H)?Number(0):undefined}var G=H.attr(k());return Number(G)};var d=function(G,H){return G.each(function(I,J){j(J).attr(k(),H)})};n.tabindex=function(H,G){H=j(H);if(G!==null&&G!==undefined){return d(H,G)}else{return g(H)}};n.tabindex.remove=function(G){G=j(G);return G.each(function(H,I){j(I).removeAttr(k())})};n.tabindex.hasAttr=function(H){H=j(H);if(H.length<=0){return false}var G=H.map(function(){var I=this.getAttributeNode(k());return I?I.specified:false});return G.length===1?G[0]:G};n.tabindex.has=function(G){G=j(G);return n.tabindex.hasAttr(G)||p(G)};n.a11y=j.a11y||{};n.a11y.orientation={HORIZONTAL:0,VERTICAL:1,BOTH:2};var t={next:j.ui.keyCode.DOWN,previous:j.ui.keyCode.UP};var b={next:j.ui.keyCode.RIGHT,previous:j.ui.keyCode.LEFT};var B=function(G){return G.jquery?G[0]:G};var w=function(G){G.each(function(H,I){I=j(I);if(!I.fluid("tabindex.has")||I.fluid("tabindex")<0){I.fluid("tabindex",0)}})};n.tabbable=function(G){G=j(G);w(G)};var o="selectionContext";var v=-32768;var q=function(G){if(G.activeItemIndex!==v){if(G.options.onLeaveContainer){G.options.onLeaveContainer(G.selectables[G.activeItemIndex])}else{if(G.options.onUnselect){G.options.onUnselect(G.selectables[G.activeItemIndex])}}}if(!G.options.rememberSelectionState){G.activeItemIndex=v}};var m=function(G,H){if(H){H(G)}};var x=function(H,G){if(G&&H){G(H)}};var f=function(H,G){x(H,G.options.onUnselect)};var y=function(G,H){f(H.selectedElement(),H);G=B(G);var I=H.selectables.index(G);if(I===-1){return}H.activeItemIndex=I;m(G,H.options.onSelect)};var F=function(G){return function(H){j(H.target).fluid("tabindex",0);y(H.target,G);return H.stopPropagation()}};var h=function(G){return function(H){j(H.target).fluid("tabindex",G.options.selectablesTabindex);f(H.target,G);return H.stopPropagation()}};var u=function(G){var H=G.selectables;if(G.activeItemIndex>=H.length){G.activeItemIndex=0}if(G.activeItemIndex<0&&G.activeItemIndex!==v){G.activeItemIndex=H.length-1}if(G.activeItemIndex>=0){n.focus(H[G.activeItemIndex])}};var A=function(G){var H=G.selectedElement();if(H){n.blur(H)}f(G.selectedElement(),G);if(G.activeItemIndex===v){G.activeItemIndex=-1}};var C=function(G){A(G);++G.activeItemIndex;u(G)};var l=function(G){A(G);--G.activeItemIndex;u(G)};var i=function(G,I,H){return function(J){if(J.which===I.next){C(G);J.preventDefault()}else{if(J.which===I.previous){l(G);J.preventDefault()}}}};var s=function(G){var H;if(G===n.a11y.orientation.HORIZONTAL){H=b}else{if(G===n.a11y.orientation.VERTICAL){H=t}}return H};var c=function(G){return function(H){if(H.which!==j.ui.keyCode.TAB){return}q(G);if(H.shiftKey){G.focusIsLeavingContainer=true}}};var r=function(G){return function(H){var J=G.options.autoSelectFirstItem;var I=typeof(J)==="function"?J():J;if(G.focusIsLeavingContainer){I=false}if(I&&H.target===G.container.get(0)){if(G.activeItemIndex===v){G.activeItemIndex=0}n.focus(G.selectables[G.activeItemIndex])}return H.stopPropagation()}};var z=function(G){return function(H){G.focusIsLeavingContainer=false;return H.stopPropagation()}};var e=function(H,K,L){var I=j.extend(true,{},K,L);var M=s(I.direction);var G=I.selectableElements?I.selectableElements:H.find(I.selectableSelector);var J={container:H,activeItemIndex:v,selectables:G,focusIsLeavingContainer:false,options:I};J.selectablesUpdated=function(N){if(typeof(J.options.selectablesTabindex)==="number"){J.selectables.fluid("tabindex",J.options.selectablesTabindex)}J.selectables.unbind("focus."+o);J.selectables.unbind("blur."+o);J.selectables.bind("focus."+o,F(J));J.selectables.bind("blur."+o,h(J));if(M&&J.options.noBubbleListeners){J.selectables.unbind("keydown."+o);J.selectables.bind("keydown."+o,i(J,M))}if(N){y(N,J)}else{u(J)}};J.refresh=function(){if(!J.options.selectableSelector){throw ("Cannot refresh selectable context which was not initialised by a selector")}J.selectables=H.find(I.selectableSelector);J.selectablesUpdated()};J.selectedElement=function(){return J.activeItemIndex<0?null:J.selectables[J.activeItemIndex]};if(M&&!J.options.noBubbleListeners){H.keydown(i(J,M))}H.keydown(c(J));H.focus(r(J));H.blur(z(J));J.selectablesUpdated();return J};n.selectable=function(I,G){I=j(I);var H=e(I,n.selectable.defaults,G);n.setScopedData(I,o,H);return H};n.selectable.select=function(H,G){n.focus(G)};n.selectable.selectNext=function(G){G=j(G);C(n.getScopedData(G,o))};n.selectable.selectPrevious=function(G){G=j(G);l(n.getScopedData(G,o))};n.selectable.currentSelection=function(H){H=j(H);var G=n.getScopedData(H,o);return j(G.selectedElement())};n.selectable.defaults={direction:n.a11y.orientation.VERTICAL,selectablesTabindex:-1,autoSelectFirstItem:true,rememberSelectionState:true,selectableSelector:".selectable",selectableElements:null,onSelect:null,onUnselect:null,onLeaveContainer:null};var a=function(L,H){if(!L.modifier){return true}var I=L.modifier;var J=I&&H.ctrlKey;var G=I&&H.altKey;var K=I&&H.shiftKey;return J||G||K};var E=function(G){return function(H){var K=H.target;if(!n.enabled(H.target)){return}var J=H.which?H.which:H.keyCode;if(J===G.key&&G.activateHandler&&a(G,H)){var I=j.Event("fluid-activate");j(H.target).trigger(I,[G.activateHandler]);if(I.isDefaultPrevented()){H.preventDefault()}}}};var D=function(J,M,G,H){var L=[];j(G).each(function(N,O){L.push({modifier:null,key:O,activateHandler:M})});if(H&&H.additionalBindings){L=L.concat(H.additionalBindings)
  }n.initEnablement(J);for(var I=0;I<L.length;++I){var K=L[I];J.keydown(E(K))}J.bind("fluid-activate",function(N,O){O=O||M;return O?O(N):null})};n.activatable=function(I,H,G){I=j(I);D(I,H,n.activatable.defaults.keys,G)};n.activate=function(G){j(G).trigger("fluid-activate")};n.activatable.defaults={keys:[j.ui.keyCode.ENTER,j.ui.keyCode.SPACE]}})(jQuery,fluid_1_4);var fluid_1_4=fluid_1_4||{};(function(c,b){b.defaults("fluid.ariaLabeller",{labelAttribute:"aria-label",liveRegionMarkup:'<div class="liveRegion fl-offScreen-hidden" aria-live="polite"></div>',liveRegionId:"fluid-ariaLabeller-liveRegion",invokers:{generateLiveElement:{funcName:"fluid.ariaLabeller.generateLiveElement",args:["{ariaLabeller}"]}}});b.ariaLabeller=function(e,d){var f=b.initView("fluid.ariaLabeller",e,d);b.initDependents(f);f.update=function(h){h=h||f.options;f.container.attr(f.options.labelAttribute,h.text);if(h.dynamicLabel){var g=b.jById(f.options.liveRegionId);if(g.length===0){g=f.generateLiveElement()}g.text(h.text)}};f.update();return f};b.ariaLabeller.generateLiveElement=function(e){var d=c(e.options.liveRegionMarkup);d.prop("id",e.options.liveRegionId);c("body").append(d);return d};var a="aria-labelling";b.getAriaLabeller=function(d){d=c(d);var e=b.getScopedData(d,a);return e};b.updateAriaLabel=function(e,g,d){d=c.extend({},d||{},{text:g});var f=b.getAriaLabeller(e);if(!f){f=b.ariaLabeller(e,d);b.setScopedData(e,a,f)}else{f.update(d)}return f};b.deadMansBlur=function(f,d){var e=b.initLittleComponent("fluid.deadMansBlur",d);e.blurPending=false;e.lastCancel=0;c(f).bind("focusout",function(h){b.log("Starting blur timer for element "+b.dumpEl(h.target));var g=new Date().getTime();b.log("back delay: "+(g-e.lastCancel));if(g-e.lastCancel>e.options.backDelay){e.blurPending=true}setTimeout(function(){if(e.blurPending){e.options.handler(f)}},e.options.delay)});e.canceller=function(g){b.log("Cancellation through "+g.type+" on "+b.dumpEl(g.target));e.lastCancel=new Date().getTime();e.blurPending=false};b.each(e.options.exclusions,function(g){g=c(g);b.each(g,function(h){c(h).bind("focusin",e.canceller).bind("fluid-focus",e.canceller).click(e.canceller).mousedown(e.canceller)})});return e};b.defaults("fluid.deadMansBlur",{delay:150,backDelay:100})})(jQuery,fluid_1_4);var fluid_1_4=fluid_1_4||{};(function(d,f){var j="__CURRENTLY_IN_CREATION__";f.isFireBreak=function(q){return q.options&&q.options["fluid.visitComponents.fireBreak"]};f.visitComponentChildren=function(u,v,t,q,w){t=t||{};for(var s in u){var r=u[s];if(!r||!r.typeName||(r.id&&t.visited&&t.visited[r.id])){continue}if(t.visited){t.visited[r.id]=true}if(v(r,s,t,q,w)){return true}if(!f.isFireBreak(r)&&!t.flat){f.visitComponentChildren(r,v,t,q,w+1)}}};var n=function(t,v,r){r=r||{visited:{},flat:true};var q=0;for(var s=t.length-1;s>=0;--s){var u=t[s];if(f.isFireBreak(u)){return}if(u.typeName){r.visited[u.id]=true;if(v(u,"",r,0,0)){return}}if(f.visitComponentChildren(u,v,r,q,1)){return}++q}};function o(s,r,q){return function(w,v){var t=w[v];if(t===undefined){var u=s.idToPath[w.id];t=s.pathToComponent[f.composePath(u,v)];if(t){t[j]=true}}if(t!==undefined){if(t[j]){f.fail("Component "+f.dumpThat(t)+' at path "'+v+'" of parent '+f.dumpThat(w)+" 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(f.get(w,f.path("options","components",v,"type"))){f.initDependent(w,v);t=w[v]}}return t}}f.dumpThat=function(q,r){return'{ typeName: "'+q.typeName+'" id: '+q.id+"}"};f.dumpThatStack=function(q,s){var r=f.transform(q,function(t){var u=s.idToPath[t.id];return f.dumpThat(t)+(u?(" - path: "+u):"")});return r.join("\n")};f.describeActivity=function(){return f.threadLocal().activityStack||[]};f.pushActivity=function(s,r){if(!r){return s()}var q=f.threadLocal();if(!q.activityStack){q.activityStack=[]}var t=f.makeArray(r);t.push("\n");t.unshift("\n");q.activityStack=t.concat(q.activityStack);return f.tryCatch(s,null,function(){q.activityStack=q.activityStack.slice(t.length)})};f.wrapActivity=function(r,q){return function(){var s=f.makeArray(arguments);var t=f.transform(f.makeArray(q),function(v){if(v.indexOf("arguments.")===0){var u=v.substring("arguments.".length);return f.get(s,u)}else{return v}});return f.pushActivity(function(){return r.apply(null,s)},t)}};var l=/arguments|options|container/;function c(w,r,s,v){v=v||{};var t=w.getFullStack(r);var q=[f.model.funcResolverStrategy,o(w,r,t)];var u=function(y){var z=y.context;if(s&&l.test(z)){var B=f.get(s[z],y.path);return(z==="arguments"||v.direct)?B:{marker:z==="options"?f.EXPAND:f.EXPAND_NOW,value:B}}var x;n(t,function(F,E,D,C,G){if(z===E||z===F.typeName||z===F.nickName){x=F;if(G>1){f.log("***WARNING: value resolution for context "+z+" found at depth "+G+": this may not be supported in future")}return true}if(f.get(F,f.path("options","components",z,"type"))&&!F[z]){x=f.get(F,z,{strategies:q});return true}});if(!x&&y.path!==""){var A=f.renderContextReference(y);f.log("Failed to resolve reference "+A+": thatStack contains\n"+f.dumpThatStack(t,w));f.fail("Failed to resolve reference "+A+" - could not match context with name "+z+" from component root of type "+t[0].typeName)}return f.get(x,y.path,q)};return u}function k(t,q,r,s){return d.extend({},f.defaults("fluid.resolveEnvironment"),{fetcher:c(t,q,r,s)})}f.instantiator=function(q){var t={options:{"fluid.visitComponents.fireBreak":true},idToPath:{},pathToComponent:{},stackCount:0,nickName:"instantiator"};var r=f.typeTag("fluid.instantiator");r=d.extend(r,t);r.stack=function(u){return r.stackCount+=u};r.getThatStack=function(w){var y=r.idToPath[w.id]||"";var v=f.model.parseEL(y);var x=f.transform(v,function(B,A){var z=f.model.composeSegments.apply(null,v.slice(0,A+1));return r.pathToComponent[z]});var u=r.pathToComponent[""];if(u){x.unshift(u)}return x};r.getEnvironmentalStack=function(){var u=[f.staticEnvironment];if(!q){u.push(f.threadLocal())}return u};r.getFullStack=function(u){var v=u?r.getThatStack(u):[];return r.getEnvironmentalStack().concat(v)};function s(u,v){r.idToPath[u.id]=v;if(r.pathToComponent[v]){f.fail("Error during instantiation - path "+v+" which has just created component "+f.dumpThat(u)+" has already been used for component "+f.dumpThat(r.pathToComponent[v])+" - this is a circular instantiation or other oversight. Please clear the component using instantiator.clearComponent() before reusing the path.")}r.pathToComponent[v]=u}r.recordRoot=function(u){if(u&&u.id&&!r.pathToComponent[""]){s(u,"")}};r.pushUpcomingInstantiation=function(v,u){r.expectedParent=v;r.expectedName=u};r.recordComponent=function(u){if(r.expectedName){r.recordKnownComponent(r.expectedParent,u,r.expectedName);delete r.expectedName;delete r.expectedParent}else{r.recordRoot(u)}};r.clearComponent=function(w,v,z,u,x){u=u||{visited:{},flat:true};z=z||w[v];f.visitComponentChildren(z,function(B,A){r.clearComponent(z,A,null,u,x)},u);var y=r.idToPath[z.id];delete r.idToPath[z.id];delete r.pathToComponent[y];if(!x){delete w[v]}};r.recordKnownComponent=function(x,w,v){var u=r.idToPath[x.id]||"";var y=f.model.composePath(u,v);s(w,y)};return r};f.freeInstantiator=f.instantiator(true);f.argMapToDemands=function(r){var q=[];f.each(r,function(t,s){q[t]="{"+s+"}"});return q};f.makePassArgsSpec=function(q){return f.transform(q,function(r,s){return"{arguments}."+s})};function p(q){if(q&&q.mergeOptions){q.mergeAllOptions=["{options}"].concat(f.makeArray(q.mergeOptions))}}function i(q){p(q);if(q.mergeAllOptions){if(q.options){f.fail("demandspec ",q," is invalid - cannot specify literal options together with mergeOptions or mergeAllOptions")}q.options={mergeAllOptions:q.mergeAllOptions}}if(q.options){delete q.options.mergeOptions}}f.embodyDemands=function(A,r,w,s,v){v=v||{};i(w);var q=f.get(v,"componentRecord.options");v.componentRecord=d.extend(true,{},v.componentRecord,f.censorKeys(w,["args","funcName"]));var u=f.get(v,"componentRecord.options.mergeAllOptions.0");if(u==="{options}"){f.set(v,"componentRecord.options.mergeAllOptions.0",q)}var C=d.makeArray(w.args);var E=f.defaults(w.funcName);var F=E?E.argumentMap:null;var z=false;if(!F&&(E||(v&&v.componentRecord))&&!v.passArgs){z=true;if(C.length<2){F=f.rawDefaults("fluid.littleComponent").argumentMap}else{F={options:C.length-1}}}v=v||{};if(C.length===0){if(v.componentRecord&&F){C=f.argMapToDemands(F)}else{if(v.passArgs){C=f.makePassArgsSpec(s)}}}var I=d.extend({"arguments":s},f.censorKeys(v.componentRecord,["type"]));f.each(F,function(K,J){if(s.length>0){I[J]=I["arguments"][K]}if(w[J]!==undefined&&I[J]===undefined){I[J]=w[J]}});p(I.options);p(F&&C[F.options]);var D=d.extend({},I);if(v.componentRecord.options!==undefined){D.options=v.componentRecord.options}var x=k(A,r,I);var t=[];if(C){for(var G=0;G<C.length;++G){var y=C[G];if(f.isMarker(y)&&y.value===f.COMPONENT_OPTIONS.value){y="{options}";if(z){F={options:G}}}if(typeof(y)==="string"){if(y.charAt(0)==="@"){var H=y.substring(1);y="{arguments}."+H}}if(!F||F.options!==G){t[G]=f.expander.expandLight(y,x)}else{if(y&&typeof(y)==="object"&&!y.targetTypeName){y.targetTypeName=w.funcName}t[G]={marker:f.EXPAND,value:f.copy(y),localRecord:D}}if(t[G]&&f.isMarker(t[G].marker,f.EXPAND_NOW)){t[G]=f.expander.expandLight(t[G].value,x)}}}else{t=s?s:[]}var B={args:t,funcName:w.funcName};return B};var e={};f.alias=function(q,r){if(r){e[q]=r}else{return e[q]}};var h={};function a(q,v){var t=h[q]||[];outer:for(var s=0;s<t.length;++s){var u=t[s];for(var r=0;r<v.length;++r){if(u.contexts[r]!==v[r]){continue outer}}return u.spec}}f.demands=function(r,t,q){var v=d.makeArray(t).sort();if(!q){return a(r,v)}else{if(q.length){q={args:q}}}if(f.getCallerInfo){var u=f.getCallerInfo(5);if(u){q.registeredFrom=u}}var s=h[r];if(!s){s=[];h[r]=s}s.push({contexts:v,spec:q})};f.compareDemands=function(r,q){var s=r.uncess-q.uncess;return s===0?q.intersect-r.intersect:s};f.isDemandLogging=function(q){return f.isLogging()&&q[0]!=="fluid.threadLocal"};f.locateAllDemands=function(z,B,r){var q=f.isDemandLogging(r);
  if(q){f.log("Resolving demands for function names ",r," in context of "+(B?"component "+B.typeName:"no component"))}var D={};var A=[];var s=z.getFullStack(B);n(s,function(G,H,F,E,I){D[G.typeName]=true;A.push(G)});if(q){f.log("Components in scope for resolution:\n"+f.dumpThatStack(A,z))}var y=[];for(var w=0;w<r.length;++w){var u=h[r[w]]||[];for(var v=0;v<u.length;++v){var C=u[v];var x={spec:C,intersect:0,uncess:0};for(var t=0;t<C.contexts.length;++t){x[D[C.contexts[t]]?"intersect":"uncess"]+=2}if(C.contexts.length===0){x.intersect++}y.push(x)}}y.sort(f.compareDemands);return y};f.locateDemands=function(u,q,s){var t=f.locateAllDemands(u,q,s);var r=t.length===0||t[0].intersect===0?null:t[0].spec.spec;if(f.isDemandLogging(s)){if(r){f.log("Located "+t.length+" potential match"+(t.length===1?"":"es")+", selected best match with "+t[0].intersect+" matched context names: ",r)}else{f.log("No matches found for demands, using direct implementation")}}return r};f.determineDemands=function(w,q,t){t=d.makeArray(t);var s=t[0];var r=f.locateDemands(w,q,t)||{};if(r.funcName){s=r.funcName}var u=f.alias(s);if(u){s=u;f.log("Following redirect from function name "+s+" to "+u);var v=f.locateDemands(w,q,[u]);if(v){f.each(v,function(y,x){if(l.test(x)){f.fail("Error in demands block ",v,' - content with key "'+x+'" is not supported since this demands block was resolved via an alias from "'+s+'"')}});if(v.funcName){s=v.funcName;f.log('Followed final inner demands to function name "'+s+'"')}}}return f.merge(null,{funcName:s,args:f.makeArray(r.args)},f.censorKeys(r,["funcName","args"]))};f.resolveDemands=function(v,q,t,u,s){var r=f.determineDemands(v,q,t);return f.embodyDemands(v,q,r,u,s)};f.invoke=function(t,r,s,q){r=f.makeArray(r);return f.withInstantiator(s,function(v){var u=f.resolveDemands(v,s,t,r,{passArgs:true});return f.invokeGlobalFunction(u.funcName,u.args,q)})};f.invoke=f.wrapActivity(f.invoke,['    while invoking function with name "',"arguments.0",'" from component',"arguments.2"]);f.makeFreeInvoker=function(r,q){var s=f.determineDemands(f.freeInstantiator,null,r);return function(){var t=f.embodyDemands(f.freeInstantiator,null,s,arguments,{passArgs:true});return f.invokeGlobalFunction(t.funcName,t.args,q)}};f.makeInvoker=function(u,s,r,t,q){r=r||f.determineDemands(u,s,t);return function(){var v=arguments;return f.pushActivity(function(){var w=f.embodyDemands(u,s,r,v,{passArgs:true});return f.invokeGlobalFunction(w.funcName,w.args,q)},["    while invoking invoker with name "+t+" on component",s])}};f.event.dispatchListener=function(u,s,t,r,q){return function(){var w=f.determineDemands(u,s,r);if(w.args.length===0&&q.args){w.args=q.args}var v=f.embodyDemands(u,s,w,arguments,{passArgs:true,componentOptions:q});t.apply(null,v.args)}};f.event.resolveEvent=function(s,r,q){return f.withInstantiator(s,function(w){if(typeof(q)==="string"){var u=f.expandOptions(q,s);if(!u){f.fail("Error in fluid.event.resolveEvent - context path "+q+" could not be looked up to a valid event firer")}return u}else{var v=q.event;var t;if(!v){f.fail("Event specification for event with name "+r+" does not include a base event specification")}if(v.charAt(0)==="{"){t=f.expandOptions(v,s)}else{t=s.events[v]}if(!t){f.fail("Error in event specification - could not resolve base event reference "+v+" to an event firer")}var u={};f.each(["fire","removeListener"],function(x){u[x]=function(){t[x].apply(null,arguments)}});u.addListener=function(A,z,x,y){t.addListener(f.event.dispatchListener(w,s,A,r,q),z,x,y)};return u}})};f.registerNamespace("fluid.expander");f.expander.preserveFromExpansion=function(q){var r={};var s=f.arrayToHash(["mergePolicy","mergeAllOptions","components","invokers","events","listeners","transformOptions"]);f.each(q.mergePolicy,function(u,t){if(f.mergePolicyIs(u,"noexpand")){s[t]=true}});f.each(s,function(w,v){var t=f.model.getPenultimate(q,v);var u=t.root[t.last];delete t.root[t.last];f.set(r,v,u)});return{restore:function(t){f.each(s,function(w,v){var u=f.get(r,v);if(u!==undefined){f.set(t,v,u)}})}}};f.expandOptions=function(r,s,q,t){if(!r){return r}return f.withInstantiator(s,function(x){var v=k(x,s,q,t);v.noCopy=true;var w;if(!f.isArrayable(r)&&!f.isPrimitive(r)){w=f.expander.preserveFromExpansion(r)}var u=f.expander.expandLight(r,v);if(w){w.restore(u)}return u})};f.locateTransformationRecord=function(q){return f.withInstantiator(q,function(s){var r=f.locateAllDemands(s,q,["fluid.transformOptions"]);return f.find(r,function(t){return t.uncess===0&&f.contains(t.spec.contexts,q.typeName)?t.spec.spec:undefined})})};f.expandComponentOptions=function(t,v,x){t=f.expandOptions(f.copy(t),x);var y={};if(v&&v.marker===f.EXPAND){var u=f.get(v,"localRecord.options");if(u){if(t&&t.mergePolicy){u.mergePolicy=t.mergePolicy}y.options=f.expandOptions(u,x)}y["arguments"]=f.get(v,"localRecord.arguments");var r=v.value;v=f.expandOptions(r,x,y,{direct:true})}y.directOptions=v;if(!y.options){y.options=v}var q=(v&&v.mergeAllOptions)||["{directOptions}"];var s=f.transform(q,function(z){return z==="{directOptions}"?y.directOptions:f.expandOptions(z,x,y,{direct:true})});var w=f.locateTransformationRecord(x);if(w){s[0].transformOptions=w.options}return[t].concat(s)};f.expandComponentOptions=f.wrapActivity(f.expandComponentOptions,["    while expanding component options ","arguments.1.value"," with record ","arguments.1"," for component ","arguments.2"]);f.initDependent=function(w,t,q,u){if(!w||w[t]){return}f.log('Beginning instantiation of component with name "'+t+'" as child of '+f.dumpThat(w));u=u||[];var r=f.threadLocal();if(q){var v=r["fluid.instantiator"];if(v&&v!==q){f.fail("Error in initDependent: user instantiator supplied with id "+q.id+" which differs from that for currently active instantiation with id "+v.id)}else{r["fluid.instantiator"]=q}}var s=w.options.components[t];f.withInstantiator(w,function(y){if(typeof(s)==="string"){w[t]=f.expandOptions([s],w)[0]}else{if(s.type){var x=f.resolveDemands(y,w,[s.type,t],u,{componentRecord:s});y.pushUpcomingInstantiation(w,t);f.tryCatch(function(){w[j]=true;var z=f.initSubcomponentImpl(w,{type:x.funcName},x.args);var B=f.composePath(y.idToPath[w.id]||"",t);var A=y.pathToComponent[B];if(A&&A!==z){y.clearComponent(w,t,A,null,true)}if(z&&z.typeName&&z.id&&z!==A){y.recordKnownComponent(w,z,t)}w[t]=z},null,function(){delete w[j];y.pushUpcomingInstantiation()})}else{w[t]=s}}},['    while instantiating dependent component with name "'+t+'" with record ',s," as child of ",w]);f.log('Finished instantiation of component with name "'+t+'" as child of '+f.dumpThat(w))};f.withInstantiator=function(t,s,r){var q=f.threadLocal();var u=q["fluid.instantiator"];if(!u){u=q["fluid.instantiator"]=f.instantiator()}return f.pushActivity(function(){return f.tryCatch(function(){if(t){u.recordComponent(t)}u.stack(1);return s(u)},null,function(){var v=u.stack(-1);if(v===0){delete q["fluid.instantiator"]}})},r)};f.bindDeferredComponent=function(s,q,r){f.withInstantiator(s,function(u){var t=f.makeArray(r.createOnEvent);f.each(t,function(v){s.events[v].addListener(function(){if(s[q]){u.clearComponent(s,q)}f.initDependent(s,q,u)},null,null,r.priority)})})};f.priorityForComponent=function(q){return q.priority?q.priority:(q.type==="fluid.typeFount"||f.hasGrade(f.defaults(q.type),"fluid.typeFount"))?"first":undefined};f.initDependents=function(u){var r=u.options;var t=r.components||{};var q={};f.each(t,function(w,v){if(!w.createOnEvent){var x=f.priorityForComponent(w);q[v]={key:v,priority:f.event.mapPriority(x,0)}}else{f.bindDeferredComponent(u,v,w)}});var s=f.event.sortListeners(q);f.withInstantiator(u,function(z){f.each(s,function(A){f.initDependent(u,A.key)});var v=r.invokers||{};for(var w in v){var y=v[w];var x=typeof(y)==="string"?y:null;u[w]=f.withInstantiator(u,function(A){f.log('Beginning instantiation of invoker with name "'+w+'" as child of '+f.dumpThat(u));return f.makeInvoker(A,u,x?null:y,x)},['    while instantiating invoker with name "'+w+'" with record ',y," as child of ",u]);f.log('Finished instantiation of invoker with name "'+w+'" as child of '+f.dumpThat(u))}})};f.staticEnvironment=f.typeTag("fluid.staticEnvironment");f.staticEnvironment.environmentClass=f.typeTag("fluid.browser");f.demands("fluid.threadLocal","fluid.browser",{funcName:"fluid.singleThreadLocal"});var g=f.typeTag("fluid.dynamicEnvironment");f.singleThreadLocal=function(){return g};f.threadLocal=function(){var q=f.locateDemands(f.freeInstantiator,null,["fluid.threadLocal"]);return f.invokeGlobalFunction(q.funcName,arguments)};function m(q,r,t,s){var u={type:r,path:t,value:s};q.fireChangeRequest(u)}f.withEnvironment=function(r,t,u){u=u||"";var q=f.threadLocal();var s=f.makeChangeApplier(q,{thin:true});return f.tryCatch(function(){for(var v in r){m(s,"ADD",f.model.composePath(u,v),r[v])}d.extend(q,r);return t()},null,function(){for(var v in r){m(s,"DELETE",f.model.composePath(u,v))}})};f.makeEnvironmentFetcher=function(r,q){return function(s){var t=f.get(f.threadLocal(),r);return f.fetchContextReference(s,q,t)}};f.extractEL=function(r,q){if(q.ELstyle==="ALL"){return r}else{if(q.ELstyle.length===1){if(r.charAt(0)===q.ELstyle){return r.substring(1)}}else{if(q.ELstyle==="${}"){var t=r.indexOf("${");var s=r.lastIndexOf("}");if(t===0&&s!==-1){return r.substring(2,s)}}}}};f.extractELWithContext=function(r,q){var s=f.extractEL(r,q);if(s&&s.charAt(0)==="{"){return f.parseContextReference(s,0)}return s?{path:s}:s};f.parseContextReference=function(q,s,r){var v=q.indexOf("}",s+1);if(v===-1){f.fail('Cannot parse context reference "'+q+'": Malformed context reference without }')}var t=q.substring(s+1,v);var u=r?q.indexOf(r,v+1):q.length;var w=q.substring(v+1,u);if(w.charAt(0)==="."){w=w.substring(1)}return{context:t,path:w,endpos:u}};f.renderContextReference=function(q){return"{"+q.context+"}"+q.path};f.fetchContextReference=function(q,s,r){var t=q.context?r[q.context]:s;if(!t){return t}return f.get(t,q.path)};f.resolveContextValue=function(s,r){if(r.bareContextRefs&&s.charAt(0)==="{"){var q=f.parseContextReference(s,0);
  return r.fetcher(q)}else{if(r.ELstyle&&r.ELstyle!=="${}"){var q=f.extractELWithContext(s,r);if(q){return r.fetcher(q)}}}while(typeof(s)==="string"){var w=s.indexOf("${");var v=s.indexOf("}",w+2);if(w!==-1&&v!==-1){var q;if(s.charAt(w+2)==="{"){q=f.parseContextReference(s,w+2,"}");v=q.endpos}else{q={path:s.substring(w+2,v)}}var t=r.fetcher(q);var u=(w===0&&v===s.length-1);if(t===undefined||t===null){return t}s=u?t:s.substring(0,w)+t+s.substring(v+1)}else{break}}return s};f.resolveContextValue=f.wrapActivity(f.resolveContextValue,["    while resolving context value ","arguments.0"]);function b(s,q){f.guardCircularity(q.seenIds,s,"expansion",' - please ensure options are not circularly connected, or protect from expansion using the "noexpand" policy or expander');function r(t){return b(t,q)}if(typeof(s)==="string"&&!q.noValue){return f.resolveContextValue(s,q)}else{if(f.isPrimitive(s)||s.nodeType!==undefined||s.jquery){return s}else{if(q.filter){return q.filter(s,r,q)}else{return(q.noCopy?f.each:f.transform)(s,function(u,t){return b(u,q)})}}}}f.defaults("fluid.resolveEnvironment",{ELstyle:"${}",bareContextRefs:true});f.resolveEnvironment=function(r,q){q=f.merge(null,f.defaults("fluid.resolveEnvironment"),q);q.seenIds={};return b(r,q)};f.expander.deferredCall=function(t,s,r){var u=s.expander;var q=(!u.args||f.isArrayable(u.args))?u.args:d.makeArray(u.args);q=r(q);return f.invokeGlobalFunction(u.func,q)};f.deferredCall=f.expander.deferredCall;f.deferredInvokeCall=function(t,s,r){var u=s.expander;var q=(!u.args||f.isArrayable(u.args))?u.args:d.makeArray(u.args);q=r(q);return f.invoke(u.func,q)};f.expander.noexpand=function(r,q){return d.extend(r,q.expander.tree)};f.noexpand=f.expander.noexpand;f.expander.lightFilter=function(v,t,q){var s;if(f.isArrayable(v)){s=q.noCopy?v:[];f.each(v,function(y,x){s[x]=t(y)})}else{s=q.noCopy?v:{};for(var r in v){var u=v[r];var w;if(r==="expander"&&!(q.expandOnly&&q.expandOnly[u.type])){w=f.getGlobalValue(u.type);if(w){return w.call(null,s,v,t,q)}}if(r!=="expander"||!w){s[r]=t(u)}}}return q.noCopy?v:s};f.expander.expandLight=function(s,r){var q=d.extend({},r);q.filter=f.expander.lightFilter;return f.resolveEnvironment(s,q)}})(jQuery,fluid_1_4);var fluid_1_4=fluid_1_4||{};(function(e,d){var c={};var b={};d.fetchResources=function(g,i,f){var h=d.initLittleComponent("fluid.fetchResources",f);h.resourceSpecs=g;h.callback=i;h.operate=function(){d.fetchResources.fetchResourcesImpl(h)};d.each(g,function(j){j.recurseFirer=d.event.getEventFirer();j.recurseFirer.addListener(h.operate);if(j.url&&!j.href){j.href=j.url}});if(h.options.amalgamateClasses){d.fetchResources.amalgamateClasses(g,h.options.amalgamateClasses,h.operate)}h.operate();return h};d.fetchResources.amalgamateClasses=function(h,g,f){d.each(g,function(i){var j=b[i];d.each(j,function(k,l){h[i+"!"+l]=k;k.recurseFirer.addListener(f)})})};d.fetchResources.timeSuccessCallback=function(f){if(f.timeSuccess&&f.options&&f.options.success){var g=f.options.success;f.options.success=function(){var i=new Date();var h=g.apply(null,arguments);d.log("External callback for URL "+f.href+" completed - callback time: "+(new Date().getTime()-i.getTime())+"ms");return h}}};function a(f){return f}d.fetchResources.clearResourceCache=function(f){if(f){delete c[a(f)]}else{d.clear(c)}};d.fetchResources.handleCachedRequest=function(g,f){var i=a(g.href);var h=c[i];if(h.$$firer$$){d.log("Handling request for "+i+" from cache");var j=g.fetchClass;if(j&&b[j]){d.log("Clearing pendingClass entry for class "+j);delete b[j][i]}c[i]=f;h.fire(f)}};d.fetchResources.completeRequest=function(f,g){f.queued=false;f.completeTime=new Date();d.log("Request to URL "+f.href+" completed - total elapsed time: "+(f.completeTime.getTime()-f.initTime.getTime())+"ms");f.recurseFirer.fire()};d.fetchResources.makeResourceCallback=function(f){return{success:function(g){f.resourceText=g;f.resourceKey=f.href;if(f.forceCache){d.fetchResources.handleCachedRequest(f,g)}d.fetchResources.completeRequest(f)},error:function(g,i,h){f.fetchError={status:g.status,textStatus:g.textStatus,errorThrown:h};d.fetchResources.completeRequest(f)}}};d.fetchResources.issueCachedRequest=function(g,f){var i=a(g.href);var h=c[i];if(!h){d.log("First request for cached resource with url "+i);h=d.event.getEventFirer();h.$$firer$$=true;c[i]=h;var j=g.fetchClass;if(j){if(!b[j]){b[j]={}}b[j][i]=g}f.cache=false;e.ajax(f)}else{if(!h.$$firer$$){f.success(h)}else{d.log("Request for cached resource which is in flight: url "+i);h.addListener(function(k){f.success(k)})}}};d.fetchResources.composeCallbacks=function(f,g){return g?function(){try{g.apply(null,arguments)}catch(h){d.log("Exception applying external fetchResources callback: "+h)}f.apply(null,arguments)}:f};d.fetchResources.composePolicy=function(h,g,f){return d.fetchResources.composeCallbacks(h,g)};d.defaults("fluid.fetchResources.issueRequest",{mergePolicy:{success:d.fetchResources.composePolicy,error:d.fetchResources.composePolicy,url:"reverse"}});d.fetchResources.issueRequest=function(g,h){var i=d.fetchResources.makeResourceCallback(g);var f={url:g.href,success:i.success,error:i.error,dataType:"text"};d.fetchResources.timeSuccessCallback(g);d.merge(d.defaults("fluid.fetchResources.issueRequest").mergePolicy,f,g.options);g.queued=true;g.initTime=new Date();d.log("Request with key "+h+" queued for "+g.href);if(g.forceCache){d.fetchResources.issueCachedRequest(g,f)}else{e.ajax(f)}};d.fetchResources.fetchResourcesImpl=function(l){var f=true;var j=true;var h=l.resourceSpecs;for(var i in h){var g=h[i];if(!g.options||g.options.async){j=false}if(g.href&&!g.completeTime){if(!g.queued){d.fetchResources.issueRequest(g,i)}if(g.queued){f=false}}else{if(g.nodeId&&!g.resourceText){var k=document.getElementById(g.nodeId);g.resourceText=d.dom.getElementText(k);g.resourceKey=g.nodeId}}}if(f&&l.callback&&!l.callbackCalled){l.callbackCalled=true;if(e.browser.mozilla&&!j){setTimeout(function(){l.callback(h)},1)}else{l.callback(h)}}};d.fetchResources.primeCacheFromResources=function(f){var i=d.defaults(f).resources;var h={typeName:"fluid.fetchResources.primeCacheFromResources"};var g=(d.expandOptions?d.expandOptions:d.identity)(d.copy(i),h);d.fetchResources(g)};d.registerNamespace("fluid.expander");d.expander.makeDefaultFetchOptions=function(f,h,g){return e.extend(true,{dataType:"text"},g,{success:function(i,k){var j=JSON.parse(i);k(f(j))},error:function(i,j){d.log("Error fetching "+h+": "+j)}})};d.expander.makeFetchExpander=function(f){return{expander:{type:"fluid.expander.deferredFetcher",href:f.url,options:d.expander.makeDefaultFetchOptions(f.disposer,f.url,f.options),resourceSpecCollector:"{resourceSpecCollector}",fetchKey:f.fetchKey}}};d.expander.deferredFetcher=function(j,f,g,k){var n=f.expander;var m=d.copy(n);var i=d.resolveEnvironment(n.resourceSpecCollector,k);delete m.type;delete m.resourceSpecCollector;delete m.fetchKey;var h=function(o){e.extend(j,o)};m.options.success=function(o){n.options.success(o,h)};var l=n.fetchKey||d.allocateGuid();i[l]=m;return j}})(jQuery,fluid_1_4);var fluid_1_4=fluid_1_4||{};(function(b,a){a.XMLP=function(c){return a.XMLP.XMLPImpl(c)};a.XMLP.closedTags={abbr:true,br:true,col:true,img:true,input:true,link:true,meta:true,param:true,hr:true,area:true,embed:true};a.XMLP._NONE=0;a.XMLP._ELM_B=1;a.XMLP._ELM_E=2;a.XMLP._ELM_EMP=3;a.XMLP._ATT=4;a.XMLP._TEXT=5;a.XMLP._ENTITY=6;a.XMLP._PI=7;a.XMLP._CDATA=8;a.XMLP._COMMENT=9;a.XMLP._DTD=10;a.XMLP._ERROR=11;a.XMLP._CONT_XML=0;a.XMLP._CONT_ALT=1;a.XMLP._ATT_NAME=0;a.XMLP._ATT_VAL=1;a.XMLP._STATE_PROLOG=1;a.XMLP._STATE_DOCUMENT=2;a.XMLP._STATE_MISC=3;a.XMLP._errs=[];a.XMLP._errs[a.XMLP.ERR_CLOSE_PI=0]="PI: missing closing sequence";a.XMLP._errs[a.XMLP.ERR_CLOSE_DTD=1]="DTD: missing closing sequence";a.XMLP._errs[a.XMLP.ERR_CLOSE_COMMENT=2]="Comment: missing closing sequence";a.XMLP._errs[a.XMLP.ERR_CLOSE_CDATA=3]="CDATA: missing closing sequence";a.XMLP._errs[a.XMLP.ERR_CLOSE_ELM=4]="Element: missing closing sequence";a.XMLP._errs[a.XMLP.ERR_CLOSE_ENTITY=5]="Entity: missing closing sequence";a.XMLP._errs[a.XMLP.ERR_PI_TARGET=6]="PI: target is required";a.XMLP._errs[a.XMLP.ERR_ELM_EMPTY=7]="Element: cannot be both empty and closing";a.XMLP._errs[a.XMLP.ERR_ELM_NAME=8]='Element: name must immediatly follow "<"';a.XMLP._errs[a.XMLP.ERR_ELM_LT_NAME=9]='Element: "<" not allowed in element names';a.XMLP._errs[a.XMLP.ERR_ATT_VALUES=10]="Attribute: values are required and must be in quotes";a.XMLP._errs[a.XMLP.ERR_ATT_LT_NAME=11]='Element: "<" not allowed in attribute names';a.XMLP._errs[a.XMLP.ERR_ATT_LT_VALUE=12]='Attribute: "<" not allowed in attribute values';a.XMLP._errs[a.XMLP.ERR_ATT_DUP=13]="Attribute: duplicate attributes not allowed";a.XMLP._errs[a.XMLP.ERR_ENTITY_UNKNOWN=14]="Entity: unknown entity";a.XMLP._errs[a.XMLP.ERR_INFINITELOOP=15]="Infinite loop";a.XMLP._errs[a.XMLP.ERR_DOC_STRUCTURE=16]="Document: only comments, processing instructions, or whitespace allowed outside of document element";a.XMLP._errs[a.XMLP.ERR_ELM_NESTING=17]="Element: must be nested correctly";a.XMLP._checkStructure=function(e,f){var c=e.m_stack;if(a.XMLP._STATE_PROLOG==e.m_iState){e.m_iState=a.XMLP._STATE_DOCUMENT}if(a.XMLP._STATE_DOCUMENT===e.m_iState){if((a.XMLP._ELM_B==f)||(a.XMLP._ELM_EMP==f)){e.m_stack[c.length]=e.getName()}if((a.XMLP._ELM_E==f)||(a.XMLP._ELM_EMP==f)){if(c.length===0){return a.XMLP._NONE}var d=c[c.length-1];e.m_stack.length--;if(d===null||d!==e.getName()){return e._setErr(e,a.XMLP.ERR_ELM_NESTING)}}}return f};a.XMLP._parseCDATA=function(d,c){var e=d.m_xml.indexOf("]]>",c);if(e==-1){return a.XMLP._setErr(d,a.XMLP.ERR_CLOSE_CDATA)}a.XMLP._setContent(d,a.XMLP._CONT_XML,c,e);d.m_iP=e+3;return a.XMLP._CDATA};a.XMLP._parseComment=function(d,c){var e=d.m_xml.indexOf("-->",c);if(e==-1){return a.XMLP._setErr(d,a.XMLP.ERR_CLOSE_COMMENT)}a.XMLP._setContent(d,a.XMLP._CONT_XML,c-4,e+3);d.m_iP=e+3;return a.XMLP._COMMENT};a.XMLP._parseDTD=function(g,d){var h,c,e,f;h=g.m_xml.indexOf(">",d);if(h==-1){return a.XMLP._setErr(g,a.XMLP.ERR_CLOSE_DTD)
  }e=g.m_xml.indexOf("[",d);c=((e!=-1)&&(e<h))?"]>":">";while(true){if(h==f){return a.XMLP._setErr(g,a.XMLP.ERR_INFINITELOOP)}f=h;h=g.m_xml.indexOf(c,d);if(h==-1){return a.XMLP._setErr(g,a.XMLP.ERR_CLOSE_DTD)}if(g.m_xml.substring(h-1,h+2)!="]]>"){break}}g.m_iP=h+c.length;return a.XMLP._DTD};a.XMLP._parsePI=function(e,d){var h,c,g,i,f;h=e.m_xml.indexOf("?>",d);if(h==-1){return a.XMLP._setErr(e,a.XMLP.ERR_CLOSE_PI)}c=a.SAXStrings.indexOfNonWhitespace(e.m_xml,d,h);if(c==-1){return a.XMLP._setErr(e,a.XMLP.ERR_PI_TARGET)}g=a.SAXStrings.indexOfWhitespace(e.m_xml,c,h);if(g==-1){g=h}i=a.SAXStrings.indexOfNonWhitespace(e.m_xml,g,h);if(i==-1){i=h}f=a.SAXStrings.lastIndexOfNonWhitespace(e.m_xml,i,h);if(f==-1){f=h-1}e.m_name=e.m_xml.substring(c,g);a.XMLP._setContent(e,a.XMLP._CONT_XML,i,f+1);e.m_iP=h+2;return a.XMLP._PI};a.XMLP._parseText=function(d,c){var e=d.m_xml.indexOf("<",c);if(e==-1){e=d.m_xml.length}a.XMLP._setContent(d,a.XMLP._CONT_XML,c,e);d.m_iP=e;return a.XMLP._TEXT};a.XMLP._setContent=function(d,e){var c=arguments;if(a.XMLP._CONT_XML==e){d.m_cAlt=null;d.m_cB=c[2];d.m_cE=c[3]}else{d.m_cAlt=c[2];d.m_cB=0;d.m_cE=c[2].length}d.m_cSrc=e};a.XMLP._setErr=function(e,d){var c=a.XMLP._errs[d];e.m_cAlt=c;e.m_cB=0;e.m_cE=c.length;e.m_cSrc=a.XMLP._CONT_ALT;return a.XMLP._ERROR};a.XMLP._parseElement=function(o,p){var l,f,i;var q,g,c;f=l=o.m_xml.indexOf(">",p);if(l==-1){return o._setErr(o,a.XMLP.ERR_CLOSE_ELM)}if(o.m_xml.charAt(p)=="/"){q=a.XMLP._ELM_E;p++}else{q=a.XMLP._ELM_B}if(o.m_xml.charAt(l-1)=="/"){if(q==a.XMLP._ELM_E){return a.XMLP._setErr(o,a.XMLP.ERR_ELM_EMPTY)}q=a.XMLP._ELM_EMP;f--}o.nameRegex.lastIndex=p;var m=o.nameRegex.exec(o.m_xml);if(!m){return a.XMLP._setErr(o,a.XMLP.ERR_ELM_NAME)}g=m[1].toLowerCase();if("li"===g&&q!==a.XMLP._ELM_E&&o.m_stack.length>0&&o.m_stack[o.m_stack.length-1]==="li"&&!o.m_emitSynthetic){o.m_name="li";o.m_emitSynthetic=true;return a.XMLP._ELM_E}o.m_attributes={};o.m_cAlt="";if(o.nameRegex.lastIndex<f){o.m_iP=o.nameRegex.lastIndex;while(o.m_iP<f){o.attrStartRegex.lastIndex=o.m_iP;var e=o.attrStartRegex.exec(o.m_xml);if(!e){return a.XMLP._setErr(o,a.XMLP.ERR_ATT_VALUES)}var j=e[1].toLowerCase();var n;if(o.m_xml.charCodeAt(o.attrStartRegex.lastIndex)===61){var d=o.m_xml.charCodeAt(o.attrStartRegex.lastIndex+1)===34?o.attrValRegex:o.attrValIERegex;d.lastIndex=o.attrStartRegex.lastIndex+1;e=d.exec(o.m_xml);if(!e){return a.XMLP._setErr(o,a.XMLP.ERR_ATT_VALUES)}n=e[1]}else{n=j;d=o.attrStartRegex}if(!o.m_attributes[j]){o.m_attributes[j]=n}else{return a.XMLP._setErr(o,a.XMLP.ERR_ATT_DUP)}o.m_iP=d.lastIndex}}if(g.indexOf("<")!=-1){return a.XMLP._setErr(o,a.XMLP.ERR_ELM_LT_NAME)}o.m_name=g;o.m_iP=l+1;if(a.XMLP.closedTags[g]){o.closeRegex.lastIndex=l+1;var h=o.closeRegex.exec;if(h){var k=o.m_xml.indexOf(g,h.lastIndex);if(k===h.lastIndex){return q}else{return a.XMLP._ELM_EMP}}}o.m_emitSynthetic=false;return q};a.XMLP._parse=function(f){var g=f.m_iP;var d=f.m_xml;if(g===d.length){return a.XMLP._NONE}var h=d.charAt(g);if(h==="<"){var e=d.charAt(g+1);if(e==="?"){return a.XMLP._parsePI(f,g+2)}else{if(e==="!"){if(g===d.indexOf("<!DOCTYPE",g)){return a.XMLP._parseDTD(f,g+9)}else{if(g===d.indexOf("<!--",g)){return a.XMLP._parseComment(f,g+4)}else{if(g===d.indexOf("<![CDATA[",g)){return a.XMLP._parseCDATA(f,g+9)}}}}else{return a.XMLP._parseElement(f,g+1)}}}else{return a.XMLP._parseText(f,g)}};a.XMLP.XMLPImpl=function(d){var c={};c.m_xml=d;c.m_iP=0;c.m_iState=a.XMLP._STATE_PROLOG;c.m_stack=[];c.m_attributes={};c.m_emitSynthetic=false;c.getColumnNumber=function(){return a.SAXStrings.getColumnNumber(c.m_xml,c.m_iP)};c.getContent=function(){return(c.m_cSrc==a.XMLP._CONT_XML)?c.m_xml:c.m_cAlt};c.getContentBegin=function(){return c.m_cB};c.getContentEnd=function(){return c.m_cE};c.getLineNumber=function(){return a.SAXStrings.getLineNumber(c.m_xml,c.m_iP)};c.getName=function(){return c.m_name};c.next=function(){return a.XMLP._checkStructure(c,a.XMLP._parse(c))};c.nameRegex=/([^\s\/>]+)/g;c.attrStartRegex=/\s*([\w:_][\w:_\-\.]*)/gm;c.attrValRegex=/\"([^\"]*)\"\s*/gm;c.attrValIERegex=/([^\>\s]+)\s*/gm;c.closeRegex=/\s*<\//g;return c};a.SAXStrings={};a.SAXStrings.WHITESPACE=" \t\n\r";a.SAXStrings.QUOTES="\"'";a.SAXStrings.getColumnNumber=function(f,e){if(!f){return -1}e=e||f.length;var c=f.substring(0,e).split("\n");c.length--;var d=c.join("\n").length;return e-d};a.SAXStrings.getLineNumber=function(d,c){if(!d){return -1}c=c||d.length;return d.substring(0,c).split("\n").length};a.SAXStrings.indexOfNonWhitespace=function(h,d,f){if(!h){return -1}d=d||0;f=f||h.length;for(var e=d;e<f;++e){var g=h.charAt(e);if(g!==" "&&g!=="\t"&&g!=="\n"&&g!=="\r"){return e}}return -1};a.SAXStrings.indexOfWhitespace=function(f,c,e){if(!f){return -1}c=c||0;e=e||f.length;for(var d=c;d<e;d++){if(a.SAXStrings.WHITESPACE.indexOf(f.charAt(d))!=-1){return d}}return -1};a.SAXStrings.lastIndexOfNonWhitespace=function(f,c,e){if(!f){return -1}c=c||0;e=e||f.length;for(var d=e-1;d>=c;d--){if(a.SAXStrings.WHITESPACE.indexOf(f.charAt(d))==-1){return d}}return -1};a.SAXStrings.replace=function(g,c,f,e,d){if(!g){return""}c=c||0;f=f||g.length;return g.substring(c,f).split(e).join(d)}})(jQuery,fluid_1_4);fluid_1_4=fluid_1_4||{};(function(e,d){d.parseTemplate=function(k,L,h,f,B){B=B||{};if(!k){d.fail("empty template supplied to fluid.parseTemplate")}var H;var C;var P;var K=0;var A=0;var s=false;var m=-1;var l=-1;var Q=false;var r=[];var i={};var p=[];var j=function(R,t){return{nestingdepth:t,lumpindex:R,parent:H}};function E(t){return t.length===1&&t[0].predList.length===1&&t[0].predList[0].clazz}function M(V,R,U){H.rootlump=j(0,-1);P=[H.rootlump];K=0;A=0;s=false;m=-1;l=-1;L=V;Q=R;if(U){for(var T=0;T<U.length;++T){var t=d.parseSelector(U[T].selector);var S=E(t);if(S){i[S]=U[T].id}else{p.push([]);r.push(e.extend({},U[T],{tree:t}))}}}}function D(){for(var t=P.length-1;t>=0;--t){var R=P[t];if(R.rsfID!==undefined){return R}}return H.rootlump}function G(){var t=j(K,A);if(Q){t.line=C.getLineNumber();t.column=C.getColumnNumber()}H.lumps[K]=t;++K;return t}function u(R,t,S){var T=R[t];if(!T){T=[];R[t]=T}T[T.length]=S}function o(t,R){if(t.indexOf("scr=contribute-")!==-1){var S=t.substring("scr=contribute-".length);u(H.collectmap,S,R)}}function J(t){return"<"+t.tagname+">"}function y(R,t){if(!t){return false}return(" "+t+" ").indexOf(" "+R+" ")!==-1}function x(T,U,R){if(T.predList){for(var S=0;S<T.predList.length;++S){var t=T.predList[S];if(t.id&&U.attributemap.id!==t.id){return false}if(t.clazz&&!y(t.clazz,R)){return false}if(t.tag&&U.tagname!==t.tag){return false}}return true}}function I(X){var R;var V=X.attributemap["class"];if(V){var Y=V.split(" ");for(var U=0;U<Y.length;++U){var W=i[e.trim(Y[U])];if(W){return W}}}for(var U=0;U<r.length;++U){var Z=r[U];var aa=p[U];var t=aa.length;if(t<Z.tree.length){var S=Z.tree[t];if(t>0){if(Z.tree[t-1].child&&aa[t-1]!==X.nestingdepth-1){continue}}var T=x(S,X,V);if(T){aa[aa.length]=X.nestingdepth;if(aa.length===Z.tree.length){if(R!==undefined){d.fail("Cutpoint specification error - node "+J(X)+" has already matched with rsf:id of "+R)}if(Z.id===undefined||Z.id===null){d.fail("Error in cutpoints list - entry at position "+U+" does not have an id set")}R=Z.id}}}}return R}function F(){if(r){for(var t=0;t<r.length;++t){var R=p[t];if(R.length>0&&R[R.length-1]===A){R.length--}}}}function v(){F();var t=G();--A;t.text="</"+C.getName()+">";var R=P[P.length-1];R.close_tag=H.lumps[K-1];P.length--;s=true}function g(X,ab){++A;if(s){s=false;var U=G();U.nestingdepth--}if(H.firstdocumentindex===-1){H.firstdocumentindex=K}var W=G();var t=P[P.length-1];W.uplump=t;var Z=C.getName();W.tagname=Z;var aa=W.attributemap=C.m_attributes;var Y=aa[d.ID_ATTRIBUTE];if(Y===undefined){Y=I(W)}for(var T in aa){if(Y===undefined){if(/href|src|codebase|action/.test(T)){Y="scr=rewrite-url"}else{if(Y===undefined&&/for|headers/.test(T)){Y="scr=null"}}}}if(Y){if(Y.charCodeAt(0)===126){Y=Y.substring(1);W.elide=true}o(Y,W);W.rsfID=Y;var S=D();if(!S.downmap){S.downmap={}}while(S){if(S.downmap){u(S.downmap,Y,W)}S=S.uplump}u(H.globalmap,Y,W);var R=Y.indexOf(":");if(R!==-1){var V=Y.substring(0,R);if(!t.finallump){t.finallump={}}t.finallump[V]=W}}W.text="<"+Z+d.dumpAttributes(aa)+(X&&!Y?"/>":">");P[P.length]=W;if(X){if(Y){v()}else{--A;P.length--}}}function q(){if(m!==-1){if(H.firstdocumentindex===-1){H.firstdocumentindex=K}var R=C.getContent().substr(m,l-m);s=false;var t=G();t.text=R;m=-1}}H=d.XMLViewTemplate();M(L,B.debugMode,f);var N=k.indexOf(d.ID_ATTRIBUTE);if(h){var w=k.indexOf(">",N);C=d.XMLP(k.substring(w+1))}else{C=d.XMLP(k)}parseloop:while(true){var O=C.next();switch(O){case d.XMLP._ELM_B:q();g(false,"");break;case d.XMLP._ELM_E:q();v();break;case d.XMLP._ELM_EMP:q();g(true,"");break;case d.XMLP._PI:case d.XMLP._DTD:m=-1;continue;case d.XMLP._TEXT:case d.XMLP._ENTITY:case d.XMLP._CDATA:case d.XMLP._COMMENT:if(m===-1){m=C.m_cB}l=C.m_cE;break;case d.XMLP._ERROR:d.setLogging(true);var n="Error parsing template: "+C.m_cAlt+" at line "+C.getLineNumber();d.log(n);d.log("Just read: "+C.m_xml.substring(C.m_iP-30,C.m_iP));d.log("Still to read: "+C.m_xml.substring(C.m_iP,C.m_iP+30));d.fail(n);break parseloop;case d.XMLP._NONE:break parseloop}}q();var z=P.length-1;if(z){d.fail("Error parsing template - unclosed tag(s) of depth "+(z)+": "+d.transform(P.splice(1,z),function(t){return J(t)}).join(", "))}return H};d.debugLump=function(g){var f=g.text;f+=" at ";f+="lump line "+g.line+" column "+g.column+" index "+g.lumpindex;f+=g.parent.href===null?"":" in file "+g.parent.href;return f};d.ID_ATTRIBUTE="rsf:id";d.getPrefix=function(g){var f=g.indexOf(":");return f===-1?g:g.substring(0,f)};d.SplitID=function(h){var g={};var f=h.indexOf(":");if(f===-1){g.prefix=h}else{g.prefix=h.substring(0,f);g.suffix=h.substring(f+1)}return g};d.XMLViewTemplate=function(){return{globalmap:{},collectmap:{},lumps:[],firstdocumentindex:-1}};d.XMLEncode=function(f){return f.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/\"/g,"&quot;")};d.dumpAttributes=function(f){var h="";for(var i in f){var g=f[i];
  if(g!==null&&g!==undefined){h+=" "+i+'="'+g+'"'}}return h};d.aggregateMMap=function(i,h){for(var f in h){var g=i[f];if(!g){i[f]=[]}i[f]=i[f].concat(h[f])}};d.parseTemplates=function(k,m,f){var h=[];f=f||{};h.globalmap={};for(var l=0;l<m.length;++l){var j=k[m[l]];var n=j.href.lastIndexOf("/");var g=n===-1?"":j.href.substring(0,n+1);var o=d.parseTemplate(j.resourceText,g,f.scanStart&&l===0,j.cutpoints,f);if(l===0){d.aggregateMMap(h.globalmap,o.globalmap)}o.href=j.href;o.baseURL=g;o.resourceKey=j.resourceKey;h[l]=o;d.aggregateMMap(h.globalmap,o.rootlump.downmap)}return h};var c="(?:[\\w\u0128-\uFFFF*_-]|\\\\.)";var b=new RegExp("([#.]?)("+c+"+)","g");var a=new RegExp("\\s*(>)?\\s*","g");d.parseSelector=function(l){var g=[];l=e.trim(l);b.lastIndex=0;var k=0;while(true){var i=[];while(true){var o=b.exec(l);if(!o||o.index!==k){break}var j={};var n=o[2];if(o[1]===""){j.tag=n}else{if(o[1]==="#"){j.id=n}else{if(o[1]==="."){j.clazz=n}}}i[i.length]=j;k=b.lastIndex}a.lastIndex=k;var f={predList:i};var h=a.exec(l);if(!h||h.index!==k){var m=l.substring(k);d.fail("Error in selector string - can not match child selector expression at "+m)}if(h[1]===">"){f.child=true}g[g.length]=f;if(a.lastIndex>=l.length){break}k=a.lastIndex;b.lastIndex=a.lastIndex}return g}})(jQuery,fluid_1_4);fluid_1_4=fluid_1_4||{};(function(h,j){function n(o){return"as child of "+(o.parent.fullID?"component with full ID "+o.parent.fullID:"root")}function i(r){var t="";var p=r;if(r.children===undefined){t=r.ID+(r.localID!==undefined?r.localID:"");p=r.parent}while(p.parent){var s=p.parent;if(p.fullID!==undefined){t=p.fullID+t;return t}if(p.noID===undefined){var o=p.ID;if(o===undefined){j.fail("Error in component tree - component found with no ID "+n(s)+": please check structure")}var q=o.indexOf(":");var u=q===-1?o:o.substring(0,q);t=u+":"+(p.localID===undefined?"":p.localID)+":"+t}p=s}return t}var k={};k.isBoundPrimitive=function(o){return j.isPrimitive(o)||o instanceof Array&&(o.length===0||typeof(o[0])==="string")};var g;function c(q,p){if(k.isBoundPrimitive(q)){return{componentType:"UIBound",value:q,ID:p}}else{var o=g(q);if(o.ID){return{ID:p,componentType:"UIContainer",children:[o]}}else{o.ID=p;return o}}}function f(q){if(!(q instanceof Array)){var r=[];for(var p in q){var s=q[p];if(s instanceof Array){for(var o=0;o<s.length;++o){var t=c(s[o],p);r[r.length]=t}}else{r[r.length]=c(s,p)}}return r}else{return q}}function d(o,q,p){if(o.value===undefined&&o.valuebinding!==undefined){if(!q){j.fail("Cannot perform value fixup for valuebinding "+o.valuebinding+" since no model was supplied to rendering")}o.value=j.get(q,o.valuebinding,p)}}function m(q,r,p,o){if(q[r]!==undefined){if(k.isBoundPrimitive(q[r])){q[r]={value:q[r]}}else{if(q[r].messagekey){q[r].componentType="UIMessage"}}}else{q[r]={value:null}}d(q[r],p,o)}k.duckMap={children:"UIContainer",value:"UIBound",valuebinding:"UIBound",messagekey:"UIMessage",markup:"UIVerbatim",selection:"UISelect",target:"UILink",choiceindex:"UISelectChoice",functionname:"UIInitBlock"};var b={UISelect:["selection","optionlist","optionnames"],UILink:["target","linktext"],UIVerbatim:["markup"],UIMessage:["messagekey"]};k.boundMap=j.transform(b,j.arrayToHash);k.inferComponentType=function(o){for(var p in k.duckMap){if(o[p]!==undefined){return k.duckMap[p]}}};k.applyComponentType=function(o){o.componentType=k.inferComponentType(o);if(o.componentType===undefined&&o.ID!==undefined){o.componentType="UIBound"}};g=function(s,r,q){if(s){k.applyComponentType(s)}if(!s||s.componentType===undefined){var p=s.decorators;if(p){delete s.decorators}s={componentType:"UIContainer",children:s};s.decorators=p}var o=s.componentType;if(o==="UIContainer"){s.children=f(s.children)}else{var t=k.boundMap[o];if(t){j.each(t,function(v,u){m(s,u,r,q)})}}return s};function l(y,v,q){if(y.componentType===undefined){y=g(y,v,q)}if(y.componentType!=="UIContainer"&&!y.parent){y={children:[y]}}if(y.children){y.childmap={};for(var u=0;u<y.children.length;++u){var p=y.children[u];if(p.componentType===undefined){p=g(p,v,q);y.children[u]=p}p.parent=y;if(p.ID===undefined){j.fail("Error in component tree: component found with no ID "+n(p))}y.childmap[p.ID]=p;var s=p.ID.indexOf(":");if(s===-1){}else{var w=p.ID.substring(0,s);var o=y.childmap[w];if(!o){o=[];y.childmap[w]=o}if(p.localID===undefined&&o.length!==0){p.localID=o.length}o[o.length]=p}p.fullID=i(p);var r=p.componentType;if(r==="UISelect"){p.selection.fullID=p.fullID+"-selection"}else{if(r==="UIInitBlock"){var x=p.functionname+"(";for(var t=0;t<p.arguments.length;++t){if(p.arguments[t] instanceof j.ComponentReference){p.arguments[t]=p.parent.fullID+p.arguments[t].reference}x+=JSON.stringify(p.arguments[t]);if(t<p.arguments.length-1){x+=", "}}p.markup={value:x+")\n"};p.componentType="UIVerbatim"}else{if(r==="UIBound"){d(p,v,q)}}}l(p,v,q)}}return y}j.NULL_STRING="\u25a9null\u25a9";var e={a:"href",link:"href",img:"src",frame:"src",script:"src",style:"src",input:"src",embed:"src",form:"action",applet:"codebase",object:"codebase"};k.decoratorComponentPrefix="**-renderer-";k.IDtoComponentName=function(o,p){return k.decoratorComponentPrefix+o.replace(/\./g,"")+"-"+p};k.invokeFluidDecorator=function(v,s,o,r,q){var u;if(q.instantiator&&q.parentComponent){var t=q.parentComponent;var p=k.IDtoComponentName(o,r);j.set(t,j.path("options","components",p),{type:v});u=j.initDependent(q.parentComponent,p,q.instantiator,s)}else{u=j.invokeGlobalFunction(v,s)}return u};j.renderer=function(q,P,Z,s){Z=Z||{};P=P||{};var aD=Z.debugMode;if(!Z.messageLocator&&Z.messageSource){Z.messageLocator=j.resolveMessageSource(Z.messageSource)}Z.document=Z.document||document;var G=s||{};var ad={};var av={};var ao={};var Q={};var R={};var an="";var aa=Z;var ak=[];var I={};var A={};var al={};function aA(aF,aE,aG){return aF.resourceKey+aE.fullID+aG}function O(aJ,aE,aG,aL){var aK;var aI=aG?aG[aJ]:null;if(aI){for(var aF=0;aF<aI.length;++aF){var aH=aI[aF];if(!aK&&aH.rsfID===aE){aK=aH}if(aH.rsfID===aJ){return aH}}}return aK}function ax(aH,aJ){var aI=aJ.jointID?aJ.jointID:aJ.ID;var aG=j.SplitID(aI);var aE=aG.prefix+":";var aF=O(aI,aE,aH.downmap,aJ);if(aF){return aF}if(aJ.children){aF=O(aI,aE,ad,aJ);if(aF){return aF}}return null}function M(aE){if(!Q[aE.href]){j.aggregateMMap(R,aE.collectmap);Q[aE.href]=true}}var at;function T(aJ,aG){for(var aH=0;aH<aJ.children.length;++aH){var aK=aJ.children[aH];if(aK.children){var aM=ax(aG,aK);if(aM){av[aK.fullID]=aM;var aE=aM.attributemap.id;if(aE!==undefined){ao[aA(aG.parent,aJ,aE)]=aK.fullID}M(aM.parent);T(aK,aM)}}}if(aG.downmap){for(var aE in aG.downmap){var aL=aG.downmap[aE];for(var aH=0;aH<aL.length;++aH){var aI=aL[aH];var aN=aI.attributemap.id;if(aN!==undefined&&aI.rsfID!==undefined){var aM=at(aJ,aI.rsfID);if(aM!==null){var aF=aM.fullID;if(aM.componentType==="UISelect"){aF=aF+"-selection"}ao[aA(aG.parent,aJ,aN)]=aF}}}}}}function N(aG,aF,aE){av={};ao={};Q={};R={};ad=aG;av[aF.fullID]=aE;T(aF,aE)}function E(aF,aH,aE){for(;aH<aE;++aH){var aG=aF[aH].text;if(aG){an+=aF[aH].text}}}function ac(aG,aJ,aE,aI,aF){var aK=aJ;while(true){if(aJ===aG.length){break}var aH=aG[aJ];if(aH.nestingdepth<aE){break}if(aH.rsfID!==undefined){if(!aF){break}if(aF&&aH.nestingdepth>aE+(aI?0:1)){j.log("Error in component tree - leaf component found to contain further components - at "+aH.toString())}else{break}}++aJ}if(!aI&&(aJ===aG.length||!aG[aJ].rsfID)){--aJ}E(aG,aK,aJ);return aJ}function v(aE){return false}function w(aE){return aE!==null&&aE!==undefined&&!v(aE)}var K={};function x(){if(!K.iselide){an+="<"+K.uselump.tagname}}function aw(){if(!K.iselide){an+="</"+K.uselump.tagname+">"}}function af(){E(K.uselump.parent.lumps,K.uselump.lumpindex+1,K.close.lumpindex+(K.iselide?0:1))}function U(){return K.endopen.lumpindex===K.close.lumpindex&&j.XMLP.closedTags[K.uselump.tagname]}function aj(){if(U()){if(!K.iselide){an+="/>"}}else{if(!K.iselide){an+=">"}E(K.uselump.parent.lumps,K.endopen.lumpindex,K.close.lumpindex+(K.iselide?0:1))}}function am(){if(!K.iselide){an+=j.dumpAttributes(K.attrcopy)}aj()}function ar(){if(K.iselide){am()}else{an+=j.dumpAttributes(K.attrcopy);var aE=U();an+=aE?"/>":">";K.nextpos=aE?K.close.lumpindex+1:K.endopen.lumpindex}}function aB(aE){an+=j.dumpAttributes(K.attrcopy);if(!K.iselide){an+=">"}an+=j.XMLEncode(aE.toString());aw()}function ah(aE){if(w(aE)){aB(aE)}else{am()}}function az(aE){if(K.iselide){ah(K.value)}else{if(w(aE)){aB(aE)}else{ar()}}}function o(aG,aE){if(aa.urlRewriter){var aH=aa.urlRewriter(aE);if(aH){return aH}}if(!aa.rebaseURLs){return aE}var aF=aE.indexOf(":/");if(aE.charAt(0)==="/"||aF!==-1&&aF<7){return aE}else{return aa.baseURL+aE}}function ay(aG){an+='<input type="hidden" ';var aF=aG.virtual;var aE={};aE[aF?"id":"name"]=aG.name;aE.value=aG.value;an+=j.dumpAttributes(aE);an+=" />\n"}var W;function r(aE,aF){if(!aF){return}var aJ=K.uselump.tagname;var aH=aa.applier;function aI(){j.applyChange(j.byId(aF),undefined,aH)}if(aa.autoBind&&/input|select|textarea/.test(aJ)&&!I[aF]){var aG=[{jQuery:["change",aI]}];if(h.browser.msie&&aJ==="input"&&/radio|checkbox/.test(K.attrcopy.type)){aG.push({jQuery:["click",aI]})}if(h.browser.safari&&aJ==="input"&&K.attrcopy.type==="radio"){aG.push({jQuery:["keyup",aI]})}W(aE,aG,K.attrcopy,aF)}}function L(aF,aH){if(aF){var aG=aH?aH:aF;if(G&&aG.valuebinding){var aE=aG.submittingname||aF.finalID;G[aE]={name:aE,EL:aG.valuebinding,oldvalue:aG.value};r(aF,aF.finalID)}if(aF.fossilizedbinding){ay(aF.fossilizedbinding)}if(aF.fossilizedshaper){ay(aF.fossilizedshaper)}}}function D(aE){if(!I[aE.selection.fullID]){I[aE.selection.fullID]=true;L(aE.selection);L(aE.optionlist);L(aE.optionnames)}}function Y(aE,aG){var aF=aE.selection;return aF.value&&typeof(aF.value)!=="string"&&typeof(aF.value.length)==="number"?h.inArray(aG,aF.value,aG)!==-1:aF.value===aG}function ap(aE,aF){aE=aE.parent;while(aF.indexOf("..::")===0){aF=aF.substring(4);aE=aE.parent}return aE.childmap[aF]}function F(aH,aG,aF,aJ){if(!aF){delete aH["rsf:id"]}if(aG.finalID!==undefined){aH.id=aG.finalID}else{if(aJ!==undefined){aH.id=aJ}else{if(aH.id||aF){aH.id=aG.fullID
  }}}var aI=1;var aE=aH.id;while(aa.document.getElementById(aH.id)||A[aH.id]){aH.id=aE+"-"+(aI++)}aG.finalID=aH.id;return aH.id}function C(aF,aE,aG){var aH=aG||aE;F(aF,aE,true,aE.fullID);if(aH.submittingname===undefined&&aH.willinput!==false){aH.submittingname=aH.finalID||aH.fullID}return aH.submittingname}function au(aF){var aH=[];if(aF.type){aH[0]=aF}else{for(var aG in aF){if(aG==="$"){aG="jQuery"}var aI=aF[aG];var aE={type:aG};if(aG==="jQuery"){aE.func=aI[0];aE.args=aI.slice(1)}else{if(aG==="addClass"||aG==="removeClass"){aE.classes=aI}else{if(aG==="attrs"){aE.attributes=aI}else{if(aG==="identify"){aE.key=aI}}}}aH[aH.length]=aE}}return aH}W=function(aI,aM,aF,aK){aa.idMap=aa.idMap||{};for(var aH=0;aH<aM.length;++aH){var aG=aM[aH];var aJ=aG.type;if(!aJ){var aL=au(aG);W(aI,aL,aF,aK);continue}if(aJ==="$"){aJ=aG.type="jQuery"}if(aJ==="jQuery"||aJ==="event"||aJ==="fluid"){var aE=F(aF,aI,true,aK);if(aG.ids===undefined){aG.ids=[];ak[ak.length]=aG}aG.ids.push(aE)}else{if(aJ==="attrs"){j.each(aG.attributes,function(aP,aO){if(aP===null||aP===undefined){delete aF[aO]}else{aF[aO]=j.XMLEncode(aP)}})}else{if(aJ==="addClass"||aJ==="removeClass"){var aN={nodeType:1,className:aF["class"]||""};h(aN)[aJ](aG.classes);aF["class"]=aN.className}else{if(aJ==="identify"){var aE=F(aF,aI,true,aK);aa.idMap[aG.key]=aE}else{if(aJ!=="null"){j.log("Unrecognised decorator of type "+aJ+" found at component of ID "+aK)}}}}}}};function J(aE,aF){if(!aE.decorators){return}if(aE.decorators.length===undefined){aE.decorators=au(aE.decorators)}W(aE,aE.decorators,aF)}function ab(aG,aE){if(aE.elide){return}var aF={};h.extend(true,aF,aE.attributemap);F(aF,aG);J(aG,aF);an+="<"+aE.tagname+" ";an+=j.dumpAttributes(aF);an+=">"}function ag(aE){if(!aE){return aE}return j.transform(aE,function(aF,aG){m(aE,aG,aa.model,aa.resolverGetConfig);return aE[aG].value})}function aq(aF){if(aF.componentType==="UIMessage"){aF.componentType="UIBound";if(!aa.messageLocator){aF.value="[No messageLocator is configured in options - please consult documentation on options.messageSource]"}else{m(aF,"messagekey",aa.model,aa.resolverGetConfig);var aE=ag(aF.args);aF.value=aa.messageLocator(aF.messagekey.value,aE)}}}function S(aQ){var aI=K.attrcopy;aq(aQ);var aO=aQ.componentType;var aT=K.uselump.tagname;J(aQ,aI);function aF(aX,aY){j.fail("Error in component tree - UISelectChoice with id "+aX.fullID+aY)}if(aO==="UIBound"||aO==="UISelectChoice"){var aK;if(aQ.choiceindex!==undefined){if(aQ.parentRelativeID!==undefined){aK=ap(aQ,aQ.parentRelativeID);if(!aK){aF(aQ," has parentRelativeID of "+aQ.parentRelativeID+" which cannot be resolved")}}else{aF(aQ," does not have parentRelativeID set")}C(aI,aQ,aK.selection);D(aK)}var aH=aK?aK.selection.submittingname:aQ.submittingname;if(!aK&&aQ.valuebinding){aH=C(aI,aQ)}if(aT==="input"||aT==="textarea"){if(aH!==undefined){aI.name=aH}}L(aQ,aK?aK.selection:null);if(typeof(aQ.value)==="boolean"||aI.type==="radio"||aI.type==="checkbox"){var aJ;var aS=aQ.value;if(aQ.choiceindex!==undefined){if(!aK.optionlist.value){j.fail("Error in component tree - selection control with full ID "+aK.fullID+" has no values")}aJ=aK.optionlist.value[aQ.choiceindex];aS=Y(aK,aJ)}if(w(aS)){if(aS){aI.checked="checked"}else{delete aI.checked}}aI.value=j.XMLEncode(aJ?aJ:"true");ah(null)}else{if(aQ.value instanceof Array){af()}else{var aP=aK?aK[aT==="textarea"||aT==="input"?"optionlist":"optionnames"].value[aQ.choiceindex]:aQ.value;if(aT==="textarea"){if(v(aP)&&aQ.willinput){aP=""}ah(aP)}else{if(aT==="input"){if(aQ.willinput||w(aP)){aI.value=j.XMLEncode(String(aP))}ah(null)}else{delete aI.name;az(aP)}}}}}else{if(aO==="UISelect"){var aW=aT==="select";var aG=false;if(aQ.selection.value instanceof Array){aG=true;if(aW){aI.multiple="multiple"}}var aL=aI.id;C(aI,aQ.selection);if(aL!==undefined){aI.id=aL}if(aW){if(aQ.selection.willinput!==false){aI.name=aQ.selection.submittingname}r(aQ,aI.id)}an+=j.dumpAttributes(aI);if(aW){an+=">";var aE=aQ.optionlist.value;var aN=aQ.optionnames===null||aQ.optionnames===undefined||!aQ.optionnames.value?aE:aQ.optionnames.value;if(!aN||!aN.length){j.fail("Error in component tree - UISelect component with fullID "+aQ.fullID+" does not have optionnames set")}for(var aR=0;aR<aN.length;++aR){an+='<option value="';var aP=aE[aR];if(aP===null){aP=j.NULL_STRING}an+=j.XMLEncode(aP);if(Y(aQ,aP)){an+='" selected="selected'}an+='">';an+=j.XMLEncode(aN[aR]);an+="</option>\n"}aw()}else{aj()}D(aQ)}else{if(aO==="UILink"){var aM=e[aT];if(aM){aq(aQ.target);var aV=aQ.target.value;if(!w(aV)){aV=aI[aM]}aV=o(K.uselump.parent,aV);aI[aM]=j.XMLEncode(aV)}var aP;if(aQ.linktext){aq(aQ.linktext);aP=aQ.linktext.value}if(!w(aP)){ar()}else{ah(aP)}}else{if(aQ.markup!==undefined){aq(aQ.markup);var aU=aQ.markup.value;if(aU===null){an+=j.dumpAttributes(aI);an+=">";af()}else{if(!K.iselide){an+=j.dumpAttributes(aI);an+=">"}an+=aU;aw()}}}}}if(aI.id!==undefined){A[aI.id]=true}}function u(aE){var aI;var aG=K.attrcopy["for"];if(aG!==undefined){aI="for"}else{aG=K.attrcopy.headers;if(aG!==undefined){aI="headers"}}if(!aI){return}var aH=K.uselump.tagname;if(aI==="for"&&aH!=="label"){return}if(aI==="headers"&&aH!=="td"&&aH!=="th"){return}var aF=ao[aA(K.uselump.parent,aE,aG)];if(aF!==undefined){K.attrcopy[aI]=aF}}function ai(aE){an+=("<!-- "+j.XMLEncode(aE)+"-->")}function y(aE){an+='<span style="background-color:#FF466B;color:white;padding:1px;">';an+=aE;an+="</span><br/>"}function X(aE){var aF=aE.fullID;return !aF?"component tree root":"full path "+aF}function H(aF,aO,aK){var aM=aK.lumpindex;var aS=aK.parent.lumps;var aL=-1;var aN=aS[aM+1];var aE=aK.close_tag;aL=aE.lumpindex+1;var aJ=aK.downmap?aK.downmap["payload-component"]:null;var aR=aJ?aJ[0]:null;var aQ=aK.rsfID.charCodeAt(0)===126;var aI=aN;var aT=aE;var aH=aK;var aG={};h.extend(true,aG,(aR===null?aK:aR).attributemap);K.attrcopy=aG;K.uselump=aH;K.endopen=aI;K.close=aT;K.nextpos=aL;K.iselide=aQ;u(aF);if(aO===null){if(aK.rsfID.indexOf("scr=")===(aQ?1:0)){var aP=aK.rsfID.substring(4+(aQ?1:0));if(aP==="ignore"){aL=K.close.lumpindex+1}else{if(aP==="rewrite-url"){aO={componentType:"UILink",target:{}}}else{x();ar();aL=K.endopen.lumpindex}}}}if(aO!==null){if(aR){K.endopen=aS[aR.lumpindex+1];K.close=aR.close_tag;K.uselump=aR;E(aS,aM,aR.lumpindex);aM=aR.lumpindex}F(aG,aO);x();S(aO);if(aR!==null){if(K.nextpos===aL){E(aS,K.close.lumpindex+1,aE.lumpindex+1)}}aL=K.nextpos}return aL}var ae;function B(aH,aE){var aG=aE.parent;var aF=aG.lumps[aE.lumpindex+1];if(aH.children!==undefined){ab(aH,aE)}else{H(aH.parent,aH,aE)}ae(aH,aE,aF)}at=function(aH,aI,aG){if(aI.indexOf("msg=")===0){var aE=aI.substring(4);return{componentType:"UIMessage",messagekey:aE}}while(aH){var aF=aH.childmap[aI];if(aF){return aF}aH=aH.parent}return null};function aC(aF,aG){var aE;while(aF){aE=aF.childmap[aG];if(aE){break}aF=aF.parent}return aE}function V(aG,aH){var aF=j.SplitID(aH.ID);var aE=aG.downmap[aH.ID];if(!aE){aE=aG.downmap[aF.prefix+":"]}return aE?aE[0]:null}ae=function(aJ,aY,aP){var aS=aP.lumpindex;var aV=aY.nestingdepth;var aK=aY.parent;var aW;if(aD){aW={}}while(true){aS=ac(aK.lumps,aS,aV,!aY.elide,false);if(aS===aK.lumps.length){break}var aN=aK.lumps[aS];var aO=aN.rsfID;if(aN.nestingdepth<aV||aO===undefined){break}if(aO.charCodeAt(0)===126){aO=aO.substring(1)}if(aO.indexOf(":")!==-1){var aQ=j.getPrefix(aO);var aE=aC(aJ,aQ);var aG=aN.uplump.finallump[aQ];var aH=aG.close_tag;if(aE){for(var aR=0;aR<aE.length;++aR){var aF=aE[aR];if(aF.children){if(aD){aW[aF.fullID]=true}var aT=av[aF.fullID];if(aT){if(aD){ai("Branching for "+aF.fullID+" from "+j.debugLump(aN)+" to "+j.debugLump(aT))}B(aF,aT);if(aD){ai("Branch returned for "+aF.fullID+j.debugLump(aN)+" to "+j.debugLump(aT))}}else{if(aD){y("No matching template branch found for branch container with full ID "+aF.fullID+" rendering from parent template branch "+j.debugLump(aP))}}}else{var aT=V(aY,aF);if(!aT){if(aD){y("Repetitive leaf with full ID "+aF.fullID+" could not be rendered from parent template branch "+j.debugLump(aP))}continue}var aU=H(aJ,aF,aT);var aM=aU<aK.lumps.lengtn&&aK.lumps[aU].nestingdepth>=aT.nestingdepth;var aI=aF.children?aF:aJ;if(aM){ae(aI,aT,aK.lumps[aU]);aU=aT.close_tag.lumpindex+1}if(aR!==aE.length-1){if(aU<aH.lumpindex){ac(aK.lumps,aU,aT.nestingdepth-1,false,false)}}else{ac(aK.lumps,aU,aT.nestingdepth,true,false)}}}}else{if(aD){y("No branch container with prefix "+aQ+": found in container "+X(aJ)+" rendering at template position "+j.debugLump(aP)+", skipping")}}aS=aH.lumpindex+1;if(aD){ai("Stack returned from branch for ID "+aO+" to "+j.debugLump(aP)+": skipping from "+j.debugLump(aN)+" to "+j.debugLump(aH))}}else{var aL;if(aO){aL=at(aJ,aO,aN);if(aD&&aL){aW[aL.fullID]=true}}if(aL&&aL.children!==undefined){B(aL);aS=aN.close_tag.lumpindex+1}else{aS=H(aJ,aL,aN)}}if(aS===aK.lumps.length){break}}if(aD){var aE=aJ.children;for(var aX=0;aX<aE.length;++aX){var aF=aE[aX];if(!aW[aF.fullID]){y("Component "+aF.componentType+" with full ID "+aF.fullID+" could not be found within template "+j.debugLump(aP))}}}};function t(aE){E(aE.parent.lumps,aE.lumpindex,aE.close_tag.lumpindex+1)}function p(){for(var aG in R){var aE=R[aG];for(var aF=0;aF<aE.length;++aF){t(aE[aF])}}}function z(){for(var aI=0;aI<ak.length;++aI){var aE=ak[aI];for(var aG=0;aG<aE.ids.length;++aG){var aL=aE.ids[aG];var aK=j.byId(aL,aa.document);if(!aK){j.fail("Error during rendering - component with id "+aL+" which has a queued decorator was not found in the output markup")}if(aE.type==="jQuery"){var aH=h(aK);aH[aE.func].apply(aH,h.makeArray(aE.args))}else{if(aE.type==="fluid"){var aF=aE.args;if(!aF){if(!aE.container){aE.container=h(aK)}else{aE.container.push(aK)}aF=[aK,aE.options]}var aJ=k.invokeFluidDecorator(aE.func,aF,aL,aI,Z);aE.that=aJ}else{if(aE.type==="event"){aK[aE.event]=aE.handler}}}}}}al.renderTemplates=function(){P=l(P,Z.model,Z.resolverGetConfig);var aE=q[0];N(q.globalmap,P,aE.rootlump);I={};p();ae(P,aE.rootlump,aE.lumps[aE.firstdocumentindex]);return an};al.processDecoratorQueue=function(){z()};return al};jQuery.extend(true,j.renderer,k);j.ComponentReference=function(o){this.reference=o
  };j.explode=function(r,o){var q=[];for(var p in r){var s=o===undefined?p:o+"."+p;q[q.length]={ID:p,value:r[p],valuebinding:s}}return q};j.explodeSelectionToInputs=function(o,p){return j.transform(o,function(r,q){return{ID:p.rowID,children:[{ID:p.inputID,parentRelativeID:"..::"+p.selectID,choiceindex:q},{ID:p.labelID,parentRelativeID:"..::"+p.selectID,choiceindex:q}]}})};j.resolveMessageSource=function(o){if(o.type==="data"){if(o.url===undefined){return j.messageLocator(o.messages,o.resolveFunc)}else{}}else{if(o.type==="resolver"){return o.resolver.resolve}}};j.renderTemplates=function(r,o,p,q){var s=j.renderer(r,o,p,q);var t=s.renderTemplates();return t};j.reRender=function(v,q,x,w){w=w||{};q=j.unwrap(q);var s=j.getLastFocusedElement?j.getLastFocusedElement():null;var o;if(s&&j.dom.isContainer(q,s)){o=s.id}if(h.browser.msie){h(q).empty()}else{q.innerHTML=""}var t=w.fossils||{};var u=j.renderer(v,x,w,t);var p=u.renderTemplates();if(w.renderRaw){p=j.XMLEncode(p);p=p.replace(/\n/g,"<br/>")}if(w.model){j.bindFossils(q,w.model,t)}if(h.browser.msie){h(q).html(p)}else{q.innerHTML=p}u.processDecoratorQueue();if(o){var r=j.byId(o);if(r){h(r).focus()}}return v};function a(o){var p=j.dom.iterateDom(o,function(r){return r.nodeType===8||r.nodeType===4?"stop":null},true);var q=p.nodeValue;if(q.indexOf("[CDATA[")===0){return q.substring(6,q.length-2)}else{return q}}j.extractTemplate=function(p,o){if(!o){return p.innerHTML}else{return a(p)}};j.render=function(t,u,o,q){q=q||{};var s=t;if(typeof(t)==="object"){s=j.extractTemplate(j.unwrap(t.node),t.armouring)}u=j.unwrap(u);var p={base:{resourceText:s,href:".",resourceKey:".",cutpoints:q.cutpoints}};var r=j.parseTemplates(p,["base"],q);return j.reRender(r,u,o,q)};j.selfRender=function(q,o,p){p=p||{};return j.render({node:q,armouring:p.armouring},q,o,p)}})(jQuery,fluid_1_4);fluid_1_4=fluid_1_4||{};(function(c,b){if(!b.renderer){b.fail("fluidRenderer.js is a necessary dependency of RendererUtilities")}b.iota=function(g,h){h=h||0;var f=[];for(var e=0;e<g;++e){f[f.length]=h++}return f};b.renderer.visitDecorators=function(e,f){b.visitComponentChildren(e,function(h,g){if(g.indexOf(b.renderer.decoratorComponentPrefix)===0){f(h,g)}},{flat:true})};b.renderer.clearDecorators=function(f,e){b.renderer.visitDecorators(e,function(h,g){f.clearComponent(e,g)})};b.renderer.getDecoratorComponents=function(f){var e={};b.renderer.visitDecorators(f,function(h,g){e[g]=h});return e};b.renderer.modeliseOptions=function(f,g,e){return c.extend({},g,f,b.filterKeys(e,["model","applier"]))};b.renderer.reverseMerge=function(g,e,f){f=b.makeArray(f);b.each(f,function(h){if(g[h]===undefined&&e[h]!==undefined){g[h]=e[h]}})};b.renderer.createRendererSubcomponent=function(f,l,n,m,i){n=n||{};var e=n.templateSource?n.templateSource:{node:c(f)};var k=b.renderer.modeliseOptions(n.rendererOptions,null,m);k.fossils=i||{};var g=b.renderer.modeliseOptions(n.expanderOptions,{ELstyle:"${}"},m);b.renderer.reverseMerge(g,n,["resolverGetConfig","resolverSetConfig"]);var h={};if(!n.noexpand){h.expander=b.renderer.makeProtoExpander(g)}var j=null;h.render=function(o){var p=n.cutpointGenerator||"fluid.renderer.selectorsToCutpoints";k.cutpoints=k.cutpoints||b.invokeGlobalFunction(p,[l,n]);f=typeof(f)==="function"?f():c(f);if(j){b.clear(k.fossils);b.reRender(j,f,o,k)}else{if(typeof(e)==="function"){e=e()}j=b.render(e,f,o,k)}};return h};b.defaults("fluid.rendererComponent",{gradeNames:["fluid.viewComponent"],initFunction:"fluid.initRendererComponent",mergePolicy:{protoTree:"noexpand, replace"},rendererOptions:{autoBind:true},events:{prepareModelForRender:null,onRenderTree:null,afterRender:null,produceTree:"unicast"}});b.initRendererComponent=function(k,f,n){var i=b.initView(k,f,n,{gradeNames:["fluid.rendererComponent"]});b.fetchResources(i.options.resources);var m=b.renderer.modeliseOptions(i.options.rendererOptions,null,i);if(!i.options.noUpgradeDecorators){b.withInstantiator(i,function(o){m.instantiator=o;m.parentComponent=i})}var g;if(!m.messageSource&&i.options.strings){g=b.messageResolver({messageBase:i.options.strings,resolveFunc:i.options.messageResolverFunction,parents:b.makeArray(i.options.parentBundle)});m.messageSource={type:"resolver",resolver:g}}b.renderer.reverseMerge(m,i.options,["resolverGetConfig","resolverSetConfig"]);var h=c.extend({},i.options.rendererFnOptions,{rendererOptions:m,repeatingSelectors:i.options.repeatingSelectors,selectorsToIgnore:i.options.selectorsToIgnore,expanderOptions:{envAdd:{styles:i.options.styles}}});if(i.options.resources&&i.options.resources.template){h.templateSource=function(){return i.options.resources.template.resourceText}}var e=i.events.produceTree;e.addListener(function(){return i.options.protoTree});if(i.options.produceTree){e.addListener(i.options.produceTree)}b.renderer.reverseMerge(h,i.options,["resolverGetConfig","resolverSetConfig"]);if(h.rendererTargetSelector){f=function(){return i.dom.locate(h.rendererTargetSelector)}}var j={fossils:{},boundPathForNode:function(o){return b.boundPathForNode(o,j.fossils)}};var l=b.renderer.createRendererSubcomponent(f,i.options.selectors,h,i,j.fossils);i.renderer=c.extend(j,l);if(g){i.messageResolver=g}i.refreshView=j.refreshView=function(){if(m.instantiator&&m.parentComponent){b.renderer.clearDecorators(m.instantiator,m.parentComponent)}i.events.prepareModelForRender.fire(i.model,i.applier,i);var o=e.fire(i);if(i.renderer.expander){o=i.renderer.expander(o)}i.events.onRenderTree.fire(i,o);i.renderer.render(o);i.events.afterRender.fire(i)};if(i.options.renderOnInit){i.refreshView()}return i};var a=function(e,f){b.each(b.makeArray(f),function(g){delete e[g]});return e};var d=function(f,e){if(e){b.each(e,function(g){if(f===g){f=f+":"}})}return f};b.renderer.selectorsToCutpoints=function(f,e){var g=[];e=e||{};f=b.copy(f);if(e.selectorsToIgnore){f=a(f,e.selectorsToIgnore)}for(var h in f){g.push({id:d(h,e.repeatingSelectors),selector:f[h]})}return g};b.renderer.NO_COMPONENT={};b.renderer.mergeComponents=function(g,f){for(var e in f){g[e]=f[e]}return g};b.registerNamespace("fluid.renderer.selection");b.renderer.selection.inputs=function(g,e,h,f){b.expect("Selection to inputs expander",["selectID","inputID","labelID","rowID"],g);var i=f.expander(g.tree);var k=b.transform(i.optionlist.value,function(n,l){var o={};var m={parentRelativeID:"..::"+g.selectID,choiceindex:l};o[g.inputID]=m;o[g.labelID]=b.copy(m);return o});var j={};j[g.selectID]=i;j[g.rowID]={children:k};j=f.expander(j);return j};b.renderer.repeat=function(m,e,k,g){b.expect("Repetition expander",["controlledBy","tree"],m);var l=b.extractContextualPath(m.controlledBy,{ELstyle:"ALL"},b.threadLocal());var j=b.get(g.model,l,g.resolverGetConfig);var f={};if(!j||j.length===0){return m.ifEmpty?g.expander(m.ifEmpty):f}var i=[];b.each(j,function(q,p){var r=b.model.composePath(l,p);var n={};if(m.pathAs){n[m.pathAs]=r}if(m.valueAs){n[m.valueAs]=b.get(g.model,r,g.resolverGetConfig)}var o=b.withEnvironment(n,function(){return g.expander(m.tree)},"rendererEnvironment");if(b.isArrayable(o)){if(o.length>0){i.push({children:o})}}else{if(o!==b.renderer.NO_COMPONENT){i.push(o)}}});var h=m.repeatID;if(h.indexOf(":")===-1){h=h+":"}b.each(i,function(n){n.ID=h});return i};b.renderer.condition=function(i,f,j,h){b.expect("Selection to condition expander",["condition"],i);var k;if(i.condition.funcName){var g=h.expandLight(i.condition.args);k=b.invoke(i.condition.funcName,g)}else{if(i.condition.expander){k=h.expander(i.condition)}else{k=h.expandLight(i.condition)}}var e=(k?i.trueTree:i.falseTree);if(!e){e=b.renderer.NO_COMPONENT}return h.expander(e)};b.extractContextualPath=function(g,f,h){var e=b.extractELWithContext(g,f);if(e){if(e.context){var i=h[e.context];if(typeof(i)!=="string"){b.fail("Could not look up context path named "+e.context+" to string value")}return b.model.composePath(i,e.path)}else{return e.path}}};b.renderer.makeProtoExpander=function(l){var r=c.extend({ELstyle:"${}"},l);r.fetcher=b.makeEnvironmentFetcher("rendererEnvironment",r.model);var k=r.IDescape||"\\";function m(s){var t=b.threadLocal().rendererEnvironment;return b.extractContextualPath(s,r,t)}var i=function(s){return b.resolveEnvironment(s,r)};var h=function(v,s){if(v.messagekey!==undefined){return{componentType:"UIMessage",messagekey:h(v.messagekey),args:i(v.args)}}var u;if(!b.isPrimitive(v)&&!b.isArrayable(v)){u=c.extend({},v);if(u.decorators){u.decorators=i(u.decorators)}v=u.value;delete u.value}else{u={}}var t=typeof(v)==="string"?m(v):null;if(t){u.valuebinding=t}else{u.value=v}if(r.model&&u.valuebinding&&u.value===undefined){u.value=b.get(r.model,u.valuebinding,r.resolverGetConfig)}if(s){u.componentType="UIBound"}return u};r.filter=b.expander.lightFilter;var g;var o;var n=function(t){var s=[];g(t,s);return{children:s}};var j=function(u){if(u===b.renderer.NO_COMPONENT){return u}var s;var v=[];var t=function(w){s=w};o(u,v,t);return s||v};var p={model:r.model,resolverGetConfig:r.resolverGetConfig,resolverSetConfig:r.resolverSetConfig,expander:j,expandLight:i};var q=function(s,t){var v={componentType:t};var w=b.renderer.boundMap[t]||{};for(var u in s){if(/decorators|args/.test(u)){v[u]=i(s[u]);continue}else{if(w[u]){v[u]=h(s[u])}else{v[u]=s[u]}}}return v};var f=function(x,w){var u=x.children;for(var t=0;t<u.length;++t){var y=[];var s={children:y};var z=u[t];var v=function(A){y[y.length]=A};o(z,y,v);if(s.children.length===1&&!s.children[0].ID){s=s.children[0]}w(s)}};function e(s){return b.find(s,function(u,t){return t==="decorators"})!==false}var o=function(u,v,t){var s=b.renderer.inferComponentType(u);if(!s&&(b.isPrimitive(u)||e(u))){s="UIBound"}if(s){t(s==="UIBound"?h(u,true):q(u,s))}else{if(!v){b.fail("Illegal cond->cond transition")}g(u,v)}};g=function(v,w){for(var t in v){var u=v[t];if(t.charAt(0)===k){t=t.substring(1)}if(t==="expander"){var s=b.makeArray(u);b.each(s,function(z){var y=b.invokeGlobalFunction(z.type,[z,v,t,p]);if(y!==b.renderer.NO_COMPONENT){b.each(y,function(A){w[w.length]=A})}})}else{if(u){var x=function(y){y.ID=t;
  w[w.length]=y};if(u.children){if(t.indexOf(":")===-1){t=t+":"}f(u,x)}else{if(b.renderer.isBoundPrimitive(u)){x(h(u,true))}else{o(u,null,x)}}}}}};return function(t){var s=c.extend({},r.envAdd);return b.withEnvironment({rendererEnvironment:s},function(){return n(t)})}}})(jQuery,fluid_1_4);var fluid_1_4=fluid_1_4||{};(function(d,b){var f=function(h){var g=d("<a name='"+h.text()+"' />",h[0].ownerDocument);h.before(g)};var e=function(h){var g={ID:h,children:[]};return g};var a=function(k,j){var i=function(m,l,s){if(l.length===0){return}var p=l[0];if(s===p.level){m[m.length-1].push(p.leaf);l.shift();return i(m,l,s)}if(s<p.level){var q=s>-1?"level"+(s+1)+":":"";var r=s===-1?"s:":"s";var n=q+"level"+(s+2)+r;var o=e(n);m[m.length-1].push(o);m.push(o.children);return i(m,l,s+1)}if(s>p.level){m.pop();return i(m,l,s-1)}};var g={children:[]};var h=b.transform(k,function(l){var n=d.inArray(l.tagName,j);var m=d(l).text();return{level:n,leaf:{ID:"level"+(n+1)+":item",children:[{ID:"link",linktext:m,target:"#"+m}]}}});i([g.children],h,-1);return g};var c=function(g,k,h,j,l){k.each(function(m,n){f(d(n))});var i={toc:{href:j}};b.fetchResources(i,function(){var m=b.parseTemplates(i,["toc"],{});var n=d("<div></div>",g[0].ownerDocument);b.reRender(m,n,a(k,h),{});g.prepend(n);l.fire(n)})};b.tableOfContents=function(g,h){var i=b.initView("fluid.tableOfContents",g,h);i.events.afterRender.addListener(function(j){i.tocNode=d(j)});c(i.container,i.locate("headings"),i.options.levels,i.options.templateUrl,i.events.afterRender);i.hide=function(){if(i.tocNode){i.tocNode.hide()}};i.show=function(){if(i.tocNode){i.tocNode.show()}};return i};b.defaults("fluid.tableOfContents",{gradeNames:"fluid.viewComponent",selectors:{headings:":header"},events:{afterRender:null},templateUrl:"../html/TableOfContents.html",levels:["H1","H2","H3","H4","H5","H6"]})})(jQuery,fluid_1_4);if(!this.JSON){JSON=function(){function f(n){return n<10?"0"+n:n}Date.prototype.toJSON=function(){return this.getUTCFullYear()+"-"+f(this.getUTCMonth()+1)+"-"+f(this.getUTCDate())+"T"+f(this.getUTCHours())+":"+f(this.getUTCMinutes())+":"+f(this.getUTCSeconds())+"Z"};var m={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"};function stringify(value,whitelist){var a,i,k,l,r=/["\\\x00-\x1f\x7f-\x9f]/g,v;switch(typeof value){case"string":return r.test(value)?'"'+value.replace(r,function(a){var c=m[a];if(c){return c}c=a.charCodeAt();return"\\u00"+Math.floor(c/16).toString(16)+(c%16).toString(16)})+'"':'"'+value+'"';case"number":return isFinite(value)?String(value):"null";case"boolean":case"null":return String(value);case"object":if(!value){return"null"}if(typeof value.toJSON==="function"){return stringify(value.toJSON())}a=[];if(typeof value.length==="number"&&!(value.propertyIsEnumerable("length"))){l=value.length;for(i=0;i<l;i+=1){a.push(stringify(value[i],whitelist)||"null")}return"["+a.join(",")+"]"}if(whitelist){l=whitelist.length;for(i=0;i<l;i+=1){k=whitelist[i];if(typeof k==="string"){v=stringify(value[k],whitelist);if(v){a.push(stringify(k)+":"+v)}}}}else{for(k in value){if(typeof k==="string"){v=stringify(value[k],whitelist);if(v){a.push(stringify(k)+":"+v)}}}}return"{"+a.join(",")+"}"}}return{stringify:stringify,parse:function(text,filter){var j;function walk(k,v){var i,n;if(v&&typeof v==="object"){for(i in v){if(Object.prototype.hasOwnProperty.apply(v,[i])){n=walk(i,v[i]);if(n!==undefined){v[i]=n}}}}return filter(k,v)}if(/^[\],:{}\s]*$/.test(text.replace(/\\./g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(:?[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,""))){j=eval("("+text+")");return typeof filter==="function"?walk("",j):j}throw new SyntaxError("parseJSON")}}}();
  /*!
   * jQuery UI AriaTabs (12.07.10)
   * http://github.com/fnagel/jQuery-Accessible-RIA
   *
   * Copyright (c) 2009 Felix Nagel for Namics (Deustchland) GmbH
   * Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php
   *
   * Depends: ui.core.js 1.8
   *   		ui.tabs.js
   */
  }(function(a){a.fn.extend(a.ui.tabs.prototype,{_create:function(){var d=this,e=this.options;if(a.address){var f={enable:true,title:{enable:true,split:" | "}};if(!a.isEmptyObject(e.jqAddress)){a.extend(true,f,e.jqAddress)}else{e.jqAddress={}}a.extend(true,e.jqAddress,f)}if(a.address&&e.jqAddress.enable){var c="#"+a.address.value().replace("/","")}d._tabify(true);this.anchors.bind(e.event+".tabs-accessibility",function(){this.focus()});d.list.attr("role","tablist");for(var b=0;b<d.anchors.length;b++){if(a.address&&e.jqAddress.enable&&c!="#"&&a(d.anchors[b]).attr("href")==c){d.select(b)}d._ariaInit(b)}d.list.keydown(function(g){switch(g.keyCode){case a.ui.keyCode.RIGHT:d.select(e.selected+1);return false;break;case a.ui.keyCode.DOWN:d.select(e.selected+1);break;case a.ui.keyCode.UP:d.select(e.selected-1);return false;break;case a.ui.keyCode.LEFT:d.select(e.selected-1);return false;break;case a.ui.keyCode.END:d.select(d.anchors.length-1);return false;break;case a.ui.keyCode.HOME:d.select(0);return false;break}});if(a.address&&this.options.jqAddress.enable){a.address.externalChange(function(i){var h="#"+i.value.replace("/","");var g=0;while(g<d.anchors.length){if(a(d.anchors[g]).attr("href")==h){d.select(g);return}g++}})}},_original_load:a.ui.tabs.prototype.load,load:function(c){if(a.address&&this.options.jqAddress.enable){if(a(this.anchors[0]).attr("aria-selected")!==undefined){if(this.options.forceFirst===0&&c!==0){if(a.address.value()==""){a.address.history(false)}a.address.value(a(this.anchors[0]).attr("href").replace(/^#/,""));a.address.history(true);this.options.forceFirst=false}if(this.options.jqAddress.title.enable){a.address.title(a.address.title().split(this.options.jqAddress.title.split)[0]+this.options.jqAddress.title.split+a(this.anchors[c]).text())}a.address.value(a(this.anchors[c]).attr("href").replace(/^#/,""))}else{this.options.forceFirst=c}}for(var b=0;b<this.anchors.length;b++){this._ariaSet(b,false);if(a.data(this.anchors[b],"href.tabs")){a(this.panels[b]).removeAttr("aria-live").removeAttr("aria-busy")}}if(a.data(this.anchors[c],"href.tabs")){a(this.panels[c]).attr("aria-live","polite").attr("aria-busy","true")}this._original_load(c);if(a.data(this.anchors[c],"href.tabs")){a(this.panels[c]).attr("aria-busy","false")}this._ariaSet(c,true)},_ariaSet:function(c,e){var d=(e)?0:-1;var b=a(this.anchors[c]);b.attr("tabindex",d).attr("aria-selected",e);if(e){if(!a.browser.msie){b.focus()}}else{b.closest("li").removeClass("ui-state-focus")}a(this.panels[c]).attr("aria-hidden",!e).attr("aria-expanded",e);if(a.browser.msie){this.options.timeout=window.setTimeout(function(){b.focus()},100)}if(e){this._updateVirtualBuffer()}},_ariaInit:function(c){var b=this;var d=a(this.panels[c]).attr("id");a(this.anchors[c]).attr("role","tab").attr("aria-controls",d).attr("id",d+"-tab").parent().attr("role","presentation");a(this.panels[c]).attr("role","tabpanel").attr("tabindex",0).attr("aria-labelledby",d+"-tab");if(this.options.collapsible){a(this.anchors[c]).bind(this.options.event,function(e){b._ariaSet(c,!a(b.panels[c]).hasClass("ui-tabs-hide"))})}},_original_add:a.ui.tabs.prototype.add,add:function(d,c,b){this._original_add(d,c,b);this.element.attr("aria-live","polite").attr("aria-relevant","additions");if(b){this._ariaInit(b);this._ariaSet(b,false)}else{this._ariaInit(this.anchors.length-1);this._ariaSet(this.anchors.length-1,false)}},_original_remove:a.ui.tabs.prototype.remove,remove:function(b){this._original_remove(b);this.element.attr("aria-live","polite").attr("aria-relevant","removals")},_original_destroy:a.ui.tabs.prototype.destroy,destroy:function(){var c=this,d=this.options;c.element.removeAttr("role").removeAttr("aria-live").removeAttr("aria-relevant");c.list.removeAttr("role");for(var b=0;b<c.anchors.length;b++){a(c.anchors[b]).removeAttr("aria-selected").removeAttr("aria-controls").removeAttr("role").removeAttr("id").removeAttr("tabindex").parent().removeAttr("role");a(c.panels[b]).removeAttr("aria-hidden").removeAttr("aria-expanded").removeAttr("aria-labelledby").removeAttr("aria-live").removeAttr("aria-busy").removeAttr("aria-relevant").removeAttr("role")}a("body>form #virtualBufferForm").parent().remove();this._original_destroy()},_updateVirtualBuffer:function(){var b=a("body>form #virtualBufferForm");if(b.length){if(b.val()=="1"){b.val("0")}else{b.val("1")}if(b.hasClass("ui-accessibility-odd")){b.addClass("ui-accessibility-even").removeClass("ui-accessibility-odd")}else{b.addClass("ui-accessibility-odd").removeClass("ui-accessibility-even")}}else{a("body").append('<form><input id="virtualBufferForm" type="hidden" value="1" /></form>')}}})})(jQuery);var fluid_1_4=fluid_1_4||{};(function(b,a){a.defaults("fluid.uiOptions.store",{gradeNames:["fluid.littleComponent","autoInit"],defaultSiteSettings:{textFont:"default",theme:"default",textSize:1,lineSpacing:1,layout:false,toc:false,links:false,inputsLarger:false}});a.defaults("fluid.cookieStore",{gradeNames:["fluid.uiOptions.store","autoInit"],invokers:{fetch:{funcName:"fluid.cookieStore.fetch",args:["{cookieStore}.options.cookieName","{cookieStore}.options.defaultSiteSettings"]},save:{funcName:"fluid.cookieStore.save",args:["{arguments}.0","{cookieStore}.options.cookieName"]}},cookieName:"fluid-ui-settings"});a.cookieStore.fetch=function(i,g){var d=document.cookie;var c=i+"=";var f,h,e;if(d.length>0){h=d.indexOf(c);if(h>-1){h=h+c.length;e=d.indexOf(";",h);if(e<h){e=d.length}f=JSON.parse(decodeURIComponent(d.substring(h,e)))}}return f||g};a.cookieStore.save=function(c,d){document.cookie=d+"="+encodeURIComponent(JSON.stringify(c))};a.defaults("fluid.tempStore",{gradeNames:["fluid.uiOptions.store","autoInit"],invokers:{fetch:{funcName:"fluid.tempStore.fetch",args:["{tempStore}"]},save:{funcName:"fluid.tempStore.save",args:["{arguments}.0","{tempStore}"]}},finalInitFunction:"fluid.tempStore.finalInit"});a.tempStore.finalInit=function(c){c.model=c.options.defaultSiteSettings};a.tempStore.fetch=function(c){return c.model};a.tempStore.save=function(c,d){d.model=c
  }})(jQuery,fluid_1_4);var fluid_1_4=fluid_1_4||{};(function(e,g){var m=function(r,q,t,u){var p=u[q]||{};var s=p[t];if(s){r.addClass(s)}};var n=function(p){return p&&(p===true||p==="true")};var i=function(p,q){if(n(q)){if(p.tableOfContents){p.tableOfContents.show()}else{p.events.onReady.fire()}}else{if(p.tableOfContents){p.tableOfContents.hide()}}};var c=function(p,t,s,q){var r=t===""||t===1?s:t*s*q;p.css("line-height",r+"em")};var f=function(p,q,r){m(p,"textFont",q.textFont,r);m(p,"textSpacing",q.textSpacing,r);m(p,"theme",q.theme,r)};var o=function(q,p,r){if(p){q.addClass(r)}else{q.removeClass(r)}};var a=function(p,r,s){var q=e("a",p);o(q,r.links,s.links)};var l=function(p,q,r){o(p,q.layout,r.layout)};var k=function(p,q,r){o(e("input",p),q.inputsLarger,r.inputsLarger)};var d=function(p){p.options.savedSettings?p.applier.requestChange("",p.options.savedSettings):p.applier.requestChange("",p.settingsStore.fetch())};var h=function(s,v){var t=["textFont","textSpacing","theme","layout"];var q,p;for(var u=0;u<t.length;u++){var r=v[t[u]];if(typeof r==="object"){g.each(r,function(w){if(w){q=q+" "+w;p=p+",."+w}})}else{if(typeof r==="string"){q=q+" "+r;p=p+",."+r}}}e(p,s).removeClass(q);return q};var j=function(p){g.initDependents(p);p.events.onInitSettingStore.fire();d(p)};var b=function(p){var r=p.css("lineHeight");if(r==="normal"){return 1}if(e.browser.msie){var q;q=p[0].currentStyle.lineHeight;if(q.match(/[0-9]$/)){return q}}return parseFloat(r)/16};g.uiEnhancer=function(q,r){var s=g.initView("fluid.uiEnhancer",q,r);var p;s.initFontSize=parseFloat(s.container.css("font-size"));var t=b(s.container);s.refreshView=function(){s.container.removeClass(p);f(s.container,s.model,s.options.classnameMap);o(s.container,!n(s.model.backgroundImages),s.options.classnameMap.noBackgroundImages);s.setTextSize(s.container,s.model.textSize,s.initFontSize);c(s.container,s.model.lineSpacing,t,s.model.textSize);i(s,s.model.toc);a(s.container,s.model,s.options.classnameMap);l(s.container,s.model,s.options.classnameMap);k(s.container,s.model,s.options.classnameMap)};s.updateModel=function(u){s.applier.requestChange("",u)};s.applier.modelChanged.addListener("",function(u,w,v){s.events.modelChanged.fire(u,w,v);s.refreshView()});p=h(s.container,s.options.classnameMap);j(s);return s};g.defaults("fluid.uiEnhancer",{gradeNames:"fluid.viewComponent",components:{tableOfContents:{type:"fluid.tableOfContents",container:"{uiEnhancer}.container",createOnEvent:"onReady",options:{templateUrl:"../../tableOfContents/html/TableOfContents.html"}},settingsStore:{type:"fluid.uiOptions.store",container:"{uiEnhancer}.container",createOnEvent:"onInitSettingStore"}},invokers:{setTextSize:"fluid.uiEnhancer.setTextSize"},events:{onReady:null,modelChanged:null,onInitSettingStore:null},classnameMap:{textFont:{"default":"",times:"fl-font-times",comic:"fl-font-comic-sans",arial:"fl-font-arial",verdana:"fl-font-verdana"},theme:{"default":"",bw:"fl-theme-hc",wb:"fl-theme-hci",by:"fl-theme-blackYellow",yb:"fl-theme-yellowBlack"},layout:"fl-layout-linear",links:"fl-text-underline fl-text-bold fl-text-larger",inputsLarger:"fl-text-larger"}});g.uiEnhancer.setTextSize=function(p,q,r){if(q===1){p.css("font-size","")}else{if(q&&q>0){p.css("font-size",r*q+"px")}}};g.pageEnhancer=function(q){var p=g.initLittleComponent("fluid.pageEnhancer");p.uiEnhancerOptions=q;g.initDependents(p);g.staticEnvironment.uiEnhancer=p.uiEnhancer;return p};g.defaults("fluid.pageEnhancer",{gradeNames:["fluid.littleComponent"],components:{uiEnhancer:{type:"fluid.uiEnhancer",container:"body",options:"{pageEnhancer}.uiEnhancerOptions"}}});g.demands("fluid.uiOptions.store",["fluid.uiEnhancer"],{funcName:"fluid.cookieStore"})})(jQuery,fluid_1_4);var fluid_1_4=fluid_1_4||{};(function(b,a){a.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"});a.textfieldSlider.finalInit=function(d){var e=b.extend(true,{},d.options.sliderOptions,d.model);d.slider.initSlider(e);d.refreshView=function(){var f=d.model.value;d.textfield.container.val(f);d.slider.setSliderValue(f);d.slider.setSliderAria(f)};d.applier.modelChanged.addListener("value",function(f){d.events.modelChanged.fire(f.value)});d.events.modelChanged.addListener(d.refreshView);d.refreshView()};a.defaults("fluid.textfieldSlider.textfield",{gradeNames:["fluid.viewComponent","autoInit"],finalInitFunction:"fluid.textfieldSlider.textfield.finalInit"});a.textfieldSlider.validateValue=function(f,g,e){var d=f.value;var h=g.value;var i=!isNaN(parseInt(h,10));if(i){if(h<f.min){h=f.min}else{if(h>f.max){h=f.max}}g.value=h}else{g.value=d}};a.textfieldSlider.textfield.finalInit=function(d){d.applier.guards.addListener({path:"value",transactional:true},a.textfieldSlider.validateValue);d.container.change(function(e){d.applier.requestChange("value",e.target.value)})};a.defaults("fluid.textfieldSlider.slider",{gradeNames:["fluid.viewComponent","autoInit"],finalInitFunction:"fluid.textfieldSlider.slider.finalInit",selectors:{thumb:".ui-slider-handle"}});var c=function(d,f){var e={role:"slider","aria-valuenow":f.value,"aria-valuemin":f.min,"aria-valuemax":f.max};d.attr(e)};a.textfieldSlider.slider.finalInit=function(d){d.slider=d.container.slider(d.model);d.initSlider=function(f){var e=d.slider.slider(f);c(d.locate("thumb"),f)};d.setSliderValue=function(e){d.slider.slider("value",e)};d.setSliderAria=function(e){d.locate("thumb").attr("aria-valuenow",e)};d.slider.bind("slide",function(g,f){d.applier.requestChange("value",f.value)})}})(jQuery,fluid_1_4);(function(d,c){c.defaults("fluid.specBuilderImpl",{gradeNames:["fluid.littleComponent"],urlRenderer:{expander:{type:"fluid.deferredInvokeCall",func:"fluid.uiOptionsTemplateLoader"}}});c.specBuilderImpl=function(e){var f=c.initLittleComponent("fluid.specBuilderImpl",e);if(f.options.urlRenderer){f.options.spec.url=f.options.urlRenderer(f.options.spec.url)}return f.options.spec};c.specBuilder=function(e){return c.specBuilderImpl.apply(null,[{spec:e}])};c.uiOptionsTemplateLoader=function(e){var f=c.initLittleComponent("fluid.uiOptionsTemplateLoader",e);c.each(f.options.templates,function(h,g){f.options.templates[g]=c.stringTemplate(h,f.options)});return function(g){return c.stringTemplate(g,f.options.templates)}};c.defaults("fluid.uiOptionsTemplateLoader",{gradeNames:["fluid.littleComponent"],prefix:"../html/",templates:{uiOptions:"%prefixFatPanelUIOptions.html",textControls:"%prefixUIOptionsTemplate-text.html",layoutControls:"%prefixUIOptionsTemplate-layout.html",linksControls:"%prefixUIOptionsTemplate-links.html"}});c.demands("fluid.uiOptions.textControls",["fluid.uiOptions"],{options:{classnameMap:"{uiEnhancer}.options.classnameMap"}});c.demands("fluid.uiOptions.layoutControls",["fluid.uiOptions"],{options:{classnameMap:"{uiEnhancer}.options.classnameMap"}});c.demands("fluid.uiOptions.linksControls",["fluid.uiOptions"],{options:{classnameMap:"{uiEnhancer}.options.classnameMap"}});c.defaults("fluid.uiOptions",{gradeNames:["fluid.viewComponent","autoInit"],components:{textControls:{type:"fluid.uiOptions.textControls",container:"{uiOptions}.dom.textControls",createOnEvent:"onUIOptionsTemplateReady",options:{textSize:"{uiOptions}.options.textSize",lineSpacing:"{uiOptions}.options.lineSpacing",model:"{uiOptions}.model",applier:"{uiOptions}.applier"}},layoutControls:{type:"fluid.uiOptions.layoutControls",container:"{uiOptions}.dom.layoutControls",createOnEvent:"onUIOptionsTemplateReady",options:{model:"{uiOptions}.model",applier:"{uiOptions}.applier"}},linksControls:{type:"fluid.uiOptions.linksControls",container:"{uiOptions}.dom.linksControls",createOnEvent:"onUIOptionsTemplateReady",options:{model:"{uiOptions}.model",applier:"{uiOptions}.applier"}},preview:{type:"fluid.uiOptions.preview",createOnEvent:"onUIOptionsTemplateReady",container:"{uiOptions}.dom.previewFrame"},settingsStore:{type:"fluid.uiOptions.store"},eventBinder:{type:"fluid.uiOptions.eventBinder"}},textSize:{min:1,max:2},lineSpacing:{min:1,max:2},selectors:{textControls:".flc-uiOptions-text-controls",layoutControls:".flc-uiOptions-layout-controls",linksControls:".flc-uiOptions-links-controls",cancel:".flc-uiOptions-cancel",reset:".flc-uiOptions-reset",save:".flc-uiOptions-save",previewFrame:".flc-uiOptions-preview-frame"},events:{onReady:null,onSave:null,onCancel:null,onReset:null,onAutoSave:null,modelChanged:null,onUIOptionsTemplateReady:null},preInitFunction:"fluid.uiOptions.preInit",finalInitFunction:"fluid.uiOptions.finalInit",resources:{template:{expander:{type:"fluid.deferredInvokeCall",func:"fluid.specBuilder",args:{forceCache:true,url:"%uiOptions"}}}},autoSave:false});c.uiOptions.preInit=function(){c.fetchResources.primeCacheFromResources("fluid.uiOptions.textControls");c.fetchResources.primeCacheFromResources("fluid.uiOptions.layoutControls");c.fetchResources.primeCacheFromResources("fluid.uiOptions.linksControls")};c.uiOptions.finalInit=function(g){g.applier.requestChange("selections",c.copy(g.settingsStore.fetch()));g.save=function(){g.events.onSave.fire(g.model.selections);var h=c.copy(g.model.selections);g.settingsStore.save(h)};g.reset=function(){g.events.onReset.fire();g.updateModel(c.copy(g.settingsStore.options.defaultSiteSettings));g.refreshControlsView()};g.cancel=function(){g.events.onCancel.fire();g.updateModel(g.settingsStore.fetch());g.refreshControlsView()};g.updateModel=function(h){g.applier.requestChange("selections",h)};g.refreshControlsView=function(){g.textControls.refreshView();
  g.layoutControls.refreshView();g.linksControls.refreshView()};g.applier.modelChanged.addListener("selections",function(h,j,i){g.events.modelChanged.fire(h,j,i.source);if(g.options.autoSave){g.events.onAutoSave.fire()}});var f=function(i){var j=i.locate("save");if(j.length>0){j.click(i.save);var h=c.findForm(j);d(h).submit(function(){i.save()})}i.locate("reset").click(i.reset);i.locate("cancel").click(i.cancel)};var e=function(h){h.events.onAutoSave.addListener(function(){h.save()})};c.fetchResources(g.options.resources,function(){g.container.append(g.options.resources.template.resourceText);g.events.onUIOptionsTemplateReady.fire();f(g);e(g);g.events.onReady.fire(g)},{amalgamateClasses:["template"]})};c.defaults("fluid.uiOptions.eventBinder",{gradeNames:["fluid.eventedComponent","autoInit"]});c.demands("fluid.uiOptions.eventBinder",["fluid.uiOptions"],{options:{listeners:{"{uiOptions}.events.onSave":"{uiEnhancer}.updateModel"}}});var a=function(e){c.each(e.options.controlValues,function(g,f){e.applier.requestChange("labelMap."+f,{values:e.options.controlValues[f],names:e.options.strings[f],classes:e.options.classnameMap[f]})})};var b=function(f,e){return{decorators:{type:"fluid",func:"fluid.textfieldSlider",options:{listeners:{modelChanged:function(g){f.applier.requestChange("selections."+e,g)}},model:{min:f.options[e].min,max:f.options[e].max,value:f.model.selections[e]}}}}};c.uiOptions.controlsFinalInit=function(e){a(e);e.refreshView()};c.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"]},selectors:{textFont:".flc-uiOptions-text-font",theme:".flc-uiOptions-theme",textSize:".flc-uiOptions-min-text-size",lineSpacing:".flc-uiOptions-line-spacing"},finalInitFunction:"fluid.uiOptions.controlsFinalInit",produceTree:"fluid.uiOptions.textControls.produceTree",resources:{template:{expander:{type:"fluid.deferredInvokeCall",func:"fluid.specBuilder",args:{forceCache:true,fetchClass:"template",url:"%textControls"}}}}});c.uiOptions.textControls.produceTree=function(g){var e={};for(var f in g.model.selections){if(f==="textFont"||f==="theme"){e[f]={optionnames:"${labelMap."+f+".names}",optionlist:"${labelMap."+f+".values}",selection:"${selections."+f+"}",decorators:{type:"fluid",func:"fluid.uiOptions.selectDecorator",options:{styles:g.options.classnameMap[f]}}}}else{if(f==="textSize"||f==="lineSpacing"){e[f]=b(g,f)}}}return e};c.demands("fluid.uiOptions.selectDecorator","fluid.uiOptions",{container:"{arguments}.0"});c.defaults("fluid.uiOptions.selectDecorator",{gradeNames:["fluid.viewComponent","autoInit"],finalInitFunction:"fluid.uiOptions.selectDecorator.finalInit"});c.uiOptions.selectDecorator.finalInit=function(e){c.each(d("option",e.container),function(f){f.className=e.options.styles[c.value(f)]})};c.defaults("fluid.uiOptions.layoutControls",{gradeNames:["fluid.rendererComponent","autoInit"],selectors:{layout:".flc-uiOptions-layout",toc:".flc-uiOptions-toc"},finalInitFunction:"fluid.uiOptions.controlsFinalInit",produceTree:"fluid.uiOptions.layoutControls.produceTree",resources:{template:{expander:{type:"fluid.deferredInvokeCall",func:"fluid.specBuilder",args:{forceCache:true,fetchClass:"template",url:"%layoutControls"}}}}});c.uiOptions.layoutControls.produceTree=function(g){var e={};for(var f in g.model.selections){if(f==="layout"||f==="toc"){e[f]="${selections."+f+"}"}}return e};c.defaults("fluid.uiOptions.linksControls",{gradeNames:["fluid.rendererComponent","autoInit"],selectors:{links:".flc-uiOptions-links",inputsLarger:".flc-uiOptions-inputs-larger"},finalInitFunction:"fluid.uiOptions.controlsFinalInit",produceTree:"fluid.uiOptions.linksControls.produceTree",resources:{template:{expander:{type:"fluid.deferredInvokeCall",func:"fluid.specBuilder",args:{forceCache:true,fetchClass:"template",url:"%linksControls"}}}}});c.uiOptions.linksControls.produceTree=function(g){var e={};for(var f in g.model.selections){if(f==="links"||f==="inputsLarger"){e[f]="${selections."+f+"}"}}return e};c.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"});c.uiOptions.preview.updateModel=function(f,e){setTimeout(function(){if(f.enhancer){f.enhancer.updateModel(e)}},0)};c.uiOptions.preview.finalInit=function(e){e.container.attr("src",e.options.templateUrl);e.container.load(function(){e.enhancerContainer=d("body",e.container.contents());e.events.onReady.fire()})};c.demands("fluid.uiEnhancer","fluid.uiOptions.preview",{funcName:"fluid.uiEnhancer",args:["{preview}.enhancerContainer","{options}"]});c.defaults("fluid.uiOptions.preview.eventBinder",{gradeNames:["fluid.eventedComponent","autoInit"]});c.demands("fluid.uiOptions.preview.eventBinder",["fluid.uiOptions.preview","fluid.uiOptions"],{options:{listeners:{"{uiOptions}.events.modelChanged":"{preview}.updateModel"}}});c.defaults("fluid.uiOptions.livePreview",{gradeNames:["fluid.eventedComponent","autoInit"],components:{eventBinder:{type:"fluid.uiOptions.preview.eventBinder",createOnEvent:"onReady"}},invokers:{updateModel:{funcName:"fluid.uiOptions.preview.updateModel",args:["{livePreview}","{uiOptions}.model.selections"]}},events:{onReady:null},finalInitFunction:"fluid.uiOptions.livePreview.finalInit"});c.uiOptions.livePreview.finalInit=function(e){e.enhancer=d(document).data("uiEnhancer");e.events.onReady.fire()};c.demands("fluid.uiOptions.preview.eventBinder","fluid.uiOptions.livePreview",{options:{listeners:{"{uiOptions}.events.modelChanged":"{livePreview}.updateModel"}}})})(jQuery,fluid_1_4);var fluid_1_4=fluid_1_4||{};(function(b,a){a.defaults("fluid.fatPanelUIOptions",{gradeNames:["fluid.viewComponent","autoInit"],components:{uiOptions:{type:"fluid.uiOptions",container:".flc-slidingPanel-panel"},slidingPanel:{type:"fluid.slidingPanel",priority:"last",container:"{fatPanelUIOptions}.container"}}});a.demands("fluid.uiOptions",["fluid.fatPanelUIOptions"],{options:{components:{preview:{type:"fluid.uiOptions.livePreview"},tabs:{type:"fluid.tabs",container:"{fatPanelUIOptions}.container",createOnEvent:"onReady"},settingsStore:"{uiEnhancer}.settingsStore"},autoSave:true}})})(jQuery,fluid_1_4);(function(c){var a=c.scrollTo=function(f,e,d){c(window).scrollTo(f,e,d)};a.defaults={axis:"xy",duration:parseFloat(c.fn.jquery)>=1.3?0:1};a.window=function(d){return c(window)._scrollable()};c.fn._scrollable=function(){return this.map(function(){var e=this,d=!e.nodeName||c.inArray(e.nodeName.toLowerCase(),["iframe","#document","html","body"])!=-1;if(!d){return e}var f=(e.contentWindow||e).document||e.ownerDocument||e;return c.browser.safari||f.compatMode=="BackCompat"?f.body:f.documentElement})};c.fn.scrollTo=function(f,e,d){if(typeof e=="object"){d=e;e=0}if(typeof d=="function"){d={onAfter:d}}if(f=="max"){f=9000000000}d=c.extend({},a.defaults,d);e=e||d.speed||d.duration;d.queue=d.queue&&d.axis.length>1;if(d.queue){e/=2}d.offset=b(d.offset);d.over=b(d.over);return this._scrollable().each(function(){var l=this,j=c(l),k=f,i,g={},m=j.is("html,body");switch(typeof k){case"number":case"string":if(/^([+-]=)?\d+(\.\d+)?(px|%)?$/.test(k)){k=b(k);break}k=c(k,this);case"object":if(k.is||k.style){i=(k=c(k)).offset()}}c.each(d.axis.split(""),function(q,r){var s=r=="x"?"Left":"Top",u=s.toLowerCase(),p="scroll"+s,o=l[p],n=a.max(l,r);if(i){g[p]=i[u]+(m?0:o-j.offset()[u]);if(d.margin){g[p]-=parseInt(k.css("margin"+s))||0;g[p]-=parseInt(k.css("border"+s+"Width"))||0}g[p]+=d.offset[u]||0;if(d.over[u]){g[p]+=k[r=="x"?"width":"height"]()*d.over[u]}}else{var t=k[u];g[p]=t.slice&&t.slice(-1)=="%"?parseFloat(t)/100*n:t}if(/^\d+$/.test(g[p])){g[p]=g[p]<=0?0:Math.min(g[p],n)}if(!q&&d.queue){if(o!=g[p]){h(d.onAfterFirst)}delete g[p]}});h(d.onAfter);function h(n){j.animate(g,e,d.easing,n&&function(){n.call(this,f,d)})}}).end()};a.max=function(j,i){var h=i=="x"?"Width":"Height",e="scroll"+h;if(!c(j).is("html,body")){return j[e]-c(j)[h.toLowerCase()]()}var g="client"+h,f=j.ownerDocument.documentElement,d=j.ownerDocument.body;return Math.max(f[e],d[e])-Math.min(f[g],d[g])};function b(d){return typeof d=="object"?d:{top:d,left:d}}})(jQuery);
  /*!	SWFObject v2.2 <http://code.google.com/p/swfobject/> 
  	is released under the MIT License <http://www.opensource.org/licenses/mit-license.php> 
  */
  var swfobject=function(){var D="undefined",r="object",S="Shockwave Flash",W="ShockwaveFlash.ShockwaveFlash",q="application/x-shockwave-flash",R="SWFObjectExprInst",x="onreadystatechange",O=window,j=document,t=navigator,T=false,U=[h],o=[],N=[],I=[],l,Q,E,B,J=false,a=false,n,G,m=true,M=function(){var aa=typeof j.getElementById!=D&&typeof j.getElementsByTagName!=D&&typeof j.createElement!=D,ah=t.userAgent.toLowerCase(),Y=t.platform.toLowerCase(),ae=Y?/win/.test(Y):/win/.test(ah),ac=Y?/mac/.test(Y):/mac/.test(ah),af=/webkit/.test(ah)?parseFloat(ah.replace(/^.*webkit\/(\d+(\.\d+)?).*$/,"$1")):false,X=!+"\v1",ag=[0,0,0],ab=null;if(typeof t.plugins!=D&&typeof t.plugins[S]==r){ab=t.plugins[S].description;if(ab&&!(typeof t.mimeTypes!=D&&t.mimeTypes[q]&&!t.mimeTypes[q].enabledPlugin)){T=true;X=false;ab=ab.replace(/^.*\s+(\S+\s+\S+$)/,"$1");ag[0]=parseInt(ab.replace(/^(.*)\..*$/,"$1"),10);ag[1]=parseInt(ab.replace(/^.*\.(.*)\s.*$/,"$1"),10);ag[2]=/[a-zA-Z]/.test(ab)?parseInt(ab.replace(/^.*[a-zA-Z]+(.*)$/,"$1"),10):0}}else{if(typeof O.ActiveXObject!=D){try{var ad=new ActiveXObject(W);
  if(ad){ab=ad.GetVariable("$version");if(ab){X=true;ab=ab.split(" ")[1].split(",");ag=[parseInt(ab[0],10),parseInt(ab[1],10),parseInt(ab[2],10)]}}}catch(Z){}}}return{w3:aa,pv:ag,wk:af,ie:X,win:ae,mac:ac}}(),k=function(){if(!M.w3){return}if((typeof j.readyState!=D&&j.readyState=="complete")||(typeof j.readyState==D&&(j.getElementsByTagName("body")[0]||j.body))){f()}if(!J){if(typeof j.addEventListener!=D){j.addEventListener("DOMContentLoaded",f,false)}if(M.ie&&M.win){j.attachEvent(x,function(){if(j.readyState=="complete"){j.detachEvent(x,arguments.callee);f()}});if(O==top){(function(){if(J){return}try{j.documentElement.doScroll("left")}catch(X){setTimeout(arguments.callee,0);return}f()})()}}if(M.wk){(function(){if(J){return}if(!/loaded|complete/.test(j.readyState)){setTimeout(arguments.callee,0);return}f()})()}s(f)}}();function f(){if(J){return}try{var Z=j.getElementsByTagName("body")[0].appendChild(C("span"));Z.parentNode.removeChild(Z)}catch(aa){return}J=true;var X=U.length;for(var Y=0;Y<X;Y++){U[Y]()}}function K(X){if(J){X()}else{U[U.length]=X}}function s(Y){if(typeof O.addEventListener!=D){O.addEventListener("load",Y,false)}else{if(typeof j.addEventListener!=D){j.addEventListener("load",Y,false)}else{if(typeof O.attachEvent!=D){i(O,"onload",Y)}else{if(typeof O.onload=="function"){var X=O.onload;O.onload=function(){X();Y()}}else{O.onload=Y}}}}}function h(){if(T){V()}else{H()}}function V(){var X=j.getElementsByTagName("body")[0];var aa=C(r);aa.setAttribute("type",q);var Z=X.appendChild(aa);if(Z){var Y=0;(function(){if(typeof Z.GetVariable!=D){var ab=Z.GetVariable("$version");if(ab){ab=ab.split(" ")[1].split(",");M.pv=[parseInt(ab[0],10),parseInt(ab[1],10),parseInt(ab[2],10)]}}else{if(Y<10){Y++;setTimeout(arguments.callee,10);return}}X.removeChild(aa);Z=null;H()})()}else{H()}}function H(){var ag=o.length;if(ag>0){for(var af=0;af<ag;af++){var Y=o[af].id;var ab=o[af].callbackFn;var aa={success:false,id:Y};if(M.pv[0]>0){var ae=c(Y);if(ae){if(F(o[af].swfVersion)&&!(M.wk&&M.wk<312)){w(Y,true);if(ab){aa.success=true;aa.ref=z(Y);ab(aa)}}else{if(o[af].expressInstall&&A()){var ai={};ai.data=o[af].expressInstall;ai.width=ae.getAttribute("width")||"0";ai.height=ae.getAttribute("height")||"0";if(ae.getAttribute("class")){ai.styleclass=ae.getAttribute("class")}if(ae.getAttribute("align")){ai.align=ae.getAttribute("align")}var ah={};var X=ae.getElementsByTagName("param");var ac=X.length;for(var ad=0;ad<ac;ad++){if(X[ad].getAttribute("name").toLowerCase()!="movie"){ah[X[ad].getAttribute("name")]=X[ad].getAttribute("value")}}P(ai,ah,Y,ab)}else{p(ae);if(ab){ab(aa)}}}}}else{w(Y,true);if(ab){var Z=z(Y);if(Z&&typeof Z.SetVariable!=D){aa.success=true;aa.ref=Z}ab(aa)}}}}}function z(aa){var X=null;var Y=c(aa);if(Y&&Y.nodeName=="OBJECT"){if(typeof Y.SetVariable!=D){X=Y}else{var Z=Y.getElementsByTagName(r)[0];if(Z){X=Z}}}return X}function A(){return !a&&F("6.0.65")&&(M.win||M.mac)&&!(M.wk&&M.wk<312)}function P(aa,ab,X,Z){a=true;E=Z||null;B={success:false,id:X};var ae=c(X);if(ae){if(ae.nodeName=="OBJECT"){l=g(ae);Q=null}else{l=ae;Q=X}aa.id=R;if(typeof aa.width==D||(!/%$/.test(aa.width)&&parseInt(aa.width,10)<310)){aa.width="310"}if(typeof aa.height==D||(!/%$/.test(aa.height)&&parseInt(aa.height,10)<137)){aa.height="137"}j.title=j.title.slice(0,47)+" - Flash Player Installation";var ad=M.ie&&M.win?"ActiveX":"PlugIn",ac="MMredirectURL="+O.location.toString().replace(/&/g,"%26")+"&MMplayerType="+ad+"&MMdoctitle="+j.title;if(typeof ab.flashvars!=D){ab.flashvars+="&"+ac}else{ab.flashvars=ac}if(M.ie&&M.win&&ae.readyState!=4){var Y=C("div");X+="SWFObjectNew";Y.setAttribute("id",X);ae.parentNode.insertBefore(Y,ae);ae.style.display="none";(function(){if(ae.readyState==4){ae.parentNode.removeChild(ae)}else{setTimeout(arguments.callee,10)}})()}u(aa,ab,X)}}function p(Y){if(M.ie&&M.win&&Y.readyState!=4){var X=C("div");Y.parentNode.insertBefore(X,Y);X.parentNode.replaceChild(g(Y),X);Y.style.display="none";(function(){if(Y.readyState==4){Y.parentNode.removeChild(Y)}else{setTimeout(arguments.callee,10)}})()}else{Y.parentNode.replaceChild(g(Y),Y)}}function g(ab){var aa=C("div");if(M.win&&M.ie){aa.innerHTML=ab.innerHTML}else{var Y=ab.getElementsByTagName(r)[0];if(Y){var ad=Y.childNodes;if(ad){var X=ad.length;for(var Z=0;Z<X;Z++){if(!(ad[Z].nodeType==1&&ad[Z].nodeName=="PARAM")&&!(ad[Z].nodeType==8)){aa.appendChild(ad[Z].cloneNode(true))}}}}}return aa}function u(ai,ag,Y){var X,aa=c(Y);if(M.wk&&M.wk<312){return X}if(aa){if(typeof ai.id==D){ai.id=Y}if(M.ie&&M.win){var ah="";for(var ae in ai){if(ai[ae]!=Object.prototype[ae]){if(ae.toLowerCase()=="data"){ag.movie=ai[ae]}else{if(ae.toLowerCase()=="styleclass"){ah+=' class="'+ai[ae]+'"'}else{if(ae.toLowerCase()!="classid"){ah+=" "+ae+'="'+ai[ae]+'"'}}}}}var af="";for(var ad in ag){if(ag[ad]!=Object.prototype[ad]){af+='<param name="'+ad+'" value="'+ag[ad]+'" />'}}aa.outerHTML='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'+ah+">"+af+"</object>";N[N.length]=ai.id;X=c(ai.id)}else{var Z=C(r);Z.setAttribute("type",q);for(var ac in ai){if(ai[ac]!=Object.prototype[ac]){if(ac.toLowerCase()=="styleclass"){Z.setAttribute("class",ai[ac])}else{if(ac.toLowerCase()!="classid"){Z.setAttribute(ac,ai[ac])}}}}for(var ab in ag){if(ag[ab]!=Object.prototype[ab]&&ab.toLowerCase()!="movie"){e(Z,ab,ag[ab])}}aa.parentNode.replaceChild(Z,aa);X=Z}}return X}function e(Z,X,Y){var aa=C("param");aa.setAttribute("name",X);aa.setAttribute("value",Y);Z.appendChild(aa)}function y(Y){var X=c(Y);if(X&&X.nodeName=="OBJECT"){if(M.ie&&M.win){X.style.display="none";(function(){if(X.readyState==4){b(Y)}else{setTimeout(arguments.callee,10)}})()}else{X.parentNode.removeChild(X)}}}function b(Z){var Y=c(Z);if(Y){for(var X in Y){if(typeof Y[X]=="function"){Y[X]=null}}Y.parentNode.removeChild(Y)}}function c(Z){var X=null;try{X=j.getElementById(Z)}catch(Y){}return X}function C(X){return j.createElement(X)}function i(Z,X,Y){Z.attachEvent(X,Y);I[I.length]=[Z,X,Y]}function F(Z){var Y=M.pv,X=Z.split(".");X[0]=parseInt(X[0],10);X[1]=parseInt(X[1],10)||0;X[2]=parseInt(X[2],10)||0;return(Y[0]>X[0]||(Y[0]==X[0]&&Y[1]>X[1])||(Y[0]==X[0]&&Y[1]==X[1]&&Y[2]>=X[2]))?true:false}function v(ac,Y,ad,ab){if(M.ie&&M.mac){return}var aa=j.getElementsByTagName("head")[0];if(!aa){return}var X=(ad&&typeof ad=="string")?ad:"screen";if(ab){n=null;G=null}if(!n||G!=X){var Z=C("style");Z.setAttribute("type","text/css");Z.setAttribute("media",X);n=aa.appendChild(Z);if(M.ie&&M.win&&typeof j.styleSheets!=D&&j.styleSheets.length>0){n=j.styleSheets[j.styleSheets.length-1]}G=X}if(M.ie&&M.win){if(n&&typeof n.addRule==r){n.addRule(ac,Y)}}else{if(n&&typeof j.createTextNode!=D){n.appendChild(j.createTextNode(ac+" {"+Y+"}"))}}}function w(Z,X){if(!m){return}var Y=X?"visible":"hidden";if(J&&c(Z)){c(Z).style.visibility=Y}else{v("#"+Z,"visibility:"+Y)}}function L(Y){var Z=/[\\\"<>\.;]/;var X=Z.exec(Y)!=null;return X&&typeof encodeURIComponent!=D?encodeURIComponent(Y):Y}var d=function(){if(M.ie&&M.win){window.attachEvent("onunload",function(){var ac=I.length;for(var ab=0;ab<ac;ab++){I[ab][0].detachEvent(I[ab][1],I[ab][2])}var Z=N.length;for(var aa=0;aa<Z;aa++){y(N[aa])}for(var Y in M){M[Y]=null}M=null;for(var X in swfobject){swfobject[X]=null}swfobject=null})}}();return{registerObject:function(ab,X,aa,Z){if(M.w3&&ab&&X){var Y={};Y.id=ab;Y.swfVersion=X;Y.expressInstall=aa;Y.callbackFn=Z;o[o.length]=Y;w(ab,false)}else{if(Z){Z({success:false,id:ab})}}},getObjectById:function(X){if(M.w3){return z(X)}},embedSWF:function(ab,ah,ae,ag,Y,aa,Z,ad,af,ac){var X={success:false,id:ah};if(M.w3&&!(M.wk&&M.wk<312)&&ab&&ah&&ae&&ag&&Y){w(ah,false);K(function(){ae+="";ag+="";var aj={};if(af&&typeof af===r){for(var al in af){aj[al]=af[al]}}aj.data=ab;aj.width=ae;aj.height=ag;var am={};if(ad&&typeof ad===r){for(var ak in ad){am[ak]=ad[ak]}}if(Z&&typeof Z===r){for(var ai in Z){if(typeof am.flashvars!=D){am.flashvars+="&"+ai+"="+Z[ai]}else{am.flashvars=ai+"="+Z[ai]}}}if(F(Y)){var an=u(aj,am,ah);if(aj.id==ah){w(ah,true)}X.success=true;X.ref=an}else{if(aa&&A()){aj.data=aa;P(aj,am,ah,ac);return}else{w(ah,true)}}if(ac){ac(X)}})}else{if(ac){ac(X)}}},switchOffAutoHideShow:function(){m=false},ua:M,getFlashPlayerVersion:function(){return{major:M.pv[0],minor:M.pv[1],release:M.pv[2]}},hasFlashPlayerVersion:F,createSWF:function(Z,Y,X){if(M.w3){return u(Z,Y,X)}else{return undefined}},showExpressInstall:function(Z,aa,X,Y){if(M.w3&&A()){P(Z,aa,X,Y)}},removeSWF:function(X){if(M.w3){y(X)}},createCSS:function(aa,Z,Y,X){if(M.w3){v(aa,Z,Y,X)}},addDomLoadEvent:K,addLoadEvent:s,getQueryParamValue:function(aa){var Z=j.location.search||j.location.hash;if(Z){if(/\?/.test(Z)){Z=Z.split("?")[1]}if(aa==null){return L(Z)}var Y=Z.split("&");for(var X=0;X<Y.length;X++){if(Y[X].substring(0,Y[X].indexOf("="))==aa){return L(Y[X].substring((Y[X].indexOf("=")+1)))}}}return""},expressInstallCallback:function(){if(a){var X=c(R);if(X&&l){X.parentNode.replaceChild(l,X);if(Q){w(Q,true);if(M.ie&&M.win){l.style.display="block"}}if(E){E(B)}}a=false}}}}();var SWFUpload;if(SWFUpload==undefined){SWFUpload=function(a){this.initSWFUpload(a)}}SWFUpload.prototype.initSWFUpload=function(b){try{this.customSettings={};this.settings=b;this.eventQueue=[];this.movieName="SWFUpload_"+SWFUpload.movieCount++;this.movieElement=null;SWFUpload.instances[this.movieName]=this;this.initSettings();this.loadFlash();this.displayDebugInfo()}catch(a){delete SWFUpload.instances[this.movieName];throw a}};SWFUpload.instances={};SWFUpload.movieCount=0;SWFUpload.version="2.2.0 2009-03-25";SWFUpload.QUEUE_ERROR={QUEUE_LIMIT_EXCEEDED:-100,FILE_EXCEEDS_SIZE_LIMIT:-110,ZERO_BYTE_FILE:-120,INVALID_FILETYPE:-130};SWFUpload.UPLOAD_ERROR={HTTP_ERROR:-200,MISSING_UPLOAD_URL:-210,IO_ERROR:-220,SECURITY_ERROR:-230,UPLOAD_LIMIT_EXCEEDED:-240,UPLOAD_FAILED:-250,SPECIFIED_FILE_ID_NOT_FOUND:-260,FILE_VALIDATION_FAILED:-270,FILE_CANCELLED:-280,UPLOAD_STOPPED:-290};SWFUpload.FILE_STATUS={QUEUED:-1,IN_PROGRESS:-2,ERROR:-3,COMPLETE:-4,CANCELLED:-5};SWFUpload.BUTTON_ACTION={SELECT_FILE:-100,SELECT_FILES:-110,START_UPLOAD:-120};
  SWFUpload.CURSOR={ARROW:-1,HAND:-2};SWFUpload.WINDOW_MODE={WINDOW:"window",TRANSPARENT:"transparent",OPAQUE:"opaque"};SWFUpload.completeURL=function(a){if(typeof(a)!=="string"||a.match(/^https?:\/\//i)||a.match(/^\//)){return a}var c=window.location.protocol+"//"+window.location.hostname+(window.location.port?":"+window.location.port:"");var b=window.location.pathname.lastIndexOf("/");if(b<=0){path="/"}else{path=window.location.pathname.substr(0,b)+"/"}return path+a};SWFUpload.prototype.initSettings=function(){this.ensureDefault=function(b,a){this.settings[b]=(this.settings[b]==undefined)?a:this.settings[b]};this.ensureDefault("upload_url","");this.ensureDefault("preserve_relative_urls",false);this.ensureDefault("file_post_name","Filedata");this.ensureDefault("post_params",{});this.ensureDefault("use_query_string",false);this.ensureDefault("requeue_on_error",false);this.ensureDefault("http_success",[]);this.ensureDefault("assume_success_timeout",0);this.ensureDefault("file_types","*.*");this.ensureDefault("file_types_description","All Files");this.ensureDefault("file_size_limit",0);this.ensureDefault("file_upload_limit",0);this.ensureDefault("file_queue_limit",0);this.ensureDefault("flash_url","swfupload.swf");this.ensureDefault("prevent_swf_caching",true);this.ensureDefault("button_image_url","");this.ensureDefault("button_width",1);this.ensureDefault("button_height",1);this.ensureDefault("button_text","");this.ensureDefault("button_text_style","color: #000000; font-size: 16pt;");this.ensureDefault("button_text_top_padding",0);this.ensureDefault("button_text_left_padding",0);this.ensureDefault("button_action",SWFUpload.BUTTON_ACTION.SELECT_FILES);this.ensureDefault("button_disabled",false);this.ensureDefault("button_placeholder_id","");this.ensureDefault("button_placeholder",null);this.ensureDefault("button_cursor",SWFUpload.CURSOR.ARROW);this.ensureDefault("button_window_mode",SWFUpload.WINDOW_MODE.WINDOW);this.ensureDefault("debug",false);this.settings.debug_enabled=this.settings.debug;this.settings.return_upload_start_handler=this.returnUploadStart;this.ensureDefault("swfupload_loaded_handler",null);this.ensureDefault("file_dialog_start_handler",null);this.ensureDefault("file_queued_handler",null);this.ensureDefault("file_queue_error_handler",null);this.ensureDefault("file_dialog_complete_handler",null);this.ensureDefault("upload_start_handler",null);this.ensureDefault("upload_progress_handler",null);this.ensureDefault("upload_error_handler",null);this.ensureDefault("upload_success_handler",null);this.ensureDefault("upload_complete_handler",null);this.ensureDefault("debug_handler",this.debugMessage);this.ensureDefault("custom_settings",{});this.customSettings=this.settings.custom_settings;if(!!this.settings.prevent_swf_caching){this.settings.flash_url=this.settings.flash_url+(this.settings.flash_url.indexOf("?")<0?"?":"&")+"preventswfcaching="+new Date().getTime()}if(!this.settings.preserve_relative_urls){this.settings.upload_url=SWFUpload.completeURL(this.settings.upload_url);this.settings.button_image_url=SWFUpload.completeURL(this.settings.button_image_url)}delete this.ensureDefault};SWFUpload.prototype.loadFlash=function(){var a,b;if(document.getElementById(this.movieName)!==null){throw"ID "+this.movieName+" is already in use. The Flash Object could not be added"}a=document.getElementById(this.settings.button_placeholder_id)||this.settings.button_placeholder;if(a==undefined){throw"Could not find the placeholder element: "+this.settings.button_placeholder_id}b=document.createElement("div");b.innerHTML=this.getFlashHTML();a.parentNode.replaceChild(b.firstChild,a);if(window[this.movieName]==undefined){window[this.movieName]=this.getMovieElement()}};SWFUpload.prototype.getFlashHTML=function(){return['<object id="',this.movieName,'" type="application/x-shockwave-flash" data="',this.settings.flash_url,'" width="',this.settings.button_width,'" height="',this.settings.button_height,'" class="swfupload">','<param name="wmode" value="',this.settings.button_window_mode,'" />','<param name="movie" value="',this.settings.flash_url,'" />','<param name="quality" value="high" />','<param name="menu" value="false" />','<param name="allowScriptAccess" value="always" />','<param name="flashvars" value="'+this.getFlashVars()+'" />',"</object>"].join("")};SWFUpload.prototype.getFlashVars=function(){var b=this.buildParamString();var a=this.settings.http_success.join(",");return["movieName=",encodeURIComponent(this.movieName),"&amp;uploadURL=",encodeURIComponent(this.settings.upload_url),"&amp;useQueryString=",encodeURIComponent(this.settings.use_query_string),"&amp;requeueOnError=",encodeURIComponent(this.settings.requeue_on_error),"&amp;httpSuccess=",encodeURIComponent(a),"&amp;assumeSuccessTimeout=",encodeURIComponent(this.settings.assume_success_timeout),"&amp;params=",encodeURIComponent(b),"&amp;filePostName=",encodeURIComponent(this.settings.file_post_name),"&amp;fileTypes=",encodeURIComponent(this.settings.file_types),"&amp;fileTypesDescription=",encodeURIComponent(this.settings.file_types_description),"&amp;fileSizeLimit=",encodeURIComponent(this.settings.file_size_limit),"&amp;fileUploadLimit=",encodeURIComponent(this.settings.file_upload_limit),"&amp;fileQueueLimit=",encodeURIComponent(this.settings.file_queue_limit),"&amp;debugEnabled=",encodeURIComponent(this.settings.debug_enabled),"&amp;buttonImageURL=",encodeURIComponent(this.settings.button_image_url),"&amp;buttonWidth=",encodeURIComponent(this.settings.button_width),"&amp;buttonHeight=",encodeURIComponent(this.settings.button_height),"&amp;buttonText=",encodeURIComponent(this.settings.button_text),"&amp;buttonTextTopPadding=",encodeURIComponent(this.settings.button_text_top_padding),"&amp;buttonTextLeftPadding=",encodeURIComponent(this.settings.button_text_left_padding),"&amp;buttonTextStyle=",encodeURIComponent(this.settings.button_text_style),"&amp;buttonAction=",encodeURIComponent(this.settings.button_action),"&amp;buttonDisabled=",encodeURIComponent(this.settings.button_disabled),"&amp;buttonCursor=",encodeURIComponent(this.settings.button_cursor)].join("")};SWFUpload.prototype.getMovieElement=function(){if(this.movieElement==undefined){this.movieElement=document.getElementById(this.movieName)}if(this.movieElement===null){throw"Could not find Flash element"}return this.movieElement};SWFUpload.prototype.buildParamString=function(){var c=this.settings.post_params;var b=[];if(typeof(c)==="object"){for(var a in c){if(c.hasOwnProperty(a)){b.push(encodeURIComponent(a.toString())+"="+encodeURIComponent(c[a].toString()))}}}return b.join("&amp;")};SWFUpload.prototype.destroy=function(){try{this.cancelUpload(null,false);var a=null;a=this.getMovieElement();if(a&&typeof(a.CallFunction)==="unknown"){for(var c in a){try{if(typeof(a[c])==="function"){a[c]=null}}catch(e){}}try{a.parentNode.removeChild(a)}catch(b){}}window[this.movieName]=null;SWFUpload.instances[this.movieName]=null;delete SWFUpload.instances[this.movieName];this.movieElement=null;this.settings=null;this.customSettings=null;this.eventQueue=null;this.movieName=null;return true}catch(d){return false}};SWFUpload.prototype.displayDebugInfo=function(){this.debug(["---SWFUpload Instance Info---\n","Version: ",SWFUpload.version,"\n","Movie Name: ",this.movieName,"\n","Settings:\n","\t","upload_url:               ",this.settings.upload_url,"\n","\t","flash_url:                ",this.settings.flash_url,"\n","\t","use_query_string:         ",this.settings.use_query_string.toString(),"\n","\t","requeue_on_error:         ",this.settings.requeue_on_error.toString(),"\n","\t","http_success:             ",this.settings.http_success.join(", "),"\n","\t","assume_success_timeout:   ",this.settings.assume_success_timeout,"\n","\t","file_post_name:           ",this.settings.file_post_name,"\n","\t","post_params:              ",this.settings.post_params.toString(),"\n","\t","file_types:               ",this.settings.file_types,"\n","\t","file_types_description:   ",this.settings.file_types_description,"\n","\t","file_size_limit:          ",this.settings.file_size_limit,"\n","\t","file_upload_limit:        ",this.settings.file_upload_limit,"\n","\t","file_queue_limit:         ",this.settings.file_queue_limit,"\n","\t","debug:                    ",this.settings.debug.toString(),"\n","\t","prevent_swf_caching:      ",this.settings.prevent_swf_caching.toString(),"\n","\t","button_placeholder_id:    ",this.settings.button_placeholder_id.toString(),"\n","\t","button_placeholder:       ",(this.settings.button_placeholder?"Set":"Not Set"),"\n","\t","button_image_url:         ",this.settings.button_image_url.toString(),"\n","\t","button_width:             ",this.settings.button_width.toString(),"\n","\t","button_height:            ",this.settings.button_height.toString(),"\n","\t","button_text:              ",this.settings.button_text.toString(),"\n","\t","button_text_style:        ",this.settings.button_text_style.toString(),"\n","\t","button_text_top_padding:  ",this.settings.button_text_top_padding.toString(),"\n","\t","button_text_left_padding: ",this.settings.button_text_left_padding.toString(),"\n","\t","button_action:            ",this.settings.button_action.toString(),"\n","\t","button_disabled:          ",this.settings.button_disabled.toString(),"\n","\t","custom_settings:          ",this.settings.custom_settings.toString(),"\n","Event Handlers:\n","\t","swfupload_loaded_handler assigned:  ",(typeof this.settings.swfupload_loaded_handler==="function").toString(),"\n","\t","file_dialog_start_handler assigned: ",(typeof this.settings.file_dialog_start_handler==="function").toString(),"\n","\t","file_queued_handler assigned:       ",(typeof this.settings.file_queued_handler==="function").toString(),"\n","\t","file_queue_error_handler assigned:  ",(typeof this.settings.file_queue_error_handler==="function").toString(),"\n","\t","upload_start_handler assigned:      ",(typeof this.settings.upload_start_handler==="function").toString(),"\n","\t","upload_progress_handler assigned:   ",(typeof this.settings.upload_progress_handler==="function").toString(),"\n","\t","upload_error_handler assigned:      ",(typeof this.settings.upload_error_handler==="function").toString(),"\n","\t","upload_success_handler assigned:    ",(typeof this.settings.upload_success_handler==="function").toString(),"\n","\t","upload_complete_handler assigned:   ",(typeof this.settings.upload_complete_handler==="function").toString(),"\n","\t","debug_handler assigned:             ",(typeof this.settings.debug_handler==="function").toString(),"\n"].join(""))
  };SWFUpload.prototype.addSetting=function(b,c,a){if(c==undefined){return(this.settings[b]=a)}else{return(this.settings[b]=c)}};SWFUpload.prototype.getSetting=function(a){if(this.settings[a]!=undefined){return this.settings[a]}return""};SWFUpload.prototype.callFlash=function(functionName,argumentArray){argumentArray=argumentArray||[];var movieElement=this.getMovieElement();var returnValue,returnString;try{returnString=movieElement.CallFunction('<invoke name="'+functionName+'" returntype="javascript">'+__flash__argumentsToXML(argumentArray,0)+"</invoke>");returnValue=eval(returnString)}catch(ex){throw"Call to "+functionName+" failed"}if(returnValue!=undefined&&typeof returnValue.post==="object"){returnValue=this.unescapeFilePostParams(returnValue)}return returnValue};SWFUpload.prototype.selectFile=function(){this.callFlash("SelectFile")};SWFUpload.prototype.selectFiles=function(){this.callFlash("SelectFiles")};SWFUpload.prototype.startUpload=function(a){this.callFlash("StartUpload",[a])};SWFUpload.prototype.cancelUpload=function(a,b){if(b!==false){b=true}this.callFlash("CancelUpload",[a,b])};SWFUpload.prototype.stopUpload=function(){this.callFlash("StopUpload")};SWFUpload.prototype.getStats=function(){return this.callFlash("GetStats")};SWFUpload.prototype.setStats=function(a){this.callFlash("SetStats",[a])};SWFUpload.prototype.getFile=function(a){if(typeof(a)==="number"){return this.callFlash("GetFileByIndex",[a])}else{return this.callFlash("GetFile",[a])}};SWFUpload.prototype.addFileParam=function(a,b,c){return this.callFlash("AddFileParam",[a,b,c])};SWFUpload.prototype.removeFileParam=function(a,b){this.callFlash("RemoveFileParam",[a,b])};SWFUpload.prototype.setUploadURL=function(a){this.settings.upload_url=a.toString();this.callFlash("SetUploadURL",[a])};SWFUpload.prototype.setPostParams=function(a){this.settings.post_params=a;this.callFlash("SetPostParams",[a])};SWFUpload.prototype.addPostParam=function(a,b){this.settings.post_params[a]=b;this.callFlash("SetPostParams",[this.settings.post_params])};SWFUpload.prototype.removePostParam=function(a){delete this.settings.post_params[a];this.callFlash("SetPostParams",[this.settings.post_params])};SWFUpload.prototype.setFileTypes=function(a,b){this.settings.file_types=a;this.settings.file_types_description=b;this.callFlash("SetFileTypes",[a,b])};SWFUpload.prototype.setFileSizeLimit=function(a){this.settings.file_size_limit=a;this.callFlash("SetFileSizeLimit",[a])};SWFUpload.prototype.setFileUploadLimit=function(a){this.settings.file_upload_limit=a;this.callFlash("SetFileUploadLimit",[a])};SWFUpload.prototype.setFileQueueLimit=function(a){this.settings.file_queue_limit=a;this.callFlash("SetFileQueueLimit",[a])};SWFUpload.prototype.setFilePostName=function(a){this.settings.file_post_name=a;this.callFlash("SetFilePostName",[a])};SWFUpload.prototype.setUseQueryString=function(a){this.settings.use_query_string=a;this.callFlash("SetUseQueryString",[a])};SWFUpload.prototype.setRequeueOnError=function(a){this.settings.requeue_on_error=a;this.callFlash("SetRequeueOnError",[a])};SWFUpload.prototype.setHTTPSuccess=function(a){if(typeof a==="string"){a=a.replace(" ","").split(",")}this.settings.http_success=a;this.callFlash("SetHTTPSuccess",[a])};SWFUpload.prototype.setAssumeSuccessTimeout=function(a){this.settings.assume_success_timeout=a;this.callFlash("SetAssumeSuccessTimeout",[a])};SWFUpload.prototype.setDebugEnabled=function(a){this.settings.debug_enabled=a;this.callFlash("SetDebugEnabled",[a])};SWFUpload.prototype.setButtonImageURL=function(a){if(a==undefined){a=""}this.settings.button_image_url=a;this.callFlash("SetButtonImageURL",[a])};SWFUpload.prototype.setButtonDimensions=function(c,a){this.settings.button_width=c;this.settings.button_height=a;var b=this.getMovieElement();if(b!=undefined){b.style.width=c+"px";b.style.height=a+"px"}this.callFlash("SetButtonDimensions",[c,a])};SWFUpload.prototype.setButtonText=function(a){this.settings.button_text=a;this.callFlash("SetButtonText",[a])};SWFUpload.prototype.setButtonTextPadding=function(b,a){this.settings.button_text_top_padding=a;this.settings.button_text_left_padding=b;this.callFlash("SetButtonTextPadding",[b,a])};SWFUpload.prototype.setButtonTextStyle=function(a){this.settings.button_text_style=a;this.callFlash("SetButtonTextStyle",[a])};SWFUpload.prototype.setButtonDisabled=function(a){this.settings.button_disabled=a;this.callFlash("SetButtonDisabled",[a])};SWFUpload.prototype.setButtonAction=function(a){this.settings.button_action=a;this.callFlash("SetButtonAction",[a])};SWFUpload.prototype.setButtonCursor=function(a){this.settings.button_cursor=a;this.callFlash("SetButtonCursor",[a])};SWFUpload.prototype.queueEvent=function(b,c){if(c==undefined){c=[]}else{if(!(c instanceof Array)){c=[c]}}var a=this;if(typeof this.settings[b]==="function"){this.eventQueue.push(function(){this.settings[b].apply(this,c)});setTimeout(function(){a.executeNextEvent()},0)}else{if(this.settings[b]!==null){throw"Event handler "+b+" is unknown or is not a function"}}};SWFUpload.prototype.executeNextEvent=function(){var a=this.eventQueue?this.eventQueue.shift():null;if(typeof(a)==="function"){a.apply(this)}};SWFUpload.prototype.unescapeFilePostParams=function(c){var e=/[$]([0-9a-f]{4})/i;var f={};var d;if(c!=undefined){for(var a in c.post){if(c.post.hasOwnProperty(a)){d=a;var b;while((b=e.exec(d))!==null){d=d.replace(b[0],String.fromCharCode(parseInt("0x"+b[1],16)))}f[d]=c.post[a]}}c.post=f}return c};SWFUpload.prototype.testExternalInterface=function(){try{return this.callFlash("TestExternalInterface")}catch(a){return false}};SWFUpload.prototype.flashReady=function(){var a=this.getMovieElement();if(!a){this.debug("Flash called back ready but the flash movie can't be found.");return}this.cleanUp(a);this.queueEvent("swfupload_loaded_handler")};SWFUpload.prototype.cleanUp=function(a){try{if(this.movieElement&&typeof(a.CallFunction)==="unknown"){this.debug("Removing Flash functions hooks (this should only run in IE and should prevent memory leaks)");for(var c in a){try{if(typeof(a[c])==="function"){a[c]=null}}catch(b){}}}}catch(d){}window.__flash__removeCallback=function(e,f){try{if(e){e[f]=null}}catch(g){}}};SWFUpload.prototype.fileDialogStart=function(){this.queueEvent("file_dialog_start_handler")};SWFUpload.prototype.fileQueued=function(a){a=this.unescapeFilePostParams(a);this.queueEvent("file_queued_handler",a)};SWFUpload.prototype.fileQueueError=function(a,c,b){a=this.unescapeFilePostParams(a);this.queueEvent("file_queue_error_handler",[a,c,b])};SWFUpload.prototype.fileDialogComplete=function(b,c,a){this.queueEvent("file_dialog_complete_handler",[b,c,a])};SWFUpload.prototype.uploadStart=function(a){a=this.unescapeFilePostParams(a);this.queueEvent("return_upload_start_handler",a)};SWFUpload.prototype.returnUploadStart=function(a){var b;if(typeof this.settings.upload_start_handler==="function"){a=this.unescapeFilePostParams(a);b=this.settings.upload_start_handler.call(this,a)}else{if(this.settings.upload_start_handler!=undefined){throw"upload_start_handler must be a function"}}if(b===undefined){b=true}b=!!b;this.callFlash("ReturnUploadStart",[b])};SWFUpload.prototype.uploadProgress=function(a,c,b){a=this.unescapeFilePostParams(a);this.queueEvent("upload_progress_handler",[a,c,b])};SWFUpload.prototype.uploadError=function(a,c,b){a=this.unescapeFilePostParams(a);this.queueEvent("upload_error_handler",[a,c,b])};SWFUpload.prototype.uploadSuccess=function(b,a,c){b=this.unescapeFilePostParams(b);this.queueEvent("upload_success_handler",[b,a,c])};SWFUpload.prototype.uploadComplete=function(a){a=this.unescapeFilePostParams(a);this.queueEvent("upload_complete_handler",a)};SWFUpload.prototype.debug=function(a){this.queueEvent("debug_handler",a)};SWFUpload.prototype.debugMessage=function(c){if(this.settings.debug){var a,d=[];if(typeof c==="object"&&typeof c.name==="string"&&typeof c.message==="string"){for(var b in c){if(c.hasOwnProperty(b)){d.push(b+": "+c[b])}}a=d.join("\n")||"";d=a.split("\n");a="EXCEPTION: "+d.join("\nEXCEPTION: ");SWFUpload.Console.writeLine(a)}else{SWFUpload.Console.writeLine(c)}}};SWFUpload.Console={};SWFUpload.Console.writeLine=function(d){var b,a;try{b=document.getElementById("SWFUpload_Console");if(!b){a=document.createElement("form");document.getElementsByTagName("body")[0].appendChild(a);b=document.createElement("textarea");b.id="SWFUpload_Console";b.style.fontFamily="monospace";b.setAttribute("wrap","off");b.wrap="off";b.style.overflow="auto";b.style.width="700px";b.style.height="350px";b.style.margin="5px";a.appendChild(b)}b.value+=d+"\n";b.scrollTop=b.scrollHeight-b.clientHeight}catch(c){alert("Exception: "+c.name+" Message: "+c.message)}};var fluid_1_4=fluid_1_4||{};(function(f,g){var e=function(r,q,p){q=(q)?q:p;r.animate(q.params,q.duration,q.callback)};var l=function(r,p,q){r.queue("fx",[]);r.animate({width:p,queue:false},q)};var i=function(p,q){if(q===false){p.displayElement.show()}else{e(p.displayElement,q,p.options.showAnimation)}};var a=function(r,q,s){q=(q===null||isNaN(q))?r.options.delay:q;if(q){var p=setTimeout(function(){a(r,0,s)},q)}else{if(s===false){r.displayElement.hide()}else{e(r.displayElement,s,r.options.hideAnimation)}}};var o=function(r,q,t){t=t||false;var p=r.indicator.width();var s=r.options.animate;if((q>p)&&(s==="both"||s==="forward")&&!t){l(r.indicator,q,r.options.speed)}else{if((q<p)&&(s==="both"||s==="backward")&&!t){l(r.indicator,q,r.options.speed)}else{r.indicator.width(q)}}};var j=function(q,p){return Math.round((Math.min(p,100)*q.progressBar.innerWidth())/100)};var n=function(p){var q=Math.max(j(p,parseFloat(p.storedPercent)),p.options.minWidth);o(p,q,true)};var k=function(p,q){p.attr("role","progressbar");p.attr("aria-valuemin","0");p.attr("aria-valuemax","100");p.attr("aria-valuenow","0");if(q){p.attr("aria-valuetext","")}p.attr("aria-busy","false")};var h=function(s,r){var t=s.options.strings;var q=r<100&&r>0;s.ariaElement.attr("aria-busy",q);s.ariaElement.attr("aria-valuenow",r);if(t.ariaBusyText){if(q){var p=g.stringTemplate(t.ariaBusyText,{percentComplete:r});
  s.ariaElement.attr("aria-valuetext",p)}else{if(r===100){s.ariaElement.attr("aria-valuetext",t.ariaDoneText)}}}};var d=function(p,q){p.html(q)};var m=function(p){p.indicator.css("top",p.progressBar.position().top).css("left",0).height(p.progressBar.height());n(p)};var b=function(r,q,p,t){i(r,t);if(q!==null){r.storedPercent=q;var s=Math.max(j(r,parseFloat(q)),r.options.minWidth);o(r,s)}if(p!==null){d(r.label,p)}if(r.ariaElement){h(r,q)}};var c=function(p){p.displayElement=p.locate("displayElement");if(p.options.initiallyHidden){p.displayElement.hide()}p.progressBar=p.locate("progressBar");p.label=p.locate("label");p.indicator=p.locate("indicator");p.ariaElement=p.locate("ariaElement");p.indicator.width(p.options.minWidth);p.storedPercent=0;if(p.ariaElement){k(p.ariaElement,p.options.strings.ariaBusyText)}if(p.options.hideAnimation.callback){p.events.afterProgressHidden.addListener(p.options.hideAnimation.callback)}p.options.hideAnimation.callback=p.events.afterProgressHidden.fire;if(p.options.showAnimation.callback){p.events.onProgressBegin.addListener(p.options.showAnimation.callback)}p.options.showAnimation.callback=p.events.onProgressBegin.fire};g.progress=function(p,q){var r=g.initView("fluid.progress",p,q);c(r);r.show=function(s){i(r,s)};r.hide=function(s,t){a(r,s,t)};r.update=function(s,t,u){b(r,s,t,u)};r.refreshView=function(){m(r)};return r};g.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);var fluid_1_4=fluid_1_4||{};(function(c,b){b.registerNamespace("fluid.browser");b.browser.binaryXHR=function(){var d=window.FormData||(window.XMLHttpRequest&&window.XMLHttpRequest.prototype&&window.XMLHttpRequest.prototype.sendAsBinary);return d?b.typeTag("fluid.browser.supportsBinaryXHR"):undefined};b.browser.formData=function(){return window.FormData?b.typeTag("fluid.browser.supportsFormData"):undefined};b.browser.flash=function(){var d=(typeof(swfobject)!=="undefined")&&(swfobject.getFlashPlayerVersion().major>8);return d?b.typeTag("fluid.browser.supportsFlash"):undefined};b.progressiveChecker=function(d){var e=b.initLittleComponent("fluid.progressiveChecker",d);return b.typeTag(b.find(e.options.checks,function(f){if(f.feature){return f.contextName}},e.options.defaultContextName))};b.defaults("fluid.progressiveChecker",{gradeNames:"fluid.typeFount",checks:[],defaultContextName:undefined});b.progressiveCheckerForComponent=function(d){var e=b.initLittleComponent("fluid.progressiveCheckerForComponent",d);var f=b.defaults(e.options.componentName);return b.progressiveChecker(b.expandOptions(f.progressiveCheckerOptions,e))};b.defaults("fluid.progressiveCheckerForComponent",{gradeNames:"fluid.typeFount"});c("head").append("<style type='text/css'>.fl-progEnhance-basic, .fl-ProgEnhance-basic { display: none; } .fl-progEnhance-enhanced, .fl-ProgEnhance-enhanced { display: block; }</style>");var a={supportsBinaryXHR:b.browser.binaryXHR(),supportsFormData:b.browser.formData(),supportsFlash:b.browser.flash()};b.merge(null,b.staticEnvironment,a)})(jQuery,fluid_1_4);var fluid_1_4=fluid_1_4||{};(function(i,l){l.setLogging(true);var n=function(x,y){return(y===1)?x.options.strings.progress.singleFile:x.options.strings.progress.pluralFiles};var s=function(x,y){y.prop("disabled",false);y.removeClass(x.options.styles.dim)};var o=function(x,y){y.prop("disabled",true);y.addClass(x.options.styles.dim)};var a=function(x,y){y.removeClass(x.options.styles.hidden)};var g=function(x,y){y.addClass(x.options.styles.hidden)};var u=function(z,y){y=y||false;var x=z.totalProgress.indicator;x.toggleClass(z.options.styles.totalProgress,!y);x.toggleClass(z.options.styles.totalProgressError,y)};var h=function(x){o(x,x.locate("uploadButton"));if(x.queue.files.length===0){x.locate("browseButtonText").text(x.options.strings.buttons.browse);x.locate("browseButton").removeClass(x.options.styles.browseButton);a(x,x.locate("instructions"))}};var d=function(x){o(x,x.locate("uploadButton"));s(x,x.locate("browseButton"));x.strategy.local.enableBrowseButton();g(x,x.locate("pauseButton"));a(x,x.locate("uploadButton"))};var m=function(x){x.locate("browseButtonText").text(x.options.strings.buttons.addMore);x.locate("browseButton").addClass(x.options.styles.browseButton);g(x,x.locate("pauseButton"));a(x,x.locate("uploadButton"));s(x,x.locate("uploadButton"));s(x,x.locate("browseButton"));x.strategy.local.enableBrowseButton();g(x,x.locate("instructions"));x.totalProgress.hide()};var e=function(x){x.totalProgress.hide(false,false);u(x);g(x,x.locate("uploadButton"));o(x,x.locate("browseButton"));x.strategy.local.disableBrowseButton();s(x,x.locate("pauseButton"));a(x,x.locate("pauseButton"));x.locate(x.options.focusWithEvent.afterUploadStart).focus()};var t=function(A){var y=A.queue.getReadyFiles().length;var B=A.queue.sizeOfReadyFiles();var x=n(A,y);var z=l.stringTemplate(A.options.strings.progress.toUploadLabel,{fileCount:y,fileLabel:x,totalBytes:l.uploader.formatFileSize(B)});A.locate("totalFileStatusText").html(z)};var c=function(C){var A=C.queue.currentBatch;var x=l.uploader.derivePercent(A.totalBytesUploaded,A.totalBytes);var z=A.files.length;var B=n(C,z);var y=l.stringTemplate(C.options.strings.progress.totalProgressLabel,{curFileN:A.fileIdx,totalFilesN:z,fileLabel:B,currBytes:l.uploader.formatFileSize(A.totalBytesUploaded),totalBytes:l.uploader.formatFileSize(A.totalBytes)});C.totalProgress.update(x,y)};var q=function(B){var D=B.queue.getErroredFiles().length;var C=B.queue.files.length;var z=n(B,C);var A="";if(D>0){var y=(D===1)?B.options.strings.progress.singleError:B.options.strings.progress.pluralErrors;u(B,true);A=l.stringTemplate(B.options.strings.progress.numberOfErrors,{errorsN:D,errorLabel:y})}var x=l.stringTemplate(B.options.strings.progress.completedLabel,{curFileN:B.queue.getUploadedFiles().length,totalFilesN:C,errorString:A,fileLabel:z,totalCurrBytes:l.uploader.formatFileSize(B.queue.sizeOfUploadedFiles())});B.totalProgress.update(100,x)};var v=function(z){var x=z.locate("fileQueue");if(z.queue.files.length===0){x.attr("summary",z.options.strings.queue.emptyQueue)}else{var y=l.stringTemplate(z.options.strings.queue.queueSummary,{totalUploaded:z.queue.getUploadedFiles().length,totalInUploadQueue:z.queue.files.length-z.queue.getUploadedFiles().length});x.attr("summary",y)}};var r=function(x){x.locate("uploadButton").click(function(){x.start()});x.locate("pauseButton").click(function(){x.stop()})};var w=function(x){if(x.queue.getReadyFiles().length>0){m(x);t(x);x.locate(x.options.focusWithEvent.afterFileDialog).focus();v(x)}};var j=function(x){if(x.queue.getReadyFiles().length===0){h(x)}t(x);v(x)};var p=function(x){if(x.queue.getReadyFiles().length===0){d(x)}else{m(x)}q(x);v(x)};var b=function(x){x.events.afterFileDialog.addListener(function(){w(x)});x.events.afterFileQueued.addListener(function(y){x.queue.addFile(y)});x.events.onFileRemoved.addListener(function(y){x.removeFile(y)});x.events.afterFileRemoved.addListener(function(){j(x)});x.events.onUploadStart.addListener(function(){e(x)});x.events.onUploadStop.addListener(function(){x.locate(x.options.focusWithEvent.onUploadStop).focus()});x.events.onFileStart.addListener(function(y){y.filestatus=l.uploader.fileStatusConstants.IN_PROGRESS;x.queue.startFile()});x.events.onFileProgress.addListener(function(y,A,z){x.queue.updateBatchStatus(A);c(x)});x.events.onFileComplete.addListener(function(y){x.queue.finishFile(y);x.events.afterFileComplete.fire(y);if(x.queue.shouldUploadNextFile()){x.strategy.remote.uploadNextFile()}else{x.events.afterUploadComplete.fire(x.queue.currentBatch.files);x.queue.clearCurrentBatch()}});x.events.onFileSuccess.addListener(function(y){y.filestatus=l.uploader.fileStatusConstants.COMPLETE;if(x.queue.currentBatch.bytesUploadedForFile===0){x.queue.currentBatch.totalBytesUploaded+=y.size}c(x)});x.events.onFileError.addListener(function(z,y){if(y===l.uploader.errorConstants.UPLOAD_STOPPED){z.filestatus=l.uploader.fileStatusConstants.CANCELLED;return}else{z.filestatus=l.uploader.fileStatusConstants.ERROR;if(x.queue.isUploading){x.queue.currentBatch.totalBytesUploaded+=z.size;x.queue.currentBatch.numFilesErrored++}}});x.events.afterUploadComplete.addListener(function(){x.queue.isUploading=false;p(x)})};var k=function(x){x.demo=l.typeTag(x.options.demo?"fluid.uploader.demo":"fluid.uploader.live");l.initDependents(x);o(x,x.locate("uploadButton"));r(x);b(x);v(x);x.statusUpdater();x.container.attr("role","application")};l.uploader=function(x,y){var z=l.initView("fluid.uploader",x);if(l.uploader.transformOptions){y=l.uploader.transformOptions(y)}z.uploaderOptions=y;l.initDependents(z);return z.uploaderImpl};l.uploaderImpl=function(){l.fail('Error creating uploader component - please make sure that a progressiveCheckerForComponent for "fluid.uploader" is registered either in the static environment or else is visible in the current component tree')};l.defaults("fluid.uploader",{gradeNames:["fluid.viewComponent"],components:{uploaderContext:{type:"fluid.progressiveCheckerForComponent",options:{componentName:"fluid.uploader"}},uploaderImpl:{type:"fluid.uploaderImpl",container:"{uploader}.container",options:"{uploader}.uploaderOptions"}},progressiveCheckerOptions:{checks:[{feature:"{fluid.browser.supportsBinaryXHR}",contextName:"fluid.uploader.html5"},{feature:"{fluid.browser.supportsFlash}",contextName:"fluid.uploader.swfUpload"}],defaultContextName:"fluid.uploader.singleFile"}});l.alias("fluid.uploader","fluid.uploaderImpl");
  l.progressiveEnhanceableUploader=function(x,z,y){return l.uploader(x,y)};l.uploader.multiFileUploader=function(x,y){var z=l.initView("fluid.uploader.multiFileUploader",x,y);z.queue=l.uploader.fileQueue();z.browse=function(){if(!z.queue.isUploading){z.strategy.local.browse()}};z.removeFile=function(A){z.queue.removeFile(A);z.strategy.local.removeFile(A);z.events.afterFileRemoved.fire(A)};z.start=function(){z.queue.start();z.events.onUploadStart.fire(z.queue.currentBatch.files);z.strategy.remote.uploadNextFile()};z.stop=function(){z.events.onUploadStop.fire();z.strategy.remote.stop()};k(z);return z};l.defaults("fluid.uploader.multiFileUploader",{gradeNames:"fluid.viewComponent",components:{strategy:{type:"fluid.uploader.progressiveStrategy"},fileQueueView:{type:"fluid.uploader.fileQueueView",options:{model:"{multiFileUploader}.queue.files",uploaderContainer:"{multiFileUploader}.container"}},totalProgress:{type:"fluid.uploader.totalProgressBar",options:{selectors:{progressBar:".flc-uploader-queue-footer",displayElement:".flc-uploader-total-progress",label:".flc-uploader-total-progress-text",indicator:".flc-uploader-total-progress",ariaElement:".flc-uploader-total-progress"}}}},invokers:{statusUpdater:"fluid.uploader.ariaLiveRegionUpdater"},queueSettings:{uploadURL:"",postParams:{},fileSizeLimit:"20480",fileTypes:null,fileTypesDescription:null,fileUploadLimit:0,fileQueueLimit:0},demo:false,selectors:{fileQueue:".flc-uploader-queue",browseButton:".flc-uploader-button-browse",browseButtonText:".flc-uploader-button-browse-text",uploadButton:".flc-uploader-button-upload",pauseButton:".flc-uploader-button-pause",totalFileStatusText:".flc-uploader-total-progress-text",instructions:".flc-uploader-browse-instructions",statusRegion:".flc-uploader-status-region"},focusWithEvent:{afterFileDialog:"uploadButton",afterUploadStart:"pauseButton",onUploadStop:"uploadButton"},styles:{disabled:"fl-uploader-disabled",hidden:"fl-uploader-hidden",dim:"fl-uploader-dim",totalProgress:"fl-uploader-total-progress-okay",totalProgressError:"fl-uploader-total-progress-errored",browseButton:"fl-uploader-browseMore"},events:{afterReady:null,onFileDialog:null,afterFileQueued:null,onFileRemoved:null,afterFileRemoved:null,onQueueError:null,afterFileDialog:null,onUploadStart:null,onUploadStop:null,onFileStart:null,onFileProgress:null,onFileError:null,onFileSuccess:null,onFileComplete:null,afterFileComplete:null,afterUploadComplete:null},strings:{progress:{toUploadLabel:"To upload: %fileCount %fileLabel (%totalBytes)",totalProgressLabel:"Uploading: %curFileN of %totalFilesN %fileLabel (%currBytes of %totalBytes)",completedLabel:"Uploaded: %curFileN of %totalFilesN %fileLabel (%totalCurrBytes)%errorString",numberOfErrors:", %errorsN %errorLabel",singleFile:"file",pluralFiles:"files",singleError:"error",pluralErrors:"errors"},buttons:{browse:"Browse Files",addMore:"Add More",stopUpload:"Stop Upload",cancelRemaning:"Cancel remaining Uploads",resumeUpload:"Resume Upload"},queue:{emptyQueue:"File list: No files waiting to be uploaded.",queueSummary:"File list:  %totalUploaded files uploaded, %totalInUploadQueue file waiting to be uploaded."}},mergePolicy:{"fileQueueView.options.model":"preserve"}});l.demands("fluid.uploader.totalProgressBar","fluid.uploader.multiFileUploader",{funcName:"fluid.progress",container:"{multiFileUploader}.container"});l.demands("fluid.uploader.fileQueueView","fluid.uploader.multiFileUploader",{container:"{multiFileUploader}.dom.fileQueue",options:{events:{onFileRemoved:"{multiFileUploader}.events.onFileRemoved"}}});l.demands("fluid.uploader.fileQueueView.eventBinder",["fluid.uploader.multiFileUploader","fluid.uploader.fileQueueView"],{options:{listeners:{"{multiFileUploader}.events.afterFileQueued":"{fileQueueView}.addFile","{multiFileUploader}.events.onUploadStart":"{fileQueueView}.prepareForUpload","{multiFileUploader}.events.onFileStart":"{fileQueueView}.showFileProgress","{multiFileUploader}.events.onFileProgress":"{fileQueueView}.updateFileProgress","{multiFileUploader}.events.onFileSuccess":"{fileQueueView}.markFileComplete","{multiFileUploader}.events.onFileError":"{fileQueueView}.showErrorForFile","{multiFileUploader}.events.afterFileComplete":"{fileQueueView}.hideFileProgress","{multiFileUploader}.events.afterUploadComplete":"{fileQueueView}.refreshAfterUpload"}}});l.uploader.formatFileSize=function(x){if(typeof(x)==="number"){if(x===0){return"0.0 KB"}else{if(x>0){if(x<1048576){return(Math.ceil(x/1024*10)/10).toFixed(1)+" KB"}else{return(Math.ceil(x/1048576*10)/10).toFixed(1)+" MB"}}}}return""};l.uploader.derivePercent=function(x,y){return Math.round((x*100)/y)};l.uploader.ariaLiveRegionUpdater=function(x,A,y){x.attr("role","log");x.attr("aria-live","assertive");x.attr("aria-relevant","text");x.attr("aria-atomic","true");var z=function(){x.text(A.text())};y.afterFileDialog.addListener(z);y.afterFileRemoved.addListener(z);y.afterUploadComplete.addListener(z)};l.demands("fluid.uploader.ariaLiveRegionUpdater","fluid.uploader.multiFileUploader",{funcName:"fluid.uploader.ariaLiveRegionUpdater",args:["{multiFileUploader}.dom.statusRegion","{multiFileUploader}.dom.totalFileStatusText","{multiFileUploader}.events"]});l.uploader.errorConstants={HTTP_ERROR:-200,MISSING_UPLOAD_URL:-210,IO_ERROR:-220,SECURITY_ERROR:-230,UPLOAD_LIMIT_EXCEEDED:-240,UPLOAD_FAILED:-250,SPECIFIED_FILE_ID_NOT_FOUND:-260,FILE_VALIDATION_FAILED:-270,FILE_CANCELLED:-280,UPLOAD_STOPPED:-290};l.uploader.fileStatusConstants={QUEUED:-1,IN_PROGRESS:-2,ERROR:-3,COMPLETE:-4,CANCELLED:-5};var f=function(x,y){if(window.opera){x.show().removeClass("hideUploaderForOpera");y.show().addClass("hideUploaderForOpera")}else{x.show();y.hide()}};l.uploader.singleFileUploader=function(x,y){var z=l.initView("fluid.uploader.singleFileUploader",x,y);f(i(z.options.selectors.basicUpload),z.container);return z};l.defaults("fluid.uploader.singleFileUploader",{gradeNames:"fluid.viewComponent",selectors:{basicUpload:".fl-progEnhance-basic"}});l.demands("fluid.uploaderImpl","fluid.uploader.singleFile",{funcName:"fluid.uploader.singleFileUploader"})})(jQuery,fluid_1_4);var fluid_1_4=fluid_1_4||{};(function(b,a){a.uploader=a.uploader||{};var c=function(g,h){var d=[];for(var f=0;f<g.length;f++){var e=g[f];if(h(e)===true){d.push(e)}}return d};a.uploader.fileQueue=function(){var d={};d.files=[];d.isUploading=false;d.start=function(){d.setupCurrentBatch();d.isUploading=true;d.shouldStop=false};d.startFile=function(){d.currentBatch.fileIdx++;d.currentBatch.bytesUploadedForFile=0;d.currentBatch.previousBytesUploadedForFile=0};d.finishFile=function(e){d.currentBatch.numFilesCompleted++};d.shouldUploadNextFile=function(){return !d.shouldStop&&d.isUploading&&d.currentBatch.numFilesCompleted<d.currentBatch.files.length};d.addFile=function(e){d.files.push(e)};d.removeFile=function(f){var e=b.inArray(f,d.files);d.files.splice(e,1)};d.totalBytes=function(){return a.uploader.fileQueue.sizeOfFiles(d.files)};d.getReadyFiles=function(){return c(d.files,function(e){return(e.filestatus===a.uploader.fileStatusConstants.QUEUED||e.filestatus===a.uploader.fileStatusConstants.CANCELLED)})};d.getErroredFiles=function(){return c(d.files,function(e){return(e.filestatus===a.uploader.fileStatusConstants.ERROR)})};d.sizeOfReadyFiles=function(){return a.uploader.fileQueue.sizeOfFiles(d.getReadyFiles())};d.getUploadedFiles=function(){return c(d.files,function(e){return(e.filestatus===a.uploader.fileStatusConstants.COMPLETE)})};d.sizeOfUploadedFiles=function(){return a.uploader.fileQueue.sizeOfFiles(d.getUploadedFiles())};d.setupCurrentBatch=function(){d.clearCurrentBatch();d.updateCurrentBatch()};d.clearCurrentBatch=function(){d.currentBatch={fileIdx:0,files:[],totalBytes:0,numFilesCompleted:0,numFilesErrored:0,bytesUploadedForFile:0,previousBytesUploadedForFile:0,totalBytesUploaded:0}};d.updateCurrentBatch=function(){var e=d.getReadyFiles();d.currentBatch.files=e;d.currentBatch.totalBytes=a.uploader.fileQueue.sizeOfFiles(e)};d.updateBatchStatus=function(f){var e=f-d.currentBatch.previousBytesUploadedForFile;d.currentBatch.totalBytesUploaded+=e;d.currentBatch.bytesUploadedForFile+=e;d.currentBatch.previousBytesUploadedForFile=f};return d};a.uploader.fileQueue.sizeOfFiles=function(f){var g=0;for(var e=0;e<f.length;e++){var d=f[e];g+=d.size}return g}})(jQuery,fluid_1_4);var fluid_1_4=fluid_1_4||{};(function(f,h){var C=function(F,E){return F.locate("fileQueue").find("#"+E.id)};var e=function(F,E){return f("#"+E.id+"_error",F.container)};var d=function(H,I){var G=H.model;var F;for(F=0;F<G.length;F++){var E=G[F];if(E.id.toString()===I.prop("id")){return E}}return null};var t=function(F,E){var G=E.id+"_progress";return F.fileProgressors[G]};var z=function(G,E){var F=C(G,E);G.scroller.scrollTo(F);var H=t(G,E);H.refreshView();H.show()};var r=function(H,F,G,E){var I=h.uploader.derivePercent(G,E);var J=I+"%";t(H,F).update(I,J)};var m=function(G,E){var F=C(G,E);t(G,E).hide();if(E.filestatus===h.uploader.fileStatusConstants.COMPLETE){G.locate("fileIconBtn",F).removeClass(G.options.styles.dim)}};var c=function(G,F){var H=t(G,F);if(!H){return}var E=H.displayElement;E.remove()};var A=function(E,F){F.fadeOut("fast",function(){F.remove();E.refreshView()})};var D=function(F,E){if(E.filestatus===h.uploader.fileStatusConstants.ERROR){A(F,e(F,E))}};var b=function(F,E,G){c(F,E);D(F,E);F.events.onFileRemoved.fire(E);A(F,G)};var k=function(F,G){var E=d(F,G);if(!E||E.filestatus===h.uploader.fileStatusConstants.COMPLETE){return}b(F,E,G)};var v=function(F,E){var G=C(F,E);b(F,E,G)};var j=function(H,F){var G=function(){if(H.hasClass(F.ready)&&!H.hasClass(F.uploading)){H.addClass(F.hover)}};var E=function(){if(H.hasClass(F.ready)&&!H.hasClass(F.uploading)){H.removeClass(F.hover)}};H.hover(G,E)};var i=function(E,G){var F=function(){k(E,G)};h.activatable(G,null,{additionalBindings:[{key:f.ui.keyCode.DELETE,activateHandler:F}]})};var l=function(E,F){if(f.browser.msie&&f.browser.version<7){j(F,E.options.styles)}E.locate("fileIconBtn",F).click(function(){k(E,F)
  });i(E,F)};var q=function(G,F){var H=G.rowTemplate.clone(),I=F.name,E=h.uploader.formatFileSize(F.size);H.removeClass(G.options.styles.hiddenTemplate);G.locate("fileName",H).text(I);G.locate("fileSize",H).text(E);G.locate("fileIconBtn",H).addClass(G.options.styles.remove);H.prop("id",F.id);H.addClass(G.options.styles.ready);l(G,H);h.updateAriaLabel(H,I+" "+E);return H};var s=function(F,I){var E=F.rowProgressorTemplate.clone();var G=I.prop("id");var H=G+"_progress";E.prop("id",H);E.css("top",I.position().top);E.height(I.height()).width(5);F.container.after(E);F.fileProgressors[H]=h.progress(F.options.uploaderContainer,{selectors:{progressBar:"#"+G,displayElement:"#"+H,label:"#"+H+" .fl-uploader-file-progress-text",indicator:"#"+H}})};var u=function(F,E){var G=q(F,E);if(!(f.browser.msie&&(f.browser.version>=8))){G.hide()}F.container.append(G);G.attr("title",F.options.strings.status.remove);G.fadeIn("slow");s(F,G);F.refreshView();F.scroller.scrollTo("100%")};var p=function(G,F){var E;for(E=0;E<G.length;E++){h.enabled(G[E],F)}};var y=function(E){var F=E.locate("fileIconBtn",E.locate("fileRows"));F.prop("disabled",true);F.addClass(E.options.styles.dim);p(E.locate("fileRows"),false)};var g=function(E){var F=E.locate("fileIconBtn",E.locate("fileRows"));F.prop("disabled",false);F.removeClass(E.options.styles.dim);p(E.locate("fileRows"),true)};var o=function(E,G,F){G.removeClass(E.options.styles.ready).removeClass(E.options.styles.error).addClass(F)};var a=function(G,F){var H=C(G,F);o(G,H,G.options.styles.uploaded);H.attr("title",G.options.strings.status.success);h.enabled(H,false);var E=G.locate("fileIconBtn",H);E.unbind("click");E.removeClass(G.options.styles.remove);E.attr("title",G.options.strings.status.success)};var w=function(H,J,E){var G=H.errorInfoRowTemplate.clone();G.prop("id",J.prop("id")+"_error");var I=h.keyForValue(h.uploader.errorConstants,E);var F=H.options.strings.errors[I];H.locate("errorText",G).text(F);J.after(G);H.scroller.scrollTo(G)};var B=function(H,F,E){m(H,F);if(F.filestatus===h.uploader.fileStatusConstants.ERROR){var G=C(H,F);o(H,G,H.options.styles.error);w(H,G,E)}};var x=function(E){h.tabbable(E.container);E.selectableContext=h.selectable(E.container,{selectableSelector:E.options.selectors.fileRows,onSelect:function(F){f(F).addClass(E.options.styles.selected)},onUnselect:function(F){f(F).removeClass(E.options.styles.selected)}})};var n=function(E){E.rowTemplate=E.locate("rowTemplate").remove();E.errorInfoRowTemplate=E.locate("errorInfoRowTemplate").remove();E.errorInfoRowTemplate.removeClass(E.options.styles.hiddenTemplate);E.rowProgressorTemplate=E.locate("rowProgressorTemplate",E.options.uploaderContainer).remove()};h.registerNamespace("fluid.uploader.fileQueueView");h.uploader.fileQueueView.finalInit=function(E){n(E);x(E)};h.uploader.fileQueueView.preInit=function(E){E.fileProgressors={};E.addFile=function(F){u(E,F)};E.removeFile=function(F){v(E,F)};E.prepareForUpload=function(){y(E)};E.refreshAfterUpload=function(){g(E)};E.showFileProgress=function(F){z(E,F)};E.updateFileProgress=function(G,H,F){r(E,G,H,F)};E.markFileComplete=function(F){t(E,F).update(100,"100%");a(E,F)};E.showErrorForFile=function(G,F){B(E,G,F)};E.hideFileProgress=function(F){m(E,F)};E.refreshView=function(){E.selectableContext.refresh();E.scroller.refreshView()}};h.defaults("fluid.uploader.fileQueueView",{gradeNames:["fluid.viewComponent","autoInit"],preInitFunction:"fluid.uploader.fileQueueView.preInit",finalInitFunction:"fluid.uploader.fileQueueView.finalInit",components:{scroller:{type:"fluid.scrollableTable"},eventBinder:{type:"fluid.uploader.fileQueueView.eventBinder"}},selectors:{fileRows:".flc-uploader-file",fileName:".flc-uploader-file-name",fileSize:".flc-uploader-file-size",fileIconBtn:".flc-uploader-file-action",errorText:".flc-uploader-file-error",rowTemplate:".flc-uploader-file-tmplt",errorInfoRowTemplate:".flc-uploader-file-error-tmplt",rowProgressorTemplate:".flc-uploader-file-progressor-tmplt"},styles:{hover:"fl-uploader-file-hover",selected:"fl-uploader-file-focus",ready:"fl-uploader-file-state-ready",uploading:"fl-uploader-file-state-uploading",uploaded:"fl-uploader-file-state-uploaded",error:"fl-uploader-file-state-error",remove:"fl-uploader-file-action-remove",dim:"fl-uploader-dim",hiddenTemplate:"fl-uploader-hidden-templates"},strings:{progress:{toUploadLabel:"To upload: %fileCount %fileLabel (%totalBytes)",singleFile:"file",pluralFiles:"files"},status:{success:"File Uploaded",error:"File Upload Error",remove:"Press Delete key to remove file"},errors:{HTTP_ERROR:"File upload error: a network error occured or the file was rejected (reason unknown).",IO_ERROR:"File upload error: a network error occured.",UPLOAD_LIMIT_EXCEEDED:"File upload error: you have uploaded as many files as you are allowed during this session",UPLOAD_FAILED:"File upload error: the upload failed for an unknown reason.",QUEUE_LIMIT_EXCEEDED:"You have as many files in the queue as can be added at one time. Removing files from the queue may allow you to add different files.",FILE_EXCEEDS_SIZE_LIMIT:"One or more of the files that you attempted to add to the queue exceeded the limit of %fileSizeLimit.",ZERO_BYTE_FILE:"One or more of the files that you attempted to add contained no data.",INVALID_FILETYPE:"One or more files were not added to the queue because they were of the wrong type."}},events:{onFileRemoved:null},mergePolicy:{model:"preserve"}});h.defaults("fluid.uploader.fileQueueView.eventBinder",{gradeNames:["fluid.eventedComponent","autoInit"]});h.demands("fluid.uploader.fileQueueView.eventBinder",[],{});h.scrollable=function(F,E){var G=h.initView("fluid.scrollable",F,E);G.scrollable=G.options.makeScrollableFn(G.container,G.options);G.maxHeight=G.scrollable.css("max-height");G.scrollTo=function(){G.scrollable.scrollTo.apply(G.scrollable,arguments)};G.refreshView=function(){if(f.browser.msie&&f.browser.version==="6.0"){G.scrollable.css("height","");if(G.scrollable.height()>=parseInt(G.maxHeight,10)){G.scrollable.css("height",G.maxHeight)}}};G.refreshView();return G};h.scrollable.makeSimple=function(F,E){return h.container(F)};h.scrollable.makeTable=function(F,E){F.wrap(E.wrapperMarkup);return F.closest(".fl-scrollable-scroller")};h.defaults("fluid.scrollable",{makeScrollableFn:h.scrollable.makeSimple});h.scrollableTable=function(F,E){E=f.extend({},h.defaults("fluid.scrollableTable"),E);return h.scrollable(F,E)};h.defaults("fluid.scrollableTable",{gradeNames:"fluid.viewComponent",makeScrollableFn:h.scrollable.makeTable,wrapperMarkup:"<div class='fl-scrollable-scroller'><div class='fl-scrollable-inner'></div></div>"});h.demands("fluid.scrollableTable","fluid.uploader.fileQueueView",{funcName:"fluid.scrollableTable",args:["{fileQueueView}.container"]})})(jQuery,fluid_1_4);var fluid_1_4=fluid_1_4||{};(function(f,d){d.uploader=d.uploader||{};d.demands("fluid.uploaderImpl","fluid.uploader.swfUpload",{funcName:"fluid.uploader.multiFileUploader"});d.uploader.swfUploadStrategy=function(h){var i=d.initLittleComponent("fluid.uploader.swfUploadStrategy",h);d.initDependents(i);return i};d.defaults("fluid.uploader.swfUploadStrategy",{components:{engine:{type:"fluid.uploader.swfUploadStrategy.engine",options:{queueSettings:"{multiFileUploader}.options.queueSettings",flashMovieSettings:"{swfUploadStrategy}.options.flashMovieSettings"}},local:{type:"fluid.uploader.local"},remote:{type:"fluid.uploader.remote"}},flashMovieSettings:{flashURL:"../../../lib/swfupload/flash/swfupload.swf",flashButtonPeerId:"",flashButtonAlwaysVisible:false,flashButtonTransparentEvenInIE:true,flashButtonImageURL:"../images/browse.png",flashButtonCursorEffect:SWFUpload.CURSOR.HAND,debug:false},styles:{browseButtonOverlay:"fl-uploader-browse-overlay",flash9Container:"fl-uploader-flash9-container",uploaderWrapperFlash10:"fl-uploader-flash10-wrapper"}});d.demands("fluid.uploader.progressiveStrategy","fluid.uploader.swfUpload",{funcName:"fluid.uploader.swfUploadStrategy"});d.uploader.swfUploadStrategy.remote=function(i,h,j){var k=d.initLittleComponent("fluid.uploader.swfUploadStrategy.remote",j);k.swfUpload=i;k.queue=h;k.uploadNextFile=function(){k.swfUpload.startUpload()};k.stop=function(){k.queue.shouldStop=true};return k};d.demands("fluid.uploader.remote","fluid.uploader.swfUploadStrategy",{funcName:"fluid.uploader.swfUploadStrategy.remote",args:["{engine}.swfUpload","{multiFileUploader}.queue","{options}"]});d.uploader.swfUploadStrategy.local=function(h,i){var j=d.initLittleComponent("fluid.uploader.swfUploadStrategy.local",i);j.swfUpload=h;j.browse=function(){if(j.options.file_queue_limit===1){j.swfUpload.selectFile()}else{j.swfUpload.selectFiles()}};j.removeFile=function(k){j.swfUpload.cancelUpload(k.id)};j.enableBrowseButton=function(){j.swfUpload.setButtonDisabled(false)};j.disableBrowseButton=function(){j.swfUpload.setButtonDisabled(true)};return j};d.demands("fluid.uploader.local","fluid.uploader.swfUploadStrategy",{funcName:"fluid.uploader.swfUploadStrategy.local",args:["{engine}.swfUpload","{options}"]});d.uploader.swfUploadStrategy.engine=function(i){var j=d.initLittleComponent("fluid.uploader.swfUploadStrategy.engine",i);var h=swfobject.getFlashPlayerVersion().major;j.flashVersionContext=d.typeTag("fluid.uploader.flash."+h);j.config=f.extend({},j.options.queueSettings,j.options.flashMovieSettings);d.initDependents(j);j.flashContainer=j.setupDOM();j.swfUploadConfig=j.setupConfig();j.swfUpload=new SWFUpload(j.swfUploadConfig);j.bindEvents();return j};d.defaults("fluid.uploader.swfUploadStrategy.engine",{invokers:{setupDOM:"fluid.uploader.swfUploadStrategy.setupDOM",setupConfig:"fluid.uploader.swfUploadStrategy.setupConfig",bindEvents:"fluid.uploader.swfUploadStrategy.eventBinder"}});d.demands("fluid.uploader.swfUploadStrategy.engine","fluid.uploader.swfUploadStrategy",{funcName:"fluid.uploader.swfUploadStrategy.engine",args:[d.COMPONENT_OPTIONS]});d.uploader.swfUploadStrategy.fileTypeTransformer=function(i,l){var h="";var j=d.get(i,l.path);var k=d.uploader.mimeTypeRegistry;
  if(!j){return"*"}else{if(typeof(j)==="string"){return j}}d.each(j,function(m){d.each(k,function(n,o){if(n===m){h+="*."+o+";"}})});return h.length===0?"*":h.substring(0,h.length-1)};d.uploader.swfUploadStrategy.flash10SetupDOM=function(i,h,j){i.wrap("<div class='"+j.uploaderWrapperFlash10+"'></div>");var k=f("<div><span></span></div>");k.addClass(j.browseButtonOverlay);i.after(k);h.attr("tabindex",-1);return k};d.demands("fluid.uploader.swfUploadStrategy.setupDOM",["fluid.uploader.swfUploadStrategy.engine","fluid.uploader.flash.10"],{funcName:"fluid.uploader.swfUploadStrategy.flash10SetupDOM",args:["{multiFileUploader}.container","{multiFileUploader}.dom.browseButton","{swfUploadStrategy}.options.styles"]});var c={uploadURL:"upload_url",flashURL:"flash_url",postParams:"post_params",fileSizeLimit:"file_size_limit",fileTypes:"file_types",fileUploadLimit:"file_upload_limit",fileQueueLimit:"file_queue_limit",flashButtonPeerId:"button_placeholder_id",flashButtonImageURL:"button_image_url",flashButtonHeight:"button_height",flashButtonWidth:"button_width",flashButtonWindowMode:"button_window_mode",flashButtonCursorEffect:"button_cursor",debug:"debug"};var a={afterReady:"swfupload_loaded_handler",onFileDialog:"file_dialog_start_handler",afterFileQueued:"file_queued_handler",onQueueError:"file_queue_error_handler",afterFileDialog:"file_dialog_complete_handler",onFileStart:"upload_start_handler",onFileProgress:"upload_progress_handler",onFileComplete:"upload_complete_handler",onFileError:"upload_error_handler",onFileSuccess:"upload_success_handler"};var b=function(m,k,l){var h=l||{};for(var i in k){var j=m[i];if(j){h[j]=k[i]}}return h};var e=function(n,k,m){var i=m||{};for(var j in k){var h=k[j].fire;var l=n[j];if(l){i[l]=h}}return i};d.uploader.swfUploadStrategy.convertConfigForSWFUpload=function(l,h,i,k){h.flashButtonPeerId=d.allocateSimpleId(l.children().eq(0));h.fileTypes=d.uploader.swfUploadStrategy.fileTypeTransformer(k,{path:"fileTypes"});var j=b(c,h);return e(a,i,j)};d.uploader.swfUploadStrategy.flash10SetupConfig=function(i,k,m,h,l){var j=i.flashButtonAlwaysVisible?false:(!f.browser.msie||i.flashButtonTransparentEvenInIE);i.flashButtonImageURL=j?undefined:i.flashButtonImageURL;i.flashButtonHeight=i.flashButtonHeight||h.outerHeight();i.flashButtonWidth=i.flashButtonWidth||h.outerWidth();i.flashButtonWindowMode=j?SWFUpload.WINDOW_MODE.TRANSPARENT:SWFUpload.WINDOW_MODE.OPAQUE;return d.uploader.swfUploadStrategy.convertConfigForSWFUpload(m,i,k,l)};d.demands("fluid.uploader.swfUploadStrategy.setupConfig",["fluid.uploader.swfUploadStrategy.engine","fluid.uploader.flash.10"],{funcName:"fluid.uploader.swfUploadStrategy.flash10SetupConfig",args:["{engine}.config","{multiFileUploader}.events","{engine}.flashContainer","{multiFileUploader}.dom.browseButton","{multiFileUploader}.options.queueSettings"]});var g=function(){var h=function(){};SWFUpload.prototype.selectFile=h;SWFUpload.prototype.selectFiles=h};d.uploader.swfUploadStrategy.bindFileEventListeners=function(h,i){var j=function(k){d.find(h,function(l){if(l.id===k.id){l.filestatus=k.filestatus;return true}})};i.onFileStart.addListener(j);i.onFileProgress.addListener(j);i.onFileError.addListener(j);i.onFileSuccess.addListener(j)};d.uploader.swfUploadStrategy.flash10EventBinder=function(h,i){g();d.uploader.swfUploadStrategy.bindFileEventListeners(h,i)};d.demands("fluid.uploader.swfUploadStrategy.eventBinder",["fluid.uploader.swfUploadStrategy.engine","fluid.uploader.flash.10"],{funcName:"fluid.uploader.swfUploadStrategy.flash10EventBinder",args:["{multiFileUploader}.queue.files","{multiFileUploader}.events"]})})(jQuery,fluid_1_4);var fluid_1_4=fluid_1_4||{};(function(b,a){a.registerNamespace("fluid.uploader.swfUploadStrategy");a.uploader.swfUploadStrategy.flash9SetupDOM=function(d){var c=b("<div><span></span></div>");c.addClass(d.flash9Container);b("body").append(c);return c};a.demands("fluid.uploader.swfUploadStrategy.setupDOM",["fluid.uploader.swfUploadStrategy.engine","fluid.uploader.flash.9"],{funcName:"fluid.uploader.swfUploadStrategy.flash9SetupDOM",args:["{swfUploadStrategy}.options.styles"]});a.uploader.swfUploadStrategy.flash9SetupConfig=function(e,c,d){return a.uploader.swfUploadStrategy.convertConfigForSWFUpload(e,c,d)};a.demands("fluid.uploader.swfUploadStrategy.setupConfig",["fluid.uploader.swfUploadStrategy.engine","fluid.uploader.flash.9"],{funcName:"fluid.uploader.swfUploadStrategy.flash9SetupConfig",args:["{engine}.flashContainer","{engine}.config","{multiFileUploader}.events"]});a.uploader.swfUploadStrategy.flash9EventBinder=function(d,f,e,c){c.click(function(g){e.browse();g.preventDefault()});a.uploader.swfUploadStrategy.bindFileEventListeners(d,f)};a.demands("fluid.uploader.swfUploadStrategy.eventBinder",["fluid.uploader.swfUploadStrategy.engine","fluid.uploader.flash.9"],{funcName:"fluid.uploader.swfUploadStrategy.flash9EventBinder",args:["{multiFileUploader}.queue.files","{multiFileUploader}.events","{local}","{multiFileUploader}.dom.browseButton"]})})(jQuery,fluid_1_4);var fluid_1_4=fluid_1_4||{};(function(b,a){a.demands("fluid.uploaderImpl","fluid.uploader.html5",{funcName:"fluid.uploader.multiFileUploader"});a.demands("fluid.uploader.progressiveStrategy","fluid.uploader.html5",{funcName:"fluid.uploader.html5Strategy"});a.defaults("fluid.uploader.html5Strategy",{gradeNames:["fluid.littleComponent","autoInit"],components:{local:{type:"fluid.uploader.local",options:{queueSettings:"{multiFileUploader}.options.queueSettings",events:{onFileDialog:"{multiFileUploader}.events.onFileDialog",afterFileDialog:"{multiFileUploader}.events.afterFileDialog",afterFileQueued:"{multiFileUploader}.events.afterFileQueued",onQueueError:"{multiFileUploader}.events.onQueueError"}}},remote:{type:"fluid.uploader.remote",options:{queueSettings:"{multiFileUploader}.options.queueSettings",events:{afterReady:"{multiFileUploader}.events.afterReady",onFileStart:"{multiFileUploader}.events.onFileStart",onFileProgress:"{multiFileUploader}.events.onFileProgress",onFileSuccess:"{multiFileUploader}.events.onFileSuccess",onFileError:"{multiFileUploader}.events.onFileError",onFileComplete:"{multiFileUploader}.events.onFileComplete"}}}},legacyBrowserFileLimit:100000});a.uploader.html5Strategy.fileSuccessHandler=function(h,g,i){g.onFileSuccess.fire(h,i.responseText,i);g.onFileComplete.fire(h)};a.uploader.html5Strategy.fileErrorHandler=function(h,g,i){g.onFileError.fire(h,a.uploader.errorConstants.UPLOAD_FAILED,i.status,i);g.onFileComplete.fire(h)};a.uploader.html5Strategy.fileStopHandler=function(h,g,i){g.onFileError.fire(h,a.uploader.errorConstants.UPLOAD_STOPPED,i.status,i);g.onFileComplete.fire(h)};a.uploader.html5Strategy.progressTracker=function(){var g={previousBytesLoaded:0};g.getChunkSize=function(h){var i=h-g.previousBytesLoaded;g.previousBytesLoaded=h;return i};return g};a.uploader.html5Strategy.monitorFileUploadXHR=function(i,h,j){j.onreadystatechange=function(){if(j.readyState===4){var k=j.status;if(k===200){a.uploader.html5Strategy.fileSuccessHandler(i,h,j)}else{if(k===0){a.uploader.html5Strategy.fileStopHandler(i,h,j)}else{a.uploader.html5Strategy.fileErrorHandler(i,h,j)}}}};var g=a.uploader.html5Strategy.progressTracker();j.upload.onprogress=function(k){h.onFileProgress.fire(i,g.getChunkSize(k.loaded),k.total)}};a.uploader.html5Strategy.remote=function(g,h){var i=a.initLittleComponent("fluid.uploader.html5Strategy.remote",h);i.queue=g;i.queueSettings=i.options.queueSettings;i.uploadNextFile=function(){var j=i.queue.currentBatch;var k=j.files[j.fileIdx];i.uploadFile(k)};i.uploadFile=function(j){i.events.onFileStart.fire(j);i.currentXHR=i.createXHR();a.uploader.html5Strategy.monitorFileUploadXHR(j,i.events,i.currentXHR);i.fileSender.send(j,i.queueSettings,i.currentXHR)};i.stop=function(){i.queue.isUploading=false;i.currentXHR.abort()};a.initDependents(i);i.events.afterReady.fire();return i};a.defaults("fluid.uploader.html5Strategy.remote",{gradeNames:["fluid.eventedComponent"],argumentMap:{options:1},components:{fileSender:{type:"fluid.uploader.html5Strategy.fileSender"}},invokers:{createXHR:"fluid.uploader.html5Strategy.createXHR"}});a.demands("fluid.uploader.remote",["fluid.uploader.html5Strategy","fluid.uploader.live"],{funcName:"fluid.uploader.html5Strategy.remote",args:["{multiFileUploader}.queue",a.COMPONENT_OPTIONS]});a.uploader.html5Strategy.createXHR=function(){return new XMLHttpRequest()};a.uploader.html5Strategy.createFormData=function(){return new FormData()};var d=function(g,h){b.each(h,function(i,j){g.append(i,j)})};a.defaults("fluid.uploader.html5Strategy.formDataSender",{gradeNames:["fluid.littleComponent","autoInit"],finalInitFunction:"fluid.uploader.html5Strategy.formDataSender.init",invokers:{createFormData:"fluid.uploader.html5Strategy.createFormData"}});a.uploader.html5Strategy.formDataSender.init=function(g){g.send=function(h,i,k){var j=g.createFormData();j.append("file",h);d(j,i.postParams);k.open("POST",i.uploadURL,true);k.send(j);return j}};a.demands("fluid.uploader.html5Strategy.fileSender",["fluid.uploader.html5Strategy.remote","fluid.browser.supportsFormData"],{funcName:"fluid.uploader.html5Strategy.formDataSender"});a.uploader.html5Strategy.generateMultipartBoundary=function(){var g="---------------------------";g+=Math.floor(Math.random()*32768);g+=Math.floor(Math.random()*32768);g+=Math.floor(Math.random()*32768);return g};a.uploader.html5Strategy.generateMultiPartContent=function(j,i){var h="\r\n";var g="";g+="--"+j+h;g+='Content-Disposition: form-data; name="fileData"; filename="'+i.name+'"'+h;g+="Content-Type: "+i.type+h+h;g+=i.getAsBinary();g+=h+"--"+j+"--"+h;return g};a.defaults("fluid.uploader.html5Strategy.rawMIMESender",{gradeNames:["fluid.littleComponent","autoInit"],finalInitFunction:"fluid.uploader.html5Strategy.rawMIMESender.init"});a.uploader.html5Strategy.rawMIMESender.init=function(g){g.send=function(i,j,k){var l=a.uploader.html5Strategy.generateMultipartBoundary();var h=a.uploader.html5Strategy.generateMultiPartContent(l,i);k.open("POST",j.uploadURL,true);
  k.setRequestHeader("Content-Type","multipart/form-data; boundary="+l);k.sendAsBinary(h);return h}};a.demands("fluid.uploader.html5Strategy.fileSender","fluid.uploader.html5Strategy.remote",{funcName:"fluid.uploader.html5Strategy.rawMIMESender"});a.uploader.html5Strategy.local=function(g,i,h){var j=a.initLittleComponent("fluid.uploader.html5Strategy.local",h);j.queue=g;j.queueSettings=j.options.queueSettings;j.addFiles=function(l){var o=(i||j.queueSettings.fileSizeLimit)*1024;var s=j.queueSettings.fileUploadLimit;var m=j.queue.getUploadedFiles().length;var k=j.queue.getReadyFiles().length;var q=s-m-k;var r=0;for(var p=0;p<l.length;p++){var n=l[p];if(n.size<o&&(!s||q>0)){n.id="file-"+a.allocateGuid();n.filestatus=a.uploader.fileStatusConstants.QUEUED;j.events.afterFileQueued.fire(n);q--;r++}else{n.filestatus=a.uploader.fileStatusConstants.ERROR;j.events.onQueueError.fire(n,a.uploader.errorConstants.UPLOAD_LIMIT_EXCEEDED)}}j.events.afterFileDialog.fire(r)};j.removeFile=function(k){};j.enableBrowseButton=function(){j.browseButtonView.enable()};j.disableBrowseButton=function(){j.browseButtonView.disable()};a.initDependents(j);return j};a.defaults("fluid.uploader.html5Strategy.local",{argumentMap:{options:2},gradeNames:["fluid.eventedComponent"],components:{browseButtonView:{type:"fluid.uploader.html5Strategy.browseButtonView",options:{queueSettings:"{multiFileUploader}.options.queueSettings",selectors:{browseButton:"{multiFileUploader}.selectors.browseButton"},listeners:{onFilesQueued:"{local}.addFiles"}}}}});a.demands("fluid.uploader.local","fluid.uploader.html5Strategy",{funcName:"fluid.uploader.html5Strategy.local",args:["{multiFileUploader}.queue","{html5Strategy}.options.legacyBrowserFileLimit","{options}"]});a.demands("fluid.uploader.local",["fluid.uploader.html5Strategy","fluid.browser.supportsFormData"],{funcName:"fluid.uploader.html5Strategy.local",args:["{multiFileUploader}.queue",undefined,"{options}"]});var f=function(h,g){g.click(function(){h.events.onBrowse.fire()});g.change(function(){var i=g[0].files;h.events.onFilesQueued.fire(i);h.renderFreshMultiFileInput()});g.focus(function(){h.browseButton.addClass("focus")});g.blur(function(){h.browseButton.removeClass("focus")})};var c=function(g){var i=b(g.options.multiFileInputMarkup);var h=g.options.queueSettings.fileTypes;if(a.isArrayable(h)){h=h.join();i.attr("accept",h)}f(g,i);return i};var e=function(g){var h=c(g);g.browseButton.append(h);g.browseButton.attr("tabindex",-1)};a.uploader.html5Strategy.browseButtonView=function(g,h){var i=a.initView("fluid.uploader.html5Strategy.browseButtonView",g,h);i.browseButton=i.locate("browseButton");i.renderFreshMultiFileInput=function(){var k=i.locate("fileInputs").last();k.hide();k.attr("tabindex",-1);var j=c(i);k.after(j)};i.enable=function(){i.locate("fileInputs").prop("disabled",false)};i.disable=function(){i.locate("fileInputs").prop("disabled",true)};e(i);return i};a.defaults("fluid.uploader.html5Strategy.browseButtonView",{gradeNames:"fluid.viewComponent",multiFileInputMarkup:"<input type='file' multiple='' class='flc-uploader-html5-input' />",queueSettings:{},selectors:{browseButton:".flc-uploader-button-browse",fileInputs:".flc-uploader-html5-input"},events:{onBrowse:null,onFilesQueued:null}});a.demands("fluid.uploader.html5Strategy.browseButtonView","fluid.uploader.html5Strategy.local",{container:"{multiFileUploader}.container",mergeOptions:{events:{onBrowse:"{local}.events.onFileDialog"}}})})(jQuery,fluid_1_4);var fluid_1_4=fluid_1_4||{};(function(e,f){f.uploader=f.uploader||{};var h;var b=function(m,l,n,j){if(!j){return}var k=Math.min(n.chunkSize,m.size);n.bytesUploaded=Math.min(n.bytesUploaded+k,m.size);l.onFileProgress.fire(m,n.bytesUploaded,m.size)};var d=function(k,j){k.queue.finishFile(j);k.events.afterFileComplete.fire(j);if(k.queue.shouldUploadNextFile()){h(k)}else{k.events.afterUploadComplete.fire(k.queue.currentBatch.files);if(j.status!==f.uploader.fileStatusConstants.CANCELLED){k.queue.clearCurrentBatch()}}};var c=function(k){if(!k.queue.isUploading){return}var j=k.demoState.currentFile;k.events.onFileSuccess.fire(j);k.demoState.fileIdx++;d(k,j)};var g=function(k){if(!k.queue.isUploading){return}var j=k.demoState.currentFile;if(k.demoState.bytesUploaded<j.size){f.invokeAfterRandomDelay(function(){b(j,k.events,k.demoState,k.queue.isUploading);g(k)})}else{c(k)}};h=function(j){j.demoState.currentFile=j.queue.files[j.demoState.fileIdx];j.demoState.chunksForCurrentFile=Math.ceil(j.demoState.currentFile/j.demoState.chunkSize);j.demoState.bytesUploaded=0;j.queue.isUploading=true;j.events.onFileStart.fire(j.demoState.currentFile);g(j)};var i=function(k){var j=k.demoState.currentFile;j.filestatus=f.uploader.fileStatusConstants.CANCELLED;k.queue.shouldStop=true;k.events.onFileError.fire(j,f.uploader.errorConstants.UPLOAD_STOPPED,"The demo upload was paused by the user.");d(k,j);k.events.onUploadStop.fire()};var a=function(j){if(j.simulateDelay===undefined||j.simulateDelay===null){j.simulateDelay=true}j.demoState={fileIdx:0,chunkSize:200000};return j};f.uploader.demoRemote=function(j,k){var l=f.initLittleComponent("fluid.uploader.demoRemote",k);l.queue=j;l.uploadNextFile=function(){h(l)};l.stop=function(){i(l)};a(l);return l};f.invokeAfterRandomDelay=function(k){var j=Math.floor(Math.random()*1000+100);setTimeout(k,j)};f.defaults("fluid.uploader.demoRemote",{gradeNames:["fluid.eventedComponent"],argumentMap:{options:1},events:{onFileProgress:"{multiFileUploader}.events.onFileProgress",afterFileComplete:"{multiFileUploader}.events.afterFileComplete",afterUploadComplete:"{multiFileUploader}.events.afterUploadComplete",onFileSuccess:"{multiFileUploader}.events.onFileSuccess",onFileStart:"{multiFileUploader}.events.onFileStart",onFileError:"{multiFileUploader}.events.onFileError",onUploadStop:"{multiFileUploader}.events.onUploadStop"}});f.demands("fluid.uploader.remote",["fluid.uploader.multiFileUploader","fluid.uploader.demo"],{funcName:"fluid.uploader.demoRemote",args:["{multiFileUploader}.queue","{multiFileUploader}.events",f.COMPONENT_OPTIONS]})})(jQuery,fluid_1_4);var fluid_1_4=fluid_1_4||{};(function(a){a.uploader=a.uploader||{};a.uploader.mimeTypeRegistry={jpg:"image/jpeg",jpeg:"image/jpeg",bmp:"image/bmp",png:"image/png",tif:"image/tiff",tiff:"image/tiff",mp3:"audio/mpeg",m4a:"audio/mp4a-latm",ogg:"audio/ogg",wav:"audio/x-wav",aiff:"audio/x-aiff",mpg:"video/mpeg",mpeg:"video/mpeg",m4v:"video/x-m4v",ogv:"video/ogg",mov:"video/quicktime",avi:"video/x-msvideo",html:"text/html",htm:"text/html",text:"text/plain",doc:"application/msword",docx:"application/msword",xls:"application/vnd.ms-excel",xlsx:"application/vnd.ms-excel",ppt:"application/vnd.ms-powerpoint",pptx:"application/vnd.ms-powerpoint"}})(fluid_1_4);(function(b){var a=0;b.widget("ui.tooltip",{options:{items:"[title]",content:function(){return b(this).attr("title")},position:{my:"left center",at:"right center",offset:"15 0"}},_create:function(){var c=this;this.tooltip=b("<div></div>").attr("id","ui-tooltip-"+a++).attr("role","tooltip").attr("aria-hidden","true").addClass("ui-tooltip ui-widget ui-corner-all ui-widget-content").appendTo(document.body).hide();this.tooltipContent=b("<div></div>").addClass("ui-tooltip-content").appendTo(this.tooltip);this.opacity=this.tooltip.css("opacity");this.element.bind("focus.tooltip mouseover.tooltip",function(d){c.open(d)}).bind("blur.tooltip mouseout.tooltip",function(d){c.close(d)})},enable:function(){this.options.disabled=false},disable:function(){this.options.disabled=true},destroy:function(){this.tooltip.remove();b.Widget.prototype.destroy.apply(this,arguments)},widget:function(){return this.element.pushStack(this.tooltip.get())},open:function(e){var f=b(e&&e.target||this.element).closest(this.options.items);if(this.current&&this.current[0]==f[0]){return}var c=this;this.current=f;this.currentTitle=f.attr("title");var d=this.options.content.call(f[0],function(g){setTimeout(function(){if(c.current==f){c._show(e,f,g)}},13)});if(d){c._show(e,f,d)}},_show:function(d,e,c){if(!c){return}e.attr("title","");if(this.options.disabled){return}this.tooltipContent.html(c);this.tooltip.css({top:0,left:0}).show().position(b.extend({of:e},this.options.position)).hide();this.tooltip.attr("aria-hidden","false");e.attr("aria-describedby",this.tooltip.attr("id"));this.tooltip.stop(false,true).fadeIn();this._trigger("open",d)},close:function(c){if(!this.current){return}var d=this.current;this.current=null;d.attr("title",this.currentTitle);if(this.options.disabled){return}d.removeAttr("aria-describedby");this.tooltip.attr("aria-hidden","true");this.tooltip.stop(false,true).fadeOut();this._trigger("close",c)}})})(jQuery);var fluid_1_4=fluid_1_4||{};(function(d,c){var b=function(e){return typeof e==="function"?e:function(){return e}};var a=function(e){e.container.tooltip({content:b(e.options.content),position:e.options.position,items:e.options.items,open:function(g){var f=d(g.target).tooltip("widget");f.stop(false,true);f.hide();if(e.options.delay){f.delay(e.options.delay).fadeIn("default",e.events.afterOpen.fire())}else{f.show();e.events.afterOpen.fire()}},close:function(g){var f=d(g.target).tooltip("widget");f.stop(false,true);f.hide();f.clearQueue();e.events.afterClose.fire()}});e.elm=e.container.tooltip("widget");e.elm.addClass(e.options.styles.tooltip)};c.tooltip=function(e,f){var g=c.initView("fluid.tooltip",e,f);g.updateContent=function(h){g.container.tooltip("option","content",b(h))};g.destroy=function(){g.container.tooltip("destroy")};g.open=function(){g.container.tooltip("open")};g.close=function(){g.container.tooltip("close")};a(g);return g};c.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);(function(a){a.fn.bgIframe=a.fn.bgiframe=function(c){if(a.browser.msie&&parseInt(a.browser.version)<=6){c=a.extend({top:"auto",left:"auto",width:"auto",height:"auto",opacity:true,src:"javascript:false;"},c||{});
  var d=function(e){return e&&e.constructor==Number?e+"px":e},b='<iframe class="bgiframe"frameborder="0"tabindex="-1"src="'+c.src+'"style="display:block;position:absolute;z-index:-1;'+(c.opacity!==false?"filter:Alpha(Opacity='0');":"")+"top:"+(c.top=="auto"?"expression(((parseInt(this.parentNode.currentStyle.borderTopWidth)||0)*-1)+'px')":d(c.top))+";left:"+(c.left=="auto"?"expression(((parseInt(this.parentNode.currentStyle.borderLeftWidth)||0)*-1)+'px')":d(c.left))+";width:"+(c.width=="auto"?"expression(this.parentNode.offsetWidth+'px')":d(c.width))+";height:"+(c.height=="auto"?"expression(this.parentNode.offsetHeight+'px')":d(c.height))+';"/>';return this.each(function(){if(a("> iframe.bgiframe",this).length==0){this.insertBefore(document.createElement(b),this.firstChild)}})}return this};if(!a.browser.version){a.browser.version=navigator.userAgent.toLowerCase().match(/.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/)[1]}})(jQuery);var fluid_1_4=fluid_1_4||{};(function(h,f){var d="state_initial",c="state_changed",b="state_reverted";function g(l,j){var m=l.options.strings;var i="<span class='flc-undo'><a href='#' class='flc-undo-undoControl'>"+m.undo+"</a><a href='#' class='flc-undo-redoControl'>"+m.redo+"</a></span>";var k=h(i).attr({role:"region","aria-live":"polite","aria-relevant":"all"});j.append(k);return k}function a(i){if(i.state===d){i.locate("undoContainer").hide();i.locate("redoContainer").hide()}else{if(i.state===c){i.locate("undoContainer").show();i.locate("redoContainer").hide()}else{if(i.state===b){i.locate("undoContainer").hide();i.locate("redoContainer").show()}}}}var e=function(i){i.locate("undoControl").click(function(){if(i.state!==b){f.model.copyModel(i.extremalModel,i.component.model);i.component.updateModel(i.initialModel,i);i.state=b;a(i);i.locate("redoControl").focus()}return false});i.locate("redoControl").click(function(){if(i.state!==c){i.component.updateModel(i.extremalModel,i);i.state=c;a(i);i.locate("undoControl").focus()}return false});return{modelChanged:function(j,l,k){if(k!==i){i.state=c;f.model.copyModel(i.initialModel,l);a(i)}}}};f.undoDecorator=function(i,l){var k=f.initLittleComponent("undo",l);k.container=k.options.renderer(k,i.container);f.initDomBinder(k);f.tabindex(k.locate("undoControl"),0);f.tabindex(k.locate("redoControl"),0);k.component=i;k.initialModel={};k.extremalModel={};f.model.copyModel(k.initialModel,i.model);f.model.copyModel(k.extremalModel,i.model);k.state=d;a(k);var j=e(k);k.returnedOptions={listeners:j};return k};f.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:g})})(jQuery,fluid_1_4);var fluid_1_4=fluid_1_4||{};(function(e,h){function j(B,A,x,z){var y=document.createEvent("KeyEvents");y.initKeyEvent(A,1,1,null,0,0,0,0,x,z);B.dispatchEvent(y)}h.setCaretToEnd=function(A,y){var B=y?y.length:0;try{A.focus();if(A.setSelectionRange){A.setSelectionRange(B,B);if(e.browser.mozilla&&B>0){j(A,"keypress",92,92);j(A,"keydown",8,0);j(A,"keypress",8,0)}}else{if(A.createTextRange){var x=A.createTextRange();x.move("character",B);x.select()}}}catch(z){}};var i=function(x){x.editContainer.hide();x.displayModeRenderer.show()};var c=function(x){if(x.isEditing()){setTimeout(function(){x.editView.value(x.model.value)},1);i(x);x.events.afterFinishEdit.fire(x.model.value,x.model.value,x.editField[0],x.viewEl[0])}};var n=function(B){var C=B.editView.value();var z=B.model.value;var x=B.viewEl[0];var A=B.editField[0];var y=B.events.onFinishEdit.fire(C,z,A,x);if(y===false){return}B.updateModelValue(C);B.events.afterFinishEdit.fire(C,z,A,x);i(B)};var q=function(z){if(z.options.submitOnEnter===undefined){z.options.submitOnEnter="textarea"!==h.unwrap(z.editField).nodeName.toLowerCase()}function A(B){return B.keyCode?B.keyCode:(B.which?B.which:0)}var x=function(B){var C=A(B);if(C===e.ui.keyCode.ESCAPE){z.textEditButton.focus(0);c(z);return false}};var y=function(B){var C=A(B);if(C!==e.ui.keyCode.ENTER){z.textEditButton.blur();return true}else{n(z);z.textEditButton.focus(0)}return false};if(z.options.submitOnEnter){z.editContainer.keypress(y)}z.editContainer.keydown(x)};var d=function(x){if(x.options.blurHandlerBinder){x.options.blurHandlerBinder(x)}else{var y=function(z){if(x.isEditing()){n(x)}return false};x.editField.blur(y)}};var s=function(y,x){if(!y.editInitialized){h.inlineEdit.renderEditContainer(y,!y.options.lazyEditView||!x);if(!y.options.lazyEditView||!x){y.editView=h.initSubcomponent(y,"editView",y.editField);e.extend(true,y.editView,h.initSubcomponent(y,"editAccessor",y.editField));q(y);d(y);y.editView.refreshView(y);y.editInitialized=true}}};var l=function(y){s(y,false);var x=y.viewEl;var z=y.displayView.value();y.updateModelValue(y.model.value===""?"":z);if(y.options.applyEditPadding){y.editField.width(Math.max(x.width()+y.options.paddings.edit,y.options.paddings.minimumEdit))}y.displayModeRenderer.hide();y.editContainer.show();setTimeout(function(){h.setCaretToEnd(y.editField[0],y.editView.value());if(y.options.selectOnEdit){y.editField[0].select()}},0);y.events.afterBeginEdit.fire()};var u=function(x,z,y){x.removeClass(z.defaultViewStyle);x.css("padding-right",y);x.removeClass(z.emptyDefaultViewText)};var p=function(x){x.displayView.value(x.options.defaultViewText);x.viewEl.css("padding-right",x.existingPadding);x.viewEl.addClass(x.options.styles.defaultViewStyle)};var r=function(x){x.displayView.value("");if(e.browser.msie){if(x.viewEl.css("display")==="inline"){x.viewEl.css("display","inline-block")}}};var k=function(x){x.displayView.value(x.model.value);u(x.viewEl,x.options.styles,x.existingPadding)};var o=function(x,y){x.displayView.refreshView(x,y);if(x.editView){x.editView.refreshView(x,y)}};var t=function(x,y){x.model.value=y;x.refreshView()};var a=function(y,A,z){var x=y.options.modelComparator;var B=x?x(y.model.value,A):y.model.value===A;if(!B){var C=e.extend(true,{},y.model);y.model.value=A;y.events.modelChanged.fire(y.model,C,z);y.refreshView(z)}};var m=function(y){var x=false;y.events.onBeginEdit.addListener(function(){x=true});y.events.afterFinishEdit.addListener(function(){x=false});return function(){return x}};var w=function(x){return function(){var y=x.events.onBeginEdit.fire();if(y===false){return false}l(x);return true}};var v=function(y){var x={content:y.options.tooltipText,position:{my:"left top",at:"left bottom",offset:"0 5"},target:"*",delay:y.options.tooltipDelay,styles:{tooltip:y.options.styles.tooltip}};h.tooltip(y.viewEl,x);if(y.textEditButton){h.tooltip(y.textEditButton,x)}};var g=function(x){var y=x.css("padding-right");return y?parseFloat(y):0};var b=function(x,y){if(y.editContainer){y.editContainer.hide()}if(y.tooltipEnabled()){v(y)}y.decorators=h.initSubcomponents(y,"componentDecorators",[y,h.COMPONENT_OPTIONS])};var f=function(z,x){var y=[];z.each(function(A,B){y.push(h.inlineEdit(e(B),x))});return y};h.inlineEdit=function(x,z){var y=h.initView("inlineEdit",x,z);y.viewEl=h.inlineEdit.setupDisplayText(y);y.displayView=h.initSubcomponent(y,"displayView",y.viewEl);e.extend(true,y.displayView,h.initSubcomponent(y,"displayAccessor",y.viewEl));y.model={value:""};y.edit=w(y);y.isEditing=m(y);y.finish=function(){n(y)};y.cancel=function(){c(y)};y.tooltipEnabled=function(){return y.options.useTooltip&&e.fn.tooltip};y.refreshView=function(A){o(y,A)};y.updateModelValue=function(B,A){a(y,B,A)};y.updateModel=function(A,B){a(y,A.value,B)};y.existingPadding=g(y.viewEl);t(y,y.displayView.value());y.displayModeRenderer=y.options.displayModeRenderer(y);s(y,true);b(x,y);return y};h.inlineEdit.setupEditField=function(x,z){var y=e(z);y=y.length?y:e("<input type='text' class='flc-inlineEdit-edit'/>");y.addClass(x);return y};h.inlineEdit.setupEditContainer=function(A,x,z){var y=e(z);y=y.length?y:e("<span></span>");A.after(y);y.append(x);return y};h.inlineEdit.defaultEditModeRenderer=function(y){var x=h.inlineEdit.setupEditField(y.options.styles.edit,y.editField);var z=h.inlineEdit.setupEditContainer(y.displayModeRenderer,x,y.editContainer);var A=h.inlineEdit.setupEditModeInstruction(y.options.styles.editModeInstruction,y.options.strings.editModeInstruction);var B=h.allocateSimpleId(A);x.attr("aria-describedby",B);h.inlineEdit.positionEditModeInstruction(A,z,x);return{container:z,field:x}};h.inlineEdit.renderEditContainer=function(z,y){z.editContainer=z.locate("editContainer");z.editField=z.locate("edit");if(z.editContainer.length!==1){if(z.editContainer.length>1){h.fail("InlineEdit did not find a unique container for selector "+z.options.selectors.editContainer+": "+h.dumpEl(z.editContainer))}}if(!y){return}var x=z.options.editModeRenderer(z);if(x){z.editContainer=x.container;z.editField=x.field}};h.inlineEdit.setupEditModeInstruction=function(x,y){var z=e("<p></p>");z.addClass(x);z.text(y);return z};h.inlineEdit.positionEditModeInstruction=function(z,y,x){y.append(z);x.focus(function(){z.show();var A=x.offset();z.css({left:A.left});z.css({top:A.top+x.height()+5})})};h.inlineEdit.setupDisplayModeContainer=function(x,y){var z=e(y);z=z.length?z:e("<span></span>");z.addClass(x.displayView);return z};h.inlineEdit.setupDisplayText=function(y){var x=y.locate("text");x.attr("tabindex","-1");x.addClass(y.options.styles.text);return x};h.inlineEdit.setupTextEditButton=function(A){var z=A.options;var x=A.locate("textEditButton");if(x.length===0){var y=e("<a href='#_' class='flc-inlineEdit-textEditButton'></a>");y.addClass(z.styles.textEditButton);y.text(z.tooltipText);h.inlineEdit.updateTextEditButton(y,A.model.value||z.defaultViewText,z.strings.textEditButton);A.events.modelChanged.addListener(function(){h.inlineEdit.updateTextEditButton(y,A.model.value||z.defaultViewText,z.strings.textEditButton)});A.locate("text").after(y);x=A.locate("textEditButton")}return x};h.inlineEdit.updateTextEditButton=function(x,z,A){var y=h.stringTemplate(A,{text:z});x.text(y)};h.inlineEdit.bindHoverHandlers=function(A,z){var y=function(B){A.addClass(z)
  };var x=function(B){A.removeClass(z)};A.hover(y,x)};h.inlineEdit.bindHighlightHandler=function(y,B,z){y=e(y);var A=function(){B.addClass(z.focus);B.addClass(z.invitation)};var x=function(){B.removeClass(z.focus);B.removeClass(z.invitation)};y.focus(A);y.blur(x)};h.inlineEdit.bindMouseHandlers=function(x,y){x=e(x);var z=h.inlineEdit.makeEditTriggerGuard(x,y);x.click(function(A){z(A);return false})};h.inlineEdit.bindKeyboardHandlers=function(x,z){x=e(x);x.attr("role","button");var y=h.inlineEdit.makeEditTriggerGuard(x,z);h.activatable(x,function(A){return y(A)})};h.inlineEdit.makeEditTriggerGuard=function(y,z){var x=h.unwrap(y);return function(B){var A=h.findAncestor(B.target,function(C){if(/input|select|textarea|button|a/i.test(C.nodeName)||C===x){return true}});if(A===x){z();return false}}};h.inlineEdit.defaultDisplayModeRenderer=function(y){var x=y.options.styles;var z=h.inlineEdit.setupDisplayModeContainer(x);var A=y.viewEl.wrap(z).parent();y.textEditButton=h.inlineEdit.setupTextEditButton(y);A.append(y.textEditButton);h.inlineEdit.bindHoverHandlers(A,x.invitation);h.inlineEdit.bindMouseHandlers(y.viewEl,y.edit);h.inlineEdit.bindMouseHandlers(y.textEditButton,y.edit);h.inlineEdit.bindKeyboardHandlers(y.textEditButton,y.edit);h.inlineEdit.bindHighlightHandler(y.viewEl,A,x);h.inlineEdit.bindHighlightHandler(y.textEditButton,A,x);return A};h.inlineEdit.standardAccessor=function(x){var y=x.nodeName.toLowerCase();return{value:function(z){return"input"===y||"textarea"===y?h.value(e(x),z):e(x).text(z)}}};h.inlineEdit.standardDisplayView=function(y){var x={refreshView:function(z,A){if(z.model.value){k(z)}else{if(z.options.defaultViewText){p(z)}else{r(z)}}if(e.trim(z.viewEl.text()).length===0){z.viewEl.addClass(z.options.styles.emptyDefaultViewText);if(z.existingPadding<z.options.paddings.minimumView){z.viewEl.css("padding-right",z.options.paddings.minimumView)}}}};return x};h.inlineEdit.standardEditView=function(x){var y={refreshView:function(z,A){if(!A||z.editField&&z.editField.index(A)===-1){z.editView.value(z.model.value)}}};e.extend(true,y,h.inlineEdit.standardAccessor(x));return y};h.inlineEdits=function(y,z){z=z||{};var A=e.extend({},h.defaults("inlineEdits").selectors,z.selectors);var x=h.container(y);var B=e(A.editables,x);return f(B,z)};h.defaults("inlineEdit",{selectors:{text:".flc-inlineEdit-text",editContainer:".flc-inlineEdit-editContainer",edit:".flc-inlineEdit-edit",textEditButton:".flc-inlineEdit-textEditButton"},styles:{text:"fl-inlineEdit-text",edit:"fl-inlineEdit-edit",invitation:"fl-inlineEdit-invitation",defaultViewStyle:"fl-inlineEdit-emptyText-invitation",emptyDefaultViewText:"fl-inlineEdit-emptyDefaultViewText",focus:"fl-inlineEdit-focus",tooltip:"fl-inlineEdit-tooltip",editModeInstruction:"fl-inlineEdit-editModeInstruction",displayView:"fl-inlineEdit-simple-editableText fl-inlineEdit-textContainer",textEditButton:"fl-offScreen-hidden"},events:{modelChanged:null,onBeginEdit:"preventable",afterBeginEdit:null,onFinishEdit:"preventable",afterFinishEdit:null,afterInitEdit:null},strings:{textEditButton:"Edit text %text",editModeInstruction:"Escape to cancel, Enter or Tab when finished"},paddings:{edit:10,minimumEdit:80,minimumView:60},applyEditPadding:true,blurHandlerBinder:null,submitOnEnter:undefined,modelComparator:null,displayAccessor:{type:"fluid.inlineEdit.standardAccessor"},displayView:{type:"fluid.inlineEdit.standardDisplayView"},editAccessor:{type:"fluid.inlineEdit.standardAccessor"},editView:{type:"fluid.inlineEdit.standardEditView"},displayModeRenderer:h.inlineEdit.defaultDisplayModeRenderer,editModeRenderer:h.inlineEdit.defaultEditModeRenderer,lazyEditView:false,defaultViewText:"Click here to edit",useTooltip:true,tooltipText:"Select or press Enter to edit",tooltipDelay:1000,selectOnEdit:false});h.defaults("inlineEdits",{selectors:{editables:".flc-inlineEditable"}})})(jQuery,fluid_1_4);var fluid_1_4=fluid_1_4||{};(function(d,c){c.inlineEdit.makeViewAccessor=function(f,g,h){return function(i){return{value:function(k){var j=f(i);if(!j){if(k){d(i).val(k)}return""}if(k){g(i,j,k)}else{return h(j)}}}}};c.inlineEdit.richTextViewAccessor=function(f){return{value:function(g){return d(f).html(g)}}};var a=function(j,f,g){var i=c.defaults(j);var h=c.merge(i?i.mergePolicy:null,{},i,g);return c.inlineEdit(f,h)};c.inlineEdit.normalizeHTML=function(g){var f=d.trim(g.replace(/\s+/g," "));f=f.replace(/\s+<\//g,"</");f=f.replace(/\<([a-z0-9A-Z\/]+)\>/g,function(h){return h.toLowerCase()});return f};c.inlineEdit.htmlComparator=function(g,f){return c.inlineEdit.normalizeHTML(g)===c.inlineEdit.normalizeHTML(f)};c.inlineEdit.bindRichTextHighlightHandler=function(g,j,h){g=d(g);var i=function(){j.addClass(h)};var f=function(){j.removeClass(h)};g.focus(i);g.blur(f)};c.inlineEdit.setupRichTextEditButton=function(i){var h=i.options;var f=i.locate("textEditButton");if(f.length===0){var g=d("<a href='#_' class='flc-inlineEdit-textEditButton'></a>");g.text(h.strings.textEditButton);i.locate("text").after(g);f=i.locate("textEditButton")}return f};c.inlineEdit.richTextDisplayModeRenderer=function(g){var f=g.options.styles;var h=c.inlineEdit.setupDisplayModeContainer(f);var i=g.viewEl.wrap(h).parent();g.textEditButton=c.inlineEdit.setupRichTextEditButton(g);i.append(g.textEditButton);i.addClass(f.focus);c.inlineEdit.bindHoverHandlers(i,f.invitation);c.inlineEdit.bindMouseHandlers(g.textEditButton,g.edit);c.inlineEdit.bindKeyboardHandlers(g.textEditButton,g.edit);c.inlineEdit.bindRichTextHighlightHandler(g.viewEl,i,f.invitation);c.inlineEdit.bindRichTextHighlightHandler(g.textEditButton,i,f.invitation);return i};c.inlineEdit.tinyMCE=function(f,g){var h=a("fluid.inlineEdit.tinyMCE",f,g);tinyMCE.init(h.options.tinyMCE);return h};c.inlineEdit.tinyMCE.getEditor=function(f){return tinyMCE.get(f.id)};c.inlineEdit.tinyMCE.setValue=function(f,g,h){d(f).val(h);g.setContent(h,{format:"raw"})};c.inlineEdit.tinyMCE.getValue=function(f){return f.getContent()};var e=c.inlineEdit.tinyMCE;e.viewAccessor=c.inlineEdit.makeViewAccessor(e.getEditor,e.setValue,e.getValue);c.inlineEdit.tinyMCE.blurHandlerBinder=function(f){function g(h){setTimeout(function(){tinyMCE.execCommand("mceFocus",false,f.editField[0].id);if(d.browser.mozilla&&d.browser.version.substring(0,3)==="1.8"){return}h.selection.select(h.getBody(),1);h.selection.collapse(0)},10)}f.events.afterInitEdit.addListener(function(h){g(h);var i=h.getBody();c.deadMansBlur(f.editField,{exclusions:{body:d(i)},handler:function(){f.cancel()}})});f.events.afterBeginEdit.addListener(function(){var h=tinyMCE.get(f.editField[0].id);if(h){g(h)}})};c.inlineEdit.tinyMCE.editModeRenderer=function(h){var g=h.options.tinyMCE;g.elements=c.allocateSimpleId(h.editField);var f=g.init_instance_callback;g.init_instance_callback=function(i){h.events.afterInitEdit.fire(i);if(f){f()}};tinyMCE.init(g)};c.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:c.inlineEdit.htmlComparator,blurHandlerBinder:c.inlineEdit.tinyMCE.blurHandlerBinder,displayModeRenderer:c.inlineEdit.richTextDisplayModeRenderer,editModeRenderer:c.inlineEdit.tinyMCE.editModeRenderer});c.inlineEdit.CKEditor=function(f,g){return a("fluid.inlineEdit.CKEditor",f,g)};c.inlineEdit.CKEditor.getEditor=function(f){return CKEDITOR.instances[f.id]};c.inlineEdit.CKEditor.setValue=function(f,g,h){g.setData(h)};c.inlineEdit.CKEditor.getValue=function(f){return f.getData()};var b=c.inlineEdit.CKEditor;b.viewAccessor=c.inlineEdit.makeViewAccessor(b.getEditor,b.setValue,b.getValue);c.inlineEdit.CKEditor.focus=function(f){setTimeout(function(){f.focus()},0)};c.inlineEdit.CKEditor.normalizeHTML=function(h){var g=c.inlineEdit.normalizeHTML(h);var f=g.indexOf(">");if(f!==-1&&f<g.length-1){if(g.charAt(f+1)!==" "){g=g.substring(0,f+1)+" "+g.substring(f+1)}}return g};c.inlineEdit.CKEditor.htmlComparator=function(g,f){return c.inlineEdit.CKEditor.normalizeHTML(g)===c.inlineEdit.CKEditor.normalizeHTML(f)};c.inlineEdit.CKEditor.blurHandlerBinder=function(f){f.events.afterInitEdit.addListener(c.inlineEdit.CKEditor.focus);f.events.afterBeginEdit.addListener(function(){var g=c.inlineEdit.CKEditor.getEditor(f.editField[0]);if(g){c.inlineEdit.CKEditor.focus(g)}})};c.inlineEdit.CKEditor.editModeRenderer=function(g){var h=c.allocateSimpleId(g.editField);d.data(c.unwrap(g.editField),"fluid.inlineEdit.CKEditor",g);var f=CKEDITOR.replace(h,g.options.CKEditor);f.on("instanceReady",function(i){c.inlineEdit.CKEditor.focus(i.editor);g.events.afterInitEdit.fire(i.editor)})};c.defaults("fluid.inlineEdit.CKEditor",{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.CKEditor.viewAccessor"},lazyEditView:true,defaultViewText:"Click Edit",modelComparator:c.inlineEdit.CKEditor.htmlComparator,blurHandlerBinder:c.inlineEdit.CKEditor.blurHandlerBinder,displayModeRenderer:c.inlineEdit.richTextDisplayModeRenderer,editModeRenderer:c.inlineEdit.CKEditor.editModeRenderer,CKEditor:{}});c.inlineEdit.dropdown=function(f,g){return a("fluid.inlineEdit.dropdown",f,g)};c.inlineEdit.dropdown.editModeRenderer=function(f){var g=c.allocateSimpleId(f.editField);f.editField.selectbox({finishHandler:function(){f.finish()}});return{container:f.editContainer,field:d("input.selectbox",f.editContainer)}};c.inlineEdit.dropdown.blurHandlerBinder=function(f){c.deadMansBlur(f.editField,{exclusions:{selectBox:d("div.selectbox-wrapper",f.editContainer)},handler:function(){f.cancel()}})};c.defaults("fluid.inlineEdit.dropdown",{applyEditPadding:false,blurHandlerBinder:c.inlineEdit.dropdown.blurHandlerBinder,editModeRenderer:c.inlineEdit.dropdown.editModeRenderer})
  })(jQuery,fluid_1_4);var fluid_1_4=fluid_1_4||{};(function(b,a){a.dom.computeAbsolutePosition=function(c){var e=0,d=0;if(c.offsetParent){do{e+=c.offsetLeft;d+=c.offsetTop;c=c.offsetParent}while(c);return[e,d]}};a.dom.cleanseScripts=function(c){var d=b.data(c,a.dom.cleanseScripts.MARKER);if(!d){a.dom.iterateDom(c,function(e){return e.tagName.toLowerCase()==="script"?"delete":null});b.data(c,a.dom.cleanseScripts.MARKER,true)}};a.dom.cleanseScripts.MARKER="fluid-scripts-cleansed";a.dom.insertAfter=function(c,d){var e=d.nextSibling;if(!e){d.parentNode.appendChild(c)}else{d.parentNode.insertBefore(c,e)}};a.dom.isWhitespaceNode=function(c){return !(/[^\t\n\r ]/.test(c.data))};a.dom.isIgnorableNode=function(c){return(c.nodeType===8)||((c.nodeType===3)&&a.dom.isWhitespaceNode(c))}})(jQuery,fluid_1_4);var fluid_1_4=fluid_1_4||{};(function(f,g){g.orientation={HORIZONTAL:4,VERTICAL:1};g.rectSides={4:["left","right"],1:["top","bottom"],8:"top",12:"bottom",2:"left",3:"right"};g.position={BEFORE:-1,AFTER:1,INSIDE:2,REPLACE:3};g.direction={NEXT:1,PREVIOUS:-1,UP:8,DOWN:12,LEFT:2,RIGHT:3};g.directionSign=function(k){return k===g.direction.UP||k===g.direction.LEFT?g.direction.PREVIOUS:g.direction.NEXT};g.directionAxis=function(k){return k===g.direction.LEFT||k===g.direction.RIGHT?0:1};g.directionOrientation=function(k){return g.directionAxis(k)?g.orientation.VERTICAL:g.orientation.HORIZONTAL};g.keycodeDirection={up:g.direction.UP,down:g.direction.DOWN,left:g.direction.LEFT,right:g.direction.RIGHT};g.moveDom=function(m,n,k){m=g.unwrap(m);n=g.unwrap(n);var l;if(k===g.position.INSIDE){n.appendChild(m)}else{if(k===g.position.BEFORE){for(l=n.previousSibling;;l=l.previousSibling){if(!l||!g.dom.isIgnorableNode(l)){if(l!==m){g.dom.cleanseScripts(m);n.parentNode.insertBefore(m,n)}break}}}else{if(k===g.position.AFTER){for(l=n.nextSibling;;l=l.nextSibling){if(!l||!g.dom.isIgnorableNode(l)){if(l!==m){g.dom.cleanseScripts(m);g.dom.insertAfter(m,n)}break}}}else{g.fail("Unrecognised position supplied to fluid.moveDom: "+k)}}}};g.normalisePosition=function(l,n,k,m){if(l===g.position.REPLACE){l=n&&k>=m?g.position.AFTER:g.position.BEFORE}return l};g.permuteDom=function(n,r,q,l,o){n=g.unwrap(n);r=g.unwrap(r);var p=f.inArray(n,l);if(p===-1){g.fail("Error in permuteDom: source element "+g.dumpEl(n)+" not found in source list "+g.dumpEl(l))}var v=f.inArray(r,o);if(v===-1){g.fail("Error in permuteDom: target element "+g.dumpEl(r)+" not found in source list "+g.dumpEl(o))}var k=l===o;q=g.normalisePosition(q,k,v,p);var u={};u[g.position.AFTER]=n.nextSibling;u[g.position.BEFORE]=n.previousSibling;g.moveDom(l[p],o[v],q);var t=k?v-1:l.length-2;var m;if(q===g.position.BEFORE&&k){t--}if(!k||v>p){for(m=t;m>p;--m){g.moveDom(l[m+1],l[m],g.position.AFTER)}if(p+1<l.length){g.moveDom(l[p+1],u[g.position.AFTER],g.position.BEFORE)}}var s=k?p-1:o.length-1;if(q===g.position.AFTER){v++}if(!k||v<p){for(m=v;m<s;++m){g.moveDom(o[m],o[m+1],g.position.BEFORE)}if(s>=0&&s<o.length-1){g.moveDom(o[s],u[g.position.BEFORE],g.position.AFTER)}}};var b=function(k,l){return window.getComputedStyle?window.getComputedStyle(k,null).getPropertyValue(l):k.currentStyle[l]};var h=function(k){while(k&&k.nodeName){if(k.nodeName==="BODY"){return true}k=k.parentNode}return false};var j=function(k){return"hidden"===k.type||b(k,"display")==="none"||b(k,"visibility")==="hidden"||!h(k)};var e=function(m,l,q){var o={};o.element=m;o.orientation=l;if(q===g.position.INSIDE){o.position=q}if(j(m)){o.clazz="hidden"}var p=g.dom.computeAbsolutePosition(m)||[0,0];var n=m.offsetWidth;var k=m.offsetHeight;o.rect={left:p[0],top:p[1]};o.rect.right=p[0]+n;o.rect.bottom=p[1]+k;return o};var c=10000;function d(k){return"Rect top: "+k.top+" left: "+k.left+" bottom: "+k.bottom+" right: "+k.right}function i(k){if(!k||!k.rect){return"null"}else{return d(k.rect)+" position: "+k.position+" for "+g.dumpEl(k.element)}}g.dropManager=function(){var l=[];var n={};var p={};var k;var m;var r,q;p.updateGeometry=function(B){m=B;l=[];n={};var s=B.elementMapper;for(var A=0;A<B.extents.length;++A){var w=B.extents[A];var t=w.orientation;var u=g.rectSides[t];var v=function(G,D,J,K,F){var E=e(G,t,K);E.owner=w;if(E.clazz!=="hidden"&&s){E.clazz=s(G)}n[g.dropManager.cacheKey(G)]=E;var H=g.dropManager.getRelativeClass(w.elements,F,g.position.BEFORE,E.clazz,s);var I=g.dropManager.getRelativeClass(w.elements,F,g.position.AFTER,E.clazz,s);if(K===g.position.INSIDE){l[l.length]=E}else{g.dropManager.splitElement(l,u,E,K,H,I)}if(D&&B.sentinelize){g.dropManager.sentinelizeElement(l,u,E,1,K,H)}if(J&&B.sentinelize){g.dropManager.sentinelizeElement(l,u,E,0,K,I)}return E};var C=true;for(var x=0;x<w.elements.length;++x){var z=w.elements[x];var y=v(z,x===0,x===w.elements.length-1,g.position.INTERLEAVED,x);if(y.clazz!=="hidden"){C=false}}if(C&&w.parentElement){v(w.parentElement,true,true,g.position.INSIDE)}}};p.startDrag=function(x,w,u,v){var z=w[0]+u/2;var y=w[1]+v/2;var t=z-x.pageX;var s=y-x.pageY;p.updateGeometry(m);k=null;r=t;q=s;f("body").bind("mousemove.fluid-dropManager",p.mouseMove)};p.lastPosition=function(){return k};p.endDrag=function(){f("body").unbind("mousemove.fluid-dropManager")};p.mouseMove=function(t){var s=t.pageX+r;var v=t.pageY+q;var u=p.closestTarget(s,v,k);if(u&&u!==g.dropManager.NO_CHANGE){k=u;p.dropChangeFirer.fire(u)}};p.dropChangeFirer=g.event.getEventFirer();var o={element:null};p.closestTarget=function(D,B,w){var v=Number.MAX_VALUE;var t=o;var s=Number.MAX_VALUE;var C=o;for(var A=0;A<l.length;++A){var z=l[A];if(z.clazz==="hidden"){continue}var u=g.geom.minPointRectangle(D,B,z.rect);if(z.clazz==="locked"){if(u<s){s=u;C=z}}else{if(u<v){v=u;t=z}if(u===0){break}}}if(!t){return t}if(s>=v){C=o}if(w&&w.position===t.position&&g.unwrap(w.element)===g.unwrap(t.element)&&g.unwrap(w.lockedelem)===g.unwrap(C.element)){return g.dropManager.NO_CHANGE}return{position:t.position,element:t.element,lockedelem:C.element}};p.shuffleProjectFrom=function(t,w,v,s){var u=p.projectFrom(t,w,v,s);if(u){u.position=g.position.REPLACE}return u};p.projectFrom=function(w,y,x,v){p.updateGeometry(m);var u=n[g.dropManager.cacheKey(w)];var t=g.geom.projectFrom(u.rect,y,l,x,v);if(!t.cacheelem){return null}var s=t.cacheelem.position;return{element:t.cacheelem.element,position:s?s:g.position.BEFORE}};p.logicalFrom=function(u,w,v,t){var s=p.getOwningSpan(u,g.position.INTERLEAVED,v);return{element:g.dropManager.getRelativeElement(u,w,s,t),position:g.position.REPLACE}};p.lockedWrapFrom=function(v,z,y,u){var x=p.logicalFrom(v,z,y,u);var s=p.getOwningSpan(v,g.position.INTERLEAVED,y);var w=n[g.dropManager.cacheKey(v)].owner.elements;if(y||s[0]===w[0]){return x}var t=g.dropManager.getRelativeElement(v,z,w,u);if(m.elementMapper(t)==="locked"){x.element=null;x.clazz="locked"}return x};p.getOwningSpan=function(u,t,w){var s=n[g.dropManager.cacheKey(u)].owner;var v=t===g.position.INSIDE?[s.parentElement]:s.elements;if(!w&&m.elementMapper){v=f.makeArray(v);g.remove_if(v,function(x){return m.elementMapper(x)==="locked"})}return v};p.geometricMove=function(v,w,s){var t=p.getOwningSpan(v,null,true);var u=p.getOwningSpan(w,s,true);g.permuteDom(v,w,s,t,u)};return p};g.dropManager.NO_CHANGE="no change";g.dropManager.cacheKey=function(k){return g.allocateSimpleId(k)};g.dropManager.sentinelizeElement=function(k,p,n,o,q,m){var l=f.extend(true,{},n);l.rect[p[o]]=l.rect[p[1-o]]+(o?1:-1);l.rect[p[1-o]]=(o?-1:1)*c;l.position=q===g.position.INSIDE?q:(o?g.position.BEFORE:g.position.AFTER);l.clazz=m;k[k.length]=l};g.dropManager.splitElement=function(n,l,m,k,p,o){var s=f.extend(true,{},m);var q=f.extend(true,{},m);var r=(s.rect[l[0]]+s.rect[l[1]])/2;s.rect[l[1]]=r;s.position=g.position.BEFORE;q.rect[l[0]]=r;q.position=g.position.AFTER;s.clazz=p;q.clazz=o;n[n.length]=s;n[n.length]=q};g.dropManager.getRelativeClass=function(m,l,n,k,o){l+=n;if(l<0&&k==="locked"){return"locked"}if(l>=m.length||o===null){return null}else{n=m[l];return o(n)==="locked"&&k==="locked"?"locked":null}};g.dropManager.getRelativeElement=function(m,o,n,l){var p=g.directionSign(o);var k=f(n).index(m)+p;if(k<0){k+=n.length}if(l){if(k===n.length||k===(n.length+p)){return m}}k%=n.length;return n[k]};g.geom=g.geom||{};g.geom.minPointRectangle=function(k,o,n){var m=k<n.left?(n.left-k):(k>n.right?(k-n.right):0);var l=o<n.top?(n.top-o):(o>n.bottom?(o-n.bottom):0);return m*m+l*l};g.geom.minRectRect=function(n,l){var m=n.right<l.left?l.left-n.right:l.right<n.left?n.left-l.right:0;var k=n.bottom<l.top?l.top-n.bottom:l.bottom<n.top?n.top-l.bottom:0;return m*m+k*k};var a=function(){return{mindist:Number.MAX_VALUE,minrdist:Number.MAX_VALUE}};g.geom.projectFrom=function(o,B,C,v,q){var m=g.directionAxis(B);var y=g.rectSides[B];var w=g.rectSides[m*15+5-B];var s=g.directionSign(B);var k={left:(7*o.left+1*o.right)/8,right:(5*o.left+3*o.right)/8,top:(7*o.top+1*o.bottom)/8,bottom:(5*o.top+3*o.bottom)/8};k[y]=s*c;k[w]=-k[y];function D(H,F,I){var G=F.rect;var J=g.geom.minRectRect(k,G);var E=-s*I*(o[I===1?y:w]-G[I===1?w:y]);if(J<=H.mindist&&E>=0){if(J===H.mindist&&E*I>H.minrdist){return}H.minrdist=E*I;H.mindist=J;H.minelem=F}}var t=a();var x=a();var n=a();for(var z=0;z<C.length;++z){var A=C[z];var l=A.owner&&A.element===A.owner.parentElement;if(A.clazz==="hidden"||v&&l){continue}else{if(!v&&A.clazz==="locked"){D(n,A,1)}else{D(t,A,1);D(x,A,-1)}}}var r=!t.minelem||x.mindist<t.mindist;r=r&&!q;var u=r?x:t;var p={wrapped:r,cacheelem:u.minelem};if(n.mindist<u.mindist){p.lockedelem=n.minelem}return p}})(jQuery,fluid_1_4);var fluid_1_4=fluid_1_4||{};(function(g,f){var a=function(m,j,k){f.dom.cleanseScripts(f.unwrap(m));var l=g(m).clone();f.dom.iterateDom(l.get(0),function(n){n.removeAttribute("id");if(n.tagName.toLowerCase()==="input"){n.setAttribute("disabled","disabled")}});l.removeProp("id");l.removeClass("ui-droppable");l.addClass(j);if(k){var i=g(document.createElement("div"));i.append(l);i.append(k);l=i}g("body").append(l);if(!g.browser.safari){l.css("display","block").width(m.offsetWidth).height(m.offsetHeight)}if(g.browser.opera){l.hide()}return l
  };function c(j,l,m,i){var k=l;var n=false;if(g.browser.opera){j.keypress(function(o){if(n){n=false;o.preventDefault();return false}});k=function(p){var o=l(p);if(o===false){n=true}}}j.keydown(k);j.keyup(m)}function d(i){i.container.attr("role",i.options.containerRole.container);i.container.attr("aria-multiselectable","false");i.container.attr("aria-readonly","false");i.container.attr("aria-disabled","false")}function h(i){return i+"_avatar"}var e=function(i){if(i.keysets&&!(i.keysets instanceof Array)){i.keysets=[i.keysets]}};f.reorderer=function(x,k){if(!x){f.fail("Reorderer initialised with no container")}var y=f.initView("fluid.reorderer",x,k);k=y.options;var r=f.dropManager();y.layoutHandler=f.initSubcomponent(y,"layoutHandler",[y.container,k,r,y.dom]);y.activeItem=undefined;e(k);var i=y.locate("dropWarning");var v;if(i){v=i.clone()}var A=function(D){var F=k.keysets;for(var E=0;E<F.length;E++){if(F[E].modifier(D)){return true}}return false};var j=function(){return g.inArray(y.activeItem,y.dom.fastLocate("movables"))>=0};var l=function(D){y.dom.fastLocate("dropTargets").attr("aria-dropeffect",D)};var s=k.styles;var t=function(D){return(!D.ctrlKey&&!D.altKey&&!D.shiftKey&&!D.metaKey)};var B=function(K){var M=y.activeItem;if(!M){return true}var D=k.keysets;for(var G=0;G<D.length;G++){var F=D[G];var J=f.keyForValue(F,K.keyCode);if(!J){continue}var L=F.modifier(K);var E=f.keycodeDirection[J];var H=y.layoutHandler.getRelativePosition(M,E,!L);if(!H){continue}if(L){var I=y.events.onBeginMove.fire(M);if(I===false){return false}if(i.length>0){if(H.clazz==="locked"){y.events.onShowKeyboardDropWarning.fire(M,i);i.show()}else{i.hide()}}if(H.element){y.requestMovement(H,M)}}else{if(t(K)){M.blur();g(H.element).focus()}}return false}return true};y.handleKeyDown=function(D){if(!y.activeItem||y.activeItem!==D.target){return true}var E=g(y.activeItem);if(!E.hasClass(s.dragging)&&A(D)){if(j()){E.removeClass(s.selected);E.addClass(s.dragging);E.attr("aria-grabbed","true");l("move")}return false}return B(D)};y.handleKeyUp=function(D){if(!y.activeItem||y.activeItem!==D.target){return true}var E=g(y.activeItem);if(E.hasClass(s.dragging)&&!A(D)){if(i){i.hide()}E.removeClass(s.dragging);E.addClass(s.selected);E.attr("aria-grabbed","false");l("none");return false}return false};var m;var n=function(E){var D=g(document.createElement(E));D.addClass(k.styles.dropMarker);D.hide();return D};y.requestMovement=function(E,D){D=f.unwrap(D);if(!E||f.unwrap(E.element)===D){return}var F=g(y.activeItem);F.unbind("blur.fluid.reorderer");y.events.onMove.fire(D,E);r.geometricMove(D,E.element,E.position);F.focus();y.refresh();r.updateGeometry(y.layoutHandler.getGeometricInfo());y.events.afterMove.fire(D,E,y.dom.fastLocate("movables"))};var w=function(D,E){y.dom.fastLocate("grabHandle",D)[E?"addClass":"removeClass"](s.hover)};function q(F){var E=k.styles;F.attr("aria-grabbed","false");F.mouseover(function(){y.events.onHover.fire(F,true)});F.mouseout(function(){y.events.onHover.fire(F,false)});var D;y.dom.fastLocate("grabHandle",F).draggable({refreshPositions:false,scroll:true,helper:function(){var G;if(v){G=v[0]}D=g(k.avatarCreator(F[0],E.avatar,G));D.prop("id",h(y.container.id));return D},start:function(M,L){var H=y.events.onBeginMove.fire(F);if(H===false){return false}var K=y.dom.fastLocate("grabHandle",F)[0];var J=f.dom.computeAbsolutePosition(K);var G=K.offsetWidth;var I=K.offsetHeight;F.focus();F.removeClass(k.styles.selected);F.addClass(k.styles.mouseDrag);F.attr("aria-grabbed","true");l("move");r.startDrag(M,J,G,I);D.show()},stop:function(I,H){F.removeClass(k.styles.mouseDrag);F.addClass(k.styles.selected);g(y.activeItem).attr("aria-grabbed","false");var G=f.unwrap(m);if(G.parentNode){G.parentNode.removeChild(G)}D.hide();H.helper=null;l("none");r.endDrag();y.requestMovement(r.lastPosition(),F);y.activeItem.focus()},handle:y.dom.fastLocate("grabHandle",F)})}function C(D,E){D.removeClass(E.selected);D.removeClass(E.dragging);D.addClass(E.defaultStyle);D.attr("aria-selected","false")}var p=function(F){y.events.onSelect.fire(F);var E=k.styles;if(y.activeItem&&y.activeItem!==F){C(g(y.activeItem),E)}y.activeItem=F;var D=g(F);D.removeClass(E.defaultStyle);D.addClass(E.selected);D.attr("aria-selected","true")};var z=function(){var G=function(I){C(g(this),k.styles);return I.stopPropagation()};var H=function(I){p(this);return I.stopPropagation()};var D=y.dom.fastLocate("selectables");for(var F=0;F<D.length;++F){var E=g(D[F]);if(!g.data(E[0],"fluid.reorderer.selectable-initialised")){E.addClass(s.defaultStyle);E.bind("blur.fluid.reorderer",G);E.focus(H);E.click(function(I){var J=f.unwrap(y.dom.fastLocate("grabHandle",this));if(f.dom.isContainer(J,I.target)){g(this).focus()}});E.attr("role",k.containerRole.item);E.attr("aria-selected","false");E.attr("aria-disabled","false");g.data(E[0],"fluid.reorderer.selectable-initialised",true)}}if(!y.selectableContext){y.selectableContext=f.selectable(y.container,{selectableElements:D,selectablesTabindex:y.options.selectablesTabindex,direction:null})}};var u=function(D){f.moveDom(m,D.element,D.position);m.css("display","");if(v){if(D.lockedelem){v.show()}else{v.hide()}}};var o=function(){var G=y.dom.fastLocate("movables");var F=y.dom.fastLocate("dropTargets");z();for(var D=0;D<G.length;D++){var E=G[D];if(!g.data(E,"fluid.reorderer.movable-initialised")){q(g(E));g.data(E,"fluid.reorderer.movable-initialised",true)}}if(G.length>0&&!m){m=n(G[0].tagName)}r.updateGeometry(y.layoutHandler.getGeometricInfo());r.dropChangeFirer.addListener(u,"fluid.Reorderer");F.attr("aria-dropeffect","none")};if(y.container){c(y.container,y.handleKeyDown,y.handleKeyUp);d(y);f.tabbable(y.container);o()}if(k.afterMoveCallbackUrl){y.events.afterMove.addListener(function(){var D=y.layoutHandler;var E=D.getModel?D.getModel():k.acquireModel(y);g.post(k.afterMoveCallbackUrl,JSON.stringify(E))},"postModel")}y.events.onHover.addListener(w,"style");y.refresh=function(){y.dom.refresh("movables");y.dom.refresh("selectables");y.dom.refresh("grabHandle",y.dom.fastLocate("movables"));y.dom.refresh("stylisticOffset",y.dom.fastLocate("movables"));y.dom.refresh("dropTargets");y.events.onRefresh.fire();o();y.selectableContext.selectables=y.dom.fastLocate("selectables");y.selectableContext.selectablesUpdated(y.activeItem)};f.initDependents(y);y.refresh();return y};f.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};f.reorderer.defaultKeysets=[{modifier:function(i){return i.ctrlKey},up:f.reorderer.keys.UP,down:f.reorderer.keys.DOWN,right:f.reorderer.keys.RIGHT,left:f.reorderer.keys.LEFT},{modifier:function(i){return i.ctrlKey},up:f.reorderer.keys.i,down:f.reorderer.keys.m,right:f.reorderer.keys.k,left:f.reorderer.keys.j}];f.reorderer.roles={GRID:{container:"grid",item:"gridcell"},LIST:{container:"list",item:"listitem"},REGIONS:{container:"main",item:"article"}};var b=function(i,j,k){k=k||{};k.layoutHandler=j;return f.reorderer(i,k)};f.reorderList=function(i,j){return b(i,"fluid.listLayoutHandler",j)};f.reorderGrid=function(i,j){return b(i,"fluid.gridLayoutHandler",j)};f.reorderer.SHUFFLE_GEOMETRIC_STRATEGY="shuffleProjectFrom";f.reorderer.GEOMETRIC_STRATEGY="projectFrom";f.reorderer.LOGICAL_STRATEGY="logicalFrom";f.reorderer.WRAP_LOCKED_STRATEGY="lockedWrapFrom";f.reorderer.NO_STRATEGY=null;f.reorderer.relativeInfoGetter=function(j,m,k,i,n,l){return function(p,r,o){var q=f.directionOrientation(r);var s=q===j?m:k;return s!==null?i[s](p,r,o,l):null}};f.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:a,keysets:f.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});f.reorderer.makeGeometricInfoGetter=function(i,k,j){return function(){var l={sentinelize:k,extents:[{orientation:i,elements:j.fastLocate("dropTargets")}],elementMapper:function(m){return g.inArray(m,j.fastLocate("movables"))===-1?"locked":null},elementIndexer:function(n){var m=j.fastLocate("selectables");return{elementClass:l.elementMapper(n),index:g.inArray(n,m),length:m.length}}};return l}};f.defaults(true,"fluid.listLayoutHandler",{orientation:f.orientation.VERTICAL,containerRole:f.reorderer.roles.LIST,selectablesTabindex:-1,sentinelize:true});f.listLayoutHandler=function(j,k,i,m){var l={};l.getRelativePosition=f.reorderer.relativeInfoGetter(k.orientation,f.reorderer.LOGICAL_STRATEGY,null,i,m,k.disableWrap);l.getGeometricInfo=f.reorderer.makeGeometricInfoGetter(k.orientation,k.sentinelize,m);return l};f.defaults(true,"fluid.gridLayoutHandler",{orientation:f.orientation.HORIZONTAL,containerRole:f.reorderer.roles.GRID,selectablesTabindex:-1,sentinelize:false});f.gridLayoutHandler=function(j,k,i,m){var l={};l.getRelativePosition=f.reorderer.relativeInfoGetter(k.orientation,k.disableWrap?f.reorderer.SHUFFLE_GEOMETRIC_STRATEGY:f.reorderer.LOGICAL_STRATEGY,f.reorderer.SHUFFLE_GEOMETRIC_STRATEGY,i,m,k.disableWrap);l.getGeometricInfo=f.reorderer.makeGeometricInfoGetter(k.orientation,k.sentinelize,m);return l};f.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"]}}});
  f.reorderer.indexRebaser=function(i){i.index++;if(i.moduleIndex!==undefined){i.moduleIndex++}return i};f.reorderer.labeller=function(i){var l=f.initLittleComponent("fluid.reorderer.labeller",i);f.initDependents(l);l.dom=l.options.dom;l.moduleCell=l.resolver.resolve("moduleCell_"+l.options.orientation);var k=f.computeNickName(l.options.layoutType);l.positionTemplate=l.resolver.lookup(["position_"+k,"position"]);var j={};l.returnedOptions={listeners:{onRefresh:function(){var m=l.dom.locate("selectables");f.each(m,function(q){var n={};var s=f.allocateSimpleId(q);var r=j[s];var p=l.renderLabel(q);var o=p;if(r){r.newRender=o;p=l.renderLabel(q,r.oldRender.position);g(q).one("focusout",function(){if(j[s]){var t=j[s].newRender.label;delete j[s];f.updateAriaLabel(q,t)}});n.dynamicLabel=true}f.updateAriaLabel(q,p.label,n)})},onMove:function(o,n){f.clear(j);var m=f.allocateSimpleId(o);j[m]={oldRender:l.renderLabel(o)}}}};return l};f.reorderer.labeller.renderLabel=function(i,m,k){var l=i.options.getGeometricInfo();var q=f.reorderer.indexRebaser(l.elementIndexer(m));q.moduleCell=i.moduleCell;var r=l.elementMapper(m);var o=i.dom.locate("labelSource",m);var j;if(k){j=i.resolver.resolve("recentStatus",{position:k})}var s={item:typeof(o)==="string"?o:f.dom.getElementText(f.unwrap(o)),position:i.positionTemplate.resolveFunc(i.positionTemplate.template,q),movable:i.resolver.resolve(r==="locked"?"fixed":"movable"),recentStatus:j||""};var p=i.resolver.lookup(["overallTemplate"]);var n=p.resolveFunc(p.template,s);return{position:s.position,label:n}}})(jQuery,fluid_1_4);var fluid_1_4=fluid_1_4||{};(function(d,f){var k=function(l,m){return l+"lightbox-cell:"+m+":"};var j=function(l){var m=function(n){if(n.which===f.reorderer.keys.ENTER){var o=d("a",n.target);document.location=o.attr("href")}};l.keypress(m)};var b=function(p,r,n){var l=p.getElementsByTagName(r);var q=[];for(var o=0;o<l.length;o+=1){var m=l[o];var s=m.id;if(s&&s.match(n)){q.push(m)}}return q};var h=function(l,m){l=f.unwrap(l);var n="^"+k(m,"[0-9]+")+"$";return function(){return b(l,"div",n)}};var a=function(l){return f.findAncestor(l,function(m){return d(m).is("form")})};var e=function(l,m){return b(m,"input","^"+k(l.prop("id"),"[^:]*")+"reorder-index$")};var c=function(m,q){var l=e(m,q);for(var p=0;p<l.length;p++){var n=l[p];var o=n.name;n.name=o||n.id}};var i=function(l){var m=a(l);c(l,m);return function(){var o,p;o=e(l,m);for(p=0;p<o.length;p+=1){o[p].value=p}if(m&&m.action){var n=d(m).serialize();d.post(m.action,n,function(r,s,q){})}}};var g=function(p,o,n){var m=f.get(p,o);var l=m||n;f.set(p,o,l)};f.reorderImages=function(l,n){var o=f.initView("fluid.reorderImages",l,n);g(o,"options.listeners.afterMove",o.options.afterMoveCallback||i(o.container));g(o,"options.selectors.movables",h(o.container,o.container.prop("id")));var m=f.reorderer(o.container,o.options);f.tabindex(d("a",o.container),-1);j(o.container);return m};f.lightbox=f.reorderImages;f.defaults("fluid.reorderImages",{layoutHandler:"fluid.gridLayoutHandler",selectors:{labelSource:".flc-reorderer-imageTitle"}})})(jQuery,fluid_1_4);var fluid_1_4=fluid_1_4||{};(function(b,a){a.registerNamespace("fluid.moduleLayout");a.moduleLayout.findColumnAndItemIndices=function(e,d){return a.find(d.columns,function(h,g){var f=b.inArray(e,h.elements);return f===-1?undefined:{columnIndex:g,itemIndex:f}},{columnIndex:-1,itemIndex:-1})};a.moduleLayout.findColIndex=function(e,d){return a.find(d.columns,function(g,f){return e===g.container?f:undefined},-1)};a.moduleLayout.updateLayout=function(g,i,e,f){g=a.unwrap(g);i=a.unwrap(i);var d=a.moduleLayout.findColumnAndItemIndices(g,f);f.columns[d.columnIndex].elements.splice(d.itemIndex,1);var k;if(e===a.position.INSIDE){k=f.columns[a.moduleLayout.findColIndex(i,f)].elements;k.splice(k.length,0,g)}else{var j=a.moduleLayout.findColumnAndItemIndices(i,f);k=f.columns[j.columnIndex].elements;e=a.normalisePosition(e,d.columnIndex===j.columnIndex,j.itemIndex,d.itemIndex);var h=e===a.position.BEFORE?0:1;k.splice(j.itemIndex+h,0,g)}};a.moduleLayout.layoutFromFlat=function(d,f,e){var g={};g.container=d;g.columns=a.transform(f,function(h){return{container:h,elements:b.makeArray(e.filter(function(){return a.dom.isContainer(h,this)}))}});return g};a.moduleLayout.layoutFromIds=function(d){return{container:a.byId(d.id),columns:a.transform(d.columns,function(e){return{container:a.byId(e.id),elements:a.transform(e.children,a.byId)}})}};a.moduleLayout.layoutToIds=function(d){return{id:a.getId(d.container),columns:a.transform(d.columns,function(e){return{id:a.getId(e.container),children:a.transform(e.elements,a.getId)}})}};var c=function(e,d){if(d){var f=b(e).offset();d=b(d);d.css("position","absolute");d.css("top",f.top);d.css("left",f.left)}};a.defaults(true,"fluid.moduleLayoutHandler",{orientation:a.orientation.VERTICAL,containerRole:a.reorderer.roles.REGIONS,selectablesTabindex:-1,sentinelize:true});a.moduleLayoutHandler=function(e,l,h,f){var i={};function k(){var n;if(l.selectors.modules){n=a.moduleLayout.layoutFromFlat(e,f.locate("columns"),f.locate("modules"))}if(!n){var m=a.get(l,"moduleLayout.layout");a.moduleLayout.layoutFromIds(m)}return n}var g=k();i.layout=g;function d(m){var n=l.selectors.lockedModules?f.fastLocate("lockedModules"):[];return b.inArray(m,n)!==-1}i.getRelativePosition=a.reorderer.relativeInfoGetter(l.orientation,a.reorderer.WRAP_LOCKED_STRATEGY,a.reorderer.GEOMETRIC_STRATEGY,h,f,l.disableWrap);i.getGeometricInfo=function(){var q=[];var p={extents:q,sentinelize:l.sentinelize};p.elementMapper=function(r){return d(r)?"locked":null};p.elementIndexer=function(r){var s=a.moduleLayout.findColumnAndItemIndices(r,i.layout);return{index:s.itemIndex,length:g.columns[s.columnIndex].elements.length,moduleIndex:s.columnIndex,moduleLength:g.columns.length}};for(var m=0;m<g.columns.length;m++){var o=g.columns[m];var n={orientation:l.orientation,elements:b.makeArray(o.elements),parentElement:o.container};q.push(n)}return p};function j(m){return function(){var n=a.accumulate(g.columns,function(o,p){return p.concat(o.elements)},[]);if(!m){a.remove_if(n,d)}return n}}i.returnedOptions={selectors:{movables:j(false),dropTargets:j(false),selectables:j(true)},listeners:{onMove:{priority:"last",listener:function(m,n){a.moduleLayout.updateLayout(m,n.element,n.position,g)}},onRefresh:function(){g=k();i.layout=g},"onShowKeyboardDropWarning.setPosition":c}};i.getModel=function(){return a.moduleLayout.layoutToIds(g)};return i}})(jQuery,fluid_1_4);var fluid_1_4=fluid_1_4||{};(function(b,a){a.reorderLayout=function(c,f){var e={layoutHandler:"fluid.moduleLayoutHandler",selectors:{columns:".flc-reorderer-column",modules:".flc-reorderer-module"}};var d=b.extend(true,e,f);return a.reorderer(c,d)}})(jQuery,fluid_1_4);var fluid_1_4=fluid_1_4||{};(function(d,h){function r(x,y,A){if(!x.pageLinks){return}if(A.pageIndex!==undefined){var z=x.pageLinks.eq(A.pageIndex);z.removeClass(x.options.styles.currentPage)}var w=x.pageLinks.eq(y.pageIndex);w.addClass(x.options.styles.currentPage)}function j(x,w,y){x.unbind("click.fluid.pager");x.bind("click.fluid.pager",function(){w.initiatePageChange.fire(y)})}function b(w){w.pageCount=Math.max(1,Math.floor((w.totalRange-1)/w.pageSize)+1)}h.pager=function(){return h.pagerImpl.apply(null,arguments)};h.pager.computePageLimit=function(w){return Math.min(w.totalRange,(w.pageIndex+1)*w.pageSize)};h.pager.directPageList=function(w,A,y){var B=h.initView("fluid.pager.directPageList",w,y);B.pageLinks=B.locate("pageLinks");for(var z=0;z<B.pageLinks.length;++z){var x=B.pageLinks.eq(z);j(x,A,{pageIndex:z})}A.onModelChange.addListener(function(C,D){r(B,C,D)});B.defaultModel={pageIndex:undefined,pageSize:1,totalRange:B.pageLinks.length};return B};h.iota=function(y,z){z=z||0;var x=[];for(var w=0;w<y;++w){x[x.length]=z++}return x};h.pager.everyPageStrategy=h.iota;h.pager.gappedPageStrategy=function(w,x){if(!w){w=3}if(!x){x=w}return function(D,E,z){var C=[];var y=0;var B=false;for(var A=0;A<D;++A){if(A<w||(D-A-1)<w||(A>=z-x&&A<=z+x)){C[y++]=A;B=false}else{if(!B){C[y++]=-1;B=true}}}return C}};h.pager.consistentGappedPageStrategy=function(w,x){if(!w){w=1}if(!x){x=w}var y=w+2+x;return function(E,D,I){var A=[];var C=I<y;var J=I>=E-y;var B=y+x;var z=I-x;var F=I+x;var H=false;for(var G=0;G<E;G++){if(G<w||E-G<=w||(C&&G<B)||(J&&G>=E-B)||(G>=z&&G<=F)){A.push(G);H=false}else{if(!H){A.push(-1);H=true}}}return A}};h.pager.renderedPageList=function(w,G,y,H,E){H=d.extend(true,y,H);var A=h.initView("fluid.pager.renderedPageList",w,H);H=A.options;var F={};var x={cutpoints:[{id:"page-link:link",selector:y.selectors.pageLinks},{id:"page-link:skip",selector:y.selectors.pageLinkSkip}],idMap:F};if(H.linkBody){x.cutpoints[x.cutpoints.length]={id:"payload-component",selector:H.linkBody}}var B=function(J,I){var K={ID:"page-link:link",localID:J+1,value:J+1,pageIndex:J,decorators:[{type:"jQuery",func:"click",args:function(L){G.initiatePageChange.fire({pageIndex:J});L.preventDefault()}}]};if(I){K.current=true;K.decorators=K.decorators.concat([{type:"addClass",classes:A.options.styles.currentPage},{type:"jQuery",func:"attr",args:["aria-label",A.options.strings.currentPageIndexMsg]}])}return K};function z(I){return function(J){return J===-1?{ID:"page-link:skip"}:B(J,J===I)}}var C=A.locate("root");h.expectFilledSelector(C,"Error finding root template for fluid.pager.renderedPageList");var D=h.selfRender(C,{},x);G.onModelChange.addListener(function(J,L){var I=A.options.pageStrategy(J.pageCount,0,J.pageIndex);var K=h.transform(I,z(J.pageIndex));if(K.length>1){K[K.length-1].value=K[K.length-1].value+E.last}G.onRenderPageLinks.fire(K,J);d.each(F,function(N,O){var M=h.jById(O);if(M.tooltip){M.tooltip("destroy")}});h.reRender(D,C,K,x);r(A,J,L)});return A};h.defaults("fluid.pager.renderedPageList",{selectors:{root:".flc-pager-links"},linkBody:"a",pageStrategy:h.pager.everyPageStrategy});var k=function(y,w,x){if(x.pageIndex===0){y.previous.addClass(w.styles.disabled)}else{y.previous.removeClass(w.styles.disabled)}if(x.pageIndex===x.pageCount-1){y.next.addClass(w.styles.disabled)
  }else{y.next.removeClass(w.styles.disabled)}};h.pager.previousNext=function(w,y,x){var z=h.initView("fluid.pager.previousNext",w,x);z.previous=z.locate("previous");j(z.previous,y,{relativePage:-1});z.next=z.locate("next");j(z.next,y,{relativePage:+1});y.onModelChange.addListener(function(A,C,B){k(z,x,A)});return z};h.pager.pagerBar=function(z,x,y,w){var A=h.initView("fluid.pager.pagerBar",x,y);A.pageList=h.initSubcomponent(A,"pageList",[x,z,A.options,h.COMPONENT_OPTIONS,w]);A.previousNext=h.initSubcomponent(A,"previousNext",[x,z,A.options,h.COMPONENT_OPTIONS,w]);return A};h.defaults("fluid.pager.pagerBar",{previousNext:{type:"fluid.pager.previousNext"},pageList:{type:"fluid.pager.renderedPageList",options:{pageStrategy:h.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 a(w){return w.options.columnDefs}h.pager.findColumnDef=function(y,x){var w=d.grep(y,function(z){return z.key===x})[0];return w};function q(z,y,w){var x=(y.options.dataOffset?y.options.dataOffset+".":"");z.shortRoot=w;z.longRoot=x+z.shortRoot}function e(x,y,w){if(x.charAt(0)==="*"){return w+x.substring(1)}else{return x.replace("*",y)}}h.pager.fetchValue=function(z,y,x,B,w){q(w,z,x);var A=e(B,w.shortRoot,w.longRoot);return h.get(y,A)};h.pager.basicSorter=function(E,y){var C=E.options.dataModel;var D={};var z=a(E);var A=h.pager.findColumnDef(z,y.sortKey);var w=[];for(var x=0;x<y.totalRange;++x){w[x]={index:x,value:h.pager.fetchValue(E,C,x,A.valuebinding,D)}}function B(I,H){var G=I.value;var F=H.value;return G===F?0:(G>F?y.sortDir:-y.sortDir)}w.sort(B);return h.transform(w,function(F){return F.index})};h.pager.directModelFilter=function(z,y,B){var C=[];var w=h.pager.computePageLimit(y);for(var A=y.pageIndex*y.pageSize;A<w;++A){var x=B?B[A]:A;C[C.length]={index:x,row:z[x]}}return C};function c(C,B){var A="";var x=0;while(true){var y=C.indexOf("${",x);if(y===-1){A+=C.substring(x);break}else{A+=C.substring(x,y);var w=C.indexOf("}",y+2);var z=C.substring(y+2,w);if(z==="VALUE"){z=B.EL}else{z=e(z,B.shortRoot,B.longRoot)}var D=h.get(B.dataModel,z);A+=D;x=w+1}}return A}function t(z,w,y){for(var x in w){var A=w[x];if(A===h.VALUE){if(x==="valuebinding"){z[x]=y.EL}else{z[x]={valuebinding:y.EL}}}else{if(x==="valuebinding"){z[x]=e(w[x],y)}else{if(typeof(A)==="object"){z[x]=A.length!==undefined?[]:{};t(z[x],A,y)}else{if(typeof(A)==="string"){z[x]=c(A,y)}else{z[x]=w[x]}}}}}return z}function o(y,C){var z=C.options;var B=y.valuebinding;var A=y.key;if(!B){h.fail("Error in definition for column with key "+A+": valuebinding is not set")}C.EL=e(B,C.shortRoot,C.longRoot);if(!A){var x=h.model.parseEL(B);A=x[x.length-1]}var w=(z.keyPrefix?z.keyPrefix:"")+A;return w}function l(x,y){var w=h.transform(y.columnDefs,function(A){var z=o(A,y);var B;if(!A.components){return{ID:z,valuebinding:y.EL}}else{if(typeof A.components==="function"){B=A.components(x.row,x.index)}else{B=A.components}}B=t({},B,y);B.ID=z;return B});return w}function v(w){return h.get(w.options.dataModel,w.options.dataOffset)}function p(w,y){var B=y.options.renderOptions.idMap["header:"+w];var z=h.jById(B);if(z.length===0){return null}var A=y.overallOptions.selectors.headerSortStylisticOffset;var x=h.findAncestor(z,function(C){return d(C).is(A)});return x}function m(y,x,w){x=d(x);x.removeClass(y.ascendingHeader);x.removeClass(y.descendingHeader);if(w!==0){x.addClass(w===1?y.ascendingHeader:y.descendingHeader);x.attr("aria-sort",w===1?"ascending":"descending")}}function s(y,x){var w=x.sortKey?h.pager.findColumnDef(y,x.sortKey):null;return w?w.sortable:false}function u(x,z){var y=z.overallOptions.styles;var w=s(z.columnDefs,x)?x.sortDir:0;m(y,p(x.sortKey,z),w)}function n(z,y,x){b(y);if(y.pageIndex>=y.pageCount){y.pageIndex=y.pageCount-1}if(x||y.pageIndex!==z.model.pageIndex||y.pageSize!==z.model.pageSize||y.sortKey!==z.model.sortKey||y.sortDir!==z.model.sortDir){var w=s(a(z),y)?z.options.sorter(z,y):null;z.permutation=w;z.events.onModelChange.fire(y,z.model,z);h.model.copyModel(z.model,y)}}function g(y,w,x){return function(){if(w.sortable===true){var z=y.model;var B=h.copy(z);var C=y.options.styles;var D=z.sortKey;if(w.key!==z.sortKey){B.sortKey=w.key;B.sortDir=1;var A=p(D,x);if(A){m(C,A,0)}}else{if(B.sortKey===w.key){B.sortDir=-1*B.sortDir}else{return false}}B.pageIndex=0;n(y,B,true);u(B,x)}return false}}function f(x,w){return x[w.sortable?"sortableHeader":"unsortableHeader"]}function i(z,x,A,y){var w=y.options.strings.sortableColumnText;if(x.sortDir===1){w=y.options.strings.sortableColumnTextAsc}else{if(x.sortDir===-1){w=y.options.strings.sortableColumnTextDesc}}return{children:h.transform(A,function(B){return{ID:o(B,y),value:B.label,decorators:[{jQuery:["click",g(z,B,y)]},{identify:"header:"+B.key},{type:"attrs",attributes:{title:(B.key===x.sortKey)?w:y.options.strings.sortableColumnText}}].concat(f(y.overallOptions.decorators,B))}})}}h.pager.selfRender=function(E,x){var z=h.initView("fluid.pager.selfRender",E.container,x);var F=z.options;F.renderOptions.idMap=F.renderOptions.idMap||{};var D=F.renderOptions.idMap;var A=z.locate("root");var C=h.selfRender(A,{},F.renderOptions);A.addClass(F.styles.root);var y=a(E);var w={options:F,columnDefs:y,overallOptions:E.options,dataModel:E.options.dataModel,idMap:D};var B=v(E);return{returnedOptions:{listeners:{onModelChange:function(I,K){var H=E.options.modelFilter(B,I,E.permutation);var G=h.transform(H,function(L){q(w,E,L.index);if(y==="explode"){return h.explode(L.row,w.longRoot)}else{if(y.length){return l(L,w)}}});var J={};J[F.row]=G;if(typeof(y)==="object"){J[F.header]=i(E,I,y,w)}F.renderOptions=F.renderOptions||{};F.renderOptions.model=w.dataModel;h.reRender(C,A,J,F.renderOptions);E.events.afterRender.fire(E);u(I,w)}}}}};h.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:{}});h.pager.summaryAria=function(w){w.attr({"aria-relevant":"all","aria-atomic":"false","aria-live":"assertive",role:"status"})};h.pager.summary=function(y,w){var x=y.locate("summary");h.pager.summaryAria(x);return{returnedOptions:{listeners:{onModelChange:function(z,B){var A=h.stringTemplate(w.message,{first:z.pageIndex*z.pageSize+1,last:h.pager.computePageLimit(z),total:z.totalRange,currentPage:z.pageIndex+1});if(x.length>0){x.text(A)}}}}}};h.pager.directPageSize=function(x){var w=x.locate("pageSize");if(w.length>0){x.events.onModelChange.addListener(function(y,z){if(w.val()!==y.pageSize){w.val(y.pageSize)}});w.change(function(){x.events.initiatePageSizeChange.fire(w.val())})}};h.pager.rangeAnnotator=function(y,x){var w={};y.events.onRenderPageLinks.addListener(function(z,C){var E=y.options.annotateColumnRange;var B=y.options.dataModel;var G=a(y);if(!E||!B||!G){return}var A=h.pager.findColumnDef(G,E);function F(H){H=y.permutation?y.permutation[H]:H;return h.pager.fetchValue(y,B,H,A.valuebinding,w)}var D={};h.model.copyModel(D,C);h.transform(z,function(H){if(H.ID==="page-link:link"){var M=H.pageIndex;var O=M*D.pageSize;D.pageIndex=M;var I=h.pager.computePageLimit(D);var N=F(O);var L=F(I-1);var K=h.copy(y.options.tooltip.options)||{};if(!K.content){K.content=function(){return h.stringTemplate(y.options.markup.rangeAnnotation,{first:N,last:L})}}if(!H.current){var J=[{type:"fluid",func:y.options.tooltip.type,options:K},{identify:M}];H.decorators=H.decorators.concat(J)}}})})};h.pagerImpl=function(w,x){var z=h.initView("fluid.pager",w,x);z.container.attr("role","application");z.events.initiatePageChange.addListener(function(C){var D=h.copy(z.model);if(C.relativePage!==undefined){D.pageIndex=z.model.pageIndex+C.relativePage}else{D.pageIndex=C.pageIndex}if(D.pageIndex===undefined||D.pageIndex<0){D.pageIndex=0}n(z,D,C.forceUpdate)});z.events.initiatePageSizeChange.addListener(function(C){var D=h.copy(z.model);D.pageSize=C;n(z,D)});var A=z.locate("pagerBar");if(A.length>0){z.pagerBar=h.initSubcomponent(z,"pagerBar",[z.events,A,h.COMPONENT_OPTIONS,z.options.strings])}var B=z.locate("pagerBarSecondary");if(B.length>0){z.pagerBarSecondary=h.initSubcomponent(z,"pagerBar",[z.events,B,h.COMPONENT_OPTIONS,z.options.strings])}z.bodyRenderer=h.initSubcomponent(z,"bodyRenderer",[z,h.COMPONENT_OPTIONS]);z.summary=h.initSubcomponent(z,"summary",[z.dom,h.COMPONENT_OPTIONS]);z.pageSize=h.initSubcomponent(z,"pageSize",[z]);z.rangeAnnotator=h.initSubcomponent(z,"rangeAnnotator",[z,h.COMPONENT_OPTIONS]);z.model=h.copy(z.options.model);var y=v(z);if(y){z.model.totalRange=y.length}if(z.model.totalRange===undefined){if(!z.pagerBar){h.fail("Error in Pager configuration - cannot determine total range,  since not configured in model.totalRange and no PagerBar is configured")}z.model=z.pagerBar.pageList.defaultModel}z.applier=h.makeChangeApplier(z.model);z.events.initiatePageChange.fire({pageIndex:z.model.pageIndex?z.model.pageIndex:0,forceUpdate:true});return z};h.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:h.pager.directModelFilter,sorter:h.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:"<b> %first </b><br/>&mdash;<br/><b> %last </b>"}})
  })(jQuery,fluid_1_4);