/*!
 * FSI Pages mobile
 * Copyright (C)2000-2013 NeptuneLabs GmbH - All rights reserved.
 *
 * sales@neptunelabs.com
 * http://www.fsi-viewer.com
 *
 * VERSION: 1.1.5
 * 
 * IMPORTANT NOTE
 * ------------------------------------------------------
 * Usage limited to the terms of the NeptuneLabs Software 
 * END-USER LICENSE AGREEMENT.
 * ------------------------------------------------------
 *
 */
Ext={platformVersion:"0.1",platformVersionDetail:{major:0,minor:1,patch:0}};Ext.apply=function(b,a,d){if(d){Ext.apply(b,d)}if(b&&a&&typeof a=="object"){for(var c in a){b[c]=a[c]}}return b};Ext.apply(Ext,{userAgent:navigator.userAgent.toLowerCase(),cache:{},idSeed:1000,BLANK_IMAGE_URL:"data:image/gif;base64,R0lGODlhAQABAID/AMDAwAAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==",isStrict:document.compatMode=="CSS1Compat",emptyFn:function(){},isSecure:/^https/i.test(window.location.protocol),isReady:false,enableGarbageCollector:false,enableListenerCollection:true,applyIf:function(b,a){var c,d;if(b){for(c in a){if(b[c]===d){b[c]=a[c]}}}return b},repaint:function(){var a=Ext.getBody().createChild({cls:"x-mask x-mask-transparent"});setTimeout(function(){a.remove()},0)},id:function(a,b){return(a=Ext.getDom(a)||{}).id=a.id||(b||"ext-gen")+(++Ext.idSeed)},extend:function(){var b=function(d){for(var c in d){if(!d.hasOwnProperty(c)){continue}this[c]=d[c]}};var a=Object.prototype.constructor;return function(c,h,f){if(Ext.isObject(h)){f=h;h=c;c=f.constructor!=a?f.constructor:function(){h.apply(this,arguments)}}var e=function(){},d,g=h.prototype;e.prototype=g;d=c.prototype=new e();d.constructor=c;c.superclass=g;if(g.constructor==a){g.constructor=h}c.override=function(j){Ext.override(c,j)};d.superclass=d.supr=(function(){return g});d.override=b;d.proto=d;c.override(f);c.extend=function(j){return Ext.extend(c,j)};return c}}(),override:function(a,b){if(b){Ext.apply(a.prototype,b)}},namespace:function(){var e=arguments.length,d,f,c,a,h,g,b;for(d=0;d<e;d++){f=arguments[d];g=f.split(".");b=window[g[0]]=Object(window[g[0]]);for(a=1,h=g.length;a<h;a++){b=b[g[a]]=Object(b[g[a]])}}return b},urlEncode:function(f,d){var b,a=[],c=encodeURIComponent;Ext.iterate(f,function(e,g){b=Ext.isEmpty(g);Ext.each(b?e:g,function(h){a.push("&",c(e),"=",(!Ext.isEmpty(h)&&(h!=e||!b))?(Ext.isDate(h)?Ext.encode(h).replace(/"/g,""):c(h)):"")})});if(!d){a.shift();d=""}return d+a.join("")},urlDecode:function(c,b){if(Ext.isEmpty(c)){return{}}var g={},f=c.split("&"),h=decodeURIComponent,a,e;Ext.each(f,function(d){d=d.split("=");a=h(d[0]);e=h(d[1]);g[a]=b||!g[a]?e:[].concat(g[a]).concat(e)});return g},htmlEncode:function(a){return Ext.util.Format.htmlEncode(a)},htmlDecode:function(a){return Ext.util.Format.htmlDecode(a)},urlAppend:function(a,b){if(!Ext.isEmpty(b)){return a+(a.indexOf("?")===-1?"?":"&")+b}return a},toArray:function(c,b,a){return Array.prototype.slice.call(c,b||0,a||c.length)},each:function(e,d,c){if(Ext.isEmpty(e,true)){return 0}if(!Ext.isIterable(e)||Ext.isPrimitive(e)){e=[e]}for(var b=0,a=e.length;b<a;b++){if(d.call(c||e[b],e[b],b,e)===false){return b}}return true},iterate:function(c,b,a){if(Ext.isEmpty(c)){return}if(Ext.isIterable(c)){Ext.each(c,b,a);return}else{if(Ext.isObject(c)){for(var d in c){if(c.hasOwnProperty(d)){if(b.call(a||c,d,c[d],c)===false){return}}}}}},pluck:function(a,c){var b=[];Ext.each(a,function(d){b.push(d[c])});return b},getBody:function(){return Ext.get(document.body||false)},getHead:function(){var a;return function(){if(a==undefined){a=Ext.get(DOC.getElementsByTagName("head")[0])}return a}}(),getDoc:function(){return Ext.get(document)},getCmp:function(a){return Ext.ComponentMgr.get(a)},getOrientation:function(){return window.innerHeight>window.innerWidth?"portrait":"landscape"},isIterable:function(a){if(Ext.isArray(a)||a.callee){return true}if(/NodeList|HTMLCollection/.test(Object.prototype.toString.call(a))){return true}return((typeof a.nextNode!="undefined"||a.item)&&Ext.isNumber(a.length))},num:function(b,a){b=Number(Ext.isEmpty(b)||Ext.isArray(b)||typeof b=="boolean"||(typeof b=="string"&&b.trim().length==0)?NaN:b);return isNaN(b)?a:b},isEmpty:function(d,a){var b=d==null,c=(Ext.isArray(d)&&!d.length),e=!a?d==="":false;return b||c||e},isArray:function(a){return Object.prototype.toString.apply(a)==="[object Array]"},isDate:function(a){return Object.prototype.toString.apply(a)==="[object Date]"},isObject:function(a){return !!a&&Object.prototype.toString.call(a)==="[object Object]"},isPrimitive:function(a){return Ext.isString(a)||Ext.isNumber(a)||Ext.isBoolean(a)},isFunction:function(a){return Object.prototype.toString.apply(a)==="[object Function]"},isNumber:function(a){return Object.prototype.toString.apply(a)==="[object Number]"&&isFinite(a)},isString:function(a){return typeof a==="string"},isBoolean:function(a){return Object.prototype.toString.apply(a)==="[object Boolean]"},isElement:function(a){return a?!!a.tagName:false},isDefined:function(a){return typeof a!=="undefined"},escapeRe:function(a){return a.replace(/([-.*+?^${}()|[\]\/\\])/g,"\\$1")},destroy:function(){var c=arguments.length,b,a;for(b=0;b<c;b++){a=arguments[b];if(a){if(Ext.isArray(a)){this.destroy.apply(this,a)}else{if(Ext.isFunction(a.destroy)){a.destroy()}else{if(a.dom){a.remove()}}}}}}});Ext.SSL_SECURE_URL=Ext.isSecure&&"about:blank";Ext.ns=Ext.namespace;Ext.ns("Ext.util","Ext.data","Ext.list","Ext.form","Ext.menu","Ext.state","Ext.layout","Ext.app","Ext.ux","Ext.plugins","Ext.direct","Ext.lib");Ext.util.Observable=Ext.extend(Object,{isObservable:true,constructor:function(a){var b=this;Ext.apply(b,a);if(b.listeners){b.on(b.listeners);delete b.listeners}b.events=b.events||{};if(this.bubbleEvents){this.enableBubble(this.bubbleEvents)}},eventOptionsRe:/^(?:scope|delay|buffer|single|stopEvent|preventDefault|stopPropagation|normalized|args|delegate|element|vertical|horizontal)$/,addManagedListener:function(f,c,e,d,b){var a=this.managedListeners=this.managedListeners||[];if(Ext.isObject(c)){b=c;for(c in b){if(!b.hasOwnProperty(c)){continue}if(this.eventOptionsRe.test(c)){continue}a.push({item:f,ename:c,fn:b[c],scope:b.scope});if(typeof b[c]=="function"){f.on(c,b[c],b.scope,b)}else{f.on(c,b[c])}}return}a.push({item:f,ename:c,fn:e,scope:d,options:b});f.on(c,e,d,b)},removeManagedListener:function(j,b,g,k){if(Ext.isObject(b)){for(var d in b){if(!b.hasOwnProperty(d)){continue}if(this.eventOptionsRe.test(d)){continue}if(typeof b[d]=="function"){this.removeManagedListener(j,d,b[d],b.scope)}else{this.removeManagedListener(j,d,b[d].fn,b[d].scope)}}return}var h=this.managedListeners?this.managedListeners.slice():[],f=h.length,c,a;for(c=0;c<f;c++){a=h[c];if(a.item===j&&a.ename===b&&(!g||a.fn===g)&&(!k||a.scope===k)){this.managedListeners.remove(a);j.un(a.ename,a.fn,a.scope)}}},fireEvent:function(){var h=this,c=Ext.toArray(arguments),e=c[0].toLowerCase(),d=true,g=h.events[e],b=h.eventQueue,f;if(h.eventsSuspended===true){if(b){b.push(c)}return false}else{if(g&&Ext.isObject(g)&&g.bubble){if(g.fire.apply(g,c.slice(1))===false){return false}f=h.getBubbleTarget&&h.getBubbleTarget();if(f&&f.isObservable){if(!f.events[e]||!Ext.isObject(f.events[e])||!f.events[e].bubble){f.enableBubble(e)}return f.fireEvent.apply(f,c)}}else{if(g&&Ext.isObject(g)){c.shift();d=g.fire.apply(g,c)}}}return d},addListener:function(b,d,c,g){var f=this,a,e;if(Ext.isObject(b)){g=b;for(b in g){if(!g.hasOwnProperty(b)){continue}a=g[b];if(!f.eventOptionsRe.test(b)){f.addListener(b,a.fn||a,a.scope||g.scope,a.fn?a:g)}}}else{b=b.toLowerCase();f.events[b]=f.events[b]||true;e=f.events[b]||true;if(Ext.isBoolean(e)){f.events[b]=e=new Ext.util.Event(f,b)}e.addListener(d,c,Ext.isObject(g)?g:{})}},removeListener:function(b,d,c){var f=this,a,e;if(Ext.isObject(b)){var g=b;for(b in g){if(!g.hasOwnProperty(b)){continue}a=g[b];if(!f.eventOptionsRe.test(b)){f.removeListener(b,a.fn||a,a.scope||g.scope)}}}else{b=b.toLowerCase();e=f.events[b];if(e.isEvent){e.removeListener(d,c)}}},purgeListeners:function(){var b=this.events,c,a;for(a in b){if(!b.hasOwnProperty(a)){continue}c=b[a];if(c.isEvent){c.clearListeners()}}this.purgeManagedListeners()},purgeManagedListeners:function(){var b=this.managedListeners||[],d=b.length,c,a;for(c=0;c<d;c++){a=b[c];a.item.un(a.ename,a.fn,a.scope)}this.managedListener=[]},addEvents:function(e){var d=this;d.events=d.events||{};if(Ext.isString(e)){var b=arguments,c=b.length;while(c--){d.events[b[c]]=d.events[b[c]]||true}}else{Ext.applyIf(d.events,e)}},hasListener:function(a){var b=this.events[a];return b.isEvent===true&&b.listeners.length>0},suspendEvents:function(a){this.eventsSuspended=true;if(a&&!this.eventQueue){this.eventQueue=[]}},resumeEvents:function(){var a=this,b=a.eventQueue||[];a.eventsSuspended=false;delete a.eventQueue;Ext.each(b,function(c){a.fireEvent.apply(a,c)})},relayEvents:function(b,e,h){h=h||"";var g=this,a=e.length,d,c;function f(j){return function(){return g.fireEvent.apply(g,[h+j].concat(Array.prototype.slice.call(arguments,0)))}}for(d=0,a=e.length;d<a;d++){c=e[d].substr(h.length);g.events[c]=g.events[c]||true;b.on(c,f(c),g)}},enableBubble:function(a){var b=this;if(!Ext.isEmpty(a)){a=Ext.isArray(a)?a:Ext.toArray(arguments);Ext.each(a,function(c){c=c.toLowerCase();var d=b.events[c]||true;if(Ext.isBoolean(d)){d=new Ext.util.Event(b,c);b.events[c]=d}d.bubble=true})}}});Ext.override(Ext.util.Observable,{on:Ext.util.Observable.prototype.addListener,un:Ext.util.Observable.prototype.removeListener,mon:Ext.util.Observable.prototype.addManagedListener,mun:Ext.util.Observable.prototype.removeManagedListener});Ext.util.Observable.releaseCapture=function(a){a.fireEvent=Ext.util.Observable.prototype.fireEvent};Ext.util.Observable.capture=function(c,b,a){c.fireEvent=c.fireEvent.createInterceptor(b,a)};Ext.util.Observable.observe=function(a,b){if(a){if(!a.isObservable){Ext.applyIf(a,new Ext.util.Observable());Ext.util.Observable.capture(a.prototype,a.fireEvent,a)}if(typeof b=="object"){a.on(b)}return a}};Ext.util.Event=Ext.extend(Object,(function(){function b(e,f,g,d){f.task=new Ext.util.DelayedTask();return function(){f.task.delay(g.buffer,e,d,Ext.toArray(arguments))}}function a(e,f,g,d){return function(){var h=new Ext.util.DelayedTask();if(!f.tasks){f.tasks=[]}f.tasks.push(h);h.delay(g.delay||10,e,d,Ext.toArray(arguments))}}function c(e,f,g,d){return function(){f.ev.removeListener(f.fn,d);return e.apply(d,arguments)}}return{isEvent:true,constructor:function(e,d){this.name=d;this.observable=e;this.listeners=[]},addListener:function(f,e,d){var g=this,h;e=e||g.observable;if(!g.isListening(f,e)){h=g.createListener(f,e,d);if(g.firing){g.listeners=g.listeners.slice(0)}g.listeners.push(h)}},createListener:function(f,e,h){h=h||{};e=e||this.observable;var g={fn:f,scope:e,o:h,ev:this},d=f;if(h.delay){d=a(d,g,h,e)}if(h.buffer){d=b(d,g,h,e)}if(h.single){d=c(d,g,h,e)}g.fireFn=d;return g},findListener:function(h,g){var f=this.listeners,d=f.length,j,e;while(d--){j=f[d];if(j){e=j.scope;if(j.fn==h&&(e==g||e==this.observable)){return d}}}return -1},isListening:function(e,d){return this.findListener(e,d)!==-1},removeListener:function(g,f){var h=this,e,j,d;if((e=h.findListener(g,f))!=-1){j=h.listeners[e];if(h.firing){h.listeners=h.listeners.slice(0)}if(j.task){j.task.cancel();delete j.task}d=j.tasks&&j.tasks.length;if(d){while(d--){j.tasks[d].cancel()}delete j.tasks}h.listeners.splice(e,1);return true}return false},clearListeners:function(){var e=this.listeners,d=e.length;while(d--){this.removeListener(e[d].fn,e[d].scope)}},fire:function(){var h=this,f=h.listeners,g=f.length,e,d,j;if(g>0){h.firing=true;for(e=0;e<g;e++){j=f[e];d=arguments.length?Array.prototype.slice.call(arguments,0):[];if(j.o){d.push(j.o)}if(j&&j.fireFn.apply(j.scope||h.observable,d)===false){return(h.firing=false)}}}h.firing=false;return true}}})());Ext.util.Stateful=Ext.extend(Ext.util.Observable,{editing:false,dirty:false,persistanceProperty:"data",constructor:function(a){Ext.applyIf(this,{data:{}});this.modified={};this[this.persistanceProperty]={};Ext.util.Stateful.superclass.constructor.call(this,a)},get:function(a){return this[this.persistanceProperty][a]},set:function(e,c){var a=this.fields,d,b;if(arguments.length==1&&Ext.isObject(e)){for(b in e){if(!e.hasOwnProperty(b)){continue}this.set(b,e[b])}}else{if(a){d=a.get(e);if(d&&d.convert){c=d.convert(c,this)}}this[this.persistanceProperty][e]=c;this.dirty=true;if(!this.editing){this.afterEdit()}}},getChanges:function(){var a=this.modified,b={},c;for(c in a){if(a.hasOwnProperty(c)){b[c]=this[this.persistanceProperty][c]}}return b},isModified:function(a){return !!(this.modified&&this.modified.hasOwnProperty(a))},markDirty:function(){this.dirty=true;if(!this.modified){this.modified={}}this.fields.each(function(a){this.modified[a.name]=this[this.persistanceProperty][a.name]},this)},reject:function(a){var b=this.modified,c;for(c in b){if(!b.hasOwnProperty(c)){continue}if(typeof b[c]!="function"){this[this.persistanceProperty][c]=b[c]}}this.dirty=false;this.editing=false;delete this.modified;if(a!==true){this.afterReject()}},commit:function(a){this.dirty=false;this.editing=false;delete this.modified;if(a!==true){this.afterCommit()}},copy:function(a){return new this.constructor(Ext.apply({},this[this.persistanceProperty]),a||this.internalId)}});Ext.util.MixedCollection=function(b,a){this.items=[];this.map={};this.keys=[];this.length=0;this.addEvents("clear","add","replace","remove","sort");this.allowFunctions=b===true;if(a){this.getKey=a}Ext.util.MixedCollection.superclass.constructor.call(this)};Ext.extend(Ext.util.MixedCollection,Ext.util.Observable,{allowFunctions:false,add:function(b,c){if(arguments.length==1){c=arguments[0];b=this.getKey(c)}if(typeof b!="undefined"&&b!==null){var a=this.map[b];if(typeof a!="undefined"){return this.replace(b,c)}this.map[b]=c}this.length++;this.items.push(c);this.keys.push(b);this.fireEvent("add",this.length-1,c,b);return c},getKey:function(a){return a.id},replace:function(c,d){if(arguments.length==1){d=arguments[0];c=this.getKey(d)}var a=this.map[c];if(typeof c=="undefined"||c===null||typeof a=="undefined"){return this.add(c,d)}var b=this.indexOfKey(c);this.items[b]=d;this.map[c]=d;this.fireEvent("replace",c,a,d);return d},addAll:function(e){if(arguments.length>1||Ext.isArray(e)){var b=arguments.length>1?arguments:e;for(var d=0,a=b.length;d<a;d++){this.add(b[d])}}else{for(var c in e){if(!e.hasOwnProperty(c)){continue}if(this.allowFunctions||typeof e[c]!="function"){this.add(c,e[c])}}}},each:function(e,d){var b=[].concat(this.items);for(var c=0,a=b.length;c<a;c++){if(e.call(d||b[c],b[c],c,a)===false){break}}},eachKey:function(d,c){for(var b=0,a=this.keys.length;b<a;b++){d.call(c||window,this.keys[b],this.items[b],b,a)}},find:function(d,c){for(var b=0,a=this.items.length;b<a;b++){if(d.call(c||window,this.items[b],this.keys[b])){return this.items[b]}}return null},insert:function(a,b,c){if(arguments.length==2){c=arguments[1];b=this.getKey(c)}if(this.containsKey(b)){this.suspendEvents();this.removeKey(b);this.resumeEvents()}if(a>=this.length){return this.add(b,c)}this.length++;this.items.splice(a,0,c);if(typeof b!="undefined"&&b!==null){this.map[b]=c}this.keys.splice(a,0,b);this.fireEvent("add",a,c,b);return c},remove:function(a){return this.removeAt(this.indexOf(a))},removeAt:function(a){if(a<this.length&&a>=0){this.length--;var c=this.items[a];this.items.splice(a,1);var b=this.keys[a];if(typeof b!="undefined"){delete this.map[b]}this.keys.splice(a,1);this.fireEvent("remove",c,b);return c}return false},removeKey:function(a){return this.removeAt(this.indexOfKey(a))},getCount:function(){return this.length},indexOf:function(a){return this.items.indexOf(a)},indexOfKey:function(a){return this.keys.indexOf(a)},item:function(b){var a=this.map[b],c=a!==undefined?a:(typeof b=="number")?this.items[b]:undefined;return typeof c!="function"||this.allowFunctions?c:null},itemAt:function(a){return this.items[a]},key:function(a){return this.map[a]},contains:function(a){return this.indexOf(a)!=-1},containsKey:function(a){return typeof this.map[a]!="undefined"},clear:function(){this.length=0;this.items=[];this.keys=[];this.map={};this.fireEvent("clear")},first:function(){return this.items[0]},last:function(){return this.items[this.length-1]},_sort:function(j,a,h){var d,e,b=String(a).toUpperCase()=="DESC"?-1:1,g=[],k=this.keys,f=this.items;h=h||function(l,c){return l-c};for(d=0,e=f.length;d<e;d++){g[g.length]={key:k[d],value:f[d],index:d}}g.sort(function(l,c){var m=h(l[j],c[j])*b;if(m===0){m=(l.index<c.index?-1:1)}return m});for(d=0,e=g.length;d<e;d++){f[d]=g[d].value;k[d]=g[d].key}this.fireEvent("sort",this)},sort:function(c,e){var d=c;if(Ext.isString(c)){d=[new Ext.util.Sorter({property:c,direction:e||"ASC"})]}else{if(c instanceof Ext.util.Sorter){d=[c]}else{if(Ext.isObject(c)){d=[new Ext.util.Sorter(c)]}}}var b=d.length;if(b==0){return}var a=function(h,g){var f=d[0].sort(h,g),k=d.length,j;for(j=1;j<k;j++){f=f||d[j].sort.call(this,h,g)}return f};this.sortBy(a)},sortBy:function(c){var b=this.items,f=this.keys,e=b.length,a=[],d;for(d=0;d<e;d++){a[d]={key:f[d],value:b[d],index:d}}a.sort(function(h,g){var j=c(h.value,g.value);if(j===0){j=(h.index<g.index?-1:1)}return j});for(d=0;d<e;d++){b[d]=a[d].value;f[d]=a[d].key}this.fireEvent("sort",this)},reorder:function(d){this.suspendEvents();var b=this.items,c=0,f=b.length,a=[],e=[],g;for(g in d){a[d[g]]=b[g]}for(c=0;c<f;c++){if(d[c]==undefined){e.push(b[c])}}for(c=0;c<f;c++){if(a[c]==undefined){a[c]=e.shift()}}this.clear();this.addAll(a);this.resumeEvents();this.fireEvent("sort",this)},keySort:function(a,b){this._sort("key",a,b||function(d,c){var f=String(d).toUpperCase(),e=String(c).toUpperCase();return f>e?1:(f<e?-1:0)})},getRange:function(e,a){var b=this.items;if(b.length<1){return[]}e=e||0;a=Math.min(typeof a=="undefined"?this.length-1:a,this.length-1);var c,d=[];if(e<=a){for(c=e;c<=a;c++){d[d.length]=b[c]}}else{for(c=e;c>=a;c--){d[d.length]=b[c]}}return d},filter:function(d,c,f,a){var b=[];if(Ext.isString(d)){b.push(new Ext.util.Filter({property:d,value:c,anyMatch:f,caseSensitive:a}))}else{if(Ext.isArray(d)||d instanceof Ext.util.Filter){b=b.concat(d)}}var e=function(g){var m=true,n=b.length,h;for(h=0;h<n;h++){var l=b[h],k=l.filter,j=l.scope;m=m&&k.call(j,g)}return m};return this.filterBy(e)},filterBy:function(e,d){var a=new Ext.util.MixedCollection(),g=this.keys,b=this.items,f=b.length,c;a.getKey=this.getKey;for(c=0;c<f;c++){if(e.call(d||this,b[c],g[c])){a.add(g[c],b[c])}}return a},findIndex:function(c,b,e,d,a){if(Ext.isEmpty(b,false)){return -1}b=this.createValueMatcher(b,d,a);return this.findIndexBy(function(f){return f&&b.test(f[c])},null,e)},findIndexBy:function(f,e,g){var b=this.keys,d=this.items;for(var c=(g||0),a=d.length;c<a;c++){if(f.call(e||this,d[c],b[c])){return c}}return -1},createValueMatcher:function(c,e,a,b){if(!c.exec){var d=Ext.escapeRe;c=String(c);if(e===true){c=d(c)}else{c="^"+d(c);if(b===true){c+="$"}}c=new RegExp(c,a?"":"i")}return c},clone:function(){var e=new Ext.util.MixedCollection();var b=this.keys,d=this.items;for(var c=0,a=d.length;c<a;c++){e.add(b[c],d[c])}e.getKey=this.getKey;return e}});Ext.util.MixedCollection.prototype.get=Ext.util.MixedCollection.prototype.item;Ext.AbstractManager=Ext.extend(Object,{typeName:"type",constructor:function(a){Ext.apply(this,a||{});this.all=new Ext.util.MixedCollection();this.types={}},get:function(a){return this.all.get(a)},register:function(a){this.all.add(a)},unregister:function(a){this.all.remove(a)},registerType:function(b,a){this.types[b]=a;a[this.typeName]=b},isRegistered:function(a){return this.types[a]!==undefined},create:function(a,d){var b=a[this.typeName]||a.type||d,c=this.types[b];if(c==undefined){throw new Error(String.format("The '{0}' type has not been registered with this manager",b))}return new c(a)},onAvailable:function(d,c,b){var a=this.all;a.on("add",function(e,f){if(f.id==d){c.call(b||f,f);a.un("add",c,b)}})}});Ext.util.DelayedTask=function(d,c,a){var e=this,f,b=function(){clearInterval(f);f=null;d.apply(c,a||[])};this.delay=function(h,k,j,g){e.cancel();d=k||d;c=j||c;a=g||a;f=setInterval(b,h)};this.cancel=function(){if(f){clearInterval(f);f=null}}};Ext.util.GeoLocation=Ext.extend(Ext.util.Observable,{hasGeoLocation:false,autoUpdate:true,latitude:null,longitude:null,accuracy:null,altitude:null,altitudeAccuracy:null,heading:null,speed:null,timestamp:null,enableHighAccuracy:false,timeout:Infinity,maximumAge:0,setMaximumAge:function(a){this.maximumAge=a;this.setAutoUpdate(this.autoUpdate)},setTimeout:function(a){this.timeout=a;this.setAutoUpdate(this.autoUpdate)},setEnableHighAccuracy:function(a){this.enableHighAccuracy=a;this.setAutoUpdate(this.autoUpdate)},factory:null,watchOperation:null,constructor:function(a){a=a||{};Ext.apply(this,a);this.coords=this;if(typeof navigator!="undefined"&&typeof navigator.geolocation!="undefined"){this.factory=navigator.geolocation}else{if(typeof google!="undefined"&&typeof google.gears!="undefined"){try{this.factory=google.gears.factory.create("beta.geolocation")}catch(c){}}}this.hasGeoLocation=this.factory!==null;this.addEvents("update","locationerror","locationupdate");Ext.util.GeoLocation.superclass.constructor.call(this);if(this.autoUpdate){var b=this;setTimeout(function(){b.setAutoUpdate(b.autoUpdate)},0)}},setAutoUpdate:function(a){if(this.watchOperation!==null){this.factory.clearWatch(this.watchOperation);this.watchOperation=null}if(!a){return true}if(!this.hasGeoLocation){this.fireEvent("locationerror",this,false,false,true,null);return false}try{this.watchOperation=this.factory.watchPosition(this.fireUpdate.createDelegate(this),this.fireError.createDelegate(this),this.parseOptions())}catch(b){this.autoUpdate=false;this.fireEvent("locationerror",this,false,false,true,b.message);return false}return true},updateLocation:function(g,a,c){var b=this;var f=function(h,e){if(e){b.fireError(e)}else{b.fireEvent("locationerror",b,false,false,true,h)}if(g){g.call(a||b,null,b)}b.fireEvent("update",false,b)};if(!this.hasGeoLocation){setTimeout(function(){f(null)},0);return}try{this.factory.getCurrentPosition(function(e){b.fireUpdate(e);if(g){g.call(a||b,b,b)}b.fireEvent("update",b,b)},function(e){f(null,e)},c?c:this.parseOptions())}catch(d){setTimeout(function(){f(d.message)},0)}},fireUpdate:function(a){this.timestamp=a.timestamp;this.latitude=a.coords.latitude;this.longitude=a.coords.longitude;this.accuracy=a.coords.accuracy;this.altitude=a.coords.altitude;this.altitudeAccuracy=a.coords.altitudeAccuracy;this.heading=typeof a.coords.heading=="undefined"?null:a.coords.heading;this.speed=typeof a.coords.speed=="undefined"?null:a.coords.speed;this.fireEvent("locationupdate",this)},fireError:function(a){this.fireEvent("locationerror",this,a.code==a.TIMEOUT,a.code==a.PERMISSION_DENIED,a.code==a.POSITION_UNAVAILABLE,a.message==undefined?null:a.message)},parseOptions:function(){var a={maximumAge:this.maximumAge,enableHighAccuracy:this.enableHighAccuracy};if(this.timeout!==Infinity){a.timeout=this.timeout}return a},getLocation:function(c,a){var b=this;if(this.latitude!==null){c.call(a||b,b,b)}else{b.updateLocation(c,a)}}});Ext.util.Region=Ext.extend(Object,{constructor:function(d,f,a,c){var e=this;e.top=d;e[1]=d;e.right=f;e.bottom=a;e.left=c;e[0]=c},contains:function(b){var a=this;return(b.left>=a.left&&b.right<=a.right&&b.top>=a.top&&b.bottom<=a.bottom)},intersect:function(g){var f=this,d=Math.max(f.top,g.top),e=Math.min(f.right,g.right),a=Math.min(f.bottom,g.bottom),c=Math.max(f.left,g.left);if(a>=d&&e>=c){return new Ext.util.Region(d,e,a,c)}else{return false}},union:function(g){var f=this,d=Math.min(f.top,g.top),e=Math.max(f.right,g.right),a=Math.max(f.bottom,g.bottom),c=Math.min(f.left,g.left);return new Ext.util.Region(d,e,a,c)},constrainTo:function(b){var a=this;a.top=a.top.constrain(b.top,b.bottom);a.bottom=a.bottom.constrain(b.top,b.bottom);a.left=a.left.constrain(b.left,b.right);a.right=a.right.constrain(b.left,b.right);return a},adjust:function(d,f,a,c){var e=this;e.top+=d;e.left+=c;e.right+=f;e.bottom+=a;return e}});Ext.util.Region.getRegion=function(a){return Ext.fly(a).getPageBox(true)};Ext.Template=function(d){var e=this,b=arguments,c=[];if(Ext.isArray(d)){d=d.join("")}else{if(b.length>1){Ext.each(b,function(a){if(Ext.isObject(a)){Ext.apply(e,a)}else{c.push(a)}});d=c.join("")}}e.html=d;if(e.compiled){e.compile()}};Ext.Template.prototype={isTemplate:true,re:/\{([\w\-]+)(?:\:([\w\.]*)(?:\((.*?)?\))?)?\}/g,argsRe:/^\s*['"](.*)["']\s*$/,compileARe:/\\/g,compileBRe:/(\r\n|\n)/g,compileCRe:/'/g,disableFormats:false,applyTemplate:function(h){var e=this,a=e.disableFormats!==true,g=Ext.util.Format,c=e,j,b,d;if(e.compiled){return e.compiled(h)}function f(k,n,p,l){if(p&&a){if(p.substr(0,5)=="this."){return c.call(p.substr(5),h[n],h)}else{if(l){j=e.argsRe;l=l.split(",");for(b=0,d=l.length;b<d;b++){l[b]=l[b].replace(j,"$1")}l=[h[n]].concat(l)}else{l=[h[n]]}return g[p].apply(g,l)}}else{return h[n]!==undefined?h[n]:""}}return e.html.replace(e.re,f)},set:function(a,c){var b=this;b.html=a;b.compiled=null;return c?b.compile():b},compile:function(){var me=this,fm=Ext.util.Format,useF=me.disableFormats!==true,body;function fn(m,name,format,args){if(format&&useF){args=args?","+args:"";if(format.substr(0,5)!="this."){format="fm."+format+"("}else{format='this.call("'+format.substr(5)+'", ';args=", values"}}else{args="";format="(values['"+name+"'] == undefined ? '' : "}return"',"+format+"values['"+name+"']"+args+") ,'"}if(Ext.isGecko){body="this.compiled = function(values){ return '"+me.html.replace(me.compileARe,"\\\\").replace(me.compileBRe,"\\n").replace(me.compileCRe,"\\'").replace(me.re,fn)+"';};"}else{body=["this.compiled = function(values){ return ['"];body.push(me.html.replace(me.compileARe,"\\\\").replace(me.compileBRe,"\\n").replace(me.compileCRe,"\\'").replace(me.re,fn));body.push("'].join('');};");body=body.join("")}eval(body);return me},insertFirst:function(b,a,c){return this.doInsert("afterBegin",b,a,c)},insertBefore:function(b,a,c){return this.doInsert("beforeBegin",b,a,c)},insertAfter:function(b,a,c){return this.doInsert("afterEnd",b,a,c)},append:function(b,a,c){return this.doInsert("beforeEnd",b,a,c)},doInsert:function(c,e,b,a){e=Ext.getDom(e);var d=Ext.DomHelper.insertHtml(c,e,this.applyTemplate(b));return a?Ext.get(d,true):d},overwrite:function(b,a,c){b=Ext.getDom(b);b.innerHTML=this.applyTemplate(a);return c?Ext.get(b.firstChild,true):b.firstChild},call:function(c,b,a){return this[c](b,a)}};Ext.Template.prototype.apply=Ext.Template.prototype.applyTemplate;Ext.Template.from=function(b,a){b=Ext.getDom(b);return new Ext.Template(b.value||b.innerHTML,a||"")};Ext.XTemplate=function(){Ext.XTemplate.superclass.constructor.apply(this,arguments);var B=this,h=B.html,q=/<tpl\b[^>]*>((?:(?=([^<]+))\2|<(?!tpl\b[^>]*>))*?)<\/tpl>/,d=/^<tpl\b[^>]*?for="(.*?)"/,w=/^<tpl\b[^>]*?if="(.*?)"/,A=/^<tpl\b[^>]*?exec="(.*?)"/,r,p=0,j=[],n="values",z="parent",k="xindex",l="xcount",e="return ",c="with(values){ ";h=["<tpl>",h,"</tpl>"].join("");while((r=h.match(q))){var b=r[0].match(d),a=r[0].match(w),D=r[0].match(A),f=null,g=null,u=null,C=b&&b[1]?b[1]:"",v;if(a){f=a&&a[1]?a[1]:null;if(f){g=new Function(n,z,k,l,c+"try{"+e+(Ext.util.Format.htmlDecode(f))+";}catch(e){return;}}")}}if(D){f=D&&D[1]?D[1]:null;if(f){u=new Function(n,z,k,l,c+(Ext.util.Format.htmlDecode(f))+"; }")}}if(C){switch(C){case".":C=new Function(n,z,c+e+n+"; }");break;case"..":C=new Function(n,z,c+e+z+"; }");break;default:C=new Function(n,z,c+e+C+"; }")}}j.push({id:p,target:C,exec:u,test:g,body:r[1]||""});h=h.replace(r[0],"{xtpl"+p+"}");++p}for(v=j.length-1;v>=0;--v){B.compileTpl(j[v])}B.master=j[j.length-1];B.tpls=j};Ext.extend(Ext.XTemplate,Ext.Template,{re:/\{([\w\-\.\#]+)(?:\:([\w\.]*)(?:\((.*?)?\))?)?(\s?[\+\-\*\\]\s?[\d\.\+\-\*\\\(\)]+)?\}/g,codeRe:/\{\[((?:\\\]|.|\n)*?)\]\}/g,applySubTemplate:function(a,j,h,d,c){var g=this,f,l=g.tpls[a],k,b=[],e;if((l.test&&!l.test.call(g,j,h,d,c))||(l.exec&&l.exec.call(g,j,h,d,c))){return""}k=l.target?l.target.call(g,j,h):j;f=k.length;h=l.target?j:h;if(l.target&&Ext.isArray(k)){for(e=0,f=k.length;e<f;e++){b[b.length]=l.compiled.call(g,k[e],h,e+1,f)}return b.join("")}return l.compiled.call(g,k,h,d,c)},compileTpl:function(tpl){var fm=Ext.util.Format,useF=this.disableFormats!==true,body;function fn(m,name,format,args,math){var v;if(name.substr(0,4)=="xtpl"){return"',this.applySubTemplate("+name.substr(4)+", values, parent, xindex, xcount),'"}if(name=="."){v='typeof values == "string" ? values : ""'}else{if(name=="#"){v="xindex"}else{if(name.indexOf(".")!=-1){v="values."+name}else{v="values['"+name+"']"}}}if(math){v="("+v+math+")"}if(format&&useF){args=args?","+args:"";if(format.substr(0,5)!="this."){format="fm."+format+"("}else{format='this.call("'+format.substr(5)+'", ';args=", values"}}else{args="";format="("+v+" === undefined ? '' : "}return"',"+format+v+args+"),'"}function codeFn(m,code){return"',("+code.replace(/\\'/g,"'")+"),'"}body=["tpl.compiled = function(values, parent, xindex, xcount){return ['"];body.push(tpl.body.replace(/(\r\n|\n)/g,"\\n").replace(/'/g,"\\'").replace(this.re,fn).replace(this.codeRe,codeFn));body.push("'].join('');};");body=body.join("");eval(body);return this},applyTemplate:function(a){return this.master.compiled.call(this,a,{},1,1)},compile:function(){return this}});Ext.XTemplate.prototype.apply=Ext.XTemplate.prototype.applyTemplate;Ext.XTemplate.from=function(b,a){b=Ext.getDom(b);return new Ext.XTemplate(b.value||b.innerHTML,a||{})};Ext.util.Sorter=Ext.extend(Object,{direction:"ASC",constructor:function(a){Ext.apply(this,a);if(this.property==undefined&&this.sorterFn==undefined){throw"A Sorter requires either a property or a sorter function"}this.sort=this.createSortFunction(this.sorterFn||this.defaultSorterFn)},createSortFunction:function(b){var c=this,d=c.property,e=c.direction,a=e.toUpperCase()=="DESC"?-1:1;return function(g,f){return a*b.call(c,g,f)}},defaultSorterFn:function(b,a){var d=this.getRoot(b)[this.property],c=this.getRoot(a)[this.property];return d>c?1:(d<c?-1:0)},getRoot:function(a){return this.root==undefined?a:a[this.root]}});Ext.util.Filter=Ext.extend(Object,{anyMatch:false,exactMatch:false,caseSensitive:false,constructor:function(a){Ext.apply(this,a);if(this.filter==undefined){if(this.property==undefined||this.value==undefined){throw"A filter requires either a property or a filter function to be set"}else{this.filter=this.createFilterFn()}}},createFilterFn:function(){var a=this,c=a.createValueMatcher(),b=a.property;return function(d){return c.test(a.getRoot.call(a,d)[b])}},getRoot:function(a){return this.root==undefined?a:a[this.root]},createValueMatcher:function(){var d=this,e=d.value,f=d.anyMatch,c=d.exactMatch,a=d.caseSensitive,b=Ext.escapeRe;if(!e.exec){e=String(e);if(f===true){e=b(e)}else{e="^"+b(e);if(c===true){e+="$"}}e=new RegExp(e,a?"":"i")}return e}});Ext.applyIf(Array.prototype,{indexOf:function(b,c){var a=this.length;c=c||0;c+=(c<0)?a:0;for(;c<a;++c){if(this[c]===b){return c}}return -1},remove:function(b){var a=this.indexOf(b);if(a!=-1){this.splice(a,1)}return this},contains:function(a){return this.indexOf(a)!==-1}});Ext.applyIf(Date.prototype,{getElapsed:function(a){return Math.abs((a||new Date)-this)}});Ext.apply(Function.prototype,{createInterceptor:function(b,a){if(!Ext.isFunction(b)){return this}else{var c=this;return function(){var e=this,d=arguments;b.target=e;b.method=c;if(b.apply(a||e||window,d)!==false){return c.apply(e||window,d)}return null}}},createDelegate:function(c,b,a){var d=this;return function(){var f=b||arguments;if(a===true){f=Array.prototype.slice.call(arguments,0);f=f.concat(b)}else{if(Ext.isNumber(a)){f=Array.prototype.slice.call(arguments,0);var e=[a,0].concat(b);Array.prototype.splice.apply(f,e)}}return d.apply(c||window,f)}},defer:function(c,e,b,a){var d=this.createDelegate(e,b,a);if(c>0){return setTimeout(d,c)}d();return 0},createSequence:function(b,a){var c=this;return(typeof b!="function")?this:function(){var d=c.apply(this||window,arguments);b.apply(a||this||window,arguments);return d}}});Ext.applyIf(Number.prototype,{constrain:function(b,a){var c=parseFloat(this);if(!isNaN(b)){c=Math.max(c,b)}if(!isNaN(a)){c=Math.min(c,a)}return c}});Ext.applyIf(String.prototype,{escape:(function(){var a=/('|\\)/g;return function(b){return b.replace(a,"\\$1")}})(),toggle:function(b,a){return this==b?a:b},trim:function(){var a=/^[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u2028\u2029\u202f\u205f\u3000]+|[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u2028\u2029\u202f\u205f\u3000]+$/g;return function(){return this.replace(a,"")}}()});Ext.applyIf(String,{escape:(function(){var a=/('|\\)/g;return function(b){return b.replace(a,"\\$1")}})(),leftPad:function(d,b,c){var a=String(d);c=c||" ";while(a.length<b){a=c+a}return a},format:(function(){var a=/\{(\d+)\}/g;return function(c){var b=Ext.toArray(arguments,1);return c.replace(a,function(d,e){return b[e]})}})()});Ext.ComponentMgr=new Ext.AbstractManager({typeName:"xtype",create:function(a,b){return a.render?a:new this.types[a.xtype||b](a)},registerType:function(b,a){this.types[b]=a;a[this.typeName]=b;a.prototype[this.typeName]=b}});Ext.reg=function(){return Ext.ComponentMgr.registerType.apply(Ext.ComponentMgr,arguments)};Ext.create=function(){return Ext.ComponentMgr.create.apply(Ext.ComponentMgr,arguments)};Ext.ComponentQuery={modeRe:/^(\s?[>]\s?|\s|$)/,tokenRe:/^(#)?([\w\-\*]+)/,matchers:[{re:/^\.([\w\-]+)/,method:"getByXType"},{re:/^(?:[\[\{](?:@)?([\w\-]+)\s?(?:(=|.=)\s?['"]?(.*?)["']?)?[\]\}])/,method:"getByAttribute"},{re:/^#([\w\-]+)/,method:"getById"}],cache:{},query:function(a,b){var e=a.split(","),f=e.length,d,g,c=[];for(d=0;d<f;d++){a=e[d].trim();g=this.cache[a];if(!g){this.cache[a]=g=this.parse(a)}c=c.concat(g.execute(b))}return c},parse:function(b){var c=this.matchers,a=[],h=c.length,j,d,k,l,g,e,f;while(b&&j!=b){j=b;d=b.match(this.tokenRe);if(d){if(d[1]=="#"){a.push({method:"getById",args:[d[2].trim()]})}else{a.push({method:"getByXType",args:[d[2].trim()]})}b=b.replace(d[0],"")}while(!(k=b.match(this.modeRe))){for(e=0;e<h;e++){f=c[e];l=b.match(f.re);if(l){a.push({method:f.method,args:l.splice(1)});b=b.replace(l[0],"")}}}if(k[1]){a.push({mode:k[1]});b=b.replace(k[1],"")}}return new Ext.ComponentQuery.Query({operations:a})}};Ext.ComponentQuery.Query=Ext.extend(Object,{constructor:function(a){a=a||{};Ext.apply(this,a)},execute:function(b){var d=this.operations,f=d.length,c,e,a;if(!b){a=Ext.ComponentMgr.all.items.slice()}for(e=0;e<f;e++){c=d[e];if(c.mode){a=this.getItems(a||[b],c.mode)}else{a=this.filterItems(a||this.getItems([b]),c)}if(e==f-1){return a}}return[]},filterItems:function(b,a){var h=[],f=b.length,d,e,c,g;for(d=0;d<f;d++){e=b[d];c=[e].concat(a.args);g=this[a.method].apply(this,c);if(g){h.push(e)}}return h},getItems:function(b,f){var a=[],e=b.length,d,c;f=f?f.trim():"";for(c=0;c<e;c++){d=b[c];if(d.getRefItems){a=a.concat(d.getRefItems(f!=">"))}}return a},getByXType:function(a,b){return b==="*"||a.isXType(b)},getByAttribute:function(b,d,a,c){return(c===undefined)?!!b[d]:(b[d]==c)},getById:function(a,b){return a.getItemId()==b}});Ext.PluginMgr=new Ext.AbstractManager({typeName:"ptype",create:function(b,c){var a=this.types[b.ptype||c];if(a.init){return a}else{return new a(b)}},findByType:function(c,f){var e=[],b=this.types;for(var a in b){if(!b.hasOwnProperty(a)){continue}var d=b[a];if(d.type==c&&(f===true&&d.isDefault)){e.push(d)}}return e}});Ext.preg=function(){return Ext.PluginMgr.registerType.apply(Ext.PluginMgr,arguments)};Ext.EventManager={optionsRe:/^(?:scope|delay|buffer|single|stopEvent|preventDefault|stopPropagation|normalized|args|delegate|horizontal|vertical)$/,touchRe:/^(?:pinch|pinchstart|pinchend|tap|doubletap|swipe|swipeleft|swiperight|scroll|scrollstart|scrollend|touchdown|touchstart|touchmove|touchend|taphold|tapstart|tapcancel)$/i,windowId:"ext-window",documentId:"ext-document",addListener:function(b,a,e,d,g){if(Ext.isObject(a)){this.handleListenerConfig(b,a);return}var f=Ext.getDom(b);if(!f){throw'Error listening for "'+a+'". Element "'+b+"\" doesn't exist."}if(!e){throw'Error listening for "'+a+'". No handler function specified'}var h=this.touchRe.test(a);var c=this.createListenerWrap(f,a,e,d,g,h);this.getEventListenerCache(f,a).push({fn:e,wrap:c,scope:d});if(h){Ext.TouchEventManager.addEventListener(f,a,c,g)}else{f.addEventListener(a,c,false)}},removeListener:function(g,k,l,m){if(Ext.isObject(k)){this.handleListenerConfig(g,k,true);return}var e=Ext.getDom(g),a=this.getEventListenerCache(e,k),h=a.length,f,c,b,d;while(h--){c=a[h];if(c&&(!l||c.fn==l)&&(!m||c.scope===m)){b=c.wrap;if(b.task){clearTimeout(b.task);delete b.task}f=b.tasks&&b.tasks.length;if(f){while(f--){clearTimeout(b.tasks[f])}delete b.tasks}if(this.touchRe.test(k)){Ext.TouchEventManager.removeEventListener(e,k,b)}else{e.removeEventListener(k,b,false)}a.splice(h,1)}}},removeAll:function(b){var d=Ext.getDom(b),a=this.getElementEventCache(d),c;for(c in a){if(!a.hasOwnProperty(c)){continue}this.removeListener(c)}Ext.cache[d.id].events={}},purgeElement:function(d,e,b){var f=Ext.getDom(d),c=0,a;if(b){this.removeListener(f,b)}else{this.removeAll(f)}if(e&&f&&f.childNodes){for(a=d.childNodes.length;c<a;c++){this.purgeElement(d.childNodes[c],e,b)}}},handleListenerConfig:function(d,b,a){var c,e;for(c in b){if(!b.hasOwnProperty(c)){continue}if(!this.optionsRe.test(c)){e=b[c];if(Ext.isFunction(e)){this[(a?"remove":"add")+"Listener"](d,c,e,b.scope,b)}else{this[(a?"remove":"add")+"Listener"](d,c,b.fn,b.scope,b)}}}},getId:function(a){var b=true,c;a=Ext.getDom(a);if(a===document){c=this.documentId}else{if(a===window){c=this.windowId}else{c=Ext.id(a);b=false}}if(!Ext.cache[c]){Ext.Element.addToCache(new Ext.Element(a),c);if(b){Ext.cache[c].skipGarbageCollection=true}}return c},createListenerWrap:function(h,a,c,b,g,j){g=!Ext.isObject(g)?{}:g;var d=["if(!window.Ext) {return;}"];if(j){d.push("e = new Ext.TouchEventObjectImpl(e);")}else{if(g.buffer||g.delay){d.push("e = new Ext.EventObjectImpl(e);")}else{d.push("e = Ext.EventObject.setEvent(e);")}}if(g.delegate){d.push('var t = e.getTarget("'+g.delegate+'", this);');d.push("if(!t) {return;}")}else{d.push("var t = e.target;")}if(g.target){d.push("if(e.target !== o.target) {return;}")}if(g.stopEvent){d.push("e.stopEvent();")}else{if(g.preventDefault){d.push("e.preventDefault();")}if(g.stopPropagation){d.push("e.stopPropagation();")}}if(g.normalized){d.push("e = e.browserEvent;")}if(g.buffer){d.push("(wrap.task && clearTimeout(wrap.task));");d.push("wrap.task = setTimeout(function(){")}if(g.delay){d.push("wrap.tasks = wrap.tasks || [];");d.push("wrap.tasks.push(setTimeout(function(){")}d.push("fn.call(scope || dom, e, t, o);");if(g.single){d.push("Ext.EventManager.removeListener(dom, ename, fn, scope);")}if(g.delay){d.push("}, "+g.delay+"));")}if(g.buffer){d.push("}, "+g.buffer+");")}var e=new Function("e","o","fn","scope","ename","dom","wrap",d.join("\n"));return function(f){e.call(h,f,g,c,b,a,h,arguments.callee)}},getEventListenerCache:function(c,a){var b=this.getElementEventCache(c);return b[a]||(b[a]=[])},getElementEventCache:function(b){var a=Ext.cache[this.getId(b)];return a.events||(a.events={})},onDocumentReady:function(d,c,b){var f=this,g=f.readyEvent,e;if(Ext.isReady){g||(g=new Ext.util.Event());g.addListener(d,c,b);g.fire();g.listeners=[]}else{if(!g){g=f.readyEvent=new Ext.util.Event();var a=function(){Ext.isReady=true;window.removeEventListener("load",arguments.callee,false);if(e){clearInterval(e)}setTimeout(function(){Ext.supports.init();Ext.TouchEventManager.init();Ext.orientation=Ext.Element.getOrientation();g.fire({orientation:Ext.orientation,width:Ext.Element.getViewportWidth(),height:Ext.Element.getViewportHeight()});g.listeners=[]},50)};e=setInterval(function(){if(/loaded|complete/.test(document.readyState)){clearInterval(e);e=null;a()}},10);window.addEventListener("load",a,false)}b=b||{};b.delay=b.delay||1;g.addListener(d,c,b)}},onWindowResize:function(c,b,a){var e=this,f=e.resizeEvent;if(!f){e.resizeEvent=f=new Ext.util.Event();var d=function(){f.fire(Ext.Element.getViewportWidth(),Ext.Element.getViewportHeight())};this.addListener(window,"resize",d,this)}f.addListener(c,b,a)},onOrientationChange:function(c,b,a){var e=this,d=e.orientationEvent;if(!d){e.orientationEvent=d=new Ext.util.Event();var f=function(g){Ext.orientation=Ext.Element.getOrientation();if(Ext.stretchEl){Ext.NELAStrechEl(true)}if(Ext.is.Desktop){d.fire(Ext.orientation,window.innerWidth,window.innerHeight)}else{setTimeout(function(){Ext.hideAddressBar(function(){d.fire(Ext.orientation,window.innerWidth,window.innerHeight)})},5)}};if(Ext.supports.OrientationChange){this.addListener(window,"orientationchange",f,this)}else{this.addListener(window,"resize",f,this,{buffer:200})}}d.addListener(c,b,a)},unOrientationChange:function(c,b,a){var e=this,d=e.orientationEvent;if(d){d.removeListener(c,b,a)}}};Ext.EventManager.on=Ext.EventManager.addListener;Ext.EventManager.un=Ext.EventManager.removeListener;Ext.onReady=Ext.EventManager.onDocumentReady;Ext.EventObjectImpl=Ext.extend(Object,{constructor:function(a){if(a){this.setEvent(a.browserEvent||a)}},setEvent:function(c){var b=this;if(c==b||(c&&c.browserEvent)){return c}b.browserEvent=c;if(c){b.type=c.type;var a=c.target;b.target=a&&a.nodeType==3?a.parentNode:a;b.xy=[c.pageX,c.pageY];b.timestamp=c.timeStamp}else{b.target=null;b.xy=[0,0]}return b},stopEvent:function(){this.stopPropagation();this.preventDefault()},preventDefault:function(){if(this.browserEvent){this.browserEvent.preventDefault()}},stopPropagation:function(){if(this.browserEvent){this.browserEvent.stopPropagation()}},getPageX:function(){return this.xy[0]},getPageY:function(){return this.xy[1]},getXY:function(){return this.xy},getTarget:function(b,c,a){return b?Ext.fly(this.target).findParent(b,c,a):(a?Ext.get(this.target):this.target)},getTime:function(){return this.timestamp}});Ext.EventObject=new Ext.EventObjectImpl();Ext.is={init:function(){var b=this.platforms,e=b.length,d,a;for(d=0;d<e;d++){a=b[d];this[a.identity]=a.regex.test(a.string)}if(this.Android){var c=5;if(navigator.appCodeName.indexOf("Android 2.1")==-1){this.Android21=false;c=50}else{this.Android21=true}this.browserBarSize=c}this.Desktop=this.Mac||this.Windows||(this.Linux&&!this.Android);this.Tablet=this.iPad;this.Phone=!this.Desktop&&!this.Tablet;this.iOS=this.iPhone||this.iPad||this.iPod},platforms:[{string:navigator.platform,regex:/iPhone/i,identity:"iPhone"},{string:navigator.platform,regex:/iPod/i,identity:"iPod"},{string:navigator.userAgent,regex:/iPad/i,identity:"iPad"},{string:navigator.userAgent,regex:/Blackberry/i,identity:"Blackberry"},{string:navigator.userAgent,regex:/Android/i,identity:"Android"},{string:navigator.platform,regex:/Mac/i,identity:"Mac"},{string:navigator.platform,regex:/Win/i,identity:"Windows"},{string:navigator.platform,regex:/Linux/i,identity:"Linux"}]};Ext.is.init();Ext.supports={init:function(){var d=document,f=d.createElement("div"),b=this.tests,c=b.length,a,e;f.innerHTML=['<div style="height:30px;width:50px;">','<div style="height:20px;width:20px;"></div>',"</div>",'<div style="float:left; background-color:transparent;"></div>'].join("");d.body.appendChild(f);for(a=0;a<c;a++){e=b[a];this[e.identity]=e.fn.call(this,d,f)}d.body.removeChild(f)},OrientationChange:!Ext.is.Desktop&&(window.orientation!==undefined),tests:[{identity:"Touch",fn:function(a,b){return(!Ext.is.Desktop&&("ontouchstart" in b))}},{identity:"RightMargin",fn:function(b,c,a){a=b.defaultView;return !(a&&a.getComputedStyle(c.firstChild.firstChild,null).marginRight!="0px")}},{identity:"TransparentColor",fn:function(b,c,a){a=b.defaultView;return !(a&&a.getComputedStyle(c.lastChild,null).backgroundColor!="transparent")}},{identity:"Float",fn:function(a,b){return !!b.lastChild.style.cssFloat}},{identity:"AudioTag",fn:function(a){return !!a.createElement("audio").canPlayType}}]};Ext.data.Batch=Ext.extend(Ext.util.Observable,{autoStart:false,current:-1,total:0,running:false,complete:false,exception:false,pauseOnException:true,constructor:function(a){Ext.apply(this,a||{});this.operations=[];this.addEvents("complete","exception","operation-complete");Ext.data.Batch.superclass.constructor.call(this,a)},add:function(a){this.total++;a.setBatch(this);this.operations.push(a)},start:function(){this.exception=false;this.running=true;this.runNextOperation()},runNextOperation:function(){this.runOperation(this.current+1)},pause:function(){this.running=false},runOperation:function(d){var c=this.operations,b=c[d];if(b==undefined){this.running=false;this.complete=true;this.fireEvent("complete",this,c[c.length-1])}else{this.current=d;var a=function(e){var f=e.hasException();if(f){this.fireEvent("exception",this,e)}else{this.fireEvent("operation-complete",this,e)}if(f&&this.pauseOnException){this.pause()}else{e.markCompleted();this.runNextOperation()}};b.markStarted();this.proxy[b.action](b,a,this)}}});Ext.data.Model=Ext.extend(Ext.util.Stateful,{evented:false,isModel:true,phantom:false,idProperty:"id",defaultProxyType:"ajax",constructor:function(e,g){e=Ext.apply({},e);if(this.evented){this.addEvents()}this.internalId=(g||g===0)?g:Ext.data.Model.id(this);Ext.data.Model.superclass.constructor.apply(this);var a=this.fields.items,d=a.length,f,b,c;for(c=0;c<d;c++){f=a[c];b=f.name;if(e[b]==undefined){e[b]=f.defaultValue}}this.set(e);if(this.getId()){this.phantom=false}},getProxy:function(){return this.constructor.proxy},load:function(c){c=c||{};Ext.apply(c,{action:"read",id:this.getId()});var b=new Ext.data.Operation(c),e=c.success,f=c.failure,d=c.scope,a;var g=function(h){a=h.getRecords()[0];if(h.wasSuccessful()){this.set(h.resultSet.records[0].data);if(typeof e=="function"){e.call(d,a)}}else{if(typeof f=="function"){f.call(d,a)}}};this.getProxy().read(b,g,this)},save:function(c){var f=this.phantom?"create":"update";c=c||{};Ext.apply(c,{records:[this],action:f});var b=new Ext.data.Operation(c),e=c.success,g=c.failure,d=c.scope,a;var h=function(j){a=j.getRecords()[0];if(j.wasSuccessful()){if(typeof e=="function"){e.call(d,a)}}else{if(typeof g=="function"){g.call(d,a)}}};this.getProxy()[f](b,h,this)},getId:function(){return this.get(this.idProperty)},setId:function(a){this.set(this.idProperty,a)},join:function(a){this.store=a},unjoin:function(a){delete this.store},afterEdit:function(){this.callStore("afterEdit")},afterReject:function(){this.callStore("afterReject")},afterCommit:function(){this.callStore("afterCommit")},callStore:function(b){var a=this.store;if(a!=undefined&&typeof a[b]=="function"){a[b](this)}}});Ext.apply(Ext.data.Model,{setProxy:function(a){a=Ext.data.ProxyMgr.create(a);a.setModel(this);this.proxy=a;return a}});Ext.data.Model.id=function(a){a.phantom=true;return[Ext.data.Model.PREFIX,"-",Ext.data.Model.AUTO_ID++].join("")};Ext.ns("Ext.data.Record");Ext.data.Record.id=Ext.data.Model.id;Ext.data.Model.PREFIX="ext-record";Ext.data.Model.AUTO_ID=1;Ext.data.Model.EDIT="edit";Ext.data.Model.REJECT="reject";Ext.data.Model.COMMIT="commit";Ext.data.Field=Ext.extend(Object,{constructor:function(b){if(Ext.isString(b)){b={name:b}}Ext.apply(this,b);var d=Ext.data.Types,a=this.sortType,c;if(this.type){if(Ext.isString(this.type)){this.type=d[this.type.toUpperCase()]||d.AUTO}}else{this.type=d.AUTO}if(Ext.isString(a)){this.sortType=Ext.data.SortTypes[a]}else{if(Ext.isEmpty(a)){this.sortType=this.type.sortType}}if(!this.convert){this.convert=this.type.convert}},dateFormat:null,defaultValue:"",mapping:null,sortType:null,sortDir:"ASC",allowBlank:true});Ext.data.SortTypes={none:function(a){return a},stripTagsRE:/<\/?[^>]+>/gi,asText:function(a){return String(a).replace(this.stripTagsRE,"")},asUCText:function(a){return String(a).toUpperCase().replace(this.stripTagsRE,"")},asUCString:function(a){return String(a).toUpperCase()},asDate:function(a){if(!a){return 0}if(Ext.isDate(a)){return a.getTime()}return Date.parse(String(a))},asFloat:function(a){var b=parseFloat(String(a).replace(/,/g,""));return isNaN(b)?0:b},asInt:function(a){var b=parseInt(String(a).replace(/,/g,""),10);return isNaN(b)?0:b}};Ext.data.Types=new function(){var a=Ext.data.SortTypes;Ext.apply(this,{stripRe:/[\$,%]/g,AUTO:{convert:function(b){return b},sortType:a.none,type:"auto"},STRING:{convert:function(b){return(b===undefined||b===null)?"":String(b)},sortType:a.asUCString,type:"string"},INT:{convert:function(b){return b!==undefined&&b!==null&&b!==""?parseInt(String(b).replace(Ext.data.Types.stripRe,""),10):0},sortType:a.none,type:"int"},FLOAT:{convert:function(b){return b!==undefined&&b!==null&&b!==""?parseFloat(String(b).replace(Ext.data.Types.stripRe,""),10):0},sortType:a.none,type:"float"},BOOL:{convert:function(b){return b===true||b==="true"||b==1},sortType:a.none,type:"bool"},DATE:{convert:function(c){var d=this.dateFormat;if(!c){return null}if(Ext.isDate(c)){return c}if(d){if(d=="timestamp"){return new Date(c*1000)}if(d=="time"){return new Date(parseInt(c,10))}return Date.parseDate(c,d)}var b=Date.parse(c);return b?new Date(b):null},sortType:a.asDate,type:"date"}});Ext.apply(this,{BOOLEAN:this.BOOL,INTEGER:this.INT,NUMBER:this.FLOAT})};Ext.ModelMgr=new Ext.AbstractManager({typeName:"mtype",defaultProxyType:"ajax",registerType:function(a,c){var g=Ext.PluginMgr,d=g.findByType("model",true),h=c.fields||[],f=Ext.extend(Ext.data.Model,c),k=c.plugins||[],b,j;for(j=0,b=k.length;j<b;j++){d.push(g.create(k[j]))}var e=new Ext.util.MixedCollection(false,function(l){return l.name});for(j=0,b=h.length;j<b;j++){e.add(new Ext.data.Field(h[j]))}Ext.override(f,{fields:e,plugins:d});f.modelName=a;Ext.data.Model.setProxy.call(f,c.proxy||this.defaultProxyType);f.getProxy=f.prototype.getProxy;for(j=0,b=d.length;j<b;j++){d[j].bootstrap(f,c)}this.types[a]=f;return f},getModel:function(b){var a=b;if(typeof a=="string"){a=this.types[a]}return a},create:function(c,b){var a=typeof b=="function"?b:this.types[b||c.name];return new a(c)}});Ext.regModel=function(){return Ext.ModelMgr.registerType.apply(Ext.ModelMgr,arguments)};Ext.data.Operation=Ext.extend(Object,{synchronous:true,action:undefined,filters:undefined,sorters:undefined,group:undefined,start:undefined,limit:undefined,batch:undefined,started:false,running:false,complete:false,success:undefined,exception:false,error:undefined,constructor:function(a){Ext.apply(this,a||{})},markStarted:function(){this.started=true;this.running=true},markCompleted:function(){this.complete=true;this.running=false},markSuccessful:function(){this.success=true},markException:function(a){this.exception=true;this.success=false;this.running=false;this.error=a},hasException:function(){return this.exception===true},getError:function(){return this.error},getRecords:function(){var a=this.getResultSet();return(a==undefined?[]:a.records)},getResultSet:function(){return this.resultSet},isStarted:function(){return this.started===true},isRunning:function(){return this.running===true},isComplete:function(){return this.complete===true},wasSuccessful:function(){return this.isComplete()&&this.success===true},setBatch:function(a){this.batch=a},allowWrite:function(){return this.action!="read"}});Ext.data.ProxyMgr=new Ext.AbstractManager({create:function(a){if(a==undefined||typeof a=="string"){a={type:a}}if(!(a instanceof Ext.data.Proxy)){Ext.applyIf(a,{type:this.defaultProxyType,model:this.model});var b=a[this.typeName]||a.type,c=this.types[b];if(c==undefined){throw new Error(String.format("The '{0}' type has not been registered with this manager",b))}return new c(a)}else{return a}}});Ext.data.ReaderMgr=new Ext.AbstractManager({typeName:"rtype"});Ext.data.Request=Ext.extend(Object,{action:undefined,params:undefined,method:"GET",url:undefined,constructor:function(a){Ext.apply(this,a)}});Ext.data.ResultSet=Ext.extend(Object,{loaded:true,count:0,total:0,success:false,constructor:function(a){Ext.apply(this,a);this.totalRecords=this.total;if(a.count==undefined){this.count=this.records.length}}});Ext.data.AbstractStore=Ext.extend(Ext.util.Observable,{remoteSort:false,remoteFilter:false,autoLoad:false,autoSave:false,batchUpdateMode:"operation",filterOnLoad:true,sortOnLoad:true,defaultSortDirection:"ASC",implicitModel:false,defaultProxyType:"memory",isDestroyed:false,isStore:true,constructor:function(a){this.addEvents("add","remove","update","datachanged","read");this.removed=[];this.sortToggle={};Ext.data.AbstractStore.superclass.constructor.apply(this,arguments);this.model=Ext.ModelMgr.getModel(a.model);if(!this.model&&a.fields){this.model=Ext.regModel("ImplicitModel-"+this.storeId||Ext.id(),{fields:a.fields});delete this.fields;this.implicitModel=true}this.setProxy(a.proxy||this.model.proxy);if(this.id){this.storeId=this.id;delete this.id;Ext.StoreMgr.register(this)}},setProxy:function(a){a=Ext.data.ProxyMgr.create(a);a.setModel(this.model);this.proxy=a;return a},getProxy:function(){return this.proxy},create:function(b){b=b||{};Ext.applyIf(b,{action:"create",records:this.getNewRecords()});var a=new Ext.data.Operation(b);return this.proxy.create(a,this.onProxyWrite,this)},read:function(b){b=b||{};Ext.applyIf(b,{action:"read",filters:this.filters,sorters:this.sorters});var a=new Ext.data.Operation(b);return this.proxy.read(a,this.onProxyRead,this)},onProxyRead:Ext.emptyFn,update:function(b){b=b||{};Ext.applyIf(b,{action:"update",records:this.getUpdatedRecords()});var a=new Ext.data.Operation(b);return this.proxy.update(a,this.onProxyWrite,this)},onProxyWrite:Ext.emptyFn,destroy:function(b){b=b||{};Ext.applyIf(b,{action:"destroy",records:this.getRemovedRecords()});var a=new Ext.data.Operation(b);return this.proxy.destroy(a,this.onProxyWrite,this)},onBatchOperationComplete:function(c,b){if(b.action=="create"){var a=b.records,e=a.length,d;for(d=0;d<e;d++){a[d].needsAdd=false}}},onBatchComplete:function(c,a){var b=c.operations,e=b.length,d;this.suspendEvents();for(d=0;d<e;d++){this.onProxyWrite(b[d])}this.resumeEvents();this.fireEvent("datachanged",this)},onBatchException:function(b,a){},filterNew:function(a){return a.phantom==true||a.needsAdd==true},getNewRecords:Ext.emptyFn,getUpdatedRecords:Ext.emptyFn,filterDirty:function(a){return a.dirty==true},getRemovedRecords:function(){return this.removed},sort:function(b,a){},decodeSorters:function(d){if(!Ext.isArray(d)){if(d==undefined){d=[]}else{d=[d]}}var c=d.length,e=Ext.util.Sorter,a,b;for(b=0;b<c;b++){a=d[b];if(!(a instanceof e)){Ext.applyIf(a,{root:"data",direction:"ASC"});if(a.fn){a.sorterFn=a.fn}if(typeof a=="function"){a={sorterFn:a}}d[b]=new e(a)}}return d},filter:function(a,b){},oldSort:function(g,f){g=g||this.sorters;f=(this.sortToggle[name]||this.defaultSortDirection).toggle("ASC","DESC");this.sortToggle[name]=f;if(typeof g=="string"){g=[{field:g,direction:f}]}this.sortInfo={sorters:g,direction:f};if(this.remoteSort){this.read()}else{if(g==undefined||g.length==0){return}var a=[],d=g.length,b;for(b=0;b<d;b++){a.push(this.createSortFunction(g[b].field,g[b].direction))}var e=f.toUpperCase()=="DESC"?-1:1;var c=function(l,k){var h=a[0].call(this,l,k);if(a.length>1){for(var n=1,m=a.length;n<m;n++){h=h||a[n].call(this,l,k)}}return e*h};this.data.sort(f,c);if(!suppressEvent){this.fireEvent("datachanged",this)}}},createSortFunction:function(d,c){c=c||"ASC";var b=c.toUpperCase()=="DESC"?-1:1;var a=this.model.prototype.fields,e=a.get(d).sortType;return function(g,f){var j=e(g.data[d]),h=e(f.data[d]);return b*(j>h?1:(j<h?-1:0))}},decodeFilters:function(e){if(!Ext.isArray(e)){if(e!=undefined){e=[e]}else{e=[]}}var d=e.length,a=Ext.util.Filter,b,c;for(c=0;c<d;c++){b=e[c];if(!(b instanceof a)){Ext.apply(b,{root:"data"});if(b.fn){b.filter=b.fn}if(typeof b=="function"){b={filter:b}}e[c]=new a(b)}}return e},clearFilter:function(a){},isFiltered:function(){},filterBy:function(b,a){},sync:function(){this.proxy.batch({create:this.getNewRecords(),update:this.getUpdatedRecords(),destroy:this.getRemovedRecords()},this.getBatchListeners())},getBatchListeners:function(){var a={scope:this,exception:this.onBatchException};if(this.batchUpdateMode=="operation"){a["operation-complete"]=this.onBatchOperationComplete}else{a.complete=this.onBatchComplete}return a},save:function(){return this.sync.apply(this,arguments)},load:function(){return this.read.apply(this,arguments)},afterEdit:function(a){this.fireEvent("update",this,a,Ext.data.Model.EDIT)},afterReject:function(a){this.fireEvent("update",this,a,Ext.data.Model.REJECT)},afterCommit:function(a){if(this.autoSave){this.sync()}this.fireEvent("update",this,a,Ext.data.Model.COMMIT)},clearData:function(){},destroyStore:function(){if(!this.isDestroyed){if(this.storeId){Ext.StoreMgr.unregister(this)}this.clearData();this.data=null;this.tree=null;this.reader=this.writer=null;this.purgeListeners();this.isDestroyed=true;if(this.implicitModel){Ext.destroy(this.model)}}},getSortState:function(){return this.sortInfo},getCount:function(){},getById:function(a){},removeAll:function(){}});Ext.data.Store=Ext.extend(Ext.data.AbstractStore,{remoteSort:false,remoteFilter:false,groupField:undefined,groupDir:"ASC",pageSize:25,currentPage:undefined,implicitModel:false,defaultProxyType:"memory",isDestroyed:false,isStore:true,constructor:function(a){a=a||{};this.data=new Ext.util.MixedCollection(false,function(b){return b.internalId});if(a.data){this.inlineData=a.data;delete a.data}Ext.data.Store.superclass.constructor.call(this,a);if(this.inlineData){this.loadData(this.inlineData);delete this.inlineData}else{if(this.autoLoad){this.load.defer(10,this,[typeof this.autoLoad=="object"?this.autoLoad:undefined])}}},getGroups:function(){var d=this.data.items,f=d.length,a=[],c={},b,g,h,e;for(e=0;e<f;e++){b=d[e];g=this.getGroupString(b);h=c[g];if(h==undefined){h={name:g,children:[]};a.push(h);c[g]=h}h.children.push(b)}return a},getGroupString:function(a){return a.get(this.groupField)},insert:function(d,c){var e,b,a;c=[].concat(c);for(e=0,a=c.length;e<a;e++){this.data.insert(d+e,c[e]);c[e].join(this)}if(this.snapshot){this.snapshot.addAll(c)}this.fireEvent("add",this,c,d);this.fireEvent("datachanged",this)},add:function(){var a=Array.prototype.slice.apply(arguments),c=a.length,b;for(b=0;b<c;b++){if(!(a[b] instanceof Ext.data.Model)){a[b]=Ext.ModelMgr.create(a[b],this.model)}if(a[b].phantom==false){a[b].needsAdd=true}}this.insert(this.data.length,a);return a},each:function(b,a){this.data.each(b,a)},remove:function(b){if(!Ext.isArray(b)){b=[b]}var e=b.length,d,c,a;for(d=0;d<e;d++){a=b[d];c=this.data.indexOf(a);if(c>-1){this.removed.push(a);if(this.snapshot){this.snapshot.remove(a)}a.unjoin(this);this.data.removeAt(c);this.fireEvent("remove",this,a,c)}}this.fireEvent("datachanged",this)},removeAt:function(b){var a=this.getAt(b);if(a){this.remove(a)}},read:function(a){a=a||{};Ext.applyIf(a,{group:{field:this.groupField,direction:this.groupDir},start:0,limit:this.pageSize,addRecords:false});return Ext.data.Store.superclass.read.call(this,a)},onProxyRead:function(b){var a=b.getRecords();this.loadRecords(a,b.addRecords);this.fireEvent("read",this,a,b.wasSuccessful());var c=b.callback;if(typeof c=="function"){c.call(b.scope||this,a,b,b.wasSuccessful())}},onProxyWrite:function(c){var g=this.data,f=c.action,b=c.getRecords(),e=b.length,a,d;if(f=="create"||f=="update"){for(d=0;d<e;d++){a=b[d];a.phantom=false;a.join(this);g.replace(a)}}else{if(f=="destroy"){for(d=0;d<e;d++){a=b[d];a.unjoin(this);g.remove(a)}this.removed=[]}}this.fireEvent("datachanged");var h=c.callback;if(typeof h=="function"){h.call(c.scope||this,b,c,c.wasSuccessful())}},getNewRecords:function(){return this.data.filterBy(this.filterNew).items},getUpdatedRecords:function(){return this.data.filterBy(this.filterDirty).items},sort:function(d,c){if(Ext.isString(d)){var b=d,a=this.sortToggle;if(c==undefined){a[b]=(a[b]||"").toggle("ASC","DESC");c=a[b]}d={property:b,direction:c}}this.sorters=this.decodeSorters(d);if(this.remoteSort){this.read()}else{this.data.sort(this.sorters);this.fireEvent("datachanged",this)}},filter:function(a,b){if(Ext.isString(a)){a={property:a,value:b}}this.filters=this.decodeFilters(a);if(this.remoteFilter){this.read()}else{this.snapshot=this.snapshot||this.data.clone();this.data=this.data.filter(this.filters);this.fireEvent("datachanged",this)}},clearFilter:function(a){if(this.isFiltered()){this.data=this.snapshot.clone();delete this.snapshot;if(a!==true){this.fireEvent("datachanged",this)}}},isFiltered:function(){return !!this.snapshot&&this.snapshot!=this.data},filterBy:function(b,a){this.snapshot=this.snapshot||this.data.clone();this.data=this.queryBy(b,a||this);this.fireEvent("datachanged",this)},queryBy:function(b,a){var c=this.snapshot||this.data;return c.filterBy(b,a||this)},loadRecords:function(a,d){if(!d){this.data.clear()}this.data.addAll(a);for(var b=0,c=a.length;b<c;b++){a[b].needsAdd=false;a[b].join(this)}this.suspendEvents();if(this.filterOnLoad){this.filter(this.filters)}if(this.sortOnLoad){this.sort(this.sorters)}this.resumeEvents();this.fireEvent("datachanged",this)},loadData:function(f,a){var c=this.model,e=f.length,d,b;for(d=0;d<e;d++){b=f[d];if(!(b instanceof Ext.data.Model)){f[d]=Ext.ModelMgr.create(b,c)}}this.loadRecords(f,a)},loadPage:function(a){this.currentPage=a;this.read({start:(a-1)*this.pageSize,limit:this.pageSize})},nextPage:function(){this.loadPage(this.currentPage+1)},previousPage:function(){this.loadPage(this.currentPage-1)},clearData:function(){this.data.each(function(a){a.unjoin()});this.data.clear()},find:function(d,c,f,e,a){var b=this.createFilterFn(d,c,e,a);return b?this.data.findIndexBy(b,null,f):-1},findRecord:function(){var a=this.find.apply(this,arguments);return a!=-1?this.getAt(a):null},createFilterFn:function(d,c,e,a,b){if(Ext.isEmpty(c,false)){return false}c=this.data.createValueMatcher(c,e,a,b);return function(f){return c.test(f.data[d])}},findExact:function(b,a,c){return this.data.findIndexBy(function(d){return d.get(b)===a},this,c)},findBy:function(b,a,c){return this.data.findIndexBy(b,a,c)},collect:function(f,g,a){var k=[],h={},b,j,e,d,c;if(a===true&&this.snapshot){d=this.snapshot.items}else{d=this.data.items}b=d.length;for(c=0;c<b;c++){j=d[c].data[f];e=String(j);if((g||!Ext.isEmpty(j))&&!h[e]){h[e]=true;k[k.length]=j}}return k},sum:function(e,f,a){var b=this.data.items,d=0,c;f=f||0;a=(a||a===0)?a:b.length-1;for(c=f;c<=a;c++){d+=(b[c].data[e]||0)}return d},getCount:function(){return this.data.length||0},getAt:function(a){return this.data.itemAt(a)},getRange:function(b,a){return this.data.getRange(b,a)},getById:function(a){return(this.snapshot||this.data).find(function(b){return b.getId()===a})},indexOf:function(a){return this.data.indexOf(a)},indexOfId:function(a){return this.data.indexOfKey(a)},removeAll:function(b){var a=[];this.each(function(c){a.push(c)});this.clearData();if(this.snapshot){this.snapshot.clear()}if(b!==true){this.fireEvent("clear",this,a)}}});Ext.data.TreeStore=Ext.extend(Ext.data.AbstractStore,{clearOnLoad:true,nodeParameter:"node",constructor:function(c){c=c||{};var a=c.root||{};var b=new Ext.data.RecordNode(a);this.tree=new Ext.data.Tree(b);this.tree.treeStore=this;Ext.data.TreeStore.superclass.constructor.call(this,c);if(c.root){this.read({node:b,doPreload:true})}},getRootNode:function(){return this.tree.getRootNode()},getNodeById:function(a){return this.tree.getNodeById(a)},read:function(e){e=e||{};e.params=e.params||{};var f=e.node||this.tree.getRootNode(),d,c,a=this.proxy.reader,b;if(this.clearOnLoad){while(f.firstChild){f.removeChild(f.firstChild)}}if(!e.doPreload){Ext.applyIf(e,{node:f});c=f.getRecord();e.params[this.nodeParameter]=c?c.getId():"root";return Ext.data.TreeStore.superclass.read.call(this,e)}else{b=a.getRoot(f.isRoot?f.attributes:f.getRecord().raw);d=a.extractData(b,true);this.fillNode(f,d);return true}},fillNode:function(g,c){g.loaded=true;var f=c.length,a,e=0,d,b=g.subStore;for(;e<f;e++){d=c[e].raw;c[e].data.leaf=d.leaf;a=new Ext.data.RecordNode({leaf:d.leaf,record:c[e],expanded:d.expanded});g.appendChild(a);if(c[e].doPreload){this.read({node:a,doPreload:true})}}if(b){if(this.clearOnLoad){b.removeAll()}b.add.apply(b,c)}},onProxyRead:function(b){var a=b.getRecords();this.fillNode(b.node,a);this.fireEvent("read",this,b.node,a,b.wasSuccessful());var c=b.callback;if(typeof c=="function"){c.call(b.scope||this,a,b,b.wasSuccessful())}},getSubStore:function(a){if(a&&a.node){a=a.node}return a.getSubStore()},removeAll:function(){var a=this.getRootNode();a.destroy()}});Ext.StoreMgr=Ext.apply(new Ext.util.MixedCollection(),{register:function(){for(var a=0,b;(b=arguments[a]);a++){this.add(b)}},unregister:function(){for(var a=0,b;(b=arguments[a]);a++){this.remove(this.lookup(b))}},lookup:function(e){if(Ext.isArray(e)){var b=["field1"],d=!Ext.isArray(e[0]);if(!d){for(var c=2,a=e[0].length;c<=a;++c){b.push("field"+c)}}return new Ext.data.ArrayStore({data:e,fields:b,expandData:d,autoDestroy:true,autoCreated:true})}return Ext.isObject(e)?(e.events?e:Ext.create(e,"store")):this.get(e)},getKey:function(a){return a.storeId}});Ext.data.WriterMgr=new Ext.AbstractManager({});Ext.data.Tree=Ext.extend(Ext.util.Observable,{constructor:function(a){this.nodeHash={};this.root=null;if(a){this.setRootNode(a)}this.addEvents("append","remove","move","insert","beforeappend","beforeremove","beforemove","beforeinsert");Ext.data.Tree.superclass.constructor.call(this)},pathSeparator:"/",proxyNodeEvent:function(){return this.fireEvent.apply(this,arguments)},getRootNode:function(){return this.root},setRootNode:function(a){this.root=a;a.ownerTree=this;a.isRoot=true;this.registerNode(a);return a},getNodeById:function(a){return this.nodeHash[a]},registerNode:function(a){this.nodeHash[a.id]=a},unregisterNode:function(a){delete this.nodeHash[a.id]},toString:function(){return"[Tree"+(this.id?" "+this.id:"")+"]"}});Ext.data.Node=Ext.extend(Ext.util.Observable,{constructor:function(a){this.attributes=a||{};this.leaf=this.attributes.leaf;this.id=this.attributes.id;if(!this.id){this.id=Ext.id(null,"xnode-");this.attributes.id=this.id}this.childNodes=[];this.parentNode=null;this.firstChild=null;this.lastChild=null;this.previousSibling=null;this.nextSibling=null;this.addEvents({append:true,remove:true,move:true,insert:true,beforeappend:true,beforeremove:true,beforemove:true,beforeinsert:true});this.listeners=this.attributes.listeners;Ext.data.Node.superclass.constructor.call(this)},fireEvent:function(b){if(Ext.data.Node.superclass.fireEvent.apply(this,arguments)===false){return false}var a=this.getOwnerTree();if(a){if(a.proxyNodeEvent.apply(a,arguments)===false){return false}}return true},isLeaf:function(){return this.leaf===true},setFirstChild:function(a){this.firstChild=a},setLastChild:function(a){this.lastChild=a},isLast:function(){return(!this.parentNode?true:this.parentNode.lastChild==this)},isFirst:function(){return(!this.parentNode?true:this.parentNode.firstChild==this)},hasChildNodes:function(){return !this.isLeaf()&&this.childNodes.length>0},isExpandable:function(){return this.attributes.expandable||this.hasChildNodes()},appendChild:function(e){var f=false,d,a;if(Ext.isArray(e)){f=e}else{if(arguments.length>1){f=arguments}}if(f){a=f.length;for(d=0;d<a;d++){this.appendChild(f[d])}}else{if(this.fireEvent("beforeappend",this.ownerTree,this,e)===false){return false}var b=this.childNodes.length;var c=e.parentNode;if(c){if(e.fireEvent("beforemove",e.getOwnerTree(),e,c,this,b)===false){return false}c.removeChild(e)}b=this.childNodes.length;if(b===0){this.setFirstChild(e)}this.childNodes.push(e);e.parentNode=this;var g=this.childNodes[b-1];if(g){e.previousSibling=g;g.nextSibling=e}else{e.previousSibling=null}e.nextSibling=null;this.setLastChild(e);e.setOwnerTree(this.getOwnerTree());this.fireEvent("append",this.ownerTree,this,e,b);if(c){e.fireEvent("move",this.ownerTree,e,c,this,b)}return e}},removeChild:function(c,b){var a=this.childNodes.indexOf(c);if(a==-1){return false}if(this.fireEvent("beforeremove",this.ownerTree,this,c)===false){return false}this.childNodes.splice(a,1);if(c.previousSibling){c.previousSibling.nextSibling=c.nextSibling}if(c.nextSibling){c.nextSibling.previousSibling=c.previousSibling}if(this.firstChild==c){this.setFirstChild(c.nextSibling)}if(this.lastChild==c){this.setLastChild(c.previousSibling)}this.fireEvent("remove",this.ownerTree,this,c);if(b){c.destroy(true)}else{c.clear()}return c},clear:function(a){this.setOwnerTree(null,a);this.parentNode=this.previousSibling=this.nextSibling=null;if(a){this.firstChild=this.lastChild=null}},destroy:function(a){if(a===true){this.purgeListeners();this.clear(true);Ext.each(this.childNodes,function(b){b.destroy(true)});this.childNodes=null}else{this.remove(true)}},insertBefore:function(d,a){if(!a){return this.appendChild(d)}if(d==a){return false}if(this.fireEvent("beforeinsert",this.ownerTree,this,d,a)===false){return false}var b=this.childNodes.indexOf(a),c=d.parentNode,e=b;if(c==this&&this.childNodes.indexOf(d)<b){e--}if(c){if(d.fireEvent("beforemove",d.getOwnerTree(),d,c,this,b,a)===false){return false}c.removeChild(d)}if(e===0){this.setFirstChild(d)}this.childNodes.splice(e,0,d);d.parentNode=this;var f=this.childNodes[e-1];if(f){d.previousSibling=f;f.nextSibling=d}else{d.previousSibling=null}d.nextSibling=a;a.previousSibling=d;d.setOwnerTree(this.getOwnerTree());this.fireEvent("insert",this.ownerTree,this,d,a);if(c){d.fireEvent("move",this.ownerTree,d,c,this,e,a)}return d},remove:function(b){var a=this.parentNode;if(a){a.removeChild(this,b)}return this},removeAll:function(a){var c=this.childNodes,b;while((b=c[0])){this.removeChild(b,a)}return this},item:function(a){return this.childNodes[a]},replaceChild:function(a,c){var b=c?c.nextSibling:null;this.removeChild(c);this.insertBefore(a,b);return c},indexOf:function(a){return this.childNodes.indexOf(a)},getOwnerTree:function(){if(!this.ownerTree){var a=this;while(a){if(a.ownerTree){this.ownerTree=a.ownerTree;break}a=a.parentNode}}return this.ownerTree},getDepth:function(){var b=0,a=this;while(a.parentNode){++b;a=a.parentNode}return b},setOwnerTree:function(a,b){if(a!=this.ownerTree){if(this.ownerTree){this.ownerTree.unregisterNode(this)}this.ownerTree=a;if(b!==true){Ext.each(this.childNodes,function(c){c.setOwnerTree(a)})}if(a){a.registerNode(this)}}},setId:function(b){if(b!==this.id){var a=this.ownerTree;if(a){a.unregisterNode(this)}this.id=this.attributes.id=b;if(a){a.registerNode(this)}this.onIdChange(b)}},onIdChange:Ext.emptyFn,getPath:function(c){c=c||"id";var e=this.parentNode,a=[this.attributes[c]];while(e){a.unshift(e.attributes[c]);e=e.parentNode}var d=this.getOwnerTree().pathSeparator;return d+a.join(d)},bubble:function(c,b,a){var d=this;while(d){if(c.apply(b||d,a||[d])===false){break}d=d.parentNode}},cascade:function(d,c,a){if(d.apply(c||this,a||[this])!==false){var f=this.childNodes,e=f.length,b;for(b=0;b<e;b++){f[b].cascade(d,c,a)}}},eachChild:function(d,c,a){var f=this.childNodes,e=f.length,b;for(b=0;b<e;b++){if(d.apply(c||this,a||[f[b]])===false){break}}},findChild:function(b,c,a){return this.findChildBy(function(){return this.attributes[b]==c},null,a)},findChildBy:function(g,f,b){var e=this.childNodes,a=e.length,d=0,h,c;for(;d<a;d++){h=e[d];if(g.call(f||h,h)===true){return h}else{if(b){c=h.findChildBy(g,f,b);if(c!=null){return c}}}}return null},sort:function(e,d){var c=this.childNodes,a=c.length,b,g;if(a>0){var f=d?function(){e.apply(d,arguments)}:e;c.sort(f);for(b=0;b<a;b++){g=c[b];g.previousSibling=c[b-1];g.nextSibling=c[b+1];if(b===0){this.setFirstChild(g)}if(b==a-1){this.setLastChild(g)}}}},contains:function(a){return a.isAncestor(this)},isAncestor:function(a){var b=this.parentNode;while(b){if(b==a){return true}b=b.parentNode}return false},toString:function(){return"[Node"+(this.id?" "+this.id:"")+"]"}});Ext.data.RecordNode=Ext.extend(Ext.data.Node,{constructor:function(a){a=a||{};if(a.record){a.record.node=this}Ext.data.RecordNode.superclass.constructor.call(this,a)},getChildRecords:function(){var e=this.childNodes,d=e.length,b=0,a=[],c;for(;b<d;b++){c=e[b].attributes.record;c.data.leaf=e[b].leaf;a.push(c)}return a},getRecord:function(){return this.attributes.record},getSubStore:function(){if(this.leaf){throw"Attempted to get a substore of a leaf node."}var b=this.getOwnerTree().treeStore;if(!this.subStore){this.subStore=new Ext.data.Store({model:b.model});var a=this.getChildRecords();this.subStore.add.apply(this.subStore,a)}if(!this.loaded){b.read({node:this})}return this.subStore},destroy:function(b){if(this.subStore){this.subStore.destroyStore()}var a=this.attributes;if(a.record){delete a.record.node;delete a.record}return Ext.data.RecordNode.superclass.destroy.call(this,b)}});Ext.data.Proxy=Ext.extend(Ext.util.Observable,{batchOrder:"create,update,destroy",setModel:function(a){this.model=Ext.ModelMgr.getModel(a)},getModel:function(){return this.model},create:Ext.emptyFn,read:Ext.emptyFn,update:Ext.emptyFn,destroy:Ext.emptyFn,batch:function(b,c){var a=new Ext.data.Batch({proxy:this,listeners:c||{}});Ext.each(this.batchOrder.split(","),function(d){if(b[d]){a.add(new Ext.data.Operation({action:d,records:b[d]}))}},this);a.start();return a}});Ext.data.DataProxy=Ext.data.Proxy;Ext.data.ProxyMgr.registerType("proxy",Ext.data.Proxy);Ext.data.ServerProxy=Ext.extend(Ext.data.Proxy,{noCache:true,cacheString:"_dc",defaultReaderType:"json",defaultWriterType:"json",timeout:30000,constructor:function(a){Ext.data.ServerProxy.superclass.constructor.call(this,a);this.extraParams=a.extraParams||{};this.nocache=this.noCache;this.setReader(this.reader);this.setWriter(this.writer)},setReader:function(a){if(a==undefined||typeof a=="string"){a={type:a}}if(!(a instanceof Ext.data.Reader)){Ext.applyIf(a,{model:this.model,type:this.defaultReaderType});a=Ext.data.ReaderMgr.create(a)}this.reader=a;return this.reader},getReader:function(){return this.reader},setWriter:function(a){if(a==undefined||typeof a=="string"){a={type:a}}if(!(a instanceof Ext.data.Writer)){Ext.applyIf(a,{model:this.model,type:this.defaultWriterType});a=Ext.data.WriterMgr.create(a)}this.writer=a;return this.writer},getWriter:function(){return this.writer},setModel:function(b){Ext.data.ServerProxy.superclass.setModel.call(this,b);b=this.model;var a=this.reader;if(a&&!a.model){this.reader.setModel(b)}if(this.writer){this.writer.model=b}},create:function(){return this.doRequest.apply(this,arguments)},read:function(){return this.doRequest.apply(this,arguments)},update:function(){return this.doRequest.apply(this,arguments)},destroy:function(){return this.doRequest.apply(this,arguments)},buildRequest:function(a){var c=Ext.applyIf(a.params||{},this.extraParams||{});c=Ext.applyIf(c,this.getParams(c));var b=new Ext.data.Request({params:c,action:a.action,records:a.records,operation:a});b.url=this.buildUrl(b);a.request=b;return b},getParams:function(f){var b=["start","limit","group","filters","sorters"],e={},d=0,a=b.length,c;for(;d<a;++d){c=b[d];if(f[c]!==undefined){e[c]=f[c]}}return e},buildUrl:function(b){var a=b.url||this.url;if(this.noCache){a=Ext.urlAppend(a,String.format("{0}={1}",this.cacheString,(new Date().getTime())))}return a},doRequest:function(a,c,b){throw new Error("The doRequest function has not been implemented on your Ext.data.ServerProxy subclass. See src/data/ServerProxy.js for details")},afterRequest:Ext.emptyFn,onDestroy:function(){Ext.destroy(this.reader,this.writer);Ext.data.ServerProxy.superclass.destroy.apply(this,arguments)}});Ext.data.AjaxProxy=Ext.extend(Ext.data.ServerProxy,{actionMethods:{create:"POST",read:"GET",update:"POST",destroy:"POST"},headers:undefined,constructor:function(){this.addEvents("exception");Ext.data.AjaxProxy.superclass.constructor.apply(this,arguments)},doRequest:function(a,e,b){var d=this.getWriter(),c=this.buildRequest(a,e,b);if(a.allowWrite()){c=d.write(c)}Ext.apply(c,{headers:this.headers,timeout:this.timeout,scope:this,callback:this.createRequestCallback(c,a,e,b),method:this.getMethod(c)});Ext.Ajax.request(c);return c},getMethod:function(a){return this.actionMethods[a.action]},createRequestCallback:function(d,a,e,b){var c=this;return function(j,k,h){if(k===true){var g=c.getReader(),f=g.read(h);Ext.apply(a,{response:h,resultSet:f});a.markCompleted()}else{this.fireEvent("exception",this,h,a);a.markException()}if(typeof e=="function"){e.call(b||c,a)}c.afterRequest(d,true)}}});Ext.data.ProxyMgr.registerType("ajax",Ext.data.AjaxProxy);Ext.data.HttpProxy=Ext.data.AjaxProxy;Ext.data.RestProxy=Ext.extend(Ext.data.AjaxProxy,{actionMethods:{create:"POST",read:"GET",update:"PUT",destroy:"DELETE"},api:{create:"create",read:"read",update:"update",destroy:"destroy"}});Ext.data.ProxyMgr.registerType("rest",Ext.data.RestProxy);Ext.apply(Ext,{getHead:function(){var a;return function(){if(a==undefined){a=Ext.get(document.getElementsByTagName("head")[0])}return a}}()});Ext.data.ScriptTagProxy=Ext.extend(Ext.data.ServerProxy,{defaultWriterType:"base",callbackParam:"callback",scriptIdPrefix:"stcScript",callbackPrefix:"stcCallback",recordParam:"records",lastRequest:undefined,constructor:function(){this.addEvents("exception");Ext.data.ScriptTagProxy.superclass.constructor.apply(this,arguments)},doRequest:function(f,k,l){var j=String.format,a=++Ext.data.ScriptTagProxy.TRANS_ID,c=j("{0}{1}",this.scriptIdPrefix,a),d=j("{0}{1}",this.callbackPrefix,a);var e=this.getWriter(),g=this.buildRequest(f),b=Ext.urlAppend(g.url,j("{0}={1}",this.callbackParam,d));if(f.allowWrite()){g=e.write(g)}Ext.apply(g,{url:b,transId:a,scriptId:c,stCallback:d});g.timeoutId=this.createTimeoutHandler.defer(this.timeout,this,[g,f]);window[d]=this.createRequestCallback(g,f,k,l);var h=document.createElement("script");h.setAttribute("src",b);h.setAttribute("type","text/javascript");h.setAttribute("id",c);Ext.getHead().appendChild(h);f.markStarted();this.lastRequest=g;return g},createRequestCallback:function(d,a,e,b){var c=this;return function(h){var g=c.getReader(),f=g.read(h);Ext.apply(a,{response:h,resultSet:f});a.markCompleted();if(typeof e=="function"){e.call(b||c,a)}c.afterRequest(d,true)}},afterRequest:function(){var a=function(b){return function(){window[b]=undefined;try{delete window[b]}catch(c){}}};return function(c,b){Ext.get(c.scriptId).remove();clearTimeout(c.timeoutId);var d=c.stCallback;if(b){a(d)();this.lastRequest.completed=true}else{window[d]=a(d)}}}(),buildUrl:function(c){var b=Ext.data.ScriptTagProxy.superclass.buildUrl.call(this,c);b=Ext.urlAppend(b,Ext.urlEncode(c.params));var a=c.records;if(Ext.isArray(a)&&a.length>0){b=Ext.urlAppend(b,String.format("{0}={1}",this.recordParam,this.encodeRecords(a)))}return b},destroy:function(){this.abort();Ext.data.ScriptTagProxy.superclass.destroy.apply(this,arguments)},isLoading:function(){var a=this.lastRequest;return(a!=undefined&&!a.completed)},abort:function(){if(this.isLoading()){this.afterRequest(this.lastRequest)}},encodeRecords:function(a){var d="";for(var b=0,c=a.length;b<c;b++){d+=Ext.urlEncode(a[b].data)}return d},createTimeoutHandler:function(b,a){this.afterRequest(b,false);this.fireEvent("exception",this,b,a);if(typeof b.callback=="function"){b.callback.call(b.scope||window,null,b.options,false)}}});Ext.data.ScriptTagProxy.TRANS_ID=1000;Ext.data.ProxyMgr.registerType("scripttag",Ext.data.ScriptTagProxy);Ext.data.ClientProxy=Ext.extend(Ext.data.Proxy,{clear:function(){throw new Error("The Ext.data.ClientProxy subclass that you are using has not defined a 'clear' function. See src/data/ClientProxy.js for details.")}});Ext.data.MemoryProxy=Ext.extend(Ext.data.ClientProxy,{constructor:function(a){Ext.data.MemoryProxy.superclass.constructor.call(this,a)}});Ext.data.ProxyMgr.registerType("memory",Ext.data.MemoryProxy);Ext.data.WebStorageProxy=Ext.extend(Ext.data.ClientProxy,{id:undefined,constructor:function(a){Ext.data.WebStorageProxy.superclass.constructor.call(this,a);if(this.getStorageObject()==undefined){throw new Error("Local Storage is not supported in this browser, please use another type of data proxy")}this.id=this.id||(this.store?this.store.storeId:undefined);if(this.id==undefined){throw new Error("No unique id was provided to the local storage proxy. See Ext.data.LocalStorageProxy documentation for details")}this.initialize()},create:function(e,h,j){var d=e.records,c=d.length,a=this.getIds(),b,g,f;e.markStarted();for(f=0;f<c;f++){g=d[f];if(g.phantom){g.phantom=false;b=this.getNextId()}else{b=g.getId()}this.setRecord(g,b);a.push(b)}this.setIds(a);e.markCompleted();e.markSuccessful();if(typeof h=="function"){h.call(j||this,e)}},read:function(e,h,j){var d=[],a=this.getIds(),c=a.length,f,b,g;if(e.id){g=this.getRecord(e.id);if(g){d.push(g);e.markSuccessful()}}else{for(f=0;f<c;f++){d.push(this.getRecord(a[f]))}e.markSuccessful()}e.markCompleted();e.resultSet=new Ext.data.ResultSet({records:d,total:d.length,loaded:true});if(typeof h=="function"){h.call(j||this,e)}},update:function(b,f,d){var a=b.records,e=a.length,c;b.markStarted();for(c=0;c<e;c++){this.setRecord(a[c])}b.markCompleted();b.markSuccessful();if(typeof f=="function"){f.call(d||this,b)}},destroy:function(b,h,e){var a=b.records,f=a.length,d=this.getIds(),g=[].concat(d),c;for(c=0;c<f;c++){g.remove(a[c].getId());this.removeRecord(a[c],false)}this.setIds(g);if(typeof h=="function"){h.call(e||this,b)}},getRecord:function(c){var a=Ext.decode(this.getStorageObject().getItem(this.getRecordKey(c))),f={},e=this.model,j=e.prototype.fields.items,d=j.length,g,k,b,h;for(g=0;g<d;g++){k=j[g];b=k.name;if(typeof k.decode=="function"){f[b]=k.decode(a[b])}else{f[b]=a[b]}}h=new e(f);h.phantom=false;return h},setRecord:function(j,c){if(c){j.setId(c)}else{c=j.getId()}var a=j.data,f={},h=this.model,k=h.prototype.fields.items,d=k.length,g,l,b;for(g=0;g<d;g++){l=k[g];b=l.name;if(typeof l.encode=="function"){f[b]=l.encode(a[b],j)}else{f[b]=a[b]}}var e=this.getStorageObject(),m=this.getRecordKey(c);e.removeItem(m);e.setItem(m,Ext.encode(f))},removeRecord:function(c,b){if(c instanceof Ext.data.Model){c=c.getId()}if(b!==false){var a=this.getIds();a.remove(c);this.setIds(a)}this.getStorageObject().removeItem(this.getRecordKey(c))},getRecordKey:function(a){if(a instanceof Ext.data.Model){a=a.getId()}return String.format("{0}-{1}",this.id,a)},getRecordCounterKey:function(){return String.format("{0}-counter",this.id)},getIds:function(){var a=(this.getStorageObject().getItem(this.id)||"").split(",");if(a.length==1&&a[0]==""){a=[]}return a},setIds:function(a){var b=this.getStorageObject(),c=a.join(",");if(Ext.isEmpty(c)){b.removeItem(this.id)}else{b.setItem(this.id,c)}},getNextId:function(){var d=this.getStorageObject(),a=this.getRecordCounterKey(),c=d[a],b,e;if(c==undefined){b=this.getIds();c=parseInt(b[b.length-1],10)||0}e=parseInt(c,10)+1;d.setItem(a,e);return e},initialize:function(){var a=this.getStorageObject();a.setItem(this.id,a.getItem(this.id)||"")},clear:function(){var d=this.getStorageObject(),c=this.getIds(),a=c.length,b;for(b=0;b<a;b++){this.removeRecord(c[b])}d.removeItem(this.getRecordCounterKey());d.removeItem(this.id)},getStorageObject:function(){throw new Error("The getStorageObject function has not been defined in your Ext.data.WebStorageProxy subclass")}});Ext.data.LocalStorageProxy=Ext.extend(Ext.data.WebStorageProxy,{getStorageObject:function(){return window.localStorage}});Ext.data.ProxyMgr.registerType("localstorage",Ext.data.LocalStorageProxy);Ext.data.SessionStorageProxy=Ext.extend(Ext.data.WebStorageProxy,{getStorageObject:function(){return window.sessionStorage}});Ext.data.ProxyMgr.registerType("sessionstorage",Ext.data.SessionStorageProxy);Ext.data.Reader=Ext.extend(Object,{idProperty:"id",totalProperty:"total",successProperty:"success",root:"",constructor:function(a){Ext.apply(this,a||{});this.model=Ext.ModelMgr.getModel(a.model);if(this.model){this.buildExtractors()}},setModel:function(a){this.model=Ext.ModelMgr.getModel(a);delete this.extractorFunctions;this.buildExtractors()},read:function(a){var b=a;if(a.responseText){b=this.getResponseData(a)}return this.readRecords(b)},readRecords:function(e){this.rawData=e;e=this.getData(e);var a=this.getRoot(e),c=a.length,f=true,d,b;if(this.totalProperty){d=parseInt(this.getTotal(e),10);if(!isNaN(d)){c=d}}if(this.successProperty){d=this.getSuccess(e);if(d===false||d==="false"){f=false}}b=this.extractData(a,true);return new Ext.data.ResultSet({total:c||b.length,count:b.length,records:b,success:f})},extractData:function(j,a){var k=[],f=[],e=this.model,c=j.length,l=this.idProperty,g=0,d,b,h;for(;g<c;g++){d=j[g];k=this.extractValues(d);b=this.getId(d);if(a===true){h=new e(k,b);h.raw=d;f.push(h)}else{k[l]=b;f.push(k)}}return f},extractValues:function(f){var a=this.model.prototype.fields.items,d=a.length,b={},c=0,g,e;for(;c<d;c++){g=a[c];e=this.extractorFunctions[c](f)||g.defaultValue;b[g.name]=g.convert(e,f)}return b},getData:function(a){return a},getRoot:function(a){return a},getResponseData:function(a){throw new Error("getResponseData must be implemented in the Ext.data.Reader subclass")},onMetaChange:function(a){Ext.apply(this,a||{});delete this.extractorFunctions;this.buildExtractors()},buildExtractors:function(){if(this.extractorFunctions){return}var e=this.id||this.idProperty,c=this.totalProperty,b=this.successProperty,d=this.messageProperty;if(c){this.getTotal=this.createAccessor(c)}if(b){this.getSuccess=this.createAccessor(b)}if(d){this.getMessage=this.createAccessor(d)}if(e){var a=this.createAccessor(e);this.getId=function(f){var g=a(f);return(g==undefined||g=="")?null:g}}else{this.getId=function(){return null}}this.buildFieldExtractors()},buildFieldExtractors:function(){var a=this.model.prototype.fields.items,c=a.length,b=0,f=[],e,d;for(;b<c;b++){e=a[b];d=(e.mapping!==undefined&&e.mapping!==null)?e.mapping:e.name;f.push(this.createAccessor(d))}this.extractorFunctions=f}});Ext.data.Writer=Ext.extend(Object,{constructor:function(a){Ext.apply(this,a)},write:function(e){var b=e.operation,a=b.records||[],d=a.length,c=0,f=[];for(;c<d;c++){f.push(this.getRecordData(a[c]))}return this.writeRecords(e,f)},getRecordData:function(a){return a.data}});Ext.data.WriterMgr.registerType("base",Ext.data.Writer);Ext.data.JsonWriter=Ext.extend(Ext.data.Writer,{root:"records",encode:false,writeRecords:function(a,b){if(this.encode===true){b=Ext.encode(b)}a.jsonData=a.jsonData||{};a.jsonData[this.root]=b;return a}});Ext.data.WriterMgr.registerType("json",Ext.data.JsonWriter);Ext.data.JsonReader=Ext.extend(Ext.data.Reader,{readRecords:function(a){if(a.metaData){this.onMetaChange(a.metaData)}this.jsonData=a;return Ext.data.JsonReader.superclass.readRecords.call(this,a)},getResponseData:function(a){var b=Ext.decode(a.responseText);if(!b){throw {message:"Ext.data.JsonReader.read: Json object not found"}}return b},buildExtractors:function(){Ext.data.JsonReader.superclass.buildExtractors.apply(this,arguments);if(this.root){this.getRoot=this.createAccessor(this.root)}else{this.getRoot=function(a){return a}}},createAccessor:function(){var a=/[\[\.]/;return function(c){if(Ext.isEmpty(c)){return Ext.emptyFn}if(Ext.isFunction(c)){return c}var b=String(c).search(a);if(b>=0){return new Function("obj","return obj"+(b>0?".":"")+c)}return function(d){return d[c]}}}()});Ext.data.ReaderMgr.registerType("json",Ext.data.JsonReader);Ext.data.TreeReader=Ext.extend(Ext.data.JsonReader,{extractData:function(b,e){var c=Ext.data.TreeReader.superclass.extractData.call(this,b,e),f=c.length,d=0,a;if(e){for(;d<f;d++){a=c[d];a.doPreload=!!this.getRoot(a.raw)}}return c}});Ext.data.ReaderMgr.registerType("tree",Ext.data.TreeReader);Ext.data.ArrayReader=Ext.extend(Ext.data.JsonReader,{buildExtractors:function(){Ext.data.ArrayReader.superclass.buildExtractors.apply(this,arguments);var a=this.model.prototype.fields.items,c=a.length,d=[],b;for(b=0;b<c;b++){d.push(function(e){return function(f){return f[e]}}(a[b].mapping||b))}this.extractorFunctions=d}});Ext.data.ReaderMgr.registerType("array",Ext.data.ArrayReader);Ext.data.ArrayStore=Ext.extend(Ext.data.Store,{constructor:function(a){a=a||{};Ext.applyIf(a,{proxy:{type:"memory",reader:"array"}});Ext.data.ArrayStore.superclass.constructor.call(this,a)},loadData:function(e,a){if(this.expandData===true){var d=[],b=0,c=e.length;for(;b<c;b++){d[d.length]=[e[b]]}e=d}Ext.data.ArrayStore.superclass.loadData.call(this,e,a)}});Ext.reg("arraystore",Ext.data.ArrayStore);Ext.data.SimpleStore=Ext.data.ArrayStore;Ext.reg("simplestore",Ext.data.SimpleStore);Ext.data.JsonStore=Ext.extend(Ext.data.Store,{constructor:function(a){a=a||{};Ext.applyIf(a,{proxy:{type:"ajax",reader:"json",writer:"json"}});Ext.data.JsonStore.superclass.constructor.call(this,a)}});Ext.reg("jsonstore",Ext.data.JsonStore);Ext.data.JsonPStore=Ext.extend(Ext.data.Store,{constructor:function(a){Ext.data.JsonPStore.superclass.constructor.call(this,Ext.apply(a,{reader:new Ext.data.JsonReader(a),proxy:new Ext.data.ScriptTagProxy(a)}))}});Ext.reg("jsonpstore",Ext.data.JsonPStore);Ext.data.XmlWriter=Ext.extend(Ext.data.Writer,{documentRoot:"xmlData",header:"",record:"record",writeRecords:function(b,c){var a=this.buildTpl(b,c);b.xmlData=a.apply(c);return b},buildTpl:function(e,f){if(this.tpl){return this.tpl}var c=[],b=this.documentRoot,a=this.record,g,d;if(this.header){c.push(this.header)}c.push("<",b,">");if(f.length>0){c.push('<tpl for="."><',a,">");g=f[0];for(d in g){if(g.hasOwnProperty(d)){c.push("<",d,">{",d,"}</",d,">")}}c.push("</",a,"></tpl>")}c.push("</",b,">");this.tpl=new Ext.XTemplate(c.join(""));return this.tpl}});Ext.data.WriterMgr.registerType("xml",Ext.data.XmlWriter);Ext.data.XmlReader=Ext.extend(Ext.data.Reader,{createAccessor:function(){var a=function(d,c,b){var e=Ext.DomQuery.selectNode(d,c),f;if(e&&e.firstChild){f=e.firstChild.nodeValue}return Ext.isEmpty(f)?b:f};return function(b){var c;if(b==this.totalProperty){c=function(e,d){var f=a(b,e,d);return parseFloat(f)}}else{if(b==this.successProperty){c=function(e,d){var f=a(b,e,true);return(f!==false&&f!=="false")}}else{c=function(e,d){return a(b,e,d)}}}return c}}(),getResponseData:function(a){var b=a.responseXML;if(!b){throw {message:"Ext.data.XmlReader.read: XML data not found"}}return b},getData:function(a){return a.documentElement||a},getRoot:function(a){return Ext.DomQuery.select(this.root,a)},constructor:function(a){a=a||{};Ext.applyIf(a,{idProperty:a.idPath||a.id,successProperty:a.success,root:a.record});Ext.data.XmlReader.superclass.constructor.call(this,a)},readRecords:function(a){this.xmlData=a;return Ext.data.XmlReader.superclass.readRecords.call(this,a)}});Ext.data.ReaderMgr.registerType("xml",Ext.data.XmlReader);Ext.data.XmlStore=Ext.extend(Ext.data.Store,{constructor:function(a){a=a||{};a=a||{};Ext.applyIf(a,{proxy:{type:"ajax",reader:"xml",writer:"xml"}});Ext.data.XmlStore.superclass.constructor.call(this,a)}});Ext.reg("xmlstore",Ext.data.XmlStore);(function(){var c=Ext.Element=Ext.extend(Object,{defaultUnit:"px",constructor:function(d,e){var f=typeof d=="string"?document.getElementById(d):d,g;if(!f){return null}g=f.id;if(!e&&g&&Ext.cache[g]){return Ext.cache[g].el}this.dom=f;this.id=g||Ext.id(f)},set:function(h,e){var f=this.dom,d,g;for(d in h){if(h.hasOwnProperty(d)){g=h[d];if(d=="style"){this.applyStyles(g)}else{if(d=="cls"){f.className=g}else{if(e!==false){f.setAttribute(d,g)}else{f[d]=g}}}}}return this},is:function(d){return Ext.DomQuery.is(this.dom,d)},getValue:function(d){var e=this.dom.value;return d?parseInt(e,10):e},addListener:function(d,g,f,e){Ext.EventManager.on(this.dom,d,g,f||this,e);return this},removeListener:function(d,f,e){Ext.EventManager.un(this.dom,d,f,e);return this},removeAllListeners:function(){Ext.EventManager.removeAll(this.dom);return this},purgeAllListeners:function(){Ext.EventManager.purgeElement(this,true);return this},remove:function(){var d=this,e=d.dom;if(e){delete d.dom;Ext.removeNode(e)}},isAncestor:function(e){var d=this.dom;e=Ext.getDom(e);if(d&&e){return d.contains(e)}return false},isDescendent:function(d){return Ext.fly(d).isAncestor(this)},contains:function(d){return !d?false:this.isAncestor(d)},getAttribute:function(e,f){var g=this.dom;return g.getAttributeNS(f,e)||g.getAttribute(f+":"+e)||g.getAttribute(e)||g[e]},setHTML:function(d){if(this.dom){this.dom.innerHTML=d}return this},getHTML:function(){return this.dom?this.dom.innerHTML:""},hide:function(){this.setVisible(false);return this},show:function(){this.setVisible(true);return this},setVisible:function(h,d){var e=this,g=e.dom,f=this.getVisibilityMode();switch(f){case c.VISIBILITY:this.removeClass(["x-hidden-display","x-hidden-offsets"]);this[h?"removeClass":"addCls"]("x-hidden-visibility");break;case c.DISPLAY:this.removeClass(["x-hidden-visibility","x-hidden-offsets"]);this[h?"removeClass":"addCls"]("x-hidden-display");break;case c.OFFSETS:this.removeClass(["x-hidden-visibility","x-hidden-display"]);this[h?"removeClass":"addCls"]("x-hidden-offsets");break}return e},getVisibilityMode:function(){var e=this.dom,d=c.data(e,"visibilityMode");if(d===undefined){c.data(e,"visibilityMode",d=c.DISPLAY)}return d},setDisplayMode:function(d){c.data(this.dom,"visibilityMode",d);return this}});var a=c.prototype;c.VISIBILITY=1;c.DISPLAY=2;c.OFFSETS=3;c.addMethods=function(d){Ext.apply(a,d)};a.on=a.addListener;a.un=a.removeListener;a.update=a.setHTML;c.get=function(d){var g,f,h;if(!d){return null}if(typeof d=="string"){if(!(f=document.getElementById(d))){return null}if(Ext.cache[d]&&Ext.cache[d].el){g=Ext.cache[d].el;g.dom=f}else{g=c.addToCache(new c(f))}return g}else{if(d.tagName){if(!(h=d.id)){h=Ext.id(d)}if(Ext.cache[h]&&Ext.cache[h].el){g=Ext.cache[h].el;g.dom=d}else{g=c.addToCache(new c(d))}return g}else{if(d instanceof c){if(d!=c.docEl){d.dom=document.getElementById(d.id)||d.dom}return d}else{if(d.isComposite){return d}else{if(Ext.isArray(d)){return c.select(d)}else{if(d==document){if(!c.docEl){var e=function(){};e.prototype=a;c.docEl=new e();c.docEl.dom=document}return c.docEl}}}}}}return null};c.addToCache=function(d,e){e=e||d.id;Ext.cache[e]={el:d,data:{},events:{}};return d};c.data=function(e,d,f){e=c.get(e);if(!e){return null}var g=Ext.cache[e.id].data;if(arguments.length==2){return g[d]}else{return(g[d]=f)}};c.garbageCollect=function(){if(!Ext.enableGarbageCollector){clearInterval(c.collectorThreadId)}else{var g,d,f,e;for(g in Ext.cache){if(!Ext.cache.hasOwnProperty(g)){continue}e=Ext.cache[g];if(e.skipGarbageCollection){continue}d=e.el;f=d.dom;if(!f||!f.parentNode||(!f.offsetParent&&!document.getElementById(g))){if(Ext.enableListenerCollection){Ext.EventManager.removeAll(f)}delete Ext.cache[eid]}}}};c.Flyweight=function(d){this.dom=d};var b=function(){};b.prototype=a;c.Flyweight.prototype=new b;c.Flyweight.prototype.isFlyweight=true;c._flyweights={};c.fly=function(f,d){var e=null;d=d||"_global";f=Ext.getDom(f);if(f){(c._flyweights[d]=c._flyweights[d]||new c.Flyweight()).dom=f;e=c._flyweights[d]}return e};Ext.get=c.get;Ext.fly=c.fly})();Ext.applyIf(Ext.Element,{unitRe:/\d+(px|em|%|en|ex|pt|in|cm|mm|pc)$/i,camelRe:/(-[a-z])/gi,opacityRe:/alpha\(opacity=(.*)\)/i,propertyCache:{},defaultUnit:"px",borders:{l:"border-left-width",r:"border-right-width",t:"border-top-width",b:"border-bottom-width"},paddings:{l:"padding-left",r:"padding-right",t:"padding-top",b:"padding-bottom"},margins:{l:"margin-left",r:"margin-right",t:"margin-top",b:"margin-bottom"},addUnits:function(a){if(a===""||a=="auto"||a===null||a===undefined){a=a||""}else{if(!isNaN(a)||!this.unitRe.test(a)){a=a+(this.defaultUnit||"px")}}return a},parseBox:function(b){if(typeof b!="string"){b=b.toString()}var c=b.split(" "),a=c.length;if(a==1){c[1]=c[2]=c[3]=c[0]}else{if(a==2){c[2]=c[0];c[3]=c[1]}else{if(a==3){c[3]=c[1]}}}return{top:parseFloat(c[0])||0,right:parseFloat(c[1])||0,bottom:parseFloat(c[2])||0,left:parseFloat(c[3])||0}},unitizeBox:function(b){var a=this.addUnits,c=this.parseBox(b);return a(c.top)+" "+a(c.right)+" "+a(c.bottom)+" "+a(c.left)},camelReplaceFn:function(b,c){return c.charAt(1).toUpperCase()},normalize:function(a){return this.propertyCache[a]||(this.propertyCache[a]=a=="float"?"cssFloat":a.replace(this.camelRe,this.camelReplaceFn))},getDocumentHeight:function(){return Math.max(!Ext.isStrict?document.body.scrollHeight:document.documentElement.scrollHeight,this.getViewportHeight())},getDocumentWidth:function(){return Math.max(!Ext.isStrict?document.body.scrollWidth:document.documentElement.scrollWidth,this.getViewportWidth())},getViewportHeight:function(){return window.innerHeight},getViewportWidth:function(){return window.innerWidth},getViewSize:function(){return{width:window.innerWidth,height:window.innerHeight}},getOrientation:function(){return(window.innerHeight>window.innerWidth)?"portrait":"landscape"},fromPoint:function(a,b){return Ext.get(document.elementFromPoint(a,b))}});Ext.Element.addMethods({getY:function(a){return this.getXY(a)[1]},getX:function(a){return this.getXY(a)[0]},getXY:function(){var a=window.webkitConvertPointFromNodeToPage(this.dom,new WebKitPoint(0,0));return[a.x,a.y]},getOffsetsTo:function(a){var c=this.getXY(),b=Ext.fly(a,"_internal").getXY();return[c[0]-b[0],c[1]-b[1]]},setXY:function(d){var b=this;if(arguments.length>1){d=[d,arguments[1]]}var c=b.translatePoints(d),a=b.dom.style;for(d in c){if(!c.hasOwnProperty(d)){continue}if(!isNaN(c[d])){a[d]=c[d]+"px"}}return b},setX:function(a){return this.setXY([a,this.getY()])},setY:function(a){return this.setXY([this.getX(),a])},setLeft:function(a){this.setStyle("left",Ext.Element.addUnits(a));return this},setTop:function(a){this.setStyle("top",Ext.Element.addUnits(a));return this},setTopLeft:function(c,b){var a=Ext.Element.addUnits;this.setStyle("top",a(c));this.setStyle("left",a(b));return this},setRight:function(a){this.setStyle("right",Ext.Element.addUnits(a));return this},setBottom:function(a){this.setStyle("bottom",Ext.Element.addUnits(a));return this},getLeft:function(a){return parseInt(this.getStyle("left"),10)||0},getRight:function(a){return parseInt(this.getStyle("right"),10)||0},getTop:function(a){return parseInt(this.getStyle("top"),10)||0},getBottom:function(a){return parseInt(this.getStyle("bottom"),10)||0},setBox:function(d,c,b,a){var e;if(Ext.isObject(d)){b=d.width;a=d.height;c=d.top;d=d.left}if(d!==e){this.setLeft(d)}if(c!==e){this.setTop(c)}if(b!==e){this.setWidth(b)}if(a!==e){this.setHeight(a)}return this},getBox:function(g,k){var h=this,e=h.dom,c=e.offsetWidth,m=e.offsetHeight,p,f,d,a,n,j;if(!k){p=h.getXY()}else{if(g){p=[0,0]}else{p=[parseInt(h.getStyle("left"),10)||0,parseInt(h.getStyle("top"),10)||0]}}if(!g){f={x:p[0],y:p[1],0:p[0],1:p[1],width:c,height:m}}else{d=h.getBorderWidth.call(h,"l")+h.getPadding.call(h,"l");a=h.getBorderWidth.call(h,"r")+h.getPadding.call(h,"r");n=h.getBorderWidth.call(h,"t")+h.getPadding.call(h,"t");j=h.getBorderWidth.call(h,"b")+h.getPadding.call(h,"b");f={x:p[0]+d,y:p[1]+n,0:p[0]+d,1:p[1]+n,width:c-(d+a),height:m-(n+j)}}f.left=f.x;f.top=f.y;f.right=f.x+f.width;f.bottom=f.y+f.height;return f},getPageBox:function(e){var g=this,c=g.dom,k=c.offsetWidth,f=c.offsetHeight,n=g.getXY(),m=n[1],a=n[0]+k,j=n[1]+f,d=n[0];if(e){return new Ext.util.Region(m,a,j,d)}else{return{left:d,top:m,width:k,height:f,right:a,bottom:j}}},translatePoints:function(a,g){g=isNaN(a[1])?g:a[1];a=isNaN(a[0])?a:a[0];var d=this,e=d.isStyle("position","relative"),f=d.getXY(),b=parseInt(d.getStyle("left"),10),c=parseInt(d.getStyle("top"),10);b=!isNaN(b)?b:(e?0:d.dom.offsetLeft);c=!isNaN(c)?c:(e?0:d.dom.offsetTop);return{left:(a-f[0]+b),top:(g-f[1]+c)}}});(function(){Ext.Element.classReCache={};var b=Ext.Element,a=document.defaultView;b.addMethods({marginRightRe:/marginRight/i,trimRe:/^\s+|\s+$/g,spacesRe:/\s+/,addCls:function(g){var h=this,f,c,e,d=[];if(!Ext.isArray(g)){if(g&&!this.hasClass(g)){h.dom.className+=" "+g}}else{for(f=0,c=g.length;f<c;f++){e=g[f];if(e&&!h.hasClass(e)){d.push(e)}}if(d.length){h.dom.className+=" "+d.join(" ")}}return h},removeClass:function(h){var j=this,g,d,c,f,e;if(!Ext.isArray(h)){h=[h]}if(j.dom&&j.dom.className){e=j.dom.className.replace(this.trimRe,"").split(this.spacesRe);for(g=0,c=h.length;g<c;g++){f=h[g];if(typeof f=="string"){f=f.replace(this.trimRe,"");d=e.indexOf(f);if(d!=-1){e.splice(d,1)}}}j.dom.className=e.join(" ")}return j},mask:function(j,e){var g=this,h=g.dom,f=Ext.Element.data(h,"mask"),c,d;g.addCls("x-masked");if(g.getStyle("position")=="static"){g.addCls("x-masked-relative")}if(f){f.remove()}c=g.createChild({cls:"x-mask"+(j?" x-mask-transparent":""),html:e||""});d=g.getSize();Ext.Element.data(h,"mask",c);if(h===document.body){d.width=window.innerWidth;d.height=window.innerHeight;if(g.orientationHandler){Ext.EventManager.unOrientationChange(g.orientationHandler,g)}g.orientationHandler=function(){d=g.getSize();d.height=window.innerHeight;c.setSize(d)};Ext.EventManager.onOrientationChange(g.orientationHandler,g)}c.setSize(d);if(Ext.is.iPad){Ext.repaint()}},unmask:function(){var d=this,e=d.dom,c=Ext.Element.data(e,"mask");if(c){c.remove();Ext.Element.data(e,"mask",undefined)}d.removeClass(["x-masked","x-masked-relative"]);if(e===document.body){Ext.EventManager.unOrientationChange(d.orientationHandler,d);delete d.orientationHandler}},radioClass:function(f){var g=this.dom.parentNode.childNodes,d;f=Ext.isArray(f)?f:[f];for(var e=0,c=g.length;e<c;e++){d=g[e];if(d&&d.nodeType==1){Ext.fly(d,"_internal").removeClass(f)}}return this.addCls(f)},toggleClass:function(c){return this.hasClass(c)?this.removeClass(c):this.addCls(c)},hasClass:function(c){return c&&(" "+this.dom.className+" ").indexOf(" "+c+" ")!=-1},replaceClass:function(d,c){return this.removeClass(d).addCls(c)},isStyle:function(c,d){return this.getStyle(c)==d},getStyle:function(j){var h=this.dom,d,g,f,c=Ext.is,e=h.style;j=b.normalize(j);f=(a)?a.getComputedStyle(h,""):h.currentStyle;d=(f)?f[j]:null;if(d&&!c.correctRightMargin&&this.marginRightRe.test(j)&&e.position!="absolute"&&d!="0px"){g=e.display;e.display="inline-block";d=a.getComputedStyle(h,null)[j];e.display=g}d||(d=e[j]);if(!c.correctTransparentColor&&d=="rgba(0, 0, 0, 0)"){d="transparent"}return d},setStyle:function(f,e){var c,d;if(typeof f=="string"){c={};c[f]=e;f=c}for(d in f){if(f.hasOwnProperty(d)){this.dom.style[b.normalize(d)]=f[d]}}return this},applyStyles:function(e){if(e){var d,c,f=this.dom;if(typeof e=="function"){e=e.call()}if(typeof e=="string"){e=e.trim().split(/\s*(?::|;)\s*/);for(d=0,c=e.length;d<c;){f.style[b.normalize(e[d++])]=e[d++]}}else{if(typeof e=="object"){this.setStyle(e)}}}},getHeight:function(d){var e=this.dom,c=d?(e.clientHeight-this.getPadding("tb")):e.offsetHeight;return c>0?c:0},getWidth:function(c){var e=this.dom,d=c?(e.clientWidth-this.getPadding("lr")):e.offsetWidth;return d>0?d:0},setWidth:function(c){var d=this;d.dom.style.width=b.addUnits(c);return d},setHeight:function(c){var d=this;d.dom.style.height=b.addUnits(c);return d},setSize:function(e,c){var f=this,d=f.dom.style;if(Ext.isObject(e)){c=e.height;e=e.width}d.width=b.addUnits(e);d.height=b.addUnits(c);return f},getBorderWidth:function(c){return this.sumStyles(c,b.borders)},getPadding:function(c){return this.sumStyles(c,b.paddings)},getMargin:function(c){return this.sumStyles(c,b.margins)},getViewSize:function(){var c=document,d=this.dom;if(d==c||d==c.body){return{width:b.getViewportWidth(),height:b.getViewportHeight()}}else{return{width:d.clientWidth,height:d.clientHeight}}},getSize:function(d){var c=this.dom;return{width:Math.max(0,d?(c.clientWidth-this.getPadding("lr")):c.offsetWidth),height:Math.max(0,d?(c.clientHeight-this.getPadding("tb")):c.offsetHeight)}},repaint:function(){var c=this.dom;this.addCls("x-repaint");c.style.background="transparent none";setTimeout(function(){c.style.background=null;Ext.get(c).removeClass("x-repaint")},1);return this},getOuterWidth:function(){return this.getWidth()+this.getMargin("lr")},getOuterHeight:function(){return this.getHeight()+this.getMargin("tb")},sumStyles:function(h,g){var j=0,d=h.match(/\w/g),c=d.length,f,e;for(e=0;e<c;e++){f=d[e]&&parseFloat(this.getStyle(g[d[e]]))||0;if(f){j+=Math.abs(f)}}return j}})})();Ext.Element.addMethods({findParent:function(h,g,c){var e=this.dom,a=document.body,f=0,d;g=g||50;if(isNaN(g)){d=Ext.getDom(g);g=Number.MAX_VALUE}while(e&&e.nodeType==1&&f<g&&e!=a&&e!=d){if(Ext.DomQuery.is(e,h)){return c?Ext.get(e):e}f++;e=e.parentNode}return null},getScrollParent:function(){var b=this.dom,a;while(b&&b!=document.body){if(b.id&&(a=Ext.ScrollManager.get(b.id))){return a}b=b.parentNode}return null},findParentNode:function(d,c,a){var b=Ext.fly(this.dom.parentNode,"_internal");return b?b.findParent(d,c,a):null},up:function(b,a){return this.findParentNode(b,a,true)},select:function(a,b){return Ext.Element.select(a,this.dom,b)},query:function(a){return Ext.DomQuery.select(a,this.dom)},down:function(a,b){var c=Ext.DomQuery.selectNode(a,this.dom);return b?c:Ext.get(c)},child:function(a,b){var d,c=this,e;e=Ext.get(c).id;e=e.replace(/[\.:]/g,"\\$0");d=Ext.DomQuery.selectNode("#"+e+" > "+a,c.dom);return b?d:Ext.get(d)},parent:function(a,b){return this.matchNode("parentNode","parentNode",a,b)},next:function(a,b){return this.matchNode("nextSibling","nextSibling",a,b)},prev:function(a,b){return this.matchNode("previousSibling","previousSibling",a,b)},first:function(a,b){return this.matchNode("nextSibling","firstChild",a,b)},last:function(a,b){return this.matchNode("previousSibling","lastChild",a,b)},matchNode:function(b,e,a,c){var d=this.dom[e];while(d){if(d.nodeType==1&&(!a||Ext.DomQuery.is(d,a))){return !c?Ext.get(d):d}d=d[b]}return null}});Ext.Element.addMethods({appendChild:function(a){return Ext.get(a).appendTo(this)},appendTo:function(a){Ext.getDom(a).appendChild(this.dom);return this},insertBefore:function(a){a=Ext.getDom(a);a.parentNode.insertBefore(this.dom,a);return this},insertAfter:function(a){a=Ext.getDom(a);a.parentNode.insertBefore(this.dom,a.nextSibling);return this},insertFirst:function(b,a){b=b||{};if(b.nodeType||b.dom||typeof b=="string"){b=Ext.getDom(b);this.dom.insertBefore(b,this.dom.firstChild);return !a?Ext.get(b):b}else{return this.createChild(b,this.dom.firstChild,a)}},insertSibling:function(e,c,d){var f=this,b,a=(c||"before").toLowerCase()=="after",g;if(Ext.isArray(e)){g=f;Ext.each(e,function(h){b=Ext.fly(g,"_internal").insertSibling(h,c,d);if(a){g=b}});return b}e=e||{};if(e.nodeType||e.dom){b=f.dom.parentNode.insertBefore(Ext.getDom(e),a?f.dom.nextSibling:f.dom);if(!d){b=Ext.get(b)}}else{if(a&&!f.dom.nextSibling){b=Ext.DomHelper.append(f.dom.parentNode,e,!d)}else{b=Ext.DomHelper[a?"insertAfter":"insertBefore"](f.dom,e,!d)}}return b},replace:function(a){a=Ext.get(a);this.insertBefore(a);a.remove();return this},createChild:function(b,a,c){b=b||{tag:"div"};if(a){return Ext.DomHelper.insertBefore(a,b,c!==true)}else{return Ext.DomHelper[!this.dom.firstChild?"overwrite":"append"](this.dom,b,c!==true)}},wrap:function(a,b){var c=Ext.DomHelper.insertBefore(this.dom,a||{tag:"div"},!b);c.dom?c.dom.appendChild(this.dom):c.appendChild(this.dom);return c},insertHtml:function(b,c,a){var d=Ext.DomHelper.insertHtml(b,this.dom,c);return a?Ext.get(d):d}});Ext.Element.addMethods({getAnchorXY:function(f,k,n){f=(f||"tl").toLowerCase();n=n||{};var j=this,a=j.dom==document.body||j.dom==document,b=n.width||a?window.innerWidth:j.getWidth(),l=n.height||a?window.innerHeight:j.getHeight(),m,c=Math.round,d=j.getXY(),h=a?0:!k?d[0]:0,g=a?0:!k?d[1]:0,e={c:[c(b*0.5),c(l*0.5)],t:[c(b*0.5),0],l:[0,c(l*0.5)],r:[b,c(l*0.5)],b:[c(b*0.5),l],tl:[0,0],bl:[0,l],br:[b,l],tr:[b,0]};m=e[f];return[m[0]+h,m[1]+g]},getAlignToXY:function(e,A,h){e=Ext.get(e);if(!e||!e.dom){throw"Element.alignToXY with an element that doesn't exist"}h=h||[0,0];if(!A||A=="?"){A="tl-bl?"}else{if(!(/-/).test(A)&&A!==""){A="tl-"+A}}A=A.toLowerCase();var w=this,d=A.match(/^([a-z]+)-([a-z]+)(\?)?$/),n=window.innerWidth,v=window.innerHeight,c="",a="",B,z,m,l,r,p,f,b,k,j,s,q,g,u;if(!d){throw"Element.alignTo with an invalid alignment "+A}c=d[1];a=d[2];u=!!d[3];B=w.getAnchorXY(c,true);z=e.getAnchorXY(a,false);m=z[0]-B[0]+h[0];l=z[1]-B[1]+h[1];if(u){s=w.getWidth();q=w.getHeight();g=e.getPageBox();b=c.charAt(0);f=c.charAt(c.length-1);j=a.charAt(0);k=a.charAt(a.length-1);p=((b=="t"&&j=="b")||(b=="b"&&j=="t"));r=((f=="r"&&k=="l")||(f=="l"&&k=="r"));if(m+s>n){m=r?g.left-s:n-s}if(m<0){m=r?g.right:0}if(l+q>v){l=p?g.top-q:v-q}if(l<0){l=p?g.bottom:0}}return[m,l]}});Ext.CompositeElement=function(b,a){this.elements=[];this.add(b,a);this.el=new Ext.Element.Flyweight()};Ext.CompositeElement.prototype={isComposite:true,getElement:function(a){var b=this.el;b.dom=a;b.id=a.id;return b},transformElement:function(a){return Ext.getDom(a)},getCount:function(){return this.elements.length},add:function(d,b){var e=this,f=e.elements;if(!d){return this}if(typeof d=="string"){d=Ext.Element.selectorFunction(d,b)}else{if(d.isComposite){d=d.elements}else{if(!Ext.isIterable(d)){d=[d]}}}for(var c=0,a=d.length;c<a;++c){f.push(e.transformElement(d[c]))}return e},invoke:function(f,b){var g=this,d=g.elements,a=d.length,h,c;for(c=0;c<a;c++){h=d[c];if(h){Ext.Element.prototype[f].apply(g.getElement(h),b)}}return g},item:function(b){var d=this,c=d.elements[b],a=null;if(c){a=d.getElement(c)}return a},addListener:function(b,h,g,f){var d=this.elements,a=d.length,c,j;for(c=0;c<a;c++){j=d[c];if(j){Ext.EventManager.on(j,b,h,g||j,f)}}return this},each:function(f,d){var g=this,c=g.elements,a=c.length,b,h;for(b=0;b<a;b++){h=c[b];if(h){h=this.getElement(h);if(f.call(d||h,h,g,b)){break}}}return g},fill:function(a){var b=this;b.elements=[];b.add(a);return b},filter:function(a){var b=[],d=this,e=d.elements,c=Ext.isFunction(a)?a:function(f){return f.is(a)};d.each(function(h,f,g){if(c(h,g)!==false){b[b.length]=d.transformElement(h)}});d.elements=b;return d},first:function(){return this.item(0)},last:function(){return this.item(this.getCount()-1)},contains:function(a){return this.indexOf(a)!=-1},indexOf:function(a){return this.elements.indexOf(this.transformElement(a))},clear:function(){this.elements=[]}};Ext.CompositeElement.prototype.on=Ext.CompositeElement.prototype.addListener;(function(){var c,b=Ext.Element.prototype,a=Ext.CompositeElement.prototype;for(c in b){if(Ext.isFunction(b[c])){(function(d){a[d]=a[d]||function(){return this.invoke(d,arguments)}}).call(a,c)}}})();if(Ext.DomQuery){Ext.Element.selectorFunction=Ext.DomQuery.select}Ext.Element.select=function(a,b,d){var c;d=(d===false)?false:true;if(typeof a=="string"){c=Ext.Element.selectorFunction(a,b)}else{if(a.length!==undefined){c=a}else{throw"Invalid selector"}}return d?new Ext.CompositeElement(c):c};Ext.select=Ext.Element.select;Ext.CompositeElementLite=Ext.CompositeElement;Ext.apply(Ext.CompositeElementLite.prototype,{addElements:function(c,a){if(!c){return this}if(typeof c=="string"){c=Ext.Element.selectorFunction(c,a)}var b=this.elements;Ext.each(c,function(d){b.push(Ext.get(d))});return this},removeElement:function(d,e){var c=this,a=this.elements,b;Ext.each(d,function(f){if((b=(a[f]||a[f=c.indexOf(f)]))){if(e){if(b.dom){b.remove()}else{Ext.removeNode(b)}}a.splice(f,1)}});return this},replaceElement:function(e,c,a){var b=!isNaN(e)?e:this.indexOf(e),f;if(b>-1){c=Ext.getDom(c);if(a){f=this.elements[b];f.parentNode.insertBefore(c,f);Ext.removeNode(f)}this.elements.splice(b,1,c)}return this}});Ext.DomHelper={emptyTags:/^(?:br|frame|hr|img|input|link|meta|range|spacer|wbr|area|param|col)$/i,confRe:/tag|children|cn|html$/i,endRe:/end/i,markup:function(h){var d="",c,g,f,a,j;if(typeof h=="string"){d=h}else{if(Ext.isArray(h)){for(var e=0;e<h.length;e++){if(h[e]){d+=this.markup(h[e])}}}else{d+="<"+(h.tag=h.tag||"div");for(c in h){if(!h.hasOwnProperty(c)){continue}g=h[c];if(!this.confRe.test(c)){if(typeof g=="object"){d+=" "+c+'="';for(f in g){if(!g.hasOwnProperty(f)){continue}d+=f+":"+g[f]+";"}d+='"'}else{d+=" "+({cls:"class",htmlFor:"for"}[c]||c)+'="'+g+'"'}}}if(this.emptyTags.test(h.tag)){d+="/>"}else{d+=">";if((j=h.children||h.cn)){d+=this.markup(j)}else{if(h.html){d+=h.html}}d+="</"+h.tag+">"}}}return d},applyStyles:function(d,e){if(e){var b=0,a,c;d=Ext.fly(d);if(typeof e=="function"){e=e.call()}if(typeof e=="string"){e=e.trim().split(/\s*(?::|;)\s*/);for(a=e.length;b<a;){d.setStyle(e[b++],e[b++])}}else{if(Ext.isObject(e)){d.setStyle(e)}}}},insertHtml:function(f,a,g){var e={},c,j,h,k,d,b;f=f.toLowerCase();e.beforebegin=["BeforeBegin","previousSibling"];e.afterend=["AfterEnd","nextSibling"];h=a.ownerDocument.createRange();j="setStart"+(this.endRe.test(f)?"After":"Before");if(e[f]){h[j](a);k=h.createContextualFragment(g);a.parentNode.insertBefore(k,f=="beforebegin"?a:a.nextSibling);return a[(f=="beforebegin"?"previous":"next")+"Sibling"]}else{d=(f=="afterbegin"?"first":"last")+"Child";if(a.firstChild){h[j](a[d]);k=h.createContextualFragment(g);if(f=="afterbegin"){a.insertBefore(k,a.firstChild)}else{a.appendChild(k)}}else{a.innerHTML=g}return a[d]}throw'Illegal insertion point -> "'+f+'"'},insertBefore:function(a,c,b){return this.doInsert(a,c,b,"beforebegin")},insertAfter:function(a,c,b){return this.doInsert(a,c,b,"afterend","nextSibling")},insertFirst:function(a,c,b){return this.doInsert(a,c,b,"afterbegin","firstChild")},append:function(a,c,b){return this.doInsert(a,c,b,"beforeend","",true)},overwrite:function(a,c,b){a=Ext.getDom(a);a.innerHTML=this.markup(c);return b?Ext.get(a.firstChild):a.firstChild},doInsert:function(d,f,e,g,c,a){var b=this.insertHtml(g,Ext.getDom(d),this.markup(f));return e?Ext.get(b,true):b}};Ext.DomQuery={select:function(h,b){var g=[],d,f,e,c,a;b=b||document;if(typeof b=="string"){b=document.getElementById(b)}h=h.split(",");for(f=0,c=h.length;f<c;f++){if(typeof h[f]=="string"){d=b.querySelectorAll(h[f]);for(e=0,a=d.length;e<a;e++){g.push(d[e])}}}return g},selectNode:function(b,a){return Ext.DomQuery.select(b,a)[0]},is:function(a,b){if(typeof a=="string"){a=document.getElementById(a)}return Ext.DomQuery.select(b).indexOf(a)!==-1}};Ext.Element.selectorFunction=Ext.DomQuery.select;Ext.query=Ext.DomQuery.select;Ext.Anim=Ext.extend(Object,{isAnim:true,disableAnimations:(Ext.is.Android||Ext.is.Blackberry)?true:false,defaultConfig:{from:{},to:{},duration:250,delay:0,easing:"ease-in-out",autoClear:true,autoReset:false,autoShow:true,out:true,direction:null,reverse:false},opposites:{left:"right",right:"left",up:"down",down:"up"},constructor:function(a){a=Ext.apply({},a||{},this.defaultConfig);this.config=a;Ext.Anim.superclass.constructor.call(this);this.running=[]},initConfig:function(c,b){var e=this,d={},a=Ext.apply({},b||{},e.config);a.el=c=Ext.get(c);if(a.reverse&&e.opposites[a.direction]){a.direction=e.opposites[a.direction]}if(e.config.before){e.config.before.call(a,c,a)}if(b.before){b.before.call(a.scope||a,c,a)}return a},run:function(c,a){c=Ext.get(c);a=a||{};var d=this,b=c.dom.style,e,f=a.after;a=this.initConfig(c,a);if(this.disableAnimations){for(e in a.to){if(!a.to.hasOwnProperty(e)){continue}b[e]=a.to[e]}this.onTransitionEnd(null,c,{config:a,after:f});return}c.un("webkitTransitionEnd",d.onTransitionEnd,d);b.webkitTransitionDuration="0ms";for(e in a.from){if(!a.from.hasOwnProperty(e)){continue}b[e]=a.from[e]}setTimeout(function(){if(a.is3d===true){c.parent().setStyle({"-webkit-perspective":"1200","-webkit-transform-style":"preserve-3d"})}b.webkitTransitionDuration=a.duration+"ms";b.webkitTransitionProperty="all";b.webkitTransitionTimingFunction=a.easing;c.on("webkitTransitionEnd",d.onTransitionEnd,d,{single:true,config:a,after:f});for(e in a.to){if(!a.to.hasOwnProperty(e)){continue}b[e]=a.to[e]}},a.delay||5);d.running[c.id]=a;return d},onTransitionEnd:function(e,c,g){c=Ext.get(c);var b=c.dom.style,a=g.config,f,d=this;if(a.autoClear){for(f in a.to){if(!a.to.hasOwnProperty(f)){continue}b[f]=""}}b.webkitTransitionDuration=null;b.webkitTransitionProperty=null;b.webkitTransitionTimingFunction=null;if(a.is3d){c.parent().setStyle({"-webkit-perspective":"","-webkit-transform-style":""})}if(d.config.after){d.config.after.call(a,c,a)}if(g.after){g.after.call(a.scope||d,c,a)}delete d.running[c.id]}});Ext.Anim.seed=1000;Ext.Anim.run=function(b,c,a){if(b.isComponent){b=b.el}a=a||{};if(c.isAnim){c.run(b,a)}else{if(Ext.isObject(c)){if(a.before&&c.before){a.before=a.before.createInterceptor(c.before,c.scope)}if(a.after&&c.after){a.after=a.after.createInterceptor(c.after,c.scope)}a=Ext.apply({},a,c);c=c.type}if(!Ext.anims[c]){throw c+" is not a valid animation type."}else{if(b&&b.dom){Ext.anims[c].run(b,a)}}}};Ext.anims={fade:new Ext.Anim({before:function(b){var c=1,a=1,e=b.getStyle("z-index")=="auto"?0:b.getStyle("z-index"),d=e;if(this.out){a=0}else{d=e+1;c=0}this.from={opacity:c,"z-index":d};this.to={opacity:a,"z-index":d}}}),slide:new Ext.Anim({direction:"left",cover:false,reveal:false,before:function(b){var a=b.getStyle("z-index")=="auto"?0:b.getStyle("z-index"),e=a+1,h=0,f=0,j=0,g=0,c=b.getHeight(),d=b.getWidth();if(this.direction=="left"||this.direction=="right"){if(this.out==true){h=-d}else{j=d}}else{if(this.direction=="up"||this.direction=="down"){if(this.out==true){f=-c}else{g=c}}}if(this.direction=="right"||this.direction=="down"){f*=-1;h*=-1;g*=-1;j*=-1}if(this.cover&&this.out){h=0;f=0;e=a}else{if(this.reveal&&!this.out){j=0;g=0;e=a}}this.from={"-webkit-transform":"translate3d("+j+"px, "+g+"px, 0)","z-index":e,opacity:0.99};this.to={"-webkit-transform":"translate3d("+h+"px, "+f+"px, 0)","z-index":e,opacity:1}}}),cardslide:new Ext.Anim({direction:"left",cover:false,reveal:false,previousIndex:0,newIndex:0,before:function(b){var a=b.getStyle("z-index")=="auto"?0:b.getStyle("z-index"),e=a+1,h=0,f=0,j=0,g=0,c=b.getHeight(),d=b.getWidth();if(/left|right/i.test(this.direction)){if(this.previousIndex||this.newIndex){this.direction=this.previousIndex>this.newIndex?"right":"left"}if(this.out===true){h=-d}else{j=d}}if(this.direction=="right"){f*=-1;h*=-1;g*=-1;j*=-1}if(this.cover&&this.out){h=0;f=0;e=a}else{if(this.reveal&&!this.out){j=0;g=0;e=a}}this.from={"-webkit-transform":"translate3d("+j+"px, "+g+"px, 0)","z-index":e,opacity:0.99};this.to={"-webkit-transform":"translate3d("+h+"px, "+f+"px, 0)","z-index":e,opacity:1}}}),flip:new Ext.Anim({is3d:true,direction:"left",before:function(c){var f="Y",a=1,b=1,e=0,d=0;if(this.out){d=-180;b=0.8}else{e=180;a=0.8}if(this.direction=="up"||this.direction=="down"){f="X"}if(this.direction=="right"||this.direction=="left"){d*=-1;e*=-1}this.from={"-webkit-transform":"rotate"+f+"("+e+"deg) scale("+a+")","-webkit-backface-visibility":"hidden"};this.to={"-webkit-transform":"rotate"+f+"("+d+"deg) scale("+b+")","-webkit-backface-visibility":"hidden"}}}),cube:new Ext.Anim({is3d:true,direction:"left",style:"outer",before:function(b){var p="0% 0%",q=0,a=0,l="Y",h=0,j=0,m=1,e=1,g,f=b.getWidth(),d=b.getHeight(),n=true,c=" translateX(0)",k="";if(this.direction=="left"||this.direction=="right"){if(this.out){p="100% 100%";j=f;e=0.5;a=-90}else{p="0% 0%";h=f;m=0.5;q=90}}else{if(this.direction=="up"||this.direction=="down"){l="X";if(this.out){p="100% 100%";j=d;a=90}else{p="0% 0%";h=d;q=-90}}}if(this.direction=="down"||this.direction=="right"){q*=-1;a*=-1;p=(p=="0% 0%")?"100% 100%":"0% 0%"}if(this.style=="inner"){h*=-1;j*=-1;q*=-1;a*=-1;if(!this.out){k=" translateX(0px)";p="0% 50%"}else{k=c;p="100% 50%"}}this.from={"-webkit-transform":"rotate"+l+"("+q+"deg)"+(n?" translateZ("+h+"px)":"")+c,"-webkit-transform-origin":p};this.to={"-webkit-transform":"rotate"+l+"("+a+"deg) translateZ("+j+"px)"+k,"-webkit-transform-origin":p}},duration:250}),pop:new Ext.Anim({scaleOnExit:true,before:function(d){var b=1,c=1,g=1,a=1,h=d.getStyle("z-index")=="auto"?0:d.getStyle("z-index"),f=h,e=h;if(!this.out){b=0.01;f=h+1;e=h+1;g=0}else{if(this.scaleOnExit){c=0.01;a=0}else{a=0.8}}this.from={"-webkit-transform":"scale("+b+")","-webkit-transform-origin":"50% 50%",opacity:g,"z-index":f};this.to={"-webkit-transform":"scale("+c+")","-webkit-transform-origin":"50% 50%",opacity:a,"z-index":e}}}),wipe:new Ext.Anim({before:function(d){var e=d.getStyle("z-index"),a="",b="100%",c="100%";if(!this.out){zindex=e+1;a="-webkit-gradient(linear, left bottom, right bottom, from(transparent), to(#000), color-stop(66%, #000), color-stop(33%, transparent))";b=d.getHeight()*100+"px";c=d.getHeight();this.from={"-webkit-mask-image":a,"-webkit-mask-size":d.getWidth()*3+"px "+d.getHeight()+"px","z-index":zIndex,"-webkit-mask-position-x":0};this.to={"-webkit-mask-image":a,"-webkit-mask-size":d.getWidth()*3+"px "+d.getHeight()+"px","z-index":zIndex,"-webkit-mask-position-x":-d.getWidth()*2+"px"}}},duration:500})};Ext.apply(Ext,{version:"0.9.5",versionDetail:{major:0,minor:9,patch:5},setup:function(b){if(b&&typeof b=="object"){if(b.addMetaTags!==false){var c=Ext.get(document.getElementsByTagName("head")[0]),a,e;if(!Ext.is.Desktop){a=Ext.get(document.createElement("meta"));var d="1.0";if(window.devicePixelRatio&&window.devicePixelRatio!=1&&window.devicePixelRatio!=0){var d=1.5/window.devicePixelRatio}a.set({name:"viewport",content:"width=device-width, user-scalable=no, initial-scale="+d+", maximum-scale="+d+";"});c.appendChild(a)}if(Ext.is.iOS){if(b.fullscreen!==false){a=Ext.get(document.createElement("meta"));a.set({name:"apple-mobile-web-app-capable",content:"yes"});c.appendChild(a);if(Ext.isString(b.statusBarStyle)){a=Ext.get(document.createElement("meta"));a.set({name:"apple-mobile-web-app-status-bar-style",content:b.statusBarStyle});c.appendChild(a)}}if(b.tabletStartupScreen&&Ext.is.iPad){a=Ext.get(document.createElement("link"));a.set({rel:"apple-touch-startup-image",href:b.tabletStartupScreen});c.appendChild(a)}if(b.phoneStartupScreen&&!Ext.is.iPad){a=Ext.get(document.createElement("link"));a.set({rel:"apple-touch-startup-image",href:b.phoneStartupScreen});c.appendChild(a)}if(b.icon){b.phoneIcon=b.tabletIcon=b.icon}e=(b.glossOnIcon===false)?"-precomposed":"";if(Ext.is.iPad&&Ext.isString(b.tabletIcon)){a=Ext.get(document.createElement("link"));a.set({rel:"apple-touch-icon"+e,href:b.tabletIcon});c.appendChild(a)}else{if(!Ext.is.iPad&&Ext.isString(b.phoneIcon)){a=Ext.get(document.createElement("link"));a.set({rel:"apple-touch-icon"+e,href:b.phoneIcon});c.appendChild(a)}}}}if(Ext.isFunction(b.onReady)){Ext.onReady(function(){var f=arguments;if(b.fullscreen!==false){Ext.stretchEl=Ext.getBody().createChild({cls:"x-body-stretcher"});Ext.NELAStrechEl(true);Ext.hideAddressBar(function(){if(Ext.is.Android){setInterval(function(){window.scrollTo(0,Ext.is.Android?1:0)},250)}else{Ext.hideAddressBar();document.body.addEventListener("touchstart",function(){Ext.hideAddressBar()},true)}b.onReady.apply(this,f)},this)}else{b.onReady.apply(this,f)}},b.scope)}}},hideAddressBar:function(b,a){setTimeout(function(){window.scrollTo(0,Ext.is.Android?1:0);if(b){setTimeout(function(){b.apply(a||this)},300)}},100)},getDom:function(a){if(!a||!document){return null}return a.dom?a.dom:(typeof a=="string"?document.getElementById(a):a)},removeNode:function(a){if(a&&a.parentNode&&a.tagName!="BODY"){Ext.EventManager.removeAll(a);a.parentNode.removeChild(a);delete Ext.cache[a.id]}}});(function(){var a=function(){var c=Ext.getBody(),b=[];if(!c){return false}var d=Ext.is;if(d.Phone){b.push("x-phone")}else{if(d.Tablet){b.push("x-tablet")}else{if(d.Desktop){b.push("x-desktop")}}}if(d.iPad){b.push("x-ipad")}if(d.iOS){b.push("x-ios")}if(d.Android){b.push("x-android")}if(b.length){c.addCls(b)}return true};if(!a()){Ext.onReady(a)}})();Ext.TouchEventManager=Ext.apply({},{swipeThreshold:35,scrollThreshold:Ext.is.Android?8:5,tapThreshold:Ext.is.Android?8:5,touchEndThreshold:35,touchDownInterval:250,swipeTime:1000,doubleTapThreshold:300,multiTouchendThreshold:50,init:function(){this.targets={all:[],touchstart:[],touchdown:[],touchmove:[],touchend:[],tap:[],tapstart:[],taphold:[],tapcancel:[],doubletap:[],swipe:[],scrollstart:[],scroll:[],scrollend:[],pinch:[],pinchstart:[],pinchend:[]};this.listeners={};this.tracks={};this.doubleTapTargets={};this.pinchTargets={};if(Ext.supports.Touch){document.addEventListener("touchstart",this.onTouchStart,false);document.addEventListener("touchmove",this.onTouchMove,false);document.addEventListener("touchend",this.onTouchEnd,false)}else{document.addEventListener("mousedown",this.onTouchStart,false);document.addEventListener("mousemove",this.onTouchMove,false);document.addEventListener("mouseup",this.onTouchEnd,false)}},onTouchStart:function(g){var d=Ext.TouchEventManager,f=Ext.supports.Touch?(g.touches||g.touch&&[g.touch]||null):[g],c=f.length,b;for(b=0;b<c;b++){var a=d.startTrack(f[b],g)}d.multiTouch=c>1},startTrack:function(d,g){var j=this,h=(d.target.nodeType==3)?d.target.parentNode:d.target,l=h,f=j.targets,m=d.identifier!=undefined?d.identifier:"mouse",k,c,a,b;if(j.tracks[m]){b=j.tracks[m];if(b.events&&(b.events.taphold||b.events.touchdown)){clearInterval(b.touchDownIntervalId)}}b=j.tracks[m]={browserEvent:g,startTime:g.timeStamp,previousTime:g.timeStamp,startX:d.pageX,startY:d.pageY,previousX:d.pageX,previousY:d.pageY,touch:d,target:h,scrolling:false,end:false,move:false,targets:{},scrollBounds:{right:window.innerWidth+document.body.scrollLeft,bottom:window.innerHeight+document.body.scrollTop}};if(Ext.is.Android||Ext.is.Blackberry){if(!(/area|input|select|textarea/i.test(h.tagName))){g.preventDefault();g.stopPropagation()}}while(l){if(j.targets.all.indexOf(l)!==-1){a=l.id;k=j.listeners[a];b.events=b.events||{};for(c in k){if(k.hasOwnProperty(c)){b.events[c]=b.events[c]||{};b.events[c][a]=k[c];b.events[c][a].dom=l;b.targets[a]=k[c]}}}l=l.parentNode}j.lastTouchId=m;if(b.events){g={time:g.timeStamp,pageX:d.pageX,pageY:d.pageY,touch:d,touches:g.touches?g.touches:[g.touch],browserEvent:g};if(b.events.touchstart&&j.fireListeners("touchstart",b,g)===false){b.end=true;return}if(b.events.tapstart&&j.fireListeners("tapstart",b,g)===false){b.end=true;b.tap=true;return}if(b.events.taphold||b.events.touchdown){b.touchDownIntervalId=setInterval(j.touchDownHandler.createDelegate(b),j.touchDownInterval);b.tap=true}if(b.events.tap||b.events.tapcancel||b.events.doubletap){b.tap=true}b.move=b.end=true}return b},onTouchMove:function(O){var n=Ext.TouchEventManager,P=Ext.supports.Touch?O.changedTouches:[O],w=P.length,N,M,p,E;O.preventDefault();O.stopPropagation();for(N=0;N<w;N++){M=P[N];p=n.tracks[M.identifier!=undefined?M.identifier:"mouse"];if(!p||!p.move){continue}var s=p.startX,r=p.startY,m=M.pageX,l=M.pageY,A=p.previousX,z=p.previousY,j=m-s,h=l-r,b=Math.abs(j),a=Math.abs(h),L=m-A,K=l-z,J=O.timeStamp,c=p.startTime,u=p.previousTime,I=J-c,g=J-u,f=O;if(p.events.touchdown&&!p.touchDownIntervalId){p.touchDownIntervalId=setInterval(n.touchDownHandler.createDelegate(p),n.touchDownInterval)}if(p.tap&&((b>=n.tapThreshold)||(a>=n.tapThreshold))){if(p.events.taphold){delete p.events.taphold;if(!p.events.touchdown){clearInterval(p.touchDownIntervalId);p.touchDownIntervalId=null}}if(p.events.tapcancel){n.fireListeners("tapcancel",p,{originalEvent:O});delete p.events.tapcancel}if(p.events.doubletap){delete p.events.doubletap}delete p.events.tap;p.tap=false}O={pageX:m,pageY:l,touches:f.touches,startX:s,startY:r,previousX:p.previousX,previousY:p.previousY,deltaX:j,deltaY:h,previousDeltaX:L,previousDeltaY:K,time:J,startTime:c,previousTime:u,deltaTime:I,previousDeltaTime:g,browserEvent:f};p.lastEvent=O;if(p.events.touchmove&&n.fireListeners("touchmove",p,O)===false){p.previousTime=J;p.previousX=m;p.previousY=l;p.previousDeltaX=L;p.previousDeltaY=K;continue}if(!p.scrolling&&p.events.swipe){if(a-b>2||I>n.swipeTime){delete p.events.swipe}else{if(b>n.swipeThreshold&&b>a){delete p.events.scroll;delete p.events.scrollstart;delete p.events.scrollend;n.fireListeners("swipe",p,{browserEvent:f,direction:(j<0)?"left":"right",distance:b,time:J,deltaTime:I});delete p.events.swipe}}continue}if(n.multiTouch&&!p.scrolling&&p.events.pinch){var d,q,B,k=n.pinch;if(!p.pinching&&!k){for(var H in n.tracks){if(n.tracks[H]!=p){d=n.pinchTargets[0]=n.tracks[H]}}if(d!=undefined){n.pinchTargets[1]=p;delete p.events.scroll;delete p.events.scrollstart;delete p.events.scrollend;delete p.events.swipe;delete d.events.scroll;delete d.events.scrollstart;delete d.events.scrollend;delete d.events.swipe;O=k=n.pinch={browserEvent:f,touches:[p.touch,d.touch],distance:Math.sqrt(Math.pow(Math.abs(p.touch.pageX-d.touch.pageX),2)+Math.pow(Math.abs(p.touch.pageY-d.touch.pageY),2))};p.pinching=d.pinching=true;n.fireListeners("pinchstart",p,O);k.previousDistance=k.distance;k.previousScale=1;return}}if(p.pinching&&k){q=Math.sqrt(Math.pow(Math.abs(k.touches[0].pageX-k.touches[1].pageX),2)+Math.pow(Math.abs(k.touches[0].pageY-k.touches[1].pageY),2));B=q/k.distance;O={browserEvent:p.browserEvent,time:J,touches:k.touches,scale:B,deltaScale:B-1,previousScale:k.previousScale,previousDeltaScale:B-k.previousScale,distance:q,deltaDistance:q-k.distance,startDistance:k.distance,previousDistance:k.previousDistance,previousDeltaDistance:q-k.previousDistance};n.fireListeners("pinch",p,O);k.previousScale=B;k.previousDistance=q;return}}if(p.events.scroll||p.events.scrollstart||p.events.scrollend){if(!p.scrolling&&(b>=n.scrollThreshold||a>=n.scrollThreshold)){p.scrolling=true;delete p.events.swipe;var D=p.targets,v,C,G,F;F=0;for(E in D){if(D.hasOwnProperty(E)){F++}}if(F>1){for(E in D){if(D.hasOwnProperty(E)){for(G=0,F=D[E].length;G<F;G++){v=D[E][G].options;if(!v){continue}if(v&&(v.vertical===true&&v.horizontal===false&&b>=a)||(v.vertical===false&&v.horizontal===true&&b<=a)){n.onTouchEnd(f);for(C in p.events){delete p.events[C][E]}}}}}}if(p.events.scrollstart){n.fireListeners("scrollstart",p,{browserEvent:p.browserEvent,time:J,pageX:m,pageY:l})}}else{if(p.scrolling){n.fireListeners("scroll",p,O)}}}if(!p.tap){if(b>a){if(j>0){if(p.scrollBounds.right-m<n.touchEndThreshold){n.onTouchEnd(f);return}}else{if(m<n.touchEndThreshold){n.onTouchEnd(f);return}}}else{if(h>0){if(p.scrollBounds.bottom-l<n.touchEndThreshold){n.onTouchEnd(f);return}}else{if(l<n.touchEndThreshold){n.onTouchEnd(f);return}}}}p.previousTime=J;p.previousX=m;p.previousY=l;p.previousDeltaX=L;p.previousDeltaY=K}},onTouchEnd:function(h){var m=Ext.TouchEventManager,k=m.tracks,g=Ext.supports.Touch?h.changedTouches:[h],j=g.length,d,b,f,n,c;for(f=0;f<j;f++){d=g[f];b=k[d.identifier!=undefined?d.identifier:"mouse"];if(!b||!b.end){continue}c={browserEvent:h,pageX:b.previousX,pageY:b.previousY,deltaX:b.previousX-b.startX,deltaY:b.previousY-b.startY,previousDeltaX:b.previousDeltaX,previousDeltaY:b.previousDeltaY,deltaTime:h.timeStamp-b.startTime,previousDeltaTime:h.timeStamp-b.previousTime,time:h.timeStamp};if(b.events.touchend&&m.fireListeners("touchend",b,c)===false){break}if(b.events.taphold||b.events.touchdown){clearInterval(b.touchDownIntervalId);b.touchDownIntervalId=null}if(b.scrolling&&b.events.scrollend){m.fireListeners("scrollend",b,c)}else{if(b.events.tap){m.fireListeners("tap",b,{browserEvent:h,time:h.timeStamp,pageX:b.startX,pageY:b.startY,touch:b.touch})}}if(b.events.doubletap&&!m.multiTouch){n=b.target.id;if(!m.doubleTapTargets[n]){m.doubleTapTargets[n]=h.timeStamp}else{if(h.timeStamp-m.doubleTapTargets[n]<=m.doubleTapThreshold){m.fireListeners("doubletap",b,{browserEvent:h,time:h.timeStamp,pageX:b.startX,pageY:b.startY,touch:b.touch});delete m.doubleTapTargets[n]}else{m.doubleTapTargets[n]=h.timeStamp}}}delete k[d.identifier]}if(m.pinch){m.fireListeners("pinchend",b,c);m.pinchTargets={};m.pinch=null}for(var a in m.tracks){var l=m.tracks[a];if(l.touchDownIntervalId){clearInterval(l.touchDownIntervalId)}}m.tracks={}},touchDownHandler:function(){var c=Ext.TouchEventManager,a=this,d=(new Date()).getTime(),b=a.lastEvent||{};c.fireListeners("touchdown",a,{time:d,startTime:a.startTime,deltaTime:d-a.startTime,deltaX:b.deltaX,deltaY:b.deltaY,pageX:b.pageX,pageY:b.pageY,touch:a.touch});c.fireListeners("taphold",a,{time:d,startTime:a.startTime,deltaTime:d-a.startTime,pageX:a.startX,pageY:a.startY,touch:a.touch})},addEventListener:function(e,b,c,d){if(!this.targets[b]){return}if(!this.targets.all.contains(e)){this.targets.all.push(e)}if(!this.targets[b].contains(e)){this.targets[b].push(e)}var f=Ext.id(e),a;c.options=d;c.ename=b;this.listeners[f]=this.listeners[f]||{};this.listeners[f][b]=this.listeners[f][b]||[];this.listeners[f][b].push(c);for(f in this.tracks){if(!this.tracks.hasOwnProperty(f)){continue}a=this.tracks[f];if(a.events==undefined){a.events={}}if(a&&(e==document||e===a.target||Ext.get(e).contains(a.target))){a.events[b]=a.events[b]||{};a.events[b][f]=a.events[b][f]||[];a.events[b][f].push(c);if(/touchmove|touchdown|scroll|swipe|tap|doubletap/i.test(b)){a.move=true}if(/touchend|touchdown|scrollend|tapcancel|tap|doubletap|/i.test(b)){a.end=true}}}},removeEventListener:function(f,b,d){if(!this.targets[b]){return}this.targets[b].remove(f);var g=Ext.id(f),c=this.listeners[g],e,a=false;if(c&&c[b]){c[b].remove(d);for(e in c){if(c.hasOwnProperty(e)){a=true;break}}if(!c[b].length){delete c[b]}if(!a){this.targets.all.remove(f);delete c[g]}}},fireListeners:function(d,b,h){var l=Ext.TouchEventManager;h.type=d;h.target=b.target;h.touch=b.touch;h.identifier=b.touch.identifier;var g=b.events[d],j,m,c,a,f,k;if(g){for(a in g){if(g.hasOwnProperty(a)){m=g[a];for(f=0,k=m.length;f<k;f++){c=m[f];if(c.call(m.dom,h)===false||h.cancel===true){if(h.browserEvent){try{h.browserEvent.stopPropagation();h.browserEvent.preventDefault()}catch(h){}}return false}}}}}return true},createListenerWrap:Ext.EventManager.createListenerWrap});Ext.TouchEventObjectImpl=Ext.extend(Object,{constructor:function(a){if(a){this.setEvent(a)}},setEvent:function(a){this.event=a;Ext.apply(this,a);return this},stopEvent:function(){this.stopPropagation();this.preventDefault()},stopPropagation:function(){this.event.cancel=true},preventDefault:function(){this.event.prevent=true},getTarget:function(b,c,a){if(b){return Ext.fly(this.target).findParent(b,c,a)}else{return a?Ext.get(this.target):this.target}}});Ext.TouchEventObject=new Ext.TouchEventObjectImpl();Ext.util.TapRepeater=Ext.extend(Ext.util.Observable,{constructor:function(b,a){this.el=Ext.get(b);Ext.apply(this,a);this.addEvents("touchstart","tap","touchend");this.el.on({touchstart:this.onTouchStart,touchend:this.onTouchEnd,scope:this});if(this.preventDefault||this.stopDefault){this.el.on("tap",this.eventOptions,this)}Ext.util.TapRepeater.superclass.constructor.call(this)},interval:10,delay:250,preventDefault:true,stopDefault:false,timer:0,eventOptions:function(a){if(this.preventDefault){a.preventDefault()}if(this.stopDefault){a.stopEvent()}},destroy:function(){Ext.destroy(this.el);this.purgeListeners()},onTouchStart:function(a){clearTimeout(this.timer);if(this.pressClass){this.el.addCls(this.pressClass)}this.tapStartTime=new Date();this.fireEvent("touchstart",this,a);this.fireEvent("tap",this,a);if(this.accelerate){this.delay=400}this.timer=this.tap.defer(this.delay||this.interval,this,[a])},tap:function(a){this.fireEvent("tap",this,a);this.timer=this.tap.defer(this.accelerate?this.easeOutExpo(this.tapStartTime.getElapsed(),400,-390,12000):this.interval,this,[a])},easeOutExpo:function(e,a,g,f){return(e==f)?a+g:g*(-Math.pow(2,-10*e/f)+1)+a},onTouchEnd:function(a){clearTimeout(this.timer);this.el.removeClass(this.pressClass);this.fireEvent("touchend",this,a)}});if(!this.JSON){this.JSON={}}(function(){function f(n){return n<10?"0"+n:n}if(typeof Date.prototype.toJSON!=="function"){Date.prototype.toJSON=function(key){return isFinite(this.valueOf())?this.getUTCFullYear()+"-"+f(this.getUTCMonth()+1)+"-"+f(this.getUTCDate())+"T"+f(this.getUTCHours())+":"+f(this.getUTCMinutes())+":"+f(this.getUTCSeconds())+"Z":null};String.prototype.toJSON=Number.prototype.toJSON=Boolean.prototype.toJSON=function(key){return this.valueOf()}}var cx=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,escapable=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,gap,indent,meta={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},rep;function quote(string){escapable.lastIndex=0;return escapable.test(string)?'"'+string.replace(escapable,function(a){var c=meta[a];return typeof c==="string"?c:"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+string+'"'}function str(key,holder){var i,k,v,length,mind=gap,partial,value=holder[key];if(value&&typeof value==="object"&&typeof value.toJSON==="function"){value=value.toJSON(key)}if(typeof rep==="function"){value=rep.call(holder,key,value)}switch(typeof value){case"string":return quote(value);case"number":return isFinite(value)?String(value):"null";case"boolean":case"null":return String(value);case"object":if(!value){return"null"}gap+=indent;partial=[];if(Object.prototype.toString.apply(value)==="[object Array]"){length=value.length;for(i=0;i<length;i+=1){partial[i]=str(i,value)||"null"}v=partial.length===0?"[]":gap?"[\n"+gap+partial.join(",\n"+gap)+"\n"+mind+"]":"["+partial.join(",")+"]";gap=mind;return v}if(rep&&typeof rep==="object"){length=rep.length;for(i=0;i<length;i+=1){k=rep[i];if(typeof k==="string"){v=str(k,value);if(v){partial.push(quote(k)+(gap?": ":":")+v)}}}}else{for(k in value){if(Object.hasOwnProperty.call(value,k)){v=str(k,value);if(v){partial.push(quote(k)+(gap?": ":":")+v)}}}}v=partial.length===0?"{}":gap?"{\n"+gap+partial.join(",\n"+gap)+"\n"+mind+"}":"{"+partial.join(",")+"}";gap=mind;return v}}if(typeof JSON.stringify!=="function"){JSON.stringify=function(value,replacer,space){var i;gap="";indent="";if(typeof space==="number"){for(i=0;i<space;i+=1){indent+=" "}}else{if(typeof space==="string"){indent=space}}rep=replacer;if(replacer&&typeof replacer!=="function"&&(typeof replacer!=="object"||typeof replacer.length!=="number")){throw new Error("JSON.stringify")}return str("",{"":value})}}if(typeof JSON.parse!=="function"){JSON.parse=function(text,reviver){var j;function walk(holder,key){var k,v,value=holder[key];if(value&&typeof value==="object"){for(k in value){if(Object.hasOwnProperty.call(value,k)){v=walk(value,k);if(v!==undefined){value[k]=v}else{delete value[k]}}}}return reviver.call(holder,key,value)}text=String(text);cx.lastIndex=0;if(cx.test(text)){text=text.replace(cx,function(a){return"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)})}if(/^[\],:{}\s]*$/.test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,""))){j=eval("("+text+")");return typeof reviver==="function"?walk({"":j},""):j}throw new SyntaxError("JSON.parse")}}}());Ext.util.JSON={encode:function(a){return JSON.stringify(a)},decode:function(a){return JSON.parse(a)}};Ext.encode=Ext.util.JSON.encode;Ext.decode=Ext.util.JSON.decode;Ext.util.JSONP={queue:[],current:null,request:function(d){d=d||{};if(!d.url){return}var b=this;d.params=d.params||{};if(d.callbackKey){d.params[d.callbackKey]="Ext.util.JSONP.callback"}var c=Ext.urlEncode(d.params);var a=document.createElement("script");a.type="text/javascript";this.queue.push({url:d.url,script:a,callback:d.callback||function(){},scope:d.scope||window,params:c||null});if(!this.current){this.next()}},next:function(){this.current=null;if(this.queue.length){this.current=this.queue.shift();this.current.script.src=this.current.url+(this.current.params?("?"+this.current.params):"");document.getElementsByTagName("head")[0].appendChild(this.current.script)}},callback:function(a){this.current.callback.call(this.current.scope,a);document.getElementsByTagName("head")[0].removeChild(this.current.script);this.next()}};Ext.util.Scroller=Ext.extend(Ext.util.Observable,{bounces:(Ext.is.Android||Ext.is.Blackberry)?false:true,momentumResetTime:(Ext.is.Android||Ext.is.Blackberry)?1000:100,friction:0.3,acceleration:25,momentum:Ext.is.Blackberry?false:true,horizontal:false,vertical:true,snap:false,scrollbars:true,fps:60,springTension:0.3,ui:"dark",scrollToEasing:"cubic-bezier(0.4, .75, 0.5, .95)",scrollToDuration:300,snapDuration:150,preventActualScroll:false,translateOpen:(Ext.is.Android||Ext.is.Blackberry)?"translate(":"translate3d(",translateClose:(Ext.is.Android||Ext.is.Blackberry)?")":", 0px)",constructor:function(f,d){f=Ext.get(f);var g=this,a=Ext.ScrollManager.get(f.id);if(a){return Ext.apply(a,d)}d=d||{};Ext.apply(g,d);g.addEvents("scrollstart","scrollend","scroll");Ext.util.Scroller.superclass.constructor.call(g);a=g.scroller=this.el=f;this.id=f.id;Ext.ScrollManager.register(this);a.addCls("x-scroller");g.parent=a.parent();g.parent.addCls("x-scroller-parent");g.offset={x:0,y:0};g.omega=1-(g.friction/10);var h=g.eventTarget?Ext.get(g.eventTarget):g.parent;h.on({touchstart:g.onTouchStart,scrollstart:g.onScrollStart,scroll:g.onScroll,scrollend:g.onScrollEnd,horizontal:g.horizontal,vertical:g.vertical,scope:g});if(g.bounces!==false){var e=g.bounces==="both"||g.bounces===true,b=e||g.bounces==="horizontal",c=e||g.bounces==="vertical";g.bounces={horizontal:b,vertical:c}}if(g.scrollbars){if(g.horizontal){g.scrollbarX=new Ext.util.Scroller.Scrollbar(g,"horizontal")}if(g.vertical){g.scrollbarY=new Ext.util.Scroller.Scrollbar(g,"vertical")}}g.scroller.on({webkitTransitionEnd:g.onTransitionEnd,scope:g})},onTouchStart:function(f){var d=this,a=d.scroller,c=a.dom.style,b;if(!f||f.touches.length>1){return}d.updateBounds();d.followTouch=f.touch;if(d.animating){clearInterval(d.scrollInterval);if(d.inTransition){b=new WebKitCSSMatrix(window.getComputedStyle(a.dom).webkitTransform);c.webkitTransitionDuration="0ms";c.webkitTransform=d.translateOpen+b.m41+"px, "+b.m42+"px"+d.translateClose;d.offset={x:b.m41,y:b.m42};d.inTransition=false}d.snapToBounds(false);if(d.scrollbarX){d.scrollbarX.stop()}if(d.scrollbarY){d.scrollbarY.stop()}d.animating=false;d.doScrollEnd()}if(d.momentum){d.resetMomentum(f)}},onScrollStart:function(c,a){var b=this;if(!c||c.touch!=b.followTouch){return}if(b.momentum){b.addMomentum(c)}b.fireEvent("scrollstart",b,c)},onScroll:function(b,j){var d=this;if(!b||b.touch!=d.followTouch){return}b.stopEvent();var g=b.previousDeltaX,c=b.previousDeltaY,a=d.horizontal?(d.offset.x+g):0,k=d.vertical?(d.offset.y+c):0,h=d.constrainToBounds({x:a,y:k}),f;d.bouncing={x:false,y:false};if(d.bounces){if(d.bounces.horizontal&&h.x!=a){a=d.offset.x+(g/2);d.bouncing.x=true}else{a=h.x}if(d.bounces.vertical&&h.y!=k){k=d.offset.y+(c/2);d.bouncing.y=true}else{k=h.y}f={x:a,y:k}}else{f=h}d._scrollTo(f);if(d.momentum){d.addMomentum(b)}},doScrollEnd:function(){var a=this;if(a.scrollbarX){a.scrollbarX.hide(true)}if(a.scrollbarY){a.scrollbarY.hide(true)}a.fireEvent("scrollend",a,a.getOffset())},onScrollEnd:function(g,k){var j=this;if(g.touch!=j.followTouch){return}if(j.momentum){j.validateMomentum(g);if(j.momentumPoints.length>1){var b=j.momentumPoints,f=b.shift(),h=b.pop(),a={x:h.offset.x-f.offset.x,y:h.offset.y-f.offset.y},d=(h.time-f.time),c={x:a.x/(d/j.acceleration),y:a.y/(d/j.acceleration)};j.applyVelocity(c)}}if(!j.animating){j.snapToBounds(true)}if(!j.animating){j.doScrollEnd()}},onTransitionEnd:function(){var a=this;if(a.inTransition){a.scroller.dom.style.webkitTransitionDuration="0ms";a.inTransition=false;a.animating=false;a.doScrollEnd()}},scrollTo:function(e,a,d){var c=this;e=c.constrainToBounds({x:Math.round(-e.x||0),y:Math.round(-e.y||0)});clearInterval(c.scrollInterval);if(c.offset.x==e.x&&c.offset.y==e.y){return false}if(a&&!c.preventActualScroll){c.animating=true;c.inTransition=true;var b=c.scroller.dom.style;b.webkitTransitionTimingFunction=d||c.scrollToEasing;b.webkitTransitionDuration=(typeof a=="number")?(a+"ms"):(c.scrollToDuration+"ms");b.webkitTransform=c.translateOpen+e.x+"px, "+e.y+"px"+c.translateClose;c.offset=e;if(c.scrollbarX){c.scrollbarX.scrollTo(e,a,d||c.scrollToEasing)}if(c.scrollbarY){c.scrollbarY.scrollTo(e,a,d||c.scrollToEasing)}}else{c._scrollTo({x:e.x,y:e.y});c.doScrollEnd()}},_scrollTo:function(c){var b=this;b.offset={x:Math.round(c.x),y:Math.round(c.y)};if(!b.preventActualScroll){var a=b.scroller.dom.style;a.webkitTransitionDuration="0ms";a.webkitTransform=b.translateOpen+b.offset.x+"px, "+b.offset.y+"px"+b.translateClose;if(b.scrollbarX){b.scrollbarX.scrollTo(b.offset)}if(b.scrollbarY){b.scrollbarY.scrollTo(b.offset)}}b.fireEvent("scroll",b,b.getOffset())},getOffset:function(){return{x:-this.offset.x,y:-this.offset.y}},applyVelocity:function(d){d=d||{x:0,y:0};var c=this,f=c.offset,b=(new Date()).getTime(),a=c.deceleration={startTime:b,startOffset:{x:f.x,y:f.y},logFriction:Math.log(c.omega),velocity:d},g=c.constrainToBounds(f),e=c.bounce={};c.decelerating=true;c.bouncing={x:false,y:false};if(c.bounces){if(c.bounces.horizontal&&g.x!=f.x){e.horizontal={startTime:b-((1/c.springTension)*c.acceleration),startOffset:g.x,velocity:(f.x-g.x)*c.springTension*Math.E};d.x=0;c.bouncing.x=true}if(c.bounces.vertical&&g.y!=f.y){e.vertical={startTime:b-((1/c.springTension)*c.acceleration),startOffset:g.y,velocity:(f.y-g.y)*c.springTension*Math.E};d.y=0;c.bouncing.y=true}}c.animating=true;c.decelerating=true;c.scrollInterval=setInterval(function(){c.handleScrollFrame()},1000/this.fps)},handleScrollFrame:function(){var j=this,e=j.deceleration,n=j.bounce=j.bounce||{},c=j.offset,a=(new Date()).getTime(),f=(a-e.startTime),l=Math.pow(j.omega,f/j.acceleration),d={x:e.velocity.x*l,y:e.velocity.y*l},h={x:c.x,y:c.y},b={},m,g,k;if(Math.abs(d.x)<1&&Math.abs(d.y)<1){j.decelerating=false}if(!n.horizontal&&Math.abs(d.x)>=1){b.x=((e.velocity.x/e.logFriction)-(e.velocity.x*(l/e.logFriction)));h.x=e.startOffset.x-b.x}if(!n.vertical&&Math.abs(d.y)>=1){b.y=((e.velocity.y/e.logFriction)-(e.velocity.y*(l/e.logFriction)));h.y=e.startOffset.y-b.y}k=j.constrainToBounds(h);if(k.x!=h.x){if(j.bounces&&j.bounces.horizontal){if(!n.horizontal){n.horizontal={startTime:a,startOffset:k.x,velocity:d.x};j.bouncing.x=true}}else{h.x=k.x}e.velocity.x=0}if(k.y!=h.y){if(j.bounces&&j.bounces.vertical){if(!n.vertical){n.vertical={startTime:a,startOffset:k.y,velocity:d.y};j.bouncing.y=true}}else{h.y=k.y}e.velocity.y=0}if(n.horizontal&&n.horizontal.startTime!=a){f=(a-n.horizontal.startTime);m=(f/j.acceleration)*Math.pow(Math.E,-j.springTension*(f/j.acceleration));b.x=n.horizontal.velocity*m;g=n.horizontal.startOffset;if(Math.abs(b.x)<=1){b.x=0;delete n.horizontal}h.x=g+b.x}if(n.vertical&&n.vertical.startTime!=a){f=(a-n.vertical.startTime);m=(f/j.acceleration)*Math.pow(Math.E,-j.springTension*(f/j.acceleration));b.y=n.vertical.velocity*m;g=n.vertical.startOffset;if(Math.abs(b.y)<=1){b.y=0;delete n.vertical}h.y=g+b.y}if(!n.vertical&&!n.horizontal){j.bouncing={x:false,y:false}}j._scrollTo(h);if((!j.bounces||(!j.bouncing.x&&!j.bouncing.y))&&!j.decelerating){clearInterval(j.scrollInterval);j.animating=false;j.snapToBounds(false);if(!this.animating){j.doScrollEnd()}return}},setSnap:function(a){this.snap=a},snapToBounds:function(a,d){var b=this,c=b.constrainToBounds(b.offset);if(b.snap){if(b.snap===true){b.snap={x:50,y:50}}else{if(Ext.isNumber(b.snap)){b.snap={x:b.snap,y:b.snap}}}if(b.snap.y){c.y=Math.round(c.y/b.snap.y)*b.snap.y}if(b.snap.x){c.x=Math.round(c.x/b.snap.x)*b.snap.x}}if(c.x!=b.offset.x||c.y!=b.offset.y){if(b.snap){b.scrollTo({x:-c.x,y:-c.y},b.snapDuration,"ease-in-out")}else{if(a){b.applyVelocity()}else{b._scrollTo(c)}}}},updateBounds:function(b){var a=this;a.parentSize={width:a.parent.getWidth(true),height:a.parent.getHeight(true)};a.contentSize={width:a.scroller.dom.scrollWidth,height:a.scroller.dom.scrollHeight};a.size={width:Math.max(a.contentSize.width,a.parentSize.width),height:Math.max(a.contentSize.height,a.parentSize.height)};a.bounds={x:a.parentSize.width-a.size.width,y:a.parentSize.height-a.size.height};if(b){if(this.scrollTo(a.getOffset())!==false){a.doScrollEnd()}}if(a.scrollbarX){a.scrollbarX.update()}if(a.scrollbarY){a.scrollbarY.update()}},constrainToBounds:function(a){if(!this.bounds){this.updateBounds()}return{x:Math.min(Math.max(this.bounds.x,a.x),0),y:Math.min(Math.max(this.bounds.y,a.y),0)}},resetMomentum:function(a){this.momentumPoints=[];if(a){this.addMomentum(a)}},addMomentum:function(b){var a=this;a.validateMomentum(b);a.momentumPoints.push({time:b.time,offset:{x:a.offset.x,y:a.offset.y}})},validateMomentum:function(c){var a=this.momentumPoints,b=c.time;while(a.length){if(b-a[0].time<=this.momentumResetTime){break}a.shift()}},destroy:function(){var a=this;a.scroller.removeClass("x-scroller");a.parent.removeClass("x-scroller-parent");a.parent.un({touchstart:a.onTouchStart,scrollstart:a.onScrollStart,scrollend:a.onScrollEnd,scroll:a.onScroll,horizontal:a.horizontal,vertical:a.vertical,scope:a});clearInterval(a.scrollInterval);if(a.scrollbars){if(a.horizontal){a.scrollbarX.destroy()}if(a.vertical){a.scrollbarY.destroy()}}a.scroller.un({DOMSubtreeModified:a.updateBounds,webkitTransitionEnd:a.onTransitionEnd,scope:a});Ext.ScrollManager.unregister(this)}});Ext.ScrollManager=new Ext.AbstractManager();Ext.util.Scroller.Scrollbar=Ext.extend(Object,{minSize:4,size:0,offset:10,translateOpen:(Ext.is.Android||Ext.is.Blackberry)?"translate(":"translate3d(",translateClose:(Ext.is.Android||Ext.is.Blackberry)?")":", 0px)",constructor:function(a,c){var b=this;b.scroller=a;b.container=a.parent;b.direction=c;b.bar=b.container.createChild({cls:"x-scrollbar x-scrollbar-"+c+" x-scrollbar-"+a.ui});b.bar.on("webkitTransitionEnd",this.onTransitionEnd,this);b.hide()},destroy:function(){this.bar.un("webkitTransitionEnd",this.onTransitionEnd,this);this.bar.remove()},update:function(){var e=this,b=e.scroller,g=b.contentSize,f=b.parentSize,c=b.size,a,d;if(e.direction=="vertical"){if(g.height>f.height){e.size=Math.round((f.height*f.height)/c.height);e.autoShow=true}else{e.autoShow=false}}else{if(g.width>f.width){e.size=Math.round((f.width*f.width)/c.width);e.autoShow=true}else{e.autoShow=false}}},scrollTo:function(f,b,d){var e=this,c=e.scroller,a=e.bar.dom.style,j=0,h=0,k=e.size,g;if(!e.autoShow){return}if(e.hideTimeout){clearTimeout(e.hideTimeout);e.hideTimeout=null}if(e.hidden){e.show()}if(e.direction=="horizontal"){if(c.bouncing.x){g=c.constrainToBounds(f);k=Math.max(k-Math.abs(f.x-g.x),e.minSize);if(f.x>=0){j=g.x+e.offset}else{j=c.parentSize.width-k-e.offset}a.width=k+"px";e.resized=true}else{j=((c.parentSize.width-k-(e.offset*2))/c.bounds.x*c.offset.x)+e.offset;if(e.resized==undefined||e.resized){a.width=k+"px";e.resized=false}}}else{if(c.bouncing.y){g=c.constrainToBounds(f);k=Math.max(k-Math.abs(f.y-g.y),e.minSize);if(f.y>=0){h=g.y+e.offset}else{h=c.parentSize.height-k-e.offset}a.height=k+"px";e.resized=true}else{h=((c.parentSize.height-k-(e.offset*2))/c.bounds.y*c.offset.y)+e.offset;if(e.resized==undefined||e.resized){a.height=k+"px";e.resized=false}}}if(b){a.webkitTransitionDuration=(typeof b=="number"?b:c.scrollToDuration)+"ms, 0ms";a.webkitTransitionTimingFunction=d;e.inTransition=true}else{a.webkitTransitionDuration="";e.inTransition=false}a.webkitTransform=e.translateOpen+j+"px, "+h+"px"+this.translateClose},hide:function(a){var b=this;if(a){b.hideTimeout=setTimeout(function(){b.bar.setStyle("opacity","0");b.hidden=true;b.hideTimeout=null},1000)}else{b.bar.setStyle("opacity","0");b.hidden=true}},show:function(){this.bar.setStyle("opacity","1");this.hidden=false},onTransitionEnd:function(){this.inTransition=false},stop:function(){var c=this,b=c.bar.dom.style,a;if(this.inTransition){b.webkitTransitionDuration="";a=new WebKitCSSMatrix(window.getComputedStyle(c.bar.dom).webkitTransform);b.webkitTransform=c.translateOpen+a.m41+"px, "+a.m42+"px"+c.translateClose}}});Ext.util.Draggable=Ext.extend(Ext.util.Observable,{baseCls:"x-draggable",dragCls:"x-dragging",proxyCls:"x-draggable-proxy",direction:"both",delay:0,cancelSelector:null,disabled:false,revert:false,constrain:window,group:"base",grid:null,snap:null,proxy:null,stack:false,constrainRegion:null,dragging:false,vertical:false,horizontal:false,threshold:0,constructor:function(b,a){a=a||{};Ext.apply(this,a);this.addEvents("dragstart","beforedragend","dragend","drag");this.el=Ext.get(b);Ext.util.Draggable.superclass.constructor.call(this);if(this.direction=="both"){this.horizontal=true;this.vertical=true}else{if(this.direction=="horizontal"){this.horizontal=true}else{this.vertical=true}}this.el.addCls(this.baseCls);this.tapEvent=(this.delay>0)?"taphold":"tapstart";this.initialRegion={top:0,left:0,right:0,bottom:0};if(!this.disabled){this.enable()}},onTapEvent:function(b,a){if(Ext.is.Android){b.browserEvent.preventDefault();b.browserEvent.stopPropagation()}if(this.cancelSelector&&b.getTarget(this.cancelSelector)){return}if(!this.dragging&&(b.type==="tapstart"||b.deltaTime>=this.delay)){this.canDrag=true}},prepareDrag:function(c){this.reset();if(this.constrain){if(this.constrain===window){var a=window.innerWidth,b=window.innerHeight;this.constrainRegion=new Ext.util.Region(0,a,b,0)}else{this.constrainRegion=Ext.fly(this.constrain).getPageBox(true)}}this.startRegion=this.getProxyEl().getPageBox(true);this.offsetToCorner={x:c.pageX-this.startRegion.left,y:c.pageY-this.startRegion.top}},onDragStart:function(a){this.prepareDrag(a);if(!this.dragging){this.el.addCls(this.dragCls);this.dragging=true;this.fireEvent("dragstart",this,a)}},onTouchMove:function(c){c.stopEvent();if(!this.canDrag){return}if(!this.dragging){if(Math.abs(c.deltaX)>=this.threshold||Math.abs(c.deltaY)>=this.threshold){this.onDragStart(c)}else{return}}var a=0,f=0,b=this.initialRegion,d=this.constrainRegion;if(this.horizontal){a=c.pageX-this.initialRegion.left-this.offsetToCorner.x}if(this.vertical){f=c.pageY-this.initialRegion.top-this.offsetToCorner.y}if(this.constrain){if(b.left+a<d.left){a=d.left-b.left}if(b.right+a>d.right){a=d.right-b.right}if(b.top+f<d.top){f=d.top-b.top}if(b.bottom+f>d.bottom){f=d.bottom-b.bottom}}this.transformTo(a,f);this.fireEvent("drag",this,c)},transformTo:function(b,e){var a=this.getProxyEl(),c=this.initialRegion,d=this.startPosition||{x:0,y:0};a.dom.style.webkitTransform="translate3d("+b+"px, "+e+"px, 0px)";this.transform={x:b,y:e};this.position={x:d.x+b,y:d.y+e};this.region=new Ext.util.Region(c.top+e,c.right+b,c.bottom+e,c.left+b)},moveTo:function(a,b){this.transformTo(a-this.initialRegion.left,b-this.initialRegion.top)},reset:function(){var a=this.getProxyEl();this.startPosition=this.position={x:a.getLeft()||0,y:a.getTop()||0};this.transformTo(0,0);this.initialRegion=this.region=a.getPageBox(true);this.transform={x:0,y:0}},onTouchEnd:function(d){this.canDrag=false;this.dragging=false;this.fireEvent("beforedragend",this,d);var b=this.getProxyEl();if(this.revert&&!this.cancelRevert&&this.transform){new Ext.Anim({from:{"-webkit-transform":"translate3d("+this.transform.x+"px, "+this.transform.y+"px, 0px)"},to:{"-webkit-transform":"translate3d(0px, 0px, 0px)"},duration:200}).run(b)}else{if(this.transform){var c=b.dom.style,a=this.position;c.webkitTransform=null;c.left=a.x+"px";c.top=a.y+"px"}}this.transform=this.startPosition=null;this.el.removeClass(this.dragCls);this.fireEvent("dragend",this,d)},enable:function(){this.el.on(this.tapEvent,this.onTapEvent,this,{horizontal:this.horizontal,vertical:this.vertical});this.el.on({touchmove:this.onTouchMove,touchend:this.onTouchEnd,scope:this});this.disabled=false},disable:function(){this.el.un(this.tapEvent,this.onTapEvent,this);this.disabled=true},destroy:function(){this.el.removeClass(this.baseCls);this.purgeListeners();this.el.un(this.tapEvent,this.onTapEvent,this);this.el.un({touchmove:this.onTouchMove,touchend:this.onTouchEnd,scope:this})},getProxyEl:function(){return this.proxy||this.el}});Ext.util.Format=function(){return{defaultDateFormat:"m/d/Y",ellipsis:function(c,a,d){if(c&&c.length>a){if(d){var e=c.substr(0,a-2),b=Math.max(e.lastIndexOf(" "),e.lastIndexOf("."),e.lastIndexOf("!"),e.lastIndexOf("?"));if(b==-1||b<(a-15)){return c.substr(0,a-3)+"..."}else{return e.substr(0,b)+"..."}}else{return c.substr(0,a-3)+"..."}}return c},htmlEncode:function(a){return !a?a:String(a).replace(/&/g,"&amp;").replace(/>/g,"&gt;").replace(/</g,"&lt;").replace(/"/g,"&quot;")},htmlDecode:function(a){return !a?a:String(a).replace(/&gt;/g,">").replace(/&lt;/g,"<").replace(/&quot;/g,'"').replace(/&amp;/g,"&")},date:function(a,b){if(!a){return""}if(!Ext.isDate(a)){a=new Date(Date.parse(a))}return a.dateFormat(b||Ext.util.Format.defaultDateFormat)}}}();if(Ext.isSafari&&(navigator.userAgent.match(/WebKit\/(\d+)/)[1]||NaN)<420){Ext.apply(Date.prototype,{_xMonth:Date.prototype.setMonth,_xDate:Date.prototype.setDate,setMonth:function(a){if(a<=-1){var d=Math.ceil(-a),c=Math.ceil(d/12),b=(d%12)?12-d%12:0;this.setFullYear(this.getFullYear()-c);return this._xMonth(b)}else{return this._xMonth(a)}},setDate:function(a){return this.setTime(this.getTime()-(this.getDate()-a)*86400000)}})}Ext.data.Connection=Ext.extend(Ext.util.Observable,{method:"post",url:null,disableCaching:true,disableCachingParam:"_dc",timeout:30000,useDefaultHeader:true,defaultPostHeader:"application/x-www-form-urlencoded; charset=UTF-8",useDefaultXhrHeader:true,defaultXhrHeader:"XMLHttpRequest",requests:{},constructor:function(a){a=a||{};Ext.apply(this,a);this.addEvents("beforerequest","requestcomplete","requestexception");Ext.data.Connection.superclass.constructor.call(this)},request:function(c){var l=this;if(l.fireEvent("beforerequest",l,c)!==false){var g=c.params,b=c.url||l.url,h,j,f,d=c.urlParams,a,m,n;if(Ext.isFunction(g)){g=g.call(c.scope||window,c)}if(Ext.isFunction(b)){b=b.call(c.scope||window,c)}j=c.rawData||c.xmlData||c.jsonData||null;if(c.jsonData&&!Ext.isPrimitive(c.jsonData)){j=Ext.encode(j)}g=Ext.isObject(g)?Ext.urlEncode(g):g;d=Ext.isObject(d)?Ext.urlEncode(d):d;a=(c.method||l.method||((g||j)?"POST":"GET")).toUpperCase();if(a==="GET"&&c.disableCaching!==false&&!l.disableCaching){b=Ext.urlAppend(b,c.disableCachingParam||l.disableCachingParam+"="+(new Date().getTime()))}if((a=="GET"||j)&&g){b=Ext.urlAppend(b,g);g=null}if(d){b=Ext.urlAppend(b,d)}if(c.autoAbort===true||l.autoAbort){l.abort()}n=this.getXhrInstance();n.open(a.toUpperCase(),b,true);f=Ext.apply({},c.headers||{},l.defaultHeaders||{});if(!f["Content-Type"]&&(j||g)){f["Content-Type"]=j?(c.rawData?"text/plain":(c.xmlData?"text/xml":"application/json")):l.defaultPostHeader}if(l.useDefaultXhrHeader&&!f["X-Requested-With"]){f["X-Requested-With"]=l.defaultXhrHeader}for(m in f){if(f.hasOwnProperty(m)){try{n.setRequestHeader(m,f[m])}catch(k){l.fireEvent("exception",m,f[m])}}}try{if(c&&c.overrideMimeType&&n.overrideMimeType){n.overrideMimeType(c.overrideMimeType)}}catch(k){}h={id:++Ext.data.Connection.requestId,xhr:n,headers:f,options:c,timeout:setTimeout(function(){h.timedout=true;l.abort(h)},c.timeout||l.timeout)};l.requests[h.id]=h;n.onreadystatechange=l.onStateChange.createDelegate(l,[h]);n.send(j||g||null);return h}else{return c.callback?c.callback.apply(c.scope,[c,undefined,undefined]):null}},getXhrInstance:function(){return new XMLHttpRequest()},isLoading:function(a){return a&&!{0:true,4:true}[a.xhr.readyState]},abort:function(a){if(a&&this.isLoading(a)){a.xhr.abort();clearTimeout(a.timeout);delete (a.timeout);a.aborted=true;this.onComplete(a)}else{if(!a){var b;for(b in this.requests){if(!this.requests.hasOwnProperty(b)){continue}this.abort(this.requests[b])}}}},onStateChange:function(a){if(a.xhr.readyState==4){clearTimeout(a.timeout);delete a.timeout;this.onComplete(a)}},onComplete:function(d){var a=d.xhr.status,c=d.options,e=true,b;if((a>=200&&a<300)||a==304){b=this.createResponse(d);this.fireEvent("requestcomplete",this,b,c);if(c.success){if(!c.scope){c.success(b,c)}else{c.success.call(c.scope,b,c)}}}else{e=false;switch(a){case 12002:case 12029:case 12030:case 12031:case 12152:case 13030:b=this.createException(d);break;default:b=this.createResponse(d)}this.fireEvent("requestexception",this,b,c);if(c.failure){if(!c.scope){c.failure(b,c)}else{c.failure.call(c.scope,b,c)}}}if(c.callback){if(!c.scope){c.callback(c,e,b)}else{c.callback.call(c.scope,c,e,b)}}delete this.requests[d.id]},createResponse:function(a){var g=a.xhr,b={},h=g.getAllResponseHeaders().replace(/\r\n/g,"\n").split("\n"),c=h.length,j,d,f,e;while(c--){j=h[c];d=j.indexOf(":");if(d>=0){f=j.substr(0,d).toLowerCase();if(j.charAt(d+1)==" "){++d}b[f]=j.substr(d+1)}}delete a.xhr;return{request:a,requestId:a.id,status:g.status,statusText:g.statusText,getResponseHeader:function(k){return b[k.toLowerCase()]},getAllResponseHeaders:function(){return b},responseText:g.responseText,responseXML:g.responseXML}},createException:function(a){return{request:a,requestId:a.id,status:a.aborted?-1:0,statusText:a.aborted?"transaction aborted":"communication failure",aborted:a.aborted,timedout:a.timedout}}});Ext.data.Connection.requestId=0;Ext.Ajax=new Ext.data.Connection({autoAbort:false});Ext.lib.Component=Ext.extend(Ext.util.Observable,{isComponent:true,renderTpl:null,tplWriteMode:"overwrite",baseCls:"x-component",disabledCls:"x-item-disabled",hidden:false,disabled:false,draggable:false,floatable:false,styleHtmlContent:false,styleHtmlCls:"x-html",allowDomMove:true,autoShow:false,autoRender:true,rendered:false,constructor:function(b){b=b||{};this.initialConfig=b;Ext.apply(this,b);this.addEvents("beforeactivate","activate","beforedeactivate","deactivate","added","disable","enable","beforeshow","show","beforehide","hide","removed","beforerender","render","afterrender","beforedestroy","destroy","resize","move","beforestaterestore","staterestore","beforestatesave","statesave");this.getId();this.mons=[];this.renderData=this.renderData||{};this.renderSelectors=this.renderSelectors||{};this.initComponent();Ext.ComponentMgr.register(this);Ext.lib.Component.superclass.constructor.call(this);if(this.plugins){this.plugins=[].concat(this.plugins);for(var c=0,a=this.plugins.length;c<a;c++){this.plugins[c]=this.initPlugin(this.plugins[c])}}if(this.applyTo){this.applyToMarkup(this.applyTo);delete this.applyTo}else{if(this.renderTo){this.render(this.renderTo);delete this.renderTo}}},initPlugin:function(a){if(a.ptype&&typeof a.init!="function"){a=Ext.PluginMgr.create(a)}else{if(typeof a=="string"){a=Ext.PluginMgr.create({ptype:a})}}a.init(this);return a},render:function(b,a){if(!this.rendered&&this.fireEvent("beforerender",this)!==false){if(this.el){this.el=Ext.get(this.el)}b=this.initContainer(b);this.onRender(b,a);this.fireEvent("render",this);this.initContent();this.afterRender(b);this.fireEvent("afterrender",this);this.initEvents();if(this.autoShow){this.show()}if(this.hidden){this.onHide(false)}if(this.disabled){this.disable(true)}}return this},onRender:function(c,a){var d=this.el,b=[],f,e;a=this.getInsertPosition(a);if(!d){if(a){d=Ext.DomHelper.insertBefore(a,this.getElConfig(),true)}else{d=Ext.DomHelper.append(c,this.getElConfig(),true)}}else{if(this.allowDomMove!==false){c.dom.insertBefore(d.dom,a)}}b.push(this.baseCls);if(this.cmpCls){b.push(this.cmpCls)}else{this.cmpCls=this.baseCls}if(this.cls){b.push(this.cls);delete this.cls}if(this.ui){b.push(this.cmpCls+"-"+this.ui)}d.addCls(b);d.setStyle(this.initStyles());f=this.initRenderTpl();if(f){e=this.initRenderData();f.append(d,e)}this.el=d;this.applyRenderSelectors();this.rendered=true},afterRender:function(){var a=Ext.layout.LayoutManager.create(this.componentLayout,"autocomponent");this.setComponentLayout(a);if(this.x||this.y){this.setPosition(this.x,this.y)}if(this.styleHtmlContent){this.getTargetEl().addCls(this.styleHtmlCls)}if(!this.ownerCt){this.setSize(this.width,this.height)}},getElConfig:function(){return{tag:"div",id:this.id}},getInsertPosition:function(a){if(a!==undefined){if(Ext.isNumber(a)){a=this.container.dom.childNodes[a]}else{a=Ext.getDom(a)}}return a},initContainer:function(a){if(!a&&this.el){a=this.el.dom.parentNode;this.allowDomMove=false}this.container=Ext.get(a);if(this.ctCls){this.container.addCls(this.ctCls)}return this.container},initRenderData:function(){return Ext.applyIf(this.renderData,{baseCls:this.baseCls,cmpCls:this.cmpCls})},initRenderTpl:function(){var a=this.renderTpl;if(a){if(this.proto.renderTpl!==a){if(Ext.isArray(a)){a=new Ext.XTemplate(a)}}else{if(Ext.isArray(this.proto.renderTpl)){a=this.proto.renderTpl=new Ext.XTemplate(a)}}}return a},initStyles:function(){var d={},a=Ext.Element,c,e,b,f;if(Ext.isString(this.style)){b=this.style.split(";");for(c=0,e=b.length;c<e;c++){if(!Ext.isEmpty(b[c])){f=b[c].split(":");d[f[0].trim()]=f[1].trim()}}}else{d=Ext.apply({},this.style)}if(this.padding!=undefined){d.padding=a.unitizeBox((this.padding===true)?5:this.padding)}if(this.margin!=undefined){d.margin=a.unitizeBox((this.margin===true)?5:this.margin)}if(this.border!=undefined){d.borderWidth=a.unitizeBox((this.border===true)?1:this.border)}delete this.style;return d},initContent:function(){var b=this.getTargetEl();if(this.html){b.update(Ext.DomHelper.markup(this.html));delete this.html}if(this.contentEl){var a=Ext.get(this.contentEl);a.show();b.appendChild(a.dom)}if(this.tpl){if(!this.tpl.isTemplate){this.tpl=new Ext.XTemplate(this.tpl)}if(this.data){this.tpl[this.tplWriteMode](b,this.data);delete this.data}}},initEvents:function(){var c=this.afterRenderEvents,b,a;if(c){for(b in c){if(!c.hasOwnProperty(b)){continue}a=c[b];if(this[b]&&this[b].on){this.mon(this[b],a)}}}},applyRenderSelectors:function(){var b=this.renderSelectors||{},c=this.el.dom,a;for(a in b){if(!b.hasOwnProperty(a)){continue}this[a]=Ext.get(Ext.DomQuery.selectNode(b[a],c))}},getId:function(){return this.id||(this.id="ext-comp-"+(++Ext.lib.Component.AUTO_ID))},getItemId:function(){return this.itemId||this.id},getEl:function(){return this.el},getTargetEl:function(){return this.el},isXType:function(b,a){if(Ext.isFunction(b)){b=b.xtype}else{if(Ext.isObject(b)){b=b.constructor.xtype}}return !a?("/"+this.getXTypes()+"/").indexOf("/"+b+"/")!=-1:this.constructor.xtype==b},getXTypes:function(){var a=this.constructor,b=[],d=this,c;if(!a.xtypes){while(d){c=d.constructor.xtype;if(c!=undefined){b.unshift(c)}d=d.constructor.superclass}a.xtypeChain=b;a.xtypes=b.join("/")}return a.xtypes},update:function(b,c,a){if(this.tpl&&!Ext.isString(b)){this.data=b;if(this.rendered){this.tpl[this.tplWriteMode](this.getTargetEl(),b||{})}}else{this.html=Ext.isObject(b)?Ext.DomHelper.markup(b):b;if(this.rendered){this.getTargetEl().update(this.html,c,a)}}if(this.rendered){this.doComponentLayout()}},setVisible:function(a){return this[a?"show":"hide"]()},isVisible:function(){var b=!this.hidden,a=this.ownerCt;if(b&&this.rendered&&a){while(a){if(a.hidden||a.collapsed){b=false;break}a=a.ownerCt}}return b},enable:function(a){if(this.rendered){this.el.removeClass(this.disabledCls);this.el.dom.disabled=false;this.onEnable()}this.disabled=false;if(a!==true){this.fireEvent("enable",this)}return this},disable:function(a){if(this.rendered){this.el.addCls(this.disabledCls);this.el.dom.disabled=true;this.onDisable()}this.disabled=true;if(a!==true){this.fireEvent("disable",this)}return this},setDisabled:function(a){return this[a?"disable":"enable"]()},addCls:function(a){if(this.rendered){this.el.addCls(a)}else{this.cls=this.cls?this.cls+" "+a:a}return this},removeClass:function(a){if(this.rendered){this.el.removeClass(a)}else{if(this.cls){this.cls=this.cls.split(" ").remove(a).join(" ")}}return this},addListener:function(b,f,e,a){if(Ext.isString(b)&&(Ext.isObject(f)||a&&a.element)){if(a.element){var d=f,c;f={};f[b]=d;b=a.element;if(e){f.scope=e}for(c in a){if(!a.hasOwnProperty(c)){continue}if(this.eventOptionsRe.test(c)){f[c]=a[c]}}}if(this[b]&&this[b].on){this.mon(this[b],f)}else{this.afterRenderEvents=this.afterRenderEvents||{};this.afterRenderEvents[b]=f}}return Ext.lib.Component.superclass.addListener.apply(this,arguments)},getBubbleTarget:function(){return this.ownerCt},isFloatable:Ext.emptyFn,isDraggable:Ext.emptyFn,isDroppable:Ext.emptyFn,onAdded:function(a,b){this.ownerCt=a;this.fireEvent("added",this,a,b)},onRemoved:function(){this.fireEvent("removed",this,this.ownerCt);delete this.ownerCt},onEnable:Ext.emptyFn,onDisable:Ext.emptyFn,beforeDestroy:Ext.emptyFn,onResize:Ext.emptyFn,setSize:function(b,a){if(Ext.isObject(b)){a=b.height;b=b.width}if(!this.rendered||!this.isVisible()){this.width=(b!==undefined)?b:this.width;this.height=(a!==undefined)?a:this.height;return this}this.doComponentLayout(b,a);return this},doComponentLayout:function(b,a){if(this.rendered&&this.componentLayout){this.width=b=(b!==undefined)?b:this.width;this.height=a=(a!==undefined)?a:this.height;this.componentLayout.layout(b,a)}return this},setComponentLayout:function(b){var a=this.componentLayout;if(a&&a.isLayout&&a!=b){a.setOwner(null)}this.componentLayout=b;b.setOwner(this)},afterComponentLayout:Ext.emptyFn,setPosition:function(a,b){if(Ext.isObject(a)){b=a.y;a=a.x}if(!this.rendered){return this}if(a!==undefined||b!==undefined){this.el.setBox(a,b);this.onPosition(a,b);this.fireEvent("move",this,a,b)}return this},onPosition:Ext.emptyFn,setWidth:function(a){return this.setSize(a)},setHeight:function(a){return this.setSize(undefined,a)},getSize:function(){return this.el.getSize()},getWidth:function(){return this.el.getWidth()},getHeight:function(){return this.el.getHeight()},setDocked:function(a,b){this.dock=a;if(b&&this.ownerCt&&this.rendered){this.ownerCt.doComponentLayout()}return this},onDestroy:function(){if(this.monitorResize&&Ext.EventManager.resizeEvent){Ext.EventManager.resizeEvent.removeListener(this.setSize,this)}},destroy:function(){if(!this.isDestroyed){if(this.fireEvent("beforedestroy",this)!==false){this.destroying=true;this.beforeDestroy();if(this.ownerCt&&this.ownerCt.remove){this.ownerCt.remove(this,false)}if(this.rendered){this.el.remove()}this.onDestroy();Ext.ComponentMgr.unregister(this);this.fireEvent("destroy",this);this.purgeListeners();this.destroying=false;this.isDestroyed=true}}}});Ext.lib.Component.prototype.on=Ext.lib.Component.prototype.addListener;Ext.lib.Component.AUTO_ID=1000;Ext.Component=Ext.extend(Ext.lib.Component,{showAnimation:null,monitorOrientation:false,floatingCls:"x-floating",hideOnMaskTap:true,stopMaskTapEvent:true,centered:false,modal:false,initComponent:function(){this.addEvents("beforeorientationchange","orientationchange");if(this.fullscreen||this.floating){this.monitorOrientation=true}if(this.fullscreen){this.width=window.innerWidth;this.height=window.innerHeight;this.cls=(this.cls||"")+" x-fullscreen";this.renderTo=document.body}},onRender:function(){Ext.Component.superclass.onRender.apply(this,arguments);if(this.monitorOrientation){this.el.addCls("x-"+Ext.orientation)}if(this.floating){this.setFloating(true)}if(this.draggable){this.setDraggable(this.draggable)}if(this.scroll){this.setScrollable(this.scroll)}},afterRender:function(){if(this.fullscreen){this.layoutOrientation(Ext.orientation,this.width,this.height)}Ext.Component.superclass.afterRender.call(this)},initEvents:function(){Ext.Component.superclass.initEvents.call(this);if(this.monitorOrientation){Ext.EventManager.onOrientationChange(this.setOrientation,this)}},afterComponentLayout:function(){var c=this.scrollEl,a=this.scroller,b;if(c){b=c.parent();if(a.horizontal){c.setStyle("min-width",b.getWidth(true)+"px");c.setHeight(b.getHeight(true)||null)}else{c.setStyle("min-height",b.getHeight(true)+"px");c.setWidth(b.getWidth(true)||null)}a.updateBounds(true)}if(this.fullscreen&&Ext.is.iPad){Ext.repaint()}},layoutOrientation:Ext.emptyFn,update:function(){Ext.Component.superclass.update.apply(this,arguments);var a=this.scroller;if(a&&a.updateBounds){a.updateBounds(true)}},nelaPreRender:function(){try{var b=this.rendered;if(!b&&this.autoRender){this.render(Ext.isBoolean(this.autoRender)?Ext.getBody():this.autoRender);this.doComponentLayout();this.componentLayout.lastComponentSize.width=this.componentLayout.lastComponentSize.height=-1}}catch(a){}},show:function(a){var b=this.rendered;if((this.hidden||!b)&&this.fireEvent("beforeshow",this)!==false){if(this.anchorEl){this.anchorEl.hide()}if(!b&&this.autoRender){this.render(Ext.isBoolean(this.autoRender)?Ext.getBody():this.autoRender)}this.hidden=false;if(this.rendered){this.onShow(a);this.fireEvent("show",this)}}return this},showBy:function(b,c,d,a){if(!this.floating){return this}if(b.isComponent){b=b.el}else{b=Ext.get(b)}this.x=0;this.y=0;this.show(c);if(a!==false){if(!this.anchorEl){this.anchorEl=this.el.createChild({cls:"x-anchor"})}this.anchorEl.show()}this.alignTo(b,d,20)},alignTo:function(f,e,g){var b=f.getPageBox(),s={width:window.innerWidth,height:window.innerHeight},m=this.getSize(),a={width:Math.min(m.width,s.width),height:Math.min(m.height,s.height)},u,k=2,d=["tl-bl","t-b","tr-br","l-r","l-r","r-l","bl-tl","b-t","br-tr"],r=this.anchorEl,h=[0,g],j,c,l=false,p=[0,0],q=b.left+(b.width/2),n=b.top+(b.height/2);if(q<=s.width*(1/3)){k=1;p[0]=25}else{if(q>=s.width*(2/3)){k=3;p[0]=-30}}if(n>=s.height*(2/3)){k+=6;h=[0,-g];p[1]=-10}else{if(e!==false&&n>=s.height*(1/3)){k+=3;h=(k<=5)?[g,0]:[-g,0];p=(k<=5)?[10,0]:[-10,0];l=true}else{p[1]=10}}u=d[k-1];j=this.el.getAlignToXY(f,u,h);if(l){if(j[0]<0){a.width=b.left-g}else{if(j[0]+a.width>s.width){a.width=s.width-b.right-g}}}else{if(j[1]<0){a.height=b.top-g}else{if(j[1]+a.height>s.height){a.height=s.height-b.bottom-g}}}if(a.width!=m.width){this.setSize(a.width)}else{if(a.height!=m.height){this.setSize(undefined,a.height)}}j=this.el.getAlignToXY(f,u,h);this.setPosition(j[0],j[1]);if(r){r.removeClass(["x-anchor-bottom","x-anchor-left","x-anchor-right","x-anchor-top"]);if(h[1]==g){c="x-anchor-top"}else{if(h[1]==-g){c="x-anchor-bottom"}else{if(h[0]==g){c="x-anchor-left"}else{c="x-anchor-right"}}}j=r.getAlignToXY(f,u,p);r.setXY(j);r.addCls(c)}return u},setCentered:function(b,d){this.centered=b;if(this.rendered&&d){var a,c;if(!this.ownerCt){a=(Ext.Element.getViewportWidth()/2)-(this.getWidth()/2);c=(Ext.Element.getViewportHeight()/2)-(this.getHeight()/2)}else{a=(this.ownerCt.getTargetEl().getWidth()/2)-(this.getWidth()/2);c=(this.ownerCt.getTargetEl().getHeight()/2)-(this.getHeight()/2)}this.setPosition(a,c)}return this},hide:function(a){if(!this.hidden&&this.fireEvent("beforehide",this)!==false){this.hidden=true;if(this.rendered){this.onHide(a,true)}}return this},onShow:function(a){this.el.show();if(this.floating){this.el.dom.parentNode||this.el.appendTo(document.body);if(a){this.el.setStyle("opacity",0.01)}if(this.centered){this.setCentered(true,true)}else{this.setPosition(this.x,this.y)}if(this.modal){this.el.parent().mask()}if(this.hideOnMaskTap){Ext.getDoc().on("touchstart",this.onFloatingTouchStart,this)}}this.doComponentLayout();if(a===undefined){a=this.showAnimation}if(a){Ext.Anim.run(this,a,{out:false,autoClear:true});this.showAnimation=a}},onFloatingTouchStart:function(c,a){var b=Ext.getDoc();if(!this.el.contains(a)){b.on("touchend",function(d){this.hide();if(this.stopMaskTapEvent||Ext.fly(a).hasClass("x-mask")){d.stopEvent()}},this,{single:true});c.stopEvent()}},onHide:function(b,a){if(b===undefined){b=this.showAnimation}if(this.hideOnMaskTap&&this.floating){Ext.getDoc().un("touchstart",this.onFloatingTouchStart,this)}if(b){Ext.Anim.run(this,b,{out:true,autoClear:true,scope:this,fireHideEvent:a,after:this.doHide})}else{this.doHide(null,{fireHideEvent:a})}},doHide:function(b,a){this.el.hide();if(this.floating&&this.modal){this.el.parent().unmask()}if(a&&a.fireHideEvent){this.fireEvent("hide",this)}},setScrollable:function(c){if(!this.rendered){this.scroll=c;return}Ext.destroy(this.scroller);if(c!==false){var e=Ext.isObject(c)?c.direction:c,d=e==="both",a=d||e==="horizontal",b=d||e===true||e==="vertical";c=Ext.apply({},Ext.isObject(c)?c:{},{momentum:true,horizontal:a,vertical:b});if(!this.scrollEl){this.scrollEl=this.getTargetEl().createChild();this.originalGetTargetEl=this.getTargetEl;this.getTargetEl=function(){return this.scrollEl}}this.scroller=new Ext.util.Scroller(this.scrollEl,c)}else{this.getTargetEl=this.originalGetTargetEl}},setFloating:function(b,a){this.floating=!!b;this.hidden=true;if(this.rendered){if(b!==false){this.el.addCls(this.floatingCls);if(a){this.show()}}else{this.el.removeClass(this.floatingCls);Ext.getDoc().un("touchstart",this.onFloatingTouchStart,this)}}},setDraggable:function(a,b){this.draggable=a;if(this.rendered){if(a===false){if(this.dragObj){this.dragObj.disable()}}else{if(b){this.show()}if(this.dragObj){this.dragObj.enable()}else{this.dragObj=new Ext.util.Draggable(this.el,Ext.apply({},this.draggable||{}));this.relayEvents(this.dragObj,["dragstart","drag","dragend"])}}}},setOrientation:function(b,a,c){if(this.fireEvent("beforeorientationchange",this,b,a,c)!==false){if(this.orientation!=b){this.el.removeClass("x-"+this.orientation);this.el.addCls("x-"+b)}this.orientation=b;this.layoutOrientation(b,a,c);if(this.fullscreen){this.setSize(a,c)}if(this.floating&&this.centered){this.setCentered(true,true)}this.onOrientationChange(b,a,c);this.fireEvent("orientationchange",this,b,a,c)}},onOrientationChange:Ext.emptyFn,onDestroy:function(){if(this.monitorOrientation&&Ext.EventManager.orientationEvent){Ext.EventManager.orientationEvent.removeListener(this.setOrientation,this)}Ext.Component.superclass.onDestroy.call(this)}});Ext.BoxComponent=Ext.Component;Ext.reg("component",Ext.Component);Ext.reg("box",Ext.BoxComponent);Ext.lib.Container=Ext.extend(Ext.Component,{autoDestroy:true,defaultType:"panel",isContainer:true,baseCls:"x-container",initComponent:function(){this.addEvents("afterlayout","beforeadd","beforeremove","add","remove","beforecardswitch","cardswitch");Ext.lib.Container.superclass.initComponent.call(this);this.initItems()},initItems:function(){var a=this.items;this.items=new Ext.util.MixedCollection(false,this.getComponentId);if(a&&a.length){this.add(a)}},afterRender:function(){var a=Ext.layout.LayoutManager.create(this.layout,"autocontainer");this.setLayout(a);Ext.lib.Container.superclass.afterRender.call(this)},setLayout:function(b){var a=this.layout;if(a&&a.isLayout&&a!=b){a.setOwner(null)}this.layout=b;b.setOwner(this)},getLayout:function(){return this.layout},doLayout:function(){if(this.rendered&&this.layout){this.layout.layout()}return this},afterLayout:function(a){this.fireEvent("afterlayout",this,a)},prepareItems:function(a,c){if(!Ext.isArray(a)){a=[a]}var e,b,d;for(b=0,d=a.length;b<d;b++){e=a[b];if(c){e=this.applyDefaults(e)}a[b]=this.lookupComponent(e)}return a},applyDefaults:function(a){var b=this.defaults;if(b){if(Ext.isFunction(b)){b=b.call(this,a)}if(Ext.isString(a)){a=Ext.ComponentMgr.get(a);Ext.apply(a,b)}else{if(!a.isComponent){Ext.applyIf(a,b)}else{Ext.apply(a,b)}}}return a},lookupComponent:function(a){if(Ext.isString(a)){return Ext.ComponentMgr.get(a)}else{return this.createComponent(a)}return a},createComponent:function(a,b){if(a.isComponent){return a}return Ext.create(a,b||this.defaultType)},getComponentId:function(a){return a.getItemId()},add:function(){var f=Array.prototype.slice.call(arguments),d=-1;if(typeof f[0]=="number"){d=f.shift()}var a=f.length>1;if(a||Ext.isArray(f[0])){var g=a?f:f[0],b=[],c,e,j;for(c=0,e=g.length;c<e;c++){j=g[c];if(d!=-1){j=this.add(d+c,j)}else{j=this.add(j)}b.push(j)}return b}var h=this.prepareItems(f[0],true)[0];d=(d!==-1)?d:this.items.length;if(this.fireEvent("beforeadd",this,h,d)!==false&&this.onBeforeAdd(h)!==false){this.items.insert(d,h);h.onAdded(this,d);this.onAdd(h);this.fireEvent("add",this,h,d)}return h},onAdd:Ext.emptyFn,onRemove:Ext.emptyFn,insert:function(b,a){return this.add(b,a)},onBeforeAdd:function(a){if(a.ownerCt){a.ownerCt.remove(a,false)}if(this.hideBorders===true){a.border=(a.border===true)}},remove:function(a,b){var d=this.getComponent(a);if(d&&this.fireEvent("beforeremove",this,d)!==false){this.doRemove(d,b);this.fireEvent("remove",this,d)}return d},doRemove:function(c,b){var d=this.layout,a=d&&this.rendered;this.items.remove(c);c.onRemoved();if(a){d.onRemove(c)}this.onRemove(c);if(b===true||(b!==false&&this.autoDestroy)){c.destroy()}if(a){d.afterRemove(c)}},removeAll:function(b){var f,d=this.items.items.slice(),a=[],e=d.length,c;for(c=0;c<e;c++){f=d[c];this.remove(f,b);if(f.ownerCt!==this){a.push(f)}}return a},getRefItems:function(a){var b=this.items.items.slice(),e=b.length,c,d;if(a){for(c=0;c<e;c++){d=b[c];if(d.getRefItems){b=b.concat(d.getRefItems(true))}}}return b},getComponent:function(a){if(Ext.isObject(a)){a=a.getItemId()}return this.items.get(a)},query:function(a){return Ext.ComponentQuery.query(a,this)},child:function(a){return this.query("> "+a)[0]||null},down:function(a){return this.query(a)[0]||null},beforeDestroy:function(){var a;if(this.items){a=this.items.first();while(a){this.doRemove(a,true);a=this.items.first()}}Ext.destroy(this.layout);Ext.lib.Container.superclass.beforeDestroy.call(this)}});Ext.Container=Ext.extend(Ext.lib.Container,{animation:null,afterLayout:function(a){if(this.floating&&this.centered){this.setCentered(true,true)}if(this.scroller){this.scroller.updateBounds()}Ext.Container.superclass.afterLayout.call(this,a)},getActiveItem:function(){if(this.layout&&this.layout.type=="card"){return this.layout.activeItem}else{return null}},setCard:function(a,b){this.layout.setActiveItem(a,b);return this},onBeforeCardSwitch:function(a,c,b,d){return this.fireEvent("beforecardswitch",this,a,c,b,d)},onCardSwitch:function(a,c,b,d){return this.fireEvent("cardswitch",this,a,c,b,d)},disable:function(){Ext.Container.superclass.disable.call(this);this.el.mask()},enable:function(){Ext.Container.superclass.enable.call(this);this.el.unmask()}});Ext.reg("container",Ext.Container);Ext.lib.Panel=Ext.extend(Ext.Container,{baseCls:"x-panel",isPanel:true,componentLayout:"dock",renderTpl:['<div class="{baseCls}-body"<tpl if="bodyStyle"> style="{bodyStyle}"</tpl>></div>'],initComponent:function(){this.addEvents("bodyresize");Ext.applyIf(this.renderSelectors,{body:"."+this.baseCls+"-body"});Ext.lib.Panel.superclass.initComponent.call(this)},initItems:function(){Ext.lib.Panel.superclass.initItems.call(this);var a=this.dockedItems;this.dockedItems=new Ext.util.MixedCollection(false,this.getComponentId);if(a){this.addDocked(a)}},getDockedComponent:function(a){if(Ext.isObject(a)){a=a.getItemId()}return this.dockedItems.get(a)},getComponent:function(a){var b=Ext.lib.Panel.superclass.getComponent.call(this,a);if(b==undefined){b=this.getDockedComponent(a)}return b},initBodyStyles:function(){var a=Ext.isString(this.bodyStyle)?this.bodyStyle.split(";"):[],b=Ext.Element;if(this.bodyPadding!=undefined){a.push("padding: "+b.unitizeBox((this.bodyPadding===true)?5:this.bodyPadding))}if(this.bodyMargin!=undefined){a.push("margin: "+b.unitizeBox((this.bodyMargin===true)?5:this.bodyMargin))}if(this.bodyBorder!=undefined){a.push("border-width: "+b.unitizeBox((this.bodyBorder===true)?1:this.bodyBorder))}delete this.bodyStyle;return a.length?a.join(";"):undefined},initRenderData:function(){return Ext.applyIf(Ext.lib.Panel.superclass.initRenderData.call(this),{bodyStyle:this.initBodyStyles()})},addDocked:function(a,e){a=this.prepareItems(a);var d,b,c;for(b=0,c=a.length;b<c;b++){d=a[b];if(e!==undefined){this.dockedItems.insert(e+b,d)}else{this.dockedItems.add(d)}d.onAdded(this,b);this.onDockedAdd(d)}if(this.rendered){}},onDockedAdd:Ext.emptyFn,onDockedRemove:Ext.emptyFn,insertDocked:function(b,a){this.addDocked(a,b)},removeDocked:function(d,b){if(!this.dockedItems.contains(d)){return d}var c=this.componentLayout,a=c&&this.rendered;if(a){c.onRemove(d)}this.dockedItems.remove(d);d.onRemoved();this.onDockedRemove(d);if(b===true||(b!==false&&this.autoDestroy)){d.destroy()}if(a){c.afterRemove(d)}if(this.rendered){}return d},getDockedItems:function(){if(this.dockedItems&&this.dockedItems.items.length){return this.dockedItems.items.slice()}return[]},getTargetEl:function(){return this.body}});Ext.Panel=Ext.extend(Ext.lib.Panel,{scroll:false,fullscreen:false});Ext.reg("panel",Ext.Panel);Ext.Button=Ext.extend(Ext.Component,{initComponent:function(){this.addEvents("tap");Ext.Button.superclass.initComponent.call(this);this.createAutoHandler()},hidden:false,disabled:false,iconAlign:"left",iconAlign:"left",baseCls:"x-button",pressedCls:"x-button-pressed",badgeText:"",badgeCls:"x-badge",hasBadgeCls:"x-hasbadge",labelCls:"x-button-label",ui:"normal",isButton:true,pressedDelay:0,iconMaskCls:"x-icon-mask",iconMask:false,afterRender:function(c,a){var e=this;Ext.Button.superclass.afterRender.call(e,c,a);var g=e.text,d=e.icon,b=e.iconCls,f=e.badgeText;e.text=e.icon=e.iconCls=e.badgeText=null;e.setText(g);e.setIcon(d);e.setIconClass(b);if(e.iconMask&&e.iconEl){e.iconEl.addCls(e.iconMaskCls)}e.setBadge(f)},initEvents:function(){var a=this;Ext.Button.superclass.initEvents.call(a);a.mon(a.el,{scope:a,tap:a.onPress,tapstart:a.onTapStart,tapcancel:a.onTapCancel})},onTapStart:function(){var a=this;if(!a.disabled){if(a.pressedDelay){a.pressedTimeout=setTimeout(function(){a.el.addCls(a.pressedCls)},Ext.isNumber(a.pressedDelay)?a.pressedDelay:100)}else{a.el.addCls(a.pressedCls)}}},onTapCancel:function(){var a=this;if(a.pressedTimeout){clearTimeout(a.pressedTimeout);delete a.pressedTimeout}a.el.removeClass(a.pressedCls)},setHandler:function(b,a){this.handler=b;this.scope=a;return this},setText:function(b){var a=this;if(a.rendered){if(!a.textEl&&b){a.textEl=a.el.createChild({tag:"span",html:b,cls:this.labelCls})}else{if(a.textEl&&b!=a.text){if(b){a.textEl.setHTML(b)}else{a.textEl.remove();a.textEl=null}}}}a.text=b;return a},setIcon:function(a){var b=this;if(b.rendered){if(!b.iconEl&&a){b.iconEl=b.el.createChild({tag:"img",src:Ext.BLANK_IMAGE_URL,style:"background-image: "+(a?"url("+a+")":"")});b.setIconAlign(b.iconAlign)}else{if(b.iconEl&&a!=b.icon){if(a){b.iconEl.setStyle("background-image",a?"url("+a+")":"");b.setIconAlign(b.iconAlign)}else{b.setIconAlign(false);b.iconEl.remove();b.iconEl=null}}}}b.icon=a;return b},setIconClass:function(a){var b=this;if(b.rendered){if(!b.iconEl&&a){b.iconEl=b.el.createChild({tag:"img",src:Ext.BLANK_IMAGE_URL,cls:a});b.setIconAlign(b.iconAlign)}else{if(b.iconEl&&a!=b.iconCls){if(a){if(b.iconCls){b.iconEl.removeClass(b.iconCls)}b.iconEl.addCls(a);b.setIconAlign(b.iconAlign)}else{b.setIconAlign(false);b.iconEl.remove();b.iconEl=null}}}}b.iconCls=a;return b},setIconAlign:function(d){var c=this,a=["top","right","bottom","left"],d=((a.indexOf(d)==-1||!d)&&d!==false)?c.iconAlign:d,b;if(c.rendered&&c.iconEl){c.el.removeClass("x-iconalign-"+c.iconAlign);if(d){c.el.addCls("x-iconalign-"+d)}}c.iconAlign=(d===false)?c.iconAlign:d;return c},setBadge:function(b){var a=this;if(a.rendered){if(!a.badgeEl&&b){a.badgeEl=a.el.createChild({tag:"span",cls:a.badgeCls,html:b});a.el.addCls(a.hasBadgeCls)}else{if(a.badgeEl&&b!=a.badgeText){if(b){a.badgeEl.setHTML(b);a.el.addCls(a.hasBadgeCls)}else{a.badgeEl.remove();a.badgeEl=null;a.el.removeClass(a.hasBadgeCls)}}}}a.badgeText=b;return a},getText:function(){return this.text},getBadgeText:function(){return this.badgeText},onDisable:function(){this.onDisableChange(true)},onEnable:function(){this.onDisableChange(false)},onDisableChange:function(a){var b=this;if(b.el){b.el[a?"addCls":"removeClass"](b.disabledClass);b.el.dom.disabled=a}b.disabled=a},onPress:function(b){var a=this;if(!a.disabled){a.onTapCancel();a.callHandler(b);a.fireEvent("tap",a,b)}},callHandler:function(b){var a=this;if(a.handler){a.handler.call(a.scope||a,a,b)}},createAutoHandler:function(){var a=this,b=a.autoEvent;if(b){if(typeof b=="string"){b={name:b,scope:a.scope||a}}a.addEvents(b.name);a.setHandler(function(){b.scope.fireEvent(b.name,a)},b.scope)}}});Ext.reg("button",Ext.Button);Ext.SplitButton=Ext.extend(Ext.Container,{defaultType:"button",cmpCls:"x-splitbutton",activeCls:"x-button-active",allowMultiple:false,initComponent:function(){this.layout={type:"hbox",align:"stretch"};Ext.SplitButton.superclass.initComponent.call(this)},afterRender:function(){Ext.SplitButton.superclass.afterRender.call(this);this.mon(this.el,{tap:this.onTap,scope:this})},afterLayout:function(a){Ext.SplitButton.superclass.afterLayout.call(this,a);if(!this.initialized){this.items.each(function(b){if(b.active){this.setActive(b)}},this);this.initialized=true}},onTap:function(b,a){a=b.getTarget(".x-button");if(a&&!this.disabled){this.setActive(Ext.getCmp(a.id))}},getActive:function(){return this.allowMultiple?this.activeButtons:this.activeButton},setActive:function(b){if(Ext.isNumber(b)){b=this.items.get(b)}else{if(Ext.isString(b)){b=Ext.getCmp(b)}else{if(!b.isButton){b=null}}}if(this.allowMultiple){this.activeButtons=this.activeButtons||[];if(b){var a=this.activeButtons.indexOf(b);if(a==-1){this.activeButtons.push(b);b.el.addCls(this.activeCls)}else{this.activeButtons.splice(a,1);b.el.removeClass(this.activeCls)}}}else{this.activeButton=b;if(this.activeButton){b.el.radioClass(this.activeCls)}}},disable:function(){this.items.each(function(a){a.disable()},this);Ext.SplitButton.superclass.disable.apply(this,arguments)},enable:function(){this.items.each(function(a){a.enable()},this);Ext.SplitButton.superclass.enable.apply(this,arguments)}});Ext.reg("splitbutton",Ext.SplitButton);Ext.ButtonContainer=Ext.extend(Ext.Container,{defaultType:"button",cls:"x-splitbutton",cmpCls:"x-buttons",activeCls:"x-button-active",allowMultiple:false,initComponent:function(){this.layout=Ext.apply({},this.layout||{},{type:"hbox",align:"stretch"});Ext.ButtonContainer.superclass.initComponent.call(this);this.addEvents("toggle")},afterRender:function(){Ext.ButtonContainer.superclass.afterRender.call(this);this.mon(this.el,{tap:this.onTap,scope:this})},afterLayout:function(b){var a=this;Ext.ButtonContainer.superclass.afterLayout.call(a,b);if(!a.initialized){a.items.each(function(d,c){a.setActive(d,!!d.active,true)});a.initialized=true}},onTap:function(b,a){if(!this.disabled&&(a=b.getTarget(".x-button"))){this.setActive(a.id)}},getActive:function(){return this.allowMultiple?this.getActiveButtons():this.activeButton},setActive:function(a,d,b){var c=this;a=c.getComponent(a);if(!a||!a.isButton||a.disabled){return}if(typeof d=="boolean"){a.el[d?"addCls":"removeClass"](c.activeCls)}else{a.el[c.allowMultiple?"toggleClass":"radioClass"](c.activeCls)}if(c.initialized){c.getActiveButtons(b!==true)}c.activeButton=a},getActiveButtons:function(d){var c=[],a,b=this;b.items.each(function(e){if(e.isButton&&!e.disabled){a=e.active||false;if(e.active=e.el.hasClass(b.activeCls)){c.push(e)}if(d&&a!==e.active){b.fireEvent("toggle",b,e,e.active)}}});return c},disable:function(){this.items.each(function(a){a.disable()});Ext.ButtonContainer.superclass.disable.apply(this,arguments)},enable:function(){this.items.each(function(a){a.enable()},this);Ext.ButtonContainer.superclass.enable.apply(this,arguments)}});Ext.reg("buttons",Ext.ButtonContainer);Ext.DataPanel=Ext.extend(Ext.Panel,{blockRefresh:false,initComponent:function(){if(Ext.isString(this.tpl)||Ext.isArray(this.tpl)){this.tpl=new Ext.XTemplate(this.tpl)}this.store=Ext.StoreMgr.lookup(this.store);this.all=new Ext.CompositeElementLite();this.instances=new Ext.util.MixedCollection();if(this.components){if(Ext.isFunction(this.components)){this.components=[{config:this.components}]}else{if(Ext.isObject(this.components)){this.components=[this.components]}}if(!this.tpl){this.tpl=new Ext.XTemplate('<tpl for="."><div class="x-list-item"></div></tpl>',{compiled:true});this.itemSelector=".x-list-item"}}this.addEvents("refresh");Ext.DataPanel.superclass.initComponent.call(this)},afterRender:function(){Ext.DataPanel.superclass.afterRender.call(this);var e=this.components,d,b,a,c;if(e){for(b=0,d=e.length;b<d;b++){a=e[b];if(a.listeners){a.delegateCls=Ext.id(null,"x-cmp-");a.listeners.delegate=(a.targetSelector||this.itemSelector)+" > ."+a.delegateCls;this.mon(this.getTemplateTarget(),a.listeners)}}}if(this.store){this.bindStore(this.store,true)}},getStore:function(){return this.store},refresh:function(){if(!this.rendered){return}var b=this.getTemplateTarget(),a=this.getRenderRecords();if(a.length<1){this.all.clear()}else{this.tpl.overwrite(b,this.collectData(a,0));this.all.fill(Ext.query(this.itemSelector,b.dom))}this.updateItems(0);this.fireEvent("refresh",this,a)},getRenderRecords:function(){return this.store.getRange()},getTemplateTarget:function(){return this.scrollEl||this.body},prepareData:function(a){return a},collectData:function(a,e){var c=[],b,d=a.length;for(b=0;b<d;b++){c[c.length]=this.prepareData(a[b].data,e+b,a[b])}return c},bindStore:function(a,b){if(!this.rendered){this.store=a;return}if(!b&&this.store){if(a!==this.store&&this.store.autoDestroy){this.store.destroyStore()}else{this.store.un({scope:this,beforeload:this.onBeforeLoad,datachanged:this.onDataChanged,add:this.onAdd,remove:this.onRemove,update:this.onUpdate,clear:this.refresh})}if(!a){this.store=null}}if(a){a=Ext.StoreMgr.lookup(a);a.on({scope:this,beforeload:this.onBeforeLoad,datachanged:this.onDataChanged,add:this.onAdd,remove:this.onRemove,update:this.onUpdate,clear:this.refresh})}this.store=a;if(a){this.refresh()}},onBeforeLoad:Ext.emptyFn,bufferRender:function(a,b){var c=document.createElement("div");this.tpl.overwrite(c,this.collectData(a,b));return Ext.query(this.itemSelector,c)},onUpdate:function(f,a){var b=this.store.indexOf(a),e,c,d;if(b>-1){e=this.isSelected(b);c=this.all.elements[b];d=this.bufferRender([a],b)[0];this.all.replaceElement(b,d,true);if(e){this.selected.replaceElement(c,d);this.all.item(b).addCls(this.selectedClass)}this.updateItems(b,b)}},onAdd:function(f,d,e){if(this.all.getCount()===0){this.refresh();return}var c=this.bufferRender(d,e),g,b=this.all.elements;if(e<this.all.getCount()){g=this.all.item(e).insertSibling(c,"before",true);b.splice.apply(b,[e,0].concat(c))}else{g=this.all.last().insertSibling(c,"after",true);b.push.apply(b,c)}this.updateItems(e)},onRemove:function(c,a,b){this.deselect(b);this.onRemoveItem(this.all.item(b),b);this.all.removeElement(b,true);if(this.store.getCount()===0){this.refresh()}if(this.components){this.cleanInstances()}},refreshNode:function(a){this.onUpdate(this.store,this.store.getAt(a))},updateItems:function(d,c){var b=this.all.elements;d=d||0;c=c||((c===0)?0:(b.length-1));for(var a=d;a<=c;a++){b[a].viewIndex=a;if(this.components){this.createInstances(b[a])}this.onUpdateItem(b[a],a)}if(this.components){this.cleanInstances()}this.doComponentLayout()},onUpdateItem:Ext.emptyFn,onRemoveItem:Ext.emptyFn,createInstances:function(f){var h=Ext.id(f),e=this.components,d=e.length,c,b,a,g;for(c=0;c<d;c++){b=e[c];g=b.targetSelector?Ext.fly(f).down(b.targetSelector,true):f;if(g){if(Ext.isObject(b.config)){a=Ext.create(b.config,"button")}else{if(Ext.isFunction(b.config)){a=b.config.call(this,this.getRecord(f),f,f.viewIndex)}}if(a){this.instances.add(a);a.addCls(b.delegateCls);a.render(g);a.doComponentLayout()}}}},cleanInstances:function(){this.instances.each(function(a){if(!document.getElementById(a.id)){this.instances.remove(a);a.destroy()}},this)},onDataChanged:function(){if(this.blockRefresh!==true){this.refresh.apply(this,arguments)}},findItemFromChild:function(a){return Ext.fly(a).findParent(this.itemSelector,this.getTemplateTarget())},getRecords:function(b){var e=[],d=b,a=d.length,c;for(c=0;c<a;c++){e[e.length]=this.store.getAt(d[c].viewIndex)}return e},getRecord:function(a){return this.store.getAt(a.viewIndex)},getNode:function(b){if(Ext.isString(b)){return document.getElementById(b)}else{if(Ext.isNumber(b)){return this.all.elements[b]}else{if(b instanceof Ext.data.Model){var a=this.store.indexOf(b);return this.all.elements[a]}}}return b},getNodes:function(e,a){var d=this.all.elements,b=[],c;e=e||0;a=!Ext.isDefined(a)?Math.max(d.length-1,0):a;if(e<=a){for(c=e;c<=a&&d[c];c++){b.push(d[c])}}else{for(c=e;c>=a&&d[c];c--){b.push(d[c])}}return b},indexOf:function(a){a=this.getNode(a);if(Ext.isNumber(a.viewIndex)){return a.viewIndex}return this.all.indexOf(a)},onDestroy:function(){this.all.clear();Ext.DataPanel.superclass.onDestroy.call(this);this.bindStore(null)}});Ext.reg("datapanel",Ext.DataPanel);Ext.DataView=Ext.extend(Ext.DataPanel,{scroll:"vertical",selectedCls:"x-item-selected",pressedCls:"x-item-pressed",pressedDelay:100,emptyText:"",deferEmptyText:true,last:false,initComponent:function(){this.selected=new Ext.CompositeElementLite();Ext.DataView.superclass.initComponent.call(this);this.addEvents("itemtap","itemdoubletap","containertap","selectionchange","beforeselect")},afterRender:function(){Ext.DataView.superclass.afterRender.call(this);this.mon(this.getTemplateTarget(),{tap:this.onTap,tapstart:this.onTapStart,tapcancel:this.onTapCancel,touchend:this.onTapCancel,doubletap:this.onDoubleTap,scope:this})},refresh:function(){if(!this.rendered){return}var a=this.getTemplateTarget();a.update("");this.clearSelections(false,true);if(this.store.getRange().length<1&&(!this.deferEmptyText||this.hasSkippedEmptyText)){a.update(this.emptyText)}this.hasSkippedEmptyText=true;Ext.DataView.superclass.refresh.call(this)},findTarget:function(a){return a.getTarget(this.itemSelector,this.getTemplateTarget())},onTap:function(c){var b=this.findTarget(c);if(b){Ext.fly(b).removeClass(this.pressedCls);var a=this.indexOf(b);if(this.onItemTap(b,a,c)!==false){c.stopEvent();this.fireEvent("itemtap",this,a,b,c)}}else{if(this.fireEvent("containertap",this,c)!==false){this.onContainerTap(c)}}},onTapStart:function(d,a){var c=this,b=this.findTarget(d);if(b){if(c.pressedDelay){if(c.pressedTimeout){clearTimeout(c.pressedTimeout)}c.pressedTimeout=setTimeout(function(){Ext.fly(b).addCls(c.pressedCls)},Ext.isNumber(c.pressedDelay)?c.pressedDelay:100)}else{Ext.fly(b).addCls(c.pressedCls)}}},onTapCancel:function(d,a){var c=this,b=this.findTarget(d);if(c.pressedTimeout){clearTimeout(c.pressedTimeout);delete c.pressedTimeout}if(b){Ext.fly(b).removeClass(c.pressedCls)}},onContainerTap:function(a){this.clearSelections()},onDoubleTap:function(b){var a=this.findTarget(b);if(a){this.fireEvent("itemdoubletap",this,this.indexOf(a),a,b)}},onItemTap:function(b,a,c){if(this.pressedTimeout){clearTimeout(this.pressedTimeout);delete this.pressedTimeout}if(this.multiSelect){this.doMultiSelection(b,a,c);c.preventDefault()}else{if(this.singleSelect){this.doSingleSelection(b,a,c);c.preventDefault()}}return true},doSingleSelection:function(b,a,c){if(this.isSelected(a)){this.deselect(a)}else{this.select(a,false)}},doMultiSelection:function(b,a,c){if(this.isSelected(a)){this.deselect(a)}else{this.select(a,true)}},getSelectionCount:function(){return this.selected.elements.length},getSelectedNodes:function(){return this.selected.elements},getSelectedIndexes:function(){var b=[],d=this.selected.elements,a=d.length,c;for(c=0;c<a;c++){b.push(d[c].viewIndex)}return b},getSelectedRecords:function(){var d=[],c=this.selected.elements,a=c.length,b;for(b=0;b<a;b++){d[d.length]=this.store.getAt(c[b].viewIndex)}return d},clearSelections:function(a,b){if((this.multiSelect||this.singleSelect)&&this.getSelectionCount()>0){if(!b){this.selected.removeClass(this.selectedCls)}this.selected.clear();this.last=false;if(!a){this.fireEvent("selectionchange",this,this.selected.elements,this.getSelectedRecords())}}},isSelected:function(a){return this.selected.contains(this.getNode(a))},deselect:function(a){if(this.isSelected(a)){a=this.getNode(a);this.selected.removeElement(a);if(this.last==a.viewIndex){this.last=false}Ext.fly(a).removeClass(this.selectedCls);this.fireEvent("selectionchange",this,this.selected.elements,[])}},select:function(d,f,b){if(Ext.isArray(d)){if(!f){this.clearSelections(true)}for(var c=0,a=d.length;c<a;c++){this.select(d[c],true,true)}if(!b){this.fireEvent("selectionchange",this,this.selected.elements,this.getSelectedRecords())}}else{var e=this.getNode(d);if(!f){this.clearSelections(true)}if(e&&!this.isSelected(e)){if(this.fireEvent("beforeselect",this,e,this.selected.elements)!==false){Ext.fly(e).addCls(this.selectedCls);this.selected.add(e);this.last=e.viewIndex;if(!b){this.fireEvent("selectionchange",this,this.selected.elements,this.getSelectedRecords())}}}}},selectRange:function(c,a,b){if(!b){this.clearSelections(true)}this.select(this.getNodes(c,a),true)},onBeforeLoad:function(){if(this.loadingText){this.clearSelections(false,true);this.getTemplateTarget().update('<div class="loading-indicator">'+this.loadingText+"</div>");this.all.clear()}},onDestroy:function(){this.selected.clear();Ext.DataView.superclass.onDestroy.call(this)}});Ext.DataView.prototype.setStore=Ext.DataView.prototype.bindStore;Ext.reg("dataview",Ext.DataView);Ext.List=Ext.extend(Ext.DataView,{cmpCls:"x-list",pinHeaders:true,indexBar:false,grouped:false,clearSelectionOnDeactivate:true,renderTpl:['<div class="{baseCls}-body"<tpl if="bodyStyle"> style="{bodyStyle}"</tpl>>','<tpl if="grouped"><h3 class="x-list-header x-list-header-swap x-hidden-display"></h3></tpl>',"</div>"],groupTpl:['<tpl for=".">','<div class="x-list-group x-group-{id}">','<h3 class="x-list-header">{group}</h3>','<div class="x-list-group-items">',"{items}","</div>","</div>","</tpl>"],disclosure:false,initComponent:function(){if(this.scroll!==false){this.scroll={direction:"vertical",scrollbars:false}}if(this.grouped){this.itemTpl=this.tpl;if(Ext.isString(this.itemTpl)||Ext.isArray(this.itemTpl)){this.itemTpl=new Ext.XTemplate(this.itemTpl)}if(Ext.isString(this.groupTpl)||Ext.isArray(this.groupTpl)){this.tpl=new Ext.XTemplate(this.groupTpl)}}else{this.indexBar=false}if(this.indexBar){var a=Ext.apply({},Ext.isObject(this.indexBar)?this.indexBar:{},{xtype:"indexbar",dock:"right",overlay:true,alphabet:true});this.indexBar=new Ext.IndexBar(a);this.dockedItems=this.dockedItems||[];this.dockedItems.push(this.indexBar);this.cls=this.cls||"";this.cls+=" x-list-indexed"}else{if(this.scroll){this.scroll.scrollbars=true}}Ext.List.superclass.initComponent.call(this);if(this.disclosure){if(Ext.isFunction(this.disclosure)){this.disclosure={scope:this,handler:this.disclosure}}this.components=this.components||[];this.components.push({config:Ext.apply({},this.disclosure.config||{},{xtype:"button",baseCls:"x-disclosure"}),listeners:{tap:this.onDisclosureTap,scope:this}})}this.on("deactivate",this.onDeactivate,this);this.addEvents("disclose")},onRender:function(){if(this.grouped){Ext.applyIf(this.renderData,{grouped:true});Ext.applyIf(this.renderSelectors,{header:".x-list-header-swap"})}Ext.List.superclass.onRender.apply(this,arguments)},onDeactivate:function(){if(this.clearSelectionOnDeactivate){this.clearSelections()}},afterRender:function(){if(!this.grouped){this.el.addCls("x-list-flat")}this.getTemplateTarget().addCls("x-list-parent");Ext.List.superclass.afterRender.call(this)},initEvents:function(){Ext.List.superclass.initEvents.call(this);if(this.grouped){if(this.pinHeaders&&this.scroll){this.mon(this.scroller,{scrollstart:this.onScrollStart,scroll:this.onScroll,scope:this})}if(this.indexBar){this.mon(this.indexBar,{index:this.onIndex,scope:this})}}},onDisclosureTap:function(f,c){var d=this.findItemFromChild(c);if(d){var a=this.getRecord(d),b=this.indexOf(d);this.fireEvent("disclose",a,d,b);if(Ext.isObject(this.disclosure)&&this.disclosure.handler){this.disclosure.handler.call(this,a,d,b)}}},setActiveGroup:function(b){var a=this;if(b){if(!a.activeGroup||a.activeGroup.header!=b.header){a.header.setHTML(b.header.getHTML());a.header.show()}}else{a.header.hide()}this.activeGroup=b},getClosestGroups:function(g){var a=this.groupOffsets,d=a.length,f,b,e,c;for(b=0;b<d;b++){f=a[b];if(f.offset>g.y){c=f;break}e=f}return{current:e,next:c}},updateItems:function(){Ext.List.superclass.updateItems.apply(this,arguments);this.updateOffsets()},afterLayout:function(){Ext.List.superclass.afterLayout.apply(this,arguments);this.updateOffsets()},updateOffsets:function(){if(this.grouped){this.groupOffsets=[];var c=this.body.query("h3.x-list-header"),b=c.length,d,a;for(a=0;a<b;a++){d=Ext.get(c[a]);d.setDisplayMode(Ext.Element.VISIBILITY);this.groupOffsets.push({header:d,offset:d.dom.offsetTop})}}},onScrollStart:function(){var a=this.scroller.getOffset();this.closest=this.getClosestGroups(a);this.setActiveGroup(this.closest.current)},onScroll:function(a,d,c){if(!this.closest){this.closest=this.getClosestGroups(d)}if(!this.headerHeight){this.headerHeight=this.header.getHeight()}if(d.y<=0){if(this.activeGroup){this.setActiveGroup(false);this.closest.next=this.closest.current}return}else{if((this.closest.next&&d.y>this.closest.next.offset)||(d.y<this.closest.current.offset)){this.closest=this.getClosestGroups(d);this.setActiveGroup(this.closest.current)}}if(this.closest.next&&d.y>0&&this.closest.next.offset-d.y<=this.headerHeight){var b=this.headerHeight-(this.closest.next.offset-d.y);this.header.setStyle("-webkit-transform","translate3d(0, -"+b+"px, 0)");this.transformed=true}else{if(this.transformed){this.header.setStyle("-webkit-transform",null);this.transformed=false}}},onIndex:function(e,g,f){var k=e.get("key").toLowerCase(),c=this.store.getGroups(),h=c.length,j,d,b,a;for(d=0;d<h;d++){j=c[d];a=this.getGroupId(j);if(a==k||a>k){b=a;break}else{b=a}}b=this.body.down(".x-group-"+a);if(b){this.scroller.scrollTo({x:0,y:b.getOffsetsTo(this.scrollEl)[1]},false,null,true)}},getGroupId:function(a){return a.name.toLowerCase()},collectData:function(e,l){if(!this.grouped){return Ext.List.superclass.collectData.call(this,e,l)}var g=[],d=this.store.getGroups(),h=d.length,b,a,j,k,f;for(f=0,h=d.length;f<h;f++){k=d[f];b=k.children;for(j=0,a=b.length;j<a;j++){b[j]=b[j].data}g.push({group:k.name,id:this.getGroupId(k),items:this.itemTpl.apply(b)})}return g},onUpdate:function(b,a){if(this.grouped){this.refresh()}else{Ext.List.superclass.onUpdate.apply(this,arguments)}},onAdd:function(c,a,b){if(this.grouped){this.refresh()}else{Ext.List.superclass.onAdd.apply(this,arguments)}},onRemove:function(c,a,b){if(this.grouped){this.refresh()}else{Ext.List.superclass.onRemove.apply(this,arguments)}}});Ext.reg("list",Ext.List);Ext.regModel("IndexBarModel",{fields:["key","value"]});Ext.Toolbar=Ext.extend(Ext.Container,{isToolbar:true,defaultType:"button",baseCls:"x-toolbar",titleCls:"x-toolbar-title",ui:"dark",layout:null,titleEl:null,initComponent:function(){this.layout=Ext.apply({},this.layout||{},{type:"hbox",align:"center"});Ext.Toolbar.superclass.initComponent.call(this)},afterRender:function(){Ext.Toolbar.superclass.afterRender.call(this);if(this.title){this.titleEl=this.el.createChild({cls:this.titleCls,html:this.title})}},setTitle:function(a){this.title=a;if(this.rendered){if(!this.titleEl){this.titleEl=this.el.createChild({cls:this.titleCls,html:this.title})}this.titleEl.setHTML(a)}},showTitle:function(){if(this.titleEl){this.titleEl.show()}},hideTitle:function(){if(this.titleEl){this.titleEl.hide()}}});Ext.reg("toolbar",Ext.Toolbar);Ext.Spacer=Ext.extend(Ext.Component,{initComponent:function(){if(!this.width){this.flex=1}Ext.Spacer.superclass.initComponent.call(this)},onRender:function(){Ext.Spacer.superclass.onRender.apply(this,arguments);if(this.flex){this.el.setStyle("-webkit-box-flex",this.flex)}}});Ext.reg("spacer",Ext.Spacer);Ext.Sheet=Ext.extend(Ext.Panel,{baseCls:"x-sheet",centered:false,floating:true,modal:true,hideOnMaskTap:false,draggable:false,monitorOrientation:true,hidden:true,arrive:"bottom",depart:"bottom",arrivalEffect:"slide",departEffect:"slide",transitions:{bottom:"up",top:"down",right:"left",left:"right"},animSheet:function(a){var d=null,b=this,c=b.transitions,e=Ext.Anim.prototype.opposites||{};if(a&&this[a]){if(a=="arrive"){d=(typeof b.arrivalEffect=="string")?{type:b.arrivalEffect||"slide",direction:c[b.arrive]||"up"}:b.arrivalEffect}else{if(a=="depart"){d=(typeof b.departEffect=="string")?{type:b.departEffect||"slide",direction:e[c[b.depart]]||"down"}:b.departEffect}}}return d},orient:function(a,k,d){if(!this.container||this.centered||!this.floating){return this}var g=this,e=g.initialConfig||{},l={width:e.width,height:e.height},j={x:e.x,y:e.y},c=g.el.getPageBox(),f,b=0;if(g.container.dom==document.body){f={width:window.innerWidth,height:window.innerHeight};b=document.body.scrollTop}else{f=g.container.getPageBox()}f.centerY=f.height/2;f.centerX=f.width/2;if(j.x!=undefined||j.y!=undefined){j.x=j.x||0;j.y=j.y||0}else{if(/^(bottom|top)/i.test(g.arrive)){l.width=g.stretchX?f.width:Math.min(200,Math.max(l.width||c.width||f.width,f.width));l.height=Math.min(l.height||0,f.height)||undefined;l=g.setSize(l).getSize();j.x=f.centerX-l.width/2;j.y=g.arrive=="top"?0:f.height-l.height+b}else{if(/^(left|right)/i.test(g.arrive)){l.height=g.stretchY?f.height:Math.min(200,Math.max(l.height||c.height||f.height,f.height));l.width=Math.min(l.width||0,f.width)||undefined;l=g.setSize(l).getSize();j.y=0;j.x=g.arrive=="left"?0:f.width-l.width}}}g.setPosition(j);return this},afterRender:function(){Ext.Sheet.superclass.afterRender.apply(this,arguments);this.el.setDisplayMode(Ext.Element.OFFSETS)},onShow:function(a){this.orient();return Ext.Sheet.superclass.onShow.call(this,a||this.animSheet("arrive"))},onHide:function(a){if(a===undefined){a=(a===false)?null:this.animSheet("depart")}return Ext.Sheet.superclass.onHide.call(this,a)},onOrientationChange:function(b,a,c){this.orient();Ext.Sheet.superclass.onOrientationChange.apply(this,arguments)},beforeDestroy:function(){delete this.showAnimation;this.hide(false);Ext.Sheet.superclass.beforeDestroy.call(this)}});Ext.reg("sheet",Ext.Sheet);Ext.NestedList=Ext.extend(Ext.Panel,{cmpCls:"x-nested-list",layout:"card",animation:"slide",backButton:null,backText:"Back",useTitleAsBackText:true,updateTitleText:true,displayField:"text",loadingText:"Loading...",emptyText:"No items available.",disclosure:false,clearSelectionDefer:200,getItemTextTpl:function(a){return"{"+this.displayField+"}"},getTitleTextTpl:function(a){return"{"+this.displayField+"}"},renderTitleText:function(b){if(!b.titleTpl){b.titleTpl=new Ext.XTemplate(this.getTitleTextTpl(b))}var a=b.getRecord();if(a){return b.titleTpl.applyTemplate(a.data)}else{if(b.isRoot){return this.title||this.backText}else{throw"No RecordNode passed into renderTitleText"}}},useToolbar:true,getDetailCard:function(b,a){return false},initComponent:function(){var b=Ext.StoreMgr.lookup(this.store),a=b.getRootNode(),c=a.getRecord()?this.renderTitleText(a):this.title||"";this.store=b;if(this.useToolbar){this.backButton=new Ext.Button({text:this.backText,ui:"back",handler:this.onBackTap,scope:this,hidden:true});if(!this.toolbar||!this.toolbar.isComponent){this.toolbar=Ext.apply({},this.toolbar||{},{dock:"top",xtype:"toolbar",ui:"light",title:c,items:[]});this.toolbar.items.unshift(this.backButton);this.toolbar=new Ext.Toolbar(this.toolbar);this.dockedItems=this.dockedItems||[];this.dockedItems.push(this.toolbar)}else{this.toolbar.insert(0,this.backButton)}}this.items=[this.getSubList(a)];Ext.NestedList.superclass.initComponent.call(this);this.on("itemtap",this.onItemTap,this);this.addEvents("listchange","leafitemtap")},getListConfig:function(b){var c=b.internalId,a=this.emptyText;return{itemId:c,xtype:"list",autoDestroy:true,recordNode:b,store:this.store.getSubStore(b),loadingText:this.loadingText,disclosure:this.disclosure,displayField:this.displayField,singleSelect:true,clearSelectionOnDeactivate:false,bubbleEvents:["itemtap","containertap","beforeselect","itemdoubletap","selectionchange"],itemSelector:".x-list-item",tpl:new Ext.XTemplate('<tpl for="."><div class="x-list-item <tpl if="leaf == true">x-list-item-leaf</tpl>">',this.getItemTextTpl(b),"</div></tpl>"),emptyText:this.loadingText,deferEmptyText:false,refresh:function(){if(this.hasSkippedEmptyText){this.emptyText=a}Ext.List.prototype.refresh.apply(this,arguments)}}},getSubList:function(b){var a=this.items,c,d=b.internalId;if(a&&a.get){c=a.get(d)}if(c){return c}else{return this.getListConfig(b)}},onItemTap:function(p,f,a,l){var n=p.getStore(),h=n.getAt(f),r=h.node,m,g=r?r.parentNode:null,j=this.backButton,q=this.useTitleAsBackText&&g?this.renderTitleText(g):this.backText,k=this.displayField,d,c,b;if(r.leaf){b=this.getDetailCard(r,g);if(b){m=this.add(b)}this.fireEvent("leafitemtap",p,f,a,l,b)}else{m=this.getSubList(r);m=this.add(m)}if(m){c=this.items.indexOf(m);this.setCard(m,{type:this.animation});if(j){d=(c!==0)?"show":"hide";j[d]();j.setText(q)}if(this.toolbar&&this.updateTitleText){this.toolbar.setTitle(this.renderTitleText(r));this.toolbar.doLayout()}}},onBackTap:function(){var g=this.getActiveItem(),h=this.items.indexOf(g);if(h!=0){var a=h-1,c=this.items.itemAt(a),k=c.recordNode,d=k.getRecord(),e=k?k.parentNode:null,f=this.backButton,b=(a!==0)?"show":"hide",j;this.setCard(a,{type:this.animation,reverse:true,after:function(l,m){this.remove(g);if(this.clearSelectionDefer){c.clearSelections.defer(this.clearSelectionDefer,c)}},scope:this});if(f){f[b]();if(e){j=this.useTitleAsBackText?this.renderTitleText(e):this.backText;f.setText(j)}}if(this.toolbar&&this.updateTitleText){this.toolbar.setTitle(k&&k.getRecord()?this.renderTitleText(k):this.title||"");this.toolbar.doLayout()}}}});Ext.reg("nestedlist",Ext.NestedList);Ext.regModel("x-textvalue",{fields:["text","value"]});Ext.Media=Ext.extend(Ext.Container,{url:"",enableControls:true,autoResume:false,autoPause:true,preload:true,playing:false,afterRender:function(){var a=this.getConfiguration();Ext.apply(a,{src:this.url,preload:this.preload?"auto":"none"});if(this.enableControls){a.controls="controls"}if(this.loop){a.loop="loop"}this.media=this.el.createChild(a);Ext.Media.superclass.afterRender.call(this);this.on({scope:this,activate:this.onActivate,beforedeactivate:this.onDeactivate})},onActivate:function(){if(this.autoResume&&!this.playing){this.play()}},onDeactivate:function(){if(this.autoPause&&this.playing){this.pause()}},play:function(){this.media.dom.play();this.playing=true},pause:function(){this.media.dom.pause();this.playing=false},toggle:function(){if(this.playing){this.pause()}else{this.play()}}});Ext.reg("media",Ext.Media);Ext.Video=Ext.extend(Ext.Media,{poster:"",cmpCls:"x-video",afterRender:function(){Ext.Video.superclass.afterRender.call(this);if(this.poster){this.media.hide();this.ghost=this.el.createChild({cls:"x-video-ghost",style:"width: 100%; height: 100%; background: #000 url("+this.poster+") center center no-repeat; -webkit-background-size: 100% auto;"});this.ghost.on("tap",this.onGhostTap,this,{single:true})}},onGhostTap:function(){this.media.show();this.ghost.hide();this.play()},getConfiguration:function(){return{tag:"video",width:"100%",height:"100%"}}});Ext.reg("video",Ext.Video);Ext.Audio=Ext.extend(Ext.Media,{cmpCls:"x-audio",onActivate:function(){Ext.Audio.superclass.onActivate.call(this);if(Ext.is.Phone){this.media.show()}},onDeactivate:function(){Ext.Audio.superclass.onDeactivate.call(this);if(Ext.is.Phone){this.media.hide()}},getConfiguration:function(){var a=!this.enableControls;if(!Ext.supports.AudioTag){return{tag:"embed",type:"audio/mpeg",target:"myself",controls:"true",hidden:a}}else{return{tag:"audio",hidden:a}}}});Ext.reg("audio",Ext.Audio);Ext.MessageBox=Ext.extend(Ext.Sheet,{centered:true,cmpCls:"x-msgbox",modal:true,renderHidden:true,arrivalEffect:"pop",departEffect:"pop",bodyPadding:"0 5 8 5",autoHeight:true,defaultTextHeight:75,ui:"dark",constructor:function(a){a=a||{};var c=this,d=a.ui||c.ui||"",b=a.cmpCls||c.cmpCls;delete a.html;c.titleBar=Ext.create({xtype:"toolbar",ui:d,dock:"top",cls:b+"-title",title:"&#160;"});c.buttonBar=Ext.create({xtype:"toolbar",ui:d,dock:"bottom",layout:{pack:"center"},cls:b+"-buttons"});a=Ext.apply({ui:d,dockedItems:[c.titleBar,c.buttonBar],renderSelectors:{body:"."+b+"-body",iconEl:"."+b+"-icon",msgContentEl:"."+b+"-content",msgEl:"."+b+"-text",inputsEl:"."+b+"-inputs",inputEl:"."+b+"-input-single",multiLineEl:"."+b+"-input-textarea"}},a||{});Ext.MessageBox.superclass.constructor.call(this,a)},renderTpl:['<div class="{cmpCls}-body"<tpl if="bodyStyle"> style="{bodyStyle}"</tpl>>','<div class="{cmpCls}-icon x-hidden-display"></div>','<div class="{cmpCls}-content">','<span class="{cmpCls}-text"></span><br />','<div class="{cmpCls}-inputs x-hidden-display">','<input type="text" class="{cmpCls}-input {cmpCls}-input-single" />','<textarea class="{cmpCls}-input {cmpCls}-input-textarea"></textarea>',"</div>","</div>","</div>"],onClick:function(b){if(b){var a=b.config||{};if(typeof a.fn=="function"){a.fn.call(a.scope||null,b.itemId||b.text,a.input?a.input.dom.value:null,a)}if(a.cls){this.el.removeClass(a.cls)}if(a.input){a.input.dom.blur()}}this.hide()},show:function(c){var e=this,f,d,h={autocomplete:"off",autocapitalize:"off",autocorrect:"off",maxlength:0,autofocus:true,placeholder:"",type:"text"},a=/true|on/i;e.rendered||e.render(document.body);c=Ext.applyIf(c||{},{multiLine:false,prompt:false,value:"",modal:true});if(c.title){e.titleBar.setTitle(c.title);e.titleBar.show()}else{e.titleBar.hide()}if(e.inputsEl&&(c.multiLine||c.prompt)){e.inputsEl.show();if(e.multiLineEl&&c.multiLine){e.inputEl&&e.inputEl.hide();e.multiLineEl.show().setHeight(Ext.isNumber(c.multiLine)?parseFloat(c.multiLine):e.defaultTextHeight);c.input=e.multiLineEl}else{if(e.inputEl){e.inputEl.show();e.multiLineEl&&e.multiLineEl.hide();c.input=e.inputEl}}if(Ext.isObject(c.prompt)){Ext.apply(h,c.prompt)}for(d in h){if(h.hasOwnProperty(d)){f=h[d];c.input.dom.setAttribute(d.toLowerCase(),/^auto/i.test(d)?(a.test(f+"")?"on":"off"):f)}}}else{e.inputsEl&&e.inputsEl.hide()}e.setIcon(c.icon||"",false);e.updateText(c.msg,false);if(c.cls){e.el.addCls(c.cls)}e.modal=!!c.modal;var g=e.buttonBar,b=[];g.removeAll();Ext.each([].concat(c.buttons||Ext.MessageBox.OK),function(j){if(j){this.push(Ext.applyIf({config:c,scope:e,handler:e.onClick},j))}},b);g.add(b);if(g.rendered){g.doLayout()}e.doComponentLayout(c.width,c.height);Ext.MessageBox.superclass.show.call(e,c.animate);if(c.input){c.input.dom.value=c.value||"";if(a.test(h.autofocus+"")&&!("autofocus" in c.input.dom)){c.input.dom.focus()}}return e},onOrientationChange:function(b,a,c){this.doComponentLayout();Ext.MessageBox.superclass.onOrientationChange.apply(this,arguments)},adjustScale:function(){Ext.apply(this,{maxWidth:window.innerWidth,maxHeight:window.innerHeight,minWidth:window.innerWidth*0.3,minHeight:window.innerHeight*0.3})},doComponentLayout:function(c,e){var f=this;if(f.msgContentEl&&f.buttonBar.rendered){f.adjustScale();var b,a=f.iconEl.getSize(),d=f.buttonBar.getSize();f.msgContentEl.setStyle({marginLeft:Ext.Element.addUnits(a.width+3)});b=f.msgContentEl.getSize();c=Ext.isNumber(c)?c:(window.innerWidth*0.7);f.setSize(c,null);b=f.msgContentEl.getSize();e=Ext.isNumber(e)?e:Math.min(f.maxHeight,Math.min(f.minHeight,f.el.getPadding("tb")+f.el.getMargin("tb")+f.body.getPadding("tb")+f.body.getMargin("tb")+Math.max(b.height,a.height)+d.height+(f.titleBar?f.titleBar.getSize().height:0)))}return Ext.MessageBox.superclass.doComponentLayout.call(f,c,e)},alert:function(d,c,b,a){return this.show({title:d,msg:c,buttons:Ext.MessageBox.OK,fn:b,scope:a,icon:Ext.MessageBox.INFO})},confirm:function(d,c,b,a){return this.show({title:d,msg:c,buttons:Ext.MessageBox.YESNO,fn:b,scope:a,icon:Ext.MessageBox.QUESTION})},prompt:function(g,f,c,b,e,d,a){return this.show({title:g,msg:f,buttons:Ext.MessageBox.OKCANCEL,fn:c,scope:b,icon:Ext.MessageBox.QUESTION,prompt:a||true,multiLine:e,value:d})},updateText:function(b,a){if(this.msgEl){this.msgEl.update(b?String(b):"&#160;");if(a!==false){this.doComponentLayout()}}return this},setIcon:function(a,b){if(a){this.iconEl.show();this.iconEl.replaceClass(this.iconCls,a)}else{this.iconEl.replaceClass(this.iconCls,"x-hidden-display")}if(b!==false){this.doComponentLayout()}this.iconCls=a;return this}});(function(){var a=Ext.MessageBox;Ext.apply(a,{OK:{text:"OK",itemId:"ok",ui:"action"},CANCEL:{text:"Cancel",itemId:"cancel"},YES:{text:"Yes",itemId:"yes",ui:"action"},NO:{text:"No",itemId:"no"},INFO:"x-msgbox-info",WARNING:"x-msgbox-warning",QUESTION:"x-msgbox-question",ERROR:"x-msgbox-error"});Ext.apply(a,{OKCANCEL:[a.OK,a.CANCEL],YESNOCANCEL:[a.YES,a.NO,a.CANCEL],YESNO:[a.YES,a.NO]})})();Ext.reg("msgbox",Ext.MessageBox);Ext.Msg=new Ext.MessageBox();Ext.form.FormPanel=Ext.extend(Ext.Panel,{standardSubmit:false,cmpCls:"x-form",url:undefined,baseParams:undefined,waitTpl:new Ext.XTemplate('<div class="{cls}">{message}&hellip;</div>'),getElConfig:function(){return Ext.apply(Ext.form.FormPanel.superclass.getElConfig.call(this),{tag:"form"})},initComponent:function(){this.addEvents("submit","beforesubmit","exception");Ext.form.FormPanel.superclass.initComponent.call(this)},afterRender:function(){Ext.form.FormPanel.superclass.afterRender.call(this);this.el.on("submit",this.onSubmit,this)},onSubmit:function(b,a){if(!this.standardSubmit||this.fireEvent("beforesubmit",this,this.getValues(true))===false){if(b){b.stopEvent()}}},submit:function(a){var b=this.el.dom||{},d=Ext.apply({url:this.url||b.action,submitDisabled:false,method:b.method||"post",autoAbort:false,params:null,waitMsg:null,headers:null,success:null,failure:null},a||{}),c=this.getValues(this.standardSubmit||!d.submitDisabled);if(this.standardSubmit){if(b){if(d.url&&Ext.isEmpty(b.action)){b.action=d.url}b.method=(d.method||b.method).toLowerCase();b.submit()}return null}if(this.fireEvent("beforesubmit",this,c,a)!==false){if(d.waitMsg){this.showMask(d.waitMsg)}return Ext.Ajax.request({url:d.url,method:d.method,rawData:Ext.urlEncode(Ext.apply(Ext.apply({},this.baseParams||{}),d.params||{},c)),autoAbort:d.autoAbort,headers:Ext.apply({"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},d.headers||{}),scope:this,callback:function(f,h,e){var g=e;this.hideMask();if(h){g=Ext.decode(g.responseText);h=!!g.success;if(h){if(typeof d.success=="function"){d.scope?d.success.call(d.scope,this,g):d.success(this,g)}this.fireEvent("submit",this,g);return}}if(typeof d.failure=="function"){d.scope?d.failure.call(d.scope,this,g):d.failure(this,g)}this.fireEvent("exception",this,g)}})}},loadRecord:function(a){if(a&&a.data){this.setValues(a.data);this.record=a}return this},loadModel:function(){return this.loadRecord.apply(this,arguments)},getRecord:function(){return this.record},updateModel:function(b,e){var a,c,d;if(b&&(a=b.fields)){c=this.getValues(e);for(d in c){if(c.hasOwnProperty(d)&&a.containsKey(d)){b.set(d,c[d])}}}return this},setValues:function(b){var a=this.getFields(),c,d;b=b||{};for(c in b){if(b.hasOwnProperty(c)&&c in a){d=a[c];d.setValue&&d.setValue(b[c])}}return this},getValues:function(d){var a=this.getFields(),e,b={},c;for(c in a){if(a.hasOwnProperty(c)){e=a[c];if(d&&e.disabled){continue}if(e.getValue){b[c]=e.getGroupValue?e.getGroupValue():e.getValue()}}}return b},reset:function(){var a=this.getFields(),b;for(b in a){if(a.hasOwnProperty(b)){a[b].reset()}}},getFields:function(){var a={};var b=function(c){if(c.isField){a[c.getName()]=c}if(c.isContainer){c.items.each(b)}};this.items.each(b);return a},showMask:function(a,b){a=Ext.isString(a)?{message:a,transparent:false}:a;if(a&&this.waitTpl){this.maskTarget=b=Ext.get(b||a.target)||this.el;b&&b.mask(!!a.transparent,this.waitTpl.apply(a))}return this},hideMask:function(){if(this.maskTarget){this.maskTarget.unmask();delete this.maskTarget}return this}});Ext.form.FormPanel.prototype.load=Ext.form.FormPanel.prototype.loadModel;Ext.reg("form",Ext.form.FormPanel);Ext.form.FieldSet=Ext.extend(Ext.Panel,{cmpCls:"x-form-fieldset",initComponent:function(){this.componentLayout=new Ext.layout.AutoComponentLayout();Ext.form.FieldSet.superclass.initComponent.call(this)},afterLayout:function(a){Ext.form.FieldSet.superclass.afterLayout.call(this,a);if(this.title&&!this.titleEl){this.setTitle(this.title)}else{if(this.titleEl){this.el.insertFirst(this.titleEl)}}if(this.instructions&&!this.instructionsEl){this.setInstructions(this.instructions)}else{if(this.instructionsEl){this.el.appendChild(this.instructionsEl)}}},setTitle:function(a){if(this.rendered){if(!this.titleEl){this.titleEl=this.el.insertFirst({cls:this.cmpCls+"-title"})}this.titleEl.setHTML(a)}else{this.title=a}return this},setInstructions:function(a){if(this.rendered){if(!this.instructionsEl){this.instructionsEl=this.el.createChild({cls:this.cmpCls+"-instructions"})}this.instructionsEl.setHTML(a)}else{this.instructions=a}return this}});Ext.reg("fieldset",Ext.form.FieldSet);Ext.form.Field=Ext.extend(Ext.Component,{ui:"text",isField:true,baseCls:"x-field",inputCls:undefined,focusClass:"x-field-focus",maxLength:0,placeHolder:undefined,autoComplete:undefined,autoCapitalize:undefined,autoFocus:undefined,autoCorrect:undefined,renderTpl:['<tpl if="label"><label <tpl if="fieldEl">for="{inputId}"</tpl>><span>{label}</span></label></tpl>','<tpl if="fieldEl"><input id="{inputId}" type="{type}" name="{name}" class="{fieldCls}"','<tpl if="tabIndex">tabIndex="{tabIndex}" </tpl>','<tpl if="placeHolder">placeholder="{placeHolder}" </tpl>','<tpl if="style">style="{style}" </tpl>','<tpl if="maxlength">maxlength="{maxlength}" </tpl>','<tpl if="autoComplete">autocomplete="{autoComplete}" </tpl>','<tpl if="autoCapitalize">autocapitalize="{autoCapitalize}" </tpl>','<tpl if="autoCorrect">autocorrect="{autoCorrect}" </tpl>','<tpl if="autoFocus">autofocus="{autoFocus}" </tpl>',"/></tpl>",'<tpl if="showClear"><div class="x-field-clear x-hidden-display"></div></tpl>','<tpl if="maskField"><div class="x-field-mask"></div></tpl>'],disabled:false,isFormField:true,hasFocus:false,autoCreateField:true,inputType:"text",label:null,labelWidth:100,labelAlign:"left",required:false,maskField:false,initComponent:function(){this.label=this.label||this.fieldLabel;Ext.form.Field.superclass.initComponent.call(this);this.addEvents("focus","blur","change","keyup")},getName:function(){return this.name||this.id||""},applyRenderSelectors:function(){this.renderSelectors=Ext.applyIf(this.renderSelectors||{},{mask:".x-field-mask",labelEl:"label",clearEl:".x-field-clear",fieldEl:"."+this.renderData.fieldCls.trim().replace(/ /g,".")});Ext.form.Field.superclass.applyRenderSelectors.call(this)},initRenderData:function(){var e=this,g=Ext.form.Field.superclass.initRenderData.call(this),f=e.autoComplete,c=e.autoCapitalize,d=e.autoFocus,a=e.autoCorrect;Ext.applyIf(g,{disabled:e.disabled,fieldCls:"x-input-"+e.inputType+(e.inputCls?" "+e.inputCls:""),fieldEl:!e.fieldEl&&e.autoCreateField,inputId:Ext.id(),label:e.label,labelAlign:"x-label-align-"+e.labelAlign,name:e.name||e.id,placeHolder:e.placeHolder,required:e.required,style:e.style,tabIndex:e.tabIndex,maxlength:e.maxLength,type:e.inputType,maskField:e.maskField,showClear:e.showClear});var b=/true|on/i;if(f!==undefined){g.autoComplete=b.test(f+"")?"on":"off"}if(c!==undefined){g.autoCapitalize=b.test(c+"")?"on":"off"}if(a!==undefined){g.autoCorrect=b.test(a+"")?"on":"off"}if(d!==undefined){g.autoFocus=b.test(d+"")?"on":"off";e.autoFocus=g.autoFocus=="on"}this.renderData=g;return g},onRender:function(){Ext.form.Field.superclass.onRender.apply(this,arguments);var a=[];if(this.required){a.push("x-field-required")}if(this.label){a.push("x-label-align-"+this.labelAlign)}this.el.addCls(a)},initEvents:function(){var a=this;Ext.form.Field.superclass.initEvents.call(a);if(a.fieldEl){a.mon(a.fieldEl,{focus:a.onFocus,blur:a.onBlur,keyup:a.onKeyUp,paste:a.checkClear,scope:a});if(a.maskField){a.mon(a.mask,{tap:a.onMaskTap,scope:a})}if(a.clearEl){a.mon(a.clearEl,{scope:this,tap:this.onClearTap})}}},onEnable:function(){this.el.removeClass(this.disabledClass);this.el.dom.disabled=false;this.fieldEl.dom.disabled=false;this.checkClear()},onDisable:function(){this.el.addCls(this.disabledClass);this.el.dom.disabled=true;this.fieldEl.dom.disabled=true;this.checkClear(true)},initValue:function(){if(this.value!==undefined){this.setValue(this.value)}this.originalValue=this.getValue()},isDirty:function(){if(this.disabled||!this.rendered){return false}return String(this.getValue())!==String(this.originalValue)},onClearTap:function(){this.setValue("")},checkClear:function(c){var b=this.clearEl,d=this.fieldEl,a=this.getValue();if(!(b&&d)){return}a=Ext.isEmpty(a)?"":String(a);if(c||a.length===0){b.addCls("x-hidden-display");d.removeClass("x-field-clearable")}else{b.removeClass("x-hidden-display");d.addCls("x-field-clearable")}},afterRender:function(){Ext.form.Field.superclass.afterRender.call(this);this.initValue();this.checkClear();if(this.autoFocus&&!("autofocus" in this.fieldEl.dom)){this.focus()}},onKeyUp:function(a){this.checkClear();this.fireEvent("keyup",this,a)},onMaskTap:function(a){this.mask.hide()},reset:function(){this.setValue(this.originalValue)},beforeFocus:Ext.emptyFn,undoNativeScroll:function(){var a=this.el.parent();while(a){if(a.getStyle("overflow")=="hidden"){a.dom.scrollTop=0;a.dom.scrollLeft=0}a=a.parent()}},onFocus:function(b){var a=this;setTimeout(function(){a.undoNativeScroll()},0);this.beforeFocus();if(this.focusClass){this.el.addCls(this.focusClass)}if(!this.hasFocus){this.hasFocus=true;this.startValue=this.getValue();this.fireEvent("focus",this)}},beforeBlur:Ext.emptyFn,onBlur:function(){this.beforeBlur();if(this.focusClass){this.el.removeClass(this.focusClass)}this.hasFocus=false;var a=this.getValue();if(String(a)!=String(this.startValue)){this.fireEvent("change",this,a,this.startValue)}this.fireEvent("blur",this);this.checkClear();if(this.maskField){this.mask.show()}this.postBlur()},postBlur:Ext.emptyFn,getValue:function(){if(!this.rendered||!this.fieldEl){return this.value}return this.fieldEl.getValue()},focus:function(){if(this.rendered&&this.fieldEl&&this.fieldEl.dom.focus){this.fieldEl.dom.focus()}return this},blur:function(){if(this.rendered&&this.fieldEl&&this.fieldEl.dom.blur){this.fieldEl.dom.blur()}return this},setValue:function(a){this.value=a;if(this.rendered&&this.fieldEl){this.fieldEl.dom.value=(Ext.isEmpty(a)?"":a)}this.checkClear();return this}});Ext.reg("field",Ext.form.Field);Ext.form.Slider=Ext.extend(Ext.form.Field,{ui:"slider",inputCls:"x-slider",minValue:0,maxValue:100,animate:true,value:0,renderTpl:['<tpl if="label">','<label <tpl if="fieldEl">for="{inputId}"</tpl>>{label}</label>',"</tpl>",'<tpl if="fieldEl">','<div id="{inputId}" name="{name}" class="{fieldCls}"','<tpl if="tabIndex">tabIndex="{tabIndex}"</tpl>','<tpl if="style">style="{style}" </tpl>',"/></tpl>",'<div class="x-field-mask"></div>'],increment:1,constructor:function(a){this.addEvents("beforechange","change","drag","dragend");Ext.form.Slider.superclass.constructor.call(this,a)},initComponent:function(){this.values=[this.value];Ext.form.Slider.superclass.initComponent.apply(this,arguments);if(this.thumbs==undefined){var a=[],b=this.values,d=b.length,c,e=this.getThumbClass();for(c=0;c<d;c++){a[a.length]=new e({value:b[c],slider:this,listeners:{scope:this,drag:this.onDrag,dragend:this.onThumbDragEnd}})}this.thumbs=a}},getThumbClass:function(){return Ext.form.Slider.Thumb},setValue:function(d){var c=this,a=c.getThumb(),b=a.getValue(),e=c.constrain(d);if(c.fireEvent("beforechange",c,a,b,e)!==false){this.moveThumb(a,this.getPixelValue(e,a));a.setValue(e);c.doComponentLayout();c.fireEvent("change",c,a,b,e)}},constrain:function(e){var b=this.increment,g=Math.floor(Math.abs(e/b)),c=this.minValue+(g*b),a=Math.min(c+b,this.maxValue),f=e-c,d=a-e;return(f<d)?c:a},getValue:function(){return this.getThumb().getValue()},getThumb:function(){return this.thumbs[0]},getSliderValue:function(b,d){var f=d.el.getOuterWidth(),g=f/2,a=this.fieldEl.getWidth()-f,c=this.maxValue-this.minValue,e=c/a;return this.minValue+(e*(b-g))},getPixelValue:function(f,c){var e=c.el.getOuterWidth(),g=e/2,a=this.fieldEl.getWidth()-e,b=this.maxValue-this.minValue,d=a/b;return(d*(f-this.minValue))+g},renderThumbs:function(){var a=this.thumbs,c=a.length,b;for(b=0;b<c;b++){a[b].render(this.fieldEl)}},onThumbDragEnd:function(a){var c=this.getThumbValue(a),b=this;b.setValue(c);b.fireEvent("dragend",b,a.thumb,b.constrain(c))},getThumbValue:function(b){var d=b.thumb,e=this.fieldEl.getPageBox(),c=d.el.getPageBox(),f=c.width,g=f/2,a=(c.left-e.left)+g;return this.getSliderValue(a,d)},onDrag:function(a){var b=this.getThumbValue(a);this.fireEvent("drag",this,a.thumb,this.constrain(b))},onTap:function(d){if(!this.disabled){var b=this.fieldEl.getPageBox(),c=d.pageX-b.left,a=this.getNearest(c);this.setValue(this.getSliderValue(c,a))}},moveThumb:function(b,c,a){var d=b.el.getOuterWidth()/2;b.el.setLeft(c-d)},afterRender:function(a){this.renderThumbs();Ext.form.Slider.superclass.afterRender.apply(this,arguments);this.fieldEl.on({scope:this,tap:this.onTap})},getNearest:function(a){return this.thumbs[0]},setThumbsDisabled:function(b){var a=this.thumbs,d=a.length,c=0;for(;c<d;c++){a[c].dragObj[b?"disable":"enable"]()}},disable:function(){Ext.form.Slider.superclass.disable.call(this);this.setThumbsDisabled(true)},enable:function(){Ext.form.Slider.superclass.enable.call(this);this.setThumbsDisabled(false)}});Ext.reg("slider",Ext.form.Slider);Ext.form.Slider.Thumb=Ext.extend(Ext.form.Field,{isField:false,baseCls:"x-thumb",ui:"thumb",autoCreateField:false,draggable:true,value:0,onRender:function(){this.draggable={direction:"horizontal",constrain:this.slider.fieldEl,revert:false,thumb:this};Ext.form.Slider.Thumb.superclass.onRender.apply(this,arguments)},setValue:function(a){this.value=a},getValue:function(){return this.value}});Ext.reg("thumb",Ext.form.Slider.Thumb);Ext.form.Toggle=Ext.extend(Ext.form.Slider,{minValue:0,maxValue:1,ui:"toggle",inputType:"toggle",minValueCls:"x-toggle-off",maxValueCls:"x-toggle-on",toggle:function(){var b=this,a=b.thumbs[0],c=a.getValue();b.setValue(c==b.minValue?b.maxValue:b.minValue)},setValue:function(b){var a=this;Ext.form.Toggle.superclass.setValue.apply(a,arguments);var c=a.fieldEl;if(a.constrain(b)===a.minValue){c.addCls(a.minValueCls);c.removeClass(a.maxValueCls)}else{c.addCls(a.maxValueCls);c.removeClass(a.minValueCls)}},onTap:function(){if(!this.disabled){this.toggle()}},getThumbClass:function(){return Ext.form.Toggle.Thumb}});Ext.reg("toggle",Ext.form.Toggle);Ext.form.Toggle.Thumb=Ext.extend(Ext.form.Slider.Thumb,{onRender:function(){Ext.form.Toggle.Thumb.superclass.onRender.apply(this,arguments);Ext.DomHelper.append(this.el,[{cls:"x-toggle-thumb-off",html:"<span>OFF</span>"},{cls:"x-toggle-thumb-on",html:"<span>ON</span>"},{cls:"x-toggle-thumb-thumb"}])}});Ext.form.TextField=Ext.extend(Ext.form.Field,{type:"text",maskField:Ext.is.iOS});Ext.reg("textfield",Ext.form.TextField);Ext.form.PasswordField=Ext.extend(Ext.form.Field,{maskField:Ext.is.iOS,inputType:"password",autoCapitalize:false});Ext.reg("passwordfield",Ext.form.PasswordField);Ext.form.EmailField=Ext.extend(Ext.form.TextField,{inputType:"email",autoCapitalize:false});Ext.reg("emailfield",Ext.form.EmailField);Ext.form.UrlField=Ext.extend(Ext.form.TextField,{inputType:"url",autoCapitalize:false});Ext.reg("urlfield",Ext.form.UrlField);Ext.form.SearchField=Ext.extend(Ext.form.Field,{inputType:"search"});Ext.reg("searchfield",Ext.form.SearchField);Ext.form.NumberField=Ext.extend(Ext.form.TextField,{inputType:"number",minValue:undefined,maxValue:undefined,stepValue:undefined,renderTpl:['<tpl if="label"><label <tpl if="fieldEl">for="{inputId}"</tpl>>{label}</label></tpl>','<tpl if="fieldEl"><input id="{inputId}" type="{type}" name="{name}" class="{fieldCls}"','<tpl if="tabIndex">tabIndex="{tabIndex}" </tpl>','<tpl if="placeholder">placeholder="{placeholder}" </tpl>','<tpl if="style">style="{style}" </tpl>','<tpl if="minValue != undefined">min="{minValue}" </tpl>','<tpl if="maxValue != undefined">max="{maxValue}" </tpl>','<tpl if="stepValue != undefined">step="{stepValue}" </tpl>','<tpl if="autoComplete">autocomplete="{autoComplete}" </tpl>','<tpl if="autoCapitalize">autocapitalize="{autoCapitalize}" </tpl>','<tpl if="autoFocus">autofocus="{autoFocus}" </tpl>',"/></tpl>",'<tpl if="showClear"><div class="x-field-clear x-hidden-display"></div></tpl>','<tpl if="maskField"><div class="x-field-mask"></div></tpl>'],ui:"number",onRender:function(b,a){Ext.apply(this.renderData,{maxValue:this.maxValue,minValue:this.minValue,stepValue:this.stepValue});Ext.form.NumberField.superclass.onRender.call(this,b,a)}});Ext.reg("numberfield",Ext.form.NumberField);Ext.form.HiddenField=Ext.extend(Ext.form.Field,{inputType:"hidden",ui:"hidden",focus:Ext.emptyFn});Ext.reg("hidden",Ext.form.HiddenField);Ext.form.Checkbox=Ext.extend(Ext.form.Field,{inputType:"checkbox",ui:"checkbox",checked:false,inputValue:undefined,constructor:function(a){this.addEvents("check");Ext.form.Checkbox.superclass.constructor.call(this,a)},renderTpl:['<tpl if="label"><label <tpl if="fieldEl">for="{inputId}"</tpl>><span>{label}</span></label></tpl>','<tpl if="fieldEl"><input id="{inputId}" type="{type}" name="{name}" class="{fieldCls}" ','<tpl if="tabIndex">tabIndex="{tabIndex}" </tpl>','<tpl if="checked"> checked </tpl>','<tpl if="style">style="{style}" </tpl> value="{inputValue}" />',"</tpl>"],onRender:function(b,a){var c=this;Ext.apply(c.renderData,{inputValue:c.inputValue||c.value||"",checked:c.checked=/^(true|1|on)/i.test(String(c.checked))});Ext.form.Checkbox.superclass.onRender.call(c,b,a);if(c.fieldEl){c.mon(c.fieldEl,{change:c.onChange,scope:c});c.setValue(c.checked)}},onChange:function(){this.fireEvent("check",this,this.getValue())},getValue:function(){if(this.rendered){return this.fieldEl.dom.checked||false}return this.checked||false},setValue:function(a){var b=this.getValue();this.checked=/^(true|1|on)/i.test(String(a));if(this.rendered){this.fieldEl.dom.checked=this.fieldEl.dom.defaultChecked=this.checked}if(b!=this.checked){this.onChange()}}});Ext.reg("checkbox",Ext.form.Checkbox);Ext.form.TextArea=Ext.extend(Ext.form.TextField,{maskField:Ext.is.iOS,maxRows:undefined,autoCapitalize:false,renderTpl:['<tpl if="label"><label <tpl if="fieldEl">for="{inputId}"</tpl>>{label}</label></tpl>','<tpl if="fieldEl"><textarea id="{inputId}" type="{type}" name="{name}" class="{fieldCls}"','<tpl if="tabIndex">tabIndex="{tabIndex}" </tpl>','<tpl if="placeHolder">placeholder="{placeHolder}" </tpl>','<tpl if="style">style="{style}" </tpl>','<tpl if="maxRows != undefined">rows="{maxRows}" </tpl>','<tpl if="maxlength">maxlength="{maxlength}" </tpl>','<tpl if="autoComplete">autocomplete="{autoComplete}" </tpl>','<tpl if="autoCapitalize">autocapitalize="{autoCapitalize}" </tpl>','<tpl if="autoFocus">autofocus="{autoFocus}" </tpl>',"></textarea></tpl>",'<tpl if="showClear"><div class="x-field-clear x-hidden-display"></div></tpl>','<tpl if="maskField"><div class="x-field-mask"></div></tpl>'],ui:"textarea",onRender:function(b,a){this.renderData.maxRows=this.maxRows;Ext.form.TextArea.superclass.onRender.call(this,b,a)}});Ext.reg("textarea",Ext.form.TextArea);Ext.layout.LayoutManager=new Ext.AbstractManager({create:function(a,b){if(!a){a=b}if(Ext.isString(a)){return new this.types[a||b]}else{if(Ext.isObject(a)){if(a.isLayout){return a}else{return new this.types[a.type||b](a)}}}}});Ext.regLayout=function(){return Ext.layout.LayoutManager.registerType.apply(Ext.layout.LayoutManager,arguments)};Ext.layout.Layout=Ext.extend(Object,{type:"layout",isLayout:true,initialized:false,constructor:function(a){this.id=Ext.id(null,"ext-layout-");Ext.apply(this,a)},layout:function(){this.initLayout();if(this.beforeLayout.apply(this,arguments)!==false){this.onLayout.apply(this,arguments);this.afterLayout()}},beforeLayout:function(){this.renderItems(this.getLayoutItems(),this.getTarget());return true},renderItems:function(a,e){var d=a.length,b,c;for(b=0;b<d;b++){c=a[b];if(c&&!c.rendered){this.renderItem(c,b,e)}else{if(!this.isValidParent(c,e)){this.moveItem(c,b,e)}}}},renderItem:function(b,a,c){if(!b.rendered){b.render(c,a);this.configureItem(b,a);this.childrenChanged=true}},moveItem:function(b,a,c){if(typeof a=="number"){a=c.dom.childNodes[a]}c=c.dom||c;c.insertBefore(b.el.dom,a||null);b.container=c;this.configureItem(b,a);this.childrenChanged=true},initLayout:function(){if(!this.initialized&&!Ext.isEmpty(this.targetCls)){this.getTarget().addCls(this.targetCls)}this.initialized=true},setOwner:function(a){this.owner=a},getLayoutItems:function(){return[]},isValidParent:function(a,b){var c=a.el?a.el.dom:Ext.getDom(a);return b&&(c.parentNode==(b.dom||b))},configureItem:function(b,a){if(this.itemCls){b.el.addCls(this.itemCls)}},onLayout:Ext.emptyFn,afterLayout:Ext.emptyFn,onRemove:Ext.emptyFn,onDestroy:Ext.emptyFn,afterRemove:function(a){if(this.itemCls&&a.rendered){a.el.removeClass(this.itemCls)}},destroy:function(){if(!Ext.isEmpty(this.targetCls)){var a=this.getTarget();if(a){a.removeClass(this.targetCls)}}this.onDestroy()}});Ext.layout.ComponentLayout=Ext.extend(Ext.layout.Layout,{type:"component",beforeLayout:function(b,a){Ext.layout.ComponentLayout.superclass.beforeLayout.call(this);return this.needsLayout(b,a)},needsLayout:function(c,a){this.lastComponentSize=this.lastComponentSize||{width:-Infinity,height:-Infinity};var b=this.childrenChanged;this.childrenChanged=false;return(b||this.lastComponentSize.width!==c||this.lastComponentSize.height!==a)},setElementSize:function(c,b,a){if(b!==undefined&&a!==undefined){c.setSize(b,a)}else{if(a!==undefined){c.setHeight(a)}else{if(b!==undefined){c.setWidth(b)}}}},getTarget:function(){return this.owner.el},setTargetSize:function(b,a){this.setElementSize(this.owner.el,b,a);this.lastComponentSize={width:b,height:a}},afterLayout:function(){var a=this.owner,b=a.layout;a.afterComponentLayout(this);if(b&&b.isLayout){b.layout()}}});Ext.layout.AutoComponentLayout=Ext.extend(Ext.layout.ComponentLayout,{type:"autocomponent",onLayout:function(b,a){this.setTargetSize(b,a)}});Ext.regLayout("autocomponent",Ext.layout.AutoComponentLayout);Ext.layout.DockLayout=Ext.extend(Ext.layout.ComponentLayout,{type:"dock",itemCls:"x-docked",onLayout:function(b,a){var c=this.owner.layout,e=this.getTarget();var d=this.info={boxes:[],size:{width:b,height:a},padding:{top:e.getPadding("t"),right:e.getPadding("r"),bottom:e.getPadding("b"),left:e.getPadding("l")},border:{top:e.getBorderWidth("t"),right:e.getBorderWidth("r"),bottom:e.getBorderWidth("b"),left:e.getBorderWidth("l")},bodyBox:{}};if(a===undefined||a===null){this.setTargetSize((b===undefined)?null:b,null);this.updateBodyBox({width:null,height:null});if(c&&c.isLayout){c.layout()}this.dockItems(true);this.setTargetSize(d.size.width,d.size.height)}else{this.setTargetSize(b,a);this.dockItems()}Ext.layout.DockLayout.superclass.onLayout.call(this,b,a)},afterLayout:function(){Ext.layout.DockLayout.superclass.afterLayout.call(this)},dockItems:function(a){this.calculateDockBoxes(a);var f=this.info,c=f.boxes,e=c.length,d,b;for(b=0;b<e;b++){d=c[b];d.item.setPosition(d.x,d.y)}this.updateBodyBox(f.bodyBox)},calculateDockBoxes:function(n){var g=this.getTarget(),k=this.getLayoutItems(),a=this.owner,q=a.body,b=this.info,r=b.size,j=k.length,l=b.padding,c=b.border,p,d,f,m,e;r.width=(b.width===undefined)?g.getWidth():b.width;if(n){r.height=q.getHeight()+l.top+c.top+l.bottom+c.bottom}b.bodyBox={x:c.left+l.left,y:c.top+l.top,width:r.width-l.left-c.left-l.right-c.right,height:r.height-c.top-l.top-c.bottom-l.bottom};for(d=0;d<j;d++){p=k[d];f=this.initBox(p);if(n===true){f=this.adjustAutoBox(f,d)}else{f=this.adjustSizedBox(f,d)}b.boxes.push(f)}},adjustSizedBox:function(c,b){var a=this.info.bodyBox;switch(c.type){case"top":c.y=a.y;break;case"left":c.x=a.x;break;case"bottom":c.y=(a.y+a.height)-c.height;break;case"right":c.x=(a.x+a.width)-c.width;break}if(!c.overlay){switch(c.type){case"top":a.y+=c.height;a.height-=c.height;break;case"left":a.x+=c.width;a.width-=c.width;break;case"bottom":a.height-=c.height;break;case"right":a.width-=c.width;break}}return c},adjustAutoBox:function(c,f){var a=this.info,g=a.bodyBox,j=a.size,d=a.boxes,h=c.type,b,e;if(h=="top"||h=="bottom"){for(b=0;b<f;b++){e=d[b];if(e.stretched&&e.type=="left"||e.type=="right"){e.height+=c.height}else{if(e.type=="bottom"){e.y+=c.height}}}}switch(h){case"top":c.y=g.y;if(!c.overlay){g.y+=c.height}j.height+=c.height;break;case"bottom":c.y=(g.y+g.height);j.height+=c.height;break;case"left":c.x=g.x;if(!c.overlay){g.x+=c.width;g.width-=c.width}break;case"right":if(!c.overlay){g.width-=c.width}c.x=(g.x+g.width);break}return c},initBox:function(d){var b=this.info.bodyBox,a=(d.dock=="top"||d.dock=="bottom"),c={item:d,overlay:d.overlay,type:d.dock};if(d.stretch!==false){c.stretched=true;if(a){c.x=b.x;c.width=b.width;d.doComponentLayout(c.width-d.el.getMargin("lr"))}else{c.y=b.y;c.height=b.height;d.doComponentLayout(undefined,c.height-d.el.getMargin("tb"))}}else{d.doComponentLayout();c.width=d.getWidth();c.height=d.getHeight();if(a){c.x=(d.align=="right")?b.width-c.width:b.x}}if(c.width==undefined){c.width=d.getWidth()+d.el.getMargin("lr")}if(c.height==undefined){c.height=d.getHeight()+d.el.getMargin("tb")}return c},getLayoutItems:function(){return this.owner.getDockedItems()},updateBodyBox:function(c){var a=this.owner.body,e=this.info,d=e.padding,b=e.border;if(Ext.isNumber(c.width)){c.width-=a.getMargin("lr")}if(Ext.isNumber(c.height)){c.height-=a.getMargin("tb")}this.setElementSize(a,c.width,c.height);a.setLeft(c.x-d.left-b.left);a.setTop(c.y-d.top-b.top)},configureItem:function(b,c){Ext.layout.DockLayout.superclass.configureItem.call(this,b,c);var a=b.el||Ext.get(b);if(this.itemCls){a.addCls(this.itemCls+"-"+b.dock)}},afterRemove:function(a){Ext.layout.DockLayout.superclass.afterRemove.call(this,a);if(this.itemCls){a.el.removeClass(this.itemCls+"-"+a.dock)}}});Ext.regLayout("dock",Ext.layout.DockLayout);Ext.layout.FieldLayout=Ext.extend(Ext.layout.ComponentLayout,{type:"field",onLayout:function(b,a){Ext.layout.FieldLayout.superclass.onLayout.call(this,owner,target);this.setTargetSize(b,a)},handleLabel:function(){this.owner.labelEl.setWidth(this.owner.labelWidth)}});Ext.regLayout("field",Ext.layout.FieldLayout);Ext.layout.ContainerLayout=Ext.extend(Ext.layout.Layout,{type:"container",getLayoutItems:function(){return this.owner&&this.owner.items&&this.owner.items.items||[]},afterLayout:function(){this.owner.afterLayout(this)},getTarget:function(){return this.owner.getTargetEl()},});Ext.layout.AutoContainerLayout=Ext.extend(Ext.layout.ContainerLayout,{type:"autocontainer",onLayout:function(a,e){var b=this.getLayoutItems(),d=b.length,c;for(c=0;c<d;c++){b[c].doComponentLayout()}}});Ext.regLayout("auto",Ext.layout.AutoContainerLayout);Ext.regLayout("autocontainer",Ext.layout.AutoContainerLayout);Ext.layout.FitLayout=Ext.extend(Ext.layout.ContainerLayout,{itemCls:"x-fit-item",targetCls:"x-layout-fit",type:"fit",onLayout:function(){Ext.layout.FitLayout.superclass.onLayout.call(this);if(this.owner.items.length){var a=this.getTargetBox();this.setItemBox(this.owner.items.get(0),a)}},getTargetBox:function(){var d=this.getTarget(),b=d.getSize(),c={left:d.getPadding("l"),right:d.getPadding("r"),top:d.getPadding("t"),bottom:d.getPadding("b")},a={left:d.getBorderWidth("l"),right:d.getBorderWidth("r"),top:d.getBorderWidth("t"),bottom:d.getBorderWidth("b")};return{width:b.width-c.left-c.right-a.left-a.right,height:b.height-c.top-c.bottom-a.top-a.bottom,x:c.left+a.left,y:c.top+a.top}},setItemBox:function(b,a){if(b&&a.height>0){a.width=null;a.height-=b.el.getMargin("tb");b.setSize(a);b.setPosition(a)}}});Ext.regLayout("fit",Ext.layout.FitLayout);Ext.layout.CardLayout=Ext.extend(Ext.layout.FitLayout,{type:"card",sizeAllCards:false,hideInactive:true,layoutOnActivate:false,beforeLayout:function(){this.activeItem=this.getActiveItem();return Ext.layout.CardLayout.superclass.beforeLayout.apply(this,arguments)},onLayout:function(){Ext.layout.FitLayout.superclass.onLayout.apply(this,arguments);var f=this.activeItem,b=this.getLayoutItems(),e=b.length,a=this.getTargetBox(),c,d;if(this.sizeAllCards){for(c=0;c<e;c++){d=b[c];this.setItemBox(d,a)}}else{if(f){this.setItemBox(f,a)}}if(!this.firstActivated&&f){if(f.fireEvent("beforeactivate",f)!==false){f.fireEvent("activate",f)}this.firstActivated=true}},getActiveItem:function(){if(!this.activeItem&&this.owner){this.activeItem=this.parseActiveItem(this.owner.activeItem)}if(this.activeItem&&this.owner.items.items.indexOf(this.activeItem)!=-1){return this.activeItem}return null},parseActiveItem:function(a){if(a&&a.isComponent){return a}else{if(typeof a=="number"||a==undefined){return this.getLayoutItems()[a||0]}else{return this.owner.getComponent(a)}}},configureItem:function(b,a){Ext.layout.FitLayout.superclass.configureItem.call(this,b,a);if(this.hideInactive&&this.activeItem!==b){b.hide()}else{b.show()}},onRemove:function(a){if(a===this.activeItem){this.activeItem=null;if(this.owner.items.getCount()==0){this.firstActivated=false}}},getAnimation:function(b,a){var c=(b||{}).animation;if(c===false){return false}return c||a.animation},setActiveItem:function(b,f){var e=this,a=e.owner,g=Ext.getDoc(),d=e.activeItem,c;f=(f==undefined)?this.getAnimation(b,a):f;b=e.parseActiveItem(b);c=a.items.indexOf(b);if(c==-1){a.add(b)}if(b&&d!=b&&a.onBeforeCardSwitch(b,d,c,!!f)!==false){if(!b.rendered){e.renderItem(b,a.items.length,e.getTarget());e.configureItem(b,0)}if(b.fireEvent("beforeactivate",b,d)===false){return}if(d&&d.fireEvent("beforedeactivate",d,b)===false){return}if(!e.sizeAllCards){e.setItemBox(b,e.getTargetBox())}if(b.hidden){b.show()}if(e.layoutOnActivate){b.doComponentLayout()}e.activeItem=b;if(f){g.on("click",Ext.emptyFn,e,{single:true,preventDefault:true});Ext.Anim.run(b,f,{out:false,autoClear:true,scope:e,after:function(){(function(){g.un("click",Ext.emptyFn,e)}).defer(50,e);b.fireEvent("activate",b,d);if(!d){a.onCardSwitch(b,d,c,true)}}});if(d){Ext.Anim.run(d,f,{out:true,autoClear:true,scope:e,after:function(){d.fireEvent("deactivate",d,b);if(e.hideInactive&&e.activeItem!=d){d.hide()}a.onCardSwitch(b,d,c,true)}})}}else{b.fireEvent("activate",b,d);if(d){d.fireEvent("deactivate",d,b);if(e.hideInactive){d.hide()}}a.onCardSwitch(b,d,c,false)}return b}return false},getNext:function(c){var a=this.getLayoutItems(),b=a.indexOf(this.activeItem);return a[b+1]||(c?a[0]:false)},next:function(b,a){return this.setActiveItem(this.getNext(a),b)},getPrev:function(c){var a=this.getLayoutItems(),b=a.indexOf(this.activeItem);return a[b-1]||(c?a[a.length-1]:false)},prev:function(b,a){return this.setActiveItem(this.getPrev(a),b)}});Ext.regLayout("card",Ext.layout.CardLayout);Ext.layout.BoxLayout=Ext.extend(Ext.layout.ContainerLayout,{type:"box",targetCls:"x-layout-box",innerCls:"x-layout-box-inner",pack:"start",direction:"horizontal",align:"center",onLayout:function(){Ext.layout.BoxLayout.superclass.onLayout.call(this);if(this.pack==="left"||this.pack==="top"){this.pack="start"}else{if(this.pack==="right"||this.pack==="bottom"){this.pack="end"}}var d=this.getTarget(),c=d.parent(),b=(c.getWidth()-c.getPadding("lr")-c.getBorderWidth("lr"))+"px",a=(c.getHeight()-c.getPadding("tb")-c.getBorderWidth("tb"))+"px";d.setStyle({"-webkit-box-orient":this.orientation,"-webkit-box-direction":this.direction,"-webkit-box-pack":this.pack,"-webkit-box-align":this.align});if(this.orientation=="horizontal"){d.setStyle({"min-width":b,height:a})}else{d.setStyle({"min-height":a,width:b})}this.prepareFlexedItems();this.setFlexedItems()},prepareFlexedItems:function(){var a=this.getLayoutItems(),d=a.length,c,b;for(b=0;b<d;b++){c=a[b];if(c.flex!=undefined){c.el.setStyle("position","absolute");c.boxEl=this.createBoxEl(c)}else{c.doComponentLayout()}}},setFlexedItems:function(){var a=this.getLayoutItems(),d=a.length,c,b;for(b=0;b<d;b++){c=a[b];if(c.flex!=undefined){c.boxSize=c.boxEl.getSize()}}for(b=0;b<d;b++){c=a[b];if(c.flex!=undefined){c.el.setStyle("position","");if(this.align=="stretch"){c.setSize(c.boxSize)}else{if(this.direction=="horizontal"){c.setWidth(c.boxSize.width)}else{c.setHeight(c.boxSize.height)}}c.boxEl.remove();delete c.boxEl;delete c.boxSize}}},getTarget:function(){var a=this.owner,b=this.innerCt;if(!b){if(a.scrollEl){b=a.scrollEl.addCls(this.innerCls)}else{b=a.getTargetEl().createChild({cls:this.innerCls})}this.innerCt=b}return b}});Ext.layout.HBoxLayout=Ext.extend(Ext.layout.BoxLayout,{orientation:"horizontal",createBoxEl:function(a){return a.el.insertSibling({style:"margin-left: "+a.el.getMargin("lr")+"px; -webkit-box-flex: "+a.flex})}});Ext.regLayout("hbox",Ext.layout.HBoxLayout);Ext.layout.VBoxLayout=Ext.extend(Ext.layout.BoxLayout,{orientation:"vertical",createBoxEl:function(a){return a.el.insertSibling({style:"margin-top: "+a.el.getMargin("tb")+"px; -webkit-box-flex: "+a.flex})}});Ext.regLayout("vbox",Ext.layout.VBoxLayout);Ext.util.Functions={createInterceptor:function(d,c,b,a){var e=d;if(!Ext.isFunction(c)){return d}else{return function(){var g=this,f=arguments;c.target=g;c.method=d;return(c.apply(b||g||window,f)!==false)?d.apply(g||window,f):a||null}}},createDelegate:function(c,d,b,a){if(!Ext.isFunction(c)){return c}return function(){var f=b||arguments;if(a===true){f=Array.prototype.slice.call(arguments,0);f=f.concat(b)}else{if(Ext.isNumber(a)){f=Array.prototype.slice.call(arguments,0);var e=[a,0].concat(b);Array.prototype.splice.apply(f,e)}}return c.apply(d||window,f)}},defer:function(d,c,e,b,a){d=Ext.util.Functions.createDelegate(d,e,b,a);if(c>0){return setTimeout(d,c)}d();return 0},createSequence:function(c,b,a){if(!Ext.isFunction(b)){return c}else{return function(){var d=c.apply(this||window,arguments);b.apply(a||this||window,arguments);return d}}}};Ext.defer=Ext.util.Functions.defer;Ext.createInterceptor=Ext.util.Functions.createInterceptor;Ext.createSequence=Ext.util.Functions.createSequence;Ext.createDelegate=Ext.util.Functions.createDelegate;Ext.NELAStrechEl=function(c){if(!Ext.stretchEl||!Ext.is.Phone){return}window.scrollTo(0,Ext.is.Android?1:0);var b=1;var a=0;if(Ext.is.Android){if(Ext.is.Android21){a=(c)?5:0}else{if(Ext.orientation=="portrait"){a=(c)?Ext.is.browserBarSize:0}else{a=-1}}}else{a=(c)?78:0;b=1}if(a!=-1){Ext.stretchEl.setSize(window.innerWidth*b,(a+window.innerHeight)*b)}else{Ext.stretchEl.setSize(1,1)}};function FSICacheManager(c){var a=this;this.FSIPages=c;this.oCacheGroups=new Object();this.arCacheGroups=new Array();this.nConcurrentRequests=4;this.nRunningRequests=0;this.bDirty=false;this.arImageNodePool=new Array();this.nDebugImageNodesCreated=0;this.nDebugImageNodesDeleted=0;this.nImagesFailed=0;this.createGroup=function(h,e,g,f){if(this.oCacheGroups[h]!=undefined){return this.oCacheGroups[h]}var d=new FSICacheManagerGroup(this,h,e,g,f);this.oCacheGroups[h]=d;this.arCacheGroups.push(d);this.arCacheGroups.sort(b);return d};this.getImageNode=function(){var d=new Image();this.nDebugImageNodesCreated++;return d};this.releaseImageNode=function(d){this.nDebugImageNodesDeleted++;d.setAttribute("src","data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==")};this.flush=function(){for(var e=0;e<this.arCacheGroups.length;e++){var d=this.arCacheGroups[e];d.flushAll()}this.bDirty=false};this.addItem=function(j,d,l,h,g,k){if(d==undefined){d="default"}var e=this.oCacheGroups[d];if(e==undefined){return}var f=e.addItem(j,l,h,g,k);return f};this.onItemLoaded=function(d,e){if(e!=true){this.nImagesFailed++}d.nItemsToLoad--;if(d.nItemsToLoad>0){return}d.loadStatus=2;this.nRunningRequests--;this.loadNextItem()};this.loadNextItem=function(){if(this.timeoutLoadNextItem!=undefined){window.clearTimeout(this.timeoutLoadNextItem);delete this.timeoutLoadNextItem}this.timeoutLoadNextItem=window.setTimeout(this.execLoadNextItem,125,this)};this.execLoadNextItem=function(d){d.doLoadNextItem()};this.doLoadNextItem=function(){if(!this.bDirty){return}var g;var f;for(var e=0;e<this.arCacheGroups.length;e++){g=this.arCacheGroups[e];if(g.bDirty){g.prepareGroup()}while(g.arPending.length>0&&this.nRunningRequests<this.nConcurrentRequests){f=g.arPending.pop();var d=f.loadImage();if(d){this.nRunningRequests++}if(this.nRunningRequests>=this.nConcurrentRequests){break}}}if(this.nRunningRequests==0){this.bDirty=false}};var b=function(e,d){return d.priority-e.priority};this.dumpGroups=function(){var k=new Date().getTime();var g;for(var f in this.oCacheGroups){var l="";var m=0;var e=0;var h=0;for(var j=this.oCacheGroups[f].arItems.length-1;j>-1;j--){g=this.oCacheGroups[f].arItems[j];l+="- ID:"+g.id+" pri:"+g.priority+" age:"+(k-g.timeStamp)+" ms status:"+g.loadStatus+"\n";switch(g.loadStatus){case 0:m++;break;case 1:e++;break;case 2:h++;break}}}for(var j=0;j<3;j++){var d=this.FSIPages.MainView.items.items[j];var l=j+") "+d.iCacheItem.id;if(this.FSIPages.MainView.layout.getActiveItem()==d){l+=" (active)"}}}}function FSICacheManagerGroup(a,f,b,d,c){this.iCacheManager=a;this.id=f;this.priority=b;this.nMinItemsCount=d;this.nMaxItemsCount=c;this.oItems=new Object();this.arItems=new Array();this.arPending=new Array();this.bDirty=false;var e=function(h,g){if(h.priority==g.priority){return h.timeStamp-g.timeStamp}else{return(h.priority-g.priority)}};this.getItem=function(g){return this.oItems[g]};this.addItem=function(k,m,j,h,l){var g=this.getItem(m);if(g!=undefined){g.update(j)}else{g=new FSICacheManagerItem(m,this.id,k,j,h,l);this.appendItem(g)}return g};this.appendItem=function(g){if(this.oItems[g.id]!=undefined){return}g.iCacheGroup=this;this.oItems[g.id]=g;this.arItems.push(g);this.arPending.push(g);this.bDirty=this.iCacheManager.bDirty=true;return g};this.sortItems=function(){if(this.arItems.length>1){this.arItems.sort(e)}if(this.arPending.length>1){this.arPending.sort(e)}};this.reduceSizeTo=function(m,g){if(this.arItems.length<=m){return}if(m<=0){this.flushAll();return}if(!g){this.sortItems()}delete this.arPending;var k=this.arItems.splice(0,this.arItems.length-m);for(var h=0;h<k.length;h++){var j=k[h];j.destroy();delete this.oItems[j.id]}this.arPending=new Array();for(var h=0;h<this.arItems.length;h++){var l=this.arItems[h];if(l.loadStatus==0){this.arPending.push(l)}}};this.prepareGroup=function(){if(!this.bDirty){return}var g=false;this.sortItems();this.reduceSizeTo(this.nMaxItemsCount,true);this.bDirty=g};this.flushToMin=function(){this.reduceSizeTo(this.nMinItemsCount,false)};this.flushAll=function(){for(var g=0;g<this.arItems.length;g++){oItem=this.arItems[g];oItem.destroy()}this.oItems=new Object();this.arItems=new Array();this.arPending=new Array();this.bDirty=false}}function FSICacheManagerItem(f,a,d,c,b,e){this.id=f;if(e==undefined){e=new Object()}this.data=e;this.data.nPanelIndex=b;this.iDOMElement=undefined;this.idGroup=a;this.iCreatorInstance=d;this.priority=(c==undefined)?0:c;this.loadStatus=0;this.timeStamp=new Date().getTime();this.update=function(g){if(g!=undefined){this.priority=g}this.timeStamp=new Date().getTime();this.iCacheGroup.bDirty=this.iCacheGroup.iCacheManager.bDirty=true};this.setPriority=function(g){this.priority=g;this.iCacheGroup.bDirty=this.iCacheGroup.iCacheManager.bDirty=true};this.createDOMElement=function(){if(this.iDOMElement!=undefined){return false}this.iDOMElement=d.onCacheManagerRequestCreateDOM(this);this.checkPageDataReady();return this.iDOMElement};this.destroy=function(){if(this.iDOMElement!=undefined){if(this.iDOMElement.parentNode!=undefined){this.iDOMElement.parentNode.removeChild(this.iDOMElement)}}d.onCacheManagerRequestDeleteDOM(this);this.destroyDOMElement(this.iDOMElement)};this.destroyDOMElement=function(g){if(!g){return}while(g.firstChild!=undefined){this.destroyDOMElement(g.firstChild)}if(g.parentNode){g.parentNode.removeChild(g)}delete g};this.loadImage=function(){if(this.loadStatus!=0){}this.nItemsToLoad=0;this.loadStatus=1;var g=this.iCreatorInstance.onCacheManagerRequestLoad(this);if(this.nItemsToLoad<1){this.loadStatus=2;g=false}return g};this.onContentLoaded=function(g){this.iCacheGroup.iCacheManager.onItemLoaded(this,g)};this.checkPageDataReady=function(g){if(this.data.bDataReady){return}if(!this.data||!this.data.arPageData){return}var h=true;for(var j=0;j<this.data.arPageData.length;j++){if(!this.data.arPageData[j]._data||!this.data.arPageData[j]._data.bReady){h=false;break}}this.data.bDataReady=h;if(g){delete g.oPageData.iCacheItemWaitingForLinkData;if(h){this.iCreatorInstance.onCacheItemCallsDataReady(this)}}};this.createDOMElement()}Ext.layout.FSIPagesMobileCardLayout=Ext.extend(Ext.layout.CardLayout,{nVPos:0,nVSize:0,offsetPosition:0,maxOffset:50000,sizeAllCards:true,hideInactive:true,layoutOnActivate:false,setActiveItem:function(d,e){if(!d){return false}var b=this.owner.items.indexOf(d);if(b==2&&this.nVPos<this.nVSize-2){this.swapRight();d=this.owner.items.items[1]}else{if(b==0&&this.nVPos>1){this.swapLeft();d=this.owner.items.items[1]}}var c=this,f=Ext.getDoc(),a=c.activeItem;d=this.parseActiveItem(d);if(d&&a!=d){if(!d.rendered){this.renderItem(d,this.owner.items.length,this.getTarget());this.configureItem(d,0)}if(this.hideInactive){d.show()}if(!this.sizeAllCards){this.setItemBox(d,this.getTargetBox())}if(this.layoutOnActivate){d.doComponentLayout()}if(d.fireEvent("beforeactivate",d,a)===false){return}if(a&&a.fireEvent("beforedeactivate",a,d)===false){return}d.fireEvent("activate",d,a);if(a){if(c.hideInactive){a.hide()}a.fireEvent("deactivate",a,d)}c.owner.fireEvent("cardswitch",d,e);c.activeItem=d;return d}return false},next:function(c,b){var a=this.setActiveItem(this.getNext(b),c);if(a){this.nVPos++;this.owner.setupPages()}return a},prev:function(c,b){var a=this.setActiveItem(this.getPrev(b),c);if(a){this.nVPos--;this.owner.setupPages()}return a},setVSize:function(a){this.nVSize=a},setVPos:function(e,b,c){if(e<0||e>=this.nVSize){e=Math.max(0,Math.min(e,this.nVSize-1))}var a=this.owner.items.items;var d=e-this.nVPos;if(b!==false){if(d==0){return}if(d==-1){this.prev(b,c);return}if(d==1){this.next(b,c);return}if(d>0){this.changeVPos(e-1);this.setActiveItem(a[1],false);this.owner.setupPages(true);this.next(b,c)}else{this.changeVPos(e+1);this.setActiveItem(a[1],false);this.owner.setupPages(true);this.prev(b,c)}}else{if(b==false){this.owner.onBeforePageTurn()}switch(e){case 0:this.changeVPos(e);this.setActiveItem(a[0],false);break;case this.nVSize-1:this.changeVPos(e);this.setActiveItem(a[this.owner.items.items.length-1],false);break;default:this.changeVPos(e);this.setActiveItem(a[1],false);break}this.owner.setupPages()}if(b==false){this.owner.onAfterPageTurn()}},swapLeft:function(f){var a;var c=this.owner.items.items;var e=c.pop();c.unshift(e);if(this.owner.direction=="horizontal"){var b=this.owner.getWidth();a=this.limitPosition(e.el.getLeft()-3*b);e.el.setLeft(a)}else{var d=this.owner.getHeight();a=this.limitPosition(e.el.getTop()-3*d);e.el.setTop(a)}},swapRight:function(f){var a;var c=this.owner.items.items;var e=c.shift();c.push(e);if(this.owner.direction=="horizontal"){var b=this.owner.getWidth();a=this.limitPosition(e.el.getLeft()+3*b);e.el.setLeft(a)}else{var d=this.owner.getHeight();a=this.limitPosition(e.el.getTop()+3*d);e.el.setTop(a)}},changeVPos:function(b){if(this.nVSize<1){return}this.nVPos=b;var h=Math.max(0,Math.min(this.nVSize-3,this.nVPos-1));var d={x:0,y:0};var j=this.owner.items.items;var a=j.length;if(this.owner.direction=="horizontal"){var m=this.owner.getWidth();var e=j[0].el.dom.offsetLeft;var g=h*m-this.offsetPosition;g=this.getLimitPos(g);for(var f=0;f<a;f++,g+=m){var l=j[f];var c=l.myIndex*m;l.el.setLeft(g-c)}var k=j[0].el.dom.offsetLeft;d.x=this.owner.scroller.offset.x-(k-e);this.scrollInternal(d)}else{var m=this.owner.getHeight();var e=j[0].el.dom.offsetTop;var g=h*m-this.offsetPosition;g=this.getLimitPos(g);for(var f=0;f<a;f++,g+=m){var l=j[f];var c=l.myIndex*m;l.el.setTop(g-c)}var k=j[0].el.dom.offsetTop;d.y=this.owner.scroller.offset.y-(k-e);this.scrollInternal(d)}},scrollInternal:function(a){this.owner.scroller.suspendEvents(false);this.owner.scroller.updateBounds();this.owner.scroller.scrollTo(a,false);this.owner.scroller._scrollTo(a,false);this.owner.scroller.resumeEvents()},getLimitPos:function(a){if(a>this.maxOffset){this.offsetPosition+=Math.floor(a/this.maxOffset)*this.maxOffset;a=a%this.maxOffset}else{if(a<0){a+=this.offsetPosition;this.offsetPosition=Math.floor(a/this.maxOffset)*this.maxOffset;a=a%this.maxOffset}}return a},limitPosition:function(a){if(a>0&&a<this.maxOffset){return a}var b=this.owner.items.items;var h=b.length;var g=a;a=this.getLimitPos(a);var f=a-g;if(this.owner.direction=="horizontal"){for(var d=0;d<h;d++){var e=b[d];e.el.setLeft(e.el.getLeft()+f)}}else{for(var d=0;d<h;d++){var e=b[d];e.el.setTop(e.el.getTop()+f)}}var c={x:0,y:0};if(this.owner.direction=="horizontal"){c.x=this.owner.scroller.offset.x-f}else{c.y=this.owner.scroller.offset.y-f}this.scrollInternal(c);return a}});Ext.regLayout("fsipagesmobilelayout",Ext.layout.FSIPagesMobileCardLayout);Ext.FSIPagesMobileCarousel=Ext.extend(Ext.Panel,{styleHtmlContent:false,lastEnabledIndex:-1,lastWidth:0,lastHeight:0,initComponent:function(){iCacheItemCurrentContent:undefined,this.layout={type:"fsipagesmobilelayout",hideInactive:false,sizeAllCardsOnLayout:false,itemCls:"x-FSIPagesMobileCarousel-item",targetCls:"x-FSIPagesMobileCarousel-scroller"};this.scroll={useIndicators:false,scrollbars:false,bounces:true,horizontal:this.direction=="horizontal"?true:false,vertical:this.direction=="horizontal"?false:true,fps:90,scrollToDuration:300,springTension:0.35,momentum:false};Ext.FSIPagesMobileCarousel.superclass.initComponent.call(this);this.on("cardswitch",this.onCardSwitch,this)},afterRender:function(){Ext.FSIPagesMobileCarousel.superclass.afterRender.call(this);this.mon(this.body,{touchend:this.onTouchEnd,direction:this.direction,disableLocking:true,scope:this});this.el.addCls(this.baseCls+"-"+this.direction)},removeContent:function(){this.contentID=undefined;this.removeCurrentContent();this.layout.nVPos=0;this.removeAll(true);if(this.items.items.length>0){}},setContent:function(b,a){this.createContainers(a)},removeAll:function(b){this.FSIPages.enableScrollBar(this.scroller,false);var a=Ext.FSIPagesMobileCarousel.superclass.removeAll.call(this,b);while(this.items.items.length>0){this.remove(0)}this.layout.activeItem=undefined;this.layout.offsetPosition=0;return a},createContainers:function(c){this.nContainers=Math.min(this.layout.nVSize,3);for(var b=0;b<this.nContainers;b++){var a=this.createPagePanel();a.myIndex=b;this.add(a)}this.bContainersReady=false;this.doLayout();this.bContainersReady=true;if(c==undefined||isNaN(c)){c=0}this.layout.setVPos(c,false);this.FSIPages.enableScrollBar(this.scroller,true);this.onScrollEndEvent(this.scroller)},removeCurrentContent:function(){var a=this.items.items;var c=Math.min(this.nContainers,a.length);for(var b=0;b<c;b++){a[b].dismissContent()}this.lastEnabledIndex=undefined},refreshContent:function(){if(this.items.items.length<1){return}var a=this.layout.getActiveItem();this.layout.activeItem=undefined;this.layout.setActiveItem(a,false);this.removeCurrentContent();this.setupPages();this.onScrollEndEvent(this.scroller)},onScrollEndEvent:function(a){},setupPages:function(){if(!this.bContainersReady){return}var b=this.items.items;var a=Math.max(0,Math.min(this.layout.nVSize-3,this.layout.nVPos-1));for(var c=0;c<this.nContainers;c++){b[c].setContent(a+c)}this.FSIPages.iCacheManager.loadNextItem()},onCardSwitch:function(d,f){var e=this.items.indexOf(d);var a=false;if(this.lastEnabledIndex!=e){this.lastEnabledIndex=e;a=true}var c;var b={x:0,y:0};if(this.direction=="horizontal"){b.x=d.el.dom.offsetLeft;c=(b.x+this.scroller.offset.x)}else{b.y=d.el.dom.offsetTop;c=(b.y+this.scroller.offset.y)}if(c!=0){this.onBeforePageTurn();this.scroller.updateBounds();if(f!==false){this.scroller.scrollTo(b,400,"cubic-bezier(0, 0, 0.48, 0.86)")}else{this.scroller.scrollTo(b)}}return a},setCurrentVisibleCard:function(a){if(!a||!a.iCacheItem||a.iCacheItem.id==this.strActiveCardCacheItemID){return false}this.strActiveCardCacheItemID=a.iCacheItem.id;return true},afterLayout:function(a){var b=this.layout.getActiveItem();if(b){this.onCardSwitch(b,false)}Ext.FSIPagesMobileCarousel.superclass.afterLayout.apply(this,arguments);if(this.bContainersReady&&this.items&&this.items.items&&this.items.items.length>0){this.onResize(this.getWidth(),this.getHeight());this.layout.changeVPos(this.layout.nVPos);var b=this.layout.activeItem;if(b&&b.el&&b.el.dom){var c={x:0,y:0};if(this.direction=="horizontal"){c.x=b.el.dom.offsetLeft}else{c.y=b.el.dom.offsetTop}this.scroller.scrollTo(c,false)}}},onResize:function(a,b){if(a==undefined){a=this.getWidth();b=this.getHeight()}if(a!=this.lastWidth||b!=this.getHeight()){if(this.doResize(a,b)){this.lastWidth=a;this.lastHeight=b}}},next:function(){return this.layout.next()},prev:function(){return this.layout.prev()},getActiveItemOffset:function(){var a=this.layout.getActiveItem();if(a){return a.el.dom[this.direction=="horizontal"?"offsetLeft":"offsetTop"]}},onTouchEnd:function(f,a){var a=this.scroller;var g=-this.getActiveItemOffset(),b,d,c;if(this.direction=="horizontal"){d=a.offset.x-g;b=f.previousDeltaX;c={x:-g,y:0}}else{d=a.offset.y-g;b=f.previousDeltaY;c={x:0,y:-g}}if(d<0&&Math.abs(d)>3&&b<=0){this.next()}else{if(d>0&&Math.abs(d)>3&&b>=0){this.prev()}else{this.scroller.scrollTo(c,150,"ease-out")}}},onBeforePageTurn:function(){var a=this.layout.activeItem},onAfterPageTurn:function(){var a=this.layout.activeItem},getDoublePageInfo:function(b){var a=new Object();a.bDoublePage=this.bDoublePageMode;if(!a.bDoublePage){a.contentID=b}else{var c;var d=1;if(this.FSIPages.iConfig.bRTL){if(!this.FSIPages.bFrontCover){d=0}c=((this.FSIPages.getListSize()+d-1)%2==0)}else{c=this.FSIPages.bFrontCover}if(c){if(b==0){a.contentID=b;a.bDoublePage=false}else{a.contentID=Math.max(0,b*2-1)}}else{a.contentID=b*2}if(a.contentID+d>=this.FSIPages.getListSize()){a.bDoublePage=false}}a.bStartsWithSinglePage=c;return a},setPageImagePadding:function(b,a,d){if(this.FSIPages.bNoPageOffsets||a._bIgnoreMargins){return}var f=(a.evenPage)?this.FSIPages.pageOffsetsUnevenPage:this.FSIPages.pageOffsetsEvenPage;var c=d.width/this.FSIPages.pagePadding.factorWidth;var e=d.height/this.FSIPages.pagePadding.factorHeight;b.style.marginLeft=Math.round(c*f.left)+"px";b.style.marginRight=Math.round(c*f.right)+"px";b.style.marginTop=Math.round(e*this.FSIPages.pageOffsets.top)+"px";b.style.marginBottom=Math.round(e*this.FSIPages.pageOffsets.bottom)+"px"},getPageImagePadding:function(a,d){if(this.FSIPages.bNoPageOffsets||a._bIgnoreMargins){return{left:0,top:0,right:0,bottom:0}}var c=new Object();var f=(a.evenPage)?this.FSIPages.pageOffsetsUnevenPage:this.FSIPages.pageOffsetsEvenPage;var b=d.width/this.FSIPages.pagePadding.factorWidth;var e=d.height/this.FSIPages.pagePadding.factorHeight;c.left=Math.round(b*f.left);c.right=Math.round(b*f.right);c.top=Math.round(e*this.FSIPages.pageOffsets.top);c.bottom=Math.round(e*this.FSIPages.pageOffsets.bottom);return c},getPageImageSize:function(a){if(this.FSIPages.bNoPageOffsets||a._bIgnoreMargins){return this.szPage}else{return this.szPageImage}},initPanelOptions:function(){this.pageVAlignStyle=this.FSIPages.pageVAlignStyle;this.leftPageHAlignStyle=this.FSIPages.leftPageHAlignStyle;this.rightPageHAlignStyle=this.FSIPages.rightPageHAlignStyle;this.strPageBackgroundStyle="#"+this.FSIPages.pageColor;if(this.FSIPages.pageBorderColor!==false){this.nPageBorderOffset=2;this.strPageBorderStyle="1px solid #"+this.FSIPages.pageBorderColor}else{this.nPageBorderOffset=0;this.strPageBorderStyle="0px none"}},gotoPageRTL:function(a,b){if(this.FSIPages.iConfig.bRTL){a=this.maxpage-a+1}return this.gotoPage(a,b)},gotoPage:function(b,d,a){var e=this.getPanelIDFromPageID(b);if(isNaN(e)||e==this.layout.nVPos){return}var c=this.layout.activeItem;if(c&&c.bZoomed&&c.clickZoom){c.clickZoom(0,0,0)}this.gotoPanel(e,d)},gotoPanel:function(b,a){if(a){a=undefined}else{a=false}this.layout.setVPos(b,a)},goFirstPage:function(){this.gotoPanel(0,true)},goLastPage:function(){this.gotoPanel(this.layout.nVSize-1,true)},goNextPage:function(){this.next()},goPreviousPage:function(){this.prev()}});Ext.reg("FSIPagesMobileCarousel",Ext.FSIPagesMobileCarousel);function FSIPagesMobileConfig(e){this.FSIPages=e;this.XMLSerializer=new XMLSerializer();this.plugins=new Object();this.arPlugins=new Array();this.nPluginToInit=-1;this.arUnrecognizedConfigNodes=new Array();this.locales=new Object();this.locales.tips=new Object();var b=false;var c=this;this.strListFilePrefix="";this.strListFileSuffix="";this.strConfigFileExtension=".xml";c.strTemplateSuffix=".json";this.bForceVersion5=true;this.BoolTable={"0":false,"false":false,"1":true,"true":true};this.pluginDefaultParameters=new Object();this.pluginDefaultParameters.pages={};this.cfgAliasNames={imageheight:"fpxheight",imagewidth:"fpxwidth",imageservertemplate:"fpxservertemplate",imageinfotemplate:"fpxinfotemplate",imageservertype:"fpxservertype",imagetilepaddingx:"fpxtilepaddingx",imagetilepaddingy:"fpxtilepaddingy",imagetilewidth:"fpxtilewidth",imagetileheight:"fpxtileheight",imagetilesx:"fpxtilesx",imagetilesy:"fpxtilesy",imageserver:"fpxserver",imagepath:"fpxpath",imagetransparency:"fpxtransparency"};var a=this.cfgDefaults={defaultcfg:"_default",fsibase:"config/",fpxservertemplate:"jpeg"};this.init=function(){this.reset();this.BaseURL=this.getBaseURL();if(c.bForceVersion5==true){}var f=this.FSIPages.queryParameters.fsiviewerversion;if(c.bForceVersion5==true){f="5"}if(f!=undefined){if(parseInt(f)<6){c.strConfigFileExtension=".fsi"}}var g=this.FSIPages.queryParameters.fsiserverversion;if(c.bForceVersion5==true){g="2"}if(g!=undefined){if(parseInt(g)<3){c.strTemplateSuffix="_json"}}if(this.FSIPages.queryParameters.fsiviewerlocation!=undefined){this.locationFSIViewer=this.FSIPages.queryParameters.fsiviewerlocation}else{this.locationFSIViewer=this.BaseURL.split("/");if(this.locationFSIViewer.length>4){this.locationFSIViewer.splice(this.locationFSIViewer.length-3,2);this.locationFSIViewer=this.locationFSIViewer.join("/")}}if(this.locationFSIViewer.charAt(this.locationFSIViewer.length-1)!="/"){this.locationFSIViewer+="/"}this.nextConfigURL=this.getReloadPath(this.locationFSIViewer,this.expandFSIPath(this.cfg.defaultcfg))};this.setPagesXMLBase=function(f){if(f!=undefined&&f.length>0){this.strXMLBase=this.getReloadPath(this.locationFSIViewer,f)}else{this.strXMLBase=undefined}};this.getBaseURL=function(){var h;var g=document.getElementsByTagName("base");if(g&&g.length>0){h=g[g.length-1].href;if(h&&h.charAt(h.length-1)!="/"){h+="/"}}else{h=document.location.href;var f=h.indexOf("?");if(f!=-1){h=h.slice(0,f)}f=h.indexOf("#");if(f!=-1){h=h.substring(0,f)}f=h.lastIndexOf("/");if(f!=-1){h=h.slice(0,f+1)}}return h};this.reset=function(){nPreventCachingRND=Math.random();this.nIncludedConfigs=0;this.completedConfigs=new Object();this.plugins=new Object();this.cfg=new Object();this.getQueryParameters();this.cloneParameters(this.cfgDefaults,this.cfg);this.cloneParameters(this.FSIPages.queryParameters,this.cfg);b=c.makeBool(this.cfg.usenc,false);this.FSIPages.initDebug();this.FSIPages.log("#init");this.FSIPages.log("<h1>Query Parameters</h1>");this.FSIPages.log("#parameters",false,this.cfg)};this.getQueryParameters=function(){if(this.FSIPages.queryParameters!=undefined){return}this.FSIPages.queryParameters=new Object();this.cloneParameters(this.FSIPages.parameters,this.FSIPages.queryParameters);this.parseQuery(document.location.href,this.FSIPages.queryParameters)};this.makeBool=function(j,f){if(typeof(f)!="boolean"){f=false}var g=f;switch(typeof(j)){case"string":var h=this.BoolTable[j.toLowerCase()];if(h!=undefined){g=h}break;case"number":g=new Boolean(j);break;case"boolean":g=j;break}return g};this.loadLanguageFile=function(){var g=this.cfg.language;if(g==undefined){g="english"}var f=this.locationFSIViewer+"/languages/"+g+".xml";this.FSIPages.log("<b>Load language:</b>",true);this.FSIPages.log(f+"...");var h={};this.finishRequestParams(h);Ext.Ajax.request({url:f,overrideMimeType:"application/xml",params:h,method:"GET",scope:this,success:function(j,k){this.logXMLResponseOK(j);this.onLanguageLoaded(true,j)},failure:function(j,k){this.logLoadFileFailed(j,k);this.onLanguageLoaded(false,j)}})};this.logLoadFileFailed=function(f,h){if(!this.FSIPages.iDebug){return}if(f&&f.status!=undefined){var g="HTTP "+f.status;if(f&&f.statusText){g+=", "+f.statusText}this.FSIPages.log("#error",true,"failed ("+g+")")}else{this.FSIPages.log("#failed")}},this.logXMLResponseOK=function(g){if(!this.FSIPages.iDebug){return}if(g&&g.responseXML){this.FSIPages.log("#ok",true)}else{this.FSIPages.log("#failed");var j;if(window.DOMParser){var k=new DOMParser();if(k&&k.parseFromString){var h=k.parseFromString(g.responseText,"text/xml");if(h){var f=this.findXMLNode(h,"parsererror");if(f){if(f.lastChild){if(f.innerHTML.indexOf("up to the first error")!=-1){f.removeChild(f.lastChild)}}if(f.firstChild){if(f.innerHTML.indexOf("This page")!=-1){f.removeChild(f.firstChild)}}j=f.outerHTML}}}}if(j!=undefined){this.FSIPages.log("#error",true,"XML parse error:");this.FSIPages.log(j,true)}else{this.FSIPages.log("#error",true,"unknown error")}}},this.parseLanguage=function(k){if(!k||!k.firstChild){return false}var f=k.firstChild.childNodes;var l,h,j;for(var g=0;g<f.length;g++){h=f[g];l=this.getAttributeValue(h,"id");if(l==undefined){continue}l=l.toLowerCase();if(h.childNodes.length>0){j=this.XMLChildNodesToString(h)}else{j=this.getAttributeValue(h,"txt")}this.locales.tips[l]=j}return true};this.getAttributeValue=function(h,g){if(!h||!h.hasAttributes()){return}var f=undefined;var j=h.getAttributeNode(g);if(j){f=j.value}return f};this.onLanguageLoaded=function(g,f){if(g){this.parseLanguage(f.responseXML)}this.initPagesParameters();this.FSIPages.onConfigReady()};this.onConfigReadyDone=function(){if(!this.readCustomPageNumbers()){this.loadImageList()}};this.swapParameters=function(h,f){h=h.toLowerCase();f=f.toLowerCase();var g=this.plugins.pages.parameters;if(g==undefined){return}this.swapValues(g,h,f);this.swapValues(this.cfg,"pages_"+h,"pages_"+f)};this.swapValues=function(j,h,g){var f=j[h];j[h]=j[g];j[g]=f};this.initPagesParameters=function(){this.LinkTemplates=this.getPagesParameter("LinkTemplates","").split(",");for(var f=0;f<this.LinkTemplates.length;f++){this.LinkTemplates[f]=decodeURIComponent(this.LinkTemplates[f])}this.LinkTemplateData=this.getPagesParameter("LinkTemplateData","").split(",");for(var f=0;f<this.LinkTemplateData.length;f++){this.LinkTemplateData[f]=decodeURIComponent(this.LinkTemplateData[f])}this.LinkTemplateCount=Math.max(this.LinkTemplates.length,this.LinkTemplateData.length);this.ParamForceLinkTarget=this.getUnescapedPagesParameter("ForceLinkTarget",undefined,"LinkTarget");this.ParamForceJavascriptTarget=this.getUnescapedPagesParameter("ForceJavascriptTarget",undefined);this.ParamForceLinkURLPrefix=this.getUnescapedPagesParameter("ForceLinkUrlPrefix",undefined,"UrlPrefix");this.ParamForceLinkURLSuffix=this.getUnescapedPagesParameter("ForceLinkUrlSuffix",undefined,"UrlSuffix");this.ParamForceLinkURL=this.getUnescapedPagesParameter("ForceLinkUrl",undefined);this.ParamForceLinkTip=this.getUnescapedPagesParameter("ForceLinkTip",undefined);this.ParamDefaultLinkTarget=this.getUnescapedPagesParameter("DefaultLinkTarget",undefined);this.ParamDefaultJavascriptTarget=this.getUnescapedPagesParameter("DefaultJavascriptTarget","_self");this.ParamDefaultLinkURLPrefix=this.getUnescapedPagesParameter("DefaultLinkUrlPrefix",undefined);this.ParamDefaultLinkURLSuffix=this.getUnescapedPagesParameter("DefaultLinkUrlSuffix",undefined);this.ParamDefaultLinkURL=this.getUnescapedPagesParameter("DefaultLinkUrl",undefined);this.ParamDefaultLinkTip=this.getUnescapedPagesParameter("DefaultLinkTip",undefined);this.bFollowLinks=this.getPagesParameter("FollowLinks",true,true);this.bRTL=this.getPagesParameter("PageOrderRTL",false,true);this.bUseNamedPageNumbersExternal=this.getPagesParameter("externalPageNumbersAreAliases",false,true);this.firstPageNum=this.getIntParameter("firstPageNumber",1);if(!this.getPagesParameter("frontcover",true,true)){this.firstPageNum++}this.nMaxRomanPageNumber=parseInt(this.getPagesParameter("UseRomanPageNumbersToPage","0"));if(isNaN(this.nMaxRomanPageNumber)){this.nMaxRomanPageNumber=0}this.nRomanPageNumberOffset=parseInt(this.getPagesParameter("RomanPageNumbersOffset","0"));if(isNaN(this.nRomanPageNumberOffset)){this.nRomanPageNumberOffset=0}};this.getTranslation=function(g){var f=this.locales.tips[g.toLowerCase()];if(f==undefined){f=g}return f};this.getPageImageURL=function(h,g){if(g==undefined){g=this.serverProfile}var f=this.getImageURL(h.src,g);if(h.rcCrop){var j=h.rcCrop.getCropString();if(j.length>0){f+="&"+j}}return f};this.getImageURL=function(g,f){if(f==undefined){f=this.serverProfile}return d(this.requestBase+"?type=image&profile="+f+"&source="+encodeURIComponent(g))};this.getDoublePageImageURL=function(f,h){var g=this.requestBase+"?type=image&profile="+this.serverProfileDoublePage+"&source="+encodeURIComponent(f.src+","+h.src);if(f.rcCrop){g+="&leftimagecrop="+f.rcCrop.getCropValueString()}if(h.rcCrop){g+="&rightimagecrop="+h.rcCrop.getCropValueString()}return d(g)};this.loadConfigs=function(){this.reset();this.loadNextConfig(true)},this.loadNextConfig=function(g){if(this.nextConfigURL==undefined){this.onConfigsReady();return}var f=!this.makeBool(this.cfg.ConfigCaching,true);this.FSIPages.log("<br/><b>Load configuration:</b>",true);this.FSIPages.log(this.nextConfigURL+"...");var h={};if(this.makeBool(this.cfg.debug)||(!g&&!this.makeBool(this.cfg.configcaching,true)&&this.makeBool(this.cfg.enableconfigcachingparameter))){this.addNoCacheParams(h)}else{this.finishRequestParams(h)}this.request=Ext.Ajax.request({url:this.nextConfigURL,overrideMimeType:"application/xml",params:h,method:"GET",scope:this,success:function(j,k){this.logXMLResponseOK(j);this.onConfigLoaded(j.responseXML);delete this.request},failure:function(j,k){this.logLoadFileFailed(j,k);this.onConfigLoaded(null);delete this.request}})};this.parseMargins=function(h,g,f,j){if(f==undefined){f=_root._FSI.StageWidth}if(j==undefined){j=_root._FSI.StageHeight}h[g+"Left"]=this.getFloatParameterPercent(g+"Left",0,f);h[g+"Top"]=this.getFloatParameterPercent(g+"Top",0,j);h[g+"Right"]=this.getFloatParameterPercent(g+"Right",0,f);h[g+"Bottom"]=this.getFloatParameterPercent(g+"Bottom",0,j);h[g+"Inner"]=this.getFloatParameterPercent(g+"Inner",0,f);h[g+"Outer"]=this.getFloatParameterPercent(g+"Outer",0,f)};this.getFloatParameterPercent=function(f,g,h){return this.parseFloatPercentDef(this.getPagesParameter(f),h,g,-1000000)};this.parseFloatPercentDef=function(j,h,g,f){if(j==undefined||j.length<1){return g}return Math.max(f,this.parseFloatPercent(j,h))};this.parsePercentDef=function(h,f){if(h==undefined||h.length<1){return f}var g=parseFloat(h);if(isNaN(g)){g=0}else{if(h.indexOf("%")!=-1){g/=100}}return g};this.parseFloatPercent=function(h,g){var f=parseFloat(h);if(isNaN(f)||f<0){f=0}else{if(h.indexOf("%")!=-1){f=Math.round(f*g/100)}else{f=Math.ceil(f)}}return f};this.onConfigLoaded=function(g){this.parseConfig(g);var f;if(this.cfg.includeconfig!=undefined&&this.nIncludedConfigs<10){f=this.getFSIPath(this.locationFSIViewer,this.expandFSIPath(this.cfg.includeconfig));this.nIncludedConfigs++;this.cfg["includeconfig("+this.nIncludedConfigs+")"]=this.cfg.includeconfig;this.cfg.includeconfig=undefined}else{if(this.cfg.cfg!=undefined){f=this.getFSIPath(this.locationFSIViewer,this.expandFSIPath(this.cfg.cfg))}}if(f!=undefined&&!this.completedConfigs[f]){this.completedConfigs[f]=true;this.nextConfigURL=f;this.loadNextConfig()}else{this.evaluateQuery(this.FSIPages.queryParameters,this.cfg);this.finalCheck()}};this.evaluateQuery=function(g,f){for(var h in g){this.setConfigParamByValue(f,h.toLowerCase(),g[h])}};this.parseConfig=function(g){var s="";if(g!=undefined){var h=g.firstChild;var r=h.childNodes;for(var n=0;n<r.length;n++){var l=r[n];if(l.nodeType!=1){continue}var p=l.nodeName.toLowerCase();s=p;var k=l.childNodes;switch(p){case"licence":break;case"plugins":for(var m=0;m<k.length;m++){this.parsePluginNode(k[m])}break;case"info":case"options":s=undefined;case"fpx":case"image":case"include":for(var m=0;m<k.length;m++){var q=k[m];if(q.nodeType!=1){continue}var f=this.getValueFromXMLNode(q,s);this.setConfigParam(this.cfg,f)}break;default:this.arUnrecognizedConfigNodes.push(l)}}}};this.parseConfigFragment=function(k,p,n){var u="";if(k!=undefined&&p!=undefined){if(n==undefined){n=[]}var g=k;var s=g.childNodes;for(var m=0;m<s.length;m++){var k=s[m];if(k.nodeType!=1){continue}var q=k.nodeName.toLowerCase();u=q;var h=k.childNodes;switch(q){case"info":case"options":u=undefined;case"fpx":case"image":case"include":for(var l=0;l<h.length;l++){var r=h[l];if(r.nodeType!=1){continue}var f=this.getValueFromXMLNode(r,u);this.setConfigParam(p,f)}break;default:n.push(k)}}}};this.findXMLNode=function(g,f){if(g==undefined||g.nodeType==undefined){return undefined}while(g){if(g.nodeName.toLowerCase()==f){break}if(g.firstChild!=undefined){g=g.firstChild}else{if(g.nextSibling!=undefined){g=g.nextSibling}else{g=g.parentNode.nextSibling}}}return g};this.getValueFromXMLNode=function(h,f){if(!h||h.nodeType!=1){return}var g=new Object();var k=(f)?f:"";g.name=k+h.nodeName.toLowerCase();if(h.hasAttributes()){var j=h.getAttributeNode("value");if(j){g.value=j.value;return g}}g.value=this.XMLChildNodesToString(h);g.node=h;return g};this.getXMLNodeAttribute=function(h,g,f){if(!h||h.nodeType!=1||!h.hasAttributes()){return f}var j=h.getAttributeNode(g);if(!j){return f}return j.value};this.XMLChildNodesToString=function(h){if(!h||!h.firstChild){return""}var f="";for(var g=0;g<h.childNodes.length;g++){f+=this.XMLSerializer.serializeToString(h.childNodes[g])}return f},this.getPluginParameter=function(m,g,f,l){g=g.toLowerCase();if(this.plugins[m]==undefined){return f}var k;var j=m+"_"+g;if(this.cfg[j]!=undefined){k=this.cfg[j]}else{var h=this.plugins[m].parameters;if(h!=undefined&&h[g]!=undefined){k=h[g]}}if(k==undefined){k=f}if(l){k=this.makeBool(k,f)}return k};this.getUnescapedPagesParameter=function(j,h,g){var f=this.getPagesParameter(j,h);if(f==undefined&&g!=undefined){f=this.getPagesParameter(g,h)}if(f!=undefined){f=decodeURIComponent(f)}return f};this.getIntParameterMinMax=function(g,h,f,j){return Math.min(j,Math.max(f,this.getIntParameter(g,h)))};this.getIntParameter=function(g,h){var f=parseInt(this.getPagesParameter(g));if(isNaN(f)){f=h}return f};this.getRGBAValue=function(g){var f=new Object();if(g==undefined){g=""}if(g.charAt(0)=="#"){g=g.substr(1)}if(g.length>8){g=g.substr(0,8)}if(g.length>5){f.webColor="#"+g.substr(0,6);f.red=parseInt(g.substr(0,2),16);f.green=parseInt(g.substr(2,2),16);f.blue=parseInt(g.substr(4,2),16);if(g.length<7){f.alpha=255}else{f.alpha=parseInt(g.substr(6,2),16)}}else{f.alpha=255;f.webColor="#000000";f.red=f.green=f.blue=0}f.webAlpha=f.alpha/255;return f};this.getPagesParameter=function(g,f,h){return this.getPluginParameter("pages",g,f,h)};this.parsePluginNode=function(j){if(j.nodeType!=1){return}var k=new Object();var l=j.attributes;for(var m=0;m<l.length;m++){var n=l[m];var h=n.nodeName.toLowerCase();k[h]=n.nodeValue}var p=j.childNodes;for(var m=0;m<p.length;m++){var g=p[m];if(g.nodeType!=1){continue}var f=this.getValueFromXMLNode(g);if(f.value!=undefined){k[f.name]=f.value;if(f.node!=undefined){k[f.name+".node"]=f.node}}}this.addPluginFromString(k.src,k)};this.trimString=function(f){return f.replace(/^\s\s*/,"").replace(/\s\s*$/,"")};this.addPluginsFromString=function(h){if(h==undefined||h.split==undefined||h.length<1){return}var f=h.split(",");for(var g=0;g<f.length;g++){var j=this.trimString(f[g]);this.addPluginFromString(j)}};this.addPluginFromString=function(g,h){if(g==undefined||g.length<1){return}if(h==undefined){h=new Object()}var f=this.plugins[g]=new Object();f.name=g;if(this.pluginDefaultParameters[g]!=undefined){f.parameters=new Object();this.cloneParameters(this.pluginDefaultParameters[g],f.parameters);this.cloneParameters(h,f.parameters)}else{f.parameters=h}};this.setConfigParamByValue=function(g,h,f){this.setConfigParam(g,{name:h.toLowerCase(),value:f})};this.setConfigParam=function(g,h){var j=h.name;var f=h.value;if(j==undefined){return}if(this.cfgAliasNames[j]!=undefined){j=this.cfgAliasNames[j]}if(g[j]!=undefined&&this.BoolTable[f.toLowerCase()]==false&&this.BoolTable[g[j]]==undefined){delete g[j]}else{switch(j){case"effects":case"tileeffects":case"sceneeffects":case"naveffects":case"thumbeffects":if(g[j]!=undefined&&g[j].length>0){g[j]+="&"+f}else{g[j]=f}break;case"plugins":this.addPluginsFromString(f);break;case"fpxpath":g[j]=f;g.fpxsrc=escape(f);break;default:g[j]=f;if(h.node!=undefined){g[j+".node"]=h.node}}}};this.finalCheck=function(){this.serverProfile=this.cfg.fpxservertemplate;this.serverProfileDoublePage=this.cfg.fpxservertemplatedoublepage;if(this.serverProfileDoublePage==undefined){this.serverProfileDoublePage="doublepage"}this.serverBase=this.cfg.fpxserver;if(this.serverBase==undefined){this.FSIPages.log("Note:",true);this.FSIPages.log("Parameter 'imageserver' undefined, guess from ["+this.locationFSIViewer+"]",true);var f;f=this.locationFSIViewer.indexOf("/users/");if(f!=-1){this.serverBase=this.locationFSIViewer.substring(0,f)+"/server"}else{f=this.locationFSIViewer.indexOf("/viewer/");this.serverBase=this.locationFSIViewer.substring(0,f)+"/server"}this.FSIPages.log("guessed location is: ["+this.serverBase+"]",true)}this.requestBase=this.serverBase;this.svri1=this.getImageURL("pages.png","_private");if(this.FSIPages.initDebug(true)){return}this.FSIPages.log("<h1>Final Parameters</h1>");this.FSIPages.log("#parameters",false,this.cfg);this.loadLanguageFile()};this.pluginsReady=function(){this.FSIPages.onConfigInitComplete()};var d=this.finishURL=function(f){if(!b||f==undefined){return f}var g="cache=0&cachernd="+nPreventCachingRND;if(f.indexOf("?")==-1){f+="?"+g}else{f+="&"+g}return f};this.finishRequestParams=function(f){if(b){f.cache=0;f.cachernd=nPreventCachingRND}};this.addNoCacheParams=function(f){f.cache=0;f.cachernd=nPreventCachingRND};this.parseXMLImageList=function(l,j){if(!l||!l.responseXML){return false}var f=l.responseXML;var p=this.findXMLNode(f,"images");var g=p.childNodes;var h;for(var m=0;m<g.length;m++){var k=g[m];if(k.nodeType!=1){continue}var n=this.getAttributeValue(k,"file");if(n){}else{h={};this.parseConfigFragment(k,h);if(h.fpxsrc&&h.fpxsrc.charAt(0)=="/"){h.fpxsrc=h.fpxsrc.substr(1)}if(h.fpxsrc&&h.fpxheight&&h.fpxwidth){j.push({src:h.fpxsrc,width:h.fpxwidth,height:h.fpxheight,file:h.file})}}}},this.getPAParam=function(){return !c.makeBool(this.cfg[fsiStringUtil.read("{4H]Q4JwD4fpe*63Q4Zj{3?")],true)},this.loadImageList=function(){var f=this.getPagesParameter("dir");if(f==undefined){return}if(f.charAt(0)=="/"){f=f.substr(1)}if(f.charAt(f.length-1)!="/"){f+="/"}this.doLoadImageList(f)};this.doLoadImageList=function(j,h){if(j==undefined){return}this.FSIPages.dir=j;var f=this.getPagesParameter("listtemplate","image_list");switch(f){case"image_list":case"catalog_list":case"photo_list":f+=c.strTemplateSuffix;break}if(this.FSIPages.bDebug){this.FSIPages.log("<b>Load image list:</b>",true);var g=this.requestBase+"?type=list&tpl="+f+"&source="+j;this.FSIPages.log(g+"...")}var k={type:"list",source:j,tpl:f};this.finishRequestParams(k);this.listRequest=Ext.Ajax.request({url:this.requestBase,params:k,method:"GET",scope:this,success:function(n,p){var s="";try{s=n.getResponseHeader("Content-Type");s=s.toLowerCase()}catch(r){}var m;var q=[];this.strListFilePrefix=this.strListFileSuffix="";if(n.responseXML||s.indexOf("xml")!=-1){this.logXMLResponseOK(n);this.parseXMLImageList(n,q)}else{try{m=JSON.parse(n.responseText);m.images.pop();q=m.images;this.FSIPages.log("#ok");this.FSIPages.log("<b>Images List contains:</b> "+m.images.length+" items",true);var l=m.imagesattributes;if(l){if(l.FilePrefix){this.strListFilePrefix=l.FilePrefix}if(l.FileSuffix){this.strListFileSuffix=l.FileSuffix}this.strListFilePrefix=this.strListFilePrefix.replace(/\[fpxbase\]/gi,this.requestBase+"?source=")}}catch(r){this.FSIPages.log("#failed");this.FSIPages.log("<b>Error parsing Images List </b>",true);this.FSIPages.log("#error",true,"JSON parse error");this.FSIPages.log("#error",true,r)}}delete this.listRequest;this.FSIPages.setListData(q);this.FSIPages.iPlugins.initPlugins()},failure:function(l,m){this.logLoadFileFailed(l,m);delete this.listRequest}})};this.parseQuery=function(k,g){if(g==undefined||k==undefined||k.length<1){return}var j,m,l,f,h;j=k.indexOf("?");if(j!=-1){h=k.slice(j+1)}else{h=""}j=h.indexOf("#");if(j!=-1){h=h.substring(0,j)}h=h.split("&");for(j=0;j<h.length;j++){m=h[j].split("=");l=decodeURIComponent(m[0]).toLowerCase();if(l.length>0){f=decodeURIComponent(m[1]);g[l]=f}}if(g.ignorequeryparameters!=undefined){delete g.ignorequeryparameters}if(g.enableconfigcachingparameter!=undefined){delete g.enableconfigcachingparameter}},this.cloneParameters=function(f,g){if(f==undefined||g==undefined){}for(var h in f){g[h]=f[h]}};this.getFSIPath=function(g,h){if(h.indexOf("://")!=-1){return h}if(this.cfg.fsibase!=undefined){h=this.cfg.fsibase+h}var f=this.getReloadPath(g,h);return f};this.expandFSIPath=function(g){var f=decodeURIComponent(g);if(f.indexOf("?")!=-1||f.indexOf(c.strConfigFileExtension)==(f.length-4)){return g}return g+c.strConfigFileExtension};this.getReloadPath=function(j,l){var g,m,f,k;if(j==undefined){j=this.locationFSIViewer}if(l==undefined){l=""}var h="/";if(l.indexOf("://")!=-1){return l}g=j;k=g.lastIndexOf("?");if(k==-1){k=g.length}m=g.lastIndexOf("\\",k);f=g.lastIndexOf("/",k);m=Math.max(m,f);if(m==-1){m=g.length-1}g=g.slice(0,m);if(g.length>0&&l.indexOf(h)!=0){g+=h}return g+l};this.cloneValueObject=function(g){var f=new Object();for(var h in g){f[h]=g[h]}return f};this.getImageInfo=function(f,h,g,k){if(!f||!f.fpxsrc){g.call(h,false);return}if(!isNaN(f.fpxwidth)&&f.fpxwidth>0&&!isNaN(f.fpxheight)&&f.fpxheight>0){g.call(h,true,k);return}var j={type:"info",source:f.fpxsrc,tpl:"info"+c.strTemplateSuffix};this.finishRequestParams(j);this.listRequest=Ext.Ajax.request({url:this.requestBase,params:j,XPassThrough:{cfg:f,scope:h,fnReady:g,oPassthough:k},method:"GET",scope:this,success:function(m,p){var n=p.XPassThrough;try{oInfo=JSON.parse(m.responseText)}catch(q){this.FSIPages.log("#error",true,"JSON parse error");this.FSIPages.log("#error",true,q);n.fnReady.call(n.scope,false,n.oPassthough);return}var l=n.cfg;if(oInfo.width){l.fpxwidth=oInfo.width}if(oInfo.height){l.fpxheight=oInfo.height}n.fnReady.call(n.scope,true,n.oPassthough)},failure:function(l,n){this.logLoadFileFailed(l,n);var m=n.XPassThrough;m.fnReady.call(m.scope,false,m.oPassthough)}})};this.getSuperseedingParam=function(j,h,g,f){if(j!=undefined&&j.length>0){return j}if(h!=undefined&&h.length>0){return h}if(g!=undefined&&g.length>0){return g}return f};this.getAbsoluteURL=function(g,h,j){if(g==undefined){return""}if(h==undefined){h=""}if(j==undefined){j=""}if(g.indexOf(":")!=-1){var k=g.indexOf("://");if((k!=-1&&k<7)||g.indexOf("javascript:")==0||g.indexOf("mailto:")==0){return g}}if(g.charAt(0)=="#"){var f=g.toLowerCase();if(f.indexOf("#page=")==0){return g}if(f.indexOf("#zoomonpage=")==0){return g}if(f.indexOf("#zoom")==0){return g}if(f.indexOf("#zoomarea")==0){return g}if(f.indexOf("#showimage")==0){return g}if(f.indexOf("#none")==0){return""}}return h+g+j};this.getHotSpotUrl=function(k,m){var j=m;var h=k.oLinkAttributes;var l=this.getSuperseedingParam(this.ParamForceLinkURL,j.url,h.DefaultURL,this.ParamDefaultLinkURL);var f=this.getSuperseedingParam(this.ParamForceLinkURLPrefix,undefined,h.UrlPrefix,this.ParamDefaultLinkURLPrefix);var g=this.getSuperseedingParam(this.ParamForceLinkURLSuffix,undefined,h.UrlSuffix,this.ParamDefaultLinkURLSuffix);return this.getAbsoluteURL(l,f,g)};this.getHotSpotTarget=function(k,m,l){var h;var j=m;var g=k.oLinkAttributes;var f=l.toLowerCase();if(f.indexOf("mailto:")==0){h=this.getSuperseedingParam(undefined,j.target,"_self","_self")}else{if(f.indexOf("javascript:")==0){h=this.getSuperseedingParam(this.ParamForceJavascriptTarget,j.target,g.URLTargetJavascript,this.ParamDefaultJavascriptTarget)}else{h=this.getSuperseedingParam(this.ParamForceLinkTarget,j.target,g.DefaultTarget,this.ParamDefaultLinkTarget)}}if(h==undefined){h="_self"}return h};this.Replace_CurrentPage=function(h,g){var f=this.strReplace(h,"_FSI_CURRENTPAGE_",g);f=this.strReplace(f,"_FSI_CURRENTDOUBLEPAGE_",1+Math.floor(g/2));return f};this.strReplace=function(h,g,f){if(h==undefined||h.length<1||h.indexOf(g)==-1){return h}return h.split(g).join(f)};this.ReplaceLinkTemplates=function(g){if(this.LinkTemplateCount<0){return g}for(var f=0;f<this.LinkTemplateCount;f++){g=this.replaceLinkTemplate(g,f)}return g};this.replaceLinkTemplate=function(j,g){var f=this.LinkTemplates[g];var h;switch(f){case"_FSI_CURRENTPAGE_":case"_FSI_CURRENTDOUBLEPAGE_":return this.Replace_CurrentPage(j,this.FSIPages.getCurrentPageNumber());break;default:h=this.LinkTemplateData[g]}return this.strReplace(j,f,h)};this.readCustomPageNumbers=function(){var g=this.getPagesParameter("CustomPageNumbersFile","");if(g.length>1){var f=this.getFSIPath(this.locationFSIViewer,g);if(f!=g){f=this.getFSIPath(this.locationFSIViewer,"pages_xml/"+g)}var j={};this.finishRequestParams(j);Ext.Ajax.request({url:f,params:j,method:"GET",scope:this,success:function(k,l){this.logXMLResponseOK(k);this.onCustomPageNumbersLoaded(true,k.responseXML)},failure:function(k,l){this.logLoadFileFailed(k,l);this.onCustomPageNumbersLoaded(false)}});return true}var h=this.getPagesParameter("CustomPageNumbers","");if(h.length<1){return false}this.parseCustomPageNumbers(h);return false};this.onCustomPageNumbersLoaded=function(j,h){if(j&&h!=undefined){var g=this.findXMLNode(h,"pagenumbers");var f=this.getValueFromXMLNode(g);if(f.value){f=f.value}else{f=""}this.parseCustomPageNumbers(f)}else{}this.loadImageList()};this.parseCustomPageNumbers=function(h){if(h.length<1){return}this.pageNumberArrayString=h.split(",");this.pageNumberArrayNum=new Object();for(var g=0;g<this.pageNumberArrayString.length;g++){var f=this.pageNumberArrayString[g];if(this.pageNumberArrayNum[f]==undefined){this.pageNumberArrayNum[f]=g}}this.bUseNamedPageNumbersExternal=this.getPagesParameter("externalPageNumbersAreAliases",false,true)};this.getPageNumberString=function(h){var g;if(this.pageNumberArrayString!=undefined){g=this.pageNumberArrayString[h-this.firstPageNum];if(g!=undefined){if(g.indexOf("_")==0){g="---"}return g}}g=h-this.nMaxRomanPageNumber;if(g>0){return String(h)}var f=this.firstPageNum;return this.int2roman(-(f-this.nMaxRomanPageNumber-g)+1+this.nRomanPageNumberOffset)};this.getPageNumber=function(f){return(this.bRTL)?this.firstPageNum+this.maxpage-f:this.firstPageNum+f-1};this.getPageNumberFromString=function(h){var g;if(this.pageNumberArrayNum!=undefined){g=this.pageNumberArrayNum[h];if(g!=undefined){return g+this.firstPageNum}}g=parseInt(h);if(isNaN(g)){var f=this.firstPageNum;if(h=="---"){return f}g=this.roman2int(h)-this.nMaxRomanPageNumber-this.nRomanPageNumberOffset;if(g-1<=-f){g=g+f-1+this.nMaxRomanPageNumber}else{g=g+this.nMaxRomanPageNumber+f-1}}return g};this.int2roman=function(f){var g="";if(f<=0||isNaN(f)){return"---"}while(f/5000>=1){g+="A";f-=5000}while(f/1000>=1){g+="M";f-=1000}if(f/900>=1){g+="CM";f-=900}if(f/500>=1){g+="D";f-=500}if(f/400>=1){g+="CD";f-=400}while(f/100>=1){g+="C";f-=100}if(f/90>=1){g+="XC";f-=90}if(f/50>=1){g+="L";f-=50}if(f/40>=1){g+="XL";f-=40}while(f/10>=1){g+="X";f-=10}if(f/9>=1){g+="IX";f-=9}if(f/5>=1){g+="V";f-=5}if(f/4>=1){g+="IV";f-=4}while(f>=1){g+="I";f-=1}return g};this.oRomanToIntMap={I:1,V:5,X:10,L:50,C:100,D:500,M:1000,A:5000};this.roman2int=function(f){if(!f||typeof(f)!="string"){return 0}f=f.toUpperCase();var h=0;for(var j=f.length-1;j>-1;j--){var g=this.oRomanToIntMap[f.charAt(j)];var k=this.oRomanToIntMap[f.charAt(j-1)];h+=g;while(j>0&&k!=undefined&&k<g){h-=k;j--;k=this.oRomanToIntMap[f.charAt(j-1)]}}return h};this.init()}var fsiStringUtil={_utf8_decode:function(a){var b="";var d=0;var e=c1=c2=0;while(d<a.length){e=a.charCodeAt(d);if(e<128){b+=String.fromCharCode(e);d++}else{if((e>191)&&(e<224)){c2=a.charCodeAt(d+1);b+=String.fromCharCode(((e&31)<<6)|(c2&63));d+=2}else{c2=a.charCodeAt(d+1);c3=a.charCodeAt(d+2);b+=String.fromCharCode(((e&15)<<12)|((c2&63)<<6)|(c3&63));d+=3}}}return b},read:function(e){var b="";var k,j,h;var g,f,d,c;var a=0;while(a<e.length){g=this.s2.indexOf(e.charAt(a++));f=this.s2.indexOf(e.charAt(a++));d=this.s2.indexOf(e.charAt(a++));c=this.s2.indexOf(e.charAt(a++));k=(g<<2)|(f>>4);j=((f&15)<<4)|(d>>2);h=((d&3)<<6)|c;b=b+String.fromCharCode(k);if(d!=64){b=b+String.fromCharCode(j)}if(c!=64){b=b+String.fromCharCode(h)}}b=fsiStringUtil._utf8_decode(b);return b.replace(/\x00*$/,"")},s2:"qM()&;sgrfaS[dX2t6.+}k4*DRQ{?eIlF#]vjwzc'|ELKVmp_J$8W1b3OZnu<H9/",Utf8Encode:function(b){b=b.replace(/\r\n/g,"\n");var a="";for(var e=0;e<b.length;e++){var d=b.charCodeAt(e);if(d<128){a+=String.fromCharCode(d)}else{if((d>127)&&(d<2048)){a+=String.fromCharCode((d>>6)|192);a+=String.fromCharCode((d&63)|128)}else{a+=String.fromCharCode((d>>12)|224);a+=String.fromCharCode(((d>>6)&63)|128);a+=String.fromCharCode((d&63)|128)}}}return a},crc32:function(e){e=this.Utf8Encode(e);var c="00000000 77073096 EE0E612C 990951BA 076DC419 706AF48F E963A535 9E6495A3 0EDB8832 79DCB8A4 E0D5E91E 97D2D988 09B64C2B 7EB17CBD E7B82D07 90BF1D91 1DB71064 6AB020F2 F3B97148 84BE41DE 1ADAD47D 6DDDE4EB F4D4B551 83D385C7 136C9856 646BA8C0 FD62F97A 8A65C9EC 14015C4F 63066CD9 FA0F3D63 8D080DF5 3B6E20C8 4C69105E D56041E4 A2677172 3C03E4D1 4B04D447 D20D85FD A50AB56B 35B5A8FA 42B2986C DBBBC9D6 ACBCF940 32D86CE3 45DF5C75 DCD60DCF ABD13D59 26D930AC 51DE003A C8D75180 BFD06116 21B4F4B5 56B3C423 CFBA9599 B8BDA50F 2802B89E 5F058808 C60CD9B2 B10BE924 2F6F7C87 58684C11 C1611DAB B6662D3D 76DC4190 01DB7106 98D220BC EFD5102A 71B18589 06B6B51F 9FBFE4A5 E8B8D433 7807C9A2 0F00F934 9609A88E E10E9818 7F6A0DBB 086D3D2D 91646C97 E6635C01 6B6B51F4 1C6C6162 856530D8 F262004E 6C0695ED 1B01A57B 8208F4C1 F50FC457 65B0D9C6 12B7E950 8BBEB8EA FCB9887C 62DD1DDF 15DA2D49 8CD37CF3 FBD44C65 4DB26158 3AB551CE A3BC0074 D4BB30E2 4ADFA541 3DD895D7 A4D1C46D D3D6F4FB 4369E96A 346ED9FC AD678846 DA60B8D0 44042D73 33031DE5 AA0A4C5F DD0D7CC9 5005713C 270241AA BE0B1010 C90C2086 5768B525 206F85B3 B966D409 CE61E49F 5EDEF90E 29D9C998 B0D09822 C7D7A8B4 59B33D17 2EB40D81 B7BD5C3B C0BA6CAD EDB88320 9ABFB3B6 03B6E20C 74B1D29A EAD54739 9DD277AF 04DB2615 73DC1683 E3630B12 94643B84 0D6D6A3E 7A6A5AA8 E40ECF0B 9309FF9D 0A00AE27 7D079EB1 F00F9344 8708A3D2 1E01F268 6906C2FE F762575D 806567CB 196C3671 6E6B06E7 FED41B76 89D32BE0 10DA7A5A 67DD4ACC F9B9DF6F 8EBEEFF9 17B7BE43 60B08ED5 D6D6A3E8 A1D1937E 38D8C2C4 4FDFF252 D1BB67F1 A6BC5767 3FB506DD 48B2364B D80D2BDA AF0A1B4C 36034AF6 41047A60 DF60EFC3 A867DF55 316E8EEF 4669BE79 CB61B38C BC66831A 256FD2A0 5268E236 CC0C7795 BB0B4703 220216B9 5505262F C5BA3BBE B2BD0B28 2BB45A92 5CB36A04 C2D7FFA7 B5D0CF31 2CD99E8B 5BDEAE1D 9B64C2B0 EC63F226 756AA39C 026D930A 9C0906A9 EB0E363F 72076785 05005713 95BF4A82 E2B87A14 7BB12BAE 0CB61B38 92D28E9B E5D5BE0D 7CDCEFB7 0BDBDF21 86D3D2D4 F1D4E242 68DDB3F8 1FDA836E 81BE16CD F6B9265B 6FB077E1 18B74777 88085AE6 FF0F6A70 66063BCA 11010B5C 8F659EFF F862AE69 616BFFD3 166CCF45 A00AE278 D70DD2EE 4E048354 3903B3C2 A7672661 D06016F7 4969474D 3E6E77DB AED16A4A D9D65ADC 40DF0B66 37D83BF0 A9BCAE53 DEBB9EC5 47B2CF7F 30B5FFE9 BDBDF21C CABAC28A 53B39330 24B4A3A6 BAD03605 CDD70693 54DE5729 23D967BF B3667A2E C4614AB8 5D681B02 2A6F2B94 B40BBE37 C30C8EA1 5A05DF1B 2D02EF8D";if(typeof(crc)=="undefined"){crc=0}var a=0;var f=0;crc=crc^(-1);for(var b=0,d=e.length;b<d;b++){f=(crc^e.charCodeAt(b))&255;a="0x"+c.substr(f*9,8);crc=(crc>>>8)^a}return crc^(-1)}};function FSIRect(d,c,b,a){this.setRect=function(h,g,f,e){this.left=(h!=undefined&&!isNaN(h))?h:0;this.right=(f!=undefined&&!isNaN(f))?f:1;this.top=(g!=undefined&&!isNaN(g))?g:0;this.bottom=(e!=undefined&&!isNaN(e))?e:1};this.clone=function(){return new FSIRect(this.left,this.top,this.right,this.bottom)};this.getCropString=function(e){this.round();if(!this.isEffectiveCropRect()){return""}return"rect="+this.left+","+this.top+","+this.width()+","+this.height()};this.getCropValueString=function(e){this.round();if(!this.isEffectiveCropRect()){return""}return this.left+","+this.top+","+this.width()+","+this.height()};this.isEffectiveCropRect=function(){return(this.left!=0||this.top!=0||this.width()!=1||this.height()!=1)};this.width=function(){return this.right-this.left};this.height=function(){return this.bottom-this.top};this.normalize=function(){if(this.left>this.right){this.flipHorz()}if(this.top>this.bottom){this.flipVert()}};this.flipHorz=function(){var e=this.left;this.left=this.right;this.right=e};this.flipVert=function(){var e=this.top;this.top=this.bottom;this.bottom=e};this.mirrorHorz=function(){var e=this.left;this.left=1-this.right;this.right=1-e};this.mirrorVert=function(){var e=this.top;this.top=1-this.bottom;this.bottom=1-e};this.round=function(){this.left=Math.round(1000000*this.left)/1000000;this.right=Math.round(1000000*this.right)/1000000;this.top=Math.round(1000000*this.top)/1000000;this.bottom=Math.round(1000000*this.bottom)/1000000};this.inflateRect=function(e,f){if(e==undefined||isNaN(e)){e=0}if(f==undefined||isNaN(f)){f=0}this.left-=e/2;this.top-=f/2;this.right+=e/2;this.bottom+=f/2};this.offsetRect=function(e,f){this.left+=e;this.right+=e;this.top+=f;this.bottom+=f};this.intersectRect=function(g){if(g==undefined||g.width==undefined){return}var e=this.width();var f=this.height();this.right=this.left+g.right*e;this.bottom=this.top+g.bottom*f;this.left+=g.left*e;this.top+=g.top*f};this.setRect(d,c,b,a)}function FSIDebugWindow(b){var a=this;this.FSIPages=b;this.init=function(d){this.createPanel();this.iPanel.show();var e=this.iPanel.getEl();var f=e.getTop();e.setTop(Math.round(f));e.setLeft(Math.round(e.getLeft()));var c=this.iPanelContent.getEl();var g=c.dom;g.firstChild.style.maxWidth=(this.iPanel.getWidth()-20)+"px";g.style.webkitTransform="none";g.firstChild.style.webkitTransform="none";this.domContent=g.firstChild.firstChild;this.FSIPages.parameters.debug="true";this.FSIPages.log=function(){this.iDebug.log.apply(this.iDebug,arguments)};if(d){this.FSIPages.doLoadConfig()}};this.tapHandler=function(d,e){e.stopEvent();var c=this.ownerCt.FSIPages;switch(d.cmd){case"closeDialog":c.iDebug.iPanel.hide();break}},this.createPanel=function(){var d=this.iPanelContent=new Ext.Container({cls:"FSIPagesMobileLinkDialogContent",floating:false,html:"<pre class='FSIDebug' />",scroll:{scrollbars:true,bounces:false,momentum:false,horizontal:false,vertical:true}});var f=[{xtype:"spacer"},{icon:"images/icons/close.png",iconCls:"fsibuttonicon",ui:"action",cmd:"closeDialog",pressEvent:"click",handler:this.tapHandler}];var g=new Ext.Toolbar({ui:"fsi",dock:"bottom",items:f});g.FSIPages=this.FSIPages;var c=Math.round(0.9*window.innerWidth);var e=Math.round(0.8*window.innerHeight);this.iPanel=new Ext.Panel({layout:"vbox",hideOnMaskTap:false,floating:true,fullscreen:false,modal:false,centered:true,width:c,height:e,dockedItems:[d,g],scroll:"vertical"})};this.log=function(g,c,f){if(g==undefined){return}var e="";if(g.charAt(0)=="#"){switch(g){case"#init":this.domContent.innerHTML="";e="<b>FSI Pages mobile</b><br/>";e+="Version "+this.FSIPages.version+"<hr/>";e+="Phone: "+Ext.is.Phone+"<br/>";e+="Tablet: "+Ext.is.Tablet+"<br/>";e+="Touch Support: "+Ext.supports.Touch+"<br/>";this.logString(e,c,f);break;case"#parameters":for(var d in f){if(d.length<1){continue}e+="<b>"+d+"</b> = "+f[d]+"<br/>"}this.logString(e,true);break;case"#ok":this.logString("<b class='ok'>ok</b>",true);break;case"#failed":this.logString("<b class='failed'>failed</b>",true);break;case"#error":this.logString("<b class='failed'>"+f+"</b>",true);break}return}this.logString(g,c)};this.logString=function(e,d){if(d){e+="<br>"}var c=document.createElement("span");c.innerHTML=e;this.domContent.appendChild(c);this.iPanelContent.scroller.scrollTo({x:0,y:100000000})}}function FSIButtonST(d,f,k,h,a,b){var m=this;this.sc=d;var f=f;var l=null;var e=0;var b=b;a.bQSet=false;var c=function(s,r){s+="&cmd=%2B0sq6ZqWQu2s2mKembdG40bbGFXiZ2Kr9c1fbQ%3D%3D";m.s1=s;var q=Ext.Ajax.request({overrideMimeType:"text/plain; charset=x-user-defined",url:s,method:"GET",scope:this,success:function(u,v){l=u.responseText;p()},failure:function(u,v){p()}})};var g=function(v){var q="";for(var u=0;u<v.length;u++){var s=v[u];if(s<128){q+=String.fromCharCode(s)}else{if((s&240)==240){q+=String.fromCharCode(((s&7)<<16)|((v[u+1]&63)<<12)|((v[u+2]&63)<<6)|(v[u+3]&63));u+=3}else{if((s&224)==224){q+=String.fromCharCode(((s&15)<<12)|((v[u+1]&63)<<6)|(v[u+2]&63));u+=2}else{q+=String.fromCharCode(((s&31)<<6)|(v[u+1]&63));u++}}}}return q};var p=function(){var A;var q=[];var v=document.createElement("img");if(l!=null){var w=j();if(w==-1991225785){j();while(e+4<l.length){var z=j();var C=j();if(C==1953188986){for(var u=e,D=98;u<e+z;u++){var B=((l.charCodeAt(u)^D)&255);D=(B^D&255);q.push(B)}break}else{e+=z+4}}}A=g(q);v.src="data:image/png;base64,"+n(l)}if(!q.length){v.src=m.s1}a.appendChild(v);if(A&&A.length){f.call(m.sc,A);a.bQSet=true}else{f.call(m.sc,fsiStringUtil.read("k4Z$R4e|?36w?zkjr&kbD4J1D*6|{bOFtbH_It"))}a.bPSet=a.bQSet;b.call(m.sc)};var j=function(){var q=(l.charCodeAt(e++)&255)<<24;q+=(l.charCodeAt(e++)&255)<<16;q+=(l.charCodeAt(e++)&255)<<8;return q+(l.charCodeAt(e++)&255)};var n=function(u){var r=new Array("A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","0","1","2","3","4","5","6","7","8","9","+","/");var s,z;var q=0;var w="";var v=u.length;while(v>=q+3){s=(u.charCodeAt(q++)&255)<<16|(u.charCodeAt(q++)&255)<<8|u.charCodeAt(q++)&255;w+=r[(s&16515072)>>18]+r[(s&258048)>>12]+r[(s&4032)>>6]+r[(s&63)]}if(v-q>0&&v-q<3){z=Boolean(v-q-1);s=((u.charCodeAt(q++)&255)<<16)|(z?(u.charCodeAt(q)&255)<<8:0);w+=r[(s&16515072)>>18]+r[(s&258048)>>12]+(z?r[(s&4032)>>6]:"=")+"="}return(w)};c(k,h)}Ext.Ajax.useDefaultXhrHeader=false;Ext.FSIPagesMobile=Ext.extend(Ext.Panel,{version:"1.1.5",fullscreen:true,monitorResize:true,direction:"horizontal",cls:"startup",animationNone:{type:"fade",duration:0},animationType:"fade",cardAnimDuration:(Ext.is.iOS)?500:200,firstTimeContentReady:false,cardSwitchAnimation:{type:this.animationType,duration:this.cardAnimDuration},defaults:{flex:1},layout:{type:"card",align:"stretch",hideInactive:true,sizeAllCardsOnLayout:false,layoutOnActivate:true},bButtonsFirstLastPage:true,currentPanel:0,contentCount:0,arListItems:new Array(),oPageDataReg:new Object(),oPageDataRegSize:0,maxPageDataCount:35,oPageListReg:undefined,defaultScreenSize:{width:1025,height:690},initComponent:function(){if(window.innerWidth>window.innerHeight){this.screenScaleFactor=100*Math.ceil(window.innerWidth/100)/1100}else{this.screenScaleFactor=100*Math.ceil(window.innerHeight/100)/1000}this.iCacheManager=new FSICacheManager(this);this.doLoadConfig();Ext.regModel("FSIOptionsModel",{fields:["cmd","icon","text"]});Ext.Panel.superclass.initComponent.call(this);this.strOrgDocumentTitle=document.title;if(this.strOrgDocumentTitle==undefined){this.strOrgDocumentTitle="FSI Pages mobile"}},initDebug:function(a){if(this.iDebug!=undefined){return false}if(!this.iConfig||!this.iConfig.makeBool(this.iConfig.cfg.debug,false)){return}this.iDebug=new FSIDebugWindow(this);this.iDebug.init(a);this.bDebug=true;return true},log:function(){},getCurrentPageNumber:function(){var a=-1;if(this.MainView.layout&&this.MainView.layout.nVSize>0){a=this.MainView.getPageIDFromPanelID(this.MainView.layout.nVPos)}return a},checkLocationChange:function(a){a.doCheckLocationChange()},doCheckLocationChange:function(){if(this.lastDocumentLocationHash==document.location.hash){return}var c=document.location.hash;var b=c.lastIndexOf("_");var e=c.substring(1,b);if(e!=this.MainView.contentID){history.forward();return}this.lastDocumentLocationHash=document.location.hash;var a=c.substr(b+1);a=parseInt(a);if(isNaN(a)||a<1||a>this.getListSize()){return}var f=this.MainView.getPanelIDFromPageID(a);if(f!=this.MainView.layout.nVPos){var d=(this.currentPanel==undefined||this.currentPanel==0);this.iOptionsDialog.hide();this.setCurrentPanel();this.MainView.gotoPage(a,d,false)}},loadConfig:function(a){if(a.length<1||this.iConfig.cfg.cfg==a){return}this.MainView.iFieldPageNumber.setValue("");this.MainView.disableNavigation();this.MainView.removeContent();this.firstTimeContentReady=false;this.getEl().addCls("startup");this.queryParameters.cfg=a;this.doLoadConfig()},doLoadConfig:function(){if(this.strOrgDocumentTitle!=undefined){document.title=this.strOrgDocumentTitle}if(this.iPlugins){this.iPlugins.destroy()}this.iConfig=new FSIPagesMobileConfig(this);this.iPlugins=new FSIPagesMobilePlugins(this);this.iConfig.loadConfigs()},createMainComponents:function(){this.createMainViewPanel();this.createBrowserPanel();this.createIndexPanel();this.createSearchPanel();this.createLinkDialog();this.createAboutDialog();this.removeAll();this.add([this.MainViewPanel,this.IndexPanel,this.iSearchPanel,this.BrowserPanel,]);this.iMainToolbar.hide();this.doLayout();this.MainView.setMainToolbar(this.iMainToolbar);this.iADG=this.iAboutDialog},onIntitST:function(b){this.iADG.nelaPreRender();var a=this.iADG.dockedItems.items[0].getEl().dom;a=a.childNodes[0].childNodes[0];a=a.lastChild.childNodes[0].childNodes[0].innerText=b},createMainViewPanel:function(){var c=[{icon:"images/icons/previous.png",ui:"back",cmd:"back",cls:"fsi",id:"FSIPagesMobile_previouspage",handler:this.tapHandler}];if(this.bButtonsFirstLastPage){c.push({icon:"images/icons/first.png",ui:"back",cls:"fsi",cmd:"firstpage",id:"FSIPagesMobile_firstpage",handler:this.tapHandler})}var b=[{xtype:"textfield",inputCls:"pageInput",width:120,value:"",id:"FSIPagesMobile_currentPageText"},{handler:this.tapHandler,cls:"fsi",icon:"images/icons/arrowup.png",cmd:"showOptions"}];var a=[{icon:"images/icons/next.png",ui:"forward",cls:"fsi",cmd:"forward",id:"FSIPagesMobile_nextpage",handler:this.tapHandler}];if(this.bButtonsFirstLastPage){a.unshift({icon:"images/icons/last.png",ui:"forward",cls:"fsi",cmd:"lastpage",id:"FSIPagesMobile_lastpage",handler:this.tapHandler})}c.push({xtype:"spacer"});b.push({xtype:"spacer"});this.iMainToolbar=new Ext.Toolbar({ui:"fsi",dock:"bottom",cls:"x-fsi-vstretch",items:c.concat(b).concat(a)});this.iMainToolbar.FSIPages=this;this.MainView=new Ext.FSIPagesMobilePageView({FSIPages:this,centered:true,direction:this.direction});this.MainViewPanel=new Ext.Panel({id:"MainPanel",layout:{type:"vbox",align:"stretch"},defaults:{autoScroll:false,flex:1},MainView:this.MainView,items:[this.MainView],dockedItems:[this.iMainToolbar]})},createSearchPanel:function(){var e=new Ext.FSIPagesMobileSearchView({FSIPages:this,centered:true,direction:this.direction,CacheGroupName:"searchthumbnails"});var f=this.createThumbnailNavToolBar("Search",e);var d=[{xtype:"container",id:"searchresulttext",html:"",cls:"searchresults"}];var c=[{xtype:"spacer"}];var b=[{xtype:"textfield",inputType:undefined,inputCls:"pageInput search",width:300,autoComplete:false,autoCapitalize:false,autoCorrect:false,id:"FSIPagesMobile_searchText"}];var a=new Ext.Toolbar({id:"FSIPagesMobileSearchBar",ui:"fsi",dock:"top",items:[d,c,b]});a.FSIPages=this;a.MainView=e;this.iSearchPanel=new Ext.Panel({id:"SearchPanel",layout:{type:"vbox",align:"stretch"},defaults:{autoScroll:false,flex:1},items:[e],dockedItems:[a,f],MainView:e,iToolbar:f,iToolbar2:a});e.iSearchbar=a},createIndexPanel:function(){var a=new Ext.FSIPagesMobileThumbnailView({FSIPages:this,centered:true,direction:this.direction,CacheGroupName:"indexthumbnails",ThumbViewOptions:{thumbHeight:135},getInitialHighlightedPage:function(){return this.getInitialPage()},getInitialPage:function(){return this.FSIPages.MainView.getPageIDFromPanelID(this.FSIPages.MainView.layout.nVPos)},getListSize:function(){return this.FSIPages.getListSize()},onSelectPage:function(c){this.FSIPages.setCurrentPanel();this.FSIPages.MainView.gotoPage(c,false,true);return true},getThumbText:function(c,d){return this.FSIPages.getDoublePageText(c,d)}});var b=this.createThumbnailNavToolBar("Index",a);this.IndexPanel=new Ext.Panel({id:"IndexPanel",layout:{type:"vbox",align:"stretch"},defaults:{autoScroll:false,flex:1},items:[a],dockedItems:[b],MainView:a,iToolbar:b})},createThumbnailNavToolBar:function(c,b){var a=[{text:this.getTranslation("Cancel"),ui:"action",cmd:"gotoMainPanelFrom"+c,id:c+"ButtonCancel",handler:this.tapHandlerThumbnailNav},{xtype:"spacer"},{xtype:"spacer"},{icon:"images/icons/first.png",ui:"back",cls:"fsi",cmd:"GoFirst",id:c+"ButtonGoFirst",handler:this.tapHandlerThumbnailNav},{icon:"images/icons/previous.png",ui:"back",cls:"fsi",cmd:"GoPrevious",id:c+"ButtonGoPrevious",handler:this.tapHandlerThumbnailNav},{icon:"images/icons/next.png",ui:"forward",cls:"fsi",cmd:"GoNext",id:c+"ButtonGoNext",handler:this.tapHandlerThumbnailNav},{icon:"images/icons/last.png",ui:"forward",cls:"fsi",cmd:"GoLast",id:c+"ButtonGoLast",handler:this.tapHandlerThumbnailNav}];var d=new Ext.Toolbar({myName:c,ui:"fsi",dock:"bottom",items:a,navButtons:true});d.FSIPages=this;d.MainView=b;return d},initIndexPanel:function(){this.IndexPanel.MainView.setupContent()},destroyDOMNode:function(b,a){if(b==undefined){return}while(b.firstChild!=undefined){this.destroyDOMNode(b.firstChild)}if(!a&&b.parentNode){b.parentNode.removeChild(b)}},getTranslation:function(a){return this.iConfig.getTranslation(a)},createBrowserPanel:function(){var a=[{text:this.getTranslation("Cancel"),ui:"action",cmd:"gotoMainPanelFromBrowser",handler:this.tapHandler}];this.BrowserPanelMainPanel=new Ext.Component({id:"BrowserPanel",layout:{type:"vbox",align:"stretch"},defaults:{autoScroll:false,flex:0,scroll:false},html:'<iframe src="resources/blank.html" width="50%" height="100%" scrolling="yes" frameborder="10" />'});this.iMainToolbarBrowser=new Ext.Toolbar({title:"Browser",ui:"dark",dock:"top",items:a});this.iMainToolbarBrowser.FSIPages=this;this.BrowserPanel=new Ext.Panel({layout:{type:"vbox",align:"stretch"},defaults:{autoScroll:false,flex:1},items:[this.iMainToolbarBrowser,this.BrowserPanelMainPanel]})},createLinkDialog:function(){var a=new Ext.Container({cls:"FSIPagesMobileLinkDialogContent",floating:false,items:[{html:""}],scroll:"vertical"});var b=[{xtype:"spacer"},{id:"FSIPagesMobileButtonOpenLink",icon:"images/icons/link.png",iconCls:"fsibuttonicon",ui:"action",cmd:"LinkDialogOpenLink",pressEvent:"click",handler:this.tapHandler},{icon:"images/icons/close.png",iconCls:"fsibuttonicon",ui:"action",cmd:"closeLinkDialog",pressEvent:"click",handler:this.tapHandler}];var c=new Ext.Toolbar({ui:"fsi",dock:"bottom",items:b});c.FSIPages=this;this.iLinkDialog=new Ext.Panel({myToolbar:c,layout:"vbox",hideOnMaskTap:false,floating:true,draggable:true,modal:false,centered:true,width:Ext.is.Phone?260:300,height:Ext.is.Phone?220:300,dockedItems:[a,c],scroll:"vertical",afterComponentLayout:function(){Ext.Component.superclass.afterComponentLayout.call(this);this.dragObj.el.un(this.dragObj.tapEvent,this.dragObj.onTapEvent,this.dragObj,{horizontal:this.dragObj.horizontal,vertical:this.dragObj.vertical});this.dragObj.el.un({touchmove:this.dragObj.onTouchMove,touchend:this.dragObj.onTouchEnd,scope:this.dragObj});this.myToolbar.el.on({touchmove:this.dragObj.onTouchMove,touchend:this.dragObj.onTouchEnd,scope:this.dragObj});this.myToolbar.el.on(this.dragObj.tapEvent,this.dragObj.onTapEvent,this.dragObj,{horizontal:this.dragObj.horizontal,vertical:this.dragObj.vertical})}});this.iLinkDialog.iPanelContent=a;this.iLinkDialog.nelaPreRender()},createAboutDialog:function(){var a=new Ext.Container({cls:"FSIPagesMobileLinkDialogContent",floating:false,html:'<table width="100%" border="0" cellpadding="0" cellspacing="0" style="position:absolute;left:auto;top:10px;z-index:2;-webkit-user-select: none;-webkit-user-drag: none;cursor:default;"><tr><td height="58"></td></tr><tr><td height="24" align="center" >Version '+this.version+'</td></tr><tr><td height="24" align="center" >&copy; 2013 NeptuneLabs GmbH</td></tr><tr><td height="35"></td></tr><tr><td align="center" height="30"><div style="width:252px;height:22px;overflow:hidden;white-space:nowrap;"></div></td></tr></table><div style="width:100%;height:100%;position:absolute;left:0px;top:0px;z-index:1;background-color:#ffffFF;overflow:hidden;-webkit-user-select: none;-webkit-user-drag: none;"/>',scroll:false});var b=[{text:this.getTranslation("Read more"),cls:"fsi",cmd:"AboutReadMore",handler:this.tapHandler},{xtype:"spacer"},{text:this.getTranslation("Help"),cls:"fsi",cmd:"AboutHelp",handler:this.tapHandler}];var c=new Ext.Toolbar({ui:"fsi",dock:"bottom",items:b});c.FSIPages=this;this.iAboutDialog=new Ext.Panel({id:"FSIPagesAbout",floating:true,modal:true,draggable:true,centered:true,width:280,height:238,dockedItems:[a,c],scroll:false});this.iAboutDialog.nelaPreRender();this.iAboutDialog.svriEL=a.el.dom.children[1]},createOptionsDialog:function(){var b=this.createOptionsDialogList();var a=b.length*45;this.optionsList=new Ext.List({layout:{type:"fit",padding:"5",align:"left"},store:this.iOptionsStore,scroll:false,tpl:'<tpl for="."><div cmd="{cmd}" class="mainoption"><table cellpadding="0" cellspacing="0" border="0"><tr><td><img src="images/icons/{icon}.png"/></td><td>{text}</td></tr></table></div></tpl>',itemSelector:"div.mainoption"});this.iOptionsDialog=new Ext.Panel({floating:true,cls:"fsi",modal:true,centered:false,width:Ext.is.Phone?260:300,height:10+a,scroll:"vertical"});this.iOptionsDialog.add(this.optionsList);this.iOptionsDialog.nelaPreRender();this.optionsList.on("itemtap",this.onOptionSelected,this)},showInstructions:function(d){if(this.iInstructionsDialog){this.closeInstructionsDialog()}var a=window.innerWidth;var c=window.innerHeight;var b;if(a>c){b=this.getPagesParameter("instructionsimagelandscape","_service/FSI Pages Mobile/instructions/landscape.tif")}else{b=this.getPagesParameter("instructionsimageportrait","_service/FSI Pages Mobile/instructions/portrait.tif")}if(b&&b.length>0&&this.iConfig.makeBool(b,true)==false){return false}if(!b||b.length<4){return false}this.bInstructionsAvailable=true;if(!d&&this.getLocalStorage("showInstructions")=="0"){return false}this.oHelpImageCfg=new Object();this.oHelpImageCfg.fpxsrc=b;this.iConfig.getImageInfo(this.oHelpImageCfg,this,this.onInstructionsInfoReady);return true},onInstructionsInfoReady:function(r,u){if(!r){this.bInstructionsAvailable=false}this.onHelpImageReady();if(!r){return}var q=window.innerWidth;var j=window.innerHeight;var a=q-12;var f=j-12-46;var n={width:this.oHelpImageCfg.fpxwidth,height:this.oHelpImageCfg.fpxheight};var m={width:a,height:f};var l=this.getMatchingImageSize(n,m);var c=this.getImageURL(this.oHelpImageCfg.fpxsrc);c+="&width="+l.width+"&height="+l.height;var g='<div class="FSIInstructions" style="background-image:url('+c+');width:100%;height:100%;" >&nbsp;</div>';var p=new Ext.Panel({width:a,height:f,style:"background-color:transparent",html:g,scroll:false});var e=[{xtype:"spacer"}];var d;if(!this.bLocalStorage){d=[]}else{var s=this.getLocalStorage("showInstructions");if(s!="0"){s=1}else{s=0}d=[{xtype:"container",style:"color:white;font-weight:bold;",html:this.getTranslation("Show instructions on start")},{xtype:"toggle",style:"-webkit-transform:scale(0.75);top:-0.6em;width:auto;background-color: transparent;border-bottom:0px none;",id:"FSIShowInstructionsToggle",value:s}]}var b=[{icon:"images/icons/close.png",iconCls:"fsibuttonicon",ui:"action",cmd:"closeInstructionsDialog",handler:this.tapHandler}];var k=new Ext.Toolbar({ui:"fsi",dock:"top",items:[e,d,b]});k.FSIPages=this;this.iInstructionsDialog=new Ext.Panel({id:"FSIPagesMobileHelp",layout:{type:"vbox",align:"stretch"},floating:true,cls:"fsi",cmpCls:"FSITransparentBackgrounds",style:"background-color:transparent;background-image:none;border:6px solid #58a8ff;padding:0px;-webkit-box-shadow:none;",modal:false,draggable:false,centered:true,width:q,height:j,items:[k,p],scroll:false});this.iInstructionsDialog.iToolBar=k;this.iInstructionsDialog.show();p.getEl().on("tap",this.closeInstructionsDialog,this)},closeInstructionsDialog:function(){if(!this.iInstructionsDialog){return}if(this.bLocalStorage&&this.iInstructionsDialog.iToolBar){var a=this.iInstructionsDialog.iToolBar.getComponent("FSIShowInstructionsToggle");if(a){this.setLocalStorage("showInstructions",String(a.getValue()))}}this.iInstructionsDialog.hide();this.remove(this.iInstructionsDialog,false);this.iInstructionsDialog.destroy();this.iInstructionsDialog=undefined},createOptionsDialogList:function(){var d=new Array();if(this.iADG.svriEL.bQSet&&this.iADG.svriEL.bQSet==this.iADG.svriEL.bPSet&&this.iConfig.getPAParam()){}else{d.push({cmd:"infowindow",icon:"info",text:this.getTranslation("About")+" FSI Pages mobile"})}var b=this.iPlugins.oPlugins.imprint;if(b&&b.bHasData){d.push({cmd:"imprint",icon:"imprint",text:this.getTranslation("Imprint")})}if(this.bInstructionsAvailable){d.push({cmd:"showinstructions",icon:"help",text:this.getTranslation("Help")})}this.urlDownloadPDF=undefined;if(this.getComponent("PagesLibraryPanel")!=undefined){d.push({cmd:"library",icon:"library",text:this.getTranslation("Library")})}var a=this.iPlugins.oPlugins.chapters;if(a&&a.arIndexItems&&a.arIndexItems.length>0){d.push({cmd:"chapters",icon:"toc",text:this.getTranslation("Table of Contents")})}if(this.getPagesParameter("index",true,true)){d.push({cmd:"index",icon:"thumbs",text:this.getTranslation("Page Thumbnails")})}if(this.getPagesParameter("search",false,true)){d.push({cmd:"search",icon:"search",text:this.getTranslation("PagesSearchButton")})}if(this.bDebug){d.push({cmd:"debugwindow",icon:"info",text:"Debug Window"})}var c=(window!=undefined&&window.opener!=undefined)?true:false;if(this.getPagesParameter("MobileQuitButton",c,true)){d.push({cmd:"quit",icon:"close_app",text:this.getTranslation("Close")})}this.iOptionsStore=new Ext.data.Store({model:"FSIOptionsModel",data:d});return d},onOptionSelected:function(h,f,k,j){var b=k.getAttribute("cmd");this.iOptionsDialog.hide();switch(b){case"imprint":var d=this.iPlugins.oPlugins.imprint;if(d&&d.bHasData&&d.iPanel){d.iPanel.show();try{d.iPanel.scroller.scrollTo({x:0,y:0},false)}catch(g){}}break;case"chapters":var a=(Ext.getOrientation()=="portrait")?"left":"up";this.setCurrentPanel("ChaptersPanel",{type:this.animationType,reverse:false,duration:this.cardAnimDuration,direction:a});this.iChaptersList._goRoot();break;case"index":var a=(Ext.getOrientation()=="portrait")?"left":"up";this.setCurrentPanel("IndexPanel",{type:this.animationType,duration:this.cardAnimDuration,reverse:false,direction:a});this.initIndexPanel();break;case"save":if(this.urlDownloadPDF&&this.urlDownloadPDF.length>0){this.downloadPDF()}break;case"search":var a=(Ext.getOrientation()=="portrait")?"left":"up";this.setCurrentPanel("SearchPanel",{type:this.animationType,duration:this.cardAnimDuration,reverse:false,direction:a});break;case"quit":if(top.window&&top.window.close){top.window.close()}break;case"library":var c=this.iPlugins.oPlugins.pageslibrary;if(c&&c.initPanel!=undefined){var a=(Ext.getOrientation()=="portrait")?"left":"up";this.setCurrentPanel("PagesLibraryPanel",{type:this.animationType,duration:this.cardAnimDuration,reverse:false,direction:a});c.initPanel()}break;case"showinstructions":this.showInstructions(true);break;case"infowindow":if(!this.iAboutDialog.isVisible()){this.iAboutDialog.show()}else{this.iAboutDialog.hide()}break;case"debugwindow":this.iDebug.iPanel.setVisible(!this.iDebug.iPanel.isVisible());break}},downloadPDF:function(){window.open(this.urlDownloadPDF,"_blank")},getPagesParameter:function(b,a,c){return this.iConfig.getPagesParameter(b,a,c)},tapHandlerThumbnailNav:function(b,c){c.stopEvent();var a=this.ownerCt.FSIPages;var d=this.ownerCt.MainView;if(!d){return}switch(b.cmd){case"GoPrevious":d.prev();break;case"GoNext":d.next();break;case"GoFirst":d.goFirstPage();break;case"GoLast":d.goLastPage();break;case"gotoMainPanelFromIndex":case"gotoMainPanelFromLibrary":case"gotoMainPanelFromSearch":d.onExitView();a.setCurrentPanel();break}},tapHandler:function(b,c){c.stopEvent();c.stopPropagation();var a=this.ownerCt.FSIPages;var d=a.MainView;switch(b.cmd){case"forward":d.goNextPage();break;case"back":d.goPreviousPage();break;case"firstpage":d.goFirstPage();break;case"lastpage":d.goLastPage();break;case"showOptions":a.MainView.hideLinkDialog(false);a.iOptionsDialog.setCentered(false);a.iOptionsDialog.showBy(b);if(a.iOptionsDialog.getEl().getLeft()<0){var e=a.iOptionsDialog.getEl().getTop();a.iOptionsDialog.setCentered(true,true);a.iOptionsDialog.getEl().setTop(e)}break;case"gotoMainPanelFromChapters":a.setCurrentPanel();break;case"gotoMainPanelFromBrowser":a.setCurrentPanel();break;case"closeLinkDialog":a.MainView.hideLinkDialog(true);break;case"closeInstructionsDialog":a.closeInstructionsDialog();break;case"LinkDialogOpenLink":if(a.MainView.followLinkFromLinkDialog()){a.MainView.hideLinkDialog(true)}break;case"AboutReadMore":a.iAboutDialog.hide();window.open("http://www.fsi-viewer.com/pagesmobile","_blank");break;case"AboutHelp":a.iAboutDialog.hide();window.open("http://help.fsi-viewer.com/?app=pagesmobile","_blank");break}},setContent:function(b,a){this.oPageListReg=undefined;this.iConfig.maxpage=this.getListSize();var c=fsiStringUtil.crc32(this.iConfig.cfg.cfg+"|"+this.dir+"|"+document.location.search);if(c<0){c="0"+String(Math.abs(c))}else{c=String(c)}this.iSearchPanel.MainView.resetSearch();this.MainView.removeContent();this.flushPageData();this.MainView.lastWidth=undefined;this.MainView.onResize(this.MainView.width,this.MainView.height);this.MainView.setContent(c,a);if(this.bDebug){this.log("<b>Set Content:</b> "+c,true);this.log("Page Size: "+this.MainView.szPage.width+" x "+this.MainView.szPage.height,true);this.log("Double Page View: "+this.MainView.bDoublePageMode,true);this.log("Zoom height: "+this.hZoomed,true)}if(!this.firstTimeContentReady){this.getEl().removeClass("startup")}},closeBrowser:function(){var a=document.getElementById("iframetarget");if(!a){return}a.style.display="hidden";this.show()},browseToInternal:function(c){this.setCurrentPanel("BrowserPanel");var a=this.BrowserPanelMainPanel.getEl();if(a==undefined||a.dom==undefined){return}var b=this.BrowserPanel.getEl().dom;b.firstChild.style.webkitTransform="none";b.parentNode.style.webkitTransform="none";a=a.dom.firstChild;a.setAttribute("src",c)},setCurrentPanel:function(b,e){var g=0;if(b!=undefined){var c=this.getComponent(b);g=this.items.indexOf(c);if(g<0){g=0}}var d=(Ext.getOrientation()=="portrait")?"left":"up";if(e==undefined){var e={type:this.animationType,duration:this.cardAnimDuration,reverse:false,direction:d};if(g==0){e.reverse=true}}if(this.layout.setActiveItem(g,e)){var f=this.items.items[this.currentPanel];if(f.MainView&&f.MainView.onMakeVisible){f.MainView.onMakeVisible(false)}var a=this.layout.activeItem;if(a.MainView&&a.MainView.onMakeVisible){a.MainView.onMakeVisible(true)}this.currentPanel=g}},getPageImage:function(b,f,a,d){var c,h,g,e;if(isNaN(b)||b<0||b>this.getListSize()){return false}if(this.iConfig.bRTL){b=this.getListSize()-b-1}e=this.getListItem(b);h=e.src;if(h==undefined){c=false}else{c=this.getImageURL(h);if(f!=undefined){c+="&width="+f}if(a!=undefined){c+="&height="+a}}return c},getDoublePageText:function(b,c){var a=this.iConfig;var b=a.getPageNumber(b+1);var d;if(c.bDoublePage){if(a.bRTL){d=a.getPageNumberString(b)+" / "+a.getPageNumberString(b-1)}else{d=a.getPageNumberString(b)+" / "+a.getPageNumberString(b+1)}}else{d=a.getPageNumberString(b)}return d},getPageImageURL:function(b,a){return this.iConfig.getPageImageURL(b,a)},getImageURL:function(c,b){var a=this.iConfig.getImageURL(c,b);return a},getDoublePageImageURL:function(b,e,a,c){var d=this.iConfig.getDoublePageImageURL(b,e);d+="&backgroundcolor="+this.pageColor;d+="&leftalignment="+this.strImageAlignParam+"&rightalignment="+this.strImageAlignParam;if(a==undefined){a=this.pageOffsetsEvenPage.right}if(c==undefined){c=this.pageOffsetsUnevenPage.left}if(a>0){d+="&leftinnergap="+a}if(c>0){d+="&rightinnergap="+c}return d},flushPageData:function(){this.oPageDataReg=new Object();this.oPageDataRegSize=0},minimizePageData:function(){if(this.oPageDataRegSize<this.maxPageDataCount){return}var c=new Array();for(var d in this.oPageDataReg){var b=this.oPageDataReg[d];if(b.refCount==0){c.push(d);this.oPageDataRegSize--;if(this.oPageDataRegSize<this.maxPageDataCount){break}}}for(var a=0;a<c.length;a++){var e=c[a];delete this.oPageDataReg[e].oPageData._data;delete this.oPageDataReg[e]}},releasePageData:function(a){if(a._data==undefined){return}a._data.refCount--},getPageData:function(a){if(a._data==undefined){var b=a.id;if(this.oPageDataReg[b]==undefined){this.minimizePageData();this.oPageDataReg[b]=a._data=new FSIPagesMobilePageData(this,a);this.oPageDataRegSize++}else{a._data=this.oPageDataReg[b]}}a._data.refCount++},parseCropRect:function(h,d,l){if(h==undefined){return new FSIRect()}var j=[0,0,1,1];var f=h.split(",");if(f.length!=4){return new FSIRect()}var g=(d!=undefined&&!isNaN(d)&&d>0&&l!=undefined&&!isNaN(l)&&l>0);var b,k,c;for(var e=0;e<f.length;e++){k=f[e];b=parseFloat(k);if(isNaN(b)){b=j[e]}else{if(k.indexOf("%")!=-1){b=Math.max(0,Math.min(100,b));b=b/100}else{if(g&&k.indexOf("px")!=-1){if(e%2==0){c=d}else{c=l}b=Math.max(0,Math.min(c,b));b=b/c}else{b=Math.max(0,Math.min(1,b))}}}f[e]=b}var a=new FSIRect(f[0],f[1],f[2],f[3]);return a},parseCropValues:function(d,b,a){var c=this.parseCropRect(d,b,a);c.right=1-c.right;c.bottom=1-c.bottom;c.round();return c},setListData:function(e){if(this.MainView==undefined){return}this.arListItems=e;var h=this.getPagesParameter("removepages");if(h!=undefined){h=h.split(",")}if(h&&h.length>0){h.sort(this.sortNumeric);for(var u=h.length-1;u>-1;u--){var m=h[u]-1;if(m>-1&&m<this.arListItems.length){this.arListItems.splice(m,1)}}}if(this.arListItems.length>0){this.firstUnEmptyListItem=this.iConfig.cloneValueObject(this.arListItems[0])}else{this.firstUnEmptyListItem={empty:true,width:1000,height:1000}}var c=this.getPagesParameter("emptyimages");if(c!=undefined){c=c.split(",")}if(c&&c.length>0){c.sort(this.sortNumeric);for(var u=0;u<c.length;u++){var m=c[u]-1;if(m>-1&&m<this.arListItems.length){this.arListItems.splice(m,0,this.getEmptyPageData())}}}var j=!this.getPagesParameter("FrontCover",true,true);this.bFrontcover=!j;var b=!this.getPagesParameter("BackCover",true,true);this.bBackCover=!b;this.bFullFrontCover=(!j&&this.getPagesParameter("FullFrontCover",false,true));this.bFullBackCover=(!j&&this.getPagesParameter("FullBackCover",false,true));if(!j){if(this.getPagesParameter("BlankFrontCover",false,true)){this.arListItems.unshift(this.getEmptyPageData())}else{}}if(!b){if(this.getPagesParameter("BlankBackCover",false,true)){this.arListItems.push(this.getEmptyPageData())}else{}}if(this.iConfig.bRTL){this.nRTLEvenIndexOffset=1}else{this.nRTLEvenIndexOffset=(j)?1:0}var A=this.arListItems.length;var l=j;if(b){l=!l}var d=(l)?0:1;if(A%2==d){this.arListItems.push(this.getEmptyPageData())}if(this.getPagesParameter("reversepageorder",this.iConfig.bRTL,true)){this.arListItems.reverse()}this.bAutoFlipCropRects=this.getPagesParameter("AutoFlipCropRect",true,true);var q;var m=this.iConfig.cfg.cropvalues;if(m!=undefined){q=this.parseCropValues(m,100,100);this.fnParsePageCrop=this.parseCropValues}else{m=this.iConfig.cfg.croprect;q=this.parseCropRect(m,100,100);this.fnParsePageCrop=this.parseCropRect}if(q&&q.isEffectiveCropRect()){this.strPageCropParameter=m;this.bCropPages=true}else{this.bCropPages=false}this.bAutoCropPages=this.getPagesParameter("autocroppages",false,true);if(this.bAutoCropPages&&!this.bCropPages){this.bCropPages=true;this.strPageCropParameter="0,0,1,1";this.fnParsePageCrop=this.parseCropRect}var k=this.firstUnEmptyListItem;var a=this.iConfig.cloneValueObject(k);this.getListItemMeasurements(a);var B=a.width;var f=a.height;var g;var m=this.getPagesParameter("ratio");if(m!=undefined&&m.length>0){g=m.split(":")}if(g&&g.length==2){g[0]=parseFloat(g[0]);g[1]=parseFloat(g[1]);if(isNaN(g[0])||g[0]<=0||isNaN(g[1])||g[1]<=0){g=undefined}if(g!=undefined){var v=B/g[0];var r=f/g[1];if(v>r){f=Math.floor(B*g[1]/g[0])}else{B=Math.floor(f*g[0]/g[1])}}}var p=new Object();this.iConfig.parseMargins(p,"PageMargin",100,100);for(var n in p){p[n]/=100}this.pageMargin=this.pageMarginEvenPage={left:p.PageMarginOuter,top:p.PageMarginTop,right:p.PageMarginInner,bottom:p.PageMarginBottom};this.pageMargin.width=this.pageMargin.left+this.pageMargin.right;this.pageMargin.height=this.pageMargin.top+this.pageMargin.bottom;var z=new Object();this.iConfig.parseMargins(z,"PagePadding",100,100);for(var n in z){z[n]/=100}this.pagePadding={left:z.PagePaddingOuter,top:z.PagePaddingTop,right:z.PagePaddingInner,bottom:z.PagePaddingBottom};this.pagePadding.width=this.pagePadding.left+this.pagePadding.right;this.pagePadding.height=this.pagePadding.top+this.pagePadding.bottom;this.pagePadding.factorWidth=1+this.pagePadding.width;this.pagePadding.factorHeight=1+this.pagePadding.height;this.pageOffsets=new Object();for(var n in this.pagePadding){this.pageOffsets[n]=this.pagePadding[n]+this.pageMargin[n]}this.pageOffsetsEvenPage=this.pageOffsets;this.pageOffsetsUnevenPage=this.iConfig.cloneValueObject(this.pageOffsets);this.pageOffsetsUnevenPage.left=this.pageOffsets.right;this.pageOffsetsUnevenPage.right=this.pageOffsets.left;this.bNoPageOffsets=(this.pageOffsets.left==0&&this.pageOffsets.top==0&&this.pageOffsets.right==0&&this.pageOffsets.bottom==0);this.pageOffsets.pageImagefactorWidth=(1+this.pagePadding.width)/(1-this.pageMargin.width);this.pageOffsets.pageImagefactorHeight=(1+this.pagePadding.height)/(1-this.pageMargin.height);B=Math.round(this.pagePadding.factorWidth*B);f=Math.round(this.pagePadding.factorHeight*f);f=Math.max(1,f);this.szPage=new Object();this.szPage.width=B;this.szPage.height=f;this.MainView.pageRatioWH=this.pageRatioWH=B/f;this.szPageImage={width:Math.floor(B/this.pageOffsets.pageImagefactorWidth),height:Math.floor(f/this.pageOffsets.pageImagefactorHeight)};this.MainView.pageImageRatioWH=this.pageImageRatioWH=this.szPageImage.width/this.szPageImage.height;var m=this.getPagesParameter("ImageAlign","tc").toLowerCase();if(m.length==0){m="tc"}else{if(m.length==1){m+="c"}}this.strImageAlignParam=m.substr(0,2);this.pageVAlignStyle=undefined;switch(m.charAt(0)){case"c":this.pageVAlignStyle="middle";break;case"b":this.pageVAlignStyle="bottom";break;default:this.pageVAlignStyle="top";break}this.leftPageHAlignStyle=this.rightPageHAlignStyle=undefined;switch(m.charAt(1)){case"r":this.leftPageHAlignStyle="right";this.rightPageHAlignStyle="left";break;case"l":this.leftPageHAlignStyle="left";this.rightPageHAlignStyle="right";break;default:this.leftPageHAlignStyle=this.rightPageHAlignStyle="center";break}this.getListItemMeasurements(k);var s=1800000;if(k.width*k.height<=s){this.hZoomed=k.height}else{this.hZoomed=Math.floor(Math.sqrt(s/this.pageRatioWH));var w=Math.floor(this.hZoomed*this.pageRatioWH)}},getEmptyPageData:function(){return{empty:true}},getListSize:function(){return this.arListItems.length},getPageListItemBySrc:function(a){if(this.oPageListReg==undefined){this.buildPageReg()}return this.getListItem(this.oPageListReg[a],false)},buildPageReg:function(){var b=this.oPageListReg=new Object();var d=this.getListSize();for(var a=0;a<d;a++){var c=this.arListItems[a];if(c&&c.src){if(c.id!=undefined||c.src.indexOf("/")!=-1){b[c.src]=a}else{b[this.dir+c.src]=a}}}},getListItem:function(b,c){var a=this.getListSize()-1;if(this.iConfig.bRTL&&c){b=a-b}var d=this.arListItems[b];if(d&&d.id==undefined){d.id=b;if(d.src!=undefined&&d.src.indexOf("/")==-1){d.src=this.dir+d.src}d.evenPage=((b+this.nRTLEvenIndexOffset)%2==0);if(d.file&&d.file=="[src]"){d.file=d.src}if(this.bHasCovers&&b==0||b==a){var e=b;if(this.iConfig.bRTL&&!c){e=a-e}if(e==0&&this.bFrontCover){d.bCover=true;if(this.bFullFrontCover){d._bIgnoreMargins=d._bAutoCrop=true}}else{if(e==a&&this.bBackCover){if(this.bFullBackCover){d._bIgnoreMargins=d._bAutoCrop=true}}}}this.getListItemMeasurements(d)}return d},getListItemMeasurements:function(d){if(d==undefined||d.srcWidth!=undefined){return}d.width=parseInt(d.width);d.height=parseInt(d.height);d.srcWidth=d.width;d.srcHeight=d.height;if(this.bCropPages||d._bAutoCrop){d.rcCrop=this.fnParsePageCrop(this.strPageCropParameter,d.srcWidth,d.srcHeight);if(this.bAutoFlipCropRects&&!d.evenPage){d.rcCrop.mirrorHorz()}d.width=Math.round(d.rcCrop.width()*d.width);d.height=Math.round(d.rcCrop.height()*d.height);if(this.bAutoCropPages||d._bAutoCrop){var c=d.width/d.height;var a=(d._bIgnoreMargins)?this.pageRatioWH:this.pageImageRatioWH;if(c<a){var b=(1-c/a);d.rcCrop.inflateRect(0,-b*d.rcCrop.height())}else{var b=(1-a/c);d.rcCrop.inflateRect(-b*d.rcCrop.width(),0)}}d.width=Math.round(d.rcCrop.width()*d.srcWidth);d.height=Math.round(d.rcCrop.height()*d.srcHeight)}},getMatchingImageSize:function(b,c){var e={width:c.width,height:c.height};if(!b||!b.width||!b.height){return e}var d=b.width/b.height;var a=c.width/c.height;if(d>a){e.height=Math.round(c.width/b.width*b.height)}else{e.width=Math.round(c.height/b.height*b.width)}return e},onConfigReady:function(){this.bLocalStorage=this.setLocalStorage("test","1");this.bButtonsFirstLastPage=this.getPagesParameter("ButtonsFirstLastPage",true,true);this.pageColor=this.getPagesParameter("PageColor","FFFFFF");this.pageBorderColor=this.getPagesParameter("PageBorderColor","CCCCCC");if(this.pageBorderColor.length!=6){if(this.getPagesParameter("PageBorderColor",true,true)){this.pageBorderColor="CCCCCC"}else{this.pageBorderColor=false}}this.bWaitForConfigReadyDone=false;if(!this.firstTimeConfigurationReady){this.firstTimeConfigurationReady=true;this.createMainComponents();if(!this.showInstructions()){this.iConfig.onConfigReadyDone()}else{this.bWaitForConfigReadyDone=true}}else{this.iConfig.onConfigReadyDone()}},onHelpImageReady:function(){if(this.bWaitForConfigReadyDone){this.bWaitForConfigReadyDone=false;this.iConfig.onConfigReadyDone()}},getLocalStorage:function(a){if(!localStorage){return}return localStorage.getItem(a)},setLocalStorage:function(b,c){var a=false;if(!localStorage){return a}try{localStorage.removeItem(b);localStorage.setItem(b,c);a=true}catch(d){}return a},sortNumeric:function(d,c){return d-c},onConfigInitComplete:function(){new FSIButtonST(this,this.onIntitST,this.iConfig.svri1,this.iConfig.svri1,this.iADG.svriEL,this.onInitComplete)},onInitComplete:function(){var d=this.iConfig.cfg.mobilewindowtitle;if(d!=undefined&&d.length>0){document.title=d}else{if(this.strOrgDocumentTitle!=undefined){document.title=this.strOrgDocumentTitle}}this.iConfig.bForceXMLPageData=this.getPagesParameter("ForceXMLDataFiles",false,true);this.iConfig.setPagesXMLBase(this.getPagesParameter("XMLBase"));var b=this.getPagesParameter("menu",true,true);if(b==this.iMainToolbar.hidden){this.iMainToolbar.setVisible(b);this.MainView.lastWidth=undefined;this.MainViewPanel.componentLayout.childrenChanged=true;this.MainViewPanel.doComponentLayout()}this.createOptionsDialog();this.bFrontCover=this.getPagesParameter("frontcover",true,true);this.bBackCover=this.getPagesParameter("backcover",true,true);this.bHasCovers=(this.bFrontCover||this.bBackCover);this.bXMLBaseUseFileName=this.getPagesParameter("XMLBaseUseImageFileName",false,true);this.MainView.calculateDimensions();var c=this.iLinkDialog.myToolbar.getComponent("FSIPagesMobileButtonOpenLink");if(c){if(this.iConfig.bFollowLinks){c.show()}else{c.hide()}}var a;a=this.getPagesParameter("forceinitialpage");if(a==undefined){a=parseInt(this.getPagesParameter("initialpage","0"))}a=parseInt(a);if(isNaN(a)){a=0}this.setContent(this.arListItems,a);if(this.intervalLocationCheck==undefined){this.intervalLocationCheck=window.setInterval(this.checkLocationChange,125,this)}Ext.hideAddressBar();if(this.getPagesParameter("search",false,true)){var e=this.getPagesParameter("SearchTextOnStart");if(e!=undefined&&e.length>0){this.setCurrentPanel("SearchPanel",{type:this.animationType,duration:0,reverse:false});this.iSearchPanel.MainView.searchFor(e)}}},setPageContainerHVAlign:function(c,b,a){if(!c||!b){return}if(b.evenPage){c.style.textAlign=this.rightPageHAlignStyle}else{c.style.textAlign=this.leftPageHAlignStyle}c.style.verticalAlign=this.pageVAlignStyle},enableScrollBar:function(c,a){if(c.NELAEnabled==undefined){c.NELAEnabled=true}if(c.NELAEnabled==a){return}c.NELAEnabled=a;var b=c;if(a){b.scroller.addCls("x-scroller");b.parent.addCls("x-scroller-parent");b.parent.on({touchstart:b.onTouchStart,scrollstart:b.onScrollStart,scrollend:b.onScrollEnd,scroll:b.onScroll,horizontal:b.horizontal,vertical:b.vertical,scope:b});clearInterval(b.scrollInterval);b.scroller.on({DOMSubtreeModified:b.updateBounds,webkitTransitionEnd:b.onTransitionEnd,scope:b});Ext.ScrollManager.register(this)}else{b.scroller.removeClass("x-scroller");b.parent.removeClass("x-scroller-parent");b.parent.un({touchstart:b.onTouchStart,scrollstart:b.onScrollStart,scrollend:b.onScrollEnd,scroll:b.onScroll,horizontal:b.horizontal,vertical:b.vertical,scope:b});clearInterval(b.scrollInterval);b.scroller.un({DOMSubtreeModified:b.updateBounds,webkitTransitionEnd:b.onTransitionEnd,scope:b});Ext.ScrollManager.unregister(this)}},optimizeScroller:function(c,b){return;if(!Ext.is.iOS){return}if(b||c.NEALalwaysOptimized){theTransform=c.translateOpen+"0px,0px"+c.translateClose}else{theTransform="none"}theTransform=c.translateOpen+"0px,0px"+c.translateClose;var a=c.el;if(!a){return}a=a.parent();a.dom.style.webkitTransform=theTransform},getProportionalSize:function(a){return Math.round(a*this.screenScaleFactor)},doLogPageNow:function(a,b){}});Ext.reg("FSIPagesMobile",Ext.FSIPagesMobile);function FSIPagesMobilePageData(a,b){this.FSIPages=a;this.oPageData=b;this.bReady=false;this.bNoLinks=true;this.arAreas=new Array();this.refCount=0;this.loadPageData=function(e){var c=this.FSIPages.iConfig;var d,f;if(e){var h=this.getXMLFileName();if(h==undefined){this.onPageDataLoaded(null,e)}if(h!=undefined){this.strXMLFile=h;var g=this.FSIPages.iConfig.strXMLBase;if(h.charAt(0)=="/"&&g.charAt(g.length-1)=="/"){h=h.substring(1)}d=g+h}}else{d=this.FSIPages.iConfig.strListFilePrefix+encodeURIComponent(this.oPageData.file)+this.FSIPages.iConfig.strListFileSuffix;f={};this.FSIPages.iConfig.finishRequestParams(f)}Ext.Ajax.request({url:d,params:f,method:"GET",scope:this,bUseExternalXML:e,success:function(j,k){this.onPageDataLoaded(j.responseXML,j.request.options.bUseExternalXML)},failure:function(j,k){this.onPageDataLoaded(null,j.request.options.bUseExternalXML)}})};this.getXMLFileName=function(){if(!this.oPageData.src){return undefined}var c="/"+this.oPageData.src;if(c.indexOf("?")!=-1){var d={};this.FSIPages.iConfig.parseQuery(c,d);if(d.source!=undefined){c=d.source}}if(this.FSIPages.bXMLBaseUseFileName){i=c.lastIndexOf("/");if(i!=-1){c=c.substr(i+1)}}if(c.length>0){c+=".xml"}else{c=undefined}return c};this.onPageDataLoaded=function(d,c){this.parseXML(d);if(!this.bHasData&&!c&&this.FSIPages.iConfig.strXMLBase!=undefined){this.loadPageData(true);return}if(this.oPageData.iCacheItemWaitingForLinkData!=undefined){this.oPageData.iCacheItemWaitingForLinkData.checkPageDataReady(this)}else{}};this.parseXML=function(e){if(!e){this.bNoLinks=true;this.bReady=true;return}var d;var c=e.firstChild;var f=false;while(c){f=false;if(c.nodeType==1){var g=c.nodeName.toLowerCase();if(!this.bHasData&&g=="pages"){this.bHasData=true}switch(g){case"links":this.oLinkAttributes=new Object();this.XMLAttributes2Object(c,this.oLinkAttributes);break;case"image":f=true;break;case"area":f=true;this.addAreaFromXML(c);break}}d=c.firstChild;if(!d||f){d=c.nextSibling;if(!d){d=c.parentNode.nextSibling}}c=d}if(this.arAreas.length>0){this.bNoLinks=false}this.bReady=true};this.addAreaFromXML=function(c){var e=c;if(e.firstChild==undefined){return}var g=new Object();this.XMLAttributes2Object(e,g);g._arShapes=new Array();e=e.firstChild;while(e){if(e.nodeType==1){var h=e.nodeName.toLowerCase();switch(h){case"shape":var f=new Object();this.XMLAttributes2Object(e,f);if(f.coords){f.parsedCoords=f.coords.split(",");if(f.parsedCoords.length>3){g._arShapes.push(f)}}break;case"text":var d="";if(e.firstChild&&e.firstChild.nodeType==3){d=e.firstChild.nodeValue}else{d=this.FSIPages.iConfig.XMLChildNodesToString(e)}if(d.length>0){g.tip=d}break}}e=e.nextSibling}if(g._arShapes.length>0){this.arAreas.push(g)}};this.XMLAttributes2Object=function(e,f){for(var d=0;d<e.attributes.length;d++){var c=e.attributes[d];f[c.nodeName.toLowerCase()]=c.nodeValue}};this.decodeToolTip=function(c){if(c==undefined||c.length==undefined){return}if(c.indexOf("+"!=-1)){c=c.replace(/\+/g," ")}c=decodeURIComponent(c);c=c.replace(/(\<font\s+[^\>]*)size\s*=\s*['"]?(\d+)[ \w]*['"]?\s+/gi,'$1style="font-size:$2px" ');c=c.replace(/\r?\n/g,"<br/>");c='<div class="FSIPagesLinkContentHTML">'+c+"</div>";return c};if(!this.FSIPages.iConfig.bForceXMLPageData&&b.file!=undefined){this.loadPageData(false)}else{if(this.FSIPages.iConfig.strXMLBase!=undefined){this.loadPageData(true)}else{this.onPageDataLoaded()}}}Ext.FSIPagesMobilePagePanel=Ext.extend(Ext.Panel,{scroll:{useIndicators:false,scrollbars:false,bounces:true,momentum:true,friction:0.75,acceleration:35,horizontal:true,vertical:true},bContentloaded:false,bIsDoublePage:false,centered:true,pinchPos:[0,0],bZoomed:false,bPinching:false,tabHoldCount:0,clickCount:0,onRender:function(b,a){Ext.FSIPagesMobilePagePanel.superclass.onRender.call(this,b,a);this.mon(this.el,{doubletap:this.onDoubleTap,taphold:this.onTapHold,pinch:this.onPinch,pinchstart:this.onPinchStart,pinchend:this.onPinchEnd,mousewheel:this.onMouseWheel,mousedown:this.onMouseDown,click:this.onClick,scope:this})},onTapHold:function(){if(this.bPinching){return}this.MainView.showContentCanvas(true,true,this.iCacheItem);this.tabHoldCount=3},onMouseDown:function(){this.tabHoldCount=0;if(this.MainView.iActiveAreaNode==undefined){this.MainView.hideLinkDialog(true)}this.MainView.iActiveAreaNode=undefined},onClick:function(){this.clickCount++;this.MainView.iActiveAreaNode=undefined;this.MainView.hideLinkDialog(true);if(this.tabHoldCount<3&&this.iCacheItem){this.MainView.showContentCanvas(false,true,this.iCacheItem)}},onScrollEnd:function(a){},onDoubleTap:function(a){a.cancelBubble=true;var c=a.pageX;var b=a.pageY;this.clickZoom(c,b,550)},clickZoom:function(d,c,b){if(this.scroller.offset.scale<=1){if(!this.MainView.zoomIsPossible){return}var e=new Object();e.scale=this.MainView.scaleZoomedImages;this.onZoom(e.scale,b);var a=e.scale-1;e.x=d*a-(this.getWidth()/2-d);e.y=c*a-(this.getHeight()/2-c);this.scroller.scrollTo(e,true)}else{this.onZoom(1,b)}},onMouseWheel:function(a){a.deltaScale=a.browserEvent.wheelDeltaY/200;this.zoomPanel(a)},onPinchStart:function(b){this.bPinching=true;var a=0;var e=0;var d=b.touches;for(var c=0;c<d.length;c++){a+=b.touches[c].pageX;e+=b.touches[c].pageY}this.pinchPos[0]=a/c;this.pinchPos[1]=e/c},onPinch:function(a){if(!this.bPinching){return}this.zoomPanel(a)},onPinchEnd:function(a){this.bPinching=false;if(!this.bZoomed){return}if(this.scroller.offset.scale>this.MainView.scaleZoomedImages){var a=new Object();a.touches=true;a.deltaScale=(this.MainView.scaleZoomedImages-this.scroller.offset.scale)*6.8;this.zoomPanel(a,true)}this.checkShowZoomImages()},zoomPanel:function(j,b){if(j.deltaScale<=0){if(!this.bZoomed){return}}if(!this.MainView.zoomIsPossible){return}var a=j.deltaScale/8;var g=this.scroller.offset;var d=g.scale;g.scale=Math.max(1,Math.min(2*this.MainView.scaleZoomedImages,g.scale+a));var k=g.scale-d;if(!this.bZoomedImages&&k==0){var l=this.bPinching;this.bPinching=false;this.checkShowZoomImages();this.bPinching=l}var e,c;if(j.touches!=undefined){e=this.pinchPos[0];c=this.pinchPos[1]}else{e=j.browserEvent.x;c=j.browserEvent.y}var h=(e-g.x)/d;var f=(c-g.y)/d;g.x-=h*k;g.y-=f*k;g.x=-g.x;g.y=-g.y;this.scroller.scrollTo(g,b);this.onZoom(g.scale)},onZoom:function(b,a){var c=(b>1);if(this.bZoomed==c){return}this.bZoomed=c;this.scroller.scrollToDuration=(a==undefined)?550:a;if(c){this.scroller.setScrollSize(this.getWidth(),this.getHeight(),this.iCacheItem.data.szPanel.width,this.iCacheItem.data.szPanel.height);this.scroller.setEnabled(true);this.loadZoomedImages()}else{this.removeZoomedImages();this.scroller.scrollTo({x:0,y:0,scale:1},(a!=undefined),undefined,true);this.scroller.setEnabled(false);this.scroller.setScrollSize(0,0,0,0)}this.MainView.enterZoom(c)},setContent:function(f){if(this.bZoomed){this.clickZoom(0,0,300)}var a=(this.MainView.layout.getActiveItem()==this);if(this.nPanelIndexLoaded==f){var d=(a==this)?10:5;this.iCacheItem.update(d);return false}else{if(this.nPanelIndexLoaded!=undefined){this.dismissContent()}}this.nPanelIndexLoaded=f;if(this.iCacheItem!=undefined){}var d=(a)?10:5;var b=this.MainView.getPanelContentID(f);this.iCacheItem=this.MainView.iCacheManagerGroup.addItem(this,b,d,undefined);if(this.iCacheItem.iDOMElement.parentNode!=undefined){this.iCacheItem.data.iPanel.dismissContent()}this.iCacheItem.data.iPanel=this;if(a){this.MainView.setCurrentVisibleCard(this)}var c=this.getEl().dom.firstChild.firstChild;try{c.appendChild(this.iCacheItem.iDOMElement)}catch(g){}return true},dismissContent:function(){if(this.bZoomed){this.clickZoom(0,0,0)}if(this.nPanelIndexLoaded==undefined){return}this.nPanelIndexLoaded=undefined;this.iCacheItem.setPriority(0);this.releaseZoomedImages();try{this.iCacheItem.iDOMElement.parentNode.removeChild(this.iCacheItem.iDOMElement)}catch(a){}this.iCacheItem=undefined;return},loadZoomedImages:function(){if(this.iCacheItem.data.arImageNodesZoomed!=undefined){return}this.releaseZoomedImages();var g=this.iCacheItem;g.nZoomedImagesLoaded=0;g.nZoomImagesToLoad=0;g.data.arImageNodesZoomed=new Array();for(var d=0;d<g.data.arPageData.length;d++){var b=g.data.arPageData[d];if(b.src!=undefined){var a=g.data.arImageDim[d];var c=g.iCacheGroup.iCacheManager.getImageNode();var e=Math.round(this.MainView.scaleZoomedImages*a.height);var f=this.FSIPages.getPageImageURL(b)+"&height="+e;c.setAttribute("class","FSIPagesMobileImage");c.addEventListener("load",this.onZoomedPageImageLoaded,false);c.addEventListener("error",this.onZoomedPageImageLoadedError,false);c.iFSIPagesCacheItem=g;c.setAttribute("src",f);g.data.arImageNodesZoomed.push(c);g.nZoomImagesToLoad++}else{g.data.arImageNodesZoomed.push(undefined)}}if(g.nZoomImagesToLoad>0){this.MainView.showLoading(true)}},onZoomScrollEnd:function(a){this.checkShowZoomImages()},checkShowZoomImages:function(){if(!this.bZoomed||this.bZoomedImages){return}var a=(this.iCacheItem.nZoomedImagesLoaded==this.iCacheItem.nZoomImagesToLoad);this.MainView.showLoading(false);if(this.scroller.inTransition||this.bPinching){return}if(a){this.onZoomedImagesReady()}},onZoomedPageImageLoaded:function(a){var c=this.iFSIPagesCacheItem;var b=c.iCreatorInstance;this.removeEventListener("load",b.onZoomedPageImageLoaded,false);this.removeEventListener("error",b.onZoomedPageImageLoadedError,false);c.nZoomedImagesLoaded++;b.checkShowZoomImages()},onZoomedPageImageLoadedError:function(a){var c=this.iFSIPagesCacheItem;var b=c.iCreatorInstance;this.removeEventListener("load",b.onZoomedPageImageLoaded,false);this.removeEventListener("error",b.onZoomedPageImageLoadedError,false);b.releaseZoomedImages()},onZoomedImagesReady:function(){var k=this.iCacheItem;var h=this.MainView.szPage;if(k.data.arImageNodes.length>0){var m=k.data.arImageDim[0].width;var c=k.data.arPageData[0].empty;var l=k.data.arImageNodes[0];if(l&&l.width&&!c){m=l.width}var d=1/this.MainView.scaleZoomedImages;for(var g=0;g<k.data.arImageNodes.length;g++){var j=k.data.arColumns[g];var a=k.data.arImageNodes[g];var b=k.data.arImageNodesZoomed[g];if(b!=undefined){b.setAttribute("class","FSIPagesMobileImageZoomed");var f=a.offsetLeft;var e=a.offsetTop;b.style.webkitTransform=this.scroller.translateOpen+f+"px,"+e+"px"+this.scroller.translateClose+" scale("+d+")";j.appendChild(b);a.style.display="none"}}}this.bZoomedImages=true},releaseZoomedImages:function(){this.removeZoomedImages();var c=this.iCacheItem;if(!c||c.data.arImageNodesZoomed==undefined){return}this.MainView.showLoading(false);for(var a=0;a<c.data.arImageNodesZoomed.length;a++){var b=c.data.arImageNodesZoomed[a];if(b!=undefined){b.removeEventListener("load",this.onZoomedPageImageLoaded,false);b.removeEventListener("error",this.onZoomedPageImageLoadedError,false);b.style.webkitTransform="none";c.iCacheGroup.iCacheManager.releaseImageNode(b)}}delete c.data.arImageNodesZoomed},removeZoomedImages:function(){if(!this.bZoomedImages){return}var g=this.iCacheItem;for(var b=0;b<g.data.arImageNodesZoomed.length;b++){var f=g.data.arColumns[b];var a=g.data.arImageNodes[b];var c=g.data.arImageNodesZoomed[b];try{f.removeChild(c);a.style.display="inline"}catch(d){}}this.bZoomedImages=false},showImageLoaded:function(a){var b=a.parentNode;this.showTDLoaded(b)},showTDLoaded:function(a){if(!a){return}var b=a.getAttribute("class").split(" ");b.pop();b=b.join(" ");a.setAttribute("class",b)},afterPageImageLoaded:function(){var a=this.checkCreateContent()},onPageImageLoadedError:function(a){a.cancelBubble=true;this.iFSIPagesCacheItem.onContentLoaded(false);this.iFSIPagesCacheItem.data.iPanel.showImageLoaded(this);delete this.iFSIPagesCacheItem},onPageImageLoaded:function(a){a.stopPropagation();this.style.display="inline";this.iFSIPagesCacheItem.onContentLoaded(true);this.iFSIPagesCacheItem.data.iPanel.showImageLoaded(this);this.iFSIPagesCacheItem.data.iPanel.afterPageImageLoaded();delete this.iFSIPagesCacheItem},onCacheManagerRequestCreateDOM:function(k){if(k.data.arImageNodes!=undefined){}k.data.arPageData=new Array();var f=this.MainView.getDoublePageInfo(this.nPanelIndexLoaded);k.data.contentID=f.contentID;this.bDoublePage=f.bDoublePage;var h=this.MainView.szPage;k.data.arColumns=new Array();k.data.arImageDim=new Array();var g=k.data.nodeContainer=document.createElement("table");g.setAttribute("class","FSIPagesMobilePageContainer");g.style.backgroundColor="#"+this.FSIPages.pageColor;g.style.border=this.MainView.strPageBorderStyle;g.style.top=this.MainView.offsetTop;var l=document.createElement("tr");g.appendChild(l);var e=document.createElement("td");k.data.arColumns.push(e);l.appendChild(e);var j=this.FSIPages.getListItem(f.contentID);k.data.arPageData.push(j);var a=this.MainView.getPageImageSize(j);var b=this.FSIPages.getMatchingImageSize(j,a);k.data.arImageDim.push(b);this.FSIPages.setPageContainerHVAlign(e,j,b);k.data.szPanel={width:h.width,height:h.height};e.style.width=h.width+"px";if(f.bDoublePage){e.setAttribute("class","FSIPagesMobilePage loading");var d=document.createElement("td");k.data.arColumns.push(d);l.appendChild(d);d.setAttribute("class","FSIPagesMobilePage loading");d.style.width=e.style.width;var j=this.FSIPages.getListItem(f.contentID+1);k.data.arPageData.push(j);this.FSIPages.setPageContainerHVAlign(d,j);var c=this.FSIPages.getMatchingImageSize(j,a);k.data.arImageDim.push(c);k.data.szPanel.width+=h.width}else{e.setAttribute("class","FSIPagesMobilePage loading")}g.style.width=(k.data.szPanel.width+this.MainView.nPageBorderOffset)+"px";g.style.height=(h.height+this.MainView.nPageBorderOffset)+"px";return g},onCacheManagerRequestDeleteDOM:function(c){this.deleteContent(c);if(c.data.arImageNodes!=undefined){for(var b=0;b<c.data.arImageNodes.length;b++){var a=c.data.arImageNodes[b];if(a.parentNode){a.parentNode.removeChild(a)}delete a.iFSIPagesCacheItem;a.removeEventListener("load",this.onPageImageLoaded,false);a.removeEventListener("error",this.onPageImageLoadedError,false);c.iCacheGroup.iCacheManager.releaseImageNode(a);c.data.arImageNodes[b]=undefined}}for(var b=0;b<c.data.arPageData.length;b++){this.FSIPages.releasePageData(c.data.arPageData[b])}delete c.data.arPageData;delete c.data.arColumns;delete c.data.arImageNodes},onCacheManagerRequestLoad:function(h){if(h.data.arImageNodes!=undefined){}h.data.arImageNodes=new Array();var d=true;for(var c=0;c<h.data.arPageData.length;c++){var e=h.data.arPageData[c];this.FSIPages.getPageData(e);if(d&&e.src==undefined&&!e.empty){d=false}if(!e.empty){e.iCacheItemWaitingForLinkData=h}}if(!d){return}h.nItemsToLoad=0;for(var c=0;c<h.data.arPageData.length;c++){var e=h.data.arPageData[c];var f=h.data.arColumns[c];var a=h.data.arImageDim[c];var b=h.iCacheGroup.iCacheManager.getImageNode();b.setAttribute("class","FSIPagesMobileImage");b.addEventListener("load",this.onPageImageLoaded,false);b.addEventListener("error",this.onPageImageLoadedError,false);b.style.display="none";this.MainView.setPageImagePadding(b,e,this.MainView.szPage);var g;if(e.src!=undefined){g=this.FSIPages.getPageImageURL(e)+"&height="+a.height}else{g="images/blank.gif";b.setAttribute("width",this.MainView.szPage.width+"px");b.setAttribute("height",this.MainView.szPage.height+"px")}b.setAttribute("src",g);b.iFSIPagesCacheItem=h;h.data.arImageNodes.push(b);f.appendChild(b);h.nItemsToLoad++}return true},deleteContent:function(f,d){this.releaseZoomedImages();if(!f.data||!f.data.bContentCreated){return}f.data.bCanvasVisible=false;var a=f.iCacheGroup.iCacheManager;if(f.data.arImagesOnTop!=undefined){for(var b=0;b<f.data.arImagesOnTop.length;b++){var e=f.data.arImagesOnTop[b];if(e!=undefined){a.releaseImageNode(e)}}delete f.data.arImagesOnTop}if(d){for(var b=0;b<f.data.arMapNodes.length;b++){var c=f.data.arMapNodes[b];f.data.arContentDivs[b].removeChild(c)}}else{delete f.data.arMapNodes}for(var b=0;b<f.data.arContentDivs.length;b++){f.destroyDOMElement(f.data.arContentDivs[b])}f.data.bContentCreated=false;f.data.bCanvasDrawn=f.data.bCanvasVisible=false;delete f.data.arContentDivs;delete f.data.arCanvasNodes;delete f.data.arImagesOnTop},getCropInfo:function(d,b,a,c){},createContent:function(k){if(!k.data||k.data.bContentCreated){if(!k.data){return false}if(k.data.bContentCreated){return false}}if(!k.data.bDataReady){return false}k.data.bContentCreated=true;k.data.bCanvasVisible=false;k.data.arContentDivs=new Array();k.data.arImagesOnTop=new Array();if(k.data.arMapNodes==undefined){k.data.arMapNodes=new Array()}var h=new Object();for(var B=0;B<k.data.arPageData.length;B++){var z=k.data.arPageData[B];var A=z._data;var l=k.data.arImageDim[B];var m=l.width;var q=l.height;var g=0,e=0;var f=1,r=1;if(z.rcCrop){g=z.rcCrop.left;e=z.rcCrop.top;f=z.rcCrop.width();r=z.rcCrop.height()}var H=k.data.arColumns[B];var d=k.data.arImageNodes[B];var D=d.offsetTop;var J=d.offsetLeft;var v=document.createElement("div");k.data.arContentDivs.push(v);v.setAttribute("class","FSIPagesMobileContent");v.style.top=D+"px";v.style.left=J+"px";v.style.opacity="0";var a=k.data.arMapNodes[B];var u;if(a==undefined){u="map_"+k.id+"__"+B;a=document.createElement("map");a.setAttribute("name",u);k.data.arMapNodes.push(a);for(var w=A.arAreas.length-1;w>-1;w--){var p=A.arAreas[w];for(var G=0;G<p._arShapes.length;G++){var I=p._arShapes[G];var C=new Array();C=C.concat(I.parsedCoords);for(var s=0;s<C.length;s+=2){C[s]=Math.round(parseFloat(C[s]-g)/f*m);C[s+1]=Math.round(parseFloat(C[s+1]-e)/r*q)}var b=C.join(",");var F=document.createElement("area");F.setAttribute("coords",b);var E=(Ext.is.iOS&&!Ext.is.iPad);if(!E){F.setAttribute("href","javascript:void(0)")}F.setAttribute("XLinkIndex",B+"_"+w+"_"+G);a.appendChild(F);F.onclick=this.onAreaClicked;F.FSIPages=this.FSIPages}}}else{u=a.getAttribute("name")}v.appendChild(a);var j=k.iCacheGroup.iCacheManager.getImageNode();k.data.arImagesOnTop.push(j);j.setAttribute("src","images/blank.gif");j.setAttribute("class","FSIPagesMobileImageTop");j.setAttribute("useMap","#"+u);j.style.width=m+"px";j.style.height=q+"px";v.appendChild(j);H.appendChild(v)}return true},drawCanvas:function(m){if(!m||!m.data.bContentCreated||!m.data.arContentDivs||!m.data.arMapNodes){return false}if(m.data.bCanvasDrawn){return true}m.data.arCanvasNodes=new Array();m.data.bCanvasDrawn=true;var e=this.MainView.linkIconImage;for(var d=0;d<m.data.arContentDivs.length;d++){var f=m.data.arContentDivs[d];var l=m.data.arPageData[d];var p=m.data.arImageDim[d];nodeCanvas=document.createElement("canvas");nodeCanvas.setAttribute("width",p.width);nodeCanvas.setAttribute("height",p.height);nodeCanvas.setAttribute("class","FSIPagesMobile");f.insertBefore(nodeCanvas,f.lastChild);m.data.arCanvasNodes.push(nodeCanvas);var g=m.data.arMapNodes[d];if(nodeCanvas.getContext){var n=nodeCanvas.getContext("2d");n.clearRect(0,0,this.MainView.szPage.width,this.MainView.szPage.height);var b=this.MainView.linkRGBAActive;n.fillStyle="rgba("+b.red+","+b.green+","+b.blue+","+this.MainView.linkFillAlpha+")";n.strokeStyle="rgba("+b.red+","+b.green+","+b.blue+","+b.webAlpha+")";n.lineWidth=1;var k=g.firstChild;while(k!=undefined){var h=k.getAttribute("coords");if(h==undefined){continue}var a=h.split(",");if(a.length<6){continue}n.beginPath();n.moveTo(a[0],a[1]);for(var c=2;c<a.length;c+=2){n.lineTo(a[c],a[c+1])}n.closePath();n.fill();n.stroke();n.drawImage(e,a[0],a[1]-14);k=k.nextSibling}}}return true},onAreaClicked:function(a){if(this.FSIPages.MainView.bPageFlipping){return}this.FSIPages.MainView.iActiveAreaNode=this;this.FSIPages.MainView.onAreaClicked(this,a)},onCacheManagerRequestUnload:function(a){return true},setScrollable:function(c){if(!this.rendered){this.scroll=c;return}if(c!==false){var e=Ext.isObject(c)?c.direction:c,d=e==="both",a=d||e==="horizontal",b=d||e===true||e==="vertical";c=Ext.apply({},Ext.isObject(c)?c:{},{jumpTo:this.jumpTo,momentum:true,horizontal:a,vertical:b});this.scrollEl=this.getTargetEl().createChild();this.originalGetTargetEl=this.getTargetEl;this.getTargetEl=function(){return this.scrollEl};this.scroller=new Ext.FSIPagesMobileZoomScroller(this.scrollEl,c);this.scroller.FSIPages=this.FSIPages;this.scroller.scrollTo({x:0,y:0,scale:1},false);this.scroller.on("scrollend",this.onZoomScrollEnd,this);this.scroller.setEnabled(false)}else{this.scroller.un("scrollend",this.onZoomScrollEnd,this);this.getTargetEl=this.originalGetTargetEl;this.scroller.destroy()}},onCacheItemCallsDataReady:function(a){if(a.id!=this.iCacheItem.id){return}this.checkCreateContent()},checkCreateContent:function(){if(this.MainView.layout.getActiveItem()!=this){return}var a=this.MainView.scroller;if(a&&!a.animating&&!a.inTransition){var b=this.MainView.createPagesContent(this.iCacheItem)}else{}return true}});Ext.reg("FSIPagesMobilePagePanel",Ext.FSIPagesMobilePagePanel);Ext.FSIPagesMobileZoomScroller=Ext.extend(Ext.util.Scroller,{bEnabled:true,szInner:{width:0,height:0},szOuter:{width:0,height:0},scrollPadding:10,springTension:0.35,constructor:function(b,a){Ext.FSIPagesMobileZoomScroller.superclass.constructor.apply(this,arguments);this.offset.scale=1;this.scroller.dom.style.webkitTransformOrigin="0% 0%"},onTouchStart:function(f){var d=this,a=d.scroller,c=a.dom.style,b;if(!f||f.touches.length>1){return}d.updateBounds();d.followTouch=f.touch;if(d.animating){clearInterval(d.scrollInterval);if(d.inTransition){d.stopTransition()}d.snapToBounds(false);if(d.scrollbarX){d.scrollbarX.stop()}if(d.scrollbarY){d.scrollbarY.stop()}d.animating=false;d.doScrollEnd()}this.updateBounds();if(d.momentum){d.resetMomentum(f)}},stopTransition:function(){if(!this.inTransition){return}var a=this.scroller,d=a.dom.style,b;d.webkitTransitionDuration="0ms";b=new WebKitCSSMatrix(window.getComputedStyle(a.dom).webkitTransform);var c={x:b.m41,y:b.m42,scale:b.a};this.updateBounds(c.scale);this.constrainToBounds(c);d.webkitTransform=this.translateOpen+c.x+"px, "+c.y+"px"+this.translateClose+" scale("+c.scale+")";this.offset={x:c.x,y:c.y,scale:c.scale};this.inTransition=false},scrollTo:function(e,b,d,a){this.updateBounds(e.scale);if(e.scale==undefined){e.scale=this.offset.scale}if(!a){e=this.constrainToBounds({x:Math.round(-e.x),y:Math.round(-e.y),scale:e.scale})}clearInterval(this.scrollInterval);if(b){this.animating=true;this.inTransition=true;var c=this.scroller.dom.style;c.webkitTransitionTimingFunction=d||this.scrollToEasing;c.webkitTransitionDuration=(typeof b=="number")?(b+"ms"):(this.scrollToDuration+"ms");c.webkitTransform=this.translateOpen+e.x+"px, "+e.y+"px"+this.translateClose+" scale("+e.scale+")";this.offset=e}else{this._scrollTo({x:e.x,y:e.y,scale:e.scale})}return this},_scrollTo:function(b){if(b.scale==undefined){b.scale=this.offset.scale}this.offset={x:Math.round(b.x),y:Math.round(b.y),scale:b.scale};var a=this.scroller.dom.style;a.webkitTransitionDuration="0ms";a.webkitTransform=this.translateOpen+this.offset.x+"px, "+this.offset.y+"px"+this.translateClose+" scale("+this.offset.scale+")"},updateBounds:function(b){if(b==undefined){b=this.offset.scale}this.parentSize={width:this.parent.getWidth(true),height:this.parent.getHeight(true)};this.contentSize={width:b*this.szOuter.width,height:b*this.szOuter.height};this.contentSizeInner={width:b*this.szInner.width+this.scrollPadding,height:b*this.szInner.height+this.scrollPadding};if(this.parentSize.width>this.contentSizeInner.width){this.ofx=-(this.contentSize.width-this.parentSize.width)/2}else{this.ofx=(this.contentSizeInner.width-this.contentSize.width)/2}if(this.parentSize.height>this.contentSizeInner.height){this.ofy=-(this.contentSize.height-this.parentSize.height)/2}else{this.ofy=(this.contentSizeInner.height-this.contentSize.height)/2}this.size={width:Math.max(this.contentSize.width,this.parentSize.width),height:Math.max(this.contentSize.height,this.parentSize.height)};this.bounds={left:this.ofx,top:this.ofy,right:this.parentSize.width-this.size.width-this.ofx,bottom:this.parentSize.height-this.size.height-this.ofy};if(this.bounds.left<this.bounds.right){var a=this.bounds.left;this.bounds.left=this.bounds.right;this.bounds.right=a}if(this.bounds.top<this.bounds.bottom){var a=this.bounds.top;this.bounds.top=this.bounds.bottom;this.bounds.bottom=a}this.bounds.x=this.bounds.right;this.bounds.y=this.bounds.bottom},constrainToBounds:function(a){if(a.scale==undefined){a.scale=this.offset.scale}if(!this.bounds){this.updateBounds(a.scale)}return{x:Math.min(Math.max(this.bounds.right,a.x),this.bounds.left),y:Math.min(Math.max(this.bounds.bottom,a.y),this.bounds.top),scale:a.scale}},onScrollEnd:function(c,b){Ext.FSIPagesMobileZoomScroller.superclass.onScrollEnd.call(this,c,b);var a=5;if(this.bounces){if(this.FSIPages.MainView.direction!="vertical"){if(-(this.bounds.left-this.offset.x)>this.parentSize.width/a){this.FSIPages.MainView.goPreviousPage()}else{if(this.bounds.right-this.offset.x>this.parentSize.width/a){this.FSIPages.MainView.goNextPage()}}}else{if(-(this.bounds.top-this.offset.y)>this.parentSize.height/a){this.FSIPages.MainView.goPreviousPage()}else{if(this.bounds.bottom-this.offset.y>this.parentSize.height/a){this.FSIPages.MainView.goNextPage()}}}}},setEnabled:function(a){if(this.bEnabled==a){return}this.bEnabled=a;this.FSIPages.enableScrollBar(this,a)},setScrollSize:function(b,d,a,c){this.szInner.width=a;this.szInner.height=c;this.szOuter.width=b;this.szOuter.height=d}});Ext.reg("FSIPagesMobileZoomScroller",Ext.FSIPagesMobileZoomScroller);Ext.FSIPagesMobilePageView=Ext.extend(Ext.FSIPagesMobileCarousel,{bZoomed:false,strContentID:"",bDoublePageMode:false,szPage:{width:0,height:0},currentPageText:"",elImagePopup:undefined,bPreviousButtonEnabled:false,bNextButtonEnabled:false,initComponent:function(){Ext.FSIPagesMobilePageView.superclass.initComponent.call(this);this.iCacheManagerGroup=this.FSIPages.iCacheManager.createGroup("mainpage",1000,3,10);this.linkIconImage=new Image();this.linkIconImage.src="images/icons/link.png"},getPanelContentID:function(a){var b=this.contentID;b+="_panel_"+a;b+="_"+this.bDoublePageMode;b+="_"+this.szPage.width;b+="x"+this.szPage.height;return b},setContent:function(d,c){this.initPanelOptions();this.bDeferToOpener=this.FSIPages.getPagesParameter("DeferLinksToOpener",false,true);this.linkRGBANormal=this.FSIPages.iConfig.getRGBAValue(this.FSIPages.getPagesParameter("LinkRGBANormal","58a8ff00"));this.linkRGBAActive=this.FSIPages.iConfig.getRGBAValue(this.FSIPages.getPagesParameter("LinkRGBAActive","58a8ffff"));this.linkFillAlpha=this.FSIPages.iConfig.getIntParameterMinMax("linkFillAlpha",20,0,100)/100;this.removeContent();this.FSIPages.iCacheManager.flush();this.contentID=d;this.setDoublePageMode(this.bDoublePageMode,true);var a=document.location.hash;if(a!=undefined&&a.length>0){a=a.split("_");if(a.length==2&&a[0].length>0&&a[1].length>0){a[0]=a[0].substr(1);if(a[0]==this.contentID){a=parseInt(a[1]);if(!isNaN(a)&&a>0){c=a}}}}if(this.FSIPages.iConfig.bRTL){c=this.FSIPages.getListSize()-c}var b;if(c!=undefined&&!isNaN(c)){b=this.getPanelIDFromPageID(c)}Ext.FSIPagesMobilePageView.superclass.setContent.call(this,d,b)},createPagePanel:function(c,b){var a=new Ext.FSIPagesMobilePagePanel({autoDestroy:false,cls:"x-FSIPagesMobilePagePanel"});a.FSIPages=this.FSIPages;a.MainView=this;return a},afterRender:function(){Ext.FSIPagesMobilePageView.superclass.afterRender.apply(this,arguments);if(this.scroll){this.scroller.on("scrollstart",this.onScrollStartEvent,this);this.scroller.on("scrollend",this.onScrollEndEvent,this);this.scroller.on("touchstart",this.onTouchStartEvent,this);this.onScrollEndEvent(this.scroller)}this.createLoader()},onTouchStartEvent:function(a){this.FSIPages.iPhoneScroll()},onScrollStartEvent:function(a){this.onBeforePageTurn()},onBeforePageTurn:function(){this.bPageFlipping=true;var a=this.layout.getActiveItem();if(a&&a.iCacheItem){this.showContentCanvas(false,false,a.iCacheItem,true)}Ext.FSIPagesMobilePageView.superclass.onBeforePageTurn.call(this)},onScrollEndEvent:function(a){if(this.bZoomed){return}this.onAfterPageTurn()},onAfterPageTurn:function(){this.bPageFlipping=false;var b=this.layout.getActiveItem();if(b){this.setCurrentVisibleCard(b);if(b.iCacheItem){var a=this.createPagesContent(b.iCacheItem)}}this.setDocumentHash();this.executeAfterFlip();if(b&&b.iCacheItem&&b.iCacheItem.data.bCanvasDrawn){this.showContentCanvas(false,true,b.iCacheItem)}Ext.FSIPagesMobilePageView.superclass.onAfterPageTurn.call(this)},executeAfterFlip:function(){if(this.executeOnceAfterFlipPage!=undefined){var f=this.getPanelIDFromPageID(this.executeOnceAfterFlipPage);if(this.layout.nVPos==f){var e=this.executeOnceAfterFlipZoom;if(typeof(e)=="string"){e=e.split(",");for(var d=0;d<e.length;d++){e[d]=parseFloat(e[d]);if(isNaN(e[d])){break}}var c=this.layout.getActiveItem();if(d>5){var b=e[2]+(e[4]-e[2])/2;var h=e[3]+(e[5]-e[3])/2;var a,g;if(this.bDoublePageMode){a=(c.MainView.getWidth()-2*this.szPage.width)/2}else{a=(c.MainView.getWidth()-this.szPage.width)/2}g=(c.MainView.getHeight()-this.szPage.height)/2;b=a+Math.round(this.szPage.width*b);h=g+Math.round(this.szPage.height*h);if(this.executeOnceAfterFlipPage==(this.getPageIDFromPanelID(this.layout.nVPos)+1)){b+=this.szPage.width}if(this.bZoomed){c.clickZoom(0,0,300)}c.clickZoom(b,h,550)}}}this.executeOnceAfterFlipPage=this.executeOnceAfterFlipZoom=undefined}},setCurrentVisibleCard:function(b){var a=Ext.FSIPagesMobilePageView.superclass.setCurrentVisibleCard.call(this,b);if(!a){return}},createPagesContent:function(b){if(this.strActiveCardCacheItemID!=b.id){return false}if(b.loadStatus!=2){return false}if(this.iCacheItemCurrentContent!=undefined&&b.id!=this.iCacheItemCurrentContent.id){this.iCacheItemCurrentContent.iCreatorInstance.deleteContent(this.iCacheItemCurrentContent,true)}this.iCacheItemCurrentContent=b;var a=b.iCreatorInstance.createContent(b);if(a===true&&this.linkRGBANormal.webAlpha>0){Ext.defer(this.intitalShowLinks,150,this)}return a},intitalShowLinks:function(){var a=this.layout.getActiveItem();if(a&&a.iCacheItem){this.showContentCanvas(true,true,a.iCacheItem)}},setupPages:function(a){if(!this.bContainersReady){return}Ext.FSIPagesMobilePageView.superclass.setupPages.call(this);this.setCurrentPageText(this.layout.nVPos)},setDocumentHash:function(){if(this.contentID==undefined){return}var a=this.getPageIDFromPanelID(this.layout.nVPos);if(a==undefined||isNaN(a)){return}var b="#"+this.contentID+"_"+a;if(document.location.hash!=b){document.location.hash=this.FSIPages.lastDocumentLocationHash=b}},onMakeVisible:function(a){if(!this.bZoomed){this.FSIPages.enableScrollBar(this.scroller,a)}this.bResizeLocked=!a;this.onResize()},autoHidePageInput:function(){if(!this.iMainToolbar){return}var a=false;if(this.FSIPages.bButtonsFirstLastPage&&this.iBTNFirstPage){var b=(this.showPageInput)?480:400;var d=false;if(this.iMainToolbar.getWidth()>b){d=true}if(d!=this.iBTNFirstPage.isVisible()){this.iBTNFirstPage.setVisible(d);this.iBTNLastPage.setVisible(d);a=true}}if(this.showPageInput&&this.iFieldPageNumber){var c;if(this.iMainToolbar.getWidth()>360){c=true}else{c=false}if(c!=this.iFieldPageNumber.isVisible()){this.iFieldPageNumber.setVisible(c);a=true}}if(a){this.iMainToolbar.doLayout()}},doResize:function(a,b){this.autoHidePageInput();this.FSIPages.iPlugins.callListeners("resize",a,b);if(this.bResizeLocked){return false}this.loaderDiv.style.left=(a/2-15)+"px";this.loaderDiv.style.top=(b/2-45)+"px";if(this.pageRatioWH==undefined||this.contentID==undefined){return false}this.calculateDimensions();this.refreshContent();return true},calculateDimensions:function(){var f=this.getWidth();var d=this.getHeight();var n=10;var j=10;var l=f-n;var m=d-j;var b=m;var k=Math.round(b*this.pageRatioWH);if(k>l){k=l;b=Math.round(k/this.pageRatioWH)}var a;this.bSingleSided=false;a=this.FSIPages.getPagesParameter("mobileDoublePageRatioLimit","70%");a=this.FSIPages.iConfig.parsePercentDef(a);if(isNaN(a)){a=0.7}else{a=Math.max(0,Math.min(1,a))}if(a!=1&&2*k>l){var e=Math.floor(l/2);var c=Math.round(e/this.pageRatioWH);if(m-c<m*(1-a)){k=e;b=c}}this.szPage={width:k,height:b};if(this.FSIPages.pageOffsets!=undefined){this.szPageImage={width:Math.floor(k/this.FSIPages.pageOffsets.pageImagefactorWidth),height:Math.floor(b/this.FSIPages.pageOffsets.pageImagefactorHeight)}}this.offsetTop=Math.round((j+m-b))/2+"px";var g=(a==1)?false:(2*this.szPage.width<=f);this.setDoublePageMode(g,false);this.hZoomed=this.FSIPages.hZoomed;this.scaleZoomedImages=this.hZoomed/this.szPage.height;if(!this.FSIPages.getPagesParameter("zoom",true,true)||this.scaleZoomedImages<1.1){this.zoomIsPossible=false}else{this.zoomIsPossible=true}},setDoublePageMode:function(f,e){var c;var b=(this.bDoublePageMode!=f);this.bDoublePageMode=f;if(this.contentID==undefined){return}if(!b&&!e){return}var a=this.getDoublePageInfo(0);var d;this.maxpage=this.FSIPages.getListSize();if(!f){c=this.maxpage;if(b&&!e){if(a.bStartsWithSinglePage){d=Math.max(0,2*this.layout.nVPos-1)}else{d=2*this.layout.nVPos}}}else{if(a.bStartsWithSinglePage){c=1+Math.floor(this.maxpage/2);if(b&&!e){d=Math.ceil(this.layout.nVPos/2)}}else{c=Math.ceil(this.maxpage/2);if(b&&!e){d=Math.floor(this.layout.nVPos/2)}}}this.layout.setVSize(c);if(d!=undefined){this.gotoPanel(d,false)}a=this.getDoublePageInfo(0);this.bStartsWithSinglePage=a.bStartsWithSinglePage},onCardSwitch:function(c,b){var a=Ext.FSIPagesMobilePageView.superclass.onCardSwitch.call(this,c,b);this.hideDialogs();if(!a){return}var d=(this.lastEnabledIndex!=0);if(this.bPreviousButtonEnabled!=d){this.bPreviousButtonEnabled=d;if(d){if(this.iBTNPreviousPage){this.iBTNPreviousPage.enable()}if(this.iBTNFirstPage){this.iBTNFirstPage.enable()}}else{if(this.iBTNPreviousPage){this.iBTNPreviousPage.disable()}if(this.iBTNFirstPage){this.iBTNFirstPage.disable()}}}var d=(this.lastEnabledIndex!=2&&this.lastEnabledIndex<this.layout.nVSize-1);if(this.bNextButtonEnabled!=d){this.bNextButtonEnabled=d;if(d){if(this.iBTNNextPage){this.iBTNNextPage.enable()}if(this.iBTNLastPage){this.iBTNLastPage.enable()}}else{if(this.iBTNNextPage){this.iBTNNextPage.disable()}if(this.iBTNLastPage){this.iBTNLastPage.disable()}}}},disableNavigation:function(){if(this.iBTNPreviousPage){this.iBTNPreviousPage.disable()}if(this.iBTNFirstPage){this.iBTNFirstPage.disable()}if(this.iBTNNextPage){this.iBTNNextPage.disable()}if(this.iBTNLastPage){this.iBTNLastPage.disable()}this.bPreviousButtonEnabled=this.bNextButtonEnabled=false},setCurrentPageText:function(c){if(this.iFieldPageNumber==undefined||this.iFieldPageNumber.hasFocus){return}var b=this.getPageIDFromPanelID(c)-1;var a=this.currentPageText=this.FSIPages.getDoublePageText(b,this.getDoublePageInfo(c));this.iFieldPageNumber.setValue(a)},getPanelIDFromPageID:function(a){if(typeof(a)!="number"){a=parseInt(a)}if(isNaN(a)){return"error"}var a=Math.max(1,Math.min(this.FSIPages.getListSize(),a));var b;var c=a-1;if(!this.bDoublePageMode){b=c}else{if(this.bStartsWithSinglePage){b=Math.ceil(c/2)}else{b=Math.floor(c/2)}}return b},getPageIDFromPanelID:function(b){var a;if(this.bDoublePageMode){if(this.bStartsWithSinglePage){a=Math.max(0,2*b-1)+1}else{a=2*b+1}}else{a=b+1}return a},enterZoom:function(a){if(this.bZoomed==a){return}this.bZoomed=a;if(a){this.FSIPages.enableScrollBar(this.scroller,false);this.panelZoomed=this.layout.getActiveItem()}else{this.FSIPages.enableScrollBar(this.scroller,true)}},followLinkFromLinkDialog:function(){if(!this.lastDisplayedLinkItemID){return false}var c=this.FSIPages.iConfig;var l=this.iActiveAreaNode;var r=this.layout.getActiveItem();var q=r.iCacheItem;var b=l.getAttribute("XLinkIndex");var h=b.split("_");var s=q.data.arPageData[h[0]];var k=s._data;var p=k.arAreas[h[1]];var f=p._arShapes[h[2]];var n=s.id+1;var d=c.getHotSpotUrl(k,p);d=c.ReplaceLinkTemplates(d);var g=c.getHotSpotTarget(k,p,d);if(d.charAt(0)=="#"){var m=d.toLowerCase();if(m.indexOf("#page=")==0){t=d.split("=");if(c.bUseNamedPageNumbersExternal){t=c.getPageNumberFromString(t[1])}else{t=Math.max(0,Math.min(this.maxpage,parseInt(t[1])))}if(!isNaN(t)){this.FSIPages.doLogPageNow("hyperlink",t);this.gotoPageRTL(t,true);return true}}if(m.indexOf("#zoomonpage=")==0){t=d.split("=");t=t[1].split(";");if(c.bUseNamedPageNumbersExternal){tpage=c.getPageNumberFromString(t[0])}else{tpage=parseInt(t[0])}if(tpage<0||tpage>this.maxPage){return true}if(!isNaN(tpage)){this.FSIPages.doLogPageNow("hyperlink",tpage);this.gotoPageAndZoom(tpage,t[1]);return true}}if(m=="#zoom"||m.indexOf("#zoom=")==0||m=="#zoomarea"){t=d.split("=");if(t.length>1){t=t[1];if(t==undefined||t.length<10){t="1,1,0.5,0.5,0.5,0.5"}}else{var a=this.getCoordBounds(f.parsedCoords);t="1,1,"+a.xMin+","+a.yMin+","+a.xMax+","+a.yMax}this.gotoPageAndZoom(n,t);return true}if(m.indexOf("#showimage=")==0){d=d.substr(11);this.displayImageInPopup(d);return false}}if(this.FSIPages.bDebug){this.FSIPages.log("<b>--- Open Link ---</b>:<br/><b>URL: </b>"+d+"<br/><b>Target: </b>"+g,true,0)}if(d.length>1&&c.bFollowLinks){if(this.bDeferToOpener&&window.opener&&window.opener.open!=undefined&&!window.opener.closed){try{if(d.indexOf("javascript:")==0&&g.toLowerCase()=="_self"){window.opener.document.location=d}else{window.opener.window.open(d,g)}}catch(j){if(d.indexOf("javascript:")==0&&g.toLowerCase()=="_self"){document.location=d}else{window.open(d,g)}}}else{if(d.indexOf("javascript:")==0&&g.toLowerCase()=="_self"){document.location=d}else{window.open(d,g)}}}return true},getCoordBounds:function(b){var d;var a={xMin:0,xMax:0,yMin:0,yMax:0};if(b==undefined||b.length<2){return a}a={xMin:1000000000,xMax:-1000000000,yMin:1000000000,yMax:-1000000000};for(var c=0;c<b.length;c+=2){d=b[c];if(d!=undefined){a.xMin=Math.min(d,a.xMin);a.xMax=Math.max(d,a.xMax)}d=b[c+1];if(d!=undefined){a.yMin=Math.min(d,a.yMin);a.yMax=Math.max(d,a.yMax)}}return a},displayImageInPopup:function(e){this.removePopupImage();if(e==undefined||e.length<1){return}var f=this.FSIPages.iConfig.requestBase;if(f!=undefined){f+="?source="}else{f=""}if(e.indexOf("http")!=0){e=f+e;if(e.indexOf("type=image")==-1){if(e.indexOf("?")==-1){e+="?"}else{e+="&"}e+="type=image"}if(e.indexOf("http")!=0){e=f+e}}var d=document.getElementById("FSIPagesMobileButtonOpenLink");if(d){d.style.display="none"}var c='<img id="FSIPopupImageElement" draggable="false" src="'+e+'">';var b=this.FSIPages.iLinkDialog;this.showLinkDialog(c);b.iPanelContent.scroller.scrollTo({x:0,y:0});b.iPanelContent.setScrollable("both");x=(this.getWidth()-b.getWidth())/2;y=(this.getHeight()-b.getHeight())/2;b.setPosition(x,y);var a=this.elImagePopup=document.getElementById("FSIPopupImageElement");if(a){Ext.EventManager.addListener(a,"load",this.onPopupImageLoaded,this);Ext.EventManager.addListener(a,"error",this.onPopupImageLoadError,this)}},onPopupImageLoadError:function(a){Ext.EventManager.removeListener(this,"load",this.onPopupImageLoaded,this);Ext.EventManager.removeListener(this,"error",this.onPopupImageLoadError,this);this.closePopupImage()},onPopupImageLoaded:function(b){Ext.EventManager.removeListener(this,"load",this.onPopupImageLoaded,this);Ext.EventManager.removeListener(this,"error",this.onPopupImageLoadError,this);var c=this.elImagePopup;var a=Math.max(100,Math.min(this.getWidth()-10,c.width+20));var e=Math.max(100,Math.min(this.getHeight()-10,c.height+80));var d=this.FSIPages.iLinkDialog;d.setSize(a,e);d.iPanelContent.scroller.scrollTo({x:0,y:0});x=(this.getWidth()-d.getWidth())/2;y=(this.getHeight()-d.getHeight())/2;d.setPosition(x,y)},removePopupImage:function(){if(this.elImagePopup==undefined){return}var a=this.elImagePopup;Ext.EventManager.removeListener(a,"load",this.onPopupImageLoaded,this);Ext.EventManager.removeListener(a,"error",this.onPopupImageLoadError,this)},closePopupImage:function(){this.removePopupImage();this.hideLinkDialog(true)},onAreaClicked:function(h,k){if(this.FSIPages.currentPanel!=0){return}var m=this.layout.getActiveItem();if(m.tabHoldCount>2){return}k.cancelBubble=true;var a=h.getAttribute("XLinkIndex");if(this.lastDisplayedLinkItemID==a){this.hideLinkDialog(true);return}this.lastDisplayedLinkItemID=a;var f=a.split("_");var l=m.iCacheItem;this.linkDialogCacheItem=l;var n=l.data.arPageData[f[0]];var g=n._data;var j=g.arAreas[f[1]];if(!j){return}var e=j._arShapes[f[2]];var c;if(this.FSIPages.iConfig.ParamForceLinkTip!=undefined){c=this.FSIPages.iConfig.ParamForceLinkTip}else{c=g.decodeToolTip(j.tip)}if(!c||c.length<1){this.followLinkFromLinkDialog();this.lastDisplayedLinkItemID=undefined;return}var b=document.getElementById("FSIPagesMobileButtonOpenLink");if(b){b.style.display=""}var d=this.FSIPages.iLinkDialog;this.showContentCanvas(true,true);this.showLinkDialog(c,k);d.iPanelContent.scroller.scrollTo({x:0,y:0});d.iPanelContent.setScrollable("vertical")},showLinkDialog:function(g,c){var d=this.FSIPages.iLinkDialog;d.iPanelContent.update(g);if(!this.linkDialogVisible){d.show()}this.linkDialogVisible=true;var e=this.getHeight();var b=Ext.is.Phone?260:300;d.setSize(b,Math.min(e,Math.max(250,e/2)));d.iPanelContent.scroller.scrollTo({x:0,y:0});if(c){var a,f;a=(c.pageX>this.getWidth()/2)?10:this.getWidth()-10-d.getWidth();f=(c.pageY>this.getHeight()/2)?10:this.getHeight()-10-d.getHeight();d.setPosition(a,f)}},hideLinkDialog:function(c,a){this.removePopupImage();if(!this.linkDialogVisible){return}this.linkDialogVisible=false;if(this.linkDialogCacheItem!=undefined&&!a){this.showContentCanvas(false,c,this.linkDialogCacheItem)}var b=this.FSIPages.iLinkDialog;b.hide();this.linkDialogCacheItem=undefined;this.lastDisplayedLinkItemID=undefined},hideDialogs:function(){this.hideLinkDialog()},showContentCanvas:function(h,c,j,e){if(j==undefined){j=this.layout.getActiveItem().iCacheItem}if(j==undefined){return}if(!j.data.bCanvasDrawn){if(j.iCreatorInstance.drawCanvas(j)==false){return}if(!j.data.bCanvasDrawn){return}}if(j.data.bCanvasVisible==h){return}j.data.bCanvasVisible=h;var g;if(e){g=0}else{g=(h)?this.linkRGBAActive.webAlpha:this.linkRGBANormal.webAlpha}var d=(c)?"0.65s":"0s";var b=(c)?"opacity":"none";for(var f=0;f<j.data.arContentDivs.length;f++){var a=j.data.arContentDivs[f].style;a.webkitTransitionProperty=b;a.webkitTransitionDuration=d;a.opacity=g}},createLoader:function(){var a=this.getEl();this.loaderDiv=document.createElement("div");this.loaderDiv.setAttribute("class","loading");var b=this.loaderDiv.nodeImage=document.createElement("img");b.setAttribute("src","images/blank.gif");b.setAttribute("class","loading");this.loaderDiv.appendChild(b);a.appendChild(this.loaderDiv)},showLoading:function(a){if(a){this.loaderDiv.nodeImage.setAttribute("src","images/loading.gif");this.loaderDiv.style.display="block"}else{this.loaderDiv.nodeImage.setAttribute("src","images/blank.gif");this.loaderDiv.style.display="none"}},onPageInputFocus:function(a){Ext.NELAStrechEl(false);this.hideDialogs();a.setValue("");var b=a.getEl().dom;Ext.EventManager.addListener(b,"keydown",this.onPageInputSubmit,this)},onPageInputBlur:function(a){Ext.NELAStrechEl(true);a.setValue(this.currentPageText);var b=a.getEl().dom;Ext.EventManager.removeListener(b,"keydown",this.onPageInputSubmit,this)},onPageInputSubmit:function(a){if(a.browserEvent.which!=13){return}var b=this.iFieldPageNumber.getValue();if(b.toLowerCase()=="about"){this.iFieldPageNumber.fieldEl.dom.blur();this.FSIPages.iAboutDialog.show();return}b=this.FSIPages.iConfig.getPageNumberFromString(b)-this.FSIPages.iConfig.firstPageNum+1;this.iFieldPageNumber.fieldEl.dom.blur();this.gotoPageRTL(b,true)},gotoPageAndZoom:function(b,a){if(isNaN(b)){return false}if(a==undefined){a="1,1,0.5,0.5,0.5,0.5"}var c=this.getPageIDFromPanelID(this.layout.nVPos);var d=(this.bDoublePageMode)?c+1:c;this.executeOnceAfterFlipPage=b;this.executeOnceAfterFlipZoom=a;if(c==b||d==b){this.executeAfterFlip()}else{this.gotoPageRTL(b,true)}},setMainToolbar:function(b){this.iMainToolbar=b;var a=this.iMainToolbar.lookupComponent("FSIPagesMobile_currentPageText");if(a!=undefined&&a.setValue!=undefined){this.iFieldPageNumber=a;this.showPageInput=this.FSIPages.getPagesParameter("PageInput",true,true);if(!this.showPageInput){a.hide();this.iMainToolbar.doLayout()}else{this.autoHidePageInput()}a.on({focus:this.onPageInputFocus,blur:this.onPageInputBlur,scope:this});this.iBTNPreviousPage=this.iMainToolbar.lookupComponent("FSIPagesMobile_previouspage");this.iBTNFirstPage=this.iMainToolbar.lookupComponent("FSIPagesMobile_firstpage");this.iBTNLastPage=this.iMainToolbar.lookupComponent("FSIPagesMobile_lastpage");this.iBTNNextPage=this.iMainToolbar.lookupComponent("FSIPagesMobile_nextpage");this.iBTNPreviousPage.disable();if(this.iBTNFirstPage){this.iBTNFirstPage.disable()}if(this.iBTNLastPage){this.iBTNLastPage.disable()}this.iBTNNextPage.disable()}}});Ext.reg("FSIPagesMobilePageView",Ext.FSIPagesMobilePageView);function FSIPagesMobilePlugins(a){this.FSIPages=a;this.listeners=new Object();this.nPluginToInit=-1;this.arPlugins=new Array();this.oPlugins=new Object();this.name="self";this.initPlugins=function(){this.plugins=this.FSIPages.iConfig.plugins;this.arPlugins=new Array();for(var d in this.plugins){var c=this.FSIPages.iConfig.cfg[this.plugins[d].name];var b=this.FSIPages.iConfig.makeBool(c,true);if(b){this.arPlugins.push(this.plugins[d])}}if(this.arPlugins.length==0){this.pluginsReady()}this.nPluginToInit=-1;this.initNextPlugin()};this.addPluginListener=function(c,d,b){if(!d||!c||!c.name||!b){return}if(this.listeners[d]==undefined){this.listeners[d]=new Object()}if(d=="resizetimeout"&&(this.listeners.resize==undefined||this.listeners.resize[this.name]==undefined)){this.addPluginListener(this,"resize",this.onResize)}var e=this.listeners[d];e[c.name]={plugin:c,fn:b}};this.onResize=function(b,c){if(!this.firstResize){this.doResizeTimeout(b,c);this.firstResize=true}else{if(this.timoutResize!=undefined){window.clearTimeout(this.timoutResize)}this.timoutResize=window.setTimeout(this.callResize,1000,this,b,c)}};this.callResize=function(d,b,c){d.doResizeTimeout(b,c)};this.doResizeTimeout=function(b,c){this.callListeners("resizetimeout",b,c)};this.callListeners=function(c){var e=this.listeners[c];if(!e){return}var b=[].splice.call(arguments,0);b.shift();for(o in e){var d=e[o];if(d.plugin&&d.fn){d.fn.apply(d.plugin,b)}}};this.initNextPlugin=function(){this.nPluginToInit++;if(this.nPluginToInit>=this.arPlugins.length){this.pluginsReady();return}var b=this.arPlugins[this.nPluginToInit];this.initPlugin(b)};this.initPlugin=function(b){if(!b||!b.name){return false}if(this.FSIPages.bDebug){this.FSIPages.log("<b>Init Plugin:</b> "+b.name+"<br/><hr/>");this.dumpPluginParameters(b,this.FSIPages.iConfig.cfg)}var d=this.FSIPages.iConfig.getPluginParameter(b.name,"TargetDevice");if(d==undefined){d="mobile"}else{d=d.toLowerCase()}var c=window["FSIPagesMobilePlugin_"+b.name];if(c==undefined||d.indexOf("mobile")==-1){this.initNextPlugin();return}b.plugin=this.oPlugins[b.name]=new c(this,b);if(b.plugin.init==undefined){this.initNextPlugin()}b.plugin.parameter=function(f,e,g){return this.FSIPages.iConfig.getPluginParameter(this.oPluginData.name,f,e,g)};b.plugin.name=b.name;if(b.plugin.init()){this.initNextPlugin()}};this.onPluginReady=function(){this.initNextPlugin()};this.pluginsReady=function(){this.FSIPages.iConfig.pluginsReady()};this.joinCfgAndParams=function(c,j,f){var b=new Object();var h;var d;var e=f.length;f=f.toUpperCase();for(var g in j){b[g]=j[g]}for(var g in c){h=g.toUpperCase();if(h.indexOf(f)==0){d=g.substr(e);b[d]=c[g]}}return b};this.dumpPluginParameters=function(d,b){var c=this.joinCfgAndParams(b,d.parameters,d.name+"_");this.FSIPages.log("#parameters",false,c)};this.destroy=function(){for(var b in this.oPlugins){if(this.oPlugins[b].destroy){this.oPlugins[b].destroy()}}}}function FSIPagesMobilePlugin_chapters(b,a){this.iPlugins=b;this.FSIPages=b.FSIPages;this.oPluginData=a;this.arIndexItems=new Array();this.lastItemAtLevel=new Object();this.init=function(){this.deltaPage=(!this.parameter("useFirstPageNumber",true,true))?0:this.FSIPages.iConfig.firstPageNum-1;this.bUsePageNameAliases=this.parameter("usePageNameAliases",false,true);this.bShowPageNumbers=this.parameter("PageNumbers",true,true);if(this.bShowPageNumbers){this.strPageNumberPrefix=this.parameter("PageNumberPrefix","");this.strPageNumberSuffix=this.parameter("PageNumberSuffix","")}this.iPanel=this.FSIPages.getComponent("ChaptersPanel");if(this.iPanel==undefined){this.iPanel=this.createPanel();this.FSIPages.add(this.iPanel)}var e=this.parameter("indexdata.node");var c=this.parseIndexDataNode(e);if(!c){var d=this.parameter("indexdatafile","");if(d.length>0){this.loadChaptersData(d);return false}return true}return true};this.createPanel=function(){var d='<table class="FSIPagesContentTitle" width="100%"><tr><td style="font-weight:bold">';d+=this.FSIPages.getTranslation("Chapter");d+='</td><td style="font-weight:bold" class="FSIPagesContentPageColumn">';d+=this.FSIPages.getTranslation("page");d+='</td><td class="FSIPagesContentImageColumn">&nbsp;</td></tr></table>';var g=new Ext.Panel({dock:"top",cls:"FSIPagesContentTitle",html:d});var c=[{text:this.FSIPages.getTranslation("Cancel"),ui:"action",cmd:"gotoMainPanelFromChapters",handler:this.FSIPages.tapHandler}];var f=new Ext.Toolbar({ui:"fsi",dock:"bottom",items:c});f.FSIPages=this.FSIPages;var e=new Ext.Panel({id:"ChaptersPanel",iToolBar:f,layout:{type:"vbox",align:"stretch"},defaults:{autoScroll:false,flex:1},dockedItems:[g,f]});return e};this.loadChaptersData=function(g){var d;if(g.toLowerCase()=="auto"){var e=this.FSIPages.iConfig.requestBase+"?source=";var c=this.FSIPages.iConfig.getPagesParameter("dir");d=e+encodeURIComponent(c)+"&type=info&tpl=chapters"}else{d=this.FSIPages.iConfig.getFSIPath(this.FSIPages.iConfig.locationFSIViewer,"pages_xml/"+g)}var f={};this.FSIPages.iConfig.finishRequestParams(f);this.request=Ext.Ajax.request({url:d,overrideMimeType:"application/xml",params:f,method:"GET",scope:this,success:function(h,j){if(h.responseXML){this.parseIndexDataNode(h.responseXML.firstChild)}this.iPlugins.onPluginReady()},failure:function(h,j){this.iPlugins.onPluginReady()}})};this.addIndexItem=function(e,f,c,d,j){var h=new Object();h.label=e;h.page=f;h.color=c;h.downloadfile=d;h.level=j;if(j==0){this.arIndexItems.push(h)}else{var g=this.lastItemAtLevel[j-1];if(g!=undefined){if(g.items==undefined){g.items=new Array()}g.items.push(h)}}this.lastItemAtLevel[j]=h};this.parseIndexDataNode=function(k){if(!k||!k.firstChild){return false}var c=this.FSIPages.iConfig;var h=0;var g=k.firstChild;while(g&&h>-1){if(g.nodeType==1){var e=decodeURIComponent(c.getXMLNodeAttribute(g,"label",""));var j=c.getXMLNodeAttribute(g,"page","");var d=c.getXMLNodeAttribute(g,"color",undefined);var f=c.getXMLNodeAttribute(g,"file",undefined);if(e.length>0){this.addIndexItem(e,j,d,f,h)}}tNode=g.firstChild;if(!tNode){tNode=g.nextSibling;if(!tNode){tNode=g.parentNode.nextSibling;h--}}else{h++}g=tNode}this.setChaptersData(this.arIndexItems);return(this.arIndexItems.length>0)};this.setChaptersData=function(f){if(f.length<1){return}this.formatChaptersItems(f);var d={items:f};Ext.regModel("FSIPagesChaptersListItem",{fields:[{name:"label",type:"string"},{name:"page",type:"string"},{name:"url",type:"string"},{name:"color",type:"string"},{name:"downloadfile",type:"string",name:"html",type:"string"}]});var c=new Ext.data.TreeStore({model:"FSIPagesChaptersListItem",root:d,proxy:{type:"ajax",reader:{type:"tree",root:"items"}}});var e=new Ext.NestedList({toolbar:this.iPanel.iToolBar,useTitleAsBackText:false,updateTitleText:false,dock:"top",displayField:"html",store:c,cls:"x-FSIPagesChapters",_goRoot:function(){this.setCard(0,{type:"slide",duration:0});this.backButton.hide()}});this.FSIPages.iChaptersList=e;e.backButton.cls="fsi";e.on("itemtap",this.onActivateChaptersItem,this);this.iPanel.insert(1,e)};this.formatChaptersItems=function(j){for(var e=0;e<j.length;e++){var k=j[e];if(k.items){this.formatChaptersItems(k.items)}else{k.leaf=true}var f="";if(k.page!=undefined){var h=this.FSIPages.getListItem(k.page-1,true);if(h){var c=this.FSIPages.getPageImageURL(h);if(c){c+="&height=60";f='<img height="60" src="'+c+'">'}}}var d=this.FSIPages.iConfig;var g="";if(this.bShowPageNumbers&&k.items==undefined&&k.page!=undefined&&k.page!=""){var l=k.page;if(this.bUsePageNameAliases){l=d.getPageNumberFromString(l)}else{l=parseInt(l)}if(!isNaN(l)){g=this.strPageNumberPrefix+d.getPageNumberString(l+this.deltaPage)+this.strPageNumberSuffix}}k.html='<table width="100%" height="100%"><tr><td>'+k.label+'</td><td class="FSIPagesContentPageColumn">'+g+'</td><td class="FSIPagesContentImageColumn">'+f+"</td></tr></table>";k.cls="chaptersitem"}};this.onActivateChaptersItem=function(m,f,c,g,d){var l=m.getStore();var n=l.getAt(f);var j=this.FSIPages.iChaptersList;var h=n.get("page");var k=n.get("label");if(!n.node.leaf){this.FSIPages.iChaptersList.backButton.setText(k);return}if(h!=undefined&&h.length>0){this.FSIPages.setCurrentPanel();this.FSIPages.MainView.gotoPageRTL(h,false)}};this.destroy=function(){if(this.FSIPages.iChaptersList!=undefined){this.FSIPages.iChaptersList.un("leafitemtap",this.onActivateChaptersItem,this);this.iPanel.remove(1,true);delete this.FSIPages.iChaptersList}this.FSIPages.remove(this.iPanel,true)}}function FSIPagesMobilePlugin_backgroundimage(b,a){this.iPlugins=b;this.FSIPages=b.FSIPages;this.oPluginData=a;this.arIndexItems=new Array();this.lastItemAtLevel=new Object();this.init=function(){this.firstResize=true;this.bImageInfoComplete=false;var f=this.iPlugins.joinCfgAndParams(this.FSIPages.iConfig.cfg,this.oPluginData.parameters,"backgroundimage_");this.cfg=new Object();f.plugins=undefined;for(var e in f){this.FSIPages.iConfig.setConfigParamByValue(this.cfg,e,f[e])}var c=this.cfg.fpxwidth=parseInt(this.cfg.fpxwidth);var d=this.cfg.fpxheight=parseInt(this.cfg.fpxheigh);if(!isNaN(c)&&c>0&&!isNaN(d)&&d>0&&this.cfg.fpxsrc.length>0){this.bImageInfoComplete=true;this.iPlugins.addPluginListener(this,"resizetimeout",this.onResizeTimeOut)}else{this.FSIPages.iConfig.getImageInfo(this.cfg,this,this.onImageInfoReady)}return this.bImageInfoComplete};this.onImageInfoReady=function(d,f){if(d){var c=this.cfg.fpxwidth;var e=this.cfg.fpxheight;if(!isNaN(c)&&c>0&&!isNaN(e)&&e>0&&this.cfg.fpxsrc.length>0){this.bImageInfoComplete=true}this.iPlugins.addPluginListener(this,"resizetimeout",this.onResizeTimeOut)}else{}this.iPlugins.onPluginReady()};this.onResizeTimeOut=function(n,g){if(!this.bImageInfoComplete){return}if(n<1||g<1){d.backgroundImage="";return}var r=this.cfg.fpxwidth;var p=this.cfg.fpxheight;var q=n/g;var c=r/p;var m="&width="+n;if(q!=c){if(q<c){var l=g*c;var f=1-n/l;m="&height="+g+"&left="+(f/2)+"&right="+(1-f/2)}else{var k=n/c;var f=1-g/k;m="&width="+n+"&top="+(f/2)+"&bottom="+(1-f/2)}}var j=this.FSIPages.iConfig.getImageURL(this.cfg.fpxsrc);j+=m;var e=this.FSIPages.MainView.getEl();if(!e||!e.dom){return}var d=e.dom.style;d.backgroundRepeat="no-repeat";d.backgroundPosition="center";d.backgroundImage="url('"+j+"')"};this.destroy=function(){var d=this.FSIPages.MainView.getEl();if(!d||!d.dom){return}var c=d.dom.style;c.backgroundImage=""}}function FSIPagesMobilePlugin_pageslibrary(b,a){this.iPlugins=b;this.FSIPages=b.FSIPages;this.oPluginData=a;this.arItems=new Array();this.lastItemAtLevel=new Object();this.bShowLabels=true;this.translationPage=this.FSIPages.getTranslation("pages");this.init=function(){var d=this.parameter("library.node");var c=this.parseDataNode(d);this.bShowLabels=this.parameter("showlabels",true,true);if(!c){var e=this.parameter("datafile","");if(e.length>0){this.loadData(e);return false}}this.onDataComplete();return false};this.createPanel=function(){var c=new Ext.FSIPagesMobileThumbnailView({plugin:this,FSIPages:this.FSIPages,centered:true,direction:"horizontal",fixedPageRatio:1,CacheGroupName:"pageslibrarythumbnails",ThumbViewOptions:{thumbHeight:260,thumbSpacingY:40,DoublePageMode:false},initPanelOptions:function(){Ext.FSIPagesMobileThumbnailView.superclass.initPanelOptions.call(this);this.pageVAlignStyle="bottom";this.leftPageHAlignStyle=this.rightPageHAlignStyle="center";this.strPageBackgroundStyle="transparent";this.strPageBorderStyle="0px none"},getInitialPage:function(){return(this.FSIPages.iConfig.bRTL)?this.getListSize():1},getListItem:function(f){var g=this.plugin.arItems[f];g._bIgnoreMargins=true;return g},getListSize:function(){return this.plugin.arItems.length},onSelectPage:function(g){var f=g-1;var h=this.plugin.arItems[f];if(!h||!h.cfg){return}this.FSIPages.setCurrentPanel();this.FSIPages.loadConfig(h.cfg);return true},getThumbText:function(g,h){if(!this.plugin.bShowLabels){return""}var f="";var j=this.plugin.arItems[g];if(!j){return""}if(j.label){f="<b>"+j.label+"</b>"}if(j.imageCount!=undefined){f+="<br/>"+j.imageCount+" "+this.FSIPages.getTranslation("pages")}return f},getInitialHighlightedPage:function(){return undefined}});var e=this.FSIPages.createThumbnailNavToolBar("Library",c);var d=new Ext.Panel({id:"PagesLibraryPanel",layout:{type:"vbox",align:"stretch"},defaults:{autoScroll:false,flex:1},items:[c],dockedItems:[e],MainView:c,iToolbar:e});return d};this.initPanel=function(){this.iPanel.MainView.setupContent()};this.loadData=function(e){var c=this.FSIPages.iConfig.getFSIPath(this.FSIPages.iConfig.locationFSIViewer,"pages_xml/"+e);var d={};this.FSIPages.iConfig.finishRequestParams(d);this.request=Ext.Ajax.request({url:c,params:d,method:"GET",scope:this,success:function(f,g){this.parseDataNode(f.responseXML);this.onDataComplete()},failure:function(f,g){this.onDataComplete()}})};this.parseDataNode=function(h){if(!h||!h.firstChild){return false}var d=this.FSIPages.iConfig;var g=0;var f=h.firstChild;while(f&&g>-1){if(f.nodeType==1&&f.nodeName.toLowerCase()=="item"){var e=decodeURIComponent(d.getXMLNodeAttribute(f,"label",""));var k=d.getXMLNodeAttribute(f,"src","");var c=d.getXMLNodeAttribute(f,"cfg","");if(k.length>0){var j=new Object();j.src=k;j.label=e;j.cfg=c;this.arItems.push(j)}}tNode=f.firstChild;if(!tNode){tNode=f.nextSibling;if(!tNode){tNode=f.parentNode.nextSibling;g--}}else{g++}f=tNode}return(this.arItems.length>0)};this.onDataComplete=function(){if(this.arItems.length>0){this.iPanel=this.FSIPages.getComponent("PagesLibraryPanel");if(this.iPanel==undefined){this.iPanel=this.createPanel();this.FSIPages.add(this.iPanel)}this.loadLibraryInfo();return}this.iPlugins.onPluginReady()};this.loadLibraryInfo=function(){if(this.FSIPages.iConfig.bRTL){this.arItems.reverse()}var e=new Array(this.arItems.length);for(var f=0;f<this.arItems.length;f++){e[f]=encodeURIComponent(this.arItems[f].src)}e=e.join(",");var c=this.FSIPages.iConfig;var d=c.requestBase+"?type=list&profile=overview&source="+e;var g={};this.FSIPages.iConfig.finishRequestParams(g);this.request=Ext.Ajax.request({url:d,params:g,method:"GET",scope:this,success:function(h,j){this.parseInfoData(h.responseText)},failure:function(h,j){this.iPlugins.onPluginReady()}})};this.parseInfoData=function(j){var c;try{c=JSON.parse(j);c.images.pop();for(var d=0;d<c.images.length;d++){var f=this.arItems[d];var h=c.images[d];if(h.src){f.src=h.src}if(h.width){f.width=h.width}if(h.height){f.height=h.height}if(h.imageCount){f.imageCount=h.imageCount}f.id=d}}catch(g){}this.iPlugins.onPluginReady()};this.destroy=function(){}}function FSIPagesMobilePlugin_imprint(b,a){this.iPlugins=b;this.FSIPages=b.FSIPages;this.oPluginData=a;this.init=function(){this.iPanel=this.FSIPages.getComponent("imprint");if(this.iPanel==undefined){this.createPanel()}var d=this.parameter("content");this.bHasData=(d&&d.length>0);if(!this.bHasData){var c=this.parameter("datafile","pages_xml/_sample_imprint.html");if(c.length>0){this.loadContent(c);return false}}if(this.bHasData){this.iPanel.update(d)}return true};this.createPanel=function(){this.iPanel=new Ext.Panel({modal:true,id:"imprint",layout:"fit",styleHtmlContent:"true",floating:true,draggable:false,centered:true,width:380,height:Ext.is.Phone?220:300,scroll:"vertical",title:"Imprint"})};this.loadContent=function(e){var c=this.FSIPages.iConfig.getFSIPath(this.FSIPages.iConfig.locationFSIViewer,e);var d={};this.FSIPages.iConfig.finishRequestParams(d);this.request=Ext.Ajax.request({url:c,params:d,method:"GET",scope:this,success:function(f,g){if(f&&f.responseText&&f.responseText.length>0){this.bHasData=true;this.iPanel.update(f.responseText)}this.iPlugins.onPluginReady()},failure:function(f,g){try{this.FSIPages.log("#error",true,"Loading content file failed ("+f.statusText+"):");this.FSIPages.log(f.request.options.url,true)}catch(h){}this.iPlugins.onPluginReady()}})}}Ext.FSIPagesMobileThumbnailPanel=Ext.extend(Ext.Panel,{centered:true,tabHoldCount:0,onRender:function(b,a){Ext.FSIPagesMobileThumbnailPanel.superclass.onRender.call(this,b,a);this.mon(this.el,{tapstart:this.onTapStart,taphold:this.onTapHold,tapcancel:this.onTapCancel,tap:this.onTap,scope:this})},onTapStart:function(a){this.tabHoldCount=0},onTapHold:function(a){this.tabHoldCount++;if(this.tabHoldCount>1){return}var b=a.target;while(b.FSIPage==undefined&&b.nodeName!="TR"){b=b.parentNode}if(b.FSIPage){this.MainView.highlightPage(b.FSIPage,true)}},onTapCancel:function(a){this.MainView.highlightPage(this.MainView.nHighlightedPage,true)},onTap:function(a){var b=a.target;if(!b){return}while(b.FSIPage==undefined&&b.nodeName!="TR"){b=b.parentNode}if(b.FSIPage){this.MainView.selectPage(b.FSIPage)}a.stopPropagation();return true},setContent:function(f){var a=(this.MainView.layout.getActiveItem()==this);if(this.nPanelIndexLoaded==f){var d=(a==this)?10:5;this.iCacheItem.update(d);return false}else{if(this.nPanelIndexLoaded!=undefined){this.dismissContent()}}this.nPanelIndexLoaded=f;if(this.iCacheItem!=undefined){}var d=(a)?10:5;var b=this.MainView.getPanelContentID(f);this.iCacheItem=this.MainView.iCacheManagerGroup.addItem(this,b,d,f,undefined);if(this.iCacheItem.iDOMElement.parentNode!=undefined){this.iCacheItem.data.iPanel.dismissContent()}this.iCacheItem.data.iPanel=this;if(a){this.MainView.setCurrentVisibleCard(this)}var c=this.getEl().dom.firstChild;try{c.appendChild(this.iCacheItem.iDOMElement)}catch(g){}return true},dismissContent:function(){if(this.nPanelIndexLoaded==undefined){return}this.nPanelIndexLoaded=undefined;this.iCacheItem.setPriority(0);try{this.iCacheItem.iDOMElement.parentNode.removeChild(this.iCacheItem.iDOMElement)}catch(a){}this.iCacheItem.data.iPanel=undefined;this.iCacheItem=undefined;return},onPageImageLoadedError:function(a){a.stopPropagation();this.iFSIPagesCacheItem.onContentLoaded(false);delete this.iFSIPagesCacheItem},onPageImageLoaded:function(a){a.stopPropagation();this.iFSIPagesCacheItem.onContentLoaded(true);delete this.iFSIPagesCacheItem},onCacheManagerRequestCreateDOM:function(g){if(g.data.arImageNodes!=undefined){}var a=this.MainView.getListSize();g.data.arPageData=new Array();var c=this.MainView.oLayout;g.data.contentID=this.nPanelIndexLoaded;g.data.arColumns=new Array();var v=this.MainView.szPage;g.data.szPage={width:v.width,height:v.height};g.data.szPanel={width:v.width,height:v.height};var q=g.data.nodeContainer=this.MainView.getThumbnailTable();var k=this.MainView.szPageImage;var C=v.height+1;var s;var m=this.MainView.getPanelStartIndex(g.data.nPanelIndex);for(var r=0;r<c.rows;r++){var B=(this.FSIPages.iConfig.bRTL)?c.rows-r-1:r;var d=q.childNodes[B].childNodes;for(var p=0;p<c.columns;p++){var b=d[p];if(m<0){m++;continue}oDoublePageInfo=this.MainView.getDoublePageInfo(m);var h=oDoublePageInfo.contentID;if(h>=a){break}b.FSIPage=(h+1);var e=this.MainView.getThumbText(h,oDoublePageInfo);var s=(oDoublePageInfo.bDoublePage)?2*v.width:v.width;s+=this.MainView.nPageBorderOffset;var A=document.createElement("div");A.setAttribute("class","FSIPagesMobilePageThumb");A.style.backgroundColor=this.MainView.strPageBackgroundStyle;A.style.border=this.MainView.strPageBorderStyle;var f=this.MainView.getListItem(oDoublePageInfo.contentID);g.data.arPageData.push(f);var u=v.width;var z=v.height;if(oDoublePageInfo.bDoublePage){u+=v.width;if(f.empty){A.style.textAlign="right"}var w=this.MainView.getListItem(oDoublePageInfo.contentID+1);g.data.szPanel.width+=v.width;if(!w.empty){f.oImageDataRightPage=w}else{}}else{f.oImageDataRightPage=undefined}A.style.width=u+"px";A.style.height=z+"px";b.appendChild(A);g.data.arColumns.push(A);if(e.length>0){var l=document.createElement("div");l.setAttribute("class","FSIThumbLabel");l.style.width=c.finalCellWidth+"px";l.innerHTML=e;b.appendChild(l)}m++}if(h>=a){break}}return q},onCacheManagerRequestDeleteDOM:function(c){if(c.data.arImageNodes!=undefined){for(var b=0;b<c.data.arImageNodes.length;b++){var a=c.data.arImageNodes[b];a.iFSIPagesCacheItem=undefined;a.removeEventListener("load",this.onPageImageLoaded,false);a.removeEventListener("error",this.onPageImageLoadedError,false);a.parentNode.removeChild(a);c.iCacheGroup.iCacheManager.releaseImageNode(a)}}delete c.data.arColumns;delete c.data.arImageNodes},onCacheManagerRequestLoad:function(k){var s;if(k.data.arImageNodes!=undefined){}k.nItemsToLoad=0;k.data.arImageNodes=new Array();var D=this.MainView.szPage;var n=this.MainView.szPageImage;var v,w;for(var B=0;B<k.data.arPageData.length;B++){var u=k.data.arPageData[B];var m=k.data.arColumns[B];var l="";v=n.width;w=n.height;var g=false;var C=u;if(u.src==undefined){if(u.oImageDataRightPage!=undefined&&u.oImageDataRightPage.src!=undefined){C=u.oImageDataRightPage;s=this.FSIPages.getPageImageURL(u.oImageDataRightPage);var c=this.FSIPages.getMatchingImageSize(u.oImageDataRightPage,this.MainView.getPageImageSize(u.oImageDataRightPage));v=c.width;w=c.height}else{s=undefined}}else{if(u.oImageDataRightPage!=undefined&&u.oImageDataRightPage.src!=undefined){g=true;var r=this.FSIPages.getMatchingImageSize(u,n);var q=this.FSIPages.getMatchingImageSize(u.oImageDataRightPage,n);v=2*n.width;w=Math.max(r.height,q.height);var e=D.width/this.FSIPages.pagePadding.factorWidth;var E=this.FSIPages.pageOffsetsEvenPage.right*e;var A=E/r.width;var h=this.FSIPages.pageOffsetsUnevenPage.left*e;var p=h/q.width;v+=Math.round(E+h);s=this.FSIPages.getDoublePageImageURL(u,u.oImageDataRightPage,A,p)}else{s=this.FSIPages.getPageImageURL(u);var c=this.FSIPages.getMatchingImageSize(u,this.MainView.getPageImageSize(u));v=c.width;w=c.height}}if(s!=undefined){s+=l+"&width="+v+"&height="+w;var a=k.iCacheGroup.iCacheManager.getImageNode();var f=this.MainView.getPageImagePadding(u,this.MainView.szPage);var z=f.left;var d=f.top;var b=(u._bIgnoreMargins)?this.MainView.szPage:this.MainView.szPageImage;if(!C._bAutoCrop){switch(this.MainView.pageVAlignStyle){case"middle":d+=(b.height-w)/2;break;case"bottom":d+=b.height-w;break}if(!g){var j=(u.evenPage)?this.MainView.leftPageHAlignStyle:this.MainView.rightPageHAlignStyle;switch(j){case"center":z+=(b.width-v)/2;break;case"right":z+=b.width-w;break}}}if(z!=0){a.style.marginLeft=Math.round(z)+"px"}if(d!=0){a.style.marginTop=Math.round(d)+"px"}a.setAttribute("class","FSIPagesMobileImage");a.addEventListener("load",this.onPageImageLoaded,false);a.addEventListener("error",this.onPageImageLoadedError,false);a.setAttribute("src",s);a.iFSIPagesCacheItem=k;m.appendChild(a);k.data.arImageNodes.push(a);k.nItemsToLoad++}}return true},onCacheManagerRequestUnload:function(a){return true},onCacheItemCallsDataReady:function(a){if(a.id!=this.iCacheItem.id){return}}});Ext.reg("FSIPagesMobileThumbnailPanel",Ext.FSIPagesMobileThumbnailPanel);Ext.FSIPagesMobileThumbnailView=Ext.extend(Ext.FSIPagesMobileCarousel,{iCacheManagerGroup:undefined,oDisabledNavButtons:{},strContentID:"",bDoublePageMode:false,szPage:{width:0,height:0},highlightedPageIndex:undefined,bNavigationEnabled:true,ThumbViewOptionDefaults:{thumbHeight:135,thumbSpacingX:10,thumbSpacingY:20,DoublePageMode:true},initComponent:function(){Ext.FSIPagesMobileThumbnailView.superclass.initComponent.call(this);if(typeof(this.ThumbViewOptions)!="object"){this.ThumbViewOptions=new Object()}for(var a in this.ThumbViewOptionDefaults){if(this.ThumbViewOptions[a]==undefined){this.ThumbViewOptions[a]=this.ThumbViewOptionDefaults[a]}}this.iCacheManagerGroup=this.FSIPages.iCacheManager.createGroup(this.CacheGroupName,500,3,10)},onDestroy:function(){this.removeContent();this.iCacheManagerGroup.flushAll();Ext.FSIPagesMobileThumbnailView.superclass.onDestroy.call(this,arguments)},removeContent:function(){this.removeHighlight();Ext.FSIPagesMobileThumbnailView.superclass.removeContent.call(this,arguments)},removeAll:function(a){Ext.FSIPagesMobileThumbnailView.superclass.removeAll.call(this,arguments);this.enableNavigation(false)},getPanelContentID:function(a){var b=this.contentID;b+="_"+this.CacheGroupName+"_"+a;b+="_"+this.szPage.width;b+="x"+this.szPage.height;b+="_"+this.oLayout.rows;b+="x"+this.oLayout.columns;return b},selectPage:function(a){if(this.onSelectPage(a)){this.onExitView()}},autoHideNavigation:function(){if(!this.bNavigationEnabled){return}var b=this.ownerCt.iToolbar;var c=this.getButtonByName("ButtonGoFirst");if(!b||!c){return}var a=(b.getWidth()>415);if(a!=c.isVisible()){c.setVisible(a);c=this.getButtonByName("ButtonGoLast");c.setVisible(a);b.doLayout()}this.updateNavToolBar(this.ownerCt.iToolbar,this.layout.nVPos,this.layout.nVSize)},enableNavigation:function(a){if(this.bNavigationEnabled==a){return}this.bNavigationEnabled=a;this.showButtonByName("ButtonGoNext",a);this.showButtonByName("ButtonGoFirst",a);this.showButtonByName("ButtonGoLast",a);this.showButtonByName("ButtonGoPrevious",a);this.ownerCt.iToolbar.doLayout();this.updateNavToolBar(this.ownerCt.iToolbar,this.layout.nVPos,this.layout.nVSize)},getButtonByName:function(b){var a=this.ownerCt;var c=a.iToolbar.myName;return a.iToolbar.getComponent(c+b)},enableButtonByName:function(b,a){if(this.oDisabledNavButtons[b]==a){return}this.oDisabledNavButtons[b]=a;var c=this.getButtonByName(b);if(!c){return}if(a){c.enable()}else{c.disable();c.el.removeClass("x-button-pressed")}},showButtonByName:function(b,a){var c=this.getButtonByName(b);if(!c){return}if(a){c.show()}else{c.hide()}},onExitView:function(){this.removeCurrentContent();this.iCacheManagerGroup.flushToMin()},getThumbRTLOffset:function(){if(this.oLayout.bRTL){var a=this.getPagePanelCount();var b=(a%this.oLayout.cellsPerPage);if(b!=0){this.oLayout.thumbOffsetRTL=this.oLayout.cellsPerPage-b}else{this.oLayout.thumbOffsetRTL=0}}else{this.oLayout.thumbOffsetRTL=0}},getContentID:function(){return this.FSIPages.MainView.contentID},setContent:function(c,b){this.removeHighlight();this.removeContent();this.contentID=c;this.setDoublePageMode(this.bGlobalDoublePageMode,true);this.getThumbRTLOffset();var a;if(b!=undefined&&!isNaN(b)){a=this.getPanelIDFromPageID(b)}Ext.FSIPagesMobileThumbnailView.superclass.setContent.call(this,c,a)},createPagePanel:function(c,b){var a=new Ext.FSIPagesMobileThumbnailPanel({autoDestroy:false,cls:"x-FSIPagesMobilePagePanel"});a.FSIPages=this.FSIPages;a.MainView=this;return a},afterRender:function(){Ext.FSIPagesMobileThumbnailView.superclass.afterRender.apply(this,arguments);if(this.scroll){this.scroller.on("scrollend",this.onAfterPageTurn,this)}this.getEl().addCls("FSIPagesMobileThumbnails");this.updateNavToolBar(this.ownerCt.iToolbar,0,0);this.enableNavigation(false)},updateNavToolBar:function(e,d,c){if(e==undefined||e.navButtons==undefined){return}if(c<2){this.enableButtonByName("ButtonGoNext",false);this.enableButtonByName("ButtonGoFirst",false);this.enableButtonByName("ButtonGoLast",false);this.enableButtonByName("ButtonGoPrevious",false)}else{var b=(d!=c-1);var a=(d>0);this.enableButtonByName("ButtonGoNext",b);this.enableButtonByName("ButtonGoFirst",a);this.enableButtonByName("ButtonGoLast",b);this.enableButtonByName("ButtonGoPrevious",a)}},onAfterPageTurn:function(){this.updateNavToolBar(this.ownerCt.iToolbar,this.layout.nVPos,this.layout.nVSize);Ext.FSIPagesMobileThumbnailView.superclass.onAfterPageTurn.call(this)},calculateSize:function(b){if(this.pageRatioWH==undefined){return}var c=this.oLayout.thumbHeight;var a=Math.round(c*this.pageRatioWH);this.szPage={width:a,height:c};this.szPageImage={width:Math.floor(a/this.FSIPages.pageOffsets.pageImagefactorWidth),height:Math.floor(c/this.FSIPages.pageOffsets.pageImagefactorHeight)};this.setDoublePageMode(this.bGlobalDoublePageMode,false)},onMakeVisible:function(a){this.FSIPages.enableScrollBar(this.scroller,a);this.bResizeLocked=!a;this.onResize()},doResize:function(){if(this.bResizeLocked){return false}if(this.contentID==undefined){return false}var a=this.getPanelFirstPageIndex(this.layout.nVPos,this.oLayout.bRTL);this.setupContent(a);return true},setDoublePageMode:function(f,e){var c;var b=(this.bDoublePageMode!=f);this.bDoublePageMode=f;if(this.contentID==undefined){return}if(!b&&!e){return}var d;var a=this.getDoublePageInfo(0);if(!f){c=this.getListSize();if(b&&!e){if(a.bStartsWithSinglePage){d=Math.max(0,2*this.layout.nVPos-1)}else{d=2*this.layout.nVPos}}}else{if(a.bStartsWithSinglePage){c=1+Math.floor(this.getListSize()/2);if(b&&!e){d=Math.ceil(this.layout.nVPos/2)}}else{c=Math.ceil(this.getListSize()/2);if(b&&!e){d=Math.floor(this.layout.nVPos/2)}}}a=this.getDoublePageInfo(0);this.bStartsWithSinglePage=a.bStartsWithSinglePage;this.layout.setVSize(Math.ceil(c/this.oLayout.cellsPerPage));this.getThumbRTLOffset();if(d!=undefined){this.gotoPanel(d,false)}},getListItem:function(a){return this.FSIPages.getListItem(a)},getPanelIDFromPageID:function(a){if(this.oLayout.thumbOffsetRTL!=0){a+=(this.bGlobalDoublePageMode)?2*this.oLayout.thumbOffsetRTL:this.oLayout.thumbOffsetRTL}if(typeof(a)!="number"){a=parseInt(a)}if(isNaN(a)){return"error"}var a=Math.max(1,Math.min(this.getListSize(),a));var b;if(!this.bGlobalDoublePageMode){b=Math.floor((a-1)/this.oLayout.cellsPerPage)}else{var c=a;if(!this.bStartsWithSinglePage){c--}b=Math.floor(c/2/this.oLayout.cellsPerPage)}return b},getPanelFirstPageIndex:function(b,a){var c=this.getPanelStartIndex(b);if(a){c+=this.oLayout.cellsPerPage-1}if(this.bGlobalDoublePageMode){c*=2;if(this.bStartsWithSinglePage&&c>0){c--}}return c+1},getPanelStartIndex:function(a){var b=a*this.oLayout.cellsPerPage-this.oLayout.thumbOffsetRTL;return b},getPagePanelCount:function(){if(!this.bDoublePageMode){return this.getListSize()}else{var a=this.getListSize();if(this.bStartsWithSinglePage){a++}return Math.ceil(a/2)}},getPanelDOM:function(b){var a=this.getPanelContentID(b);var c=this.iCacheManagerGroup.getItem(a);if(c==undefined||c.iDOMElement==undefined){return}return c.iDOMElement},removeHighlight:function(){if(this.highlightedPageIndex!=undefined){this.doHighlightPage(this.highlightedPageIndex,false);this.highlightedPageIndex=undefined}},highlightPage:function(a,b){if(this.highlightedPageIndex!=undefined&&this.highlightedPageIndex==a){return}if(this.highlightedPageIndex!=undefined){this.doHighlightPage(this.highlightedPageIndex,false)}this.highlightedPageIndex=undefined;this.highlightedPageIndex=this.doHighlightPage(a,b)},doHighlightPage:function(c,g){var e=this.getPanelIDFromPageID(c);var b=this.getPanelDOM(e);if(b==undefined||b.nodeName!="TABLE"){return}var m=b.childNodes;for(var d=0;d<m.length;d++){var l=m[d];var k=l.childNodes;for(var a=0;a<k.length;a++){if(k[a].FSIPage==c){var f;var h=k[a].getAttribute("class");if(g){f=c;h=h.split(" ")[0];h=[h];h.push("highlighted");h=h.join(" ");k[a].setAttribute("class",h)}else{h=h.split(" ")[0];k[a].setAttribute("class",h)}return f}}}},setupLayout:function(){if(this.tableTemplate){this.FSIPages.destroyDOMNode(this.tableTemplate);delete this.tableTemplate}this.oLayout=new Object();this.oLayout.thumbHeight=this.FSIPages.getProportionalSize(this.ThumbViewOptions.thumbHeight);this.oLayout.thumbWidth=Math.ceil(this.oLayout.thumbHeight*this.pageRatioWH);if(this.bGlobalDoublePageMode){this.oLayout.tableWidth=2*this.oLayout.thumbWidth}else{this.oLayout.tableWidth=this.oLayout.thumbWidth}this.oLayout.tableWidth+=2*this.ThumbViewOptions.thumbSpacingX;this.oLayout.tableHeight=this.oLayout.thumbHeight+10;this.oLayout.rowHeight=this.oLayout.thumbHeight;this.oLayout.totalRowHeight=this.oLayout.rowHeight+this.ThumbViewOptions.thumbSpacingY;this.oLayout.columns=Math.max(1,Math.floor(this.getWidth()/this.oLayout.tableWidth));this.oLayout.rows=Math.max(1,Math.floor(this.getHeight()/this.oLayout.totalRowHeight));this.oLayout.finalRowHeight=Math.floor(this.getHeight()/this.oLayout.rows);this.oLayout.finalCellWidth=Math.floor(this.getWidth()/this.oLayout.columns);this.oLayout.bRTL=this.FSIPages.iConfig.bRTL;this.oLayout.cellsPerPage=this.oLayout.rows*this.oLayout.columns},getThumbnailTable:function(){if(this.tableTemplate!=undefined){return this.tableTemplate.cloneNode(true)}var e=this.oLayout;var c=document.createElement("table");c.setAttribute("class","FSIPagesMobileThumbnails");var d=document.createElement("tr");d.style.height=e.finalRowHeight+"px";var b=document.createElement("td");b.setAttribute("class","FSIPagesMobileThumbnails");b.style.width=e.finalCellWidth+"px";for(var a=0;a<e.columns;a++){d.appendChild(b.cloneNode(true))}for(var a=0;a<e.rows;a++){c.appendChild(d.cloneNode(true))}this.tableTemplate=c;return this.tableTemplate.cloneNode(true)},setupContent:function(b){var d=(this.contentID==undefined||this.contentID!=this.getContentID());if(d){this.initPanelOptions()}var f=true;if(this.oLayout){var e=this.oLayout.rows;var a=this.oLayout.columns}this.bGlobalDoublePageMode=this.ThumbViewOptions.DoublePageMode;if(this.fixedPageRatio==undefined){this.pageRatioWH=this.FSIPages.MainView.pageRatioWH}else{this.pageRatioWH=this.fixedPageRatio}this.setupLayout();if(this.oLayout){f=(e!=this.oLayout.rows||a!=this.oLayout.columns)}this.getThumbRTLOffset();this.calculateSize();this.nHighlightedPage=this.getInitialHighlightedPage();if(b!=undefined){this.nCurrentPage=b}else{this.nCurrentPage=this.getInitialPage()}if(!d&&!f){var c=0;if(this.nCurrentPage!=undefined&&!isNaN(this.nCurrentPage)){c=this.getPanelIDFromPageID(this.nCurrentPage)}this.gotoPanel(c,false)}else{this.setContent(this.getContentID(),this.nCurrentPage)}this.highlightPage(this.nHighlightedPage,true);this.enableNavigation(this.layout.nVSize>1)}});Ext.reg("Ext.FSIPagesMobileThumbnailView",Ext.FSIPagesMobileThumbnailView);Ext.FSIPagesMobileSearchView=Ext.extend(Ext.FSIPagesMobileThumbnailView,{curSearchValue:"",strSearchTextDefault:"",strSearchResults:"",strLoading:"",nTimerID:null,useMethodGet:false,iInput:null,bDefaultValueText:false,bEmpty:false,nLastSelectedItem:-1,nLastSelectedPage:-1,bSortResults:false,strResultTemplate:"",strSearchType:"",strSearchContext:"",searchParameters:undefined,strConfigContentID:undefined,strSearchResultClickAction:"",bAutoExactMatch:false,strSearchQueryTemplate:undefined,strSearchCustomValue:undefined,strSearchCustomURL:undefined,bGetJSONResult:false,arPageList:[],ThumbViewOptions:{DoublePageMode:false},afterRender:function(){Ext.FSIPagesMobileSearchView.superclass.afterRender.apply(this,arguments);this.getAttributeValue=this.FSIPages.iConfig.getAttributeValue;if(!this.bInitDone){this.bInitDone=true;this.iTextResults=this.iSearchbar.lookupComponent("searchresulttext");this.iInput=this.iSearchbar.lookupComponent("FSIPagesMobile_searchText");this.iInput.on({focus:this.onInputFocus,blur:this.onInputBlur,keyup:this.onInputKeyUp,change:this.onInputKeyUp,scope:this});var a=this.iInput.getEl().dom;Ext.EventManager.addListener(a,"keydown",this.onInputSubmit,this)}},searchFor:function(a){if(!this.iInput==undefined){return}this.setInputDefaultText(false);this.iInput.setValue(a);this.getResult()},resetSearch:function(a){if(this.curSearchValue==""){return}this.nLastSelectedItem=nLastSelectedPage=-1;this.clearResults();this.curSearchValue="";if(!a){this.iInput.setValue("")}this.iTextResults.update("")},setEmpty:function(a){if(a==this.bEmpty){return}this.bEmpty=a;if(a){this.getEl().addCls("searchEmpty");this.iTextResults.update("")}else{this.getEl().removeClass("searchEmpty")}},clearResults:function(){this.removeContent();this.arPageList=new Array();this.setEmpty(true)},onMakeVisible:function(a){Ext.FSIPagesMobileSearchView.superclass.onMakeVisible.apply(this,arguments);if(!a){this.iInput.blur();if(this.nTimerID!=null){window.clearTimeout(this.nTimerID)}this.nTimerID=null}else{if(this.strConfigContentID!=this.FSIPages.MainView.contentID){this.strConfigContentID=this.FSIPages.MainView.contentID;this.strSearchCustomURL=this.FSIPages.getPagesParameter("SearchCustomURL");this.strSearchCustomValue=this.FSIPages.getPagesParameter("SearchCustomValue");this.useMethodGet=this.FSIPages.getPagesParameter("SearchUseMethodGet",false,true);this.bSortResults=this.FSIPages.getPagesParameter("SearchSortResults",false,true);this.strResultTemplate=this.FSIPages.getPagesParameter("SearchResultServerTemplate","pages_searchresult");if(this.strSearchCustomURL==undefined&&this.strResultTemplate=="pages_searchresult"){this.bGetJSONResult=true;this.strResultTemplate="pages_searchresult_json"}else{this.bGetJSONResult=false}this.strSearchType=this.FSIPages.getPagesParameter("SearchType","simplesearch");if(this.strSearchType=="simplesearch"){this.strSearchContext=this.FSIPages.getPagesParameter("SearchContext","iptc.fsi_search_data,iptc.caption")}else{this.strSearchContext=undefined}this.strSearchResultClickAction=this.FSIPages.getPagesParameter("SearchResultClickAction","");this.bAutoExactMatch=this.FSIPages.getPagesParameter("SearchAutoExactMatch",false,true);this.strSearchQueryTemplate=this.FSIPages.getPagesParameter("SearchQueryTemplate");var b=this.FSIPages.getPagesParameter("SearchParameters","");if(b.length>0){if(b.indexOf("?")==-1){b="?"+b}this.searchParameters={};this.FSIPages.iConfig.parseQuery(b,this.searchParameters)}else{this.searchParameters=undefined}this.strSearchTextDefault=this.FSIPages.getTranslation("PagesSearchButton");this.strSearchResults=this.FSIPages.getTranslation("matches");this.strLoading=this.FSIPages.getTranslation("loading")}if(this.iInput.getValue()==""){this.setInputDefaultText(true)}if(Ext.is.Desktop){this.iInput.focus()}if(this.getListSize()>0){this.setupContent(this.nLastSelectedItem);this.setEmpty(false)}else{this.setEmpty(true)}}},onSelectPage:function(a){var b=this.getListItem(a-1);if(!b||b.id==undefined){return}this.FSIPages.setCurrentPanel();a=(b.id+1);switch(this.strSearchResultClickAction){case"zoom":this.FSIPages.MainView.gotoPageAndZoom(a);break;default:this.FSIPages.MainView.gotoPage(a,false,true)}this.nLastSelectedItem=a;this.nLastSelectedPage=b.id+1;return true},getInitialPage:function(){return 1},getListItem:function(a){var b=this.arPageList[a];return b},getListSize:function(){return this.arPageList.length},setInputDefaultText:function(b){this.bDefaultValueText=b;var a=this.iInput.getEl();if(a&&a.first!=undefined){a=a.first()}if(b){this.iInput.setValue(this.strSearchTextDefault);a.addCls("defaultText");this.iTextResults.update("")}else{a.removeClass("defaultText")}},onInputFocus:function(a){if(this.bDefaultValueText){this.setInputDefaultText(false);a.setValue("")}},onInputBlur:function(a){if(a.getValue()==""){this.setInputDefaultText(true)}},onInputSubmit:function(a){if(a.browserEvent.which!=13){return}if(this.nTimerID!=null){window.clearTimeout(this.nTimerID)}this.getResult();this.iInput.blur()},onInputKeyUp:function(b,a){if(this.bDefaultValueText&&this.iInput.getValue()!=this.strSearchTextDefault){this.setInputDefaultText(false)}if(this.nTimerID!=null){window.clearTimeout(this.nTimerID)}this.nTimerID=Ext.defer(this.getResult,1000,this)},getResult:function(){if(this.bDefaultValueText){return}var a="";if(this.iInput){a=this.iInput.getValue()}if(a.length>1&&a!=this.curSearchValue){this.curSearchValue=a;this.requestResult(a)}else{if(a.length==0){this.resetSearch(true)}}},requestResult:function(f){var e;var a;this.iTextResults.update(this.strLoading);if(this.bAutoExactMatch){f='"'+f+'"'}if(this.strSearchCustomURL==undefined){a=this.FSIPages.iConfig.requestBase;e={type:this.strSearchType,tpl:this.strResultTemplate,limit:"0,"+this.FSIPages.getListSize(),source:this.FSIPages.dir};if(this.strSearchType=="simplesearch"){e.context=this.strSearchContext}}else{a=this.strSearchCustomURL;e={cmd:"search",src:this.FSIPages.dir,vtl:this.strResultTemplate,page:1,rows:512,cols:4}}e.headers={};if(this.bGetJSONResult){e.headers.Accept="application/json"}else{e.headers.Accept="application/xml"}if(this.strSearchCustomValue!=undefined){e.customvalue=this.strSearchCustomValue}if(this.strSearchQueryTemplate!=undefined){var b={};var d=this.strSearchQueryTemplate.replace(/%%searchtext%%/g,f);if(d.indexOf("?")==-1){d="?"+d}this.FSIPages.iConfig.parseQuery(d,b);for(var c in b){e[c]=b[c]}}else{e.query=f}if(this.searchParameters!=undefined){for(var c in this.searchParameters){e[c]=this.searchParameters[c]}}this.FSIPages.iConfig.finishRequestParams(e);this.request=Ext.Ajax.request({url:a,params:e,method:(this.useMethodGet)?"GET":"POST",scope:this,success:function(g,h){this.onResultsLoaded(g);delete this.request},failure:function(g,h){this.onResultsLoaded(null);delete this.request}})},getContentID:function(){return this.FSIPages.MainView.contentID+"_search:"+this.curSearchValue},pageNumSort:function(d,c){return d.id-c.id},parseXMLResult:function(f,b){if(!f||!f.firstChild){return false}var d=this.FSIPages.iConfig.findXMLNode(f,"results");if(!d){return true}var a=d.childNodes;var g,d,e;for(var c=0;c<a.length;c++){d=a[c];if(d.nodeType!=1){continue}g=this.getAttributeValue(d,"searchID");if(g==undefined){continue}if(g.charAt(0)=="/"){g=g.substr(1)}b.push(g)}return true},onResultsLoaded:function(b){var d=[];this.nLastSelectedItem=nLastSelectedPage=-1;if(b!=null){if(!b.responseXML){try{var a=JSON.parse(b.responseText);a.results.pop();d=a.results}catch(h){}}else{var c=this.parseXMLResult(b.responseXML,d);if(!c){this.FSIPages.log("#error",true,"Failed to parse search result XML:");try{this.FSIPages.log(b.request.options.url)}catch(h){}}}}this.arPageList=[];if(d.length>0){for(var g=0;g<d.length;g++){var f=this.FSIPages.getPageListItemBySrc(d[g]);if(f!=undefined){this.arPageList.push(f)}else{console.log("NOT FOUND: "+d[g])}}}if(this.arPageList.length>0){if(this.bSortResults){this.arPageList.sort(this.pageNumSort)}this.setEmpty(false);this.setupContent()}else{this.clearResults()}this.iTextResults.update(this.arPageList.length+" "+this.strSearchResults)},getInitialHighlightedPage:function(){return this.nLastSelectedItem},getThumbText:function(b,c){var a="";var d=this.getListItem(b);if(d&&d.id!=undefined){a=this.FSIPages.getDoublePageText(d.id,c)}return a}});Ext.reg("Ext.FSIPagesMobileSearchView",Ext.FSIPagesMobileSearchView);