var V3;
if(!V3){V3={__namespace:true};}
(function(V3){ //AUTO-GENERATED-DO NOT MODIFY 
"use strict";if(typeof Object.getPrototypeOf!=="function"){if(typeof"test".__proto__==="object"){Object.getPrototypeOf=function(a){return a.__proto__}}else{Object.getPrototypeOf=function(a){return a.constructor.prototype}}}if(!Function.prototype.bind){Function.prototype.bind=function(d,c,a,b){if(typeof this!=="function"){throw new Error("Function.prototype.bind - what is trying to be bound is not callable")}var h=Array.prototype.slice.call(arguments,1),g=this,e=function(){},f=function(){return g.apply(this instanceof e&&d?this:d,h.concat(Array.prototype.slice.call(arguments)))};e.prototype=this.prototype;f.prototype=new e();return f}}if(!Array.prototype.forEach){Array.prototype.forEach=function(c){if(this===void 0||this===null){throw new TypeError()}var e=Object(this);var a=e.length>>>0;if(typeof c!=="function"){throw new TypeError()}var b=arguments.length>=2?arguments[1]:void 0;for(var d=0;d<a;d++){if(d in e){c.call(b,e[d],d,e)}}}}var V3;(function(V3,window){if(V3.RegisterFile){return}if(!window.Break){window.Break=function(){eval("debugger")}}if(!V3.Log){var fsafe=function(msg){setTimeout(function(){throw msg},1)};var c=window.console,vs=window.intellisense;V3.Log={Debug:function(msg){try{c.debug(msg);if(vs){vs.logMessage("   DBUG: "+msg)}}catch(e){fsafe("Debug: "+msg)}},Info:function(msg){try{c.info(msg);if(vs){vs.logMessage("   INFO: "+msg)}}catch(e){fsafe("Info : "+msg)}},Warn:function(msg){try{c.warn(msg);if(vs){vs.logMessage("   WARN: "+msg)}}catch(e){fsafe("Warn : "+msg)}},Error:function(msg){try{c.error(msg);if(vs){vs.logMessage("   ERRR: "+msg)}}catch(e){fsafe("Error: "+msg)}}}}V3.isDebuggerAttached=function(){if(typeof window.__BROWSERTOOLS_CONSOLE!=="undefined"){V3.isDebuggerAttached=function(){return true};return true}else{V3.isDebuggerAttached=function(){return false};return false}};var loadedScripts={css:{},js:{}};var loadFile=function(id,url,filetype,lowPriority,numberOfCssIncludesToSkip){if(loadedScripts[filetype][id]){return true}if(filetype=="js"){var eScript=document.createElement("script");eScript.type="text/javascript";eScript.async=false;eScript.setAttribute("addedbyjs","true");eScript.src=url;eScript.onload=function(){setTimeout(function(){if(!_registeredFiles[id]||!_registeredFiles[id].IsLoaded){V3.RegisterFile(id,0,null,function(){})}},0)};document.getElementsByTagName("head")[0].appendChild(eScript)}else{if(filetype=="css"){if(document.createStyleSheet){var index=numberOfCssIncludesToSkip;if(lowPriority){document.createStyleSheet(url,numberOfCssIncludesToSkip)}else{document.createStyleSheet(url)}}else{var head=document.getElementsByTagName("head")[0];var link=document.createElement("link");link.href=url;link.type="text/css";link.rel="stylesheet";link.setAttribute("addedbyjs","true");var hasBeenAdded=false;if(lowPriority&&head.childNodes.length>0){var skipCount=0;for(var i=0;i<head.childNodes.length;i++){var child=head.childNodes[i];var tagName=(child.tagName+"").toLowerCase();if(tagName=="style"||(tagName=="link"&&child.type=="text/css")){if(skipCount++>=numberOfCssIncludesToSkip){head.insertBefore(link,child);hasBeenAdded=true;break}}}}if(!hasBeenAdded){head.appendChild(link)}}}}loadedScripts[filetype][id]=true;return false};var _registeredFiles={};var _awaitingFiles=[];var _registeredAsyncModules={};var _detectErrorTimerId=null;var fireIfReady=function(e){var isLoadingAsyncModules=false;for(var i=0;i<e.Files.length;i++){var file,ver;if(typeof e.Files[i]==="string"){file=e.Files[i];ver=null}else{file=e.Files[i].Filename||e.Files[i].FileName;ver=e.Files[i].Version}if(_registeredAsyncModules[file]&&!_registeredAsyncModules[file].IsLoading){loadFile(file,_registeredAsyncModules[file].Url,"js");_registeredAsyncModules[file].IsLoading=true;isLoadingAsyncModules=true}else{if(!_registeredFiles[file]||!_registeredFiles[file].IsLoaded){if(V3.debugMode||window.vsDesignTime){V3.Log.Debug("Deferred '"+e.CallbackName+"' because of '"+file+"' Version: "+(ver||"*"))}return false}if(ver&&_registeredFiles[file].Version<ver){return false}}}if(isLoadingAsyncModules){return false}if(window.vsDesignTime){intellisense.logMessage("Trying to load '"+e.CallbackName+"'...")}try{V3._currentlyLoadingModule=e;e.Callback.apply(window,[V3])}catch(error){V3.Log.Error("CRITICAL ERROR thrown while trying to load registered file "+e.CallbackName+". "+error,"error",error)}delete V3._currentlyLoadingModule;return true};V3.WaitForFiles=function(arrFiles,optionalCallbackName,optionalIsOptional,fCallback){if(arguments.length===2){fCallback=arguments[1];optionalCallbackName=null;optionalIsOptional=false}else{if(arguments.length==3){fCallback=arguments[2];if(typeof arguments[1]==="boolean"){optionalIsOptional=arguments[1];optionalCallbackName=null}else{optionalIsOptional=false}}}var awaitingEntry={Files:arrFiles,Callback:fCallback,CallbackName:optionalCallbackName,IsOptional:optionalIsOptional,toString:function(){return this.CallbackName}};if(fireIfReady(awaitingEntry)){return true}else{_awaitingFiles.push(awaitingEntry);return false}};V3.RegisterFile=function(filename,version,optionalDependencyArray,fCallback){var arrDependencies=optionalDependencyArray;if(arguments.length<3){throw new Error("must specify filename, version and fCallback")}if(arguments.length==3){fCallback=arguments[2];arrDependencies=null}if(window.vsDesignTime){intellisense.logMessage("V3.RegisterFile called for '"+filename+"'.")}if(typeof filename!=="string"||filename===""){throw new Error("filename must be specified")}if(typeof version!=="number"||!isFinite(version)){throw new Error("version must be a finite number")}if(typeof fCallback!=="function"){throw new Error("fCallback must be a function")}if(_registeredFiles[filename]){V3.Log.Warn('Registered multiple times into the DOM! Name="'+filename+'"');return}_registeredFiles[filename]={Name:filename,Version:version,IsLoaded:false};if(!V3.WaitForFiles(arrDependencies||[],filename,fCallback.bind(window))){if(V3.debugMode){V3.Log.Debug("Current awaiting count ("+_awaitingFiles.length+"): "+compileString(_awaitingFiles))}}else{V3.Log.Info('Loaded "'+filename+'".');_registeredFiles[filename].IsLoaded=true;if(_awaitingFiles.length>0){for(var i=0;i<_awaitingFiles.length;i++){var awaitingEntry=_awaitingFiles[i];if(fireIfReady(awaitingEntry)){V3.Log.Info("Loaded '"+awaitingEntry.CallbackName+"' (was deferred).");_awaitingFiles.splice(i,1);if(_registeredFiles[awaitingEntry.CallbackName]){_registeredFiles[awaitingEntry.CallbackName].IsLoaded=true}i=-1}}}if(V3.debugMode){V3.Log.Debug("Current awaiting count ("+_awaitingFiles.length+"): "+compileString(_awaitingFiles))}}if(_detectErrorTimerId){clearTimeout(_detectErrorTimerId);_detectErrorTimerId=null}if(_awaitingFiles.length>0){_detectErrorTimerId=setTimeout(function(){Break();var blockingDependencies=[];_awaitingFiles.forEach(function(awaitingEntry){awaitingEntry.Files.forEach(function(dependency){var dependencyKey=dependency.FileName||dependency.Filename||dependency;var r=_registeredFiles[dependencyKey];if(!r&&(!dependency.Version||r.Version<dependency.Version)){var awaitingFileHasCallbackName=false;for(var i=0;i<_awaitingFiles.length;i++){if(_awaitingFiles[i].CallbackName===dependencyKey){awaitingFileHasCallbackName=true;break}}if(!awaitingFileHasCallbackName){blockingDependencies.push(dependencyKey);return false}}});if(blockingDependencies.length>0){return false}});if(_awaitingFiles.every(function(e){return e.IsOptional})){V3.Log.Info("Framework loadup halted by optional "+_awaitingFiles.join(",")+" because of dependencie(s): "+blockingDependencies.join(","),"blockingDependencies",blockingDependencies)}else{V3.Log.Error("Framework loadup halted "+_awaitingFiles.join(",")+" because of dependencie(s): "+blockingDependencies.join(","),"blockingDependencies",blockingDependencies)}},5000)}function compileString(_awaitingFiles){var ret="";for(var i=0;i<_awaitingFiles.length;i++){ret=ret+_awaitingFiles[i].CallbackName+","}return ret}};V3.Dynamic={__class:true,__static:true,LoadScript:function(id,url){if(arguments.length==1){url=id}return loadFile(id,url,"js")},LoadSheet:function(id,url,isLowPriority,cssFilesToSkip){if(arguments.length<4&&typeof url==="boolean"){cssFilesToSkip=arguments[2];isLowPriority=arguments[1];url=arguments[0]}return loadFile(id,url,"css",isLowPriority,cssFilesToSkip)},RegisterOnDemandModule:function(id,url){if(!_registeredAsyncModules[id]){_registeredAsyncModules[id]={Id:id,Url:url,IsLoading:false}}}};V3.addPlaceholder=function(){document.write('<div id="v3-temp-placeholder"></div>');var e=document.getElementById("v3-temp-placeholder");e.id="";return e}})(V3=V3||{__namespace:true},window); })(V3);
var V3;
if(!V3){V3={__namespace:true};}
(function(V3){ var V3 = V3 || {};
V3.Modernizr=(function(A,c,g){var G="2.8.3",v={},y=true,J=c.documentElement,a="modernizr",F=c.createElement(a),C=F.style,I,b={}.toString,j=" -webkit- -moz- -o- -ms- ".split(" "),h="Webkit Moz O ms",D=h.split(" "),H=h.toLowerCase().split(" "),E={svg:"http://www.w3.org/2000/svg"},l={},o={},f={},e=[],k=e.slice,s,m=function(S,U,M,T){var L,R,O,P,K=c.createElement("div"),Q=c.body,N=Q||c.createElement("body");if(parseInt(M,10)){while(M--){O=c.createElement("div");O.id=T?T[M]:a+(M+1);K.appendChild(O)}}L=["&#173;",'<style id="s',a,'">',S,"</style>"].join("");K.id=a;(Q?K:N).innerHTML+=L;N.appendChild(K);if(!Q){N.style.background="";N.style.overflow="hidden";P=J.style.overflow;J.style.overflow="hidden";J.appendChild(N)}R=U(K,S);if(!Q){N.parentNode.removeChild(N);J.style.overflow=P}else{K.parentNode.removeChild(K)}return !!R},i=({}).hasOwnProperty,x;if(!r(i,"undefined")&&!r(i.call,"undefined")){x=function(K,L){return i.call(K,L)}}else{x=function(K,L){return((L in K)&&r(K.constructor.prototype[L],"undefined"))}}if(!Function.prototype.bind){Function.prototype.bind=function d(M){var N=this;if(typeof N!="function"){throw new TypeError()}var K=k.call(arguments,1),L=function(){if(this instanceof L){var Q=function(){};Q.prototype=N.prototype;var P=new Q();var O=N.apply(P,K.concat(k.call(arguments)));if(Object(O)===O){return O}return P}else{return N.apply(M,K.concat(k.call(arguments)))}};return L}}function B(K){C.cssText=K}function u(L,K){return B(j.join(L+";")+(K||""))}function r(L,K){return typeof L===K}function t(L,K){return !!~(""+L).indexOf(K)}function z(M,K){for(var L in M){var N=M[L];if(!t(N,"-")&&C[N]!==g){return K=="pfx"?N:true}}return false}function p(L,O,N){for(var K in L){var M=O[L[K]];if(M!==g){if(N===false){return L[K]}if(r(M,"function")){return M.bind(N||O)}return M}}return false}function n(O,K,N){var L=O.charAt(0).toUpperCase()+O.slice(1),M=(O+" "+D.join(L+" ")+L).split(" ");if(r(K,"string")||r(K,"undefined")){return z(M,K)}else{M=(O+" "+(H).join(L+" ")+L).split(" ");return p(M,K,N)}}l.flexbox=function(){return n("flexWrap")};l.geolocation=function(){return"geolocation" in navigator};l.backgroundsize=function(){return n("backgroundSize")};l.borderimage=function(){return n("borderImage")};l.borderradius=function(){return n("borderRadius")};l.boxshadow=function(){return n("boxShadow")};l.textshadow=function(){return c.createElement("div").style.textShadow===""};l.cssanimations=function(){return n("animationName")};l.cssgradients=function(){var M="background-image:",L="gradient(linear,left top,right bottom,from(#9f9),to(white));",K="linear-gradient(left top,#9f9, white);";B((M+"-webkit- ".split(" ").join(L+M)+j.join(K+M)).slice(0,-M.length));return t(C.backgroundImage,"gradient")};l.cssreflections=function(){return n("boxReflect")};l.csstransforms=function(){return !!n("transform")};l.csstransforms3d=function(){var K=!!n("perspective");if(K&&"webkitPerspective" in J.style){m("@media (transform-3d),(-webkit-transform-3d){#modernizr{left:9px;position:absolute;height:3px;}}",function(L,M){K=L.offsetLeft===9&&L.offsetHeight===3})}return K};l.csstransitions=function(){return n("transition")};l.fontface=function(){var K;m('@font-face {font-family:"font";src:url("https://")}',function(O,P){var N=c.getElementById("smodernizr"),L=N.sheet||N.styleSheet,M=L?(L.cssRules&&L.cssRules[0]?L.cssRules[0].cssText:L.cssText||""):"";K=/src/i.test(M)&&M.indexOf(P.split(" ")[0])===0});return K};l.localstorage=function(){try{localStorage.setItem(a,a);localStorage.removeItem(a);return true}catch(K){return false}};l.sessionstorage=function(){try{sessionStorage.setItem(a,a);sessionStorage.removeItem(a);return true}catch(K){return false}};l.svg=function(){return !!c.createElementNS&&!!c.createElementNS(E.svg,"svg").createSVGRect};l.inlinesvg=function(){var K=c.createElement("div");K.innerHTML="<svg/>";return(K.firstChild&&K.firstChild.namespaceURI)==E.svg};l.svgclippaths=function(){return !!c.createElementNS&&/SVGClipPath/.test(b.call(c.createElementNS(E.svg,"clipPath")))};for(var w in l){if(x(l,w)){s=w.toLowerCase();v[s]=l[w]();e.push((v[s]?"":"no-")+s)}}v.addTest=function(L,M){if(typeof L=="object"){for(var K in L){if(x(L,K)){v.addTest(K,L[K])}}}else{L=L.toLowerCase();if(v[L]!==g){return v}M=typeof M=="function"?M():M;if(typeof y!=="undefined"&&y){J.className+=" "+(M?"":"no-")+L}v[L]=M}return v};B("");F=I=null;v._version=G;v._prefixes=j;v._domPrefixes=H;v._cssomPrefixes=D;v.testProp=function(K){return z([K])};v.testAllProps=n;v.testStyles=m;J.className=J.className.replace(/(^|\s)no-js(\s|$)/,"$1$2")+(y?" js "+e.join(" "):"");var q=v.testStyles=m;v.addTest("hiddenscroll",function(){return q("#modernizr {width:100px;height:100px;overflow:scroll}",function(K){return K.offsetWidth===K.clientWidth})});return v})(this,this.document); })(V3);
var V3;
if(!V3){V3={__namespace:true};}
(function(V3){ //AUTO-GENERATED-DO NOT MODIFY 
"use strict";V3.RegisterFile("V3.Utils",1.1,function(V3){var loadedTimeMs=(new Date().valueOf());var loadedRandom=Math.random();var _debugMode=false;var EMPTY_FUNCTION=function(){};var ERROR_FUNCTION=function(errorMessage){throw new Error(errorMessage||"")};V3.Object=(function(){var obj=function(src){if(this instanceof obj){return src?V3.clone(src):{}}else{return new V3.AutoConstruct(obj,src?[src]:null)}};obj.__class=true;try{window.Object.defineProperty({},"test",{enumerable:true,writable:true,configurable:true});obj.define=function(target,name,descriptor){if(typeof descriptor.enumerable!=="boolean"){descriptor.enumerable=true}if(typeof descriptor.writable!=="boolean"){descriptor.writable=true}if(typeof descriptor.configurable!=="boolean"){descriptor.configurable=true}window.Object.defineProperty(target,name,descriptor)}}catch(err){Log.Warn("Browser doesn't support Object.defineProperty() on plain objects. Therefore switching to primitive method 'obj[field]=null;'.","err",err);obj.define=function(target,name,descriptor){target[name]=descriptor.value}}obj.addField=function(target,name,value,hidden,readonly,fixed){var descriptor={value:value,enumerable:hidden===false,writable:readonly,configurable:fixed};return obj.define(target,name,descriptor)};obj.addHidden=function(target,name,initialValue,referenceIsReadOnly){var descriptor={configurable:true,enumerable:false,writable:referenceIsReadOnly!==true,value:null};if(arguments.length>=3){descriptor.value=initialValue}obj.define(target,name,descriptor)};return obj})();V3.Namespace=function(strNamespace,optionalContainer){if((strNamespace+"").indexOf("V3.")===0){strNamespace=strNamespace.substr(3)}if(optionalContainer&&!optionalContainer.__namespace&&optionalContainer!==window){throw"Specified container is not a namespace";return}var names=strNamespace.split(".");var parent=optionalContainer||V3;for(var i=0;i<names.length;i++){var space=parent[names[i]];if(!space){parent[names[i]]=space={}}V3.Object.addHidden(space,"__namespace",true);parent=space}return parent};V3.Namespace("Utils");V3.clone=function(obj,target,bindFunctions){if(Is.ValueType(obj)){throw new Error("not supported error")}if(!target){if(obj instanceof Array){target=[]}else{target={}}}for(var field in obj){var value=obj[field];if(Is.ValueType(value)||!Is.Specified(value)||Is.EnumField(value)){target[field]=value}else{if(Is.Function(value.clone)){target[field]=value.clone()}else{if(Is.PlainObject(value)){target[field]=V3.clone(value,target[field]||{},bindFunctions)}else{if(Is.Function(value)){if(Is.Specified(bindFunctions)){target[field]=value.bind(bindFunctions)}else{target[field]=value}}else{if(Is.Date(value)){target[field]=new Date(value.valueOf())}else{target[field]=value}}}}}}return target};V3.construct=function(ctor,arrArguments){var inst=Object.create(ctor.prototype);var ret=ctor.apply(inst,arrArguments);return Object(ret)===ret?ret:inst};V3.createLookup=function(obj,fGetKey){var f;if(Is.Function(fGetKey)){f=fGetKey}else{var propertyName=fGetKey;f=function(key,value){return value[propertyName]}}var ret={};V3.forEach(obj,function(value,key){ret[f(key,value)]=value});return ret};V3.extend=function(target,overwrite,fields){if(arguments.length===2){fields=arguments[1];overwrite=false}if(V3.Is.ValueType(target)){throw new Error("target must be an object")}if(!target){target={}}for(var fieldName in fields){var field=target[fieldName];if(field!==null&&typeof field==="object"){if(!(field instanceof Array)){V3.extend(field,overwrite,fields[fieldName]);continue}else{if(!overwrite){continue}else{}}}if(typeof field!=="undefined"){if(!overwrite){continue}}target[fieldName]=fields[fieldName]}return target};V3.find=function(obj,fCallback,value,caseSensitive){if(!obj){throw new Error("invalid object")}var ret=null;var predicate;if(Is.Function(fCallback)){predicate=fCallback}else{if(Is.String(value)&&!caseSensitive){value=value.toLowerCase();predicate=function(a){if((a[fCallback]+"").toLowerCase()==value){ret=a;return false}}}else{predicate=function(a){if(a[fCallback]==value){ret=a;return false}}}}V3.forEach(obj,null,function(item,key){if(fCallback(item,key)){ret=item;return false}});return ret};V3.forEach=function(obj,thisArg,fCallback){if(arguments.length<3){fCallback=thisArg;thisArg=this||obj}if(!obj){throw new Error("obj must be set to an instance of array or plain object.")}var iteratedOverAll=true;if(Is.ArrayEnumerable(obj)){for(var i=0;i<obj.length;i++){if(fCallback.call(thisArg,obj[i],i)===false){iteratedOverAll=false;break}}}else{for(var fieldName in obj){if(fCallback.call(thisArg,obj[fieldName],fieldName)===false){iteratedOverAll=false;break}}}return iteratedOverAll};V3.first=function(obj,returnKey){if(!obj){throw new Error("obj not specified")}for(var fieldName in obj){if(returnKey){return fieldName}else{return obj[fieldName]}}return null};V3.isEmpty=function(obj){for(var fieldName in obj){return false}return true};V3.newId=(function(){var _counter=Math.floor(Math.random()*65535);return function(){if(_counter>=65535){_counter=0}else{_counter++}var now=("00000000000"+Math.abs(new Date().valueOf()).toString(16)).slice(-12);var count=("000"+_counter.toString(16)).slice(-4);return now+count}})();V3.sort=function(arr,sortType){if(!sortType){sortType=V3.sortType.AlphabeticallyCaseInsensitive}var ret=[];V3.forEach(function(item){ret.add(item)});ret.sort(function(a,b){return sortType(a,b)});return ret};V3.sortType={AlphabeticallyCaseSensitive:function(a,b){a=(a+"");b=(b+"");return(a==b)?0:(a>b?1:-1)},AlphabeticallyCaseInsensitive:function(a,b){a=(""+a).toUpperCase();b=(""+b).toUpperCase();return(a==b)?0:(a>b?1:-1)}};V3.findFrameworkItem=function(item){var failSafeCounter=2000;var search=function(target,item){var levelsCounter=arguments[2]||0;if(target===item){return""}if(failSafeCounter--<=0){return null}for(var fieldName in target){if(target[fieldName]===item){return fieldName}}if(levelsCounter<10){for(var fieldName in target){var field=target[fieldName];if(typeof field==="object"&&!V3.Is.DomElement(field)){var found=search(field,item,levelsCounter+1);if(typeof found==="string"){return fieldName+"."+found}}}}return null};var found=search(V3,item);if(!found){return null}return"V3."+found};V3.createJsonForDebug=function(obj,spaces,stripOutNulls){var debugJsonReplacer=function(key,value){if(V3.Is.Number(value)){if(V3.Is.EnumField(this[key])){value=V3.findFrameworkItem(this[key])||value}}else{if(value===null){if(stripOutNulls){return undefined}}else{if(this[key] instanceof V3Date){value="/Date('"+this[key].toStringFormat().replace(" 00:00:00.000","")+"')/"}}}return value};return JSON.stringify(obj,debugJsonReplacer,spaces)};V3.parseJson=(function(){var jsonReviverFunction=function(k,v){if(typeof v==="string"){if(v.substr(0,6)==="/Date("){return new Date(parseInt(v.substr(6,v.length-8),10))}else{if(v.length==24&&/\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}Z/g.test(v)){return new Date(v)}}}return v};return function(str){return JSON.parse(str,jsonReviverFunction)}})();V3.addValidation=function(target,fields){function createParameterValidationMethod(checks){return(function(value){for(var i=0;i<checks.length;i++){checks[i](value)}})}function addFieldCheck(fieldName,targetFunction,criteria){if(!(criteria.Params instanceof Array)){throw new Error("Must specify 'Params' array.")}var prefix=fieldName+": ";var parameterIsUnspecified={};for(var i=0;i<criteria.Params.length;i++){var param=criteria.Params[i];var funCheckIsOfType=V3.Is[param.type];if(typeof funCheckIsOfType!=="function"){throw new Error("Unrecognised type '"+criteria.type+"'. For a list of valid types, See: V3.Is.XXXX methods, is case sensitive.")}var checks=[];checks.add(function(value){if(value!==parameterIsUnspecified&&V3.Is.Specified(value)&&!funCheckIsOfType(value)){throw new Error(prefix+"Invalid type supplied for parameter number "+i)}});if(param.isRequired===true){checks.add(function(value){if(typeof value===parameterIsUnspecified&&V3.Is.Property(targetFunction)){return}if(!V3.Is.Specified(value)){throw new Error(prefix+"value must be specified!")}})}if(typeof param.min==="Number"){checks.add(function(value){if(typeof value!=="Number"){value=value.length}if(value<param.min){throw new Error(prefix+"value must be >= "+param.min)}})}if(typeof param.max==="Number"){checks.add(function(value){if(typeof value!=="Number"){value=value.length}if(value>param.max){throw new Error(prefix+"value must be <= "+para.max)}})}param.performParameterValidation=createParameterValidationMethod(checks)}function performValidation(criteria,args,undefined){for(var i=0;i<criteria.Params.length;i++){var value=(i<args.length)?args[i]:parameterIsUnspecified;criteria.Params[i].performParameterValidation(value)}}var fToBind=targetFunction;var fNOP=function(){};var fBound=function(){performValidation(criteria,arguments);return fToBind.apply(this,arguments)};fNOP.prototype=fToBind;fBound.prototype=new fNOP();var wrapper=fBound;if(window.vsDesignTime){intellisense.redirectDefinition(wrapper,targetFunction)}return wrapper}var errors=[];for(var fieldName in fields){if(Is.Function(target[fieldName])){target[fieldName]=addFieldCheck(fieldName,target[fieldName],fields[fieldName])}else{errors.add(new Error("Failed to add validation check"))}}if(errors.length>0){throw (errors.length==1?errors[0]:errors)}};V3.paramDefinition=function(type,isRequired,minValue,maxValue){if(arguments.length===1&&Is.PlainObject(arguments[0])){return arguments[0]}this.type=type;this.isRequired=isRequired;this.min=minValue;this.max=maxValue};var Log=V3.Log=(function(){var con=V3.Log;var insideError=false,doBreak=true;var tracker={};var self;return self={__class:true,__static:true,Debug:function(msg,optionalObjectName,optionalObject,optionalUnwind){if(V3.debugMode||window.vsDesignTime){if(Is.String(optionalObjectName)&&optionalObject&&self.Watch(msg+" "+optionalObjectName,optionalObject,"debug",optionalUnwind)){if(V3.Utils.Console.Enabled){return}}if(V3.Utils.Console&&V3.Utils.Console.Enabled){V3.Utils.Console.WriteDebug(msg)}else{con.Debug(msg)}}},Info:function(msg,optionalObjectName,optionalObject,optionalUnwind){con.Info(msg);if(V3.Utils.Console){V3.Utils.Console.WriteInfo(msg)}if(V3.debugMode){if(Is.String(optionalObjectName)&&optionalObject){self.Watch(optionalObjectName,optionalObject,"info",optionalUnwind)}}},Warn:function(msg,optionalObjectName,optionalObject,optionalUnwind){con.Warn(msg);if(V3.Utils.Console){V3.Utils.Console.WriteWarning(msg)}if(V3.debugMode){if(Is.String(optionalObjectName)&&optionalObject){self.Watch(optionalObjectName,optionalObject,"warn",optionalUnwind)}}},Error:function(msg,optionalObjectName,optionalObject,optionalUnwind){con.Error(msg);if(doBreak&&_debugMode&&V3.isDebuggerAttached()){Break()}if(optionalObject){con.Error(optionalObjectName+": "+optionalObject.toString())}if(insideError){return}insideError=true;if(V3.debugMode){try{if(V3.Utils.Console){V3.Utils.Console.WriteError(msg);if(Is.String(optionalObjectName)&&optionalObject){self.Watch(optionalObjectName,optionalObject,"error",optionalUnwind)}}}catch(err){}}insideError=false},DebugWarning:function(msg){if(!tracker[msg]){tracker[msg]=true;this.Warn(msg)}},Watch:function(objectName,objData,optionalDebugLevel){if(V3.Utils.Console){V3.Utils.Console.AddWatch(objectName,objData,optionalDebugLevel);return true}return false}}})();var Is=V3.Is=(function(){var Is={__class:true};Is.DomElement=function(obj){return(obj&&obj.nodeType)};Is.TextNode=function(obj){return(obj&&obj.nodeType===3)};Is.FormField=function(obj){return(obj&&"INPUT SELECT TEXTAREA".indexOf((""+obj.tagName).toUpperCase())!=-1)};Is.String=function(obj){return(typeof obj==="string")};Is.Number=function(obj){return(typeof obj==="number")};Is.Function=function(obj){return(typeof obj==="function")};Is.Property=function(obj){return(typeof obj==="function"&&obj.__prop)};Is.Date=function(obj){return(obj instanceof Date)};Is.Event=function(obj){return(obj instanceof V3.EventType)};Is.Array=function(obj){return(obj instanceof Array)};Is.ArrayEnumerable=function(obj){if(Is.Array(obj)){return true}else{if(Is.Number(obj.length)&&(obj.length===0||!Is.Undefined(obj[0]))){return true}}return false};Is.Specified=function(obj){return !(obj===null||typeof obj==="undefined")};Is.Boolean=function(obj){return(typeof obj==="boolean")};Is.PlainObject=function(obj){if(typeof obj!=="object"){return false}if(obj instanceof V3.Class){return false}return(Object.prototype.toString.call(obj)==="[object Object]")};Is.Defined=function(obj){return typeof obj!=="undefined"},Is.Undefined=function(obj){return typeof obj==="undefined"};if(Object.prototype.toString.call(arguments)==="[object Arguments]"){Is.Arguments=function(obj){if(Object.prototype.toString.call(obj)==="[object Arguments]"){return true}return false}}else{Is.Arguments=function(obj){if(Object.prototype.toString.call(obj)==="[object Object]"&&Is.Number(obj.length)&&!Is.Function(obj.push)){return true}return false}}Is.EnumField=function(obj){return(obj instanceof V3.Enum.Field)};Is.ValueType=function(value){return Is.String(value)||Is.Number(value)||Is.Boolean(value)};Is.InDOM=function(domElement){do{if(domElement===document){return true}}while(domElement=domElement.parentNode);return false};return Is})();if(!Math.sign){Math.sign=function(x){return((x>0)-(x<0))||+x}}Function.prototype.GetFunctionName=function(){var name=this.name||this.displayName||this.__className;if(!name){var m=/function\s+?(\S+?)\(/i.exec(Function.prototype.toString.call(this));if(m){name=m[1]}}return name||""};Function.prototype.GetFunctionParameters=function(){if(this.__parameterNames instanceof Array){return this.__parameterNames}var str=null;var regex=/function.*?\((.*?)\)/;var match=regex.exec(Function.prototype.toString.call(this));if(match&&match.length==2){str=match[1]}var ret=str.split(",");ret.toString=function(){return str};ret.valueOf=function(){return str};this.__parameterNames=ret;return ret};Function.prototype.InheritsFrom=function(baseClass,extension){if(!baseClass){throw new Error("baseClass is not specified")}else{if(baseClass!==V3.Class&&!(baseClass.prototype instanceof V3.Class)){throw new Error("baseClass must be of type V3.Class")}}var realConstructor=this;var constructorName=this.GetFunctionName();var switchLogic=function(){if(this instanceof baseClass){if(V3.isDebuggerAttached()){return realConstructor.apply(this,arguments)}else{try{return realConstructor.apply(this,arguments)}catch(error){Log.Error("Error while calling a constructor.","error",error)}}}else{return V3.AutoConstruct(fauxConstructor,[].addRange(arguments))}};var fauxConstructor;try{eval("fauxConstructor = function "+constructorName+"() { return switchLogic.apply(this, arguments); };")}catch(err){V3.Log.Error("Failed to create fauxConstructor with constructorName: "+constructorName);eval("fauxConstructor = function default_safe_name() { return switchLogic.apply(this, arguments); };")}V3.Class.SetInheritance(fauxConstructor,baseClass,constructorName);if(extension){V3.extend(fauxConstructor.prototype,true,extension)}realConstructor.prototype=fauxConstructor.prototype;fauxConstructor.__realConstructor=realConstructor;V3.Object.addHidden(fauxConstructor,"__class",true);if(window.vsDesignTime){intellisense.redirectDefinition(fauxConstructor,realConstructor);var example=null;try{example=new fauxConstructor()}catch(error){intellisense.logMessage("Exception while trying to call construction without parameters.");try{example=Object.create(fauxConstructor.prototype);intellisense.logMessage("error="+JSON.stringify(error))}catch(error){example=null}}if(extension){for(var fieldName in example){extension[fieldName]=example[fieldName]}}}return fauxConstructor};RegExp.escape=function(str){return str.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")};var RegExpMatch=function(execResult,index){this.groups=execResult;this.value=execResult[0];this.length=this.value.length;this.index=index};RegExpMatch.prototype.toString=function(){return this.value};RegExp.prototype.findAll=function(str){if(!this.global){throw new Error("regexp.global must be set to true")}var ret=[];var result;while((result=this.exec(str))!==null){ret.push(new RegExpMatch(result,this.lastIndex-result[0].length))}if(ret.length==0){return null}return ret};V3.forEach({add:function(value,blockDuplicates){if(blockDuplicates===true&&this.contains(value)){return false}else{this.push(value);return true}},addAt:function(index,item){if(index<0||index>this.length){throw new Error("Index is out of bounds")}this.splice(index,0,item)},addRange:function(arr,blockDuplicates){if(!arr){throw new Error("arr must be specified")}if(arr instanceof Array){arr.forEach(function(item){this.add(item,blockDuplicates)},this)}else{if(Is.Number(arr.length)&&(arr.length===0||!Is.Undefined(arr[0]))){for(var i=0;i<arr.length;i++){this.add(arr[i],blockDuplicates)}}else{throw new Error("'arr' needs to be of type Array, instead received typeof: "+(typeof arr)+".")}}return this},clear:function(){this.length=0},clone:function(){var ret=[];for(var i=0;i<this.length;i++){ret.push(this[i])}return ret},contains:function(item){return this.indexOf(item)!=-1},exists:function(fPredicate,thisArg){for(var i=0;i<this.length;i++){if(fPredicate.call(thisArg,this[i],i,this)){return true}}return false},find:function(fPredicate,thisArg){for(var i=0;i<this.length;i++){if(fPredicate.call(thisArg,this[i],i,this)){return this[i]}}return null},findAll:function(fPredicate,thisArg){var ret=[];for(var i=0;i<this.length;i++){if(fPredicate.call(thisArg,this[i],i,this)){ret.add(this[i])}}return ret},indexOf:function(item){for(var i=0;i<this.length;i++){if(this[i]===item){return i}}return -1},remove:function(item){var i=this.indexOf(item);if(i==-1){return false}else{this.removeAt(i);return true}},removeAll:function(fPredicate,thisArg){for(var i=this.length-1;i>=0;i--){if(fPredicate.call(thisArg,this[i],i,this)){this.removeAt(i)}}},removeAt:function(index){if(!Is.Number(index)){throw new Error("index must be a number")}if(index<0||index>this.length){throw new Error("Index out of bounds")}this.splice(index,1)}},function(field,key){V3.Object.addHidden(Array.prototype,key,field,false)});String.prototype.lpad=function(padString,length){var str=this;while(str.length<length){str=padString+str}return str};String.prototype.rpad=function(padString,length){var str=this;while(str.length<length){str=str+padString}return str};String.prototype.startsWith=function(str,caseSensitive){if(this.length<str.length){return false}var starts=this.substr(0,str.length);if(caseSensitive){return(starts==str)}else{return starts.toLowerCase()==str.toLowerCase()}};String.prototype.endsWith=function(str,caseSensitive){if(this.length<str.length){return false}var ends=this.substr(-str.length);if(caseSensitive){return(ends==str)}else{return ends.toLowerCase()==str.toLowerCase()}};String.prototype.contains=function(str,caseSensitive){if(this.length<str.length){return false}if(caseSensitive){return this.indexOf(str)!=-1}else{return this.toLowerCase().indexOf(str.toLowerCase())!=-1}};Number.prototype.toStringFormat=function(c,d,t){var n=this,c=isNaN(c=Math.abs(c))?2:c,d=d==undefined?".":d,t=t==undefined?",":t,s=n<0?"-":"",i=parseInt(n=Math.abs(+n||0).toFixed(c))+"",j=(j=i.length)>3?j%3:0;return s+(j?i.substr(0,j)+t:"")+i.substr(j).replace(/(\d{3})(?=\d)/g,"$1"+t)+(c?d+Math.abs(n-i).toFixed(c).slice(2):"")};Number.prototype.toDigits=function(numOfDigits,numOfDecimalPlaces){var str=Math.abs(this).toString();var num,dec=null,decPos=str.indexOf("."),prefix=((this<0)?"-":"");if(decPos==-1){num=str;if(numOfDecimalPlaces>0){dec="0"}}else{num=str.substr(0,decPos);if(numOfDigits<0){numOfDigits=0}dec=str.substr(decPos+1,str.length-decPos-1);if(numOfDecimalPlaces>0||numOfDecimalPlaces<0){if(dec.length>Math.abs(numOfDecimalPlaces)){dec=dec.substr(0,Math.abs(numOfDecimalPlaces))}}}numOfDigits=Math.abs(numOfDigits);if(numOfDecimalPlaces<0){numOfDecimalPlaces=-numOfDecimalPlaces}if(dec==null||numOfDecimalPlaces===0){return prefix+num.lpad("0",numOfDigits)}else{return prefix+num.lpad("0",numOfDigits)+"."+dec.rpad("0",numOfDecimalPlaces)}};Number.prototype.toDecimal=function(maxDecimals,minDecimalLength){var str=Math.abs(this).toString();var num,dec=null,decPos=str.indexOf("."),prefix=((this<0)?"-":"");if(decPos==-1){num=str;if(minDecimalLength>0){dec="0"}}else{num=str.substr(0,decPos);dec=str.substr(decPos+1,str.length-decPos-1);if(maxDecimals>0||maxDecimals<0){if(dec.length>Math.abs(maxDecimals)){dec=dec.substr(0,Math.abs(maxDecimals));dec=dec.replace(/0*$/,"")}}}if(dec==null){return prefix+num}else{return prefix+num+"."+dec.rpad("0",minDecimalLength||0)}};Number.prototype.getNumberOfDecimals=function(){var str=this.toString();var i=str.indexOf(".");if(i==-1){return 0}return str.length-(i+1)};Date.MonthNameStrings=["January","February","March","April","May","June","July","August","September","October","November","December","Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];Date.DayOfWeekStrings=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sun","Mon","Tue","Wed","Thu","Fri","Sat"];Date.prototype.toUTCStringFormat=function(format){return this.toStringFormat(format,true)};Date.prototype.equals=function(date){if(this==date){return true}if(!this||!date){return false}return this.getTime()==date.getTime()};Date.prototype.clone=function(){return new Date(this.valueOf())};Date.prototype.toStringFormat=function(format,displayUTC){var dfi;if(displayUTC instanceof CultureInfo){dfi=displayUTC.dateTimeFormat();displayUTC=arguments[3]}else{if(displayUTC instanceof DateTimeFormatInfo){dfi=displayUTC;displayUTC=arguments[3]}else{dfi=CultureInfo.currentCulture().dateTimeFormat()}}if(typeof format!=="string"||format.length===0){format="datetimems"}else{if(format.length==2&&format.substr(0,1)=="%"){format=format.substr(1)}else{if(format.length==1){switch(format){case"t":format=dfi.shortTimePattern();break;case"T":format=dfi.longTimePattern();break;case"d":format=dfi.shortDatePattern();break;case"D":format=dfi.longDatePattern();break;case"g":format=dfi.shortDatePattern()+" "+dfi.shortTimePattern();break;case"G":format=dfi.shortDatePattern()+" "+dfi.longTimePattern();break;case"f":format=dfi.longDatePattern()+" "+dfi.shortTimePattern();break;case"F":format=dfi.fullDateTimePattern();break;case"y":format=dfi.yearMonthPattern();break;case"Y":format=dfi.yearMonthPattern();break;case"m":format=dfi.monthDayPattern();break;case"M":format=dfi.monthDayPattern();break;case"O":format='yyyy"-"MM"-"dd"T"HH":"mm":"ss"."fffffff';break;case"o":format='yyyy"-"MM"-"dd"T"HH":"mm":"ss"."fffffff';break}}}}switch(format.toLowerCase()){case"date":return this.getFullYear()+"-"+(this.getMonth()+1).toString().lpad("0",2)+"-"+this.getDate().toString().lpad("0",2);case"time":return this.getHours().toString().lpad("0",2)+":"+this.getMinutes().toString().lpad("0",2)+":"+this.getSeconds().toString().lpad("0",2);case"datetime":return this.getFullYear()+"-"+(this.getMonth()+1).toString().lpad("0",2)+"-"+this.getDate().toString().lpad("0",2)+" "+this.getHours().toString().lpad("0",2)+":"+this.getMinutes().toString().lpad("0",2)+":"+this.getSeconds().toString().lpad("0",2);case"datetimems":return this.getFullYear()+"-"+(this.getMonth()+1).toString().lpad("0",2)+"-"+this.getDate().toString().lpad("0",2)+" "+this.getHours().toString().lpad("0",2)+":"+this.getMinutes().toString().lpad("0",2)+":"+this.getSeconds().toString().lpad("0",2)+"."+this.getMilliseconds().toString().lpad("0",3);case"iso":return this.getUTCFullYear()+"-"+(this.getUTCMonth()+1).toString().lpad("0",2)+"-"+this.getUTCDate().toString().lpad("0",2)+"T"+this.getUTCHours().toString().lpad("0",2)+":"+this.getUTCMinutes().toString().lpad("0",2)+":"+this.getUTCSeconds().toString().lpad("0",2)+"."+this.getUTCMilliseconds().toString().lpad("0",3)+"Z";case"utcdate":return this.getUTCFullYear()+"-"+(this.getUTCMonth()+1).toString().lpad("0",2)+"-"+this.getUTCDate().toString().lpad("0",2);case"utctime":return this.getUTCHours().toString().lpad("0",2)+":"+this.getUTCMinutes().toString().lpad("0",2)+":"+this.getUTCSeconds().toString().lpad("0",2)}var src={FullYear:displayUTC?this.getUTCFullYear():this.getFullYear(),Month:displayUTC?this.getUTCMonth():this.getMonth(),Date:displayUTC?this.getUTCDate():this.getDate(),Day:displayUTC?this.getUTCDay():this.getDay(),Hours:displayUTC?this.getUTCHours():this.getHours(),Minutes:displayUTC?this.getUTCMinutes():this.getMinutes(),Seconds:displayUTC?this.getUTCSeconds():this.getSeconds(),Milliseconds:displayUTC?this.getUTCMilliseconds():this.getMilliseconds(),TimezoneOffset:displayUTC?0:this.getTimezoneOffset()};if(format.length<4){switch(format){case"d":return("")+src.Date;case"dd":return(src.Date<10?"0":"")+src.Date;case"ddd":return dfi.abbreviatedDayNames()[src.Day];case"dddd":return dfi.dayNames()[src.Day];case"M":return("")+(src.Month+1);case"MM":return(src.Month<9?"0":"")+(src.Month+1);case"MMM":return dfi.abbreviatedMonthNames()[src.Month];case"MMMM":return dfi.monthNames()[src.Month]}}var ret=format;var constants=/".*?"|'.*?'/gm.findAll(format),constantPlaceholder='"';if(constants){for(var i=0;i<constants.length;i++){ret=ret.replace(constants[i].value,constantPlaceholder)}}if(format.indexOf("h")>=0){var h=(((src.Hours+11)%12)+1).toString();ret=ret.replace("hh",h.lpad("0",2)).replace("h",h)}if(format.indexOf("H")>=0){var h=(src.Hours).toString();ret=ret.replace("HH",h.lpad("0",2)).replace("H",h)}if(format.indexOf("m")>=0){var m=src.Minutes.toString();ret=ret.replace("mm",m.lpad("0",2)).replace("m",m)}if(format.indexOf("s")>=0){var s=src.Seconds.toString();ret=ret.replace("ss",s.lpad("0",2)).replace("s",s)}if(format.indexOf("f")>=0||format.indexOf("F")>=0){var fff=src.Milliseconds.toString().lpad("0",3);var ff=fff.substr(0,2);var f=fff.substr(0,1);ret=ret.replace("fff",fff).replace("ff",ff).replace("f",f);if(format.indexOf("F")>=0){var FFF="FFF";var FF="FF";var F="F";if(fff=="000"){ret=ret.replace(".FFF","").replace("FFF","")}else{ret=ret.replace("FFF",fff)}if(ff=="00"){ret=ret.replace(".FF","").replace("FF","")}else{ret=ret.replace("FF",ff)}if(f=="0"){ret=ret.replace(".F","").replace("F","")}else{ret=ret.replace("F",f)}}}if(format.indexOf("t")>=0){var t=((src.Hours>=12)?dfi.pmDesignator():dfi.amDesignator()).toLowerCase();ret=ret.replace("tt",t);ret=ret.replace("t",t.substr(0,1))}if(format.indexOf("T")>=0){var t=((src.Hours>=12)?dfi.pmDesignator():dfi.amDesignator());ret=ret.replace("TT",t);ret=ret.replace("T",t.substr(0,1))}if(format.indexOf("y")>=0){var y=src.FullYear.toString().lpad("0",4);ret=ret.replace("yyyy",y).replace("yy",y.substr(2,2))}if(format.indexOf("M")>=0){var m=(src.Month+1).toString();ret=ret.replace(/(^|[^MAP])MM([^M]|$)/gm,"$1"+m.lpad("0",2)+"$2").replace(/(^|[^MAP])M([^M]|$)/gm,"$1"+m+"$2")}if(format.indexOf("d")>=0){var d=src.Date.toString();ret=ret.replace(/(^|[^d])dd([^d]|$)/gm,"$1"+d.lpad("0",2)+"$2").replace(/(^|[^d])d([^d]|$)/gm,"$1"+d+"$2")}if(format.indexOf("ddd")>=0){ret=ret.replace("dddd",dfi.dayNames()[src.Day]).replace("ddd",dfi.abbreviatedDayNames()[src.Day])}if(format.indexOf("MMM")>=0){ret=ret.replace("MMMM",dfi.monthNames()[src.Month]).replace("MMM",dfi.abbreviatedMonthNames()[src.Month])}if(format.indexOf("z")>=0||format.indexOf("Z")>=0){var o=-src.TimezoneOffset;var p=(o>=0)?"+":"-";o=Math.abs(o);var h=Math.floor(o/60).toString();var m=(o%60).toString().lpad("0",2);var z1=p+h,z2=p+h.lpad("0",2),z3=p+h+m,z4=p+h+":"+m,z5=p+h.lpad("0",2)+m,z6=p+h.lpad("0",2)+":"+m;ret=ret.replace("zz:zz",z6).replace("zzzz",z5).replace("z:zz",z4).replace("zzz",z3).replace("zz",z2).replace("z",z1);if(format.indexOf("Z")>=0){if(o==0){ret=ret.replace("ZZ:ZZ","").replace("ZZZZ","").replace("Z:ZZ","").replace("ZZZ","").replace("ZZ","").replace("Z","")}else{ret=ret.replace("ZZ:ZZ",z6).replace("ZZZZ",z5).replace("Z:ZZ",z4).replace("ZZZ",z3).replace("ZZ",z2).replace("Z",z1)}}}if(constants){var index=0;for(var i=0;i<constants.length;i++){var txt=constants[i].value;if(txt=='""'){txt='"'}else{txt=txt.substr(1,txt.length-2)}index=ret.indexOf(constantPlaceholder,index);ret=ret.substr(0,index)+txt+ret.substr(index+constantPlaceholder.length);index=index+txt.length}}return ret};if(window.vsDesignTime){intellisense.annotate(Date,{DayOfWeekStrings:null,MonthNameStrings:null})}V3.Enum=function(values){if(!(this instanceof V3.Enum)){return new V3.Enum(values)}var isArray=Is.Array(values);var fieldPrototypeFunction=function(){V3.Enum.Field.apply(this,arguments)};fieldPrototypeFunction.prototype=new V3.Enum.Field();delete this.prototype;V3.Object.addHidden(this,"prototype",fieldPrototypeFunction.prototype,true);V3.forEach(values,this,function(value,key){var fieldName,fieldValue;if(isArray){fieldName=value;fieldValue=key}else{fieldName=key;fieldValue=value}var accessibleName=fieldName.toString().replace(/\W/g,"");if(!Is.ValueType(fieldValue)){throw Error("The value of an enum field must be a value type.")}fieldName=fieldName+"";var field=new fieldPrototypeFunction(accessibleName,fieldName,fieldValue);this[accessibleName]=field;if(window.vsDesignTime){intellisense.redirectDefinition(field,values)}});if(window.vsDesignTime){intellisense.redirectDefinition(this,values);intellisense.annotate(this,{prototype:null})}return this};V3.Object.addHidden(V3.Enum.prototype,"__enum",true);delete V3.Enum.prototype.constructor;V3.Object.addHidden(V3.Enum.prototype,"exists",function(value){if(!this.__enum){return false}for(var fieldName in this){if(this[fieldName]===value){return true}}return false});V3.Object.addHidden(V3.Enum.prototype,"fromValue",function(val){for(var key in this){if(this[key].valueOf()==val){return this[key]}}throw new Error("Value not found! Value="+val)});V3.Object.addHidden(V3.Enum.prototype,"parse",function(strValue){if(typeof strValue==="undefined"||strValue===null){return null}if(typeof strValue==="string"){if(this[strValue]){return this[strValue]}for(var field in this){if(this[field].toString(true)===strValue){return this[field]}}if(strValue==parseFloat(strValue).toString()){strValue=parseFloat(strValue)}}if(strValue instanceof V3.Enum.Field){for(var field in this){if(this[field]===strValue||(this[field].valueOf()===strValue.valueOf()&&this[field].toString()===strValue.toString())){return this[field]}}}for(var field in this){if(this[field].valueOf()===strValue){return this[field]}}return null});V3.Enum.Field=function(fieldName,displayName,value){V3.Object.addHidden(this,"_fieldName",fieldName);V3.Object.addHidden(this,"_displayName",displayName);V3.Object.addHidden(this,"_value",value)};V3.Object.addHidden(V3.Enum.Field.prototype,"__enumMember",true);V3.Object.addHidden(V3.Enum.Field.prototype,"toString",function(returnDisplayName){return returnDisplayName?this._displayName:this._fieldName});V3.Object.addHidden(V3.Enum.Field.prototype,"valueOf",function(){return this._value});V3.Object.addHidden(V3.Enum.Field.prototype,"equals",function(obj){return obj==this._value||obj===this._fieldName});V3.Object.addHidden(V3.Enum.Field.prototype,"toJSON",function(){return this.valueOf()});V3.Object.addHidden(V3.Enum.Field.prototype,"toStringDebug",function(){return this.toString()+" {"+this.valueOf()+"}"});V3.Class=function(){if(!(this instanceof V3.Class)){var c=new V3.Class();c.__static=true;return c}else{if(_debugMode){var sw=new V3.Utils.StopWatch(true)}if(!this.constructor.__compiledAutoInstantiate){if(_debugMode){var sw=new V3.Utils.StopWatch(true)}var bdy="";var fun={};for(var key in this){if(this[key]&&typeof this[key].__autoInstantiate==="function"){fun[key]=this[key].__autoInstantiate.bind(this[key]);bdy+='fun["'+key+'"](i,"'+key+'");\r\n';if(_debugMode){bdy+='timings["'+key+'"]=sw.getDuration();sw.reset(true);'}}}var compiled=null;if(bdy.length>0){if(_debugMode){bdy="var timings={}; var sw= new V3.Utils.StopWatch(true);"+bdy+"return timings;"}compiled=new Function("fun","i",bdy)}if(compiled){this.constructor.__compiledAutoInstantiate=compiled.bind(this,fun)}else{this.constructor.__compiledAutoInstantiate=EMPTY_FUNCTION}if(_debugMode){Log.Debug("Compiling auto instantiate method for "+this.constructor.name+" ("+sw.getDuration()+"ms)")}}var timings=this.constructor.__compiledAutoInstantiate(this);if(_debugMode){sw.stop();if(sw.getDuration()>25){Log.Warn("Auto Instantiate took: "+sw.getDuration()+"ms. Class: "+this.constructor.name,"timings",timings)}}}};V3.Object.addHidden(V3.Class,"__class",true);V3.Object.addHidden(V3.Class.prototype,"__class",true);V3.Object.addHidden(V3.Class.prototype,"__baseConstructors__",[]);V3.Class.prototype.base=function(arg1,arg2,etc){var args=[].slice.call(arguments,0);var proto=Object.getPrototypeOf(this);if(typeof this.__baseConstructorIndex__!=="number"){V3.Object.addHidden(this,"__baseConstructorIndex__");this.__baseConstructorIndex__=proto.__baseConstructors__.length}var baseCtor=proto.__baseConstructors__[this.__baseConstructorIndex__=this.__baseConstructorIndex__-1];if(arguments.length<baseCtor.length){Log.Warn("Invoking base constructor with not enought arguments based on constructor signature. baseCtor="+baseCtor.name+", Expected number of arguments:"+baseCtor.length+", Specified:"+arguments.length)}baseCtor.apply(this,args);if(this.__baseConstructorIndex__===0){delete this.__baseConstructorIndex__}};V3.Class.prototype.toString=function(){var ret="[instanceof ("+((this.constructor&&this.constructor.name)||"?")+")]";if(this.id){if(Is.String(this.id)){ret=ret+"."+this.id}else{if(Is.Property(this.id)){ret+ret+"."+this.id()}}}return ret};V3.Class.prototype.Set=function(objFields){V3.forEach(objFields,this,function(value,field){if(!(field in this)){throw new Error("'"+field+"' was not found on object.")}var target=this[field];if(Is.Property(target)){target.call(this,value)}else{if(Is.Event(target)){if(Is.Event(value)){target.addEventHandler(value.fire.bind(value))}else{if(Is.Function(value)){target.addEventHandler(value)}else{if(value!==null){throw new Error("Value must be a function. Value="+value)}}}}else{if((target instanceof V3.Collection||Is.Array(value))&&(Is.Function(target.add)||Is.Function(target.addRange))){if(value!==null){if(Is.Function(target.addRange)){target.addRange(value)}else{value.forEach(function(item){target.add(item)},this)}}}else{if(Is.Function(target)){if(Is.Function(value)){this[field]=value}else{if(Is.Array(value)){target.apply(this,value)}else{target.call(this,value)}}}else{if(Is.PlainObject(value)){V3.Class.prototype.Set.call(target,value)}else{if(Is.Undefined(target)){Log.Error("Field not found! Name="+field,"target",this)}else{this[field]=value}}}}}}if(window.vsDesignTime){intellisense.redirectDefinition(field,target)}});return this};V3.Class.SetInheritance=function(ctor,baseClass){var baseInstance=Object.create(baseClass.prototype);ctor.prototype=baseInstance;delete baseInstance.__baseConstructorIndex__;baseInstance.constructor=ctor;V3.Object.addHidden(baseInstance,"__baseConstructors__",baseClass.prototype.__baseConstructors__.clone());baseInstance.__baseConstructors__.add(baseClass);var className=(arguments.length==3?arguments[2]:ctor.GetFunctionName());V3.Object.addHidden(baseInstance,"__className",className,true);V3.Object.addHidden(baseInstance,"__baseClassName",baseClass.GetFunctionName(),true);if(Is.Undefined(ctor.name)){V3.Object.addHidden(ctor,"name",className,true)}if(window.vsDesignTime){ctor.prototype.base=function(){V3.Class.prototype.base.apply(this,arguments)};intellisense.redirectDefinition(ctor.prototype.base,baseClass)}};V3.EventType=function EventType(eventName,optionalArgsString,optionalSingleUse,optionalIsDebugEvent,args){this._delegates=[];var me=this;args=arguments[arguments.length-1];if(args==optionalArgsString){args=null}if(!args||typeof args!=="object"){args={}}this.name=eventName;this.signature=optionalArgsString;if(args.bind&&args.bind instanceof Array&&args.bind.length>0){this.setBindParameters(args.bind);this._owner=args.owner||args.bind[0]}else{this._owner=args.owner||this;this._bindParams=[];this._bindParams.thisArg=this._owner}this._singleUse=(optionalSingleUse===true);this._hasFired=false;if(Is.Undefined(args.log)){if(optionalIsDebugEvent===true){args.log=false}else{args.log=(V3.EventType._doLogging.length===0||V3.EventType._doLogging[V3.EventType._doLogging.length-1])}}this._doLog=args.log===true||args.log==="silent";if(Is.Function(args.lazyLoadCallback)){this._lazyLoadCallback=args.lazyLoadCallback}else{}this.removeEventHandler=this._removeEventHandler;this.fire=this._fire;if(!this._lazyLoadCallback){this.addEventHandler=this._addEventHandler}else{this.addEventHandler=function(targetFunction){this._lazyLoadCallback.call(this._owner,this);this._addEventHandler(targetFunction);this.addEventHandler=this._addEventHandler}}if(this._singleUse){this.reset=function(){this._hasFired=false}}if(window.vsDesignTime){if(Is.String(optionalArgsString)){var arrFireParameters=optionalArgsString.split(",").slice(this._bindParams.length);var fireParams=[];arrFireParameters.forEach(function(paramName){fireParams.add({name:paramName})});this.fire=this.fire.bind(this);this.addEventHandler=this.addEventHandler.bind(this);intellisense.addSignature(this.fire,"Fires/triggers the event for all event handlers to receive.",fireParams);intellisense.addSignature(this.addEventHandler,"The function to invoke when event is fired. Handler function should have the signature: function("+optionalArgsString+")").addParameter("targetFunction("+optionalArgsString+")","Function","")}}};V3.Object.addHidden(V3.EventType,"__class",true,true);V3.Object.addHidden(V3.EventType.prototype,"__event",true,true);V3.extend(V3.EventType.prototype,{setOwner:function(owner){if(this._bindParams.thisArg===this._owner){this._bindParams.thisArg=owner}this._owner=owner},setBindParameters:function(arrBindParameters){this._bindParams=arrBindParameters.slice(1);this._bindParams.thisArg=arrBindParameters[0]},toStringDebug:function(){var ownerName=null;var id;if(this._owner){id=(this._owner.id||this._id);if(this._owner.constructor&&this._owner!=this){ownerName=this._owner.constructor.name;if(!ownerName&&Is.Function(this._owner.constructor.GetFunctionName)){ownerName=this._owner.constructor.GetFunctionName()}}}if(id){if(Is.Property(id)){id=id()}}var pfix="";if(ownerName){pfix="("+ownerName+")"}if(id){pfix="["+pfix+id+"]"}if(pfix){pfix=pfix+"."}return"event "+pfix+this.name},_fireDelegate:function(delegate,argArray){if(V3.debugMode||V3.isDebuggerAttached()){return delegate.apply(this._bindParams.thisArg,this._bindParams.concat(argArray))}else{try{return delegate.apply(this._bindParams.thisArg,this._bindParams.concat(argArray))}catch(err){var me=this;setTimeout(function(){throw err},1);Log.Error("Error while firing event "+this.name,"err",err);if(_debugMode){Log.Watch("",{handler:delegate.toString(),args:argArray},"error",true)}if(V3.Utils.OnEventError!=this){V3.Utils.OnEventError.fire(this.name,err,argArray)}}}},_addEventHandler:function(targetFunction){if(typeof targetFunction!="function"){throw"Invalid target specified"}if(this._singleUse&&this._hasFired){var me=this;me._fireDelegate(targetFunction,me._lastFireParameters)}else{if(this.fire===EMPTY_FUNCTION){this.fire=this._fire}return this._delegates.add(targetFunction,true)}},_removeEventHandler:function(targetFunction){if(typeof(targetFunction)!="function"){throw"Invalid target specified"}return this._delegates.remove(targetFunction)},_fire:function(arg1,arg2,etc){var argArray=Array.prototype.slice.call(arguments,0);if(this._singleUse){if(this._hasFired){return}this._lastFireParameters=argArray}if(this._doLog===true){var obj=[].addRange(argArray);obj.EventObject=this;Log.Debug("Firing "+this.toStringDebug(),"",obj)}var ret=[];if(this._delegates.length>0){var timer=_debugMode?new V3.Utils.StopWatch():null;for(var i=0;i<this._delegates.length&&i<=5000;i++){if(_debugMode){timer.reset(true)}var returnValue=this._fireDelegate(this._delegates[i],argArray);if(Is.Specified(returnValue)){ret.add(returnValue)}if(_debugMode){timer.stop();if(timer.getDuration()>500){Log.Warn("Event handler took a long time to execute. Duration to execute: "+timer.getDuration()+"ms.","Details",{Event:this,Delegate:this._delegates[i]})}}}if(this._delegates.length>5000){Log.Error("Number of event listeners exceeds the maximum of 5000! Event="+this.toStringDebug())}else{if(this._delegates.length>100){Log.Warn("Number of event listeners is very high ("+this._delegates.length+"), possible recursive loop where event handler is adding new event handlers. Event="+this.toStringDebug())}}}this._hasFired=true;return ret}});V3.EventType._doLogging=[];V3.EventType.setDefaultLoggingStatus=function(doLogging){V3.EventType._doLogging.add(doLogging)};V3.EventType.revertDefaultLoggingStatus=function(){if(V3.EventType._doLogging.length===0){Log.Warn("cancelLogging was called too many times!")}else{V3.EventType._doLogging.removeAt(V3.EventType._doLogging.length-1)}};V3.EventPrototype=function(optionalArgsString,optionalSingleUse,optionalIsDebugEvent){var doLogging=V3.EventType._doLogging[V3.EventType._doLogging.length-1];return V3.AutoConstruct(V3.EventType,[].addRange(arguments),function funCustomInstantiateCode(classInstance,fieldName,ctor,args){args.addAt(0,fieldName);V3.EventType.setDefaultLoggingStatus(doLogging);var e=V3.construct(V3.EventType,args);V3.EventType.revertDefaultLoggingStatus();e.setOwner(classInstance);return e})};V3.Property=function(thisArg,fGetter,fSetter){if(!(this instanceof V3.Property)){var ret=V3.AutoConstruct(V3.Property,[].addRange(arguments),true);var Defaults=ret.Defaults.bind(ret);delete ret.Defaults;ret.OnChange=function(handler){Defaults({OnChange:handler});return this};return ret}if(arguments.length<1){throw new Error("No enough parameters specified, required at least 2, instead received "+arguments.length+".")}if(!window.vsDesignTime&&(Is.Undefined(thisArg)||Is.Function(thisArg))){throw new Error("thisArg must be specified, and should be an object, not a function.")}var fCallbackOnSet=null;var fCallbackOnGet=null;var initialValue=null;if(arguments.length==2){if(Is.Function(arguments[1])){fCallbackOnGet=arguments[1]}else{initialValue=arguments[1]}}else{if(arguments.length==3){if(Is.Function(arguments[1])){fCallbackOnGet=arguments[1];fCallbackOnSet=arguments[2]}else{initialValue=arguments[1];fCallbackOnSet=arguments[2]}}}var storage={value:initialValue};var onChange=null;var property;if(fCallbackOnGet&&!fCallbackOnSet){property=fCallbackOnGet.bind(thisArg)}else{onChange=new V3.EventType("Property.OnChange","value, oldValue",{bind:[thisArg],log:false});property=function(value){if(arguments.length==0){if(fCallbackOnGet){return fCallbackOnGet.call(thisArg,storage.value)}else{return storage.value}}else{if(Is.Property(value)){var foreignProperty=value;property.bindProperty(foreignProperty)}else{if(fCallbackOnSet){var refSubstitute={value:value};if(fCallbackOnSet.call(thisArg,value,storage.value,refSubstitute)===false){return}value=refSubstitute.value}if(value!==storage.value){var oldValue=storage.value;storage.value=value;if(onChange){onChange.fire(value,oldValue)}}}}};if(onChange){property.OnChange=onChange;property.bindProperty=function(foreignProperty){if(!foreignProperty){throw new Error("foreignProperty must be specified")}if(!foreignProperty.OnChange){throw new Error("foreignProperty is read only, cannot bind to read-only properties")}foreignProperty.OnChange.addEventHandler(property);property.OnChange.addEventHandler(foreignProperty);property(foreignProperty())};property.unbindProperty=function(foreignProperty){foreignProperty.OnChange.removeEventHandler(property);property.OnChange.removeEventHandler(foreignProperty)}}}V3.Object.addHidden(property,"__prop",true,true);if(window.vsDesignTime){if(fCallbackOnGet||fCallbackOnSet){intellisense.redirectDefinition(property,fCallbackOnGet||fCallbackOnSet)}else{if(onChange){var orig=onChange.addEventHandler;onChange.addEventHandler=function(handler){intellisense.redirectDefinition(property,handler);orig.call(this,arguments);onChange.addEventHandler=orig};intellisense.redirectDefinition(onChange.addEventHandler,orig)}}}return property};V3.PropertyPrototype=function(fGetter,fSetter){return V3.Property.apply(this,arguments)};var Placeholder=function(){};Placeholder.prototype.Defaults=function(obj){var placeholder=this;if(!obj){return}var bdy="";V3.forEach(obj,function(value,key){if(Is.Function(value)){bdy+='o["'+key+'"]=d["'+key+'"].bind(i||o);'}else{bdy+='o["'+key+'"]=d["'+key+'"];'}});placeholder.__defaults=new Function("d","o","i",bdy).bind(null,obj);placeholder.Defaults=ERROR_FUNCTION.bind(null,"Defaults has already been called");return this};Placeholder.prototype.__autoInstantiate=function(classInstance,fieldName){var placeholder=this;var newInstance=placeholder.createInstance(classInstance,fieldName);classInstance[fieldName]=newInstance;return newInstance};Placeholder.prototype.createInstance=function(classInstance,fieldName){var placeholder=this;if(!placeholder.__funCustomInstantiateCode){if(placeholder.__injectOwnerReferences&&!classInstance){throw new Error("owner must be specified")}}var args=placeholder.__arrArguments.clone();if(placeholder.__injectOwnerReferences){args.addAt(0,classInstance)}var newInstance;if(placeholder.__funCustomInstantiateCode){newInstance=placeholder.__funCustomInstantiateCode(classInstance,fieldName,placeholder.__ctor,args)}else{newInstance=V3.construct(placeholder.__ctor,args)}if(placeholder.__defaults){var spec={};placeholder.__defaults(spec,classInstance);V3.Class.prototype.Set.call(newInstance,spec)}return newInstance};Placeholder.prototype.toString=function(){return"auto constructor"};V3.AutoConstruct=function(ctor,arrArguments,injectOwnerReference){if(!arrArguments){arrArguments=[]}var placeholder=new Placeholder();var funCustomInstantiateCode=null;if(injectOwnerReference===true){placeholder.__injectOwnerReferences=true}else{if(Is.Function(injectOwnerReference)){funCustomInstantiateCode=injectOwnerReference}}if(ctor.prototype instanceof V3.Class||ctor===V3.Property){if(injectOwnerReference!==true&&ctor.prototype instanceof V3.Class){placeholder.InjectOwner=function(){placeholder.__injectOwnerReferences=true;return this}}if(window.vsDesignTime){intellisense.annotate(placeholder.Defaults,V3.Class.prototype.Set);intellisense.annotate(placeholder,new ctor(arrArguments))}}else{placeholder.Defaults=null}placeholder.__arrArguments=arrArguments;placeholder.__ctor=ctor;placeholder.__funCustomInstantiateCode=funCustomInstantiateCode;return placeholder};window.__V3_globallyAccessible={};V3.GetGloballyAccessibleFunctionReference=(function(){var counter=0;return function(fHandler,optionalSalt){if(!Is.Function(fHandler)){throw new Error("fHandler must be a function.")}if(Is.Undefined(optionalSalt)){optionalSalt=""}var uid="f"+optionalSalt+(counter++);__V3_globallyAccessible[uid]=fHandler;return"__V3_globallyAccessible['"+uid+"']"}})();window.V3Date=(function(Date){Date.prototype.asDate=function(){return this};Date.prototype.asV3Date=function(){return new V3Date(this)};function V3Date(value_or_year,month,day,hour,minute,second,millisecond){if(arguments.length==0||arguments[0]===null||typeof arguments[0]==="undefined"){var now=new Date();this.setFromDate(now)}else{if(arguments.length==1){if(typeof arguments[0]==="string"){this._set_d(V3Date.parseStrict(arguments[0])._d)}else{if(typeof arguments[0]==="number"){this.setFromDate(new Date(arguments[0]))}else{if(arguments[0] instanceof Date){this.setFromDate(arguments[0])}else{throw new Error("Invalid argument passed into V3Date constructor. Value="+arguments[0])}}}}else{this._set_d(new Date(Date.UTC.apply(this,arguments)))}}}V3Date.prototype=new Date(0);V3Date.equals=function(a,b){if(a&&!b){return false}else{if(!a&&b){return false}else{return a.asDate().valueOf()==b.asDate().valueOf()}}};var proto=V3Date.prototype;proto._set_d=function(_d){if(isNaN(_d.getDate())){throw new Error("d is NAN")}this._d=_d;this.onchange()};proto.onchange=function(){this.value=this.toString()};proto.clone=function(){return new V3Date(this)};var funNames=["FullYear","Month","Date","Hours","Minutes","Seconds","Milliseconds","Day"];for(var i=0;i<funNames.length;i++){var funName=funNames[i];(function(funName,i){proto["get"+funName]=function(){return this._d["getUTC"+funName].apply(this._d,arguments)};proto["set"+funName]=function(val){var ret=this._d["setUTC"+funName].apply(this._d,arguments);this.onchange();return ret};proto["getUTC"+funName]=function(){var d=this.asDate();return d["getUTC"+funName].apply(d,arguments)};proto["setUTC"+funName]=function(val){var d=this.asDate();var ret=d["setUTC"+funName].apply(d,arguments);this.setFromDate(d);this.onchange();return ret}})(funName,i)}proto.toTimeString=function(){return this.toString("HH:mm:ss")+' "UTC"zzzz'};V3Date.parse=function(strDate){return Date.parse(strDate)};proto.toString=Date.prototype.toStringFormat;proto.asV3Date=function(){return this};proto.valueOf=function(){return this.asDate().valueOf()};proto.toJSON=function(){return this.toISOString()};proto.toISOString=function(){return this.toUTCString("ISO")};proto.toUTCString=function(format){return this.toStringFormat(format,true)};proto.getUTCTime=function(){return Date.UTC(this.getFullYear(),this.getMonth(),this.getDate(),this.getHours(),this.getMinutes(),this.getSeconds(),this.getMilliseconds())};proto.getTime=function(){return this.asDate().getTime()};proto.getTimezoneOffset=function(){this.asDate().getTimezoneOffset()};proto.asDate=function(){var d=new Date(this.getFullYear(),this.getMonth(),this.getDate(),this.getHours(),this.getMinutes(),this.getSeconds(),this.getMilliseconds());return d};proto.setFromDate=function(d){this._set_d(new Date(Date.UTC(d.getFullYear(),d.getMonth(),d.getDate(),d.getHours(),d.getMinutes(),d.getSeconds(),d.getMilliseconds())))};proto.addYears=function(years){var n=new V3Date(this);n.setFullYear(n.getFullYear()+years);return n};proto.addMonths=function(months){var n=new V3Date(this);n.setMonth(n.getMonth()+months);return n};proto.addDays=function(days){var n=new V3Date(this);n.setDate(n.getDate()+days);return n};proto.addHours=function(hours){var n=new V3Date(this);n.setHours(n.getHours()+hours);return n};proto.addSeconds=function(seconds){var n=new V3Date(this);n.setSeconds(n.getSeconds()+seconds);return n};proto.addMilliseconds=function(milliseconds){var n=new V3Date(this);n.setMilliseconds(n.getMilliseconds()+milliseconds);return n};proto.date=function(){return new V3Date(this.getFullYear(),this.getMonth(),this.getDate(),0,0,0,0)};proto.getDayOfWeek=function(){return V3.CultureInfo.currentCulture().dateTimeFormat().dayNames()[this.getDay()]};proto.getDaysBetween=function(date){var ONE_DAY=86400000;var d1=this.asV3Date().date(),d2=date.asV3Date().date();var diffDayDecimal=(d1.getUTCTime()-d2.getUTCTime())/ONE_DAY;return(diffDayDecimal>=0)?Math.floor(diffDayDecimal):Math.ceil(diffDayDecimal)};proto.getHoursBetween=function(date){var ONE_HOUR=3600000;var d1=this.asV3Date(),d2=date.asV3Date();var diffHourDecimal=(d1.getUTCTime()-d2.getUTCTime())/ONE_HOUR;return(diffHourDecimal>=0)?Math.floor(diffHourDecimal):Math.ceil(diffHourDecimal)};proto.getLastDOW=function(strName,formatter){if(formatter instanceof CultureInfo){formatter=formatter.dateTimeFormat()}else{if(!(formatter instanceof DateTimeFormatInfo)){formatter=V3.CultureInfo.currentCulture().dateTimeFormat()}}var dowOffset=null;var names=[].addRange(formatter.dayNames()).addRange(formatter.abbreviatedDayNames());for(var i=0;i<names.length;i++){if(strName.toLowerCase()==names[i].toLowerCase()){dowOffset=(i%7)-this.getDay();if(dowOffset>0){dowOffset-=7}break}}if(dowOffset===null){throw new Error(strName+" is not recognised as a valid Day of Week")}return this.addDays(dowOffset)};V3Date.min=function(){var m=arguments[0];for(var i=0;i<arguments.length;i++){if(arguments[i].valueOf()<m.valueOf()){m=arguments[i]}}return m};V3Date.max=function(){var m=arguments[0];for(var i=0;i<arguments.length;i++){if(arguments[i].valueOf()>m.valueOf()){m=arguments[i]}}return m};V3Date.parseStrict=function(strDate){if(typeof strDate!=="string"){return null}var Y=parseInt(strDate.substr(0,4),10),M=parseInt(strDate.substr(5,2),10),D=parseInt(strDate.substr(8,2),10),h=0,m=0,s=0,f=0;if(strDate.length>=15){h=parseInt(strDate.substr(11,2),10);m=parseInt(strDate.substr(14,2),10);if(strDate.length>=19){s=parseInt(strDate.substr(17,2),10)}if(strDate.length>=21){f=parseInt(strDate.rpad("0",23).substr(20,3),10)}if(!isFinite(s)){s=0}if(!isFinite(f)){f=0}}M=M-1;if(isNaN(Y)){throw new Error("unable to parse string: "+strDate)}return new V3Date(Y,M,D,h,m,s,f)};return V3Date})(Date);var TimeSpan=(function(){var SECOND=1000,MINUTE=SECOND*60,HOUR=MINUTE*60,DAY=HOUR*24;var TimeSpan=function(milliseconds){this.TotalDays=milliseconds/DAY;this.TotalHours=milliseconds/HOUR;this.TotalMinutes=milliseconds/MINUTE;this.TotalMilliseconds=milliseconds;if(milliseconds<DAY){this.Days=0}else{this.Days=Math.floor(milliseconds/DAY);milliseconds-=(this.Days*DAY)}if(milliseconds<HOUR){this.Hours=0}else{this.Hours=Math.floor(milliseconds/HOUR);milliseconds-=(this.Hours*HOUR)}if(milliseconds<MINUTE){this.Minutes=0}else{this.Minutes=Math.floor(milliseconds/MINUTE);milliseconds-=(this.Minutes*MINUTE)}if(milliseconds<SECOND){this.Seconds=0}else{this.Seconds=Math.floor(milliseconds/SECOND);milliseconds-=(this.Seconds*SECOND)}this.Milliseconds=milliseconds};TimeSpan.__struct=true;TimeSpan.prototype={toString:function(){var ret="";if(this.Days){ret=this.Days+":"}ret+=this.Hours+":"+this.Minutes+":"+this.Seconds;if(this.Milliseconds){ret+="."+this.Milliseconds}return ret},toShortString:function(){var ret="";if(this.Days){ret+=this.Days+"d"}if(this.Hours){ret+=" "+this.Hours+"h"}if(this.Minutes){ret+=" "+this.Minutes+"m"}if(this.Seconds){ret+=" "+this.Seconds+"s"}if(this.Milliseconds){ret+=" "+this.Milliseconds+"ms"}return ret.trim()},toLongString:function(){var fields=[];var t=TimeSpan._Terms;if(this.Days){fields.add(this.Days+" "+(this.Days>1?t.ds:t.d))}if(this.Hours){fields.add(this.Hours+" "+(this.Hours>1?t.hs:t.h))}if(this.Minutes){fields.add(this.Minutes+" "+(this.Minutes>1?t.ms:t.m))}if(this.Seconds){fields.add(this.Seconds+" "+(this.Seconds>1?t.ss:t.s))}var ret="";for(var i=0;i<fields.length;i++){if(i>0){if(i==fields.length-1){ret+=" "+t.and+" "}else{ret+=", "}}ret+=fields[i]}return ret}};TimeSpan.fromDays=function(days){return new TimeSpan(days*DAY)};TimeSpan.fromHours=function(hours){return new TimeSpan(hours*HOUR)};TimeSpan.fromMinutes=function(minutes){return new TimeSpan(minutes*MINUTE)};TimeSpan.fromSeconds=function(seconds){return new TimeSpan(seconds*SECOND)};TimeSpan._Terms={and:"and",d:"Day",ds:"Days",h:"Hour",hs:"Hours",m:"Minute",ms:"Minutes",s:"Second",ss:"Seconds"};return TimeSpan})();var StopWatch=function StopWatch(doStart,namedWatch){if(!StopWatch.NamedWatches){StopWatch.NamedWatches={}}if(namedWatch===undefined&&typeof doStart=="string"){namedWatch=doStart;doStart=undefined}if(!namedWatch){this.name="{Unnamed}"}else{this.name=namedWatch;if(StopWatch.NamedWatches[namedWatch]){var existing=StopWatch.NamedWatches[namedWatch];if(doStart){existing.start()}return existing}else{StopWatch.NamedWatches[namedWatch]=this}}this.reset(doStart)};StopWatch.__class=true;StopWatch.prototype={reset:function(doStart){var wasRunning=this._get_isRunning();this._startTime=new Date();this._lastDuration=0;this._set_isRunning(false);if(doStart){this.start()}return wasRunning},start:function(){if(this._get_isRunning()){return false}else{this._startTime=new Date();this._set_isRunning(true);return true}},stop:function(){var wasRunning;if(!this._get_isRunning()){wasRunning=false}else{this._lastDuration=this._calculateDuration();this._set_isRunning(false);wasRunning=true}return wasRunning},_calculateDuration:function(){return this._lastDuration+(new Date().getTime()-this._startTime.getTime())},getDuration:function(){if(this._get_isRunning()){return this._calculateDuration()}return this._lastDuration},_get_isRunning:function(){return this._isRunning},_set_isRunning:function(value){this._isRunning=value;this.isRunning=value},toString:function(){return this.name+(this._get_isRunning()?" {Is Running":" {Is Stopped")+" Duration="+this.getDuration()+"ms }"}};var Animation=function Animation(duration,offset,doPulsing,fStep){if(arguments.length<2||arguments.length>4){throw new Error("Invalid number of arguments specified")}if(arguments.length===2){fStep=arguments[1];doPulsing=false;offset=0}if(arguments.length===3){fStep=arguments[2];if(Is.Boolean(arguments[1])){doPulsing=arguments[1];offset=0}else{if(Is.Number(arguments[1])){offset=arguments[1];doPulsing=false}}}this._doRun=false;this._startCount=0;this._stopCount=0;this._duration=duration||400;this._effectiveDuration=this._duration/(doPulsing?2:1);this._timerId=0;this._doPulsing=doPulsing;this._repeatCount=0;this._stopCallback=null;this._offset=offset?(offset*this._effectiveDuration):0;this._fCallback=fStep;this.refreshRate=new V3.Property(this,20,function(value,prevValue,refSubstitute){if(value<0.5){refSubstitute.value=1}else{if(value>60){refSubstitute.value=60}}});this.refreshRate.OnChange.addEventHandler(function(value){this._setTimer()});this.OnStart=new V3.EventType("V3.Utils.Animation.OnStart","sender",{owner:this});this.OnCompleted=new V3.EventType("V3.Utils.Animation.OnCompleted","sender",{owner:this})}.InheritsFrom(V3.Class,{_timerId:0,_startCount:0,_repeatCount:0,_position:0,_resumePosition:0,_fun:function(){var stopRunning=false;var now=new Date().getTime();if(!this._startCount){this._startCount=now;this._stopCount=now+this._duration}if(this._repeatCount==-1){if(!this._doRun){stopRunning=true}}else{if(now>=this._stopCount){if(!this._doRun||this._repeatCount==0){now=this._startCount+this._duration;stopRunning=true}else{if(this._repeatCount>0){this._repeatCount-=1;this._startCount=now}}}}var steppingBackwards=false;var ms=(now-this._startCount);this._position=ms;ms=(ms+this._offset)%this._duration;if(ms>this._effectiveDuration){ms=this._duration-ms;steppingBackwards=true}var x=ms/this._effectiveDuration;var easedPercentage;if(!steppingBackwards){easedPercentage=-1*(x)*(x-2)}else{easedPercentage=1*(x)*x}this._fCallback(x,easedPercentage,steppingBackwards);if(stopRunning){clearInterval(this._timerId);this._timerId=0;this._callStopCallback();this.OnCompleted.fire(this);this._startCount=0}},_callStopCallback:function(){if(Is.Function(this._stopCallback)){this._stopCallback();this._stopCallback=null}},_setTimer:function(){if(this._timerId){clearInterval(this._timerId)}if(this._doRun){var animation=this;this._timerId=setInterval(function(){animation._fun()},1000/this.refreshRate())}},start:function(repeatCount,resumeData){this._doRun=true;if(Is.Number(repeatCount)){this._repeatCount=repeatCount}else{if(this._repeatCount<=0){this._repeatCount=-1}}if(Is.Specified(resumeData)){this._resumePosition=resumeData}if(this._resumePosition){this._startCount=(new Date().valueOf())-this._resumePosition;this._resumePosition=0}this._setTimer();this.OnStart.fire(this)},pause:function(){this._doRun=false;this._setTimer();this._resumePosition=this._position;return this._resumePosition},stop:function(callBack){this._position=0;this._resumePosition=0;this._stopCallback=callBack;if(this._timerId){this._doRun=false}else{this._callStopCallback()}}});var OnLoad=new V3.EventType("Document.OnLoad","",true);var OnLoaded=new V3.EventType("OnLoaded","",true);var OnEventError=new V3.EventType("OnEventError","eventName, err, paramArray",false,true);OnLoad.addEventHandler(function(){if(_debugMode){V3.enableDebugMode()}if(V3.debugMode){Log.Info("OnLoad invoked")}});var __debugModeEnabled=false;V3.enableDebugMode=function(silent){if(__debugModeEnabled){return}__debugModeEnabled=true;V3.debugMode=(silent?"silent":true)};var Color=function(){var r=arguments[0],g=arguments[1],b=arguments[2],a=arguments[3];if(arguments.length<=2){if(arguments[0] instanceof Color){r=arguments[0].R;g=arguments[0].G;b=arguments[0].B;a=arguments[0].A;if(arguments.length===2){a=arguments[1]}}else{if(Is.Number(arguments[0])){if(arguments[0]%1!==0){throw new Error("number must be a whole number")}var value=arguments[0];if(arguments.length===2){a=arguments[1]}r=(value&16711680)>>16;g=(value&65280)>>8;b=(value&255)}else{throw new Error("Invalid arguments")}}}if(r%1!==0){throw new Error("r must be a whole number")}if(g%1!==0){throw new Error("g must be a whole number")}if(b%1!==0){throw new Error("b must be a whole number")}this.R=r;this.G=g;this.B=b;if(Is.Number(a)){this.A=a}else{this.A=1}};V3.extend(Color.prototype,true,{R:0,G:0,B:0,A:0,blend:function(color,strength){if(Is.Number(color)){color=new V3.Color(color)}var r=Math.max(0,Math.min(255,Math.round((this.R*(1-strength))+(color.R*strength))));var g=Math.max(0,Math.min(255,Math.round((this.G*(1-strength))+(color.G*strength))));var b=Math.max(0,Math.min(255,Math.round((this.B*(1-strength))+(color.B*strength))));var a=Math.max(0,Math.min(1,Math.round((this.A*(1-strength))+(color.A*strength))));return new V3.Color(r,g,b,a)},grayscale:function(){var greyLevel=Math.round(this.R*0.3+this.G*0.59+this.B*0.11);return new V3.Color(greyLevel,greyLevel,greyLevel,this.A)},toString:function(hex){if(hex===true||(!Is.Specified(hex)&&this.A===1)){return"#"+this.R.toString(16).lpad("0",2)+this.G.toString(16).lpad("0",2)+this.B.toString(16).lpad("0",2)}else{if(hex===false||this.A===1){return"rgb("+this.R+","+this.G+","+this.B+")"}else{return"rgba("+this.R+","+this.G+","+this.B+","+this.A+")"}}},Set:function(obj){if(Is.Number(obj.R)){this.R=obj.R}if(Is.Number(obj.G)){this.G=obj.G}if(Is.Number(obj.B)){this.B=obj.B}if(Is.Number(obj.A)){this.A=obj.A}return this},setHSV:function(h,s,v,a){var rgb=V3.Color.Hsv2rgb(h,s,v);this.R=rgb.r;this.G=rgb.g;this.B=rgb.b;if(arguments.length===4){this.A=a}},getHSV:function(){var hsv=V3.Color.RgbToHsv(this.R,this.G,this.B);return{H:hsv.h,S:hsv.s,V:hsv.v,A:this.A}},offsetHue:function(degreeOffset){var hsv=this.getHSV();hsv.H=((hsv.H*360+degreeOffset)%360)/360;var ret=new V3.Color(0);ret.setHSV(hsv.H,hsv.S,hsv.V,hsv.A);return ret}});V3.extend(Color,{__class:true,parse:function(str){var m=/#?[0-9a-f]{3}||#?[0-9a-f]{6}/i.exec(str);if(m){if(str.startsWith("#")){str=str.substr(1)}var r,g,b;if(str.length==3){r=parseInt(str.substr(0,1),16);r=r+(r<<8);g=parseInt(str.substr(1,1),16);g=g+(g<<8);b=parseInt(str.substr(2,1),16);b=b+(b<<8)}else{r=parseInt(str.substr(0,2),16);g=parseInt(str.substr(2,2),16);b=parseInt(str.substr(4,2),16)}return new V3.Color(r,g,b)}var m=/rgba?\((\d+),(\d+),(\d+)(,\d+)?\)/i.exec(str);if(m){if(m.groups.length===3){return new V3.Color(m.groups[1],m.groups[2],m.groups[3])}else{return new V3.Color(m.groups[1],m.groups[2],m.groups[3],m.groups[4])}return}throw new Error("Unable to parse string '"+str+"' to colour")},Blend:function(firstHex,secondHex,decimalPercentage){var c1=V3.Color.parse(firstHex);var c2=V3.Color.parse(secondHex);return c1.blend(c2,decimalPercentage).toString(true)},RetrieveColors:function(stringWithColor){stringWithColor=stringWithColor.toLowerCase();var i=0;var ret=[];while(true){var i1=stringWithColor.indexOf("rgb",i);var i2=stringWithColor.indexOf("#",i);if(i1==-1){if(i2==-1){break}else{i=i2}}else{if(i2==-1){i=i1}else{i=Math.min(i1,i2)}}var val=null;var isHash=(i==i2);if(isHash){i++;val=stringWithColor.substr(i,6);if(isFinite(parseInt(val.substr(3,3),16))){i+=6}else{i+=3;val=val.substr(0,1)+val.substr(0,1)+val.substr(1,1)+val.substr(1,1)+val.substr(2,1)+val.substr(2,1)}}else{i+=3;var s=stringWithColor.indexOf("(",i);if(s!=-1){var e=stringWithColor.indexOf(")",s);if(e!=-1){i=e;s++;val=stringWithColor.substr(s,e-s);var split=val.split(",");if(split.length>=3){val=parseInt(split[0],10).toString(16).lpad("0",2)+parseInt(split[1],10).toString(16).lpad("0",2)+parseInt(split[2],10).toString(16).lpad("0",2)}}}}if(val!=null&&isFinite(parseInt(val,16))){ret.add(val)}}return ret},RetrieveColor:function(stringWithColor){var arr=V3.Color.RetrieveColors(stringWithColor);if(arr.length>0){return arr[0]}return null},Hsv2rgb:function(h,s,v){var var_r,var_g,var_b;if(s==0){return{r:Math.round(v*255),g:Math.round(v*255),b:Math.round(v*255)}}else{var var_h=h*6;if(var_h==6){var_h=0}var var_i=Math.floor(var_h);var var_1=v*(1-s);var var_2=v*(1-s*(var_h-var_i));var var_3=v*(1-s*(1-(var_h-var_i)));if(var_i==0){var_r=v;var_g=var_3;var_b=var_1}else{if(var_i==1){var_r=var_2;var_g=v;var_b=var_1}else{if(var_i==2){var_r=var_1;var_g=v;var_b=var_3}else{if(var_i==3){var_r=var_1;var_g=var_2;var_b=v}else{if(var_i==4){var_r=var_3;var_g=var_1;var_b=v}else{var_r=v;var_g=var_1;var_b=var_2}}}}}return{r:Math.round(var_r*255),g:Math.round(var_g*255),b:Math.round(var_b*255)}}},RgbToHsv:function(r,g,b){r=r/255;g=g/255;b=b/255;var max=Math.max(r,g,b),min=Math.min(r,g,b);var h,s,v=max;var d=max-min;s=(max==0)?0:d/max;if(max==min){h=0}else{switch(max){case r:h=(g-b)/d+(g<b?6:0);break;case g:h=(b-r)/d+2;break;case b:h=(r-g)/d+4;break}h/=6}return{h:h,s:s,v:v}},fromHSV:function(h,s,v,a){if(arguments.length===3){a=1}var rgb=V3.Color.Hsv2rgb(h,s,v);return new V3.Color(rgb.r,rgb.g,rgb.b,a)},getHueFromNumber:function(number,initialHue){if(arguments.length===1){initialHue=0}var hue=initialHue+(number*222.49223594996215);return Math.floor(hue%360)/360}});var Colors=(function(){return{Transparent:new Color(0,0),Black:new Color(0,1),Grey:new Color(8947848,1),White:new Color(16777215,1),Red:new Color(16711680,1),DarkRed:new Color(8912896,1),Green:new Color(65280,1),DarkGreen:new Color(34816,1),Blue:new Color(255,1),DarkBlue:new Color(136,1),Yellow:new Color(16776960,1),Orange:new Color(8947712,1),Cyan:new Color(65535,1),Teal:new Color(34952,1),Magenta:new Color(16711935,1),Purple:new Color(8913032,1)}})();var Cookies=V3.Class();Cookies.__defaultPath="/";Cookies.get=function(name){name=escape(name);var regex=new RegExp("(^| )"+RegExp.escape(name)+"(=(.*?))?(;|$)");var matches=regex.exec(document.cookie);if(matches==null){return null}return unescape(matches[3]||"")};Cookies.set=function(name,value,optionalExpiryDate,optionalPath){if(value===null){value=""}var expiry=((optionalExpiryDate instanceof Date)?optionalExpiryDate:new V3Date().addDays(365)).toUTCString();var path=(typeof optionalPath=="string")?path=optionalPath:path=Cookies.__defaultPath;document.cookie=escape(name)+"="+escape(value)+";expires="+expiry+";path="+escape(path)+";"};Cookies.contains=function(name){return Cookies.get(name)!=null};Cookies.remove=function(name,optionalPath){Cookies.set(name,"",new V3Date().addDays(-1),optionalPath)};Cookies.setGlobal=function(name,value,optionalExpiryDate){Cookies.set(name,value,optionalExpiryDate,"/")};Cookies.removeGlobal=function(name){Cookies.set(name,"",new V3Date().addDays(-1),"/")};V3.Collection=function Collection(owner,doAddAt,doRemoveAt,doClear){if(Is.Function(arguments[0])){doClear=arguments[2];doRemoveAt=arguments[1];doAddAt=arguments[0];owner=this}this.base();this._collection=[];if(doAddAt){if(!Is.Function(doAddAt)){throw new Error("doAddAt must be a function.")}this._doAddAt=doAddAt}if(doRemoveAt){if(!Is.Function(doRemoveAt)){throw new Error("doRemoveAt must be a function.")}this._doRemoveAt=doRemoveAt}if(doClear){if(!Is.Function(doClear)){throw new Error("doClear must be a function.")}this._doClear=doClear}this.owner=owner}.InheritsFrom(V3.Class,{OnChange:V3.EventPrototype("sender, e:{action:'add' or 'remove', item: newChild, index: 0}"),_collection:[],_doAddAt:function(item,index,base){base()},_doRemoveAt:function(item,index,base){base()},_doClear:function(base){base()},count:V3.PropertyPrototype(function(){return this._collection.length}),add:function(child,blockDuplicates){return this.addAt(this._collection.length,child,blockDuplicates)},addAt:function(index,child,blockDuplicates){if(!isFinite(index)){throw new Error("index number be a valid number.")}if(index<0||index>this._collection.length){throw new Error("index out of bounds")}if(blockDuplicates&&this._collection.contains(child)){return false}var me=this;var ret=this._doAddAt.call(this.owner,child,index,function(){me._collection.addAt(index,child);me.OnChange.fire(me,{action:"add",item:child,index:index})});return(ret!==false)},addRange:function(arr,blockDuplicates){if(arr instanceof Array){arr.forEach(function(item){this.add(item,blockDuplicates)},this)}else{if(Is.Arguments(arr)){for(var i=0;i<arr.length;i++){this.add(arr[i],blockDuplicates)}}else{throw new Error("'arr' needs to be of type Array, instead received typeof: "+(typeof arr)+".")}}return this},get:function(index){if(index<0||index>=this._collection.length){throw new Error("index out of bounds")}return this._collection[index]},remove:function(child){var index=this._collection.indexOf(child);if(index==-1){return false}else{return this.removeAt(index)}},removeAt:function(index){if(index<0||index>=this._collection.length){throw new Error("index out of bounds")}var me=this;var ret=this._doRemoveAt.call(this.owner,this._collection[index],index,function(){var item=me._collection[index];me._collection.removeAt(index);me.OnChange.fire(me,{action:"remove",item:item,index:index})});return(ret!==false)},forEach:function(thisArg,fCallback){var args=[this._collection].addRange(arguments);return V3.forEach.apply(this,args)},find:function(fCallback,thisArg){return this._collection.find(fCallback,thisArg)},exists:function(fCallback,thisArg){return this._collection.exists(fCallback,thisArg)},toArray:function(){return[].concat(this._collection)},indexOf:function(child){return this._collection.indexOf(child)},contains:function(child){return this.indexOf(child)!==-1},clear:function(){var me=this;if(me._collection.length==0){return}this._doClear.call(this.owner,function(inBulk){if(inBulk){me._collection.clear()}else{while(me._collection.length>0){me.removeAt(me._collection.length-1)}}})},insertBefore:function(child,existingChild){var index;if(Is.Specified(existingChild)){index=this.indexOf(existingChild);if(index===-1){throw new Error("existingChild does not currently exist in collection.")}}else{index=this._collection.length}this.addAt(index,child)},insertAfter:function(child,existingChild){var index;if(Is.Specified(existingChild)){index=this.indexOf(existingChild);if(index===-1){throw new Error("existingChild does not currently exist in collection.")}}else{index=this._collection.length-1}this.addAt(index+1,child)},toString:function(){return V3.Class.prototype.toString.call(this)+" (count="+this.count()+")"}});var DataTransfer=function DataTransfer(input){this.base();var e;if(Is.String(input)){e=document.getElementById(input)}else{e=input}if(this._instances[e.id]){return this._instances[e.id]}else{this._instances[e.id]=this}var d;if(e.value){d=JSON.parse(e.value)}else{d={}}this.data(d);this.DOMElement=e;OnSubmit.addEventHandler(this._OnSubmit.bind(this))}.InheritsFrom(V3.Class,{_instances:{},DOMElement:null,data:V3.PropertyPrototype(null),OnCommit:V3.EventPrototype("sender, e"),_OnSubmit:function(form,e){var d=this.data();var cancel=false;var args={data:d};this.OnCommit.fire(this,args);if(!cancel){if(args.data){this.DOMElement.value=JSON.stringify(args.data)}else{this.DOMElement.value=""}}}});var LocalStorage=(function(){var LocalStorageInstanceReference={};var directReadAndParse=function(key){var data=window.localStorage.getItem(key);if(!data){return null}try{return V3.parseJson(data)}catch(error){Log.Error("Failure to parse JSON, so removing it from the storage: "+data,"error",error);removeFromStorage(key);return null}};var directWrite=function(key,value){if(value===null){window.localStorage.removeItem(key)}else{window.localStorage.setItem(key,JSON.stringify(value))}};var removeFromStorage=function(key){window.localStorage.removeItem(key)};var updateLastModified=function(){directWrite("V3._LastModified",new Date())};var getLastModified=function(){return directReadAndParse("V3._LastModified")};var getCompositeKey=function(staticKey,dynamicKey,sessionKey){if(!staticKey){throw new Error("staticKey is missing")}if(!dynamicKey){throw new Error("dynamicKey is missing")}if(!sessionKey){return staticKey+"["+dynamicKey+"]"}else{return staticKey+"["+dynamicKey+":"+sessionKey+"]"}};var getStoreMetaKey=function(compositeKey){return"V3.Store."+compositeKey};var getItemDataKey=function(compositeKey,itemKey){return"V3.ItemData."+compositeKey+".["+itemKey+"]"};var getItemMetaKey=function(compositeKey,itemKey){return"V3.ItemMeta."+compositeKey+".["+itemKey+"]"};var isExpired=function(meta){if(meta.absoluteExpiration){if(meta.absoluteExpiration<=new Date()){return true}}if(meta.slidingExpiration){if(meta.lastModified.asV3Date().addSeconds(meta.slidingExpiration)<=new Date()){return true}}return false};var _lastModified=new Date();var _nextCull=new Date();var funSyncStorage=function(){var lastModified=getLastModified();if(lastModified&&_lastModified.valueOf()===lastModified+0&&_nextCull>new Date()){return}_lastModified=lastModified||_lastModified;_nextCull=new V3Date().addSeconds(10);for(var i=window.localStorage.length-1;i>=0;i--){var key=window.localStorage.key(i);if(!key||key.indexOf("V3.")!==0){continue}if(key.indexOf("V3.Store.")===0){var storeMeta=directReadAndParse(key);if(storeMeta&&isExpired(storeMeta)){Log.Warn("Data store expired, about to destroy: "+storeMeta.CompositeKey,"Keys",storeMeta.Keys);var instance=LocalStorageInstanceReference[storeMeta.CompositeKey];if(instance){instance._clearInternal(false)}else{LocalStorage._destory(storeMeta.CompositeKey)}}}else{if(key.indexOf("V3.ItemMeta.")===0){var itemMeta=directReadAndParse(key);if(itemMeta){var instance=LocalStorageInstanceReference[itemMeta.StoreCompositeKey];if(isExpired(itemMeta)){if(instance){instance._removeItemInternal(false,itemMeta.ItemKey)}else{removeFromStorage(key);updateLastModified()}}else{if(instance&&instance.enableCrossInstanceUpdates()){instance._notifyOfItem(itemMeta)}}}}}}for(var lsInstanceId in LocalStorageInstanceReference){var lsInstance=LocalStorageInstanceReference[lsInstanceId];if(lsInstance.enableCrossInstanceUpdates()){if(window.localStorage.getItem(lsInstance._storageKey)===null){if(lsInstance._existsInStorage){Log.Warn("Data store not in storage any more, about to destroy: "+lsInstance._compositeKey,"Keys",lsInstance._meta.Keys);lsInstance._clearInternal(false)}}else{for(var i=lsInstance._meta.Keys.length-1;i>=0;i--){var itemKey=lsInstance._meta.Keys[i];var key=getItemMetaKey(lsInstance._compositeKey,itemKey);if(window.localStorage.getItem(key)===null){lsInstance._removeItemInternal(false,itemKey)}}}}}};var startPollingTimer=function(){if(!startPollingTimer._timerId){funSyncStorage();startPollingTimer._timerId=setInterval(funSyncStorage,750)}};var LocalStorage=function LocalStorage(staticKey,key,sessionId,slidingExpiration,absoluteExpiration){this.base();if(!window.localStorage){Log.Warn("sessionStorage is not available, bookingProcessor cannot persist contents.");return}startPollingTimer();if(!slidingExpiration&&!absoluteExpiration){throw new Error("expiration must be supplied")}if(slidingExpiration instanceof TimeSpan){slidingExpiration=Math.floor(slidingExpiration.TotalMilliseconds/1000)}this._compositeKey=getCompositeKey(staticKey,key,sessionId);if(!LocalStorageInstanceReference[this._compositeKey]){LocalStorageInstanceReference[this._compositeKey]=this}else{return LocalStorageInstanceReference[this._compositeKey]}this._storageKey=getStoreMetaKey(this._compositeKey);this._meta=directReadAndParse(this._storageKey);if(this._meta){this.Keys.addRange(this._meta.Keys)}else{this._meta={lastModified:new Date(),CompositeKey:this._compositeKey,Keys:[]}}this._meta.slidingExpiration=slidingExpiration;this._meta.absoluteExpiration=absoluteExpiration;this._writeMeta();updateLastModified()}.InheritsFrom(V3.Class,{OnChange:V3.EventPrototype("sender, e"),_compositeKey:null,_storageKey:null,_meta:!window.vsDesignTime?null:{Keys:[],lastModified:new Date()},_itemLastModified:V3.Object(),_existsInStorage:false,Keys:V3.Object([]),_pollTimerId:null,enableCrossInstanceUpdates:V3.Property(true),_writeMeta:function(){directWrite(this._storageKey,this._meta);this._existsInStorage=true},_getStorageKeyForItemMeta:function(itemKey){return getItemMetaKey(this._compositeKey,itemKey)},_getStorageKeyForItemData:function(itemKey){return getItemDataKey(this._compositeKey,itemKey)},count:V3.Property(function get(){return this._meta.Keys.length}),clear:function(){this._clearInternal(true)},_clearInternal:function(isLocalTrigger){if(isLocalTrigger){this._meta.Keys.forEach(this.removeItem.bind(this))}else{this._meta.Keys.forEach(this._removeItemInternal.bind(this,false))}LocalStorage._destory(this._compositeKey);this._existsInStorage=false},getItem:function(itemKey){return directReadAndParse(this._getStorageKeyForItemData(itemKey))},setItem:function(itemKey,item,slidingExpiration,absoluteExpiration){if(itemKey===null||V3.Is.Undefined(itemKey)){throw new Error("itemKey must be specified")}if(V3.Is.Undefined(item)){throw new Error("item must be defined")}if(item===null){throw new Error("item cannot be null due to limitations of local storage")}if(slidingExpiration===0){slidingExpiration=null}this.Keys.add(itemKey,true);this._meta.Keys.add(itemKey,true);this._meta.lastModified=new Date();this._writeMeta();var itemMetaKey=this._getStorageKeyForItemMeta(itemKey);var itemMeta=directReadAndParse(itemMetaKey);if(!itemMeta){itemMeta={StoreCompositeKey:this._compositeKey,ItemKey:itemKey}}itemMeta.lastModified=new Date();if(!V3.Is.Undefined(slidingExpiration)){itemMeta.slidingExpiration=slidingExpiration}if(!V3.Is.Undefined(absoluteExpiration)){itemMeta.absoluteExpiration=absoluteExpiration}directWrite(itemMetaKey,itemMeta);directWrite(this._getStorageKeyForItemData(itemMeta.ItemKey),item);this._itemLastModified[itemKey]=itemMeta.lastModified;updateLastModified();this.OnChange.fire(this,{action:"set",itemKey:itemMeta.ItemKey,item:item,trigger:"local"})},removeItem:function(itemKey){this._meta.lastModified=new Date();this._removeItemInternal(true,itemKey);updateLastModified()},_removeItemInternal:function(isLocalTrigger,itemKey){removeFromStorage(this._getStorageKeyForItemData(itemKey));removeFromStorage(this._getStorageKeyForItemMeta(itemKey));delete this._itemLastModified[itemKey];this._meta.Keys.remove(itemKey);if(isLocalTrigger){this._meta.lastModified=new Date();this._writeMeta()}this.Keys.remove(itemKey);this.OnChange.fire(this,{action:"removed",itemKey:itemKey,trigger:isLocalTrigger?"local":"remote"})},_notifyOfItem:function(itemMeta){this._existsInStorage=true;var itemKey=itemMeta.ItemKey;if(!this._itemLastModified[itemKey]||this._itemLastModified[itemKey]<itemMeta.lastModified){this._itemLastModified[itemKey]=itemMeta.lastModified;this.Keys.add(itemMeta.ItemKey,true);this._meta.Keys.add(itemMeta.ItemKey,true);var item=directReadAndParse(this._getStorageKeyForItemData(itemMeta.ItemKey));this.OnChange.fire(this,{action:"set",itemKey:itemMeta.ItemKey,item:item,trigger:"remote"})}}});LocalStorage._destory=function(compositeKey){var meta=directReadAndParse(getStoreMetaKey(compositeKey));if(!meta){return}meta.Keys.forEach(function(itemKey){removeFromStorage(getItemDataKey(compositeKey,itemKey));removeFromStorage(getItemMetaKey(compositeKey,itemKey))});removeFromStorage(getStoreMetaKey(compositeKey));updateLastModified()};return LocalStorage})();var CultureInfo=function CultureInfo(config,prototype){this.base();this._currencyISOAbbreviation=config.CurrencyISOAbbreviation;this._twoLetterISOLanguageName=config.TwoLetterISOLanguageName;this._threeLetterISOLanguageName=config.ThreeLetterISOLanguageName;this._regionId=config.RegionId;this._niCurrency=new NumberFormatInfo(config.CurrencyFormatInfo,prototype?prototype._niCurrency:null);this._dateTimeFormat=new DateTimeFormatInfo(config.DateTimeFormat);this._niNumber=new NumberFormatInfo(config.NumberFormat);this._niPercent=new NumberFormatInfo(config.PercentFormat)}.InheritsFrom(V3.Class,{_niCurrency:null,_niNumber:null,_niPercent:null,twoLetterISOLanguageName:V3.Property(function get(){return this._twoLetterISOLanguageName}),threeLetterISOLanguageName:V3.Property(function get(){return this._threeLetterISOLanguageName}),currencyNumberFormat:V3.Property(function get(){return this._niCurrency}),numberNumberFormat:V3.Property(function get(){return this._niNumber}),percentNumberFormat:V3.Property(function get(){return this._niPercent}),currencyISOAbbreviation:V3.Property(function get(){return this._currencyISOAbbreviation}),dateTimeFormat:V3.Property(function get(){return this._dateTimeFormat}),regionId:V3.Property(function get(){return this._regionId}),name:V3.Property(function get(){return !this._regionId?this._twoLetterISOLanguageName:(this._twoLetterISOLanguageName+"-"+this._regionId)}),toString:function(){return this.name()},formatNumber:function(number,str){var letter=(typeof str==="string"&&str.substr(0,1).toUpperCase());var dd=str.length==1?null:parseInt(str.substr(1),10);var numFormatter;switch(letter){case"C":numFormatter=this.currencyNumberFormat();break;case"N":numFormatter=this.numberNumberFormat();break;case"P":numFormatter=this.percentNumberFormat();break;default:throw new Error("Not implemented or supported format string: "+str)}return numFormatter.formatNumber(number,dd)}});var _PositiveNumberPatterns=[function(c,v){return c+v},function(c,v){return v+c},function(c,v){return c+"\xA0"+v},function(c,v){return v+"\xA0"+c}];var _NegativeNumberPatterns=[function(c,v,n){return"("+c+v+")"},function(c,v,n){return n+c+v},function(c,v,n){return c+n+v},function(c,v,n){return c+v+n},function(c,v,n){return"("+v+c+")"},function(c,v,n){return n+v+c},function(c,v,n){return v+n+c},function(c,v,n){return v+c+n},function(c,v,n){return n+v+"\xA0"+c},function(c,v,n){return n+c+"\xA0"+v},function(c,v,n){return v+"\xA0"+c+n},function(c,v,n){return c+"\xA0"+v+n},function(c,v,n){return c+"\xA0"+n+v},function(c,v,n){return v+n+"\xA0"+c},function(c,v,n){return"("+c+"\xA0"+v+")"},function(c,v,n){return"("+v+"\xA0"+c+")"}];var RoundMidpointAwayFromZero=function(n,dd){var m=Math.pow(10,dd);var s=Math.sign(n);n=n*m*s;return Math.round(n)/m*s};var NumberFormatInfo=function NumberFormatInfo(config,prototype){this.base();var c=this._config={DecimalDigits:2,DecimalSeparator:".",GroupSeparator:",",GroupSizes:[3],PositivePattern:0,NegativePattern:1,Symbol:"$",NegativeSign:"-",Multiplier:1};if(prototype&&prototype._config){V3.extend(c,true,prototype._config)}V3.extend(c,true,config);if(!c.Multiplier){c.Multiplier=1}c.PositivePattern=Math.max(0,Math.min(c.PositivePattern||0,_PositiveNumberPatterns.length-1));c.NegativePattern=Math.max(0,Math.min(c.NegativePattern||0,_NegativeNumberPatterns.length-1));if(!c.GroupSizes||c.GroupSizes.length==0){c.GroupSizes=[0]}this._addSymbolPos=_PositiveNumberPatterns[this._config.PositivePattern];this._addSymbolNeg=_NegativeNumberPatterns[this._config.NegativePattern]}.InheritsFrom(V3.Class,{_config:{},_groupDigits:function(s){var groups=this._config.GroupSizes;var gi=0;var ret=[];for(var i=s.length;i>0;i-=size){var size=groups[gi++];if(gi>=groups.length){gi=groups.length-1}if(i-size<0){size=i}if(size>0){ret.add(s.substr(i-size,size))}else{ret.add(s.substr(0,i));break}}return ret.reverse().join(this._config.GroupSeparator)},decimalDigits:V3.Property(function get(){return this._config.DecimalDigits}),decimalSeparator:V3.Property(function get(){return this._config.DecimalSeparator}),groupSeparator:V3.Property(function get(){return this._config.GroupSeparator}),groupSizes:V3.Property(function get(){return[].addRange(this._config.GroupSizes)}),positivePattern:V3.Property(function get(){return this._config.PositivePattern}),negativePattern:V3.Property(function get(){return this._config.NegativePattern}),symbol:V3.Property(function get(){return this._config.Symbol}),negativeSign:V3.Property(function get(){return this._config.NegativeSign}),setPatternsToIncludeSpaces:function(){var mapPositive=[2,3,2,3];var mapNegative=[14,9,12,11,15,8,13,10,8,9,10,11,12,13,14,15];this._config.PositivePattern=mapPositive[this._config.PositivePattern];this._config.NegativePattern=mapNegative[this._config.NegativePattern];this._addSymbolPos=_PositiveNumberPatterns[this._config.PositivePattern];this._addSymbolNeg=_NegativeNumberPatterns[this._config.NegativePattern]},formatNumber:function(n,dd){if(typeof n!=="number"){throw new Error("Invalid value: "+n)}if(isNaN(n)){return"NaN"}var strSymbol=(this._config.Symbol===null)?"":this._config.Symbol;dd=(dd!==null&&isFinite(dd))?dd:this._config.DecimalDigits;n=RoundMidpointAwayFromZero(n,dd);n=n*this._config.Multiplier;var strs=Math.abs(n).toFixed(dd).split(".");var strNum=this._groupDigits(strs[0]);if(dd>0){strNum=strNum+this._config.DecimalSeparator+strs[1]}return(n<0?this._addSymbolNeg:this._addSymbolPos)(strSymbol,strNum,this._config.NegativeSign)}});var DateTimeFormatInfo=function DateTimeFormatInfo(config){this.base();this._config=config}.InheritsFrom(V3.Class,{dayNames:V3.Property(function get(){return this._config.DayNames}),monthNames:V3.Property(function get(){return this._config.MonthNames}),abbreviatedDayNames:V3.Property(function get(){return this._config.AbbreviatedDayNames}),abbreviatedMonthNames:V3.Property(function get(){return this._config.AbbreviatedMonthNames}),shortestDayNames:V3.Property(function get(){return this._config.ShortestDayNames}),amDesignator:V3.Property(function get(){return this._config.AMDesignator}),pmDesignator:V3.Property(function get(){return this._config.PMDesignator}),longDatePattern:V3.Property(function get(){return this._config.LongDatePattern}),shortDatePattern:V3.Property(function get(){return this._config.ShortDatePattern}),longTimePattern:V3.Property(function get(){return this._config.LongTimePattern}),shortTimePattern:V3.Property(function get(){return this._config.ShortTimePattern}),yearMonthPattern:V3.Property(function get(){return this._config.YearMonthPattern}),monthDayPattern:V3.Property(function get(){return this._config.MonthDayPattern}),fullDateTimePattern:V3.Property(function get(){return this._config.FullDateTimePattern}),firstDayOfWeek:V3.Property(function get(){return this._config.FirstDayOfWeek})});CultureInfo.invariantCulture=new V3.Property(null,function get(){return new CultureInfo({RegionId:null,CurrencyISOAbbreviation:"",TwoLetterISOLanguageName:"iv",ThreeLetterISOLanguageName:"ivl",CurrencyFormatInfo:{DecimalDigits:2,DecimalSeparator:".",GroupSeparator:",",GroupSizes:[3],NegativePattern:0,PositivePattern:0,Symbol:"¤",NegativeSign:"-"},DateTimeFormat:{DayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],MonthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],AbbreviatedDayNames:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],AbbreviatedMonthNames:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],ShortestDayNames:["Su","Mo","Tu","We","Th","Fr","Sa"],AMDesignator:"AM",PMDesignator:"PM",LongDatePattern:"dddd, dd MMMM yyyy",ShortDatePattern:"MM/dd/yyyy",LongTimePattern:"HH:mm:ss",ShortTimePattern:"HH:mm",YearMonthPattern:"yyyy MMMM",MonthDayPattern:"MMMM dd",FullDateTimePattern:"dddd, dd MMMM yyyy HH:mm:ss"}})});CultureInfo.currentCulture=new V3.Property(null,CultureInfo.invariantCulture(),function setter(value,currentValue,ref){if(value===null){throw new Error("value cannot be nul")}});CultureInfo.currentUICulture=new V3.Property(null,CultureInfo.invariantCulture(),function setter(value,currentValue,ref){if(value===null){throw new Error("value cannot be nul")}});(function(){var orig=Number.prototype.toStringFormat;Number.prototype.toStringFormat=function(str,formatProvider){var letter=(typeof str==="string"&&str.substr(0,1).toUpperCase());if(letter==="C"||letter==="N"||letter==="P"){return(formatProvider||CultureInfo.currentCulture()).formatNumber(this.valueOf(),str)}else{return orig.apply(this,[].addRange(arguments))}};Number.prototype.toStringUI=function(str){return V3.CultureInfo.currentUICulture().formatNumber(this.valueOf(),str||"N")};Date.prototype.toStringUI=function(str,formatProvider){if(arguments.length==1){formatProvider=V3.CultureInfo.currentUICulture()}return Date.prototype.toStringFormat.call(this,str,formatProvider)}})();V3.Constants={EMPTY_FUNCTION:EMPTY_FUNCTION};V3.Color=Color;V3.Colors=Colors;V3.Cookies=Cookies;V3.LocalStorage=LocalStorage;V3.TimeSpan=TimeSpan;V3.CultureInfo=CultureInfo;V3.NumberFormatInfo=NumberFormatInfo;V3.DateTimeFormatInfo=DateTimeFormatInfo;V3.Utils.DataTransfer=DataTransfer;V3.Utils.StopWatch=StopWatch;V3.Utils.Animation=Animation;V3.Utils.OnLoad=OnLoad;V3.Utils.OnLoaded=OnLoaded;V3.Utils.OnEventError=OnEventError;var fInitScroll=function(){var lx=null,ly=null;V3.AddEventHandler(window,"scroll",function(event){var x=window.pageXOffset;var y=window.pageYOffset;if(lx!=x||ly!=y){lx=x;ly=y;V3.Utils.OnScroll.fire({event:event,x:x,y:y})}})};V3.Utils._CheckResize=EMPTY_FUNCTION;var fInitResizeTimer=function(){var debug=V3.debuggingEnabledFor("resize");var lw=-1,lh=-1;var lastUpdate=null;var fCheckResize=function(event){var w=document.body.scrollWidth,h=document.body.scrollHeight;if(lw!=w||lh!=h){lastUpdate=(new Date()).valueOf();if(debug){V3.Log.Info("Resized: "+w+"\t"+h+"\t")}lw=w;lh=h;V3.Utils.OnResize.fire({event:event||window.event,width:w,height:h,x:window.pageXOffset,y:window.pageYOffset});return true}};V3.AddEventHandler(window,"resize",function(event){fCheckResize(event);V3.Utils._CheckResize()});var tmrUpdate=null;V3.Utils._CheckResize=function(){lastUpdate=(new Date()).valueOf();if(!tmrUpdate){if(debug){V3.Log.Info("Starting resize timer")}if(debug){V3.Log.Info("ChckRsz: "+document.body.scrollWidth+"\t"+document.body.scrollHeight)}tmrUpdate=setInterval(function(){if(((new Date()).valueOf()-lastUpdate)>750){if(debug){V3.Log.Info("Cancelling resize timer")}clearInterval(tmrUpdate);tmrUpdate=null}fCheckResize(null)},1000/25)}}};V3.Utils.PageIsLoaded=false;var OnSubmit=new V3.EventType("OnSubmit","form, args");var OnScroll=new V3.EventType("OnScroll","e",{log:false,lazyLoadCallback:fInitScroll});var OnResize=new V3.EventType("OnResize","e",{log:false,lazyLoadCallback:fInitResizeTimer});var OnUnload=new V3.EventType("Document.OnUnload","",true);var W3cEventHandler=function(funCallback){return function(e){var event=e||window.event||{};if(window.vsDesignTime){event=window.event}if(!event.stopPropagation){event.stopPropagation=function(){event.cancelBubble=true}}if(!event.target){event.target=event.srcElement}if(!event.preventDefault){event.preventDefault=function(){event.returnValue=false}}if(!event.currentTarget){event.currentTarget=this}var ret=funCallback.call(this,event,this);if(ret===false||event.returnValue===false){if(event.preventDefault){event.preventDefault()}event.returnValue=false;return false}else{return true}}};var AddEventHandler=(function(){var counter=0;return function(domObj,eventName,fEventHandler){var prepend=false;if(arguments.length===4){prepend=arguments[2];fEventHandler=arguments[3]}fEventHandler=W3cEventHandler(fEventHandler);function append(eventName){var existing=domObj["on"+eventName];var fAttach;if(typeof existing!=="function"){fAttach=fEventHandler}else{existing=domObj["v3_on"+eventName]||existing;if(prepend){fAttach=function(event){var retVal=true;if(fEventHandler.apply(this,arguments)===false){retVal=false}if(existing.apply(this,arguments)===false){retVal=false}return retVal}}else{fAttach=function(event){var retVal=true;if(existing.apply(this,arguments)===false){retVal=false}if(fEventHandler.apply(this,arguments)===false){retVal=false}return retVal}}}if(domObj===window||typeof domObj.id==="undefined"){domObj["on"+eventName]=fAttach.bind(domObj)}else{if(!domObj.id){domObj.id="v3_autogenerated_id_"+(counter++)}var jsSafeId=domObj.id.replace("'","\\'");domObj["v3_on"+eventName]=fAttach;domObj["on"+eventName]=new Function("return (this && this.id === '"+jsSafeId+"' ? this : document.getElementById('"+jsSafeId+"')).v3_on"+eventName+".apply(this, arguments);")}}if(Is.Array(eventName)){V3.forEach(eventName,this,append)}else{append(eventName)}}})();(function(){var regexCache={};var getDomElement=function(element){if(!Is.Specified(element)){throw new Error("element must be specified")}if(Is.String(element)){element=document.getElementById(element);if(!element){throw new Error("element with id '"+element+"' not found.")}}if(!Is.DomElement(element)){throw new Error("element not supported")}return element};V3.addCssClass=function(element,className){if(element&&element.V3Ctrl&&element.V3Ctrl.cssClassAdd){element.V3Ctrl.cssClassAdd(className)}else{if(element&&element.classList&&className&&Is.String(className)){var r=false;className.split(" ").forEach(function(className){if(!element.classList.contains(className)){element.classList.add(className);r=true}});return r}else{element=getDomElement(element);if(!Is.String(className)){throw new Error("classname must be a string")}var cn=element.getAttribute("class");var regex=regexCache[className];if(!regex){regex=regexCache[className]=new RegExp("(^|\\s+)"+className+"(\\s+|$)")}if(!regex.test(cn)){element.setAttribute("class",(cn+" "+className).replace(/^\s+|\s+$/gm,""));return true}return false}}};V3.remCssClass=function(element,className){if(element&&element.V3Ctrl&&element.V3Ctrl.cssClassRem){element.V3Ctrl.cssClassRem(className)}else{if(element&&element.classList&&className&&Is.String(className)){var r=false;className.split(" ").forEach(function(className){if(element.classList.contains(className)){element.classList.remove(className);r=true}});return r}else{element=getDomElement(element);if(!Is.String(className)){throw new Error("classname must be a string")}var cn=element.getAttribute("class");if(cn==className){element.removeAttribute("class","");return true}else{var regex=regexCache[className];if(!regex){regex=regexCache[className]=new RegExp("(^|\\s+)"+className+"(\\s+|$)")}if(regex.test(cn)){element.setAttribute("class",cn.replace(regex," "));return true}}return false}}};V3.switchCssClass=function(element,className1,className2,useOne){element=getDomElement(element);if(useOne){V3.remCssClass(element,className2);return V3.addCssClass(element,className1)}else{V3.remCssClass(element,className1);return V3.addCssClass(element,className2)}};V3.toggleCssClass=function(element,initialClass,toggledClass){if(element instanceof Array){for(var i=0;i<element.length;i++){V3.toggleCssClass(element[i],initialClass,toggledClass)}return}element=getDomElement(element);if((element.className||"").indexOf(initialClass)==-1){V3.remCssClass(element,toggledClass);V3.addCssClass(element,initialClass)}else{V3.remCssClass(element,initialClass);V3.addCssClass(element,toggledClass)}}})();window.UserAgentsEnum=V3.Enum({Unknown:"Unknown",iPad:"iPad",IE7:"IE7",IE:"Internet Explorer"});var parseQueryString=function(url){var r=V3.Class();r.Keys=[];r.Values={};r.get=function(key,defaultValue){var v=this.Values[key];if(typeof defaultValue==="undefined"){defaultValue=null}if(typeof v==="undefined"){v=defaultValue}return v};var m,k,v,regex=/[\?&](.*?)=([^&#]*)/gi,t="?";while((m=regex.exec(url))!=null){if(t.length>1){t=t+"&"}k=m[1];v=decodeURIComponent(m[2]);r.Keys.push(k);r.Values[k]=v;t=t+k+"="+v;if(typeof r[k]==="undefined"){r[k]=v;if(typeof r[k.toLowerCase()]==="undefined"){r[k.toLowerCase()]=v}}}r.toString=function(){return t};return r};var QueryString=parseQueryString(window.location.href);var UserAgent=UserAgentsEnum.Unknown;if(QueryString.ipad=="true"||navigator.userAgent.match(/iPad/)){UserAgent=UserAgentsEnum.iPad}else{if(QueryString.ie7=="true"||navigator.userAgent.match(/MSIE 7\./)){UserAgent=UserAgentsEnum.IE7}else{if(navigator.userAgent.indexOf("MSIE")!==-1||navigator.appVersion.indexOf("Trident/")>0){UserAgent=UserAgentsEnum.IE}}}V3.W3cEventHandler=W3cEventHandler;V3.AddEventHandler=AddEventHandler;V3.Utils.UserAgent=UserAgent;V3.Utils.parseQueryString=parseQueryString;V3.Utils.QueryString=QueryString;V3.Utils.OnSubmit=OnSubmit;V3.Utils.OnScroll=OnScroll;V3.Utils.OnResize=OnResize;V3.Utils.OnUnload=OnUnload;V3.Utils.OnLoad.addEventHandler(function(){V3.AddEventHandler(window,"unload",V3.Utils.OnUnload.fire.bind(V3.Utils.OnUnload));V3.addCssClass(document.documentElement,"v3_useragent_"+UserAgent.toString());var aspNetPostbackManager=null;if(window.Sys&&window.Sys.WebForms&&window.Sys.WebForms.PageRequestManager&&window.Sys.WebForms.PageRequestManager.getInstance()){aspNetPostbackManager=window.Sys.WebForms.PageRequestManager.getInstance()}for(var i=0;i<document.forms.length;i++){(function(){var form=document.forms[i];var cb=function(event){var args={Index:i,Event:event,CancelSubmit:false};OnSubmit.fire(form,args);return !args.CancelSubmit};if(!aspNetPostbackManager||aspNetPostbackManager._form!==form){V3.AddEventHandler(form,"submit",cb)}else{if(!aspNetPostbackManager._onSubmitStatements){V3.Log.Error("asp.net PageRequestManager doesn't have a private variable called '_onSubmitStatements' which is needed in order to fire the onsubmit event prior to the manager collecting all the form data for submission","aspNetPostbackManager",aspNetPostbackManager)}else{aspNetPostbackManager._onSubmitStatements.add(function(){return !!cb(window.event)})}if(form.onsubmit===null&&(!Is.Specified(aspNetPostbackManager._onsubmit)||Is.Function(aspNetPostbackManager._onsubmit))){form.onsubmit=aspNetPostbackManager._onsubmit;V3.AddEventHandler(form,"submit",true,cb);aspNetPostbackManager._onsubmit=form.onsubmit;form.onsubmit=null}}})()}});(function(){var fReady=function(){V3.Utils.OnLoad.fire();setTimeout(function(){V3.Utils.PageIsLoaded=true;V3.Utils.OnLoaded.fire()},50)};if(document.body&&(!document.readyState||document.readyState!=="loading")){if(V3.debugMode){Log.Info("Firing OnLoad by internal detection")}fReady()}else{V3.AddEventHandler(window,"load",fReady);V3.AddEventHandler(document,"DOMContentLoaded",fReady)}})();V3.debuggingEnabledFor=function(code){return !!V3.debugMode};if(V3.debugMode||(V3.Utils.QueryString.get("db_mod","")||"false").toLowerCase()!=="false"){var knownDebugCodes={};var enabledDebugCodes=V3.Utils.QueryString.get("db_mod","").toLowerCase().split(",");var debugAll=enabledDebugCodes[0]=="all";V3.getDebuggingCodes=function(){return knownDebugCodes};V3.registerDebugCode=function(code,description,declaredIn){code=code.toLowerCase();var r=knownDebugCodes[code];if(!r){r=knownDebugCodes[code]={}}if(description&&!r.Description){r.Description=description}if(!r.DeclaredIn){r.DeclaredIn=declaredIn||""}else{if(declaredIn&&!r.DeclaredIn.contains(declaredIn)){r.DeclaredIn=r.DeclaredIn+","+declaredIn}}};V3.debuggingEnabledFor=function(code1,code2){if(arguments.length==0){return(debugAll||!!V3.debugMode)}var ret=debugAll;for(var i=0;i<arguments.length;i++){var code=arguments[i].toLowerCase();V3.registerDebugCode(code,null,(V3._currentlyLoadingModule||{}).CallbackName);if(enabledDebugCodes.contains(code)){ret=true}}return ret};V3.registerDebugCode("all","Enables all modules for debugging");_debugMode=V3.debuggingEnabledFor("base");V3.registerDebugCode("nc","No-console, hides the console");var silentDebug=V3.debuggingEnabledFor("silent");var noConsole=V3.debuggingEnabledFor("nc");if(!noConsole){OnLoad.addEventHandler(function(){if(V3.Utils.Console){Log.Debug("About to enable the in-page console, all future debug will be outputted there.  Only Info, Warning and Errors will be presented here now.");V3.Utils.Console.EnableConsole()}})}V3.enableDebugMode(silentDebug)}V3.EventType.setDefaultLoggingStatus(_debugMode)});V3.Cookies.__defaultPath='/v4';
V3.CultureInfo.currentCulture(new V3.CultureInfo({CurrencyISOAbbreviation:"GBP",TwoLetterISOLanguageName:"en",ThreeLetterISOLanguageName:"eng",RegionId:"GB",DateTimeFormat:{AMDesignator:"AM",PMDesignator:"PM",DayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],MonthNames:["January","February","March","April","May","June","July","August","September","October","November","December",""],AbbreviatedDayNames:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],AbbreviatedMonthNames:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec",""],ShortestDayNames:["Su","Mo","Tu","We","Th","Fr","Sa"],LongDatePattern:"dd MMMM yyyy",ShortDatePattern:"dd/MM/yyyy",LongTimePattern:"HH:mm:ss",ShortTimePattern:"HH:mm",YearMonthPattern:"MMMM yyyy",MonthDayPattern:"d MMMM",FullDateTimePattern:"dd MMMM yyyy HH:mm:ss",FirstDayOfWeek:1},CurrencyFormatInfo:{DecimalDigits:2,GroupSizes:[3],NegativePattern:1,PositivePattern:0,DecimalSeparator:".",GroupSeparator:",",Symbol:"£",NegativeSign:"-",Multiplier:1},PercentFormat:{DecimalDigits:2,GroupSizes:[3],NegativePattern:5,PositivePattern:1,DecimalSeparator:".",GroupSeparator:",",Symbol:"%",NegativeSign:"-",Multiplier:100},NumberFormat:{DecimalDigits:2,GroupSizes:[3],NegativePattern:1,PositivePattern:0,DecimalSeparator:".",GroupSeparator:",",Symbol:null,NegativeSign:"-",Multiplier:1}}));
V3.CultureInfo.currentUICulture(new V3.CultureInfo({CurrencyISOAbbreviation:"GBP",TwoLetterISOLanguageName:"en",ThreeLetterISOLanguageName:"eng",RegionId:"GB",DateTimeFormat:{AMDesignator:"AM",PMDesignator:"PM",DayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],MonthNames:["January","February","March","April","May","June","July","August","September","October","November","December",""],AbbreviatedDayNames:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],AbbreviatedMonthNames:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec",""],ShortestDayNames:["Su","Mo","Tu","We","Th","Fr","Sa"],LongDatePattern:"dd MMMM yyyy",ShortDatePattern:"dd/MM/yyyy",LongTimePattern:"HH:mm:ss",ShortTimePattern:"HH:mm",YearMonthPattern:"MMMM yyyy",MonthDayPattern:"d MMMM",FullDateTimePattern:"dd MMMM yyyy HH:mm:ss",FirstDayOfWeek:1},CurrencyFormatInfo:{DecimalDigits:2,GroupSizes:[3],NegativePattern:1,PositivePattern:0,DecimalSeparator:".",GroupSeparator:",",Symbol:"£",NegativeSign:"-",Multiplier:1},PercentFormat:{DecimalDigits:2,GroupSizes:[3],NegativePattern:5,PositivePattern:1,DecimalSeparator:".",GroupSeparator:",",Symbol:"%",NegativeSign:"-",Multiplier:100},NumberFormat:{DecimalDigits:2,GroupSizes:[3],NegativePattern:1,PositivePattern:0,DecimalSeparator:".",GroupSeparator:",",Symbol:null,NegativeSign:"-",Multiplier:1}}));
 })(V3);
var V3;
if(!V3){V3={__namespace:true};}
(function(V3){ //AUTO-GENERATED-DO NOT MODIFY 
"use strict";V3.RegisterFile("V3.UI",1,["V3.Utils"],function(r){r.Namespace("UI");var R=r.Is;var V=false;if(r.debugMode){V=r.Utils.QueryString.get("db_mod","").toLowerCase().split(",").exists(function(e){return e=="ui"||e=="all"});r.Log.Info("V3.UI in debug mode: "+V+". (db_mod=ui)");if(V){r.Log.Warn("V3.UI is in debug mode, this will log many UI events which can significantly slow down the page.")}}r.EventType.setDefaultLoggingStatus(V);var c=function(){if(!r.UI._Body){r.UI._Body=document.createElement("div");r.UI._Body.className="V3";document.body.appendChild(r.UI._Body)}return r.UI._Body};var H=function(W,Z){var Y=W.DOMElement||W;var X=Z.DOMElement||Z;while(X=X.parentNode){if(X===Y){return true}}return false};var h=new r.EventType("OnDOMFocusChanged","e:{oldFocus:DOMElement, newFocus:DOMElement}",false,true);r.Utils.OnLoad.addEventHandler(function(){r.addCssClass(document.body,"loading");r.Utils.OnLoaded.addEventHandler(function(){r.remCssClass(document.body,"loading")});var X=function(ac){var ad=ac.DOMElement||ac;var ab=[];ab.hasV3Controls=false;ab.hasUnfocusEvent=false;while(ad.parentNode){ab.add(ad);if(ad.V3Ctrl){ab.hasV3Controls=true;if(ad.V3Ctrl.OnUnfocus){ab.hasUnfocusEvent=true}}ad=ad.parentNode}ab.isInDom=(ad===document);return ab};var aa=document.body;var e=null;var Y=null;var Z=(function(ae){if(ae.target!==aa){var ad=aa;var ac=ae.target;aa=ae.target;var ab=X(ad);if(!ab.isInDom){ad=Y.find(function(af){return R.InDOM(af)});if(!ad&&R.InDOM(e)){ad=e}if(ad){ab=X(ad)}else{r.Log.Error("The old focused element is no longer in the DOM and no common parent could be found!!")}}h.fire({oldFocus:ad,newFocus:ac});Y=X(ac);e=ab.find(function(af){return Y.contains(af)});if(Y.hasV3Controls){if(ac&&ac.V3Ctrl&&ac.V3Ctrl.OnFocus){ac.V3Ctrl.OnFocus.fire(ac.V3Ctrl,{oldFocus:(ad.V3Ctrl||ad)})}r.forEach(Y,function(af){if(af===e){return false}if(af.V3Ctrl&&af.V3Ctrl.OnFocusContainer){af.V3Ctrl.OnFocusContainer.fire(af.V3Ctrl,{oldFocus:(ad.V3Ctrl||ad),newFocus:(ac.V3Ctrl||ac)})}})}if(ad&&ab.hasV3Controls){if(ad.V3Ctrl&&ad.V3Ctrl.OnUnfocus){ad.V3Ctrl.OnUnfocus.fire(ad.V3Ctrl,{newFocus:ac.V3Ctrl||ac,isWithinContainer:function(){return H(ad,ac)}})}r.forEach(ab,function(af){if(af===e){return false}if(af.V3Ctrl&&af.V3Ctrl.OnUnfocusContainer){af.V3Ctrl.OnUnfocusContainer.fire(af.V3Ctrl,{newFocus:ac.V3Ctrl||ac})}})}}});function W(ac,ab){if(ac){var ad=false;if(ab){r.addCssClass(ac,"focused")}else{r.remCssClass(ac,"focused")}if(ac.v3FocusableParent){ad=true}var ae=ac;while(ae.parentNode){if(ab){r.addCssClass(ae,"child-focused")}else{r.remCssClass(ae,"child-focused")}if(ab&&!ad&&ae.v3FocusableParent){ad=true;r.addCssClass(ae,"focused")}else{r.remCssClass(ae,"focused")}ae=ae.parentNode}}}if(!document.addEventListener){r.Log.Warn("Document doesn't contain document.addEventListener(), so flagging of focuses and unfocsed elements will not work.")}else{document.body.addEventListener("focus",function(ab){Z(ab);W(ab.target,true)},true);document.body.addEventListener("blur",function(ab){W(ab.target,false)},true);document.body.tabIndex=-1}});r.UI.Sticky=function(){throw new Error("Not supported")}.InheritsFrom(r.Class);r.Utils.OnLoaded.addEventHandler(function(){var X=[];var W=function(ab){var Z=document.getElementsByClassName("sticky");X.clear();for(var ac=0;ac<Z.length;ac++){var ad=Z[ac];var ah=parseInt(ad.getAttribute("data-x"),10);var af=parseInt(ad.getAttribute("data-y"),10);var aa,Y;if(!isFinite(ah)||!isFinite(af)){var ag=r.remCssClass(ad,"stick");var ae=ad.getBoundingClientRect();if(ae&&ae.left){aa=ae.left+window.pageXOffset}else{aa=ad.offsetLeft}if(ae&&ae.top){Y=ae.top+window.pageYOffset}else{Y=ad.offsetTop}if(ag){r.addCssClass(ad,"stick")}}if(isFinite(ah)){aa=ah}if(isFinite(af)){Y=af}X.add({DOMElement:ad,x:aa,y:Y,flagged:false})}if(ab){e(ab)}};var e=function(Y){X.forEach(function(Z){if(Y.y>Z.y){if(!Z.flagged){r.addCssClass(Z.DOMElement,"stick");Z.flagged=true}}else{if(Z.flagged){r.remCssClass(Z.DOMElement,"stick");Z.flagged=false}}})};W(null);r.Utils.OnResize.addEventHandler(W);r.Utils.OnScroll.addEventHandler(e)});var I=r.Class();r.extend(I,{selectElementsWithId:function(e,Z,W,Y){if(!R.DomElement(e)){throw new Error("container must be a DOM element!")}var X={};I._selectElementsWithId(e,X,Z,W,Y);return X},_selectElementsWithId:function(e,X,aa,W,Z){for(var Y=0;Y<e.childNodes.length;Y++){var ab=e.childNodes[Y];if(!ab.id||ab.id==""){if(ab.childNodes.length){I._selectElementsWithId(ab,X,aa,W,Z)}}else{if(aa){if(!X[ab.id]){if(Z){X[ab.id]=d.wrap(ab)||ab}else{X[ab.id]=ab}}if(R.Number(W)){I._selectElementsWithId(ab,X,true,W-1,Z)}else{I._selectElementsWithId(ab,X,true,W,Z)}}else{if(Z){throw new Error("wrapDomElements cannot be true if flattenHierarchy is set to false.")}var ac={};if(R.Number(W)){I._selectElementsWithId(ab,ac,false,W-1)}else{I._selectElementsWithId(ab,ac,false,W)}ac.DOMElement=ab;X[ab.id]=ac}}}},isTouchScreen:function(){return("ontouchstart" in document.documentElement)},getScrollPosition:function(){return{x:window.scrollX||window.pageXOffset||0,y:window.scrollY||window.pageYOffset||0}},scrollTo:function(){if(arguments.length==0){return}var X=I.getScrollPosition();var ab,W;if(arguments.length>1&&(R.Boolean(arguments[arguments.length-1])||R.PlainObject(arguments[arguments.length-1]))){if(R.Boolean(arguments[arguments.length-1])){W={OnlyIfHidden:arguments[arguments.length-1],Padding:{X:0,Y:0}}}else{W=arguments[arguments.length-1];if(R.Number(W.Padding)){W.Padding={X:W.Padding,Y:W.Padding}}else{if(!W.Padding){W.Padding={X:0,Y:0}}}}delete arguments[arguments.length-1];arguments.length=arguments.length-1}else{W={OnlyIfHidden:false}}if(R.Number(arguments[0])){ab={};if(arguments.length==1){ab.y=arguments[0];ab.x=X.x}else{ab.y=arguments[0];ab.x=arguments[1]}ab.width=window.innerWidth/2;ab.height=window.innerHeight/2}else{if(R.WebControl(arguments[0])){arguments[0]=arguments[0].DOMElement}if(R.DomElement(arguments[0])){var Y=arguments[0].getClientRects();ab={x:Y[0].left+X.x,y:Y[0].top+X.y,width:Y[0].width,height:Y[0].height}}else{if(R.PlainObject(arguments[0])&&R.Number(arguments[0].x)&&R.Number(arguments[0].y)){ab={x:arguments[0].x,y:arguments[0].y,width:arguments[0].width||0,height:arguments[0].height||0}}else{throw new Error("Invalid arguments")}}}if(W.OnlyIfHidden){var e=function(){var ac=0;if(W.Padding&&W.Padding.X){var ac=W.Padding.X;if(ac<=0.5){ac=(window.innerWidth-ab.width)*ac}}return ac};var aa=function(){var ac=0;if(W.Padding&&W.Padding.Y){var ac=W.Padding.Y;if(ac<=0.5){ac=(window.innerHeight-ab.height)*ac}}return ac};if(X.x<=ab.x&&(ab.x+ab.width)<=(X.x+window.innerWidth)){ab.x=X.x}else{var Z=e();if(ab.width+Z<window.innerWidth){if(X.x<=ab.x){ab.x=ab.x+ab.width+Z-window.innerWidth}else{ab.x-=Z}}}if(X.y<=ab.y&&(ab.y+ab.height)<=(X.y+window.innerHeight)){ab.y=X.y}else{var Z=aa();if(ab.height+Z<window.innerHeight){if(X.y<=ab.y){ab.y=ab.y+ab.height+Z-window.innerHeight}else{ab.y-=Z}}}}window.scrollTo(ab.x,ab.y)},encodeHTML:function(W){var Y=I.__encodeHTML;if(!Y){Y=I.__encodeHTML={d:document.createElement("div"),t:document.createTextNode("")};Y.d.appendChild(Y.t)}Y.t.data=W;var X=Y.d.innerHTML;Y.t.data="";return X}});r.Utils.OnLoad.addEventHandler(function F(){if(I.isTouchScreen()){r.addCssClass(window.document.documentElement,"touch")}else{r.addCssClass(window.document.documentElement,"no-touch")}});var j=function j(e,W){this.base(this._addAt,this._removeAt,this._clear);this._owner=e;if(R.Specified(W)&&!R.Function(W)){throw new Error("typeFilter must be a class constructor function.")}this._typeFilter=W}.InheritsFrom(r.Collection,{_modifyDom:true,_onAdd:function(e){},_onRemove:function(e){},_onClear:function(){return false},_updateDOM:function(X,e){if(this._modifyDom&&this._owner&&this._owner.DOMElement&&X.DOMElement){if(e==this.count()){(this._owner.DOMContainer||this._owner.DOMElement).appendChild(X.DOMElement)}else{var W=this.get(e);if(W){W=W.DOMElement||W}(this._owner.DOMContainer||this._owner.DOMElement).insertBefore(X.DOMElement,W)}r.Utils._CheckResize()}},_addAt:function(Z,W,Y){if(!R.Control(Z)){throw new Error("child must inherit from V3.UI.Control")}if(this._typeFilter&&!(Z instanceof this._typeFilter)){throw new Error("child must be of type "+this._typeFilter.GetFunctionName())}if(Z.Parent===this._owner){var e=this.indexOf(Z);if(e==W||(W==this._collection.length&&e==this._collection.length-1)){throw new Error("child already in collection at that index.")}else{if(e>=0){this._updateDOM(Z,W);this._collection.removeAt(e);this._collection.addAt(W,Z);return}}}if(this._onAdd&&this._onAdd(Z)===false){return false}this._updateDOM(Z,W);if(Z.Parent){Z.Parent.Controls.remove(Z)}Y();if(Z.Parent!==this._owner){var X=Z.Parent;Z.Parent=this._owner;Z.OnParentChange.fire(Z.Parent,X)}Z._fireOnVisibleChangeIfNeeded();return true},_removeAt:function(X,e,Y){if(e<0||e>this._collection.length){throw new Error("index out of bounds")}var Z=this._collection[e];if(this._onRemove&&this._onRemove(Z,e)===false){return false}Y();if(Z.Parent!==null){var W=Z.Parent;Z.Parent=null;Z.OnParentChange.fire(Z.Parent,W)}if(this._modifyDom&&this._owner&&this._owner.DOMElement&&Z.DOMElement&&this._owner.DOMElement==Z.DOMElement.parentNode){(this._owner.DOMContainer||this._owner.DOMElement).removeChild(Z.DOMElement)}Z._fireOnVisibleChangeIfNeeded();return true},_clear:function(e){e(this._onClear())}});var G=function G(e){this.base();if(!(e instanceof x)){throw new Error("owner must be an instance of V3.UI.WebControl")}this._owner=e}.InheritsFrom(r.Class,{count:r.Property(function N(){return this._owner.DOMElement.attributes.length}),add:function(e,W){if(R.PlainObject(arguments[0])){W=arguments[0].value;e=arguments[0].name}if(R.String(e)&&R.String(W)){this._owner.DOMElement.setAttribute(e,W)}else{throw new Error("Invalid parameter values")}},get:function(e){if(!R.String(e)){return null}return this._owner.DOMElement.getAttribute(e)},exists:function(e){if(!R.String(e)){return false}return this._owner.DOMElement.hasAttribute(e)},remove:function(e){if(R.String(e)){this._owner.DOMElement.removeAttribute(e)}}});var u=function u(){this.base();this.OnParentChange.setBindParameters([this,this])}.InheritsFrom(r.Class,{OnParentChange:r.EventPrototype("sender, newParent, oldParent",{log:V}),OnVisibleChange:r.EventPrototype("sender, isEffectivelyVisible",{log:V}),Controls:j().InjectOwner(),Data:r.Object(),Parent:null,_isEffectivelyVisible:null,_fireOnVisibleChangeIfNeeded:function(W){var e=(this.visible()&&this._canBeVisible());if(W&&this.DOMElement){this.DOMElement.style.visibility=(e?"visible":"hidden");if(this.cssClassAdd){if(e){this.cssClassRem("hidden")}else{this.cssClassAdd("hidden")}}}var X=e&&(!this.Parent||this.Parent._isEffectivelyVisible)&&((!this.DOMElement)||(this.DOMElement&&document.body&&document.body.contains(this.DOMElement)));if(X!=this._isEffectivelyVisible){this._isEffectivelyVisible=X;this.Controls.forEach(function(Y){if(Y instanceof u){Y._fireOnVisibleChangeIfNeeded(false)}});this.OnVisibleChange.fire(this,!!this._isEffectivelyVisible);r.Utils._CheckResize()}},_canBeVisible:r.Property(true).OnChange(function E(e){this._fireOnVisibleChangeIfNeeded(true)}),visible:r.Property(true).OnChange(function E(e){this._fireOnVisibleChangeIfNeeded(true)}),isVisible:r.Property(function(){return !!this._isEffectivelyVisible})});r.extend(u.prototype,{Insert:function(Y,X,e){for(var W=0;W<arguments.length;W++){var Z=arguments[W];if(!R.Specified(Z)){continue}if(typeof Z==="string"){Z=document.createTextNode(Z||"")}if(typeof this._OverrideInsert==="function"){this._OverrideInsert.apply(this,arguments)}else{if(R.DomElement(Z)){if(Z.V3Ctrl){throw new Error("This element is controlled by a V3.UI.Control class and therefore cannot be added in this way")}(this.DOMContainer||this.DOMElement).appendChild(Z)}else{this.Controls.add(Z)}}}return this}});r.Is.Control=function(e){return e instanceof u};var x=function x(X,W,Y,e){this.base();if(R.String(X)){if(X.toLowerCase()=="svg"){this.__updateClassName=this.__updateClassNameSvg}this.DOMElement=document.createElement(X);this.DOMElement.id=this.constructor.name+"_"+(d._count=(d._count||0)+1);if(R.String(W)){this._cssClassAdd(true,W)}if(R.String(Y)){if(e){this.DOMElement.innerHTML=Y}else{this.DOMElement.appendChild(document.createTextNode(Y))}}this.DOMElement.V3Ctrl=this}else{if(R.DomElement(X)){this.DOMElement=X;if(this.DOMElement.className){if(typeof this.DOMElement.className.baseVal==="undefined"){this._cssClassListPublic.addRange((this.DOMElement.className+"").split(" "))}else{this._cssClassListPublic.addRange((this.DOMElement.className.baseVal+"").split(" "));this.__updateClassName=this.__updateClassNameSvg}}this.DOMElement.V3Ctrl=this;this._fireOnVisibleChangeIfNeeded()}else{throw new Error("WebControlBasic constructor expected an argument of type string or DomElement. ValueSpecified="+X)}}}.InheritsFrom(u,{OnClick:r.EventPrototype("sender, args",{lazyLoadCallback:function(){var e=this;r.AddEventHandler(this.DOMElement,"click",function(W){if(e.enabled&&!e.enabled()){return}if(e.OnClick.fire(e,{Event:W}).contains(false)){return false}})}}),Attributes:G().InjectOwner(),_cssClassListPublic:r.AutoConstruct(Array),_cssClassListPrivate:r.AutoConstruct(Array),__updateClassName:function(){this.DOMElement.className=this._cssClassListPrivate.join(" ")+" "+this._cssClassListPublic.join(" ");r.Utils._CheckResize()},__updateClassNameSvg:function(){this.DOMElement.className.baseVal=this._cssClassListPrivate.join(" ")+" "+this._cssClassListPublic.join(" ");r.Utils._CheckResize()},cssClass:r.Property(function N(){return this._cssClassListPublic.join(" ")},function y(e){this._cssClassListPublic.clear();this._cssClassListPublic.addRange(e.split(" "),true);this.__updateClassName()}),cssClassAdd:function(e,W){return this._cssClassAdd(false,e,W)},_cssClassAdd:function(Z,ac,ab){var ad=Z?this._cssClassListPrivate:this._cssClassListPublic;var W;if(!Z){W=this.cssClass()}var e=ad.add(ac,true);if(!e&&R.Number(ab)){this._cssClassRem(Z,ac,true);e=ad.add(ac)}if(e){this.__updateClassName();if(ab){if(!R.Number(ab)){this.DOMElement.offsetWidth}else{var Y=this.cssClassAdd__TimerLookup=(this.cssClassAdd__TimerLookup||{});var aa=this;if(Y[ac]){clearTimeout(Y[ac])}Y[ac]=setTimeout(function(){delete Y[ac];aa._cssClassRem(Z,ac)},ab)}}}if(!Z){var X=this.cssClass();if(W!=X){this.cssClass.OnChange.fire(X,W)}}return e},cssClassRem:function(e,W){return this._cssClassRem(false,e,W)},_cssClassRem:function(Y,e,X){var Z;if(!Y){Z=this.cssClass()}var W=Y?this._cssClassListPrivate:this._cssClassListPublic;if(!W.remove(e)){return false}else{this.__updateClassName();if(!Y){var aa=this.cssClass();if(Z!=aa){this.cssClass.OnChange.fire(aa,Z)}}if(X){this.DOMElement.offsetWidth}return true}},cssClassToggle:function(e,Y,X,W){return this._cssClassToggle(false,e,Y,X,W)},_cssClassToggle:function(Y,e,Z,X,W){if(e){if(X){this._cssClassRem(Y,X,W)}if(Z){this._cssClassAdd(Y,Z,W)}}else{if(Z){this._cssClassRem(Y,Z,W)}if(X){this._cssClassAdd(Y,X,W)}}},cssClassTransitionSync:function(e){if(this.cssClassRem(e)){this.DOMElement.offsetWidth;this.cssClassAdd(e)}else{if(this._cssClassRem(true,e)){this.DOMElement.offsetWidth;this._cssClassAdd(true,e)}}},tooltip:r.Property(function N(){return this.DOMElement.title},function y(e){if(e===null){e=""}this.DOMElement.title=e;this.Attributes.add("data-tooltip-text",e)}),activateContainer:function(e){if(this.DOMContainer){throw new Error("DOMContainer already activated")}if(R.TextNode(this.DOMElement)){r.Log.Warn("Unable to create container on text node. id:"+this.DOMElement.id);return}var W;if(!e||r.Is.String(e)){W=document.createElement("div");W.className=e||"container"}else{if(e instanceof x){W=e.DOMContainer||e.DOMElement}else{W=e}}while(this.DOMElement.firstChild){W.appendChild(this.DOMElement.firstChild)}this.DOMElement.appendChild(W);this.DOMContainer=W},_afterAppendDoDom:function(){this._fireOnVisibleChangeIfNeeded()},performClick:function(){this.OnClick.fire(this,{Event:{stopPropagation:r.Constants.EMPTY_FUNCTION}})},focus:function(){var W=this.DOMElement;setTimeout(function(){if(V){r.Log.Debug("calling DOMElement.focus() now.")}W.focus()},0)},scrollIntoView:function(e){I.scrollTo(this,e)},appendTo:function(e,W){if(R.String(e)){e=document.getElementById(e)}if(R.String(W)){W=document.getElementById(W)}if(!W){e.appendChild(this.DOMElement)}else{if(e.contains(W)){e.insertBefore(this.DOMElement,W)}else{if(W.contains(e)){W.insertBefore(this.DOMElement,e.nextSibling)}else{throw new Error("invalid parent/child specified")}}}this._afterAppendDoDom()},Style:function(W){var e=this.DOMElement;r.forEach(W,this,function(Y,X){switch(X.toLowerCase()){case"float":e.style.cssFloat=e.style.styleFloat=Y;return;case"width":case"height":case"left":case"top":case"right":case"bottom":if(R.Number(Y)){Y=Y+"px"}break}if(!R.Specified(e.style[X])){r.Log.Warn("style named '"+X+"' was not found.","domObj.style",e.style)}e.style[X]=Y});return this},AppendTo:function(e){this.appendTo.apply(this,arguments);return this},AppendHere:function(){var e=document.getElementById("v3-temp-div-id");if(!e){document.write('<div id="v3-temp-div-id"></div>');e=document.getElementById("v3-temp-div-id")}this.AppendTo(e.parentNode,e);e.parentNode.removeChild(e);return this},ContainsChild:function(W,e){if(e&&this.DOMElement===(W.DOMElement||W)){return true}return H(this,W)},DOMContainer:null,beginBulkLoad:function(){if(this._isBulkLoading){throw new Error("Already in bulk load state")}if(this._PREV_DOMContainer){throw new Error("Cannot start bulk load as PREV_DOMContainer is already assigned.")}this._isBulkLoading=true;this._PREV_DOMContainer=this.DOMContainer;this.DOMContainer=document.createDocumentFragment()},endBulkLoad:function(){if(!this._isBulkLoading){throw new Error("Not in bulk load state.")}this._isBulkLoading=false;var e=this.DOMContainer;var W=[].addRange(e.childNodes);this.DOMContainer=this._PREV_DOMContainer;delete this._PREV_DOMContainer;(this.DOMContainer||this.DOMElement).appendChild(e);W.forEach(function(X){if(X.V3Ctrl instanceof x){X.V3Ctrl._afterAppendDoDom()}})}});var S=r.Enum({Enter:0,Move:1,Down:2,Up:3,Click:4,DoubleClick:5,Exit:5});var d=function d(e,X){this.base(e,X);var W=this;if(R.String(e)){if(V){if(document.getElementById(this.DOMElement.id)!==null){throw new Error("Id has been duplicated. id="+this.DOMElement.id)}}}if(window.vsDesignTime||V){this._addValidation()}this.DOMElement.V3Ctrl=this;this.enabled(!this.DOMElement.disabled);if(V){this.OnFocus.addEventHandler(function(){this.cssClassAdd("focus-self")});this.OnUnfocus.addEventHandler(function(){this.cssClassRem("focus-self")});this.OnFocusContainer.addEventHandler(function(){this.cssClassAdd("focus-container")});this.OnUnfocusContainer.addEventHandler(function(){this.cssClassRem("focus-container")})}}.InheritsFrom(x,{OnKeyEvent:r.EventPrototype("sender, args",{lazyLoadCallback:function(){r.AddEventHandler(this.DOMElement,"keydown",this._fireOnKey.bind(this,q.Down));r.AddEventHandler(this.DOMElement,"keyup",this._fireOnKey.bind(this,q.Up));r.AddEventHandler(this.DOMElement,"keypress",this._fireOnKey.bind(this,q.Press))}}),OnFocus:r.EventPrototype("sender, e:{oldFocus:Control || DOMElement}",{}),OnFocusContainer:r.EventPrototype("sender, e:{oldFocus:Control || DOMElement}"),OnUnfocus:r.EventPrototype("sender, e:{newFocus:(Control || DOMElement), isWithinContainer:function(){}"),OnUnfocusContainer:r.EventPrototype("sender, e:{newFocus:(Control || DOMElement)"),OnMouseEvent:r.EventPrototype("sender, args",{lazyLoadCallback:function(){var e=this;r.AddEventHandler(e.DOMElement,"mouseover",function(X){var Y=e.OnMouseEvent.fire(e,{Event:X,Type:S.Enter,Target:X.target.V3Ctrl,Button:X.button===2?"right":"left"});if(Y.contains(false)){return false}});r.AddEventHandler(e.DOMElement,"mousemove",function(X){var Y=e.OnMouseEvent.fire(e,{Event:X,Type:S.Move,Target:X.target.V3Ctrl});if(Y.contains(false)){return false}});var W=null;r.AddEventHandler(e.DOMElement,"mousedown",function(Y){var Z=e.OnMouseEvent.fire(e,{Event:Y,Type:S.Down,Target:Y.target.V3Ctrl});if(Z.contains(false)){return false}var X=new Date().valueOf();if(W){if((X-W)<350){Z=e.OnMouseEvent.fire(e,{Event:Y,Type:S.DoubleClick,Target:Y.target.V3Ctrl,Detected:true});X=null}}W=X;if(Z.contains(false)){return false}});r.AddEventHandler(e.DOMElement,"mouseup",function(X){var Y=e.OnMouseEvent.fire(e,{Event:X,Type:S.Up,Target:X.target.V3Ctrl});if(Y.contains(false)){return false}});r.AddEventHandler(e.DOMElement,"mouseout",function(X){var Y=e.OnMouseEvent.fire(e,{Event:X,Type:S.Exit,Target:X.target.V3Ctrl});if(Y.contains(false)){return false}})}}),_checkEffectivelyEnabled:function(){this.effectivelyEnabled(this.enabled()&&(!this.Parent||!this.Parent.effectivelyEnabled||this.Parent.effectivelyEnabled()))},enabled:r.Property(true).OnChange(function(e){if(!e){this.effectivelyEnabled(false)}else{this.effectivelyEnabled(!this.Parent||!this.Parent.effectivelyEnabled||this.Parent.effectivelyEnabled())}}),effectivelyEnabled:r.Property(true).OnChange(function(e){if(e){this.DOMElement.disabled=false;this.cssClassRem("disabled");this.Attributes.remove("disabled")}else{this.DOMElement.disabled=true;this.cssClassAdd("disabled");this.Attributes.add("disabled","disabled")}this.Controls.forEach(function(W){if(W instanceof d){W._checkEffectivelyEnabled()}})}),_addValidation:function(){return},_fireOnKey:function(X,Y,W){if(!this.enabled()){return}var aa={Event:Y,Type:X,KeyCode:p.parse(Y.keyCode)||Y.keyCode,Ctrl:Y.ctrlKey};var Z=this.OnKeyEvent.fire(this,aa);if(Z.contains(false)){return false}},color:r.Property(null,function y(e){if(!(e instanceof r.Color)){throw new Error("value must be of type V3.Color")}this.DOMElement.style.color=e.toString(true)})});d._registeredWrappers={};d.registerWrapper=function(W,e){if(!R.String(W)||W===""){throw new Error("tagName must be a string")}if(!R.Function(e)){throw new Error("createInstance must be a function!")}d._registeredWrappers[W.toUpperCase()]=e};d.wrap=function(W){var e=d._registeredWrappers[W.tagName.toUpperCase()];if(e){return e(W)}else{return null}};r.Is.WebControl=function(e){return e&&(e instanceof r.UI.WebControlBasic)};var n=function n(e,W){if(arguments.length==1&&R.DomElement(arguments[0])){this.base(arguments[0],arguments[2]);e=this.href()}else{this.base("a",arguments[2])}if(this.DOMElement.childNodes.length==1&&R.TextNode(this.DOMElement.childNodes[0])){this._textNode=this.DOMElement.childNodes[0];W=this._textNode.data}else{this._textNode=document.createTextNode(W||"");this.DOMElement.appendChild(this._textNode)}this.href(e);this.text(W)}.InheritsFrom(d,{click:function(){this.DOMElement.click()},href:r.Property("",function(e){if(e){this.DOMElement.href=e}else{this.DOMElement.href="javascript:void(0)"}}),text:r.Property(function N(){return this._textNode.data},function y(e){if(!r.Is.Specified(e)){e=""}this._textNode.data=e.toString()}),target:r.Property(function N(){return this.DOMElement.target},function y(e){this.DOMElement.target=e})});n.wrap=function(e){return new n(e)};var D=function D(Z,Y){var X=["span","label","p","h1","h2","h3","h4","h5","h6"];var W=false;if(arguments.length===1&&R.DomElement(arguments[0])){if(!X.contains((arguments[0].tagName+"").toLowerCase())){throw new Error("Unsupported DOM Element")}this.base(arguments[0]);Z=""}else{if(arguments.length==1&&!r.Is.String(arguments[0])){Y=Z;Z=""}var e=Y;if(R.WebControl(e)){e=e.DOMElement}if(R.FormField(e)){this.base("label");if(e.id){this.DOMElement.htmlFor=e.id}if(!e.parentNode){W=true}}else{if(R.String(Z)&&Z.length<=2&&X.contains(Z.toLowerCase())){this.base(Z);if(arguments.length==2){Z=arguments[1]}else{Z=""}}else{this.base("span")}}}if(this.DOMElement.childNodes.length==1&&R.TextNode(this.DOMElement.childNodes[0])){this._textNode=this.DOMElement.childNodes[0];Z=this._textNode.data}else{this._textNode=document.createTextNode("");this.DOMElement.appendChild(this._textNode)}if(W){this.Controls.add(Y)}this.text(Z)}.InheritsFrom(x,{_updateCanBeVisible:function(){if(!this.autoVisibility()){this._canBeVisible(true)}else{if(this.text()==""){this._canBeVisible(false)}else{this._canBeVisible(true)}}},text:r.Property("",function y(X,W,Y){if(!r.Is.Specified(Y.value)){Y.value=""}this._textNode.data=Y.value.toString()}).OnChange(function E(e){this._updateCanBeVisible()}),autoVisibility:r.Property(false).OnChange(function E(e){this._updateCanBeVisible()})});D.wrap=function(e){return new D(e)};d.registerWrapper("span",D.wrap);d.registerWrapper("label",D.wrap);d.registerWrapper("h1",D.wrap);d.registerWrapper("h2",D.wrap);d.registerWrapper("h3",D.wrap);d.registerWrapper("h4",D.wrap);var b=function b(e){if(arguments.length==1&&R.DomElement(arguments[0])){this.base(arguments[0],e)}else{this.base("div",e)}}.InheritsFrom(d,{_hookedKeyEvents:false,defaultButton:r.Property(null).OnChange(function(e){if(!this._hookedKeyEvents&&e){this.OnKeyEvent.addEventHandler(function(X,Y){if(Y.Type==q.Press&&Y.KeyCode==p.Enter){var W=this.defaultButton();if(!W){return}var Z=Y.Event.target;if(Z&&((Z.tagName.toLowerCase()=="input")&&(Z.type.toLowerCase()=="submit"||Z.type.toLowerCase()=="button"))||((Z.tagName.toLowerCase()=="a")&&(Z.href!=null)&&(Z.href!=""))||((Z.tagName.toLowerCase()=="textarea"))){return}Y.Event.preventDefault();Y.Event.stopPropagation();W.performClick();return false}})}}),width:r.Property(function N(){return parseInt(this.DOMElement.style.width,10)},function y(e){this.Style({width:e})}),height:r.Property(function N(){return parseInt(this.DOMElement.style.height,10)},function y(e){this.Style({height:e})})});b.wrap=function(e){return new b(e)};d.registerWrapper("div",b.wrap);var M=function M(W){if(V){var e=new r.Utils.StopWatch(true)}this.base("img");if(V){e.stop();if(e.getDuration()>10){r.Log.Warn("init image look a long time: "+e.getDuration()+"ms")}}var X=this;r.AddEventHandler(X.DOMElement,"load",function(){X.loaded=true;X.OnLoad.fire(X,X.DOMElement.src,X.size())});this.Set({imageUrl:W})}.InheritsFrom(d,{OnLoad:r.EventPrototype("sender, url, size",true),clear:function(){this.imageUrl("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAALSURBVAgdY2BgAAAAAwABT0gKrwAAAABJRU5ErkJggg==")},loaded:false,size:r.Property(function N(){return{width:this.DOMElement.naturalWidth,height:this.DOMElement.naturalHeight}}),imageUrl:r.Property(function N(){return this.DOMElement.src},function y(e){if(!e||e===""){throw new Error("Value cannot be an empty string! Use the visible property if trying to hide the image.")}if(this.DOMElement.src!=e){this.DOMElement.src=e}})});function B(e){if(!e){return null}else{return{x:e.x,y:e.y}}}function z(e){if(!e){return null}else{return{width:e.width,height:e.height}}}var C=function C(e,Y,X,W,Z){this.base("div");this._sourceImageSize=Z;this._addInstanceMembersToSpriteImage();this._img=new M(e).Set({OnLoad:this._calculate.bind(this),Style:{position:"absolute"}});this.imageUrl=this._img.imageUrl;this.Controls.add(this._img);this.Style({display:"inline-block",overflow:"hidden",position:"relative"});this.locationOnSprite.OnChange.addEventHandler(this._calculate);this.sizeOnSprite.OnChange.addEventHandler(this._calculate);this.size.OnChange.addEventHandler(this._calculate);this.Set({locationOnSprite:Y,sizeOnSprite:X,size:W||X});this._isReady=true;this._calculate()}.InheritsFrom(d,{_img:null,_sourceBounds:null,_renderedSize:null,_addInstanceMembersToSpriteImage:function(){this._sourceBounds={point:null,size:null};this.locationOnSprite=new r.Property(this,null,function W(X){this._sourceBounds.point=B(X)});this.sizeOnSprite=new r.Property(this,null,function W(X){this._sourceBounds.size=z(X)});this.size=new r.Property(this,null,function W(X){this._renderedSize=z(X);this.Style({width:X.width+"px",height:X.height+"px"})});this.scaledImageSize=new r.Property(this,function e(){return{width:parseInt(this._img.DOMElement.style.width,10),height:parseInt(this._img.DOMElement.style.height,10)}});this.scaledLocationOnSprite=new r.Property(this,function e(){return{x:-parseInt(this._img.DOMElement.style.left,10),y:-parseInt(this._img.DOMElement.style.top,10)}})},_calculate:function(){if(!this._isReady){return}var X=this._sourceImageSize;if(this._img.loaded){X=this._img.size()}var e={x:(this._renderedSize.width/this._sourceBounds.size.width),y:(this._renderedSize.height/this._sourceBounds.size.height)};var W={x:X.width/(this._sourceBounds.size.width),y:X.height/(this._sourceBounds.size.height)};this._img.Style({left:-(this._sourceBounds.point.x*e.x)+"px ",top:-(this._sourceBounds.point.y*e.y)+"px",width:(this._sourceBounds.size.width*e.x*W.x)+"px ",height:(this._sourceBounds.size.height*e.y*W.y)+"px"})}});var T=function T(ab,W,ad,ac,aa,Y,ae){this.base();this.imageUrl=new M(ab).imageUrl;this.scale=new r.Property(this,1);if(R.Number(ac)){ac=[ac]}if(R.Number(aa)){aa=[aa]}if(R.Boolean(ac)){if(R.Boolean(aa)){throw new Error("Cannot specify boolean for both colWidth and rowHeights")}this._isSingleColumnWithVaryingWidths=ac;ac=[Math.max.apply(Math,aa)]}if(R.Boolean(aa)){this._isSingleRowWithVaryingHeights=aa;aa=[Math.max.apply(Math,ac)]}this._rowCount=ad;this._colCount=W;this._colWidths=ac;this._rowHeights=aa;this._colSpacings=(Y instanceof Array)?Y:[Y||0];this._rowSpacings=(ae instanceof Array)?ae:[ae||0];var Z=0;for(var X=0;X<this._rowCount;X++){Z+=this._colWidths[X%this._colWidths.length];Z+=this._colSpacings[X%this._colSpacings.length]}var e=0;for(var X=0;X<this._colCount;X++){e+=this._rowHeights[X%this._rowHeights.length];e+=this._rowSpacings[X%this._rowSpacings.length]}this._size={width:Z,height:e};this.imageIds=new r.Property(this)}.InheritsFrom(r.Class,{_isSingleColumnWithVaryingWidths:false,_isSingleRowWithVaryingHeights:false,getImageFromIndex:function(Z,ad){var e=Z%this._colCount;var Y=Math.floor(Z/this._colCount);var ac={width:this._colWidths[e%this._colWidths.length],height:this._rowHeights[Y%this._rowHeights.length]};var ab=0;var W=0;if(this._isSingleColumnWithVaryingWidths){ac.width=ac.height}else{for(var X=0;X<e;X++){ab+=this._colWidths[X%this._colWidths.length];ab+=this._colSpacings[X%this._colSpacings.length]}}if(this._isSingleRowWithVaryingHeights){ac.height=ac.width}else{for(var X=0;X<Y;X++){W+=this._rowHeights[X%this._rowHeights.length];W+=this._rowSpacings[X%this._rowSpacings.length]}}if(!ad){ad={width:ac.width/this.scale(),height:ac.height/this.scale()}}var aa=new C(this.imageUrl,{x:ab,y:W},ac,ad,this._size);return aa},getImageById:function(X){var e=this.imageIds();if(!e){throw new Error("imageIds is not set")}var W=e[X];if(R.Undefined(W)){return null}else{return this.getImageFromIndex()}},size:r.Property(function N(){return this._size})});var P=function P(W,e,X,Y){this.base(W,Y);if(arguments.length>=3&&W.toLowerCase()==="input"){this.Attributes.add("type",arguments[2])}r.AddEventHandler(this.DOMElement,["change","input","keyup"],this._fireOnChange.bind(this));this.Set({OnFocus:function(Z,aa){this._lastValue=this.value()},OnChange:function(Z,aa){if(this._binding){if(this._customBind){this._customBind(this._binding.obj,this._binding.field,aa)}else{this._binding.obj[this._binding.field]=Z.value()}}}});this._lastValue=this.value();if(!R.String(e)){e=this.DOMElement.name||this.DOMElement.id}this.name(e)}.InheritsFrom(d,{OnChange:r.EventPrototype("sender, e"),value:r.Property(function N(){return this.DOMElement.value},function y(e){if(this.DOMElement.value!=e){this.DOMElement.value=e}this._fireOnChange()}),name:r.Property(function N(){return this.DOMElement.name},function y(e){this.Attributes.add("name",e)}),_lastValue:null,_fireOnChange:function(X){var W=this.value();if(this._lastValue!=W){if(!X){this.OnChange.fire(this,{event:X,lastValue:this._lastValue,value:W,changedByUser:false})}else{this.OnChange.fire(this,{event:X,lastValue:this._lastValue,value:W,changedByUser:true})}this._lastValue=W}},_binding:null,bind:function(e,W){if(arguments.length===0){if(!this._binding){r.Log.Warn("bind() called when control is not currently bound therefore nothing to do.");return}e=this._binding.obj;W=this._binding.field}else{if(e===null){this._binding=null;return}this._binding={obj:e,field:W}}if(this._customBind){this._customBind(e,W)}else{if(R.String(e[W])||R.Number(e[W])){this.value(e[W]+"")}else{e[W]=this.value()}}return this},readOnly:r.Property(false,function y(e){if(e){this.DOMElement.readOnly=true;this.Attributes.add("readonly","readonly")}else{this.DOMElement.readOnly=false;this.Attributes.remove("readonly")}})});var i=P.prototype;if(window.vsDesignTime){intellisense.addSignature(i.name,"Gets or Sets the name of the property",[{name:"value",optional:true}])}var l=function l(e){this.base("input",e,"checkbox");r.AddEventHandler(this.DOMElement,["change","click","onkeyup"],this.__DOMElement_EventHandler.bind(this));this.OnChange.addEventHandler(function(W,X){if(R.Undefined(X.selected)){X.selected=this.DOMElement.checked}})}.InheritsFrom(P,{_customBind:function(X,Y,W){if(!W&&(R.Boolean(X[Y])||R.Number(X[Y]))){this.selected(!!X[Y])}else{X[Y]=this.selected()}},_fireOnChangeEvent:function(e){this.OnChange.fire(this,{checked:e})},__DOMElement_EventHandler:function(e,W){this.selected(W.checked)},selected:r.Property(function N(){return this.DOMElement.checked},function y(W,e){this.DOMElement.checked=W;if(W!=e){this._fireOnChangeEvent(W)}})});var O=function O(e){this.base("input",e,"radio");if(!R.String(e)){throw new Error("Name must be specified!")}this.Group=k.getGroupByName(e);this.Group.registerRadioButton(this);r.AddEventHandler(this.DOMElement,["change","click","onkeyup"],this.__DOMElement_EventHandler.bind(this));this.OnChange.addEventHandler(function(W,X){if(R.Undefined(X.selected)){X.selected=this.DOMElement.checked}})}.InheritsFrom(P,{__DOMElement_EventHandler:function(e,W){this.selected(W.checked)},_customBind:function(X,Y,W){if(!W&&(R.Boolean(X[Y])||R.Number(X[Y]))){this.selected(!!X[Y])}else{X[Y]=this.selected()}},_fireOnChangeEvent:function(X){var W=this.Group._selectedButton;if(X){this.Group._selectedButton=this;if(W){W._deselected()}}var Y={selected:X,selectedButton:this.Group._selectedButton,deselectedButton:W};this.OnChange.fire(this,Y)},_deselected:function(){this.selected(false)},selected:r.Property(false,function(W,e){this.DOMElement.checked=W;if(W!=e){this._fireOnChangeEvent(W)}})});var k=function k(e){this.base();this.groupName(e)}.InheritsFrom(r.Class,{groupName:r.Property(),_Controls:r.AutoConstruct(Array),_selectedButton:null,registerRadioButton:function(e){this._Controls.add(e);if(e.selected()){this._selectedButton=e}}});k._RegisteredGroups={};k.getGroupByName=function(W){var e=k._RegisteredGroups[W];if(!e){e=new k(W);k._RegisteredGroups[W]=e}return e};var o=function o(W,e){if(arguments.length==1&&R.DomElement(arguments[0])){this.base(arguments[0],arguments[0].name)}else{var X;if(R.String(W)){X=W}else{X=null;if(arguments.length==1){e=arguments[0]}}this.base("select",X)}this.OnChange.addEventHandler(function(Y,Z){if(R.Undefined(Z.selectedIndex)){this._readSelectedItemFromElement();this._enhanceEventArgs(Z)}});if(R.Array(e)||R.PlainObject(e)){this.addRange(e)}}.InheritsFrom(P,{DOMElement:!window.vsDesignTime?null:document.createElement("select"),_selected:r.Object({Index:-1,Value:null,Name:null}),_options:r.AutoConstruct(Array),_enhanceEventArgs:function(W){W.selectedIndex=this._selected.Index;W.selectedValue=this._selected.Value;W.name=this._selected.Name;W.userSelected=true},_customBind:function(X,Y,W){if(!W&&(R.String(X[Y])||R.Number(X[Y]))){this.selectedValue(X[Y])}else{this._readSelectedItemFromElement();if(W){this._enhanceEventArgs(W)}X[Y]=this.selectedValue()}},count:r.Property(function N(){return this._options.length}),selectedIndex:r.Property(function N(){return this._selected.Index},function y(e){if(!R.Number(e)){throw new Error("value must be a number!")}if(e<-1||this.DOMElement.options.length<=e){throw new Error("index out of bounds")}if(e!=this._selected.Index){if(e!==-1){this.DOMElement.options[e].selected=true}else{if(e===-1){this.DOMElement.options[this._selected.Index].selected=false}}this._readSelectedItemFromElement();this.OnChange.fire(this,{event:null,selectedIndex:this._selected.Index,selectedValue:this._selected.Value,name:this._selected.Name,userSelected:false});if(r.jQuery){r.jQuery(this.DOMElement).change()}}}),selectedValue:r.Property(function N(){return this._selected.Value},function y(W){var e=this.find(W);if(e){this.selectedIndex(e.index)}}),_readSelectedItemFromElement:function(e){var Y=this.DOMElement;var X=-1;var Z=null;for(var W=0;W<Y.options.length;W++){if(Y.options[W].selected){X=W;Z=Y.options[W].ctrlValue;if(R.Undefined(Z)){Z=Y.options[W].value}break}}this._selected.Index=X;this._selected.Value=Z;if(X==-1){this._selected.Name=null}else{this._selected.Name=Y.options[X].innerHTML}if(this._lastValue===Z){return false}else{this._lastValue=Z;if(e){this.OnChange.fire(this,{event:null,selectedIndex:this._selected.Index,selectedValue:this._selected.Value,name:this._selected.Name,userSelected:false})}return true}},_indexOfValue:function(X){var W=(R.Specified(X)&&R.Function(X.valueOf))?X.valueOf():X;for(var e=0;e<this._options.length;e++){if(this._options[e].ctrlValue===X||this._options[e].ctrlValueOf===W){return e}}return -1},_findIndexOfOpt:function(W){var X=this.DOMElement;for(var e=0;e<X.options.length;e++){if(X.options[e]===W){return e}}return -1},_getSafe:function(e){var W=this._options[e];if(!W){return null}else{return{index:e,name:W.innerHTML,value:W.ctrlValue,enabled:!W.disabled,selected:this._selected.Index==e}}},add:function(W,X,e){this.addAt(this.count(),W,X,e)},addAt:function(X,W,Z,e){if(X<0||X>this.count()){throw new Error("Index out of valid bounds")}W=W+"";if(R.Undefined(Z)){Z=W}if(!R.Boolean(e)){e=true}var Y=document.createElement("option");Y.innerHTML=W.toString();Y.value=Z;Y.disabled=!e;Y.ctrlValue=Z;if(R.Specified(Z)&&R.Function(Z.valueOf)){Y.ctrlValueOf=Z.valueOf()}else{Y.ctrlValueOf=Z}this._options.addAt(X,Y);this.DOMElement.add(Y,X);if(e&&this._selected.Index==-1){Y.selected=true}this._readSelectedItemFromElement(true)},addRange:function(e){r.forEach(e,this,function(X,W){if(R.String(W)){this.add(W,X)}else{if(R.PlainObject(X)&&R.Defined(X.label)&&R.Defined(X.value)){this.add(X.label,X.value)}else{this.add(X.toString(),X)}}})},clear:function(){this.DOMElement.options.length=0;this._options.clear();this._readSelectedItemFromElement(true)},containsValue:function(e){return(this._indexOfValue(e)!==-1)},indexOfName:function(W){W=W.toLowerCase();var e=-1;this._options.find(function(Y,X){if(Y.innerHTML.toLowerCase()===W){e=X;return true}});return e},get:function(e){if(e<0||e>=this.count()){throw new Error("index out of bounds")}return this._getSafe(e)},find:function(e){return this._getSafe(this._indexOfValue(e))},findByName:function(W){var e=-1;this._options.find(function(Y,X){if(Y.innerHTML==W){e=X;return true}});this._getSafe(e)},remove:function(X){var e=this._indexOfValue(X);if(e>=0){var W=this._options[e];if(e===this.selectedIndex()){this.selectedIndex(-1)}this._options.removeAt(e);this.DOMElement.removeChild(W)}this._readSelectedItemFromElement(true)},rename:function(X,e){var W=this._indexOfValue(X);if(W===-1){throw new Error("value not found")}this.DOMElement.options[W].innerHTML=e+""},setFilter:function y(X){var e=0;var W=-1;if(!X||X===""){X=null}this._options.forEach(function(Z,Y){if(!X||Z.innerHTML.toLowerCase().indexOf(X.toLowerCase())==0){e++;if(W===-1){W=Y}if(!Z.parentNode){this.DOMElement.add(Z,Y)}}else{if(Z.parentNode){this.DOMElement.remove(this._findIndexOfOpt(Z))}}}.bind(this));return{count:e,firstMatch:(W===-1?null:this.get(W))}},toArray:function(W){var e=[];if(W){this._options.forEach(function(X){e.add(X.innerHTML)})}else{e.add({name:item.innerHTML,value:R.Undefined(item.ctrlValue)?item.value:item.ctrlValue})}return e}});o.wrap=function(e){if(!R.DomElement(e)){if(!e&&window.vsDesignTime){e=document.createElement("select")}else{throw new Error("domSelect must be a DOM element")}}return new o(e)};r.extend(o.prototype,{Insert:function(W,e,X){this.addRange.apply(this,arguments);return this}});var L=function L(e){if(arguments.length==1&&R.DomElement(arguments[0])){this.base(arguments[0])}else{this.base("button")}this.DOMElement.appendChild(this._textNode=document.createTextNode(""));this.DOMElement.type="button";if(!R.String(e)){e=""}this.text(e)}.InheritsFrom(d,{_textNode:null,text:r.Property("",function y(e){this._textNode.data=e}),useSubmitBehaviour:r.Property(false,function y(e){if(e){this.DOMElement.type="submit"}else{this.DOMElement.type="button"}}),performClick:function(){this.DOMElement.click()}});L.wrap=function(e){return new L(e)};d.registerWrapper("button",L.wrap);var q=new r.Enum({Down:0,Up:1,Press:2});var p=new r.Enum({Backspace:8,Enter:13,Escape:27,"Left Arrow":37,"Up Arrow":38,"Right Arrow":39,"Down Arrow":40,Delete:46});var U=function U(){if(arguments.length==1&&R.DomElement(arguments[0])){this.base(arguments[0])}else{var e=false;var X;if(r.Is.Boolean(arguments[0])){e=(arguments[0]===true);X=arguments[1]}else{X=arguments[0]}if(e){this.base("textarea",null,"",X)}else{this.base("input",null,"text",X)}}this._attachedPanel_OnKeyEvent_Bound=this._attachedPanel_OnKeyEvent_Bound.bind(this);this._attachedPanel_OnUnfocusContainer_Bound=this._attachedPanel_OnUnfocusContainer_Bound.bind(this);this.OnChange.addEventHandler(function(Z,aa){aa.text=this.text();this._makeSuggestion();if(V){r.Log.Debug("SUGGESTION: text="+aa.text+", value="+aa.value+", suggestion="+this._currentSuggestion)}});this.OnKeyEvent.addEventHandler(function(Z,ab){if(ab.KeyCode==p.Delete||ab.KeyCode==p.Backspace){this._stopSuggestions=true;this._currentSuggestion=null}else{this._stopSuggestions=false;if(ab.KeyCode===p.Enter){if(ab.Type==q.Up){this._lockInSuggestion()}}}if(ab.Type==q.Down&&ab.KeyCode==27){var aa=this.attachedPanel();if(aa&&aa.visible()){ab.Event.stopPropagation();this.closeAttachedPanel()}}}.bind(this));this.OnUnfocus.addEventHandler(function(Z,ab){var aa=this.attachedPanel();if(!aa||!aa.visible()){ab.isFocusingAttachedPanel=false}else{ab.isFocusingAttachedPanel=(ab.newFocus&&(ab.newFocus===aa||aa.ContainsChild(ab.newFocus)));if(!ab.isFocusingAttachedPanel){this.closeAttachedPanel()}}this._lockInSuggestion();if(V){r.Log.Debug("LOCK: text="+this.text()+", value="+this.value()+", suggestion="+this._currentSuggestion)}}.bind(this));if(this.DOMElement.tagName.toUpperCase()=="TEXTAREA"){this.rows=new r.Property(this,function W(){return this.DOMElement.rows},function Y(Z){this.DOMElement.rows=Z});this.columns=new r.Property(this,function W(){return this.DOMElement.cols},function Y(Z){this.DOMElement.cols=Z})}}.InheritsFrom(P,{_attachedPanelHookedEvents:false,closeAttachedPanel:function(){var e=this.attachedPanel();if(e&&e.visible()){e.visible(false)}},_attachedPanel_OnKeyEvent_Bound:function(W,X){if(X.KeyCode==p.Escape&&X.Type==q.Down){X.Event.stopPropagation();this._ignoreNextFocus=true;this.DOMElement.focus();W.visible(false)}},_attachedPanel_OnUnfocusContainer_Bound:function(W,X){if(X.newFocus!==this){W.visible(false)}},attachedPanel:r.Property(null,function y(Y,X){if(X){X.cssClassRem("is-attached");X.OnKeyEvent.removeEventHandler(this._attachedPanel_OnKeyEvent_Bound);X.OnUnfocusContainer.removeEventHandler(this._attachedPanel_OnUnfocusContainer_Bound)}if(Y===null){return}if(!(Y instanceof b)){throw new Error("value must be an instance of Panel or null.")}Y.cssClassAdd("is-attached");Y.OnKeyEvent.addEventHandler(this._attachedPanel_OnKeyEvent_Bound);Y.OnUnfocusContainer.addEventHandler(this._attachedPanel_OnUnfocusContainer_Bound);Y.DOMElement.tabIndex=-1;if(!this._attachedPanelHookedEvents){this._attachedPanelHookedEvents=true;var W=this;this.OnFocus.addEventHandler(function(){var Z=this.attachedPanel();if(Z&&!Z.visible()){if(this._ignoreNextFocus){if(V){r.Log.Debug("Is not showing/focusing panel.")}this._ignoreNextFocus=false}else{if(V){r.Log.Debug("Showing/focusing panel.")}Z.visible(true);if(this.readOnly()){Z.focus()}}}});this.OnClick.addEventHandler(function(){var Z=this.attachedPanel();if(Z){Z.visible(true)}})}var e=Y;if(!e.DOMElement.parentNode){if(this.Parent){this.Parent.Controls.insertAfter(e,this)}else{if(this.DOMElement.parentNode){this.DOMElement.parentNode.insertBefore(e.DOMElement,this.DOMElement.nextSibling)}}e.Style({position:"absolute"})}}),_autoSuggestSource:null,_currentSuggestion:null,_stopSuggestions:false,_makeSuggestion:function(){if(!this._autoSuggestSource||this._stopSuggestions){return}var W=this.text();if(W.length==0){return}var e=this._autoSuggestSource.find(function(Y){return(Y.length>W.length&&Y.substr(0,W.length).toLowerCase()===W.toLowerCase())});if(!e){this._currentSuggestion=null}else{this._currentSuggestion=e.substr(W.length);var X=this.DOMElement.selectionStart;this.DOMElement.value=this.DOMElement.value+this._currentSuggestion;this.DOMElement.selectionStart=X;this.DOMElement.selectionEnd=X+this._currentSuggestion.length}},_lockInSuggestion:function(){var e=this._currentSuggestion;if(e&&!this._stopSuggestions){this._currentSuggestion=null;this._stopSuggestions=false;alert("lockin");this.text(this.text()+e)}},selectAll:function(){this.DOMElement.select()},autoSuggestSource:r.Property(null,function y(e){if(e!==null&&!R.Array(e)){throw new Error("value must be an array")}if(e===null||e.length==0){this._autoSuggestSource=null;this._currentSuggestion=null;this._stopSuggestions=false;return}this._autoSuggestSource=e.clone()}),text:r.Property(function N(){var e=this.value();if(this._currentSuggestion){e=e.substr(0,e.length-this._currentSuggestion.length)}var W=this.maxLength();if((e||"").length>W){e=e.substr(0,W)}return e},function y(e){this._currentSuggestion=null;this._stopSuggestions=false;this.value(e)}),placeholder:r.Property("",function y(e){this.DOMElement.placeholder=e}),maxLength:r.Property(2147483647,function y(e){this.DOMElement.maxLength=e})});U.wrap=function(e){return new U(e)};d.registerWrapper("a",n.wrap);d.registerWrapper("select",o.wrap);d.registerWrapper("textarea",U.wrap);d.registerWrapper("input",function(e){switch(e.type.toLowerCase()){case"text":return U.wrap(e);case"submit":return L.wrap(e);default:return null}});var J=function J(){this.base("date-input");if(r.UI.DateInput.HasNativeSupport){this.DOMElement.type="date"}else{this.DOMElement.type="text";this._setupPicker()}this.OnChange.addEventHandler(function(W,X){if(X.changedByUser){if(this.allowTextEntry()||this.DOMElement.type==="date"){var Y=new Date(X.value);if(Y){this.date(Y)}}}});this.OnDateSelected.addEventHandler(function(X,Y){var W=this._bound;if(W){W.obj[W.field]=Y.date}});this.formatString("dd/MM/yyyy");r.CultureInfo.currentUICulture.OnChange.addEventHandler(function(e){this._updateText()}.bind(this))}.InheritsFrom(U,{OnDateSelected:r.EventPrototype("sender, e:{date:dteDate, formatted:strDate}"),_updateText:function(){if(!this.date()){this.value("")}else{if(this.DOMElement.type==="text"){this.value(this.date().toStringFormat(this.formatString(),r.CultureInfo.currentUICulture()))}else{this.value(this.date().toStringFormat("yyyy-MM-dd",r.CultureInfo.currentUICulture()))}}},allowTextEntry:r.Property(false,function y(e){this.readOnly(e)}),isRequired:r.Property(true).OnChange(function(e){if(e&&!this.date()){this.date(this.minDate()||new V3Date())}}),formatString:r.Property("",function y(X,e,W){if(!X){W.value="dd/MM/yyyy"}}).OnChange(function(e){this._updateText();if(!J.HasNativeSupport){this.DOMElement.size=new Date("2000-09-26").toStringFormat(e).length}}),date:r.Property(null,function y(X,e,W){if(X&&R.String(X)){W.value=X=new V3Date(X).date()}else{if(!X){if(!this.isRequired()){this.value("");return}W.value=X=(this.minDate()||new V3Date().date())}else{W.value=X=X.asV3Date().date()}}if(this.maxDate()){if(X>this.maxDate()){W.value=X=this.maxDate()}}if(this.minDate()){if(X<this.minDate()){W.value=X=this.minDate()}}if(X.equals(e)){return false}}).OnChange(function(){this._updateText();this.OnDateSelected.fire(this,{date:this.date(),formatted:this.value()})}),_bound:!window.vsDesignTime?null:{obj:null,field:null},bind:function(X,W){var e=this._bound;if(X){e=this._bound={obj:X,field:W};if(r.Is.Defined(X[W])){this.date(X[W]);return}}if(e.obj[e.field]){this.date(e.obj[e.field]);e.obj[e.field]=this.date()}},_jQueryPickerInUse:null,minDate:r.Property(null,function y(X,e,W){if(R.String(X)){W.value=X=new V3Date(X).date()}else{W.value=X=new V3Date(X).date()}if(X&&this.maxDate()&&X>this.maxDate()){throw new Error("minDate must be less than or equal to maxDate")}}).OnChange(function E(e){if(J.HasNativeSupport){this.DOMElement.min=e.toStringFormat("yyyy-MM-dd")}else{if(this._jQueryPickerInUse){r.jQuery(this.DOMElement).datepicker("option","minDate",e)}}if(e&&this.date()&&this.date()<e){this.date(e)}}),maxDate:r.Property(null,function y(X,e,W){if(R.String(X)){W.value=X=new V3Date(X).date()}else{W.value=X=new V3Date(X).date()}if(X&&this.minDate()&&X<this.minDate()){throw new Error("maxDate must be less than or equal to minDate")}}).OnChange(function E(e){if(J.HasNativeSupport){this.DOMElement.max=e.toStringFormat("yyyy-MM-dd")}else{if(this._jQueryPickerInUse){r.jQuery(this.DOMElement).datepicker("option","maxDate",e)}}if(e&&this.date()&&this.date()>e){this.date(e)}}),_setupPicker:function(){if(!r.jQuery){r.Log.Error("The browser does not support the HTML5 input type 'Date' and jQuery is not present, we cannot present a date picker UI control.");return}var e=new b().Set({cssClass:"date-picker",visible:false,OnKeyEvent:function(W,X){if(X.Type==q.Down&&X.KeyCode==p.Escape){X.Event.stopPropagation();this.visible(false)}}}).Style({position:"relative"}).Insert(new L("X").Set({cssClass:"ui-datepicker-close ui-state-default ui-priority-primary ui-corner-all",OnClick:function(W,X){e.visible(false)}}));this.attachedPanel(e);this.OnParentChange.addEventHandler(function(X,Y,W){if(!this.Parent){if(W){W.Controls.remove(e)}}else{this.Parent.Controls.insertAfter(e,this);if(!this._jQueryPickerInUse){setTimeout(function(){var Z=r.jQuery(e.DOMElement);var aa=r.CultureInfo.currentUICulture().dateTimeFormat();this._jQueryPickerInUse=true;Z.datepicker({onSelect:function(){this.date(Z.datepicker("getDate"));e.visible(false)}.bind(this),onClose:function(ac,ab){this.date(Z.datepicker("getDate"))}.bind(this),showAnim:"",numberOfMonths:1,dateFormat:"yyyy-MM-dd",showButtonPanel:false,buttonImage:"",minDate:this.minDate(),maxDate:this.maxDate(),hideIfNoPrevNext:true,dayNames:aa.dayNames(),dayNamesShort:aa.abbreviatedDayNames(),monthNames:aa.monthNames(),monthNamesShort:aa.abbreviatedMonthNames(),dayNamesMin:aa.shortestDayNames(),firstDay:aa.firstDayOfWeek()||0});r.CultureInfo.currentUICulture.OnChange.addEventHandler(function(ab){var ad=ab.dateTimeFormat();var ac=Z.datepicker({dayNames:ad.dayNames(),dayNamesShort:ad.abbreviatedDayNames(),monthNames:ad.monthNames(),monthNamesShort:ad.abbreviatedMonthNames(),dayNamesMin:ad.shortestDayNames()})});e.OnVisibleChange.addEventHandler(function(ac,ab){if(ab){Z.datepicker("setDate",this.date())}}.bind(this))}.bind(this),0)}}});this.readOnly(true)}});try{var Q=document.createElement("input");Q.type="date";Q.value="><";if(Q.type!=="date"){throw new Error('type "Date" not supported')}else{if(Q.value==="><"){throw new Error('allowed text "><"')}}J.HasNativeSupport=true;r.Log.Debug("Browser has native support for DateInput!")}catch(A){r.Log.Debug("Browser does not have native support for DateInput, error: "+A,"error",A);J.HasNativeSupport=false}var m=function m(e){this.base("popup "+(e||""));this._doPositioning_Bound=this._doPositioning.bind(this);this.visible(false);this.visible.OnChange.addEventHandler(function(W){if(W){if(this._modal){this._pnlBlocker.appendTo(c())}this.appendTo(c())}});this.OnVisibleChange.addEventHandler(function(Y,W){if(W){if(this._onOpening()===false){this.close()}else{this._doPositioning();setTimeout(this._doPositioning.bind(this),0)}r.Utils.OnResize.addEventHandler(this._doPositioning_Bound);this.OnShow.fire(this,{})}else{if(this._onClosing()===false){return}var X=c();if(X.contains(this.DOMElement)){X.removeChild(this.DOMElement)}if(X.contains(this._pnlBlocker.DOMElement)){X.removeChild(this._pnlBlocker.DOMElement)}r.Utils.OnResize.removeEventHandler(this._doPositioning_Bound);this.OnClose.fire(this,{cancelled:this._isCancel!==false});this._isCancel=null}});this.Style({position:"absolute"});this.cssClass.OnChange.addEventHandler(function(W){this._pnlBlocker.cssClass(W)});this.OnKeyEvent.addEventHandler(function(W,X){if(X.Type==q.Down&&X.KeyCode==p.Escape&&this.closeOnEscape()){X.Event.stopPropagation();this.close()}})}.InheritsFrom(b,{OnShow:r.EventPrototype("sender, e"),OnClose:r.EventPrototype("sender, e:{cancel:true/false, product: productEntity, configuration: {}"),_modal:false,_pnlBlocker:b("popup-background-cover").Defaults({Style:{position:"fixed",left:0,top:0,right:0,bottom:0},OnClick:function(W,X){if(this._modal&&this.closeModalOnBackgroundClick()){this.close()}},OnFocus:function(W,X){this.focus()}}),closeOnEscape:r.Property(true),closeModalOnBackgroundClick:r.Property(true),_onOpening:function(){},_onClosing:function(){},_doPositioning:function(){this.Style({left:Math.floor(Math.max(0,(window.innerWidth/2)-(this.DOMElement.offsetWidth/2))+window.pageXOffset),top:Math.floor(Math.max(0,(window.innerHeight/2)-(this.DOMElement.offsetHeight/2))+window.pageYOffset)})},show:function(e){if(this.visible()){return}this._modal=e;if(e){this.cssClassAdd("modal")}else{this.cssClassRem("modal")}this.visible(true);this.focus()},_isCancel:null,close:function(e){this._isCancel=!e;this.visible(false)}});var s=function s(Y,X,W){if(arguments.length==2){if(R.Boolean(X)){W=X;X=null}}this.base("",Y,"toggler");this.OnClick.addEventHandler(this._this_OnClick);this.targetControl(X);if(!R.Boolean(W)){W=true}this.collapsed(W);this.cssClass.OnChange.addEventHandler(function(Z){if(this.collapsed()){this.cssClassAdd("is-collapsed")}else{this.cssClassAdd("is-expanded")}});var e=this;this.collapsed.OnChange.addEventHandler(function(Z){e.OnToggle.fire(e,{collapsed:Z})})}.InheritsFrom(n,{OnToggle:r.EventPrototype("sender, e:{collapsed:true||false}"),_this_OnClick:function(W,X){if(X){X.Event.stopPropagation()}this.collapsed(!this.collapsed())},collapsed:r.Property(null).OnChange(function(e){this._updateTargetObject()}),_updateTargetObject:function(){var e=this.collapsed();if(!e){this.cssClassRem("is-collapsed");this.cssClassAdd("is-expanded");if(this._target){this._target.cssClassRem("collapsed");this._target.cssClassAdd("expanded");this._target.visible(true)}}if(e){this.cssClassRem("is-expanded");this.cssClassAdd("is-collapsed");if(this._target){this._target.cssClassRem("expanded");this._target.cssClassAdd("collapsed");this._target.visible(false)}}},_target:null,targetControl:r.Property(null).OnChange(function(W,e){this._target=W;if(e){e.cssClassRem("toggler-controlled");e.cssClassRem("expanded");e.cssClassRem("collapsed")}if(W){W.cssClassAdd("toggler-controlled");this._updateTargetObject()}})});var f=function f(e,W){this.base(this._OnAddNode,this._OnRemoveNode);this._treeOnAddNode=e;this._treeOnRemoveNode=W}.InheritsFrom(r.Collection,{_treeOnAddNode:null,_treeOnRemoveNode:null,_OnAddNode:function(W,e,X){if(!(W instanceof K)){throw new Error("node must be of type TreeNode")}this._treeOnAddNode(W,e,X)},_OnRemoveNode:function(W,e,X){if(!(W instanceof K)){throw new Error("node must be of type TreeNode")}this._treeOnRemoveNode(W,e,X)}});var K=function K(e){this.base();this.Nodes=new f(this._OnAddNode.bind(this),this._OnRemoveNode.bind(this));this.initialiseComponent();this.Set({OnVisibleChange:function(X,W){this._Wrapper.visible(W)}});this._Wrapper.DOMElement.v3FocusableParent=true;this._SetStateClass()}.InheritsFrom(b,{_Wrapper:b().Defaults({cssClass:"node"}),_Item:b().Defaults({cssClass:"item"}),_Trigger:D().Defaults({cssClass:"trigger",visible:false,text:"",OnClick:function(W,X){this.collapsed(!this.collapsed())}}),_SetStateClass:function(){if(this.Nodes.count()==0){this._Wrapper.cssClassRem("expanded");this._Wrapper.cssClassRem("collapsed")}else{if(this.collapsed()){this._Wrapper.cssClassRem("expanded");this._Wrapper.cssClassAdd("collapsed")}else{this._Wrapper.cssClassRem("collapsed");this._Wrapper.cssClassAdd("expanded")}}},Nodes:new f(),collapsed:r.Property(false),parentNode:r.Property(null),_OnAddNode:function(W,e,X){this._Wrapper.Controls.addAt(e+1,W._Wrapper);this._Wrapper.cssClassAdd("has-children");this._Trigger.visible(true);W.parentNode(this);X();this._SetStateClass()},_OnRemoveNode:function(W,e,X){X();this._Wrapper.Controls.remove(W._Wrapper);if(this.Nodes.count()==0){this._Wrapper.cssClassRem("has-children");this._Trigger.visible(false)}this._SetStateClass()},initialiseComponent:function(){this._Wrapper.Insert(this._Item);this._Item.Insert(this._Trigger,this);this.collapsed.OnChange.addEventHandler(function(){this._SetStateClass()}.bind(this));this.DOMElement.tabIndex=-1;this.Set({OnFocus:function(W,X){this._Wrapper.cssClassAdd("focused")},OnUnfocus:function(W,X){this._Wrapper.cssClassRem("focused")},OnMouseEvent:function(W,X){switch(X.Type){case S.DoubleClick:if(X.Target===this||X.Target===this._label){if(this._Trigger.visible()){this.collapsed(!this.collapsed())}X.Event.preventDefault();return false}break}}.bind(this)});this._Wrapper.DOMElement.V3Ctrl=this},text:r.Property("",function y(e){if(this._label){this._label.text(e)}else{this._label=new r.UI.Label().Set({cssClass:"node-label",text:e});this.Controls.add(this._label)}}),getTree:function(){var e=this.parentNode();while(e){if(e instanceof g){return e}else{e=e.parentNode()}}return null},InsertNode:function(Y,X,e){for(var W=0;W<arguments.length;W++){this.Nodes.add(arguments[W])}return this}});var g=function g(){this.base();this.Controls._onAdd=function(W){if(W instanceof K){this._rootNode.Nodes.add(W);return false}};this.rootNode(new K());var e=function(){this.DOMElement.className=this.cssClass()+" "+this._internalCssClasses.toArray().join(" ")}.bind(this);this._internalCssClasses.OnChange.addEventHandler(e);this.cssClass.OnChange.addEventHandler(e);this._internalCssClasses.add("tree-view")}.InheritsFrom(b,{_internalCssClasses:r.Collection(),rootNode:r.Property(function N(){return this._rootNode},function y(W,e){if(e){e._Wrapper.cssClassRem("root");this.Controls.remove(e._Wrapper)}this._rootNode=W;this._rootNode._Wrapper.cssClassAdd("root");this._rootNode.collapsed.OnChange.addEventHandler(function(X){if(X&&!this.showRootTrigger()){this._rootNode.collapsed(false)}}.bind(this));this.Nodes=this._rootNode.Nodes;this.Controls.add(this._rootNode._Wrapper);this._rootNode.parentNode(this)}),showRootNode:r.Property(true,function y(e){if(e){this._internalCssClasses.remove("no-root")}else{this._internalCssClasses.add("no-root",true)}}),showRootTrigger:r.Property(true,function y(e){if(e){this._internalCssClasses.remove("no-root-trigger")}else{this._internalCssClasses.add("no-root-trigger",true)}}),Insert:function(e){throw new Error("Not supported")},InsertNode:function(Y,X,e){for(var W=0;W<arguments.length;W++){this.Nodes.add(arguments[W])}return this}});var v=function v(e){this.base();this.Controls.add(this._btnDelete.Set({OnClick:function(X,Y){this.parentNode().removeExpression(this)}.bind(this)}));if(!e){var W=r.clone({Id:null,IsGroup:false,IsExpression:true,Expression:{}});W.Id=r.newId();this.bind(W)}}.InheritsFrom(K,{_dto:null,_btnDelete:L("x"),bind:function(W){if(!W){throw new Error("objDTO must be an object instance.")}if(W.IsGroup){throw new Error("objDTO must be a object that represents an expression, not a group.")}if(!W.Expression){W.Expression={}}this._dto=W;var e=this.getTree();if(e instanceof w){e.OnBind.fire(this,{dto:W.Expression})}}});var a=function a(W){this.base(true);this.Insert(this._ddlOperator);this._nodeControls.Insert("Add",this._btnAddGroup," or ",this._btnAddNode);this.Controls.remove(this._btnDelete);if(!W){this.Controls.add(this._btnDelete)}var e=r.clone({Id:null,IsGroup:true,Operator:0,Nodes:[]});e.Id=r.newId();this.bind(e);this.InsertNode(this._nodeControls)}.InheritsFrom(v,{_btnAddGroup:L("Group").Defaults({OnClick:function(){this.addGroupNode()}}),_btnAddNode:L("Add").Defaults({OnClick:function(){this.addNode()}}),_nodeControls:K().Defaults({_Wrapper:{cssClassAdd:"controls"}}),_ddlOperator:o({"All must apply":0,"One or more must apply":1}).Defaults({cssClass:"operator"}),_dto:null,bind:function(e){if(!e){throw new Error("objDTO must be set to an object instance in order for data to be bound to it.")}if(e.IsExpression){throw new Error("objDTO must be a object that represents a group, not an expression.")}this._dto=e;this._doBind()},clear:function(){while(this.Nodes.count()>0){if(this.Nodes.get(0) instanceof v){this.removeExpression(this.Nodes.get(0))}else{break}}},_doBind:function(){this.clear();if(!this._dto.IsGroup){throw Error("root node must be a group")}if(!this._dto.Nodes){this._dto.Nodes=[]}this._ddlOperator.bind(this._dto,"Operator");this._dto.Nodes.forEach(function(W,e){if(W.IsGroup){this.addGroupNode(W)}else{this.addNode(W)}}.bind(this))},addGroupNode:function(){var W=new a();this.Nodes.insertBefore(W,this._nodeControls);this.getTree()._onNodeAdded(W);if(arguments.length===1){W.bind(arguments[0])}else{var e=W._dto;W.bind(e);this._dto.Nodes.add(e)}},addNode:function(){var W=new v();this.Nodes.insertBefore(W,this._nodeControls);this.getTree()._onNodeAdded(W);if(arguments.length===1){W.bind(arguments[0])}else{var e=W._dto;W.bind(e);this._dto.Nodes.add(e)}},removeExpression:function(e){this._dto.Nodes.remove(e._dto);this.Nodes.remove(e)}});var w=function w(){this.base();var e=new a(true);this.rootNode(e);setTimeout(function(){this._onNodeAdded(e)}.bind(this),1)}.InheritsFrom(g,{OnBind:r.EventPrototype("node, e:{dto:{}}",{log:V}),OnNodeAdded:r.EventPrototype("sender, e:{Node:TreeNode, IsRoot:Boolean}",{log:V}),_onNodeAdded:function(e){if(e instanceof a){this.OnNodeAdded.fire(this,{Node:e,IsGroupNode:true,Controls:{btnAddGroup:e._btnAddGroup,btnAddNode:e._btnAddNode,btnDelete:e._btnDelete}})}else{if(e instanceof v){this.OnNodeAdded.fire(this,{Node:e,IsRoot:false,IsGroupNode:false,Controls:{btnDelete:e._btnDelete}})}}},bind:r.Property(null,function y(e){this.rootNode().bind(e)})});var t=function t(e,W){this.base(document.createElementNS("http://www.w3.org/2000/svg","svg"));this._DOMDefinitions=document.createElementNS("http://www.w3.org/2000/svg","defs");this.DOMElement.appendChild(this._DOMDefinitions);this._DOMPath=document.createElementNS("http://www.w3.org/2000/svg","path");this.DOMElement.appendChild(this._DOMPath);if(e){this.size(e);this.viewBox(e)}if(R.String(W)){this.path(W)}}.InheritsFrom(x,{_DOMPath:null,lineColor:r.Property(r.Colors.Black).OnChange(function(e){if(!(e instanceof r.Color)){throw new Error("value is not supported")}this._DOMPath.setAttribute("stroke",e)}),lineThickness:r.Property(1).OnChange(function(e){this._DOMPath.setAttribute("stroke-width",e)}),fillColor:r.Property(r.Colors.Black).OnChange(function y(e){if(!(e instanceof r.Color)){throw new Error("value is not supported")}this._DOMPath.setAttribute("fill",e)}),scale:r.Property(null).OnChange(function(e){}),path:r.Property("").OnChange(function(e){this._DOMPath.setAttribute("d",e)}),size:r.Property({width:10,height:10}).OnChange(function(e){this.DOMElement.setAttribute("width",e.width+"px");this.DOMElement.setAttribute("height",e.height+"px")}),viewBox:r.Property({x:0,y:0,width:10,height:10}).OnChange(function(Y,Z){var e=(r.Is.Specified(Y.x)?Y.x:Z.x);var aa=(r.Is.Specified(Y.y)?Y.y:Z.y);var W=(r.Is.Specified(Y.width)?Y.width:Z.width);var X=(r.Is.Specified(Y.height)?Y.height:Z.height);this.DOMElement.setAttribute("viewBox",e+" "+aa+" "+W+" "+X)}),addFilter:function(W){W='<filter id="fid1" xmlns="http://www.w3.org/2000/svg">'+W+"</filter>";var e=(new DOMParser().parseFromString(W,"text/xml"));this._DOMDefinitions.appendChild(e.firstChild);this._DOMPath.setAttribute("filter",'url("#fid1")')}});t.createStar=function(){return new t({width:200,height:200},"m199.200012,76.897453l-67.433075,-9.659958l-30.166931,-60.2375l-30.166458,60.2375l-67.433548,9.659958l48.800003,46.893753l-11.508995,66.208794l60.308998,-31.262497l60.318008,31.262497l-11.518005,-66.208794l48.800003,-46.893753z").Set({lineThickness:5,lineColor:new r.Color(16360478,0),fillColor:new r.Color(16360478,1)})};r.UI.Utils=I;r.UI.MouseEventType=S;r.UI.Control=u;r.UI.ControlCollection=j;r.UI.WebControlBasic=x;r.UI.WebControl=d;r.UI.HyperLink=n;r.UI.Label=D;r.UI.Panel=b;r.UI.Image=M;r.UI.SpriteImage=C;r.UI.DropDownList=o;r.UI.RadioButton=O;r.UI.CheckBox=l;r.UI.Button=L;r.UI.SpriteGrid=T;r.UI.KeyEventType=q;r.UI.TextBox=U;r.UI.Keys=p;r.UI.TreeView=g;r.UI.TreeNode=K;r.UI.ExpressionTreeView=w;r.UI.FormElement=P;r.UI.DateInput=J;r.UI.Popup=m;r.UI.HyperLinkToggle=s;r.UI.SvgSimple=t;r.UI.getV3BodyRoot=c;r.UI.Images={LoadingCircular:M("data:image/png;base64,R0lGODlhEAAQAPIAAP///wAAAMLCwkJCQgAAAGJiYoKCgpKSkiH+GkNyZWF0ZWQgd2l0aCBhamF4bG9hZC5pbmZvACH5BAAKAAAAIf8LTkVUU0NBUEUyLjADAQAAACwAAAAAEAAQAAADMwi63P4wyklrE2MIOggZnAdOmGYJRbExwroUmcG2LmDEwnHQLVsYOd2mBzkYDAdKa+dIAAAh+QQACgABACwAAAAAEAAQAAADNAi63P5OjCEgG4QMu7DmikRxQlFUYDEZIGBMRVsaqHwctXXf7WEYB4Ag1xjihkMZsiUkKhIAIfkEAAoAAgAsAAAAABAAEAAAAzYIujIjK8pByJDMlFYvBoVjHA70GU7xSUJhmKtwHPAKzLO9HMaoKwJZ7Rf8AYPDDzKpZBqfvwQAIfkEAAoAAwAsAAAAABAAEAAAAzMIumIlK8oyhpHsnFZfhYumCYUhDAQxRIdhHBGqRoKw0R8DYlJd8z0fMDgsGo/IpHI5TAAAIfkEAAoABAAsAAAAABAAEAAAAzIIunInK0rnZBTwGPNMgQwmdsNgXGJUlIWEuR5oWUIpz8pAEAMe6TwfwyYsGo/IpFKSAAAh+QQACgAFACwAAAAAEAAQAAADMwi6IMKQORfjdOe82p4wGccc4CEuQradylesojEMBgsUc2G7sDX3lQGBMLAJibufbSlKAAAh+QQACgAGACwAAAAAEAAQAAADMgi63P7wCRHZnFVdmgHu2nFwlWCI3WGc3TSWhUFGxTAUkGCbtgENBMJAEJsxgMLWzpEAACH5BAAKAAcALAAAAAAQABAAAAMyCLrc/jDKSatlQtScKdceCAjDII7HcQ4EMTCpyrCuUBjCYRgHVtqlAiB1YhiCnlsRkAAAOwAAAAAAAAAAAA==").Defaults({cssClass:"loading-image",Style:{borderRadius:"8px",boxShadow:"0px 0px 5px 2px rgba(255,255,255,0.8)"}})};r.EventType.revertDefaultLoggingStatus()}); })(V3);
var V3;
if(!V3){V3={__namespace:true};}
(function(V3){ V3.RegisterFile('jQuery', 3.003001, function (V3) {
var jqExists = (!!window.jQuery);
/*! jQuery v3.3.1 | (c) JS Foundation and other contributors | jquery.org/license */
!function(e,t){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,function(e,t){"use strict";var n=[],r=e.document,i=Object.getPrototypeOf,o=n.slice,a=n.concat,s=n.push,u=n.indexOf,l={},c=l.toString,f=l.hasOwnProperty,p=f.toString,d=p.call(Object),h={},g=function e(t){return"function"==typeof t&&"number"!=typeof t.nodeType},y=function e(t){return null!=t&&t===t.window},v={type:!0,src:!0,noModule:!0};function m(e,t,n){var i,o=(t=t||r).createElement("script");if(o.text=e,n)for(i in v)n[i]&&(o[i]=n[i]);t.head.appendChild(o).parentNode.removeChild(o)}function x(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?l[c.call(e)]||"object":typeof e}var b="3.3.1",w=function(e,t){return new w.fn.init(e,t)},T=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g;w.fn=w.prototype={jquery:"3.3.1",constructor:w,length:0,toArray:function(){return o.call(this)},get:function(e){return null==e?o.call(this):e<0?this[e+this.length]:this[e]},pushStack:function(e){var t=w.merge(this.constructor(),e);return t.prevObject=this,t},each:function(e){return w.each(this,e)},map:function(e){return this.pushStack(w.map(this,function(t,n){return e.call(t,n,t)}))},slice:function(){return this.pushStack(o.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(e){var t=this.length,n=+e+(e<0?t:0);return this.pushStack(n>=0&&n<t?[this[n]]:[])},end:function(){return this.prevObject||this.constructor()},push:s,sort:n.sort,splice:n.splice},w.extend=w.fn.extend=function(){var e,t,n,r,i,o,a=arguments[0]||{},s=1,u=arguments.length,l=!1;for("boolean"==typeof a&&(l=a,a=arguments[s]||{},s++),"object"==typeof a||g(a)||(a={}),s===u&&(a=this,s--);s<u;s++)if(null!=(e=arguments[s]))for(t in e)n=a[t],a!==(r=e[t])&&(l&&r&&(w.isPlainObject(r)||(i=Array.isArray(r)))?(i?(i=!1,o=n&&Array.isArray(n)?n:[]):o=n&&w.isPlainObject(n)?n:{},a[t]=w.extend(l,o,r)):void 0!==r&&(a[t]=r));return a},w.extend({expando:"jQuery"+("3.3.1"+Math.random()).replace(/\D/g,""),isReady:!0,error:function(e){throw new Error(e)},noop:function(){},isPlainObject:function(e){var t,n;return!(!e||"[object Object]"!==c.call(e))&&(!(t=i(e))||"function"==typeof(n=f.call(t,"constructor")&&t.constructor)&&p.call(n)===d)},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},globalEval:function(e){m(e)},each:function(e,t){var n,r=0;if(C(e)){for(n=e.length;r<n;r++)if(!1===t.call(e[r],r,e[r]))break}else for(r in e)if(!1===t.call(e[r],r,e[r]))break;return e},trim:function(e){return null==e?"":(e+"").replace(T,"")},makeArray:function(e,t){var n=t||[];return null!=e&&(C(Object(e))?w.merge(n,"string"==typeof e?[e]:e):s.call(n,e)),n},inArray:function(e,t,n){return null==t?-1:u.call(t,e,n)},merge:function(e,t){for(var n=+t.length,r=0,i=e.length;r<n;r++)e[i++]=t[r];return e.length=i,e},grep:function(e,t,n){for(var r,i=[],o=0,a=e.length,s=!n;o<a;o++)(r=!t(e[o],o))!==s&&i.push(e[o]);return i},map:function(e,t,n){var r,i,o=0,s=[];if(C(e))for(r=e.length;o<r;o++)null!=(i=t(e[o],o,n))&&s.push(i);else for(o in e)null!=(i=t(e[o],o,n))&&s.push(i);return a.apply([],s)},guid:1,support:h}),"function"==typeof Symbol&&(w.fn[Symbol.iterator]=n[Symbol.iterator]),w.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),function(e,t){l["[object "+t+"]"]=t.toLowerCase()});function C(e){var t=!!e&&"length"in e&&e.length,n=x(e);return!g(e)&&!y(e)&&("array"===n||0===t||"number"==typeof t&&t>0&&t-1 in e)}var E=function(e){var t,n,r,i,o,a,s,u,l,c,f,p,d,h,g,y,v,m,x,b="sizzle"+1*new Date,w=e.document,T=0,C=0,E=ae(),k=ae(),S=ae(),D=function(e,t){return e===t&&(f=!0),0},N={}.hasOwnProperty,A=[],j=A.pop,q=A.push,L=A.push,H=A.slice,O=function(e,t){for(var n=0,r=e.length;n<r;n++)if(e[n]===t)return n;return-1},P="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",M="[\\x20\\t\\r\\n\\f]",R="(?:\\\\.|[\\w-]|[^\0-\\xa0])+",I="\\["+M+"*("+R+")(?:"+M+"*([*^$|!~]?=)"+M+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+R+"))|)"+M+"*\\]",W=":("+R+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+I+")*)|.*)\\)|)",$=new RegExp(M+"+","g"),B=new RegExp("^"+M+"+|((?:^|[^\\\\])(?:\\\\.)*)"+M+"+$","g"),F=new RegExp("^"+M+"*,"+M+"*"),_=new RegExp("^"+M+"*([>+~]|"+M+")"+M+"*"),z=new RegExp("="+M+"*([^\\]'\"]*?)"+M+"*\\]","g"),X=new RegExp(W),U=new RegExp("^"+R+"$"),V={ID:new RegExp("^#("+R+")"),CLASS:new RegExp("^\\.("+R+")"),TAG:new RegExp("^("+R+"|[*])"),ATTR:new RegExp("^"+I),PSEUDO:new RegExp("^"+W),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+M+"*(even|odd|(([+-]|)(\\d*)n|)"+M+"*(?:([+-]|)"+M+"*(\\d+)|))"+M+"*\\)|)","i"),bool:new RegExp("^(?:"+P+")$","i"),needsContext:new RegExp("^"+M+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+M+"*((?:-\\d)?\\d*)"+M+"*\\)|)(?=[^-]|$)","i")},G=/^(?:input|select|textarea|button)$/i,Y=/^h\d$/i,Q=/^[^{]+\{\s*\[native \w/,J=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,K=/[+~]/,Z=new RegExp("\\\\([\\da-f]{1,6}"+M+"?|("+M+")|.)","ig"),ee=function(e,t,n){var r="0x"+t-65536;return r!==r||n?t:r<0?String.fromCharCode(r+65536):String.fromCharCode(r>>10|55296,1023&r|56320)},te=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,ne=function(e,t){return t?"\0"===e?"\ufffd":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e},re=function(){p()},ie=me(function(e){return!0===e.disabled&&("form"in e||"label"in e)},{dir:"parentNode",next:"legend"});try{L.apply(A=H.call(w.childNodes),w.childNodes),A[w.childNodes.length].nodeType}catch(e){L={apply:A.length?function(e,t){q.apply(e,H.call(t))}:function(e,t){var n=e.length,r=0;while(e[n++]=t[r++]);e.length=n-1}}}function oe(e,t,r,i){var o,s,l,c,f,h,v,m=t&&t.ownerDocument,T=t?t.nodeType:9;if(r=r||[],"string"!=typeof e||!e||1!==T&&9!==T&&11!==T)return r;if(!i&&((t?t.ownerDocument||t:w)!==d&&p(t),t=t||d,g)){if(11!==T&&(f=J.exec(e)))if(o=f[1]){if(9===T){if(!(l=t.getElementById(o)))return r;if(l.id===o)return r.push(l),r}else if(m&&(l=m.getElementById(o))&&x(t,l)&&l.id===o)return r.push(l),r}else{if(f[2])return L.apply(r,t.getElementsByTagName(e)),r;if((o=f[3])&&n.getElementsByClassName&&t.getElementsByClassName)return L.apply(r,t.getElementsByClassName(o)),r}if(n.qsa&&!S[e+" "]&&(!y||!y.test(e))){if(1!==T)m=t,v=e;else if("object"!==t.nodeName.toLowerCase()){(c=t.getAttribute("id"))?c=c.replace(te,ne):t.setAttribute("id",c=b),s=(h=a(e)).length;while(s--)h[s]="#"+c+" "+ve(h[s]);v=h.join(","),m=K.test(e)&&ge(t.parentNode)||t}if(v)try{return L.apply(r,m.querySelectorAll(v)),r}catch(e){}finally{c===b&&t.removeAttribute("id")}}}return u(e.replace(B,"$1"),t,r,i)}function ae(){var e=[];function t(n,i){return e.push(n+" ")>r.cacheLength&&delete t[e.shift()],t[n+" "]=i}return t}function se(e){return e[b]=!0,e}function ue(e){var t=d.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function le(e,t){var n=e.split("|"),i=n.length;while(i--)r.attrHandle[n[i]]=t}function ce(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&e.sourceIndex-t.sourceIndex;if(r)return r;if(n)while(n=n.nextSibling)if(n===t)return-1;return e?1:-1}function fe(e){return function(t){return"input"===t.nodeName.toLowerCase()&&t.type===e}}function pe(e){return function(t){var n=t.nodeName.toLowerCase();return("input"===n||"button"===n)&&t.type===e}}function de(e){return function(t){return"form"in t?t.parentNode&&!1===t.disabled?"label"in t?"label"in t.parentNode?t.parentNode.disabled===e:t.disabled===e:t.isDisabled===e||t.isDisabled!==!e&&ie(t)===e:t.disabled===e:"label"in t&&t.disabled===e}}function he(e){return se(function(t){return t=+t,se(function(n,r){var i,o=e([],n.length,t),a=o.length;while(a--)n[i=o[a]]&&(n[i]=!(r[i]=n[i]))})})}function ge(e){return e&&"undefined"!=typeof e.getElementsByTagName&&e}n=oe.support={},o=oe.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return!!t&&"HTML"!==t.nodeName},p=oe.setDocument=function(e){var t,i,a=e?e.ownerDocument||e:w;return a!==d&&9===a.nodeType&&a.documentElement?(d=a,h=d.documentElement,g=!o(d),w!==d&&(i=d.defaultView)&&i.top!==i&&(i.addEventListener?i.addEventListener("unload",re,!1):i.attachEvent&&i.attachEvent("onunload",re)),n.attributes=ue(function(e){return e.className="i",!e.getAttribute("className")}),n.getElementsByTagName=ue(function(e){return e.appendChild(d.createComment("")),!e.getElementsByTagName("*").length}),n.getElementsByClassName=Q.test(d.getElementsByClassName),n.getById=ue(function(e){return h.appendChild(e).id=b,!d.getElementsByName||!d.getElementsByName(b).length}),n.getById?(r.filter.ID=function(e){var t=e.replace(Z,ee);return function(e){return e.getAttribute("id")===t}},r.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&g){var n=t.getElementById(e);return n?[n]:[]}}):(r.filter.ID=function(e){var t=e.replace(Z,ee);return function(e){var n="undefined"!=typeof e.getAttributeNode&&e.getAttributeNode("id");return n&&n.value===t}},r.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&g){var n,r,i,o=t.getElementById(e);if(o){if((n=o.getAttributeNode("id"))&&n.value===e)return[o];i=t.getElementsByName(e),r=0;while(o=i[r++])if((n=o.getAttributeNode("id"))&&n.value===e)return[o]}return[]}}),r.find.TAG=n.getElementsByTagName?function(e,t){return"undefined"!=typeof t.getElementsByTagName?t.getElementsByTagName(e):n.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){while(n=o[i++])1===n.nodeType&&r.push(n);return r}return o},r.find.CLASS=n.getElementsByClassName&&function(e,t){if("undefined"!=typeof t.getElementsByClassName&&g)return t.getElementsByClassName(e)},v=[],y=[],(n.qsa=Q.test(d.querySelectorAll))&&(ue(function(e){h.appendChild(e).innerHTML="<a id='"+b+"'></a><select id='"+b+"-\r\\' msallowcapture=''><option selected=''></option></select>",e.querySelectorAll("[msallowcapture^='']").length&&y.push("[*^$]="+M+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||y.push("\\["+M+"*(?:value|"+P+")"),e.querySelectorAll("[id~="+b+"-]").length||y.push("~="),e.querySelectorAll(":checked").length||y.push(":checked"),e.querySelectorAll("a#"+b+"+*").length||y.push(".#.+[+~]")}),ue(function(e){e.innerHTML="<a href='' disabled='disabled'></a><select disabled='disabled'><option/></select>";var t=d.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&y.push("name"+M+"*[*^$|!~]?="),2!==e.querySelectorAll(":enabled").length&&y.push(":enabled",":disabled"),h.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&y.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),y.push(",.*:")})),(n.matchesSelector=Q.test(m=h.matches||h.webkitMatchesSelector||h.mozMatchesSelector||h.oMatchesSelector||h.msMatchesSelector))&&ue(function(e){n.disconnectedMatch=m.call(e,"*"),m.call(e,"[s!='']:x"),v.push("!=",W)}),y=y.length&&new RegExp(y.join("|")),v=v.length&&new RegExp(v.join("|")),t=Q.test(h.compareDocumentPosition),x=t||Q.test(h.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)while(t=t.parentNode)if(t===e)return!0;return!1},D=t?function(e,t){if(e===t)return f=!0,0;var r=!e.compareDocumentPosition-!t.compareDocumentPosition;return r||(1&(r=(e.ownerDocument||e)===(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!n.sortDetached&&t.compareDocumentPosition(e)===r?e===d||e.ownerDocument===w&&x(w,e)?-1:t===d||t.ownerDocument===w&&x(w,t)?1:c?O(c,e)-O(c,t):0:4&r?-1:1)}:function(e,t){if(e===t)return f=!0,0;var n,r=0,i=e.parentNode,o=t.parentNode,a=[e],s=[t];if(!i||!o)return e===d?-1:t===d?1:i?-1:o?1:c?O(c,e)-O(c,t):0;if(i===o)return ce(e,t);n=e;while(n=n.parentNode)a.unshift(n);n=t;while(n=n.parentNode)s.unshift(n);while(a[r]===s[r])r++;return r?ce(a[r],s[r]):a[r]===w?-1:s[r]===w?1:0},d):d},oe.matches=function(e,t){return oe(e,null,null,t)},oe.matchesSelector=function(e,t){if((e.ownerDocument||e)!==d&&p(e),t=t.replace(z,"='$1']"),n.matchesSelector&&g&&!S[t+" "]&&(!v||!v.test(t))&&(!y||!y.test(t)))try{var r=m.call(e,t);if(r||n.disconnectedMatch||e.document&&11!==e.document.nodeType)return r}catch(e){}return oe(t,d,null,[e]).length>0},oe.contains=function(e,t){return(e.ownerDocument||e)!==d&&p(e),x(e,t)},oe.attr=function(e,t){(e.ownerDocument||e)!==d&&p(e);var i=r.attrHandle[t.toLowerCase()],o=i&&N.call(r.attrHandle,t.toLowerCase())?i(e,t,!g):void 0;return void 0!==o?o:n.attributes||!g?e.getAttribute(t):(o=e.getAttributeNode(t))&&o.specified?o.value:null},oe.escape=function(e){return(e+"").replace(te,ne)},oe.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},oe.uniqueSort=function(e){var t,r=[],i=0,o=0;if(f=!n.detectDuplicates,c=!n.sortStable&&e.slice(0),e.sort(D),f){while(t=e[o++])t===e[o]&&(i=r.push(o));while(i--)e.splice(r[i],1)}return c=null,e},i=oe.getText=function(e){var t,n="",r=0,o=e.nodeType;if(o){if(1===o||9===o||11===o){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=i(e)}else if(3===o||4===o)return e.nodeValue}else while(t=e[r++])n+=i(t);return n},(r=oe.selectors={cacheLength:50,createPseudo:se,match:V,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(Z,ee),e[3]=(e[3]||e[4]||e[5]||"").replace(Z,ee),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||oe.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&oe.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return V.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&X.test(n)&&(t=a(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(Z,ee).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=E[e+" "];return t||(t=new RegExp("(^|"+M+")"+e+"("+M+"|$)"))&&E(e,function(e){return t.test("string"==typeof e.className&&e.className||"undefined"!=typeof e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(e,t,n){return function(r){var i=oe.attr(r,e);return null==i?"!="===t:!t||(i+="","="===t?i===n:"!="===t?i!==n:"^="===t?n&&0===i.indexOf(n):"*="===t?n&&i.indexOf(n)>-1:"$="===t?n&&i.slice(-n.length)===n:"~="===t?(" "+i.replace($," ")+" ").indexOf(n)>-1:"|="===t&&(i===n||i.slice(0,n.length+1)===n+"-"))}},CHILD:function(e,t,n,r,i){var o="nth"!==e.slice(0,3),a="last"!==e.slice(-4),s="of-type"===t;return 1===r&&0===i?function(e){return!!e.parentNode}:function(t,n,u){var l,c,f,p,d,h,g=o!==a?"nextSibling":"previousSibling",y=t.parentNode,v=s&&t.nodeName.toLowerCase(),m=!u&&!s,x=!1;if(y){if(o){while(g){p=t;while(p=p[g])if(s?p.nodeName.toLowerCase()===v:1===p.nodeType)return!1;h=g="only"===e&&!h&&"nextSibling"}return!0}if(h=[a?y.firstChild:y.lastChild],a&&m){x=(d=(l=(c=(f=(p=y)[b]||(p[b]={}))[p.uniqueID]||(f[p.uniqueID]={}))[e]||[])[0]===T&&l[1])&&l[2],p=d&&y.childNodes[d];while(p=++d&&p&&p[g]||(x=d=0)||h.pop())if(1===p.nodeType&&++x&&p===t){c[e]=[T,d,x];break}}else if(m&&(x=d=(l=(c=(f=(p=t)[b]||(p[b]={}))[p.uniqueID]||(f[p.uniqueID]={}))[e]||[])[0]===T&&l[1]),!1===x)while(p=++d&&p&&p[g]||(x=d=0)||h.pop())if((s?p.nodeName.toLowerCase()===v:1===p.nodeType)&&++x&&(m&&((c=(f=p[b]||(p[b]={}))[p.uniqueID]||(f[p.uniqueID]={}))[e]=[T,x]),p===t))break;return(x-=i)===r||x%r==0&&x/r>=0}}},PSEUDO:function(e,t){var n,i=r.pseudos[e]||r.setFilters[e.toLowerCase()]||oe.error("unsupported pseudo: "+e);return i[b]?i(t):i.length>1?(n=[e,e,"",t],r.setFilters.hasOwnProperty(e.toLowerCase())?se(function(e,n){var r,o=i(e,t),a=o.length;while(a--)e[r=O(e,o[a])]=!(n[r]=o[a])}):function(e){return i(e,0,n)}):i}},pseudos:{not:se(function(e){var t=[],n=[],r=s(e.replace(B,"$1"));return r[b]?se(function(e,t,n,i){var o,a=r(e,null,i,[]),s=e.length;while(s--)(o=a[s])&&(e[s]=!(t[s]=o))}):function(e,i,o){return t[0]=e,r(t,null,o,n),t[0]=null,!n.pop()}}),has:se(function(e){return function(t){return oe(e,t).length>0}}),contains:se(function(e){return e=e.replace(Z,ee),function(t){return(t.textContent||t.innerText||i(t)).indexOf(e)>-1}}),lang:se(function(e){return U.test(e||"")||oe.error("unsupported lang: "+e),e=e.replace(Z,ee).toLowerCase(),function(t){var n;do{if(n=g?t.lang:t.getAttribute("xml:lang")||t.getAttribute("lang"))return(n=n.toLowerCase())===e||0===n.indexOf(e+"-")}while((t=t.parentNode)&&1===t.nodeType);return!1}}),target:function(t){var n=e.location&&e.location.hash;return n&&n.slice(1)===t.id},root:function(e){return e===h},focus:function(e){return e===d.activeElement&&(!d.hasFocus||d.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:de(!1),disabled:de(!0),checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,!0===e.selected},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeType<6)return!1;return!0},parent:function(e){return!r.pseudos.empty(e)},header:function(e){return Y.test(e.nodeName)},input:function(e){return G.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||"text"===t.toLowerCase())},first:he(function(){return[0]}),last:he(function(e,t){return[t-1]}),eq:he(function(e,t,n){return[n<0?n+t:n]}),even:he(function(e,t){for(var n=0;n<t;n+=2)e.push(n);return e}),odd:he(function(e,t){for(var n=1;n<t;n+=2)e.push(n);return e}),lt:he(function(e,t,n){for(var r=n<0?n+t:n;--r>=0;)e.push(r);return e}),gt:he(function(e,t,n){for(var r=n<0?n+t:n;++r<t;)e.push(r);return e})}}).pseudos.nth=r.pseudos.eq;for(t in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})r.pseudos[t]=fe(t);for(t in{submit:!0,reset:!0})r.pseudos[t]=pe(t);function ye(){}ye.prototype=r.filters=r.pseudos,r.setFilters=new ye,a=oe.tokenize=function(e,t){var n,i,o,a,s,u,l,c=k[e+" "];if(c)return t?0:c.slice(0);s=e,u=[],l=r.preFilter;while(s){n&&!(i=F.exec(s))||(i&&(s=s.slice(i[0].length)||s),u.push(o=[])),n=!1,(i=_.exec(s))&&(n=i.shift(),o.push({value:n,type:i[0].replace(B," ")}),s=s.slice(n.length));for(a in r.filter)!(i=V[a].exec(s))||l[a]&&!(i=l[a](i))||(n=i.shift(),o.push({value:n,type:a,matches:i}),s=s.slice(n.length));if(!n)break}return t?s.length:s?oe.error(e):k(e,u).slice(0)};function ve(e){for(var t=0,n=e.length,r="";t<n;t++)r+=e[t].value;return r}function me(e,t,n){var r=t.dir,i=t.next,o=i||r,a=n&&"parentNode"===o,s=C++;return t.first?function(t,n,i){while(t=t[r])if(1===t.nodeType||a)return e(t,n,i);return!1}:function(t,n,u){var l,c,f,p=[T,s];if(u){while(t=t[r])if((1===t.nodeType||a)&&e(t,n,u))return!0}else while(t=t[r])if(1===t.nodeType||a)if(f=t[b]||(t[b]={}),c=f[t.uniqueID]||(f[t.uniqueID]={}),i&&i===t.nodeName.toLowerCase())t=t[r]||t;else{if((l=c[o])&&l[0]===T&&l[1]===s)return p[2]=l[2];if(c[o]=p,p[2]=e(t,n,u))return!0}return!1}}function xe(e){return e.length>1?function(t,n,r){var i=e.length;while(i--)if(!e[i](t,n,r))return!1;return!0}:e[0]}function be(e,t,n){for(var r=0,i=t.length;r<i;r++)oe(e,t[r],n);return n}function we(e,t,n,r,i){for(var o,a=[],s=0,u=e.length,l=null!=t;s<u;s++)(o=e[s])&&(n&&!n(o,r,i)||(a.push(o),l&&t.push(s)));return a}function Te(e,t,n,r,i,o){return r&&!r[b]&&(r=Te(r)),i&&!i[b]&&(i=Te(i,o)),se(function(o,a,s,u){var l,c,f,p=[],d=[],h=a.length,g=o||be(t||"*",s.nodeType?[s]:s,[]),y=!e||!o&&t?g:we(g,p,e,s,u),v=n?i||(o?e:h||r)?[]:a:y;if(n&&n(y,v,s,u),r){l=we(v,d),r(l,[],s,u),c=l.length;while(c--)(f=l[c])&&(v[d[c]]=!(y[d[c]]=f))}if(o){if(i||e){if(i){l=[],c=v.length;while(c--)(f=v[c])&&l.push(y[c]=f);i(null,v=[],l,u)}c=v.length;while(c--)(f=v[c])&&(l=i?O(o,f):p[c])>-1&&(o[l]=!(a[l]=f))}}else v=we(v===a?v.splice(h,v.length):v),i?i(null,a,v,u):L.apply(a,v)})}function Ce(e){for(var t,n,i,o=e.length,a=r.relative[e[0].type],s=a||r.relative[" "],u=a?1:0,c=me(function(e){return e===t},s,!0),f=me(function(e){return O(t,e)>-1},s,!0),p=[function(e,n,r){var i=!a&&(r||n!==l)||((t=n).nodeType?c(e,n,r):f(e,n,r));return t=null,i}];u<o;u++)if(n=r.relative[e[u].type])p=[me(xe(p),n)];else{if((n=r.filter[e[u].type].apply(null,e[u].matches))[b]){for(i=++u;i<o;i++)if(r.relative[e[i].type])break;return Te(u>1&&xe(p),u>1&&ve(e.slice(0,u-1).concat({value:" "===e[u-2].type?"*":""})).replace(B,"$1"),n,u<i&&Ce(e.slice(u,i)),i<o&&Ce(e=e.slice(i)),i<o&&ve(e))}p.push(n)}return xe(p)}function Ee(e,t){var n=t.length>0,i=e.length>0,o=function(o,a,s,u,c){var f,h,y,v=0,m="0",x=o&&[],b=[],w=l,C=o||i&&r.find.TAG("*",c),E=T+=null==w?1:Math.random()||.1,k=C.length;for(c&&(l=a===d||a||c);m!==k&&null!=(f=C[m]);m++){if(i&&f){h=0,a||f.ownerDocument===d||(p(f),s=!g);while(y=e[h++])if(y(f,a||d,s)){u.push(f);break}c&&(T=E)}n&&((f=!y&&f)&&v--,o&&x.push(f))}if(v+=m,n&&m!==v){h=0;while(y=t[h++])y(x,b,a,s);if(o){if(v>0)while(m--)x[m]||b[m]||(b[m]=j.call(u));b=we(b)}L.apply(u,b),c&&!o&&b.length>0&&v+t.length>1&&oe.uniqueSort(u)}return c&&(T=E,l=w),x};return n?se(o):o}return s=oe.compile=function(e,t){var n,r=[],i=[],o=S[e+" "];if(!o){t||(t=a(e)),n=t.length;while(n--)(o=Ce(t[n]))[b]?r.push(o):i.push(o);(o=S(e,Ee(i,r))).selector=e}return o},u=oe.select=function(e,t,n,i){var o,u,l,c,f,p="function"==typeof e&&e,d=!i&&a(e=p.selector||e);if(n=n||[],1===d.length){if((u=d[0]=d[0].slice(0)).length>2&&"ID"===(l=u[0]).type&&9===t.nodeType&&g&&r.relative[u[1].type]){if(!(t=(r.find.ID(l.matches[0].replace(Z,ee),t)||[])[0]))return n;p&&(t=t.parentNode),e=e.slice(u.shift().value.length)}o=V.needsContext.test(e)?0:u.length;while(o--){if(l=u[o],r.relative[c=l.type])break;if((f=r.find[c])&&(i=f(l.matches[0].replace(Z,ee),K.test(u[0].type)&&ge(t.parentNode)||t))){if(u.splice(o,1),!(e=i.length&&ve(u)))return L.apply(n,i),n;break}}}return(p||s(e,d))(i,t,!g,n,!t||K.test(e)&&ge(t.parentNode)||t),n},n.sortStable=b.split("").sort(D).join("")===b,n.detectDuplicates=!!f,p(),n.sortDetached=ue(function(e){return 1&e.compareDocumentPosition(d.createElement("fieldset"))}),ue(function(e){return e.innerHTML="<a href='#'></a>","#"===e.firstChild.getAttribute("href")})||le("type|href|height|width",function(e,t,n){if(!n)return e.getAttribute(t,"type"===t.toLowerCase()?1:2)}),n.attributes&&ue(function(e){return e.innerHTML="<input/>",e.firstChild.setAttribute("value",""),""===e.firstChild.getAttribute("value")})||le("value",function(e,t,n){if(!n&&"input"===e.nodeName.toLowerCase())return e.defaultValue}),ue(function(e){return null==e.getAttribute("disabled")})||le(P,function(e,t,n){var r;if(!n)return!0===e[t]?t.toLowerCase():(r=e.getAttributeNode(t))&&r.specified?r.value:null}),oe}(e);w.find=E,w.expr=E.selectors,w.expr[":"]=w.expr.pseudos,w.uniqueSort=w.unique=E.uniqueSort,w.text=E.getText,w.isXMLDoc=E.isXML,w.contains=E.contains,w.escapeSelector=E.escape;var k=function(e,t,n){var r=[],i=void 0!==n;while((e=e[t])&&9!==e.nodeType)if(1===e.nodeType){if(i&&w(e).is(n))break;r.push(e)}return r},S=function(e,t){for(var n=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n},D=w.expr.match.needsContext;function N(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()}var A=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function j(e,t,n){return g(t)?w.grep(e,function(e,r){return!!t.call(e,r,e)!==n}):t.nodeType?w.grep(e,function(e){return e===t!==n}):"string"!=typeof t?w.grep(e,function(e){return u.call(t,e)>-1!==n}):w.filter(t,e,n)}w.filter=function(e,t,n){var r=t[0];return n&&(e=":not("+e+")"),1===t.length&&1===r.nodeType?w.find.matchesSelector(r,e)?[r]:[]:w.find.matches(e,w.grep(t,function(e){return 1===e.nodeType}))},w.fn.extend({find:function(e){var t,n,r=this.length,i=this;if("string"!=typeof e)return this.pushStack(w(e).filter(function(){for(t=0;t<r;t++)if(w.contains(i[t],this))return!0}));for(n=this.pushStack([]),t=0;t<r;t++)w.find(e,i[t],n);return r>1?w.uniqueSort(n):n},filter:function(e){return this.pushStack(j(this,e||[],!1))},not:function(e){return this.pushStack(j(this,e||[],!0))},is:function(e){return!!j(this,"string"==typeof e&&D.test(e)?w(e):e||[],!1).length}});var q,L=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/;(w.fn.init=function(e,t,n){var i,o;if(!e)return this;if(n=n||q,"string"==typeof e){if(!(i="<"===e[0]&&">"===e[e.length-1]&&e.length>=3?[null,e,null]:L.exec(e))||!i[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(i[1]){if(t=t instanceof w?t[0]:t,w.merge(this,w.parseHTML(i[1],t&&t.nodeType?t.ownerDocument||t:r,!0)),A.test(i[1])&&w.isPlainObject(t))for(i in t)g(this[i])?this[i](t[i]):this.attr(i,t[i]);return this}return(o=r.getElementById(i[2]))&&(this[0]=o,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):g(e)?void 0!==n.ready?n.ready(e):e(w):w.makeArray(e,this)}).prototype=w.fn,q=w(r);var H=/^(?:parents|prev(?:Until|All))/,O={children:!0,contents:!0,next:!0,prev:!0};w.fn.extend({has:function(e){var t=w(e,this),n=t.length;return this.filter(function(){for(var e=0;e<n;e++)if(w.contains(this,t[e]))return!0})},closest:function(e,t){var n,r=0,i=this.length,o=[],a="string"!=typeof e&&w(e);if(!D.test(e))for(;r<i;r++)for(n=this[r];n&&n!==t;n=n.parentNode)if(n.nodeType<11&&(a?a.index(n)>-1:1===n.nodeType&&w.find.matchesSelector(n,e))){o.push(n);break}return this.pushStack(o.length>1?w.uniqueSort(o):o)},index:function(e){return e?"string"==typeof e?u.call(w(e),this[0]):u.call(this,e.jquery?e[0]:e):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){return this.pushStack(w.uniqueSort(w.merge(this.get(),w(e,t))))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}});function P(e,t){while((e=e[t])&&1!==e.nodeType);return e}w.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return k(e,"parentNode")},parentsUntil:function(e,t,n){return k(e,"parentNode",n)},next:function(e){return P(e,"nextSibling")},prev:function(e){return P(e,"previousSibling")},nextAll:function(e){return k(e,"nextSibling")},prevAll:function(e){return k(e,"previousSibling")},nextUntil:function(e,t,n){return k(e,"nextSibling",n)},prevUntil:function(e,t,n){return k(e,"previousSibling",n)},siblings:function(e){return S((e.parentNode||{}).firstChild,e)},children:function(e){return S(e.firstChild)},contents:function(e){return N(e,"iframe")?e.contentDocument:(N(e,"template")&&(e=e.content||e),w.merge([],e.childNodes))}},function(e,t){w.fn[e]=function(n,r){var i=w.map(this,t,n);return"Until"!==e.slice(-5)&&(r=n),r&&"string"==typeof r&&(i=w.filter(r,i)),this.length>1&&(O[e]||w.uniqueSort(i),H.test(e)&&i.reverse()),this.pushStack(i)}});var M=/[^\x20\t\r\n\f]+/g;function R(e){var t={};return w.each(e.match(M)||[],function(e,n){t[n]=!0}),t}w.Callbacks=function(e){e="string"==typeof e?R(e):w.extend({},e);var t,n,r,i,o=[],a=[],s=-1,u=function(){for(i=i||e.once,r=t=!0;a.length;s=-1){n=a.shift();while(++s<o.length)!1===o[s].apply(n[0],n[1])&&e.stopOnFalse&&(s=o.length,n=!1)}e.memory||(n=!1),t=!1,i&&(o=n?[]:"")},l={add:function(){return o&&(n&&!t&&(s=o.length-1,a.push(n)),function t(n){w.each(n,function(n,r){g(r)?e.unique&&l.has(r)||o.push(r):r&&r.length&&"string"!==x(r)&&t(r)})}(arguments),n&&!t&&u()),this},remove:function(){return w.each(arguments,function(e,t){var n;while((n=w.inArray(t,o,n))>-1)o.splice(n,1),n<=s&&s--}),this},has:function(e){return e?w.inArray(e,o)>-1:o.length>0},empty:function(){return o&&(o=[]),this},disable:function(){return i=a=[],o=n="",this},disabled:function(){return!o},lock:function(){return i=a=[],n||t||(o=n=""),this},locked:function(){return!!i},fireWith:function(e,n){return i||(n=[e,(n=n||[]).slice?n.slice():n],a.push(n),t||u()),this},fire:function(){return l.fireWith(this,arguments),this},fired:function(){return!!r}};return l};function I(e){return e}function W(e){throw e}function $(e,t,n,r){var i;try{e&&g(i=e.promise)?i.call(e).done(t).fail(n):e&&g(i=e.then)?i.call(e,t,n):t.apply(void 0,[e].slice(r))}catch(e){n.apply(void 0,[e])}}w.extend({Deferred:function(t){var n=[["notify","progress",w.Callbacks("memory"),w.Callbacks("memory"),2],["resolve","done",w.Callbacks("once memory"),w.Callbacks("once memory"),0,"resolved"],["reject","fail",w.Callbacks("once memory"),w.Callbacks("once memory"),1,"rejected"]],r="pending",i={state:function(){return r},always:function(){return o.done(arguments).fail(arguments),this},"catch":function(e){return i.then(null,e)},pipe:function(){var e=arguments;return w.Deferred(function(t){w.each(n,function(n,r){var i=g(e[r[4]])&&e[r[4]];o[r[1]](function(){var e=i&&i.apply(this,arguments);e&&g(e.promise)?e.promise().progress(t.notify).done(t.resolve).fail(t.reject):t[r[0]+"With"](this,i?[e]:arguments)})}),e=null}).promise()},then:function(t,r,i){var o=0;function a(t,n,r,i){return function(){var s=this,u=arguments,l=function(){var e,l;if(!(t<o)){if((e=r.apply(s,u))===n.promise())throw new TypeError("Thenable self-resolution");l=e&&("object"==typeof e||"function"==typeof e)&&e.then,g(l)?i?l.call(e,a(o,n,I,i),a(o,n,W,i)):(o++,l.call(e,a(o,n,I,i),a(o,n,W,i),a(o,n,I,n.notifyWith))):(r!==I&&(s=void 0,u=[e]),(i||n.resolveWith)(s,u))}},c=i?l:function(){try{l()}catch(e){w.Deferred.exceptionHook&&w.Deferred.exceptionHook(e,c.stackTrace),t+1>=o&&(r!==W&&(s=void 0,u=[e]),n.rejectWith(s,u))}};t?c():(w.Deferred.getStackHook&&(c.stackTrace=w.Deferred.getStackHook()),e.setTimeout(c))}}return w.Deferred(function(e){n[0][3].add(a(0,e,g(i)?i:I,e.notifyWith)),n[1][3].add(a(0,e,g(t)?t:I)),n[2][3].add(a(0,e,g(r)?r:W))}).promise()},promise:function(e){return null!=e?w.extend(e,i):i}},o={};return w.each(n,function(e,t){var a=t[2],s=t[5];i[t[1]]=a.add,s&&a.add(function(){r=s},n[3-e][2].disable,n[3-e][3].disable,n[0][2].lock,n[0][3].lock),a.add(t[3].fire),o[t[0]]=function(){return o[t[0]+"With"](this===o?void 0:this,arguments),this},o[t[0]+"With"]=a.fireWith}),i.promise(o),t&&t.call(o,o),o},when:function(e){var t=arguments.length,n=t,r=Array(n),i=o.call(arguments),a=w.Deferred(),s=function(e){return function(n){r[e]=this,i[e]=arguments.length>1?o.call(arguments):n,--t||a.resolveWith(r,i)}};if(t<=1&&($(e,a.done(s(n)).resolve,a.reject,!t),"pending"===a.state()||g(i[n]&&i[n].then)))return a.then();while(n--)$(i[n],s(n),a.reject);return a.promise()}});var B=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;w.Deferred.exceptionHook=function(t,n){e.console&&e.console.warn&&t&&B.test(t.name)&&e.console.warn("jQuery.Deferred exception: "+t.message,t.stack,n)},w.readyException=function(t){e.setTimeout(function(){throw t})};var F=w.Deferred();w.fn.ready=function(e){return F.then(e)["catch"](function(e){w.readyException(e)}),this},w.extend({isReady:!1,readyWait:1,ready:function(e){(!0===e?--w.readyWait:w.isReady)||(w.isReady=!0,!0!==e&&--w.readyWait>0||F.resolveWith(r,[w]))}}),w.ready.then=F.then;function _(){r.removeEventListener("DOMContentLoaded",_),e.removeEventListener("load",_),w.ready()}"complete"===r.readyState||"loading"!==r.readyState&&!r.documentElement.doScroll?e.setTimeout(w.ready):(r.addEventListener("DOMContentLoaded",_),e.addEventListener("load",_));var z=function(e,t,n,r,i,o,a){var s=0,u=e.length,l=null==n;if("object"===x(n)){i=!0;for(s in n)z(e,t,s,n[s],!0,o,a)}else if(void 0!==r&&(i=!0,g(r)||(a=!0),l&&(a?(t.call(e,r),t=null):(l=t,t=function(e,t,n){return l.call(w(e),n)})),t))for(;s<u;s++)t(e[s],n,a?r:r.call(e[s],s,t(e[s],n)));return i?e:l?t.call(e):u?t(e[0],n):o},X=/^-ms-/,U=/-([a-z])/g;function V(e,t){return t.toUpperCase()}function G(e){return e.replace(X,"ms-").replace(U,V)}var Y=function(e){return 1===e.nodeType||9===e.nodeType||!+e.nodeType};function Q(){this.expando=w.expando+Q.uid++}Q.uid=1,Q.prototype={cache:function(e){var t=e[this.expando];return t||(t={},Y(e)&&(e.nodeType?e[this.expando]=t:Object.defineProperty(e,this.expando,{value:t,configurable:!0}))),t},set:function(e,t,n){var r,i=this.cache(e);if("string"==typeof t)i[G(t)]=n;else for(r in t)i[G(r)]=t[r];return i},get:function(e,t){return void 0===t?this.cache(e):e[this.expando]&&e[this.expando][G(t)]},access:function(e,t,n){return void 0===t||t&&"string"==typeof t&&void 0===n?this.get(e,t):(this.set(e,t,n),void 0!==n?n:t)},remove:function(e,t){var n,r=e[this.expando];if(void 0!==r){if(void 0!==t){n=(t=Array.isArray(t)?t.map(G):(t=G(t))in r?[t]:t.match(M)||[]).length;while(n--)delete r[t[n]]}(void 0===t||w.isEmptyObject(r))&&(e.nodeType?e[this.expando]=void 0:delete e[this.expando])}},hasData:function(e){var t=e[this.expando];return void 0!==t&&!w.isEmptyObject(t)}};var J=new Q,K=new Q,Z=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,ee=/[A-Z]/g;function te(e){return"true"===e||"false"!==e&&("null"===e?null:e===+e+""?+e:Z.test(e)?JSON.parse(e):e)}function ne(e,t,n){var r;if(void 0===n&&1===e.nodeType)if(r="data-"+t.replace(ee,"-$&").toLowerCase(),"string"==typeof(n=e.getAttribute(r))){try{n=te(n)}catch(e){}K.set(e,t,n)}else n=void 0;return n}w.extend({hasData:function(e){return K.hasData(e)||J.hasData(e)},data:function(e,t,n){return K.access(e,t,n)},removeData:function(e,t){K.remove(e,t)},_data:function(e,t,n){return J.access(e,t,n)},_removeData:function(e,t){J.remove(e,t)}}),w.fn.extend({data:function(e,t){var n,r,i,o=this[0],a=o&&o.attributes;if(void 0===e){if(this.length&&(i=K.get(o),1===o.nodeType&&!J.get(o,"hasDataAttrs"))){n=a.length;while(n--)a[n]&&0===(r=a[n].name).indexOf("data-")&&(r=G(r.slice(5)),ne(o,r,i[r]));J.set(o,"hasDataAttrs",!0)}return i}return"object"==typeof e?this.each(function(){K.set(this,e)}):z(this,function(t){var n;if(o&&void 0===t){if(void 0!==(n=K.get(o,e)))return n;if(void 0!==(n=ne(o,e)))return n}else this.each(function(){K.set(this,e,t)})},null,t,arguments.length>1,null,!0)},removeData:function(e){return this.each(function(){K.remove(this,e)})}}),w.extend({queue:function(e,t,n){var r;if(e)return t=(t||"fx")+"queue",r=J.get(e,t),n&&(!r||Array.isArray(n)?r=J.access(e,t,w.makeArray(n)):r.push(n)),r||[]},dequeue:function(e,t){t=t||"fx";var n=w.queue(e,t),r=n.length,i=n.shift(),o=w._queueHooks(e,t),a=function(){w.dequeue(e,t)};"inprogress"===i&&(i=n.shift(),r--),i&&("fx"===t&&n.unshift("inprogress"),delete o.stop,i.call(e,a,o)),!r&&o&&o.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return J.get(e,n)||J.access(e,n,{empty:w.Callbacks("once memory").add(function(){J.remove(e,[t+"queue",n])})})}}),w.fn.extend({queue:function(e,t){var n=2;return"string"!=typeof e&&(t=e,e="fx",n--),arguments.length<n?w.queue(this[0],e):void 0===t?this:this.each(function(){var n=w.queue(this,e,t);w._queueHooks(this,e),"fx"===e&&"inprogress"!==n[0]&&w.dequeue(this,e)})},dequeue:function(e){return this.each(function(){w.dequeue(this,e)})},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(e,t){var n,r=1,i=w.Deferred(),o=this,a=this.length,s=function(){--r||i.resolveWith(o,[o])};"string"!=typeof e&&(t=e,e=void 0),e=e||"fx";while(a--)(n=J.get(o[a],e+"queueHooks"))&&n.empty&&(r++,n.empty.add(s));return s(),i.promise(t)}});var re=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,ie=new RegExp("^(?:([+-])=|)("+re+")([a-z%]*)$","i"),oe=["Top","Right","Bottom","Left"],ae=function(e,t){return"none"===(e=t||e).style.display||""===e.style.display&&w.contains(e.ownerDocument,e)&&"none"===w.css(e,"display")},se=function(e,t,n,r){var i,o,a={};for(o in t)a[o]=e.style[o],e.style[o]=t[o];i=n.apply(e,r||[]);for(o in t)e.style[o]=a[o];return i};function ue(e,t,n,r){var i,o,a=20,s=r?function(){return r.cur()}:function(){return w.css(e,t,"")},u=s(),l=n&&n[3]||(w.cssNumber[t]?"":"px"),c=(w.cssNumber[t]||"px"!==l&&+u)&&ie.exec(w.css(e,t));if(c&&c[3]!==l){u/=2,l=l||c[3],c=+u||1;while(a--)w.style(e,t,c+l),(1-o)*(1-(o=s()/u||.5))<=0&&(a=0),c/=o;c*=2,w.style(e,t,c+l),n=n||[]}return n&&(c=+c||+u||0,i=n[1]?c+(n[1]+1)*n[2]:+n[2],r&&(r.unit=l,r.start=c,r.end=i)),i}var le={};function ce(e){var t,n=e.ownerDocument,r=e.nodeName,i=le[r];return i||(t=n.body.appendChild(n.createElement(r)),i=w.css(t,"display"),t.parentNode.removeChild(t),"none"===i&&(i="block"),le[r]=i,i)}function fe(e,t){for(var n,r,i=[],o=0,a=e.length;o<a;o++)(r=e[o]).style&&(n=r.style.display,t?("none"===n&&(i[o]=J.get(r,"display")||null,i[o]||(r.style.display="")),""===r.style.display&&ae(r)&&(i[o]=ce(r))):"none"!==n&&(i[o]="none",J.set(r,"display",n)));for(o=0;o<a;o++)null!=i[o]&&(e[o].style.display=i[o]);return e}w.fn.extend({show:function(){return fe(this,!0)},hide:function(){return fe(this)},toggle:function(e){return"boolean"==typeof e?e?this.show():this.hide():this.each(function(){ae(this)?w(this).show():w(this).hide()})}});var pe=/^(?:checkbox|radio)$/i,de=/<([a-z][^\/\0>\x20\t\r\n\f]+)/i,he=/^$|^module$|\/(?:java|ecma)script/i,ge={option:[1,"<select multiple='multiple'>","</select>"],thead:[1,"<table>","</table>"],col:[2,"<table><colgroup>","</colgroup></table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:[0,"",""]};ge.optgroup=ge.option,ge.tbody=ge.tfoot=ge.colgroup=ge.caption=ge.thead,ge.th=ge.td;function ye(e,t){var n;return n="undefined"!=typeof e.getElementsByTagName?e.getElementsByTagName(t||"*"):"undefined"!=typeof e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&N(e,t)?w.merge([e],n):n}function ve(e,t){for(var n=0,r=e.length;n<r;n++)J.set(e[n],"globalEval",!t||J.get(t[n],"globalEval"))}var me=/<|&#?\w+;/;function xe(e,t,n,r,i){for(var o,a,s,u,l,c,f=t.createDocumentFragment(),p=[],d=0,h=e.length;d<h;d++)if((o=e[d])||0===o)if("object"===x(o))w.merge(p,o.nodeType?[o]:o);else if(me.test(o)){a=a||f.appendChild(t.createElement("div")),s=(de.exec(o)||["",""])[1].toLowerCase(),u=ge[s]||ge._default,a.innerHTML=u[1]+w.htmlPrefilter(o)+u[2],c=u[0];while(c--)a=a.lastChild;w.merge(p,a.childNodes),(a=f.firstChild).textContent=""}else p.push(t.createTextNode(o));f.textContent="",d=0;while(o=p[d++])if(r&&w.inArray(o,r)>-1)i&&i.push(o);else if(l=w.contains(o.ownerDocument,o),a=ye(f.appendChild(o),"script"),l&&ve(a),n){c=0;while(o=a[c++])he.test(o.type||"")&&n.push(o)}return f}!function(){var e=r.createDocumentFragment().appendChild(r.createElement("div")),t=r.createElement("input");t.setAttribute("type","radio"),t.setAttribute("checked","checked"),t.setAttribute("name","t"),e.appendChild(t),h.checkClone=e.cloneNode(!0).cloneNode(!0).lastChild.checked,e.innerHTML="<textarea>x</textarea>",h.noCloneChecked=!!e.cloneNode(!0).lastChild.defaultValue}();var be=r.documentElement,we=/^key/,Te=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,Ce=/^([^.]*)(?:\.(.+)|)/;function Ee(){return!0}function ke(){return!1}function Se(){try{return r.activeElement}catch(e){}}function De(e,t,n,r,i,o){var a,s;if("object"==typeof t){"string"!=typeof n&&(r=r||n,n=void 0);for(s in t)De(e,s,n,r,t[s],o);return e}if(null==r&&null==i?(i=n,r=n=void 0):null==i&&("string"==typeof n?(i=r,r=void 0):(i=r,r=n,n=void 0)),!1===i)i=ke;else if(!i)return e;return 1===o&&(a=i,(i=function(e){return w().off(e),a.apply(this,arguments)}).guid=a.guid||(a.guid=w.guid++)),e.each(function(){w.event.add(this,t,i,r,n)})}w.event={global:{},add:function(e,t,n,r,i){var o,a,s,u,l,c,f,p,d,h,g,y=J.get(e);if(y){n.handler&&(n=(o=n).handler,i=o.selector),i&&w.find.matchesSelector(be,i),n.guid||(n.guid=w.guid++),(u=y.events)||(u=y.events={}),(a=y.handle)||(a=y.handle=function(t){return"undefined"!=typeof w&&w.event.triggered!==t.type?w.event.dispatch.apply(e,arguments):void 0}),l=(t=(t||"").match(M)||[""]).length;while(l--)d=g=(s=Ce.exec(t[l])||[])[1],h=(s[2]||"").split(".").sort(),d&&(f=w.event.special[d]||{},d=(i?f.delegateType:f.bindType)||d,f=w.event.special[d]||{},c=w.extend({type:d,origType:g,data:r,handler:n,guid:n.guid,selector:i,needsContext:i&&w.expr.match.needsContext.test(i),namespace:h.join(".")},o),(p=u[d])||((p=u[d]=[]).delegateCount=0,f.setup&&!1!==f.setup.call(e,r,h,a)||e.addEventListener&&e.addEventListener(d,a)),f.add&&(f.add.call(e,c),c.handler.guid||(c.handler.guid=n.guid)),i?p.splice(p.delegateCount++,0,c):p.push(c),w.event.global[d]=!0)}},remove:function(e,t,n,r,i){var o,a,s,u,l,c,f,p,d,h,g,y=J.hasData(e)&&J.get(e);if(y&&(u=y.events)){l=(t=(t||"").match(M)||[""]).length;while(l--)if(s=Ce.exec(t[l])||[],d=g=s[1],h=(s[2]||"").split(".").sort(),d){f=w.event.special[d]||{},p=u[d=(r?f.delegateType:f.bindType)||d]||[],s=s[2]&&new RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"),a=o=p.length;while(o--)c=p[o],!i&&g!==c.origType||n&&n.guid!==c.guid||s&&!s.test(c.namespace)||r&&r!==c.selector&&("**"!==r||!c.selector)||(p.splice(o,1),c.selector&&p.delegateCount--,f.remove&&f.remove.call(e,c));a&&!p.length&&(f.teardown&&!1!==f.teardown.call(e,h,y.handle)||w.removeEvent(e,d,y.handle),delete u[d])}else for(d in u)w.event.remove(e,d+t[l],n,r,!0);w.isEmptyObject(u)&&J.remove(e,"handle events")}},dispatch:function(e){var t=w.event.fix(e),n,r,i,o,a,s,u=new Array(arguments.length),l=(J.get(this,"events")||{})[t.type]||[],c=w.event.special[t.type]||{};for(u[0]=t,n=1;n<arguments.length;n++)u[n]=arguments[n];if(t.delegateTarget=this,!c.preDispatch||!1!==c.preDispatch.call(this,t)){s=w.event.handlers.call(this,t,l),n=0;while((o=s[n++])&&!t.isPropagationStopped()){t.currentTarget=o.elem,r=0;while((a=o.handlers[r++])&&!t.isImmediatePropagationStopped())t.rnamespace&&!t.rnamespace.test(a.namespace)||(t.handleObj=a,t.data=a.data,void 0!==(i=((w.event.special[a.origType]||{}).handle||a.handler).apply(o.elem,u))&&!1===(t.result=i)&&(t.preventDefault(),t.stopPropagation()))}return c.postDispatch&&c.postDispatch.call(this,t),t.result}},handlers:function(e,t){var n,r,i,o,a,s=[],u=t.delegateCount,l=e.target;if(u&&l.nodeType&&!("click"===e.type&&e.button>=1))for(;l!==this;l=l.parentNode||this)if(1===l.nodeType&&("click"!==e.type||!0!==l.disabled)){for(o=[],a={},n=0;n<u;n++)void 0===a[i=(r=t[n]).selector+" "]&&(a[i]=r.needsContext?w(i,this).index(l)>-1:w.find(i,this,null,[l]).length),a[i]&&o.push(r);o.length&&s.push({elem:l,handlers:o})}return l=this,u<t.length&&s.push({elem:l,handlers:t.slice(u)}),s},addProp:function(e,t){Object.defineProperty(w.Event.prototype,e,{enumerable:!0,configurable:!0,get:g(t)?function(){if(this.originalEvent)return t(this.originalEvent)}:function(){if(this.originalEvent)return this.originalEvent[e]},set:function(t){Object.defineProperty(this,e,{enumerable:!0,configurable:!0,writable:!0,value:t})}})},fix:function(e){return e[w.expando]?e:new w.Event(e)},special:{load:{noBubble:!0},focus:{trigger:function(){if(this!==Se()&&this.focus)return this.focus(),!1},delegateType:"focusin"},blur:{trigger:function(){if(this===Se()&&this.blur)return this.blur(),!1},delegateType:"focusout"},click:{trigger:function(){if("checkbox"===this.type&&this.click&&N(this,"input"))return this.click(),!1},_default:function(e){return N(e.target,"a")}},beforeunload:{postDispatch:function(e){void 0!==e.result&&e.originalEvent&&(e.originalEvent.returnValue=e.result)}}}},w.removeEvent=function(e,t,n){e.removeEventListener&&e.removeEventListener(t,n)},w.Event=function(e,t){if(!(this instanceof w.Event))return new w.Event(e,t);e&&e.type?(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented||void 0===e.defaultPrevented&&!1===e.returnValue?Ee:ke,this.target=e.target&&3===e.target.nodeType?e.target.parentNode:e.target,this.currentTarget=e.currentTarget,this.relatedTarget=e.relatedTarget):this.type=e,t&&w.extend(this,t),this.timeStamp=e&&e.timeStamp||Date.now(),this[w.expando]=!0},w.Event.prototype={constructor:w.Event,isDefaultPrevented:ke,isPropagationStopped:ke,isImmediatePropagationStopped:ke,isSimulated:!1,preventDefault:function(){var e=this.originalEvent;this.isDefaultPrevented=Ee,e&&!this.isSimulated&&e.preventDefault()},stopPropagation:function(){var e=this.originalEvent;this.isPropagationStopped=Ee,e&&!this.isSimulated&&e.stopPropagation()},stopImmediatePropagation:function(){var e=this.originalEvent;this.isImmediatePropagationStopped=Ee,e&&!this.isSimulated&&e.stopImmediatePropagation(),this.stopPropagation()}},w.each({altKey:!0,bubbles:!0,cancelable:!0,changedTouches:!0,ctrlKey:!0,detail:!0,eventPhase:!0,metaKey:!0,pageX:!0,pageY:!0,shiftKey:!0,view:!0,"char":!0,charCode:!0,key:!0,keyCode:!0,button:!0,buttons:!0,clientX:!0,clientY:!0,offsetX:!0,offsetY:!0,pointerId:!0,pointerType:!0,screenX:!0,screenY:!0,targetTouches:!0,toElement:!0,touches:!0,which:function(e){var t=e.button;return null==e.which&&we.test(e.type)?null!=e.charCode?e.charCode:e.keyCode:!e.which&&void 0!==t&&Te.test(e.type)?1&t?1:2&t?3:4&t?2:0:e.which}},w.event.addProp),w.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},function(e,t){w.event.special[e]={delegateType:t,bindType:t,handle:function(e){var n,r=this,i=e.relatedTarget,o=e.handleObj;return i&&(i===r||w.contains(r,i))||(e.type=o.origType,n=o.handler.apply(this,arguments),e.type=t),n}}}),w.fn.extend({on:function(e,t,n,r){return De(this,e,t,n,r)},one:function(e,t,n,r){return De(this,e,t,n,r,1)},off:function(e,t,n){var r,i;if(e&&e.preventDefault&&e.handleObj)return r=e.handleObj,w(e.delegateTarget).off(r.namespace?r.origType+"."+r.namespace:r.origType,r.selector,r.handler),this;if("object"==typeof e){for(i in e)this.off(i,t,e[i]);return this}return!1!==t&&"function"!=typeof t||(n=t,t=void 0),!1===n&&(n=ke),this.each(function(){w.event.remove(this,e,n,t)})}});var Ne=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([a-z][^\/\0>\x20\t\r\n\f]*)[^>]*)\/>/gi,Ae=/<script|<style|<link/i,je=/checked\s*(?:[^=]|=\s*.checked.)/i,qe=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g;function Le(e,t){return N(e,"table")&&N(11!==t.nodeType?t:t.firstChild,"tr")?w(e).children("tbody")[0]||e:e}function He(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function Oe(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function Pe(e,t){var n,r,i,o,a,s,u,l;if(1===t.nodeType){if(J.hasData(e)&&(o=J.access(e),a=J.set(t,o),l=o.events)){delete a.handle,a.events={};for(i in l)for(n=0,r=l[i].length;n<r;n++)w.event.add(t,i,l[i][n])}K.hasData(e)&&(s=K.access(e),u=w.extend({},s),K.set(t,u))}}function Me(e,t){var n=t.nodeName.toLowerCase();"input"===n&&pe.test(e.type)?t.checked=e.checked:"input"!==n&&"textarea"!==n||(t.defaultValue=e.defaultValue)}function Re(e,t,n,r){t=a.apply([],t);var i,o,s,u,l,c,f=0,p=e.length,d=p-1,y=t[0],v=g(y);if(v||p>1&&"string"==typeof y&&!h.checkClone&&je.test(y))return e.each(function(i){var o=e.eq(i);v&&(t[0]=y.call(this,i,o.html())),Re(o,t,n,r)});if(p&&(i=xe(t,e[0].ownerDocument,!1,e,r),o=i.firstChild,1===i.childNodes.length&&(i=o),o||r)){for(u=(s=w.map(ye(i,"script"),He)).length;f<p;f++)l=i,f!==d&&(l=w.clone(l,!0,!0),u&&w.merge(s,ye(l,"script"))),n.call(e[f],l,f);if(u)for(c=s[s.length-1].ownerDocument,w.map(s,Oe),f=0;f<u;f++)l=s[f],he.test(l.type||"")&&!J.access(l,"globalEval")&&w.contains(c,l)&&(l.src&&"module"!==(l.type||"").toLowerCase()?w._evalUrl&&w._evalUrl(l.src):m(l.textContent.replace(qe,""),c,l))}return e}function Ie(e,t,n){for(var r,i=t?w.filter(t,e):e,o=0;null!=(r=i[o]);o++)n||1!==r.nodeType||w.cleanData(ye(r)),r.parentNode&&(n&&w.contains(r.ownerDocument,r)&&ve(ye(r,"script")),r.parentNode.removeChild(r));return e}w.extend({htmlPrefilter:function(e){return e.replace(Ne,"<$1></$2>")},clone:function(e,t,n){var r,i,o,a,s=e.cloneNode(!0),u=w.contains(e.ownerDocument,e);if(!(h.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||w.isXMLDoc(e)))for(a=ye(s),r=0,i=(o=ye(e)).length;r<i;r++)Me(o[r],a[r]);if(t)if(n)for(o=o||ye(e),a=a||ye(s),r=0,i=o.length;r<i;r++)Pe(o[r],a[r]);else Pe(e,s);return(a=ye(s,"script")).length>0&&ve(a,!u&&ye(e,"script")),s},cleanData:function(e){for(var t,n,r,i=w.event.special,o=0;void 0!==(n=e[o]);o++)if(Y(n)){if(t=n[J.expando]){if(t.events)for(r in t.events)i[r]?w.event.remove(n,r):w.removeEvent(n,r,t.handle);n[J.expando]=void 0}n[K.expando]&&(n[K.expando]=void 0)}}}),w.fn.extend({detach:function(e){return Ie(this,e,!0)},remove:function(e){return Ie(this,e)},text:function(e){return z(this,function(e){return void 0===e?w.text(this):this.empty().each(function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=e)})},null,e,arguments.length)},append:function(){return Re(this,arguments,function(e){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||Le(this,e).appendChild(e)})},prepend:function(){return Re(this,arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=Le(this,e);t.insertBefore(e,t.firstChild)}})},before:function(){return Re(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this)})},after:function(){return Re(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)})},empty:function(){for(var e,t=0;null!=(e=this[t]);t++)1===e.nodeType&&(w.cleanData(ye(e,!1)),e.textContent="");return this},clone:function(e,t){return e=null!=e&&e,t=null==t?e:t,this.map(function(){return w.clone(this,e,t)})},html:function(e){return z(this,function(e){var t=this[0]||{},n=0,r=this.length;if(void 0===e&&1===t.nodeType)return t.innerHTML;if("string"==typeof e&&!Ae.test(e)&&!ge[(de.exec(e)||["",""])[1].toLowerCase()]){e=w.htmlPrefilter(e);try{for(;n<r;n++)1===(t=this[n]||{}).nodeType&&(w.cleanData(ye(t,!1)),t.innerHTML=e);t=0}catch(e){}}t&&this.empty().append(e)},null,e,arguments.length)},replaceWith:function(){var e=[];return Re(this,arguments,function(t){var n=this.parentNode;w.inArray(this,e)<0&&(w.cleanData(ye(this)),n&&n.replaceChild(t,this))},e)}}),w.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(e,t){w.fn[e]=function(e){for(var n,r=[],i=w(e),o=i.length-1,a=0;a<=o;a++)n=a===o?this:this.clone(!0),w(i[a])[t](n),s.apply(r,n.get());return this.pushStack(r)}});var We=new RegExp("^("+re+")(?!px)[a-z%]+$","i"),$e=function(t){var n=t.ownerDocument.defaultView;return n&&n.opener||(n=e),n.getComputedStyle(t)},Be=new RegExp(oe.join("|"),"i");!function(){function t(){if(c){l.style.cssText="position:absolute;left:-11111px;width:60px;margin-top:1px;padding:0;border:0",c.style.cssText="position:relative;display:block;box-sizing:border-box;overflow:scroll;margin:auto;border:1px;padding:1px;width:60%;top:1%",be.appendChild(l).appendChild(c);var t=e.getComputedStyle(c);i="1%"!==t.top,u=12===n(t.marginLeft),c.style.right="60%",s=36===n(t.right),o=36===n(t.width),c.style.position="absolute",a=36===c.offsetWidth||"absolute",be.removeChild(l),c=null}}function n(e){return Math.round(parseFloat(e))}var i,o,a,s,u,l=r.createElement("div"),c=r.createElement("div");c.style&&(c.style.backgroundClip="content-box",c.cloneNode(!0).style.backgroundClip="",h.clearCloneStyle="content-box"===c.style.backgroundClip,w.extend(h,{boxSizingReliable:function(){return t(),o},pixelBoxStyles:function(){return t(),s},pixelPosition:function(){return t(),i},reliableMarginLeft:function(){return t(),u},scrollboxSize:function(){return t(),a}}))}();function Fe(e,t,n){var r,i,o,a,s=e.style;return(n=n||$e(e))&&(""!==(a=n.getPropertyValue(t)||n[t])||w.contains(e.ownerDocument,e)||(a=w.style(e,t)),!h.pixelBoxStyles()&&We.test(a)&&Be.test(t)&&(r=s.width,i=s.minWidth,o=s.maxWidth,s.minWidth=s.maxWidth=s.width=a,a=n.width,s.width=r,s.minWidth=i,s.maxWidth=o)),void 0!==a?a+"":a}function _e(e,t){return{get:function(){if(!e())return(this.get=t).apply(this,arguments);delete this.get}}}var ze=/^(none|table(?!-c[ea]).+)/,Xe=/^--/,Ue={position:"absolute",visibility:"hidden",display:"block"},Ve={letterSpacing:"0",fontWeight:"400"},Ge=["Webkit","Moz","ms"],Ye=r.createElement("div").style;function Qe(e){if(e in Ye)return e;var t=e[0].toUpperCase()+e.slice(1),n=Ge.length;while(n--)if((e=Ge[n]+t)in Ye)return e}function Je(e){var t=w.cssProps[e];return t||(t=w.cssProps[e]=Qe(e)||e),t}function Ke(e,t,n){var r=ie.exec(t);return r?Math.max(0,r[2]-(n||0))+(r[3]||"px"):t}function Ze(e,t,n,r,i,o){var a="width"===t?1:0,s=0,u=0;if(n===(r?"border":"content"))return 0;for(;a<4;a+=2)"margin"===n&&(u+=w.css(e,n+oe[a],!0,i)),r?("content"===n&&(u-=w.css(e,"padding"+oe[a],!0,i)),"margin"!==n&&(u-=w.css(e,"border"+oe[a]+"Width",!0,i))):(u+=w.css(e,"padding"+oe[a],!0,i),"padding"!==n?u+=w.css(e,"border"+oe[a]+"Width",!0,i):s+=w.css(e,"border"+oe[a]+"Width",!0,i));return!r&&o>=0&&(u+=Math.max(0,Math.ceil(e["offset"+t[0].toUpperCase()+t.slice(1)]-o-u-s-.5))),u}function et(e,t,n){var r=$e(e),i=Fe(e,t,r),o="border-box"===w.css(e,"boxSizing",!1,r),a=o;if(We.test(i)){if(!n)return i;i="auto"}return a=a&&(h.boxSizingReliable()||i===e.style[t]),("auto"===i||!parseFloat(i)&&"inline"===w.css(e,"display",!1,r))&&(i=e["offset"+t[0].toUpperCase()+t.slice(1)],a=!0),(i=parseFloat(i)||0)+Ze(e,t,n||(o?"border":"content"),a,r,i)+"px"}w.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=Fe(e,"opacity");return""===n?"1":n}}}},cssNumber:{animationIterationCount:!0,columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{},style:function(e,t,n,r){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var i,o,a,s=G(t),u=Xe.test(t),l=e.style;if(u||(t=Je(s)),a=w.cssHooks[t]||w.cssHooks[s],void 0===n)return a&&"get"in a&&void 0!==(i=a.get(e,!1,r))?i:l[t];"string"==(o=typeof n)&&(i=ie.exec(n))&&i[1]&&(n=ue(e,t,i),o="number"),null!=n&&n===n&&("number"===o&&(n+=i&&i[3]||(w.cssNumber[s]?"":"px")),h.clearCloneStyle||""!==n||0!==t.indexOf("background")||(l[t]="inherit"),a&&"set"in a&&void 0===(n=a.set(e,n,r))||(u?l.setProperty(t,n):l[t]=n))}},css:function(e,t,n,r){var i,o,a,s=G(t);return Xe.test(t)||(t=Je(s)),(a=w.cssHooks[t]||w.cssHooks[s])&&"get"in a&&(i=a.get(e,!0,n)),void 0===i&&(i=Fe(e,t,r)),"normal"===i&&t in Ve&&(i=Ve[t]),""===n||n?(o=parseFloat(i),!0===n||isFinite(o)?o||0:i):i}}),w.each(["height","width"],function(e,t){w.cssHooks[t]={get:function(e,n,r){if(n)return!ze.test(w.css(e,"display"))||e.getClientRects().length&&e.getBoundingClientRect().width?et(e,t,r):se(e,Ue,function(){return et(e,t,r)})},set:function(e,n,r){var i,o=$e(e),a="border-box"===w.css(e,"boxSizing",!1,o),s=r&&Ze(e,t,r,a,o);return a&&h.scrollboxSize()===o.position&&(s-=Math.ceil(e["offset"+t[0].toUpperCase()+t.slice(1)]-parseFloat(o[t])-Ze(e,t,"border",!1,o)-.5)),s&&(i=ie.exec(n))&&"px"!==(i[3]||"px")&&(e.style[t]=n,n=w.css(e,t)),Ke(e,n,s)}}}),w.cssHooks.marginLeft=_e(h.reliableMarginLeft,function(e,t){if(t)return(parseFloat(Fe(e,"marginLeft"))||e.getBoundingClientRect().left-se(e,{marginLeft:0},function(){return e.getBoundingClientRect().left}))+"px"}),w.each({margin:"",padding:"",border:"Width"},function(e,t){w.cssHooks[e+t]={expand:function(n){for(var r=0,i={},o="string"==typeof n?n.split(" "):[n];r<4;r++)i[e+oe[r]+t]=o[r]||o[r-2]||o[0];return i}},"margin"!==e&&(w.cssHooks[e+t].set=Ke)}),w.fn.extend({css:function(e,t){return z(this,function(e,t,n){var r,i,o={},a=0;if(Array.isArray(t)){for(r=$e(e),i=t.length;a<i;a++)o[t[a]]=w.css(e,t[a],!1,r);return o}return void 0!==n?w.style(e,t,n):w.css(e,t)},e,t,arguments.length>1)}});function tt(e,t,n,r,i){return new tt.prototype.init(e,t,n,r,i)}w.Tween=tt,tt.prototype={constructor:tt,init:function(e,t,n,r,i,o){this.elem=e,this.prop=n,this.easing=i||w.easing._default,this.options=t,this.start=this.now=this.cur(),this.end=r,this.unit=o||(w.cssNumber[n]?"":"px")},cur:function(){var e=tt.propHooks[this.prop];return e&&e.get?e.get(this):tt.propHooks._default.get(this)},run:function(e){var t,n=tt.propHooks[this.prop];return this.options.duration?this.pos=t=w.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):this.pos=t=e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):tt.propHooks._default.set(this),this}},tt.prototype.init.prototype=tt.prototype,tt.propHooks={_default:{get:function(e){var t;return 1!==e.elem.nodeType||null!=e.elem[e.prop]&&null==e.elem.style[e.prop]?e.elem[e.prop]:(t=w.css(e.elem,e.prop,""))&&"auto"!==t?t:0},set:function(e){w.fx.step[e.prop]?w.fx.step[e.prop](e):1!==e.elem.nodeType||null==e.elem.style[w.cssProps[e.prop]]&&!w.cssHooks[e.prop]?e.elem[e.prop]=e.now:w.style(e.elem,e.prop,e.now+e.unit)}}},tt.propHooks.scrollTop=tt.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},w.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2},_default:"swing"},w.fx=tt.prototype.init,w.fx.step={};var nt,rt,it=/^(?:toggle|show|hide)$/,ot=/queueHooks$/;function at(){rt&&(!1===r.hidden&&e.requestAnimationFrame?e.requestAnimationFrame(at):e.setTimeout(at,w.fx.interval),w.fx.tick())}function st(){return e.setTimeout(function(){nt=void 0}),nt=Date.now()}function ut(e,t){var n,r=0,i={height:e};for(t=t?1:0;r<4;r+=2-t)i["margin"+(n=oe[r])]=i["padding"+n]=e;return t&&(i.opacity=i.width=e),i}function lt(e,t,n){for(var r,i=(pt.tweeners[t]||[]).concat(pt.tweeners["*"]),o=0,a=i.length;o<a;o++)if(r=i[o].call(n,t,e))return r}function ct(e,t,n){var r,i,o,a,s,u,l,c,f="width"in t||"height"in t,p=this,d={},h=e.style,g=e.nodeType&&ae(e),y=J.get(e,"fxshow");n.queue||(null==(a=w._queueHooks(e,"fx")).unqueued&&(a.unqueued=0,s=a.empty.fire,a.empty.fire=function(){a.unqueued||s()}),a.unqueued++,p.always(function(){p.always(function(){a.unqueued--,w.queue(e,"fx").length||a.empty.fire()})}));for(r in t)if(i=t[r],it.test(i)){if(delete t[r],o=o||"toggle"===i,i===(g?"hide":"show")){if("show"!==i||!y||void 0===y[r])continue;g=!0}d[r]=y&&y[r]||w.style(e,r)}if((u=!w.isEmptyObject(t))||!w.isEmptyObject(d)){f&&1===e.nodeType&&(n.overflow=[h.overflow,h.overflowX,h.overflowY],null==(l=y&&y.display)&&(l=J.get(e,"display")),"none"===(c=w.css(e,"display"))&&(l?c=l:(fe([e],!0),l=e.style.display||l,c=w.css(e,"display"),fe([e]))),("inline"===c||"inline-block"===c&&null!=l)&&"none"===w.css(e,"float")&&(u||(p.done(function(){h.display=l}),null==l&&(c=h.display,l="none"===c?"":c)),h.display="inline-block")),n.overflow&&(h.overflow="hidden",p.always(function(){h.overflow=n.overflow[0],h.overflowX=n.overflow[1],h.overflowY=n.overflow[2]})),u=!1;for(r in d)u||(y?"hidden"in y&&(g=y.hidden):y=J.access(e,"fxshow",{display:l}),o&&(y.hidden=!g),g&&fe([e],!0),p.done(function(){g||fe([e]),J.remove(e,"fxshow");for(r in d)w.style(e,r,d[r])})),u=lt(g?y[r]:0,r,p),r in y||(y[r]=u.start,g&&(u.end=u.start,u.start=0))}}function ft(e,t){var n,r,i,o,a;for(n in e)if(r=G(n),i=t[r],o=e[n],Array.isArray(o)&&(i=o[1],o=e[n]=o[0]),n!==r&&(e[r]=o,delete e[n]),(a=w.cssHooks[r])&&"expand"in a){o=a.expand(o),delete e[r];for(n in o)n in e||(e[n]=o[n],t[n]=i)}else t[r]=i}function pt(e,t,n){var r,i,o=0,a=pt.prefilters.length,s=w.Deferred().always(function(){delete u.elem}),u=function(){if(i)return!1;for(var t=nt||st(),n=Math.max(0,l.startTime+l.duration-t),r=1-(n/l.duration||0),o=0,a=l.tweens.length;o<a;o++)l.tweens[o].run(r);return s.notifyWith(e,[l,r,n]),r<1&&a?n:(a||s.notifyWith(e,[l,1,0]),s.resolveWith(e,[l]),!1)},l=s.promise({elem:e,props:w.extend({},t),opts:w.extend(!0,{specialEasing:{},easing:w.easing._default},n),originalProperties:t,originalOptions:n,startTime:nt||st(),duration:n.duration,tweens:[],createTween:function(t,n){var r=w.Tween(e,l.opts,t,n,l.opts.specialEasing[t]||l.opts.easing);return l.tweens.push(r),r},stop:function(t){var n=0,r=t?l.tweens.length:0;if(i)return this;for(i=!0;n<r;n++)l.tweens[n].run(1);return t?(s.notifyWith(e,[l,1,0]),s.resolveWith(e,[l,t])):s.rejectWith(e,[l,t]),this}}),c=l.props;for(ft(c,l.opts.specialEasing);o<a;o++)if(r=pt.prefilters[o].call(l,e,c,l.opts))return g(r.stop)&&(w._queueHooks(l.elem,l.opts.queue).stop=r.stop.bind(r)),r;return w.map(c,lt,l),g(l.opts.start)&&l.opts.start.call(e,l),l.progress(l.opts.progress).done(l.opts.done,l.opts.complete).fail(l.opts.fail).always(l.opts.always),w.fx.timer(w.extend(u,{elem:e,anim:l,queue:l.opts.queue})),l}w.Animation=w.extend(pt,{tweeners:{"*":[function(e,t){var n=this.createTween(e,t);return ue(n.elem,e,ie.exec(t),n),n}]},tweener:function(e,t){g(e)?(t=e,e=["*"]):e=e.match(M);for(var n,r=0,i=e.length;r<i;r++)n=e[r],pt.tweeners[n]=pt.tweeners[n]||[],pt.tweeners[n].unshift(t)},prefilters:[ct],prefilter:function(e,t){t?pt.prefilters.unshift(e):pt.prefilters.push(e)}}),w.speed=function(e,t,n){var r=e&&"object"==typeof e?w.extend({},e):{complete:n||!n&&t||g(e)&&e,duration:e,easing:n&&t||t&&!g(t)&&t};return w.fx.off?r.duration=0:"number"!=typeof r.duration&&(r.duration in w.fx.speeds?r.duration=w.fx.speeds[r.duration]:r.duration=w.fx.speeds._default),null!=r.queue&&!0!==r.queue||(r.queue="fx"),r.old=r.complete,r.complete=function(){g(r.old)&&r.old.call(this),r.queue&&w.dequeue(this,r.queue)},r},w.fn.extend({fadeTo:function(e,t,n,r){return this.filter(ae).css("opacity",0).show().end().animate({opacity:t},e,n,r)},animate:function(e,t,n,r){var i=w.isEmptyObject(e),o=w.speed(t,n,r),a=function(){var t=pt(this,w.extend({},e),o);(i||J.get(this,"finish"))&&t.stop(!0)};return a.finish=a,i||!1===o.queue?this.each(a):this.queue(o.queue,a)},stop:function(e,t,n){var r=function(e){var t=e.stop;delete e.stop,t(n)};return"string"!=typeof e&&(n=t,t=e,e=void 0),t&&!1!==e&&this.queue(e||"fx",[]),this.each(function(){var t=!0,i=null!=e&&e+"queueHooks",o=w.timers,a=J.get(this);if(i)a[i]&&a[i].stop&&r(a[i]);else for(i in a)a[i]&&a[i].stop&&ot.test(i)&&r(a[i]);for(i=o.length;i--;)o[i].elem!==this||null!=e&&o[i].queue!==e||(o[i].anim.stop(n),t=!1,o.splice(i,1));!t&&n||w.dequeue(this,e)})},finish:function(e){return!1!==e&&(e=e||"fx"),this.each(function(){var t,n=J.get(this),r=n[e+"queue"],i=n[e+"queueHooks"],o=w.timers,a=r?r.length:0;for(n.finish=!0,w.queue(this,e,[]),i&&i.stop&&i.stop.call(this,!0),t=o.length;t--;)o[t].elem===this&&o[t].queue===e&&(o[t].anim.stop(!0),o.splice(t,1));for(t=0;t<a;t++)r[t]&&r[t].finish&&r[t].finish.call(this);delete n.finish})}}),w.each(["toggle","show","hide"],function(e,t){var n=w.fn[t];w.fn[t]=function(e,r,i){return null==e||"boolean"==typeof e?n.apply(this,arguments):this.animate(ut(t,!0),e,r,i)}}),w.each({slideDown:ut("show"),slideUp:ut("hide"),slideToggle:ut("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(e,t){w.fn[e]=function(e,n,r){return this.animate(t,e,n,r)}}),w.timers=[],w.fx.tick=function(){var e,t=0,n=w.timers;for(nt=Date.now();t<n.length;t++)(e=n[t])()||n[t]!==e||n.splice(t--,1);n.length||w.fx.stop(),nt=void 0},w.fx.timer=function(e){w.timers.push(e),w.fx.start()},w.fx.interval=13,w.fx.start=function(){rt||(rt=!0,at())},w.fx.stop=function(){rt=null},w.fx.speeds={slow:600,fast:200,_default:400},w.fn.delay=function(t,n){return t=w.fx?w.fx.speeds[t]||t:t,n=n||"fx",this.queue(n,function(n,r){var i=e.setTimeout(n,t);r.stop=function(){e.clearTimeout(i)}})},function(){var e=r.createElement("input"),t=r.createElement("select").appendChild(r.createElement("option"));e.type="checkbox",h.checkOn=""!==e.value,h.optSelected=t.selected,(e=r.createElement("input")).value="t",e.type="radio",h.radioValue="t"===e.value}();var dt,ht=w.expr.attrHandle;w.fn.extend({attr:function(e,t){return z(this,w.attr,e,t,arguments.length>1)},removeAttr:function(e){return this.each(function(){w.removeAttr(this,e)})}}),w.extend({attr:function(e,t,n){var r,i,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return"undefined"==typeof e.getAttribute?w.prop(e,t,n):(1===o&&w.isXMLDoc(e)||(i=w.attrHooks[t.toLowerCase()]||(w.expr.match.bool.test(t)?dt:void 0)),void 0!==n?null===n?void w.removeAttr(e,t):i&&"set"in i&&void 0!==(r=i.set(e,n,t))?r:(e.setAttribute(t,n+""),n):i&&"get"in i&&null!==(r=i.get(e,t))?r:null==(r=w.find.attr(e,t))?void 0:r)},attrHooks:{type:{set:function(e,t){if(!h.radioValue&&"radio"===t&&N(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}},removeAttr:function(e,t){var n,r=0,i=t&&t.match(M);if(i&&1===e.nodeType)while(n=i[r++])e.removeAttribute(n)}}),dt={set:function(e,t,n){return!1===t?w.removeAttr(e,n):e.setAttribute(n,n),n}},w.each(w.expr.match.bool.source.match(/\w+/g),function(e,t){var n=ht[t]||w.find.attr;ht[t]=function(e,t,r){var i,o,a=t.toLowerCase();return r||(o=ht[a],ht[a]=i,i=null!=n(e,t,r)?a:null,ht[a]=o),i}});var gt=/^(?:input|select|textarea|button)$/i,yt=/^(?:a|area)$/i;w.fn.extend({prop:function(e,t){return z(this,w.prop,e,t,arguments.length>1)},removeProp:function(e){return this.each(function(){delete this[w.propFix[e]||e]})}}),w.extend({prop:function(e,t,n){var r,i,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return 1===o&&w.isXMLDoc(e)||(t=w.propFix[t]||t,i=w.propHooks[t]),void 0!==n?i&&"set"in i&&void 0!==(r=i.set(e,n,t))?r:e[t]=n:i&&"get"in i&&null!==(r=i.get(e,t))?r:e[t]},propHooks:{tabIndex:{get:function(e){var t=w.find.attr(e,"tabindex");return t?parseInt(t,10):gt.test(e.nodeName)||yt.test(e.nodeName)&&e.href?0:-1}}},propFix:{"for":"htmlFor","class":"className"}}),h.optSelected||(w.propHooks.selected={get:function(e){var t=e.parentNode;return t&&t.parentNode&&t.parentNode.selectedIndex,null},set:function(e){var t=e.parentNode;t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex)}}),w.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){w.propFix[this.toLowerCase()]=this});function vt(e){return(e.match(M)||[]).join(" ")}function mt(e){return e.getAttribute&&e.getAttribute("class")||""}function xt(e){return Array.isArray(e)?e:"string"==typeof e?e.match(M)||[]:[]}w.fn.extend({addClass:function(e){var t,n,r,i,o,a,s,u=0;if(g(e))return this.each(function(t){w(this).addClass(e.call(this,t,mt(this)))});if((t=xt(e)).length)while(n=this[u++])if(i=mt(n),r=1===n.nodeType&&" "+vt(i)+" "){a=0;while(o=t[a++])r.indexOf(" "+o+" ")<0&&(r+=o+" ");i!==(s=vt(r))&&n.setAttribute("class",s)}return this},removeClass:function(e){var t,n,r,i,o,a,s,u=0;if(g(e))return this.each(function(t){w(this).removeClass(e.call(this,t,mt(this)))});if(!arguments.length)return this.attr("class","");if((t=xt(e)).length)while(n=this[u++])if(i=mt(n),r=1===n.nodeType&&" "+vt(i)+" "){a=0;while(o=t[a++])while(r.indexOf(" "+o+" ")>-1)r=r.replace(" "+o+" "," ");i!==(s=vt(r))&&n.setAttribute("class",s)}return this},toggleClass:function(e,t){var n=typeof e,r="string"===n||Array.isArray(e);return"boolean"==typeof t&&r?t?this.addClass(e):this.removeClass(e):g(e)?this.each(function(n){w(this).toggleClass(e.call(this,n,mt(this),t),t)}):this.each(function(){var t,i,o,a;if(r){i=0,o=w(this),a=xt(e);while(t=a[i++])o.hasClass(t)?o.removeClass(t):o.addClass(t)}else void 0!==e&&"boolean"!==n||((t=mt(this))&&J.set(this,"__className__",t),this.setAttribute&&this.setAttribute("class",t||!1===e?"":J.get(this,"__className__")||""))})},hasClass:function(e){var t,n,r=0;t=" "+e+" ";while(n=this[r++])if(1===n.nodeType&&(" "+vt(mt(n))+" ").indexOf(t)>-1)return!0;return!1}});var bt=/\r/g;w.fn.extend({val:function(e){var t,n,r,i=this[0];{if(arguments.length)return r=g(e),this.each(function(n){var i;1===this.nodeType&&(null==(i=r?e.call(this,n,w(this).val()):e)?i="":"number"==typeof i?i+="":Array.isArray(i)&&(i=w.map(i,function(e){return null==e?"":e+""})),(t=w.valHooks[this.type]||w.valHooks[this.nodeName.toLowerCase()])&&"set"in t&&void 0!==t.set(this,i,"value")||(this.value=i))});if(i)return(t=w.valHooks[i.type]||w.valHooks[i.nodeName.toLowerCase()])&&"get"in t&&void 0!==(n=t.get(i,"value"))?n:"string"==typeof(n=i.value)?n.replace(bt,""):null==n?"":n}}}),w.extend({valHooks:{option:{get:function(e){var t=w.find.attr(e,"value");return null!=t?t:vt(w.text(e))}},select:{get:function(e){var t,n,r,i=e.options,o=e.selectedIndex,a="select-one"===e.type,s=a?null:[],u=a?o+1:i.length;for(r=o<0?u:a?o:0;r<u;r++)if(((n=i[r]).selected||r===o)&&!n.disabled&&(!n.parentNode.disabled||!N(n.parentNode,"optgroup"))){if(t=w(n).val(),a)return t;s.push(t)}return s},set:function(e,t){var n,r,i=e.options,o=w.makeArray(t),a=i.length;while(a--)((r=i[a]).selected=w.inArray(w.valHooks.option.get(r),o)>-1)&&(n=!0);return n||(e.selectedIndex=-1),o}}}}),w.each(["radio","checkbox"],function(){w.valHooks[this]={set:function(e,t){if(Array.isArray(t))return e.checked=w.inArray(w(e).val(),t)>-1}},h.checkOn||(w.valHooks[this].get=function(e){return null===e.getAttribute("value")?"on":e.value})}),h.focusin="onfocusin"in e;var wt=/^(?:focusinfocus|focusoutblur)$/,Tt=function(e){e.stopPropagation()};w.extend(w.event,{trigger:function(t,n,i,o){var a,s,u,l,c,p,d,h,v=[i||r],m=f.call(t,"type")?t.type:t,x=f.call(t,"namespace")?t.namespace.split("."):[];if(s=h=u=i=i||r,3!==i.nodeType&&8!==i.nodeType&&!wt.test(m+w.event.triggered)&&(m.indexOf(".")>-1&&(m=(x=m.split(".")).shift(),x.sort()),c=m.indexOf(":")<0&&"on"+m,t=t[w.expando]?t:new w.Event(m,"object"==typeof t&&t),t.isTrigger=o?2:3,t.namespace=x.join("."),t.rnamespace=t.namespace?new RegExp("(^|\\.)"+x.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,t.result=void 0,t.target||(t.target=i),n=null==n?[t]:w.makeArray(n,[t]),d=w.event.special[m]||{},o||!d.trigger||!1!==d.trigger.apply(i,n))){if(!o&&!d.noBubble&&!y(i)){for(l=d.delegateType||m,wt.test(l+m)||(s=s.parentNode);s;s=s.parentNode)v.push(s),u=s;u===(i.ownerDocument||r)&&v.push(u.defaultView||u.parentWindow||e)}a=0;while((s=v[a++])&&!t.isPropagationStopped())h=s,t.type=a>1?l:d.bindType||m,(p=(J.get(s,"events")||{})[t.type]&&J.get(s,"handle"))&&p.apply(s,n),(p=c&&s[c])&&p.apply&&Y(s)&&(t.result=p.apply(s,n),!1===t.result&&t.preventDefault());return t.type=m,o||t.isDefaultPrevented()||d._default&&!1!==d._default.apply(v.pop(),n)||!Y(i)||c&&g(i[m])&&!y(i)&&((u=i[c])&&(i[c]=null),w.event.triggered=m,t.isPropagationStopped()&&h.addEventListener(m,Tt),i[m](),t.isPropagationStopped()&&h.removeEventListener(m,Tt),w.event.triggered=void 0,u&&(i[c]=u)),t.result}},simulate:function(e,t,n){var r=w.extend(new w.Event,n,{type:e,isSimulated:!0});w.event.trigger(r,null,t)}}),w.fn.extend({trigger:function(e,t){return this.each(function(){w.event.trigger(e,t,this)})},triggerHandler:function(e,t){var n=this[0];if(n)return w.event.trigger(e,t,n,!0)}}),h.focusin||w.each({focus:"focusin",blur:"focusout"},function(e,t){var n=function(e){w.event.simulate(t,e.target,w.event.fix(e))};w.event.special[t]={setup:function(){var r=this.ownerDocument||this,i=J.access(r,t);i||r.addEventListener(e,n,!0),J.access(r,t,(i||0)+1)},teardown:function(){var r=this.ownerDocument||this,i=J.access(r,t)-1;i?J.access(r,t,i):(r.removeEventListener(e,n,!0),J.remove(r,t))}}});var Ct=e.location,Et=Date.now(),kt=/\?/;w.parseXML=function(t){var n;if(!t||"string"!=typeof t)return null;try{n=(new e.DOMParser).parseFromString(t,"text/xml")}catch(e){n=void 0}return n&&!n.getElementsByTagName("parsererror").length||w.error("Invalid XML: "+t),n};var St=/\[\]$/,Dt=/\r?\n/g,Nt=/^(?:submit|button|image|reset|file)$/i,At=/^(?:input|select|textarea|keygen)/i;function jt(e,t,n,r){var i;if(Array.isArray(t))w.each(t,function(t,i){n||St.test(e)?r(e,i):jt(e+"["+("object"==typeof i&&null!=i?t:"")+"]",i,n,r)});else if(n||"object"!==x(t))r(e,t);else for(i in t)jt(e+"["+i+"]",t[i],n,r)}w.param=function(e,t){var n,r=[],i=function(e,t){var n=g(t)?t():t;r[r.length]=encodeURIComponent(e)+"="+encodeURIComponent(null==n?"":n)};if(Array.isArray(e)||e.jquery&&!w.isPlainObject(e))w.each(e,function(){i(this.name,this.value)});else for(n in e)jt(n,e[n],t,i);return r.join("&")},w.fn.extend({serialize:function(){return w.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var e=w.prop(this,"elements");return e?w.makeArray(e):this}).filter(function(){var e=this.type;return this.name&&!w(this).is(":disabled")&&At.test(this.nodeName)&&!Nt.test(e)&&(this.checked||!pe.test(e))}).map(function(e,t){var n=w(this).val();return null==n?null:Array.isArray(n)?w.map(n,function(e){return{name:t.name,value:e.replace(Dt,"\r\n")}}):{name:t.name,value:n.replace(Dt,"\r\n")}}).get()}});var qt=/%20/g,Lt=/#.*$/,Ht=/([?&])_=[^&]*/,Ot=/^(.*?):[ \t]*([^\r\n]*)$/gm,Pt=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,Mt=/^(?:GET|HEAD)$/,Rt=/^\/\//,It={},Wt={},$t="*/".concat("*"),Bt=r.createElement("a");Bt.href=Ct.href;function Ft(e){return function(t,n){"string"!=typeof t&&(n=t,t="*");var r,i=0,o=t.toLowerCase().match(M)||[];if(g(n))while(r=o[i++])"+"===r[0]?(r=r.slice(1)||"*",(e[r]=e[r]||[]).unshift(n)):(e[r]=e[r]||[]).push(n)}}function _t(e,t,n,r){var i={},o=e===Wt;function a(s){var u;return i[s]=!0,w.each(e[s]||[],function(e,s){var l=s(t,n,r);return"string"!=typeof l||o||i[l]?o?!(u=l):void 0:(t.dataTypes.unshift(l),a(l),!1)}),u}return a(t.dataTypes[0])||!i["*"]&&a("*")}function zt(e,t){var n,r,i=w.ajaxSettings.flatOptions||{};for(n in t)void 0!==t[n]&&((i[n]?e:r||(r={}))[n]=t[n]);return r&&w.extend(!0,e,r),e}function Xt(e,t,n){var r,i,o,a,s=e.contents,u=e.dataTypes;while("*"===u[0])u.shift(),void 0===r&&(r=e.mimeType||t.getResponseHeader("Content-Type"));if(r)for(i in s)if(s[i]&&s[i].test(r)){u.unshift(i);break}if(u[0]in n)o=u[0];else{for(i in n){if(!u[0]||e.converters[i+" "+u[0]]){o=i;break}a||(a=i)}o=o||a}if(o)return o!==u[0]&&u.unshift(o),n[o]}function Ut(e,t,n,r){var i,o,a,s,u,l={},c=e.dataTypes.slice();if(c[1])for(a in e.converters)l[a.toLowerCase()]=e.converters[a];o=c.shift();while(o)if(e.responseFields[o]&&(n[e.responseFields[o]]=t),!u&&r&&e.dataFilter&&(t=e.dataFilter(t,e.dataType)),u=o,o=c.shift())if("*"===o)o=u;else if("*"!==u&&u!==o){if(!(a=l[u+" "+o]||l["* "+o]))for(i in l)if((s=i.split(" "))[1]===o&&(a=l[u+" "+s[0]]||l["* "+s[0]])){!0===a?a=l[i]:!0!==l[i]&&(o=s[0],c.unshift(s[1]));break}if(!0!==a)if(a&&e["throws"])t=a(t);else try{t=a(t)}catch(e){return{state:"parsererror",error:a?e:"No conversion from "+u+" to "+o}}}return{state:"success",data:t}}w.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:Ct.href,type:"GET",isLocal:Pt.test(Ct.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":$t,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":JSON.parse,"text xml":w.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?zt(zt(e,w.ajaxSettings),t):zt(w.ajaxSettings,e)},ajaxPrefilter:Ft(It),ajaxTransport:Ft(Wt),ajax:function(t,n){"object"==typeof t&&(n=t,t=void 0),n=n||{};var i,o,a,s,u,l,c,f,p,d,h=w.ajaxSetup({},n),g=h.context||h,y=h.context&&(g.nodeType||g.jquery)?w(g):w.event,v=w.Deferred(),m=w.Callbacks("once memory"),x=h.statusCode||{},b={},T={},C="canceled",E={readyState:0,getResponseHeader:function(e){var t;if(c){if(!s){s={};while(t=Ot.exec(a))s[t[1].toLowerCase()]=t[2]}t=s[e.toLowerCase()]}return null==t?null:t},getAllResponseHeaders:function(){return c?a:null},setRequestHeader:function(e,t){return null==c&&(e=T[e.toLowerCase()]=T[e.toLowerCase()]||e,b[e]=t),this},overrideMimeType:function(e){return null==c&&(h.mimeType=e),this},statusCode:function(e){var t;if(e)if(c)E.always(e[E.status]);else for(t in e)x[t]=[x[t],e[t]];return this},abort:function(e){var t=e||C;return i&&i.abort(t),k(0,t),this}};if(v.promise(E),h.url=((t||h.url||Ct.href)+"").replace(Rt,Ct.protocol+"//"),h.type=n.method||n.type||h.method||h.type,h.dataTypes=(h.dataType||"*").toLowerCase().match(M)||[""],null==h.crossDomain){l=r.createElement("a");try{l.href=h.url,l.href=l.href,h.crossDomain=Bt.protocol+"//"+Bt.host!=l.protocol+"//"+l.host}catch(e){h.crossDomain=!0}}if(h.data&&h.processData&&"string"!=typeof h.data&&(h.data=w.param(h.data,h.traditional)),_t(It,h,n,E),c)return E;(f=w.event&&h.global)&&0==w.active++&&w.event.trigger("ajaxStart"),h.type=h.type.toUpperCase(),h.hasContent=!Mt.test(h.type),o=h.url.replace(Lt,""),h.hasContent?h.data&&h.processData&&0===(h.contentType||"").indexOf("application/x-www-form-urlencoded")&&(h.data=h.data.replace(qt,"+")):(d=h.url.slice(o.length),h.data&&(h.processData||"string"==typeof h.data)&&(o+=(kt.test(o)?"&":"?")+h.data,delete h.data),!1===h.cache&&(o=o.replace(Ht,"$1"),d=(kt.test(o)?"&":"?")+"_="+Et+++d),h.url=o+d),h.ifModified&&(w.lastModified[o]&&E.setRequestHeader("If-Modified-Since",w.lastModified[o]),w.etag[o]&&E.setRequestHeader("If-None-Match",w.etag[o])),(h.data&&h.hasContent&&!1!==h.contentType||n.contentType)&&E.setRequestHeader("Content-Type",h.contentType),E.setRequestHeader("Accept",h.dataTypes[0]&&h.accepts[h.dataTypes[0]]?h.accepts[h.dataTypes[0]]+("*"!==h.dataTypes[0]?", "+$t+"; q=0.01":""):h.accepts["*"]);for(p in h.headers)E.setRequestHeader(p,h.headers[p]);if(h.beforeSend&&(!1===h.beforeSend.call(g,E,h)||c))return E.abort();if(C="abort",m.add(h.complete),E.done(h.success),E.fail(h.error),i=_t(Wt,h,n,E)){if(E.readyState=1,f&&y.trigger("ajaxSend",[E,h]),c)return E;h.async&&h.timeout>0&&(u=e.setTimeout(function(){E.abort("timeout")},h.timeout));try{c=!1,i.send(b,k)}catch(e){if(c)throw e;k(-1,e)}}else k(-1,"No Transport");function k(t,n,r,s){var l,p,d,b,T,C=n;c||(c=!0,u&&e.clearTimeout(u),i=void 0,a=s||"",E.readyState=t>0?4:0,l=t>=200&&t<300||304===t,r&&(b=Xt(h,E,r)),b=Ut(h,b,E,l),l?(h.ifModified&&((T=E.getResponseHeader("Last-Modified"))&&(w.lastModified[o]=T),(T=E.getResponseHeader("etag"))&&(w.etag[o]=T)),204===t||"HEAD"===h.type?C="nocontent":304===t?C="notmodified":(C=b.state,p=b.data,l=!(d=b.error))):(d=C,!t&&C||(C="error",t<0&&(t=0))),E.status=t,E.statusText=(n||C)+"",l?v.resolveWith(g,[p,C,E]):v.rejectWith(g,[E,C,d]),E.statusCode(x),x=void 0,f&&y.trigger(l?"ajaxSuccess":"ajaxError",[E,h,l?p:d]),m.fireWith(g,[E,C]),f&&(y.trigger("ajaxComplete",[E,h]),--w.active||w.event.trigger("ajaxStop")))}return E},getJSON:function(e,t,n){return w.get(e,t,n,"json")},getScript:function(e,t){return w.get(e,void 0,t,"script")}}),w.each(["get","post"],function(e,t){w[t]=function(e,n,r,i){return g(n)&&(i=i||r,r=n,n=void 0),w.ajax(w.extend({url:e,type:t,dataType:i,data:n,success:r},w.isPlainObject(e)&&e))}}),w._evalUrl=function(e){return w.ajax({url:e,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,"throws":!0})},w.fn.extend({wrapAll:function(e){var t;return this[0]&&(g(e)&&(e=e.call(this[0])),t=w(e,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){var e=this;while(e.firstElementChild)e=e.firstElementChild;return e}).append(this)),this},wrapInner:function(e){return g(e)?this.each(function(t){w(this).wrapInner(e.call(this,t))}):this.each(function(){var t=w(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)})},wrap:function(e){var t=g(e);return this.each(function(n){w(this).wrapAll(t?e.call(this,n):e)})},unwrap:function(e){return this.parent(e).not("body").each(function(){w(this).replaceWith(this.childNodes)}),this}}),w.expr.pseudos.hidden=function(e){return!w.expr.pseudos.visible(e)},w.expr.pseudos.visible=function(e){return!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)},w.ajaxSettings.xhr=function(){try{return new e.XMLHttpRequest}catch(e){}};var Vt={0:200,1223:204},Gt=w.ajaxSettings.xhr();h.cors=!!Gt&&"withCredentials"in Gt,h.ajax=Gt=!!Gt,w.ajaxTransport(function(t){var n,r;if(h.cors||Gt&&!t.crossDomain)return{send:function(i,o){var a,s=t.xhr();if(s.open(t.type,t.url,t.async,t.username,t.password),t.xhrFields)for(a in t.xhrFields)s[a]=t.xhrFields[a];t.mimeType&&s.overrideMimeType&&s.overrideMimeType(t.mimeType),t.crossDomain||i["X-Requested-With"]||(i["X-Requested-With"]="XMLHttpRequest");for(a in i)s.setRequestHeader(a,i[a]);n=function(e){return function(){n&&(n=r=s.onload=s.onerror=s.onabort=s.ontimeout=s.onreadystatechange=null,"abort"===e?s.abort():"error"===e?"number"!=typeof s.status?o(0,"error"):o(s.status,s.statusText):o(Vt[s.status]||s.status,s.statusText,"text"!==(s.responseType||"text")||"string"!=typeof s.responseText?{binary:s.response}:{text:s.responseText},s.getAllResponseHeaders()))}},s.onload=n(),r=s.onerror=s.ontimeout=n("error"),void 0!==s.onabort?s.onabort=r:s.onreadystatechange=function(){4===s.readyState&&e.setTimeout(function(){n&&r()})},n=n("abort");try{s.send(t.hasContent&&t.data||null)}catch(e){if(n)throw e}},abort:function(){n&&n()}}}),w.ajaxPrefilter(function(e){e.crossDomain&&(e.contents.script=!1)}),w.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(e){return w.globalEval(e),e}}}),w.ajaxPrefilter("script",function(e){void 0===e.cache&&(e.cache=!1),e.crossDomain&&(e.type="GET")}),w.ajaxTransport("script",function(e){if(e.crossDomain){var t,n;return{send:function(i,o){t=w("<script>").prop({charset:e.scriptCharset,src:e.url}).on("load error",n=function(e){t.remove(),n=null,e&&o("error"===e.type?404:200,e.type)}),r.head.appendChild(t[0])},abort:function(){n&&n()}}}});var Yt=[],Qt=/(=)\?(?=&|$)|\?\?/;w.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=Yt.pop()||w.expando+"_"+Et++;return this[e]=!0,e}}),w.ajaxPrefilter("json jsonp",function(t,n,r){var i,o,a,s=!1!==t.jsonp&&(Qt.test(t.url)?"url":"string"==typeof t.data&&0===(t.contentType||"").indexOf("application/x-www-form-urlencoded")&&Qt.test(t.data)&&"data");if(s||"jsonp"===t.dataTypes[0])return i=t.jsonpCallback=g(t.jsonpCallback)?t.jsonpCallback():t.jsonpCallback,s?t[s]=t[s].replace(Qt,"$1"+i):!1!==t.jsonp&&(t.url+=(kt.test(t.url)?"&":"?")+t.jsonp+"="+i),t.converters["script json"]=function(){return a||w.error(i+" was not called"),a[0]},t.dataTypes[0]="json",o=e[i],e[i]=function(){a=arguments},r.always(function(){void 0===o?w(e).removeProp(i):e[i]=o,t[i]&&(t.jsonpCallback=n.jsonpCallback,Yt.push(i)),a&&g(o)&&o(a[0]),a=o=void 0}),"script"}),h.createHTMLDocument=function(){var e=r.implementation.createHTMLDocument("").body;return e.innerHTML="<form></form><form></form>",2===e.childNodes.length}(),w.parseHTML=function(e,t,n){if("string"!=typeof e)return[];"boolean"==typeof t&&(n=t,t=!1);var i,o,a;return t||(h.createHTMLDocument?((i=(t=r.implementation.createHTMLDocument("")).createElement("base")).href=r.location.href,t.head.appendChild(i)):t=r),o=A.exec(e),a=!n&&[],o?[t.createElement(o[1])]:(o=xe([e],t,a),a&&a.length&&w(a).remove(),w.merge([],o.childNodes))},w.fn.load=function(e,t,n){var r,i,o,a=this,s=e.indexOf(" ");return s>-1&&(r=vt(e.slice(s)),e=e.slice(0,s)),g(t)?(n=t,t=void 0):t&&"object"==typeof t&&(i="POST"),a.length>0&&w.ajax({url:e,type:i||"GET",dataType:"html",data:t}).done(function(e){o=arguments,a.html(r?w("<div>").append(w.parseHTML(e)).find(r):e)}).always(n&&function(e,t){a.each(function(){n.apply(this,o||[e.responseText,t,e])})}),this},w.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){w.fn[t]=function(e){return this.on(t,e)}}),w.expr.pseudos.animated=function(e){return w.grep(w.timers,function(t){return e===t.elem}).length},w.offset={setOffset:function(e,t,n){var r,i,o,a,s,u,l,c=w.css(e,"position"),f=w(e),p={};"static"===c&&(e.style.position="relative"),s=f.offset(),o=w.css(e,"top"),u=w.css(e,"left"),(l=("absolute"===c||"fixed"===c)&&(o+u).indexOf("auto")>-1)?(a=(r=f.position()).top,i=r.left):(a=parseFloat(o)||0,i=parseFloat(u)||0),g(t)&&(t=t.call(e,n,w.extend({},s))),null!=t.top&&(p.top=t.top-s.top+a),null!=t.left&&(p.left=t.left-s.left+i),"using"in t?t.using.call(e,p):f.css(p)}},w.fn.extend({offset:function(e){if(arguments.length)return void 0===e?this:this.each(function(t){w.offset.setOffset(this,e,t)});var t,n,r=this[0];if(r)return r.getClientRects().length?(t=r.getBoundingClientRect(),n=r.ownerDocument.defaultView,{top:t.top+n.pageYOffset,left:t.left+n.pageXOffset}):{top:0,left:0}},position:function(){if(this[0]){var e,t,n,r=this[0],i={top:0,left:0};if("fixed"===w.css(r,"position"))t=r.getBoundingClientRect();else{t=this.offset(),n=r.ownerDocument,e=r.offsetParent||n.documentElement;while(e&&(e===n.body||e===n.documentElement)&&"static"===w.css(e,"position"))e=e.parentNode;e&&e!==r&&1===e.nodeType&&((i=w(e).offset()).top+=w.css(e,"borderTopWidth",!0),i.left+=w.css(e,"borderLeftWidth",!0))}return{top:t.top-i.top-w.css(r,"marginTop",!0),left:t.left-i.left-w.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var e=this.offsetParent;while(e&&"static"===w.css(e,"position"))e=e.offsetParent;return e||be})}}),w.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(e,t){var n="pageYOffset"===t;w.fn[e]=function(r){return z(this,function(e,r,i){var o;if(y(e)?o=e:9===e.nodeType&&(o=e.defaultView),void 0===i)return o?o[t]:e[r];o?o.scrollTo(n?o.pageXOffset:i,n?i:o.pageYOffset):e[r]=i},e,r,arguments.length)}}),w.each(["top","left"],function(e,t){w.cssHooks[t]=_e(h.pixelPosition,function(e,n){if(n)return n=Fe(e,t),We.test(n)?w(e).position()[t]+"px":n})}),w.each({Height:"height",Width:"width"},function(e,t){w.each({padding:"inner"+e,content:t,"":"outer"+e},function(n,r){w.fn[r]=function(i,o){var a=arguments.length&&(n||"boolean"!=typeof i),s=n||(!0===i||!0===o?"margin":"border");return z(this,function(t,n,i){var o;return y(t)?0===r.indexOf("outer")?t["inner"+e]:t.document.documentElement["client"+e]:9===t.nodeType?(o=t.documentElement,Math.max(t.body["scroll"+e],o["scroll"+e],t.body["offset"+e],o["offset"+e],o["client"+e])):void 0===i?w.css(t,n,s):w.style(t,n,i,s)},t,a?i:void 0,a)}})}),w.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(e,t){w.fn[t]=function(e,n){return arguments.length>0?this.on(t,null,e,n):this.trigger(t)}}),w.fn.extend({hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)}}),w.fn.extend({bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)}}),w.proxy=function(e,t){var n,r,i;if("string"==typeof t&&(n=e[t],t=e,e=n),g(e))return r=o.call(arguments,2),i=function(){return e.apply(t||this,r.concat(o.call(arguments)))},i.guid=e.guid=e.guid||w.guid++,i},w.holdReady=function(e){e?w.readyWait++:w.ready(!0)},w.isArray=Array.isArray,w.parseJSON=JSON.parse,w.nodeName=N,w.isFunction=g,w.isWindow=y,w.camelCase=G,w.type=x,w.now=Date.now,w.isNumeric=function(e){var t=w.type(e);return("number"===t||"string"===t)&&!isNaN(e-parseFloat(e))},"function"==typeof define&&define.amd&&define("jquery",[],function(){return w});var Jt=e.jQuery,Kt=e.$;return w.noConflict=function(t){return e.$===w&&(e.$=Kt),t&&e.jQuery===w&&(e.jQuery=Jt),w},t||(e.jQuery=e.$=w),w});
V3.jQuery = (V3 === window.V3 && !jqExists) ? $ : window.jQuery.noConflict(true); //Not calling jQuery.noConflict() is for backward compatibility with old applications using this jQuery resource, ultimately it would be preferred to always call jQuery.noConflict()
}); })(V3);
var V3;
if(!V3){V3={__namespace:true};}
(function(V3){ V3.RegisterFile('jQuery.UI', 1.012001, [{ Filename: 'jQuery', Version: 3.003001 }], function (V3) {
/*! jQuery UI - v1.12.1 - 2019-01-17
* http://jqueryui.com
* Includes: disable-selection.js, focusable.js, keycode.js, unique-id.js, widgets/datepicker.js
* Copyright jQuery Foundation and other contributors; Licensed MIT */

(function(t){"function"==typeof define&&define.amd?define(["jquery"],t):t(jQuery)})(function(t){function e(t){for(var e=t.css("visibility");"inherit"===e;)t=t.parent(),e=t.css("visibility");return"hidden"!==e}function i(t){for(var e,i;t.length&&t[0]!==document;){if(e=t.css("position"),("absolute"===e||"relative"===e||"fixed"===e)&&(i=parseInt(t.css("zIndex"),10),!isNaN(i)&&0!==i))return i;t=t.parent()}return 0}function s(){this._curInst=null,this._keyEvent=!1,this._disabledInputs=[],this._datepickerShowing=!1,this._inDialog=!1,this._mainDivId="ui-datepicker-div",this._inlineClass="ui-datepicker-inline",this._appendClass="ui-datepicker-append",this._triggerClass="ui-datepicker-trigger",this._dialogClass="ui-datepicker-dialog",this._disableClass="ui-datepicker-disabled",this._unselectableClass="ui-datepicker-unselectable",this._currentClass="ui-datepicker-current-day",this._dayOverClass="ui-datepicker-days-cell-over",this.regional=[],this.regional[""]={closeText:"Done",prevText:"Prev",nextText:"Next",currentText:"Today",monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],weekHeader:"Wk",dateFormat:"mm/dd/yy",firstDay:0,isRTL:!1,showMonthAfterYear:!1,yearSuffix:""},this._defaults={showOn:"focus",showAnim:"fadeIn",showOptions:{},defaultDate:null,appendText:"",buttonText:"...",buttonImage:"",buttonImageOnly:!1,hideIfNoPrevNext:!1,navigationAsDateFormat:!1,gotoCurrent:!1,changeMonth:!1,changeYear:!1,yearRange:"c-10:c+10",showOtherMonths:!1,selectOtherMonths:!1,showWeek:!1,calculateWeek:this.iso8601Week,shortYearCutoff:"+10",minDate:null,maxDate:null,duration:"fast",beforeShowDay:null,beforeShow:null,onSelect:null,onChangeMonthYear:null,onClose:null,numberOfMonths:1,showCurrentAtPos:0,stepMonths:1,stepBigMonths:12,altField:"",altFormat:"",constrainInput:!0,showButtonPanel:!1,autoSize:!1,disabled:!1},t.extend(this._defaults,this.regional[""]),this.regional.en=t.extend(!0,{},this.regional[""]),this.regional["en-US"]=t.extend(!0,{},this.regional.en),this.dpDiv=n(t("<div id='"+this._mainDivId+"' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>"))}function n(e){var i="button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a";return e.on("mouseout",i,function(){t(this).removeClass("ui-state-hover"),-1!==this.className.indexOf("ui-datepicker-prev")&&t(this).removeClass("ui-datepicker-prev-hover"),-1!==this.className.indexOf("ui-datepicker-next")&&t(this).removeClass("ui-datepicker-next-hover")}).on("mouseover",i,o)}function o(){t.datepicker._isDisabledDatepicker(r.inline?r.dpDiv.parent()[0]:r.input[0])||(t(this).parents(".ui-datepicker-calendar").find("a").removeClass("ui-state-hover"),t(this).addClass("ui-state-hover"),-1!==this.className.indexOf("ui-datepicker-prev")&&t(this).addClass("ui-datepicker-prev-hover"),-1!==this.className.indexOf("ui-datepicker-next")&&t(this).addClass("ui-datepicker-next-hover"))}function a(e,i){t.extend(e,i);for(var s in i)null==i[s]&&(e[s]=i[s]);return e}t.ui=t.ui||{},t.ui.version="1.12.1",t.fn.extend({disableSelection:function(){var t="onselectstart"in document.createElement("div")?"selectstart":"mousedown";return function(){return this.on(t+".ui-disableSelection",function(t){t.preventDefault()})}}(),enableSelection:function(){return this.off(".ui-disableSelection")}}),t.ui.focusable=function(i,s){var n,o,a,r,l,h=i.nodeName.toLowerCase();return"area"===h?(n=i.parentNode,o=n.name,i.href&&o&&"map"===n.nodeName.toLowerCase()?(a=t("img[usemap='#"+o+"']"),a.length>0&&a.is(":visible")):!1):(/^(input|select|textarea|button|object)$/.test(h)?(r=!i.disabled,r&&(l=t(i).closest("fieldset")[0],l&&(r=!l.disabled))):r="a"===h?i.href||s:s,r&&t(i).is(":visible")&&e(t(i)))},t.extend(t.expr[":"],{focusable:function(e){return t.ui.focusable(e,null!=t.attr(e,"tabindex"))}}),t.ui.focusable,t.ui.keyCode={BACKSPACE:8,COMMA:188,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SPACE:32,TAB:9,UP:38},t.fn.extend({uniqueId:function(){var t=0;return function(){return this.each(function(){this.id||(this.id="ui-id-"+ ++t)})}}(),removeUniqueId:function(){return this.each(function(){/^ui-id-\d+$/.test(this.id)&&t(this).removeAttr("id")})}}),t.extend(t.ui,{datepicker:{version:"1.12.1"}});var r;t.extend(s.prototype,{markerClassName:"hasDatepicker",maxRows:4,_widgetDatepicker:function(){return this.dpDiv},setDefaults:function(t){return a(this._defaults,t||{}),this},_attachDatepicker:function(e,i){var s,n,o;s=e.nodeName.toLowerCase(),n="div"===s||"span"===s,e.id||(this.uuid+=1,e.id="dp"+this.uuid),o=this._newInst(t(e),n),o.settings=t.extend({},i||{}),"input"===s?this._connectDatepicker(e,o):n&&this._inlineDatepicker(e,o)},_newInst:function(e,i){var s=e[0].id.replace(/([^A-Za-z0-9_\-])/g,"\\\\$1");return{id:s,input:e,selectedDay:0,selectedMonth:0,selectedYear:0,drawMonth:0,drawYear:0,inline:i,dpDiv:i?n(t("<div class='"+this._inlineClass+" ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>")):this.dpDiv}},_connectDatepicker:function(e,i){var s=t(e);i.append=t([]),i.trigger=t([]),s.hasClass(this.markerClassName)||(this._attachments(s,i),s.addClass(this.markerClassName).on("keydown",this._doKeyDown).on("keypress",this._doKeyPress).on("keyup",this._doKeyUp),this._autoSize(i),t.data(e,"datepicker",i),i.settings.disabled&&this._disableDatepicker(e))},_attachments:function(e,i){var s,n,o,a=this._get(i,"appendText"),r=this._get(i,"isRTL");i.append&&i.append.remove(),a&&(i.append=t("<span class='"+this._appendClass+"'>"+a+"</span>"),e[r?"before":"after"](i.append)),e.off("focus",this._showDatepicker),i.trigger&&i.trigger.remove(),s=this._get(i,"showOn"),("focus"===s||"both"===s)&&e.on("focus",this._showDatepicker),("button"===s||"both"===s)&&(n=this._get(i,"buttonText"),o=this._get(i,"buttonImage"),i.trigger=t(this._get(i,"buttonImageOnly")?t("<img/>").addClass(this._triggerClass).attr({src:o,alt:n,title:n}):t("<button type='button'></button>").addClass(this._triggerClass).html(o?t("<img/>").attr({src:o,alt:n,title:n}):n)),e[r?"before":"after"](i.trigger),i.trigger.on("click",function(){return t.datepicker._datepickerShowing&&t.datepicker._lastInput===e[0]?t.datepicker._hideDatepicker():t.datepicker._datepickerShowing&&t.datepicker._lastInput!==e[0]?(t.datepicker._hideDatepicker(),t.datepicker._showDatepicker(e[0])):t.datepicker._showDatepicker(e[0]),!1}))},_autoSize:function(t){if(this._get(t,"autoSize")&&!t.inline){var e,i,s,n,o=new Date(2009,11,20),a=this._get(t,"dateFormat");a.match(/[DM]/)&&(e=function(t){for(i=0,s=0,n=0;t.length>n;n++)t[n].length>i&&(i=t[n].length,s=n);return s},o.setMonth(e(this._get(t,a.match(/MM/)?"monthNames":"monthNamesShort"))),o.setDate(e(this._get(t,a.match(/DD/)?"dayNames":"dayNamesShort"))+20-o.getDay())),t.input.attr("size",this._formatDate(t,o).length)}},_inlineDatepicker:function(e,i){var s=t(e);s.hasClass(this.markerClassName)||(s.addClass(this.markerClassName).append(i.dpDiv),t.data(e,"datepicker",i),this._setDate(i,this._getDefaultDate(i),!0),this._updateDatepicker(i),this._updateAlternate(i),i.settings.disabled&&this._disableDatepicker(e),i.dpDiv.css("display","block"))},_dialogDatepicker:function(e,i,s,n,o){var r,l,h,c,u,d=this._dialogInst;return d||(this.uuid+=1,r="dp"+this.uuid,this._dialogInput=t("<input type='text' id='"+r+"' style='position: absolute; top: -100px; width: 0px;'/>"),this._dialogInput.on("keydown",this._doKeyDown),t("body").append(this._dialogInput),d=this._dialogInst=this._newInst(this._dialogInput,!1),d.settings={},t.data(this._dialogInput[0],"datepicker",d)),a(d.settings,n||{}),i=i&&i.constructor===Date?this._formatDate(d,i):i,this._dialogInput.val(i),this._pos=o?o.length?o:[o.pageX,o.pageY]:null,this._pos||(l=document.documentElement.clientWidth,h=document.documentElement.clientHeight,c=document.documentElement.scrollLeft||document.body.scrollLeft,u=document.documentElement.scrollTop||document.body.scrollTop,this._pos=[l/2-100+c,h/2-150+u]),this._dialogInput.css("left",this._pos[0]+20+"px").css("top",this._pos[1]+"px"),d.settings.onSelect=s,this._inDialog=!0,this.dpDiv.addClass(this._dialogClass),this._showDatepicker(this._dialogInput[0]),t.blockUI&&t.blockUI(this.dpDiv),t.data(this._dialogInput[0],"datepicker",d),this},_destroyDatepicker:function(e){var i,s=t(e),n=t.data(e,"datepicker");s.hasClass(this.markerClassName)&&(i=e.nodeName.toLowerCase(),t.removeData(e,"datepicker"),"input"===i?(n.append.remove(),n.trigger.remove(),s.removeClass(this.markerClassName).off("focus",this._showDatepicker).off("keydown",this._doKeyDown).off("keypress",this._doKeyPress).off("keyup",this._doKeyUp)):("div"===i||"span"===i)&&s.removeClass(this.markerClassName).empty(),r===n&&(r=null))},_enableDatepicker:function(e){var i,s,n=t(e),o=t.data(e,"datepicker");n.hasClass(this.markerClassName)&&(i=e.nodeName.toLowerCase(),"input"===i?(e.disabled=!1,o.trigger.filter("button").each(function(){this.disabled=!1}).end().filter("img").css({opacity:"1.0",cursor:""})):("div"===i||"span"===i)&&(s=n.children("."+this._inlineClass),s.children().removeClass("ui-state-disabled"),s.find("select.ui-datepicker-month, select.ui-datepicker-year").prop("disabled",!1)),this._disabledInputs=t.map(this._disabledInputs,function(t){return t===e?null:t}))},_disableDatepicker:function(e){var i,s,n=t(e),o=t.data(e,"datepicker");n.hasClass(this.markerClassName)&&(i=e.nodeName.toLowerCase(),"input"===i?(e.disabled=!0,o.trigger.filter("button").each(function(){this.disabled=!0}).end().filter("img").css({opacity:"0.5",cursor:"default"})):("div"===i||"span"===i)&&(s=n.children("."+this._inlineClass),s.children().addClass("ui-state-disabled"),s.find("select.ui-datepicker-month, select.ui-datepicker-year").prop("disabled",!0)),this._disabledInputs=t.map(this._disabledInputs,function(t){return t===e?null:t}),this._disabledInputs[this._disabledInputs.length]=e)},_isDisabledDatepicker:function(t){if(!t)return!1;for(var e=0;this._disabledInputs.length>e;e++)if(this._disabledInputs[e]===t)return!0;return!1},_getInst:function(e){try{return t.data(e,"datepicker")}catch(i){throw"Missing instance data for this datepicker"}},_optionDatepicker:function(e,i,s){var n,o,r,l,h=this._getInst(e);return 2===arguments.length&&"string"==typeof i?"defaults"===i?t.extend({},t.datepicker._defaults):h?"all"===i?t.extend({},h.settings):this._get(h,i):null:(n=i||{},"string"==typeof i&&(n={},n[i]=s),h&&(this._curInst===h&&this._hideDatepicker(),o=this._getDateDatepicker(e,!0),r=this._getMinMaxDate(h,"min"),l=this._getMinMaxDate(h,"max"),a(h.settings,n),null!==r&&void 0!==n.dateFormat&&void 0===n.minDate&&(h.settings.minDate=this._formatDate(h,r)),null!==l&&void 0!==n.dateFormat&&void 0===n.maxDate&&(h.settings.maxDate=this._formatDate(h,l)),"disabled"in n&&(n.disabled?this._disableDatepicker(e):this._enableDatepicker(e)),this._attachments(t(e),h),this._autoSize(h),this._setDate(h,o),this._updateAlternate(h),this._updateDatepicker(h)),void 0)},_changeDatepicker:function(t,e,i){this._optionDatepicker(t,e,i)},_refreshDatepicker:function(t){var e=this._getInst(t);e&&this._updateDatepicker(e)},_setDateDatepicker:function(t,e){var i=this._getInst(t);i&&(this._setDate(i,e),this._updateDatepicker(i),this._updateAlternate(i))},_getDateDatepicker:function(t,e){var i=this._getInst(t);return i&&!i.inline&&this._setDateFromField(i,e),i?this._getDate(i):null},_doKeyDown:function(e){var i,s,n,o=t.datepicker._getInst(e.target),a=!0,r=o.dpDiv.is(".ui-datepicker-rtl");if(o._keyEvent=!0,t.datepicker._datepickerShowing)switch(e.keyCode){case 9:t.datepicker._hideDatepicker(),a=!1;break;case 13:return n=t("td."+t.datepicker._dayOverClass+":not(."+t.datepicker._currentClass+")",o.dpDiv),n[0]&&t.datepicker._selectDay(e.target,o.selectedMonth,o.selectedYear,n[0]),i=t.datepicker._get(o,"onSelect"),i?(s=t.datepicker._formatDate(o),i.apply(o.input?o.input[0]:null,[s,o])):t.datepicker._hideDatepicker(),!1;case 27:t.datepicker._hideDatepicker();break;case 33:t.datepicker._adjustDate(e.target,e.ctrlKey?-t.datepicker._get(o,"stepBigMonths"):-t.datepicker._get(o,"stepMonths"),"M");break;case 34:t.datepicker._adjustDate(e.target,e.ctrlKey?+t.datepicker._get(o,"stepBigMonths"):+t.datepicker._get(o,"stepMonths"),"M");break;case 35:(e.ctrlKey||e.metaKey)&&t.datepicker._clearDate(e.target),a=e.ctrlKey||e.metaKey;break;case 36:(e.ctrlKey||e.metaKey)&&t.datepicker._gotoToday(e.target),a=e.ctrlKey||e.metaKey;break;case 37:(e.ctrlKey||e.metaKey)&&t.datepicker._adjustDate(e.target,r?1:-1,"D"),a=e.ctrlKey||e.metaKey,e.originalEvent.altKey&&t.datepicker._adjustDate(e.target,e.ctrlKey?-t.datepicker._get(o,"stepBigMonths"):-t.datepicker._get(o,"stepMonths"),"M");break;case 38:(e.ctrlKey||e.metaKey)&&t.datepicker._adjustDate(e.target,-7,"D"),a=e.ctrlKey||e.metaKey;break;case 39:(e.ctrlKey||e.metaKey)&&t.datepicker._adjustDate(e.target,r?-1:1,"D"),a=e.ctrlKey||e.metaKey,e.originalEvent.altKey&&t.datepicker._adjustDate(e.target,e.ctrlKey?+t.datepicker._get(o,"stepBigMonths"):+t.datepicker._get(o,"stepMonths"),"M");break;case 40:(e.ctrlKey||e.metaKey)&&t.datepicker._adjustDate(e.target,7,"D"),a=e.ctrlKey||e.metaKey;break;default:a=!1}else 36===e.keyCode&&e.ctrlKey?t.datepicker._showDatepicker(this):a=!1;a&&(e.preventDefault(),e.stopPropagation())},_doKeyPress:function(e){var i,s,n=t.datepicker._getInst(e.target);return t.datepicker._get(n,"constrainInput")?(i=t.datepicker._possibleChars(t.datepicker._get(n,"dateFormat")),s=String.fromCharCode(null==e.charCode?e.keyCode:e.charCode),e.ctrlKey||e.metaKey||" ">s||!i||i.indexOf(s)>-1):void 0},_doKeyUp:function(e){var i,s=t.datepicker._getInst(e.target);if(s.input.val()!==s.lastVal)try{i=t.datepicker.parseDate(t.datepicker._get(s,"dateFormat"),s.input?s.input.val():null,t.datepicker._getFormatConfig(s)),i&&(t.datepicker._setDateFromField(s),t.datepicker._updateAlternate(s),t.datepicker._updateDatepicker(s))}catch(n){}return!0},_showDatepicker:function(e){if(e=e.target||e,"input"!==e.nodeName.toLowerCase()&&(e=t("input",e.parentNode)[0]),!t.datepicker._isDisabledDatepicker(e)&&t.datepicker._lastInput!==e){var s,n,o,r,l,h,c;s=t.datepicker._getInst(e),t.datepicker._curInst&&t.datepicker._curInst!==s&&(t.datepicker._curInst.dpDiv.stop(!0,!0),s&&t.datepicker._datepickerShowing&&t.datepicker._hideDatepicker(t.datepicker._curInst.input[0])),n=t.datepicker._get(s,"beforeShow"),o=n?n.apply(e,[e,s]):{},o!==!1&&(a(s.settings,o),s.lastVal=null,t.datepicker._lastInput=e,t.datepicker._setDateFromField(s),t.datepicker._inDialog&&(e.value=""),t.datepicker._pos||(t.datepicker._pos=t.datepicker._findPos(e),t.datepicker._pos[1]+=e.offsetHeight),r=!1,t(e).parents().each(function(){return r|="fixed"===t(this).css("position"),!r}),l={left:t.datepicker._pos[0],top:t.datepicker._pos[1]},t.datepicker._pos=null,s.dpDiv.empty(),s.dpDiv.css({position:"absolute",display:"block",top:"-1000px"}),t.datepicker._updateDatepicker(s),l=t.datepicker._checkOffset(s,l,r),s.dpDiv.css({position:t.datepicker._inDialog&&t.blockUI?"static":r?"fixed":"absolute",display:"none",left:l.left+"px",top:l.top+"px"}),s.inline||(h=t.datepicker._get(s,"showAnim"),c=t.datepicker._get(s,"duration"),s.dpDiv.css("z-index",i(t(e))+1),t.datepicker._datepickerShowing=!0,t.effects&&t.effects.effect[h]?s.dpDiv.show(h,t.datepicker._get(s,"showOptions"),c):s.dpDiv[h||"show"](h?c:null),t.datepicker._shouldFocusInput(s)&&s.input.trigger("focus"),t.datepicker._curInst=s))}},_updateDatepicker:function(e){this.maxRows=4,r=e,e.dpDiv.empty().append(this._generateHTML(e)),this._attachHandlers(e);var i,s=this._getNumberOfMonths(e),n=s[1],a=17,l=e.dpDiv.find("."+this._dayOverClass+" a");l.length>0&&o.apply(l.get(0)),e.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width(""),n>1&&e.dpDiv.addClass("ui-datepicker-multi-"+n).css("width",a*n+"em"),e.dpDiv[(1!==s[0]||1!==s[1]?"add":"remove")+"Class"]("ui-datepicker-multi"),e.dpDiv[(this._get(e,"isRTL")?"add":"remove")+"Class"]("ui-datepicker-rtl"),e===t.datepicker._curInst&&t.datepicker._datepickerShowing&&t.datepicker._shouldFocusInput(e)&&e.input.trigger("focus"),e.yearshtml&&(i=e.yearshtml,setTimeout(function(){i===e.yearshtml&&e.yearshtml&&e.dpDiv.find("select.ui-datepicker-year:first").replaceWith(e.yearshtml),i=e.yearshtml=null},0))},_shouldFocusInput:function(t){return t.input&&t.input.is(":visible")&&!t.input.is(":disabled")&&!t.input.is(":focus")},_checkOffset:function(e,i,s){var n=e.dpDiv.outerWidth(),o=e.dpDiv.outerHeight(),a=e.input?e.input.outerWidth():0,r=e.input?e.input.outerHeight():0,l=document.documentElement.clientWidth+(s?0:t(document).scrollLeft()),h=document.documentElement.clientHeight+(s?0:t(document).scrollTop());return i.left-=this._get(e,"isRTL")?n-a:0,i.left-=s&&i.left===e.input.offset().left?t(document).scrollLeft():0,i.top-=s&&i.top===e.input.offset().top+r?t(document).scrollTop():0,i.left-=Math.min(i.left,i.left+n>l&&l>n?Math.abs(i.left+n-l):0),i.top-=Math.min(i.top,i.top+o>h&&h>o?Math.abs(o+r):0),i},_findPos:function(e){for(var i,s=this._getInst(e),n=this._get(s,"isRTL");e&&("hidden"===e.type||1!==e.nodeType||t.expr.filters.hidden(e));)e=e[n?"previousSibling":"nextSibling"];return i=t(e).offset(),[i.left,i.top]},_hideDatepicker:function(e){var i,s,n,o,a=this._curInst;!a||e&&a!==t.data(e,"datepicker")||this._datepickerShowing&&(i=this._get(a,"showAnim"),s=this._get(a,"duration"),n=function(){t.datepicker._tidyDialog(a)},t.effects&&(t.effects.effect[i]||t.effects[i])?a.dpDiv.hide(i,t.datepicker._get(a,"showOptions"),s,n):a.dpDiv["slideDown"===i?"slideUp":"fadeIn"===i?"fadeOut":"hide"](i?s:null,n),i||n(),this._datepickerShowing=!1,o=this._get(a,"onClose"),o&&o.apply(a.input?a.input[0]:null,[a.input?a.input.val():"",a]),this._lastInput=null,this._inDialog&&(this._dialogInput.css({position:"absolute",left:"0",top:"-100px"}),t.blockUI&&(t.unblockUI(),t("body").append(this.dpDiv))),this._inDialog=!1)},_tidyDialog:function(t){t.dpDiv.removeClass(this._dialogClass).off(".ui-datepicker-calendar")},_checkExternalClick:function(e){if(t.datepicker._curInst){var i=t(e.target),s=t.datepicker._getInst(i[0]);(i[0].id!==t.datepicker._mainDivId&&0===i.parents("#"+t.datepicker._mainDivId).length&&!i.hasClass(t.datepicker.markerClassName)&&!i.closest("."+t.datepicker._triggerClass).length&&t.datepicker._datepickerShowing&&(!t.datepicker._inDialog||!t.blockUI)||i.hasClass(t.datepicker.markerClassName)&&t.datepicker._curInst!==s)&&t.datepicker._hideDatepicker()}},_adjustDate:function(e,i,s){var n=t(e),o=this._getInst(n[0]);this._isDisabledDatepicker(n[0])||(this._adjustInstDate(o,i+("M"===s?this._get(o,"showCurrentAtPos"):0),s),this._updateDatepicker(o))},_gotoToday:function(e){var i,s=t(e),n=this._getInst(s[0]);this._get(n,"gotoCurrent")&&n.currentDay?(n.selectedDay=n.currentDay,n.drawMonth=n.selectedMonth=n.currentMonth,n.drawYear=n.selectedYear=n.currentYear):(i=new Date,n.selectedDay=i.getDate(),n.drawMonth=n.selectedMonth=i.getMonth(),n.drawYear=n.selectedYear=i.getFullYear()),this._notifyChange(n),this._adjustDate(s)},_selectMonthYear:function(e,i,s){var n=t(e),o=this._getInst(n[0]);o["selected"+("M"===s?"Month":"Year")]=o["draw"+("M"===s?"Month":"Year")]=parseInt(i.options[i.selectedIndex].value,10),this._notifyChange(o),this._adjustDate(n)},_selectDay:function(e,i,s,n){var o,a=t(e);t(n).hasClass(this._unselectableClass)||this._isDisabledDatepicker(a[0])||(o=this._getInst(a[0]),o.selectedDay=o.currentDay=t("a",n).html(),o.selectedMonth=o.currentMonth=i,o.selectedYear=o.currentYear=s,this._selectDate(e,this._formatDate(o,o.currentDay,o.currentMonth,o.currentYear)))},_clearDate:function(e){var i=t(e);this._selectDate(i,"")},_selectDate:function(e,i){var s,n=t(e),o=this._getInst(n[0]);i=null!=i?i:this._formatDate(o),o.input&&o.input.val(i),this._updateAlternate(o),s=this._get(o,"onSelect"),s?s.apply(o.input?o.input[0]:null,[i,o]):o.input&&o.input.trigger("change"),o.inline?this._updateDatepicker(o):(this._hideDatepicker(),this._lastInput=o.input[0],"object"!=typeof o.input[0]&&o.input.trigger("focus"),this._lastInput=null)},_updateAlternate:function(e){var i,s,n,o=this._get(e,"altField");o&&(i=this._get(e,"altFormat")||this._get(e,"dateFormat"),s=this._getDate(e),n=this.formatDate(i,s,this._getFormatConfig(e)),t(o).val(n))},noWeekends:function(t){var e=t.getDay();return[e>0&&6>e,""]},iso8601Week:function(t){var e,i=new Date(t.getTime());return i.setDate(i.getDate()+4-(i.getDay()||7)),e=i.getTime(),i.setMonth(0),i.setDate(1),Math.floor(Math.round((e-i)/864e5)/7)+1},parseDate:function(e,i,s){if(null==e||null==i)throw"Invalid arguments";if(i="object"==typeof i?""+i:i+"",""===i)return null;var n,o,a,r,l=0,h=(s?s.shortYearCutoff:null)||this._defaults.shortYearCutoff,c="string"!=typeof h?h:(new Date).getFullYear()%100+parseInt(h,10),u=(s?s.dayNamesShort:null)||this._defaults.dayNamesShort,d=(s?s.dayNames:null)||this._defaults.dayNames,p=(s?s.monthNamesShort:null)||this._defaults.monthNamesShort,f=(s?s.monthNames:null)||this._defaults.monthNames,g=-1,m=-1,_=-1,v=-1,b=!1,y=function(t){var i=e.length>n+1&&e.charAt(n+1)===t;return i&&n++,i},w=function(t){var e=y(t),s="@"===t?14:"!"===t?20:"y"===t&&e?4:"o"===t?3:2,n="y"===t?s:1,o=RegExp("^\\d{"+n+","+s+"}"),a=i.substring(l).match(o);if(!a)throw"Missing number at position "+l;return l+=a[0].length,parseInt(a[0],10)},k=function(e,s,n){var o=-1,a=t.map(y(e)?n:s,function(t,e){return[[e,t]]}).sort(function(t,e){return-(t[1].length-e[1].length)});if(t.each(a,function(t,e){var s=e[1];return i.substr(l,s.length).toLowerCase()===s.toLowerCase()?(o=e[0],l+=s.length,!1):void 0}),-1!==o)return o+1;throw"Unknown name at position "+l},x=function(){if(i.charAt(l)!==e.charAt(n))throw"Unexpected literal at position "+l;l++};for(n=0;e.length>n;n++)if(b)"'"!==e.charAt(n)||y("'")?x():b=!1;else switch(e.charAt(n)){case"d":_=w("d");break;case"D":k("D",u,d);break;case"o":v=w("o");break;case"m":m=w("m");break;case"M":m=k("M",p,f);break;case"y":g=w("y");break;case"@":r=new Date(w("@")),g=r.getFullYear(),m=r.getMonth()+1,_=r.getDate();break;case"!":r=new Date((w("!")-this._ticksTo1970)/1e4),g=r.getFullYear(),m=r.getMonth()+1,_=r.getDate();break;case"'":y("'")?x():b=!0;break;default:x()}if(i.length>l&&(a=i.substr(l),!/^\s+/.test(a)))throw"Extra/unparsed characters found in date: "+a;if(-1===g?g=(new Date).getFullYear():100>g&&(g+=(new Date).getFullYear()-(new Date).getFullYear()%100+(c>=g?0:-100)),v>-1)for(m=1,_=v;;){if(o=this._getDaysInMonth(g,m-1),o>=_)break;m++,_-=o}if(r=this._daylightSavingAdjust(new Date(g,m-1,_)),r.getFullYear()!==g||r.getMonth()+1!==m||r.getDate()!==_)throw"Invalid date";return r},ATOM:"yy-mm-dd",COOKIE:"D, dd M yy",ISO_8601:"yy-mm-dd",RFC_822:"D, d M y",RFC_850:"DD, dd-M-y",RFC_1036:"D, d M y",RFC_1123:"D, d M yy",RFC_2822:"D, d M yy",RSS:"D, d M y",TICKS:"!",TIMESTAMP:"@",W3C:"yy-mm-dd",_ticksTo1970:1e7*60*60*24*(718685+Math.floor(492.5)-Math.floor(19.7)+Math.floor(4.925)),formatDate:function(t,e,i){if(!e)return"";var s,n=(i?i.dayNamesShort:null)||this._defaults.dayNamesShort,o=(i?i.dayNames:null)||this._defaults.dayNames,a=(i?i.monthNamesShort:null)||this._defaults.monthNamesShort,r=(i?i.monthNames:null)||this._defaults.monthNames,l=function(e){var i=t.length>s+1&&t.charAt(s+1)===e;return i&&s++,i},h=function(t,e,i){var s=""+e;if(l(t))for(;i>s.length;)s="0"+s;return s},c=function(t,e,i,s){return l(t)?s[e]:i[e]},u="",d=!1;if(e)for(s=0;t.length>s;s++)if(d)"'"!==t.charAt(s)||l("'")?u+=t.charAt(s):d=!1;else switch(t.charAt(s)){case"d":u+=h("d",e.getDate(),2);break;case"D":u+=c("D",e.getDay(),n,o);break;case"o":u+=h("o",Math.round((new Date(e.getFullYear(),e.getMonth(),e.getDate()).getTime()-new Date(e.getFullYear(),0,0).getTime())/864e5),3);break;case"m":u+=h("m",e.getMonth()+1,2);break;case"M":u+=c("M",e.getMonth(),a,r);break;case"y":u+=l("y")?e.getFullYear():(10>e.getFullYear()%100?"0":"")+e.getFullYear()%100;break;case"@":u+=e.getTime();break;case"!":u+=1e4*e.getTime()+this._ticksTo1970;break;case"'":l("'")?u+="'":d=!0;break;default:u+=t.charAt(s)}return u},_possibleChars:function(t){var e,i="",s=!1,n=function(i){var s=t.length>e+1&&t.charAt(e+1)===i;return s&&e++,s};for(e=0;t.length>e;e++)if(s)"'"!==t.charAt(e)||n("'")?i+=t.charAt(e):s=!1;else switch(t.charAt(e)){case"d":case"m":case"y":case"@":i+="0123456789";break;case"D":case"M":return null;case"'":n("'")?i+="'":s=!0;break;default:i+=t.charAt(e)}return i},_get:function(t,e){return void 0!==t.settings[e]?t.settings[e]:this._defaults[e]},_setDateFromField:function(t,e){if(t.input.val()!==t.lastVal){var i=this._get(t,"dateFormat"),s=t.lastVal=t.input?t.input.val():null,n=this._getDefaultDate(t),o=n,a=this._getFormatConfig(t);try{o=this.parseDate(i,s,a)||n}catch(r){s=e?"":s}t.selectedDay=o.getDate(),t.drawMonth=t.selectedMonth=o.getMonth(),t.drawYear=t.selectedYear=o.getFullYear(),t.currentDay=s?o.getDate():0,t.currentMonth=s?o.getMonth():0,t.currentYear=s?o.getFullYear():0,this._adjustInstDate(t)}},_getDefaultDate:function(t){return this._restrictMinMax(t,this._determineDate(t,this._get(t,"defaultDate"),new Date))},_determineDate:function(e,i,s){var n=function(t){var e=new Date;return e.setDate(e.getDate()+t),e},o=function(i){try{return t.datepicker.parseDate(t.datepicker._get(e,"dateFormat"),i,t.datepicker._getFormatConfig(e))}catch(s){}for(var n=(i.toLowerCase().match(/^c/)?t.datepicker._getDate(e):null)||new Date,o=n.getFullYear(),a=n.getMonth(),r=n.getDate(),l=/([+\-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g,h=l.exec(i);h;){switch(h[2]||"d"){case"d":case"D":r+=parseInt(h[1],10);break;case"w":case"W":r+=7*parseInt(h[1],10);break;case"m":case"M":a+=parseInt(h[1],10),r=Math.min(r,t.datepicker._getDaysInMonth(o,a));break;case"y":case"Y":o+=parseInt(h[1],10),r=Math.min(r,t.datepicker._getDaysInMonth(o,a))}h=l.exec(i)}return new Date(o,a,r)},a=null==i||""===i?s:"string"==typeof i?o(i):"number"==typeof i?isNaN(i)?s:n(i):new Date(i.getTime());return a=a&&"Invalid Date"==""+a?s:a,a&&(a.setHours(0),a.setMinutes(0),a.setSeconds(0),a.setMilliseconds(0)),this._daylightSavingAdjust(a)},_daylightSavingAdjust:function(t){return t?(t.setHours(t.getHours()>12?t.getHours()+2:0),t):null},_setDate:function(t,e,i){var s=!e,n=t.selectedMonth,o=t.selectedYear,a=this._restrictMinMax(t,this._determineDate(t,e,new Date));t.selectedDay=t.currentDay=a.getDate(),t.drawMonth=t.selectedMonth=t.currentMonth=a.getMonth(),t.drawYear=t.selectedYear=t.currentYear=a.getFullYear(),n===t.selectedMonth&&o===t.selectedYear||i||this._notifyChange(t),this._adjustInstDate(t),t.input&&t.input.val(s?"":this._formatDate(t))},_getDate:function(t){var e=!t.currentYear||t.input&&""===t.input.val()?null:this._daylightSavingAdjust(new Date(t.currentYear,t.currentMonth,t.currentDay));return e},_attachHandlers:function(e){var i=this._get(e,"stepMonths"),s="#"+e.id.replace(/\\\\/g,"\\");e.dpDiv.find("[data-handler]").map(function(){var e={prev:function(){t.datepicker._adjustDate(s,-i,"M")},next:function(){t.datepicker._adjustDate(s,+i,"M")},hide:function(){t.datepicker._hideDatepicker()},today:function(){t.datepicker._gotoToday(s)},selectDay:function(){return t.datepicker._selectDay(s,+this.getAttribute("data-month"),+this.getAttribute("data-year"),this),!1},selectMonth:function(){return t.datepicker._selectMonthYear(s,this,"M"),!1},selectYear:function(){return t.datepicker._selectMonthYear(s,this,"Y"),!1}};t(this).on(this.getAttribute("data-event"),e[this.getAttribute("data-handler")])})},_generateHTML:function(t){var e,i,s,n,o,a,r,l,h,c,u,d,p,f,g,m,_,v,b,y,w,k,x,C,D,T,I,M,P,S,N,H,A,z,O,E,W,F,L,R=new Date,Y=this._daylightSavingAdjust(new Date(R.getFullYear(),R.getMonth(),R.getDate())),B=this._get(t,"isRTL"),j=this._get(t,"showButtonPanel"),q=this._get(t,"hideIfNoPrevNext"),K=this._get(t,"navigationAsDateFormat"),U=this._getNumberOfMonths(t),V=this._get(t,"showCurrentAtPos"),X=this._get(t,"stepMonths"),$=1!==U[0]||1!==U[1],G=this._daylightSavingAdjust(t.currentDay?new Date(t.currentYear,t.currentMonth,t.currentDay):new Date(9999,9,9)),J=this._getMinMaxDate(t,"min"),Q=this._getMinMaxDate(t,"max"),Z=t.drawMonth-V,te=t.drawYear;if(0>Z&&(Z+=12,te--),Q)for(e=this._daylightSavingAdjust(new Date(Q.getFullYear(),Q.getMonth()-U[0]*U[1]+1,Q.getDate())),e=J&&J>e?J:e;this._daylightSavingAdjust(new Date(te,Z,1))>e;)Z--,0>Z&&(Z=11,te--);for(t.drawMonth=Z,t.drawYear=te,i=this._get(t,"prevText"),i=K?this.formatDate(i,this._daylightSavingAdjust(new Date(te,Z-X,1)),this._getFormatConfig(t)):i,s=this._canAdjustMonth(t,-1,te,Z)?"<a class='ui-datepicker-prev ui-corner-all' data-handler='prev' data-event='click' title='"+i+"'><span class='ui-icon ui-icon-circle-triangle-"+(B?"e":"w")+"'>"+i+"</span></a>":q?"":"<a class='ui-datepicker-prev ui-corner-all ui-state-disabled' title='"+i+"'><span class='ui-icon ui-icon-circle-triangle-"+(B?"e":"w")+"'>"+i+"</span></a>",n=this._get(t,"nextText"),n=K?this.formatDate(n,this._daylightSavingAdjust(new Date(te,Z+X,1)),this._getFormatConfig(t)):n,o=this._canAdjustMonth(t,1,te,Z)?"<a class='ui-datepicker-next ui-corner-all' data-handler='next' data-event='click' title='"+n+"'><span class='ui-icon ui-icon-circle-triangle-"+(B?"w":"e")+"'>"+n+"</span></a>":q?"":"<a class='ui-datepicker-next ui-corner-all ui-state-disabled' title='"+n+"'><span class='ui-icon ui-icon-circle-triangle-"+(B?"w":"e")+"'>"+n+"</span></a>",a=this._get(t,"currentText"),r=this._get(t,"gotoCurrent")&&t.currentDay?G:Y,a=K?this.formatDate(a,r,this._getFormatConfig(t)):a,l=t.inline?"":"<button type='button' class='ui-datepicker-close ui-state-default ui-priority-primary ui-corner-all' data-handler='hide' data-event='click'>"+this._get(t,"closeText")+"</button>",h=j?"<div class='ui-datepicker-buttonpane ui-widget-content'>"+(B?l:"")+(this._isInRange(t,r)?"<button type='button' class='ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all' data-handler='today' data-event='click'>"+a+"</button>":"")+(B?"":l)+"</div>":"",c=parseInt(this._get(t,"firstDay"),10),c=isNaN(c)?0:c,u=this._get(t,"showWeek"),d=this._get(t,"dayNames"),p=this._get(t,"dayNamesMin"),f=this._get(t,"monthNames"),g=this._get(t,"monthNamesShort"),m=this._get(t,"beforeShowDay"),_=this._get(t,"showOtherMonths"),v=this._get(t,"selectOtherMonths"),b=this._getDefaultDate(t),y="",k=0;U[0]>k;k++){for(x="",this.maxRows=4,C=0;U[1]>C;C++){if(D=this._daylightSavingAdjust(new Date(te,Z,t.selectedDay)),T=" ui-corner-all",I="",$){if(I+="<div class='ui-datepicker-group",U[1]>1)switch(C){case 0:I+=" ui-datepicker-group-first",T=" ui-corner-"+(B?"right":"left");break;case U[1]-1:I+=" ui-datepicker-group-last",T=" ui-corner-"+(B?"left":"right");break;default:I+=" ui-datepicker-group-middle",T=""}I+="'>"}for(I+="<div class='ui-datepicker-header ui-widget-header ui-helper-clearfix"+T+"'>"+(/all|left/.test(T)&&0===k?B?o:s:"")+(/all|right/.test(T)&&0===k?B?s:o:"")+this._generateMonthYearHeader(t,Z,te,J,Q,k>0||C>0,f,g)+"</div><table class='ui-datepicker-calendar'><thead>"+"<tr>",M=u?"<th class='ui-datepicker-week-col'>"+this._get(t,"weekHeader")+"</th>":"",w=0;7>w;w++)P=(w+c)%7,M+="<th scope='col'"+((w+c+6)%7>=5?" class='ui-datepicker-week-end'":"")+">"+"<span title='"+d[P]+"'>"+p[P]+"</span></th>";for(I+=M+"</tr></thead><tbody>",S=this._getDaysInMonth(te,Z),te===t.selectedYear&&Z===t.selectedMonth&&(t.selectedDay=Math.min(t.selectedDay,S)),N=(this._getFirstDayOfMonth(te,Z)-c+7)%7,H=Math.ceil((N+S)/7),A=$?this.maxRows>H?this.maxRows:H:H,this.maxRows=A,z=this._daylightSavingAdjust(new Date(te,Z,1-N)),O=0;A>O;O++){for(I+="<tr>",E=u?"<td class='ui-datepicker-week-col'>"+this._get(t,"calculateWeek")(z)+"</td>":"",w=0;7>w;w++)W=m?m.apply(t.input?t.input[0]:null,[z]):[!0,""],F=z.getMonth()!==Z,L=F&&!v||!W[0]||J&&J>z||Q&&z>Q,E+="<td class='"+((w+c+6)%7>=5?" ui-datepicker-week-end":"")+(F?" ui-datepicker-other-month":"")+(z.getTime()===D.getTime()&&Z===t.selectedMonth&&t._keyEvent||b.getTime()===z.getTime()&&b.getTime()===D.getTime()?" "+this._dayOverClass:"")+(L?" "+this._unselectableClass+" ui-state-disabled":"")+(F&&!_?"":" "+W[1]+(z.getTime()===G.getTime()?" "+this._currentClass:"")+(z.getTime()===Y.getTime()?" ui-datepicker-today":""))+"'"+(F&&!_||!W[2]?"":" title='"+W[2].replace(/'/g,"&#39;")+"'")+(L?"":" data-handler='selectDay' data-event='click' data-month='"+z.getMonth()+"' data-year='"+z.getFullYear()+"'")+">"+(F&&!_?"&#xa0;":L?"<span class='ui-state-default'>"+z.getDate()+"</span>":"<a class='ui-state-default"+(z.getTime()===Y.getTime()?" ui-state-highlight":"")+(z.getTime()===G.getTime()?" ui-state-active":"")+(F?" ui-priority-secondary":"")+"' href='#'>"+z.getDate()+"</a>")+"</td>",z.setDate(z.getDate()+1),z=this._daylightSavingAdjust(z);
I+=E+"</tr>"}Z++,Z>11&&(Z=0,te++),I+="</tbody></table>"+($?"</div>"+(U[0]>0&&C===U[1]-1?"<div class='ui-datepicker-row-break'></div>":""):""),x+=I}y+=x}return y+=h,t._keyEvent=!1,y},_generateMonthYearHeader:function(t,e,i,s,n,o,a,r){var l,h,c,u,d,p,f,g,m=this._get(t,"changeMonth"),_=this._get(t,"changeYear"),v=this._get(t,"showMonthAfterYear"),b="<div class='ui-datepicker-title'>",y="";if(o||!m)y+="<span class='ui-datepicker-month'>"+a[e]+"</span>";else{for(l=s&&s.getFullYear()===i,h=n&&n.getFullYear()===i,y+="<select class='ui-datepicker-month' data-handler='selectMonth' data-event='change'>",c=0;12>c;c++)(!l||c>=s.getMonth())&&(!h||n.getMonth()>=c)&&(y+="<option value='"+c+"'"+(c===e?" selected='selected'":"")+">"+r[c]+"</option>");y+="</select>"}if(v||(b+=y+(!o&&m&&_?"":"&#xa0;")),!t.yearshtml)if(t.yearshtml="",o||!_)b+="<span class='ui-datepicker-year'>"+i+"</span>";else{for(u=this._get(t,"yearRange").split(":"),d=(new Date).getFullYear(),p=function(t){var e=t.match(/c[+\-].*/)?i+parseInt(t.substring(1),10):t.match(/[+\-].*/)?d+parseInt(t,10):parseInt(t,10);return isNaN(e)?d:e},f=p(u[0]),g=Math.max(f,p(u[1]||"")),f=s?Math.max(f,s.getFullYear()):f,g=n?Math.min(g,n.getFullYear()):g,t.yearshtml+="<select class='ui-datepicker-year' data-handler='selectYear' data-event='change'>";g>=f;f++)t.yearshtml+="<option value='"+f+"'"+(f===i?" selected='selected'":"")+">"+f+"</option>";t.yearshtml+="</select>",b+=t.yearshtml,t.yearshtml=null}return b+=this._get(t,"yearSuffix"),v&&(b+=(!o&&m&&_?"":"&#xa0;")+y),b+="</div>"},_adjustInstDate:function(t,e,i){var s=t.selectedYear+("Y"===i?e:0),n=t.selectedMonth+("M"===i?e:0),o=Math.min(t.selectedDay,this._getDaysInMonth(s,n))+("D"===i?e:0),a=this._restrictMinMax(t,this._daylightSavingAdjust(new Date(s,n,o)));t.selectedDay=a.getDate(),t.drawMonth=t.selectedMonth=a.getMonth(),t.drawYear=t.selectedYear=a.getFullYear(),("M"===i||"Y"===i)&&this._notifyChange(t)},_restrictMinMax:function(t,e){var i=this._getMinMaxDate(t,"min"),s=this._getMinMaxDate(t,"max"),n=i&&i>e?i:e;return s&&n>s?s:n},_notifyChange:function(t){var e=this._get(t,"onChangeMonthYear");e&&e.apply(t.input?t.input[0]:null,[t.selectedYear,t.selectedMonth+1,t])},_getNumberOfMonths:function(t){var e=this._get(t,"numberOfMonths");return null==e?[1,1]:"number"==typeof e?[1,e]:e},_getMinMaxDate:function(t,e){return this._determineDate(t,this._get(t,e+"Date"),null)},_getDaysInMonth:function(t,e){return 32-this._daylightSavingAdjust(new Date(t,e,32)).getDate()},_getFirstDayOfMonth:function(t,e){return new Date(t,e,1).getDay()},_canAdjustMonth:function(t,e,i,s){var n=this._getNumberOfMonths(t),o=this._daylightSavingAdjust(new Date(i,s+(0>e?e:n[0]*n[1]),1));return 0>e&&o.setDate(this._getDaysInMonth(o.getFullYear(),o.getMonth())),this._isInRange(t,o)},_isInRange:function(t,e){var i,s,n=this._getMinMaxDate(t,"min"),o=this._getMinMaxDate(t,"max"),a=null,r=null,l=this._get(t,"yearRange");return l&&(i=l.split(":"),s=(new Date).getFullYear(),a=parseInt(i[0],10),r=parseInt(i[1],10),i[0].match(/[+\-].*/)&&(a+=s),i[1].match(/[+\-].*/)&&(r+=s)),(!n||e.getTime()>=n.getTime())&&(!o||e.getTime()<=o.getTime())&&(!a||e.getFullYear()>=a)&&(!r||r>=e.getFullYear())},_getFormatConfig:function(t){var e=this._get(t,"shortYearCutoff");return e="string"!=typeof e?e:(new Date).getFullYear()%100+parseInt(e,10),{shortYearCutoff:e,dayNamesShort:this._get(t,"dayNamesShort"),dayNames:this._get(t,"dayNames"),monthNamesShort:this._get(t,"monthNamesShort"),monthNames:this._get(t,"monthNames")}},_formatDate:function(t,e,i,s){e||(t.currentDay=t.selectedDay,t.currentMonth=t.selectedMonth,t.currentYear=t.selectedYear);var n=e?"object"==typeof e?e:this._daylightSavingAdjust(new Date(s,i,e)):this._daylightSavingAdjust(new Date(t.currentYear,t.currentMonth,t.currentDay));return this.formatDate(this._get(t,"dateFormat"),n,this._getFormatConfig(t))}}),t.fn.datepicker=function(e){if(!this.length)return this;t.datepicker.initialized||(t(document).on("mousedown",t.datepicker._checkExternalClick),t.datepicker.initialized=!0),0===t("#"+t.datepicker._mainDivId).length&&t("body").append(t.datepicker.dpDiv);var i=Array.prototype.slice.call(arguments,1);return"string"!=typeof e||"isDisabled"!==e&&"getDate"!==e&&"widget"!==e?"option"===e&&2===arguments.length&&"string"==typeof arguments[1]?t.datepicker["_"+e+"Datepicker"].apply(t.datepicker,[this[0]].concat(i)):this.each(function(){"string"==typeof e?t.datepicker["_"+e+"Datepicker"].apply(t.datepicker,[this].concat(i)):t.datepicker._attachDatepicker(this,e)}):t.datepicker["_"+e+"Datepicker"].apply(t.datepicker,[this[0]].concat(i))},t.datepicker=new s,t.datepicker.initialized=!1,t.datepicker.uuid=(new Date).getTime(),t.datepicker.version="1.12.1",t.datepicker});
}); })(V3);
var V3;
if(!V3){V3={__namespace:true};}
(function(V3){ V3.RegisterFile('jQuery.UI.Uniform', 1.009002, [{ Filename: 'jQuery', Version: 1.007001 }, { Filename: 'jQuery.UI', Version: 1.009002 }], function (V3) {
//DP: modifiedy char position: 2401, was .text(), now .html()
//DP: added 2x: (a.browser&&) because jQuery 3.0 no longer providers .browser[msie] detection.
//DP: was .attr(), now .prop()
(function(a){a.uniform={options:{selectClass:"selector",radioClass:"radio",checkboxClass:"checker",fileClass:"uploader",filenameClass:"filename",fileBtnClass:"action",fileDefaultText:"No file selected",fileBtnText:"Choose File",checkedClass:"checked",focusClass:"focus",disabledClass:"disabled",buttonClass:"button",activeClass:"active",hoverClass:"hover",useID:true,idPrefix:"uniform",resetSelector:false,autoHide:true},elements:[]};if(a.browser&&a.browser.msie&&a.browser.version<7){a.support.selectOpacity=false}else{a.support.selectOpacity=true}a.fn.uniform=function(k){k=a.extend(a.uniform.options,k);var d=this;if(k.resetSelector!=false){a(k.resetSelector).mouseup(function(){function l(){a.uniform.update(d)}setTimeout(l,10)})}function j(l){$el=a(l);$el.addClass($el.prop("type"));b(l)}function g(l){a(l).addClass("uniform");b(l)}function i(o){var m=a(o);var p=a("<div>"),l=a("<span>");p.addClass(k.buttonClass);if(k.useID&&m.prop("id")!=""){p.prop("id",k.idPrefix+"-"+m.prop("id"))}var n;if(m.is("a")||m.is("button")){n=m.text()}else{if(m.is(":submit")||m.is(":reset")||m.is("input[type=button]")){n=m.prop("value")}}n=n==""?m.is(":reset")?"Reset":"Submit":n;l.html(n);m.css("opacity",0);m.wrap(p);m.wrap(l);p=m.closest("div");l=m.closest("span");if(m.is(":disabled")){p.addClass(k.disabledClass)}p.bind({"mouseenter.uniform":function(){p.addClass(k.hoverClass)},"mouseleave.uniform":function(){p.removeClass(k.hoverClass);p.removeClass(k.activeClass)},"mousedown.uniform touchbegin.uniform":function(){p.addClass(k.activeClass)},"mouseup.uniform touchend.uniform":function(){p.removeClass(k.activeClass)},"click.uniform touchend.uniform":function(r){if(a(r.target).is("span")||a(r.target).is("div")){if(o[0].dispatchEvent){var q=document.createEvent("MouseEvents");q.initEvent("click",true,true);o[0].dispatchEvent(q)}else{o[0].click()}}}});o.bind({"focus.uniform":function(){p.addClass(k.focusClass)},"blur.uniform":function(){p.removeClass(k.focusClass)}});a.uniform.noSelect(p);b(o)}function e(o){var m=a(o);var p=a("<div />"),l=a("<span />");if(!m.css("display")=="none"&&k.autoHide){p.hide()}p.addClass(k.selectClass);if(k.useID&&o.prop("id")!=""){p.prop("id",k.idPrefix+"-"+o.prop("id"))}var n=o.find(":selected:first");if(n.length==0){n=o.find("option:first")}l.html(n.html());o.css("opacity",0);o.wrap(p);o.before(l);p=o.parent("div");l=o.siblings("span");o.bind({"change.uniform":function(){l.html(o.find(":selected").html());p.removeClass(k.activeClass)},"focus.uniform":function(){p.addClass(k.focusClass)},"blur.uniform":function(){p.removeClass(k.focusClass);p.removeClass(k.activeClass)},"mousedown.uniform touchbegin.uniform":function(){p.addClass(k.activeClass)},"mouseup.uniform touchend.uniform":function(){p.removeClass(k.activeClass)},"click.uniform touchend.uniform":function(){p.removeClass(k.activeClass)},"mouseenter.uniform":function(){p.addClass(k.hoverClass)},"mouseleave.uniform":function(){p.removeClass(k.hoverClass);p.removeClass(k.activeClass)},"keyup.uniform":function(){l.text(o.find(":selected").html())}});if(a(o).prop("disabled")){p.addClass(k.disabledClass)}a.uniform.noSelect(l);b(o)}function f(n){var m=a(n);var o=a("<div />"),l=a("<span />");if(!m.css("display")=="none"&&k.autoHide){o.hide()}o.addClass(k.checkboxClass);if(k.useID&&n.prop("id")!=""){o.prop("id",k.idPrefix+"-"+n.prop("id"))}a(n).wrap(o);a(n).wrap(l);l=n.parent();o=l.parent();a(n).css("opacity",0).bind({"focus.uniform":function(){o.addClass(k.focusClass)},"blur.uniform":function(){o.removeClass(k.focusClass)},"click.uniform touchend.uniform":function(){if(!a(n).prop("checked")){l.removeClass(k.checkedClass)}else{l.addClass(k.checkedClass)}},"mousedown.uniform touchbegin.uniform":function(){o.addClass(k.activeClass)},"mouseup.uniform touchend.uniform":function(){o.removeClass(k.activeClass)},"mouseenter.uniform":function(){o.addClass(k.hoverClass)},"mouseleave.uniform":function(){o.removeClass(k.hoverClass);o.removeClass(k.activeClass)}});if(a(n).prop("checked")){l.addClass(k.checkedClass)}if(a(n).prop("disabled")){o.addClass(k.disabledClass)}b(n)}function c(n){var m=a(n);var o=a("<div />"),l=a("<span />");if(!m.css("display")=="none"&&k.autoHide){o.hide()}o.addClass(k.radioClass);if(k.useID&&n.prop("id")!=""){o.prop("id",k.idPrefix+"-"+n.prop("id"))}a(n).wrap(o);a(n).wrap(l);l=n.parent();o=l.parent();a(n).css("opacity",0).bind({"focus.uniform":function(){o.addClass(k.focusClass)},"blur.uniform":function(){o.removeClass(k.focusClass)},"click.uniform touchend.uniform":function(){if(!a(n).prop("checked")){l.removeClass(k.checkedClass)}else{var p=k.radioClass.split(" ")[0];a("."+p+" span."+k.checkedClass+":has([name='"+a(n).prop("name")+"'])").removeClass(k.checkedClass);l.addClass(k.checkedClass)}},"mousedown.uniform touchend.uniform":function(){if(!a(n).is(":disabled")){o.addClass(k.activeClass)}},"mouseup.uniform touchbegin.uniform":function(){o.removeClass(k.activeClass)},"mouseenter.uniform touchend.uniform":function(){o.addClass(k.hoverClass)},"mouseleave.uniform":function(){o.removeClass(k.hoverClass);o.removeClass(k.activeClass)}});if(a(n).prop("checked")){l.addClass(k.checkedClass)}if(a(n).prop("disabled")){o.addClass(k.disabledClass)}b(n)}function h(q){var o=a(q);var r=a("<div />"),p=a("<span>"+k.fileDefaultText+"</span>"),m=a("<span>"+k.fileBtnText+"</span>");if(!o.css("display")=="none"&&k.autoHide){r.hide()}r.addClass(k.fileClass);p.addClass(k.filenameClass);m.addClass(k.fileBtnClass);if(k.useID&&o.prop("id")!=""){r.prop("id",k.idPrefix+"-"+o.prop("id"))}o.wrap(r);o.after(m);o.after(p);r=o.closest("div");p=o.siblings("."+k.filenameClass);m=o.siblings("."+k.fileBtnClass);if(!o.prop("size")){var l=r.width();o.prop("size",l/10)}var n=function(){var s=o.val();if(s===""){s=k.fileDefaultText}else{s=s.split(/[\/\\]+/);s=s[(s.length-1)]}p.text(s)};n();o.css("opacity",0).bind({"focus.uniform":function(){r.addClass(k.focusClass)},"blur.uniform":function(){r.removeClass(k.focusClass)},"mousedown.uniform":function(){if(!a(q).is(":disabled")){r.addClass(k.activeClass)}},"mouseup.uniform":function(){r.removeClass(k.activeClass)},"mouseenter.uniform":function(){r.addClass(k.hoverClass)},"mouseleave.uniform":function(){r.removeClass(k.hoverClass);r.removeClass(k.activeClass)}});if(a.browser&&a.browser.msie){o.bind("click.uniform.ie7",function(){setTimeout(n,0)})}else{o.bind("change.uniform",n)}if(o.prop("disabled")){r.addClass(k.disabledClass)}a.uniform.noSelect(p);a.uniform.noSelect(m);b(q)}a.uniform.restore=function(l){if(l==undefined){l=a(a.uniform.elements)}a(l).each(function(){if(a(this).is(":checkbox")){a(this).unwrap().unwrap()}else{if(a(this).is("select")){a(this).siblings("span").remove();a(this).unwrap()}else{if(a(this).is(":radio")){a(this).unwrap().unwrap()}else{if(a(this).is(":file")){a(this).siblings("span").remove();a(this).unwrap()}else{if(a(this).is("button, :submit, :reset, a, input[type='button']")){a(this).unwrap().unwrap()}}}}}a(this).unbind(".uniform");a(this).css("opacity","1");var m=a.inArray(a(l),a.uniform.elements);a.uniform.elements.splice(m,1)})};function b(l){l=a(l).get();if(l.length>1){a.each(l,function(m,n){a.uniform.elements.push(n)})}else{a.uniform.elements.push(l)}}a.uniform.noSelect=function(l){function m(){return false}a(l).each(function(){this.onselectstart=this.ondragstart=m;a(this).mousedown(m).css({MozUserSelect:"none"})})};a.uniform.update=function(l){if(l==undefined){l=a(a.uniform.elements)}l=a(l);l.each(function(){var n=a(this);if(n.is("select")){var m=n.siblings("span");var p=n.parent("div");p.removeClass(k.hoverClass+" "+k.focusClass+" "+k.activeClass);m.html(n.find(":selected").html());if(n.is(":disabled")){p.addClass(k.disabledClass)}else{p.removeClass(k.disabledClass)}}else{if(n.is(":checkbox")){var m=n.closest("span");var p=n.closest("div");p.removeClass(k.hoverClass+" "+k.focusClass+" "+k.activeClass);m.removeClass(k.checkedClass);if(n.is(":checked")){m.addClass(k.checkedClass)}if(n.is(":disabled")){p.addClass(k.disabledClass)}else{p.removeClass(k.disabledClass)}}else{if(n.is(":radio")){var m=n.closest("span");var p=n.closest("div");p.removeClass(k.hoverClass+" "+k.focusClass+" "+k.activeClass);m.removeClass(k.checkedClass);if(n.is(":checked")){m.addClass(k.checkedClass)}if(n.is(":disabled")){p.addClass(k.disabledClass)}else{p.removeClass(k.disabledClass)}}else{if(n.is(":file")){var p=n.parent("div");var o=n.siblings(k.filenameClass);btnTag=n.siblings(k.fileBtnClass);p.removeClass(k.hoverClass+" "+k.focusClass+" "+k.activeClass);o.text(n.val());if(n.is(":disabled")){p.addClass(k.disabledClass)}else{p.removeClass(k.disabledClass)}}else{if(n.is(":submit")||n.is(":reset")||n.is("button")||n.is("a")||l.is("input[type=button]")){var p=n.closest("div");p.removeClass(k.hoverClass+" "+k.focusClass+" "+k.activeClass);if(n.is(":disabled")){p.addClass(k.disabledClass)}else{p.removeClass(k.disabledClass)}}}}}}})};return this.each(function(){if(a.support.selectOpacity){var l=a(this);if(l.is("select")){if(l.prop("multiple")!=true){if(l.prop("size")==undefined||l.prop("size")<=1){e(l)}}}else{if(l.is(":checkbox")){f(l)}else{if(l.is(":radio")){c(l)}else{if(l.is(":file")){h(l)}else{if(l.is(":text, :password, input[type='email']")){j(l)}else{if(l.is("textarea")){g(l)}else{if(l.is("a")||l.is(":submit")||l.is(":reset")||l.is("button")||l.is("input[type=button]")){i(l)}}}}}}}}})}})(V3.jQuery);
}); })(V3);
var V3;
if(!V3){V3={__namespace:true};}
(function(V3){ 
(function(V3){
var serviceName="EntityService";
var serverTimeOffset=0;
if(!V3.WebServices){V3.WebServices={__namespace:true};}
if(!V3.WebServices[serviceName]){ V3.WebServices[serviceName]={__class:true, __static: true};}
(function(objTarget){
function doCall(url, webMethodName, args, onSuccess, onError){
  var notifiedApplication = false;
  var timeOffset;

  function success(parsedObj, httpStatusCode){
    if(!notifiedApplication){ 
      notifiedApplication = true;    
      onSuccess(parsedObj, {httpStatusCode:httpStatusCode, xhr: this});
    }
  }

  function error(parsedObj, httpStatusCode, isParseException){
    if(!notifiedApplication){ 
      notifiedApplication = true;    
  
      var e = {
        xhr: this,
        isParseException: !!isParseException,
        isServerException: !!(!isParseException && parsedObj && parsedObj.Type),
        response: parsedObj,
        toString: function(){
          if(this.isServerException){
            var ex = this.response;
            return ex.Type + ': ' + ex.Message + '\r\n' + ex.StackTrace;
          } else if (this.isParseException) {
            return 'Unable to parse JSON: ' + this.xhr.responseText;
          } else {
            return this.message;
          }
        }
      };

      if (e.isServerException) {
          e.message = (parsedObj.Type + ': ' + parsedObj.Message);
      } else if (e.isParseException) {
          e.message = 'Parse error: ' + parsedObj;
      } else {
          e.message = 'HttpCode: ' + this.statusText;
      }

      eval('debugger //webMethodError, http code: ' + httpStatusCode + ', Is Parse Exception: ' + isParseException);
      if(window.V3 && window.V3.Log && window.V3.Log.Error) { 
        V3.Log.Error('Error while calling Web Method ' + webMethodName + ' on URL: ' + url, 'e', e); 
      }
      onError(e);
    }
  }
  
  function jsonReviver(k, v){
    if (typeof v === 'string' && v.substr(0, 6) === '/Date(') { 
        return new Date(parseInt(v.substr(6, v.length - 8), 10) + timeOffset);
    }
    return v;
  }

  var aborting = false;
  var connector;
  var onLoadCallback = function(connectorState, httpStatusCode){
    if(connectorState == 4){ //DONE and HTTP_OK
      var parsedObj = null;
      if(!aborting && httpStatusCode < 100){
        if (httpStatusCode==0) {
           error.call(this, new Error('Unsent, maybe error with CORS or connection timed out without sending (ie browser limited to 2 connections per origin and both choked all subsequent requests)'), httpStatusCode);
        } else if(httpStatusCode==1) {
           error.call(this, new Error('Connection was Opened but an error occurred'), httpStatusCode);
        } else if(httpStatusCode==2) {
          error.call(this, new Error('Headers were received, but an error occurred.'), httpStatusCode);
        } else{
          error.call(this, new Error('Unknown error'), httpStatusCode);
        }
        return;
      }
      try {
          var localTimeOffset = -(new Date()).getTimezoneOffset() * 60 * 1000;
          timeOffset = (serverTimeOffset - localTimeOffset);
          parsedObj = JSON.parse(this.responseText||'',jsonReviver);
      } catch(exception) {
          if(!aborting){
            error.call(this, exception, httpStatusCode, true);
            return;
          }
      }

      if(aborting){
        if(V3.debugMode && window.V3 && window.V3.Log && window.V3.Log.Info){
          window.V3.Log.Warn('Aborting web service request.','details', {'arguments':args, 'responseText':this.responseText, 'parsedResponse': parsedObj, 'xhr': connector}, true);
        }
        return;
      }
      
      if(V3.debugMode && window.V3 && window.V3.Log && window.V3.Log.Info){
        window.V3.Log.Info('RECEIVED ' + (this.responseText||'').length.toLocaleString() + 'chars from: ' + url,'parsedObj', parsedObj);
      }

      if(httpStatusCode === 200){
        success.call(this, parsedObj.hasOwnProperty('d') ? parsedObj.d : parsedObj, httpStatusCode);
      } else {
        error.call(this, parsedObj, httpStatusCode, false);
      }
    }
  };
  

  if (window.XDomainRequest && navigator.userAgent.match(/MSIE 9\./)) {
    connector = new XDomainRequest();
    connector.contentType = 'text/plain';
    connector.onload = function(){ onLoadCallback.call(this, 4, 200); };
    connector.onprogress = function(){}; 
    connector.open('POST', url, true);
  } else {
    connector = new XMLHttpRequest();
    connector.onreadystatechange = function(){ onLoadCallback.call(this, this.readyState, this.status); }
    connector.open('POST', url, true);
    connector.setRequestHeader('Content-Type', 'application/json; charset=utf-8');
    connector.setRequestHeader('Accept', 'application/json; charset=utf-8');
  }
  connector.timeout=timeoutValue;
  connector.ontimeout=function(){ error.call(this, new Error('timed-out')); };
  connector.onerror =function(e){ error.call(this, e||event); };

  var json=JSON.stringify(args);

  if(V3.debugMode && window.V3 && window.V3.Log && window.V3.Log.Info){
    window.V3.Log.Info('SEND ' + json.length.toLocaleString() + 'chars to: ' + url,'args', args);
  }

  connector.send(json);
  
  return {
    xhr: connector,
    abort: function(){
      aborting = true;
      this.xhr.abort();
    }
  };
}
var timeoutValue=120000;
objTarget.Search=function(onSuccess, onError) { 

  var overload=objTarget['_Search' + (arguments.length-2)];
  if(!overload){throw new Error("No overload found for the method Search where there's " + (arguments.length-2) + " arguments specified.");}
  return overload.apply(this, arguments); 
}; 
objTarget._Search1=function(onSuccess, onError, request) {
var dto={'request':request};var url="https://book.txgb.co.uk/v4/Services/EntityService.jsws/Search?";
return doCall(url, "Search", dto, onSuccess, onError);
};

var timeoutValue=120000;
objTarget.GetChildLocations=function(onSuccess, onError) { 

  var overload=objTarget['_GetChildLocations' + (arguments.length-2)];
  if(!overload){throw new Error("No overload found for the method GetChildLocations where there's " + (arguments.length-2) + " arguments specified.");}
  return overload.apply(this, arguments); 
}; 
objTarget._GetChildLocations1=function(onSuccess, onError, parentLocationId) {
var dto={'parentLocationId':parentLocationId};var url="https://book.txgb.co.uk/v4/Services/EntityService.jsws/GetChildLocations?";
return doCall(url, "GetChildLocations", dto, onSuccess, onError);
};

var timeoutValue=120000;
objTarget.GetPrimaryLocations=function(onSuccess, onError) { 

  var overload=objTarget['_GetPrimaryLocations' + (arguments.length-2)];
  if(!overload){throw new Error("No overload found for the method GetPrimaryLocations where there's " + (arguments.length-2) + " arguments specified.");}
  return overload.apply(this, arguments); 
}; 
objTarget._GetPrimaryLocations1=function(onSuccess, onError, types) {
var dto={'types':types};var url="https://book.txgb.co.uk/v4/Services/EntityService.jsws/GetPrimaryLocations?";
return doCall(url, "GetPrimaryLocations", dto, onSuccess, onError);
};

var timeoutValue=120000;
objTarget.QuickSearch=function(onSuccess, onError) { 

  var overload=objTarget['_QuickSearch' + (arguments.length-2)];
  if(!overload){throw new Error("No overload found for the method QuickSearch where there's " + (arguments.length-2) + " arguments specified.");}
  return overload.apply(this, arguments); 
}; 
objTarget._QuickSearch1=function(onSuccess, onError, rq) {
var dto={'rq':rq};var url="https://book.txgb.co.uk/v4/Services/EntityService.jsws/QuickSearch?";
return doCall(url, "QuickSearch", dto, onSuccess, onError);
};

var timeoutValue=120000;
objTarget.FindLocationByOldRegionIds=function(onSuccess, onError) { 

  var overload=objTarget['_FindLocationByOldRegionIds' + (arguments.length-2)];
  if(!overload){throw new Error("No overload found for the method FindLocationByOldRegionIds where there's " + (arguments.length-2) + " arguments specified.");}
  return overload.apply(this, arguments); 
}; 
objTarget._FindLocationByOldRegionIds1=function(onSuccess, onError, regionIds) {
var dto={'regionIds':regionIds};var url="https://book.txgb.co.uk/v4/Services/EntityService.jsws/FindLocationByOldRegionIds?";
return doCall(url, "FindLocationByOldRegionIds", dto, onSuccess, onError);
};
})(V3.WebServices[serviceName]);
})(V3);
 })(V3);
var V3;
if(!V3){V3={__namespace:true};}
(function(V3){ 
(function(V3){
var serviceName="LocationService";
var serverTimeOffset=0;
if(!V3.WebServices){V3.WebServices={__namespace:true};}
if(!V3.WebServices[serviceName]){ V3.WebServices[serviceName]={__class:true, __static: true};}
(function(objTarget){
function doCall(url, webMethodName, args, onSuccess, onError){
  var notifiedApplication = false;
  var timeOffset;

  function success(parsedObj, httpStatusCode){
    if(!notifiedApplication){ 
      notifiedApplication = true;    
      onSuccess(parsedObj, {httpStatusCode:httpStatusCode, xhr: this});
    }
  }

  function error(parsedObj, httpStatusCode, isParseException){
    if(!notifiedApplication){ 
      notifiedApplication = true;    
  
      var e = {
        xhr: this,
        isParseException: !!isParseException,
        isServerException: !!(!isParseException && parsedObj && parsedObj.Type),
        response: parsedObj,
        toString: function(){
          if(this.isServerException){
            var ex = this.response;
            return ex.Type + ': ' + ex.Message + '\r\n' + ex.StackTrace;
          } else if (this.isParseException) {
            return 'Unable to parse JSON: ' + this.xhr.responseText;
          } else {
            return this.message;
          }
        }
      };

      if (e.isServerException) {
          e.message = (parsedObj.Type + ': ' + parsedObj.Message);
      } else if (e.isParseException) {
          e.message = 'Parse error: ' + parsedObj;
      } else {
          e.message = 'HttpCode: ' + this.statusText;
      }

      eval('debugger //webMethodError, http code: ' + httpStatusCode + ', Is Parse Exception: ' + isParseException);
      if(window.V3 && window.V3.Log && window.V3.Log.Error) { 
        V3.Log.Error('Error while calling Web Method ' + webMethodName + ' on URL: ' + url, 'e', e); 
      }
      onError(e);
    }
  }
  
  function jsonReviver(k, v){
    if (typeof v === 'string' && v.substr(0, 6) === '/Date(') { 
        return new Date(parseInt(v.substr(6, v.length - 8), 10) + timeOffset);
    }
    return v;
  }

  var aborting = false;
  var connector;
  var onLoadCallback = function(connectorState, httpStatusCode){
    if(connectorState == 4){ //DONE and HTTP_OK
      var parsedObj = null;
      if(!aborting && httpStatusCode < 100){
        if (httpStatusCode==0) {
           error.call(this, new Error('Unsent, maybe error with CORS or connection timed out without sending (ie browser limited to 2 connections per origin and both choked all subsequent requests)'), httpStatusCode);
        } else if(httpStatusCode==1) {
           error.call(this, new Error('Connection was Opened but an error occurred'), httpStatusCode);
        } else if(httpStatusCode==2) {
          error.call(this, new Error('Headers were received, but an error occurred.'), httpStatusCode);
        } else{
          error.call(this, new Error('Unknown error'), httpStatusCode);
        }
        return;
      }
      try {
          var localTimeOffset = -(new Date()).getTimezoneOffset() * 60 * 1000;
          timeOffset = (serverTimeOffset - localTimeOffset);
          parsedObj = JSON.parse(this.responseText||'',jsonReviver);
      } catch(exception) {
          if(!aborting){
            error.call(this, exception, httpStatusCode, true);
            return;
          }
      }

      if(aborting){
        if(V3.debugMode && window.V3 && window.V3.Log && window.V3.Log.Info){
          window.V3.Log.Warn('Aborting web service request.','details', {'arguments':args, 'responseText':this.responseText, 'parsedResponse': parsedObj, 'xhr': connector}, true);
        }
        return;
      }
      
      if(V3.debugMode && window.V3 && window.V3.Log && window.V3.Log.Info){
        window.V3.Log.Info('RECEIVED ' + (this.responseText||'').length.toLocaleString() + 'chars from: ' + url,'parsedObj', parsedObj);
      }

      if(httpStatusCode === 200){
        success.call(this, parsedObj.hasOwnProperty('d') ? parsedObj.d : parsedObj, httpStatusCode);
      } else {
        error.call(this, parsedObj, httpStatusCode, false);
      }
    }
  };
  

  if (window.XDomainRequest && navigator.userAgent.match(/MSIE 9\./)) {
    connector = new XDomainRequest();
    connector.contentType = 'text/plain';
    connector.onload = function(){ onLoadCallback.call(this, 4, 200); };
    connector.onprogress = function(){}; 
    connector.open('POST', url, true);
  } else {
    connector = new XMLHttpRequest();
    connector.onreadystatechange = function(){ onLoadCallback.call(this, this.readyState, this.status); }
    connector.open('POST', url, true);
    connector.setRequestHeader('Content-Type', 'application/json; charset=utf-8');
    connector.setRequestHeader('Accept', 'application/json; charset=utf-8');
  }
  connector.timeout=timeoutValue;
  connector.ontimeout=function(){ error.call(this, new Error('timed-out')); };
  connector.onerror =function(e){ error.call(this, e||event); };

  var json=JSON.stringify(args);

  if(V3.debugMode && window.V3 && window.V3.Log && window.V3.Log.Info){
    window.V3.Log.Info('SEND ' + json.length.toLocaleString() + 'chars to: ' + url,'args', args);
  }

  connector.send(json);
  
  return {
    xhr: connector,
    abort: function(){
      aborting = true;
      this.xhr.abort();
    }
  };
}
var timeoutValue=120000;
objTarget.GetPrimaryLocations=function(onSuccess, onError) { 

  var overload=objTarget['_GetPrimaryLocations' + (arguments.length-2)];
  if(!overload){throw new Error("No overload found for the method GetPrimaryLocations where there's " + (arguments.length-2) + " arguments specified.");}
  return overload.apply(this, arguments); 
}; 
objTarget._GetPrimaryLocations1=function(onSuccess, onError, types) {
var dto={'types':types};var url="https://book.txgb.co.uk/v4/Services/LocationService.jsws/GetPrimaryLocations?";
return doCall(url, "GetPrimaryLocations", dto, onSuccess, onError);
};

var timeoutValue=120000;
objTarget.GetChildLocations=function(onSuccess, onError) { 

  var overload=objTarget['_GetChildLocations' + (arguments.length-2)];
  if(!overload){throw new Error("No overload found for the method GetChildLocations where there's " + (arguments.length-2) + " arguments specified.");}
  return overload.apply(this, arguments); 
}; 
objTarget._GetChildLocations1=function(onSuccess, onError, parentLocationId) {
var dto={'parentLocationId':parentLocationId};var url="https://book.txgb.co.uk/v4/Services/LocationService.jsws/GetChildLocations?";
return doCall(url, "GetChildLocations", dto, onSuccess, onError);
};

var timeoutValue=120000;
objTarget.FindNearbyLocations=function(onSuccess, onError) { 

  var overload=objTarget['_FindNearbyLocations' + (arguments.length-2)];
  if(!overload){throw new Error("No overload found for the method FindNearbyLocations where there's " + (arguments.length-2) + " arguments specified.");}
  return overload.apply(this, arguments); 
}; 
objTarget._FindNearbyLocations4=function(onSuccess, onError, latLng, locType, parentLocationId, maxNumber) {
var dto={'latLng':latLng,'locType':locType,'parentLocationId':parentLocationId,'maxNumber':maxNumber};var url="https://book.txgb.co.uk/v4/Services/LocationService.jsws/FindNearbyLocations?";
return doCall(url, "FindNearbyLocations", dto, onSuccess, onError);
};

var timeoutValue=120000;
objTarget.CreateNewLocations=function(onSuccess, onError) { 

  var overload=objTarget['_CreateNewLocations' + (arguments.length-2)];
  if(!overload){throw new Error("No overload found for the method CreateNewLocations where there's " + (arguments.length-2) + " arguments specified.");}
  return overload.apply(this, arguments); 
}; 
objTarget._CreateNewLocations1=function(onSuccess, onError, locations) {
var dto={'locations':locations};var url="https://book.txgb.co.uk/v4/Services/LocationService.jsws/CreateNewLocations?";
return doCall(url, "CreateNewLocations", dto, onSuccess, onError);
};

var timeoutValue=120000;
objTarget.UpdateLocations=function(onSuccess, onError) { 

  var overload=objTarget['_UpdateLocations' + (arguments.length-2)];
  if(!overload){throw new Error("No overload found for the method UpdateLocations where there's " + (arguments.length-2) + " arguments specified.");}
  return overload.apply(this, arguments); 
}; 
objTarget._UpdateLocations1=function(onSuccess, onError, locations) {
var dto={'locations':locations};var url="https://book.txgb.co.uk/v4/Services/LocationService.jsws/UpdateLocations?";
return doCall(url, "UpdateLocations", dto, onSuccess, onError);
};

var timeoutValue=120000;
objTarget.DeleteLocations=function(onSuccess, onError) { 

  var overload=objTarget['_DeleteLocations' + (arguments.length-2)];
  if(!overload){throw new Error("No overload found for the method DeleteLocations where there's " + (arguments.length-2) + " arguments specified.");}
  return overload.apply(this, arguments); 
}; 
objTarget._DeleteLocations1=function(onSuccess, onError, strLocationIds) {
var dto={'strLocationIds':strLocationIds};var url="https://book.txgb.co.uk/v4/Services/LocationService.jsws/DeleteLocations?";
return doCall(url, "DeleteLocations", dto, onSuccess, onError);
};

var timeoutValue=120000;
objTarget.Search=function(onSuccess, onError) { 

  var overload=objTarget['_Search' + (arguments.length-2)];
  if(!overload){throw new Error("No overload found for the method Search where there's " + (arguments.length-2) + " arguments specified.");}
  return overload.apply(this, arguments); 
}; 
objTarget._Search1=function(onSuccess, onError, rq) {
var dto={'rq':rq};var url="https://book.txgb.co.uk/v4/Services/LocationService.jsws/Search?";
return doCall(url, "Search", dto, onSuccess, onError);
};
})(V3.WebServices[serviceName]);
})(V3);
 })(V3);
(function(V3){ //AUTO-GENERATED-DO NOT MODIFY 
V3.RegisterFile("V3.API.EntityService",1,["V3.Utils","V3.CABS.UI.Common"],function(){V3.Namespace("API");var a=function a(d){if(d&&d._EntityServiceProxy){return d._EntityServiceProxy}this.base();this.OnLoad.addEventHandler(function(){this.IsLoaded=true;if(this._errorTimerId){clearTimeout(this._errorTimerId)}}.bind(this));if(window.vsDesignTime&&!d){d=window.getProviderSearchControlDefaultSettings().GlobalSettings.EntityServiceApiSettings}d._EntityServiceProxy=this;var c=d.EndPoint;this._shortname=d.Shortname;c=c||"http://localhost/CABS4/Services/EntityService.asmx";if(V3.WebServices&&V3.WebServices.EntityService){this.OnLoad.fire()}else{var b=c+"/GetJavascript?cb="+encodeURIComponent(V3.GetGloballyAccessibleFunctionReference(this._loadedCallback.bind(this)));V3.Dynamic.LoadScript("EntityWebService",b);this._errorTimerId=setTimeout(this._loadTimeout.bind(this),5000)}}.InheritsFrom(V3.Class,{OnLoad:new V3.EventType(null,"",true),IsLoaded:false,_loadedCallback:function(b){this.OnLoad.fire()},_errorTimerId:null,_loadTimeout:function(){V3.Log.Error("BookingWebService API load has timed out.","instance",this)},Search:function(e,d,c){e=this._searchResponseSuccess.bind(this,e);d=this._searchResponseFailure.bind(this,d);var b={abort:function(){b._abortPending=true;if(b._wsRet){b._wsRet.abort()}},xhr:null};this.OnLoad.addEventHandler(function(){if(!c.Shortname){c.Shortname=this._shortname}if(!c._CurrentUICulture){c._CurrentUICulture=V3.CultureInfo.currentUICulture().name()}if(!b._abortPending){b._wsRet=V3.WebServices.EntityService.Search(e,d,c);b.xhr=b._wsRet.xhr}}.bind(this));return b},_searchResponseSuccess:function(c,b){if(b&&b.Entities&&b.Entities.length){V3.forEach(b.Entities,function(d){if(b.Parents&&d.ParentId){d.Parent=b.Parents[d.ParentId]}if(d.Settings&&d.Settings.Terminology){if(d.Children&&d.Children.length){V3.forEach(d.Children,function(e){e.Settings=V3.extend(e.Settings||{},false,d.Settings)})}}})}c(b)},_searchResponseFailure:function(c,b){V3.Log.Error("Failed to invoke EntityService.Search()","response",b);c(b)},FindServicesByProviderShortname:function(f,d,c,b,e){return this.FindServicesByProviderShortnames(f,d,[c],b,e)},FindServicesByProviderShortnames:function(g,e,b,d,f){if(!b||b.length==0){throw new Error("providerShortnames must be specified")}if(!d){d={}}if(!f){f={}}var c={TransactionId:V3.newId(),CurrentCurrency:currentCurrency,Campaign:d.Campaign,Filter:{Codes:b,Type:V3.CABS.EntityTypeEnum.Provider},Output:{Children:{Filter:d.ServiceFilter,Output:V3.extend(f.ServiceOutput,true,{Children:{Filter:d.ProductFilter,Output:f.ProductOutput}})}}};return this.Search(function(h){var i=[];h.Entities.forEach(function(j){i.addRange(j.Children)});h.Entities=i;g(h)},e,c)},GetServicesByIds:function(f,e,c,d){if(!c||c.length==0){throw new Error("ids must be specified")}if(!d){d={}}var b={Campaign:d.Campaign,Filter:{Ids:c,Type:V3.CABS.EntityTypeEnum.Service,TagCriteria:!d.IndustryCategoryGroup?null:{IndustryCategoryGroups:[d.IndustryCategoryGroup]}},Output:{Output:{Children:{Filter:d.ProductFilter}}}};return this.Search(function(g){f(g)},e,b)},GetServicesByCodes:function(f,e,b,d){if(!b||b.length==0){throw new Error("codes must be specified")}if(!d){d={}}var c={Campaign:d.Campaign,Filter:{Codes:b,Type:V3.CABS.EntityTypeEnum.Service,TagCriteria:!d.IndustryCategoryGroup?null:{IndustryCategoryGroups:[d.IndustryCategoryGroup]}},Output:{Output:{Children:{Filter:d.ProductFilter}}}};return this.Search(function(g){f(g)},e,c)},FindServicesByPartnerShortname:function(f,d,e,c){if(!e){throw new Error("partnerShortname must be specified")}if(!c){c={}}var b={Campaign:c.Campaign,Filter:{Codes:[e],Type:V3.CABS.EntityTypeEnum.Partner},Output:{Children:{Filter:{TagCriteria:!c.IndustryCategoryGroup?null:{IndustryCategoryGroups:[c.IndustryCategoryGroup]}},Output:{Children:{Filter:c.ProductFilter}}}}};return this.Search(function(g){var h=[];g.Entities.forEach(function(i){h.addRange(i.Children)});g.Entities=h;f(g)},d,b)}});V3.API.EntityWebService=a}); })(V3);
(function(V3){ //AUTO-GENERATED-DO NOT MODIFY 
V3.RegisterFile("V3.CABS.UI.Common",1,["V3.Utils","V3.UI"],function(){var o=false,r=false,A=false;if(V3.debugMode){o=V3.debuggingEnabledFor("ccui");r=V3.debuggingEnabledFor("getterm");A=V3.debuggingEnabledFor("restext")}V3.EventType.setDefaultLoggingStatus(o);var v=V3.Enum({Accommodation:0,Activity:1});var b=V3.Enum({Accommodation:0,Tours:1,Events:2,Attractions:3,NonServicedAccommodation:4});var c=V3.Enum({NoMerge:0,LowestRate:1,LowestRateForCampaign:2});b.prototype.toGroup=function(){switch(this){case b.Accommodation:return v.Accommodation;case b.NonServicedAccommodation:return v.Accommodation;case b.Tours:return v.Activity;case b.Events:return v.Activity;case b.Attractions:return v.Activity;default:throw new Error("Unrecognised value")}};var f=V3.Enum({Partner:1,Provider:2,Service:3,Product:4});var x=V3.Enum({Country:10,State:20,Region:30,City:40,Landmark:50});var G=function(I,J){if(!this._pfId){this._pfId=V3.newId();$.fn.prettyPhoto(this._pfId,{opacity:0.4,default_width:800,default_height:344,theme:"V3",allow_resize:true,horizontal_padding:30,modal:false,social_tools:false,inline_markup:'<div class="pp_inline"><div id="tempLightbox">{content}</div></div>'})}$.prettyPhoto.open(I)};var z={ICGAccommodation:"Accommodation",ICGActivity:"Activities",Business:"Provider",Destination:"Destination",Product:"Product",Products:"Products",Nights:"Nights",DateCommencing:"Commencing",DateConcluding:"Concluding",TimeCheckIn:"Check-In",TimeCheckOut:"Check-Out",Guests:"Guests",GuestAdults:"Adults",GuestChildren:"Children",GuestSeniors:"Seniors"};var h=function(J){if(J){for(var I in z){if(V3.Is.String(J[I])){z[I]=J[I]}}}};var d=function(J){if(!J){J={};V3.Object.addField(J,"___copyOfDefault",true,true)}for(var I in z){if(!V3.Is.String(J[I])){J[I]=z[I]}}return J};var e=V3.Class();e.ProcessPlaceholders=function(M,K){for(var J in K){var I=RegExp.escape(J);var L=new RegExp(I,"g");if(A){M=M.replace(L,J.substr(0,J.length-1)+"="+K[J]+J.substr(J.length-1))}else{M=M.replace(L,K[J])}}return M};e.TryAbbreviateStateName=function(I){switch(I.toLowerCase()){case"south australia":return"SA";case"queensland":return"Qld";case"australian capital territory":return"ACT";case"northern territory":return"NT";case"tasmania":return"Tas";case"victoria":return"Vic";case"western australia":return"WA";case"new south wales":return"NSW";default:return I}};e.GetCssClassNameFromEnum=function(I){if(!V3.Is.Specified(I)){throw new Error("e must be specified")}switch(I){case v.Accommodation:return"icg-accommodation";case v.Activity:return"icg-activity";case b.Accommodation:return"ic-accommodation";case b.NonServicedAccommodation:return"ic-accommodation";case b.Tours:return"ic-tour";case b.Events:return"ic-event";case b.Attractions:return"ic-attraction";case f.Service:return"type-service";case f.Product:return"type-product";case f.Provider:return"type-business";case f.Partner:return"type-partner";case x.Country:return"location";case x.State:return"location";case x.Region:return"location";case x.City:return"location";case x.Landmark:return"landmark";default:return null}};e.IsValidEntityCode=function(I){return(I&&V3.Is.String(I)&&I.indexOf(" ")==-1&&I.indexOf(".")&&I.indexOf("/")&&I.indexOf("\\")==-1)};e.GetTerm=function(J,I){var K=null;if(I&&I!==z&&!I.___copyOfDefault&&V3.Is.String(I[J])){K=I[J];if(r){K="gt[c:"+K+"]"}}else{if(V3.Res&&V3.Res["Terms."+J]){K=V3.Res["Terms."+J];if(r){K="gt[r:"+K+"]"}}else{K=z[J];if(r){K="gt[d:"+K+"]"}}}return K};e._getDefaultTerminology=d;e.ConvertTxCurrencyToDisplayCurrency=function(J,I,K){if(I==_DisplayCurrencyCode){return J}else{return(J*K)*_DisplayCurrencyConversionCoefficient}};var l=V3.Is;var s=function s(I){this.base("ul","tabs");if(I){V3.forEach(I,this,function(K,J){this.addTab(K)})}}.InheritsFrom(V3.UI.WebControlBasic,{OnTabClicked:V3.EventPrototype("sender, e:{tab:Control, index:clickedTabIndex, currentIndex: tabIndex, changingTabs: true}"),OnSelectedTabIndexChanged:V3.EventPrototype("sender, e:{tab:Control, index: 0}"),selectedTabIndex:V3.Property(-1).OnChange(function(I){this._selectTab(I)}),selectedTabName:V3.Property(function E(){if(!this._currentTab){return null}return this._currentTab.name()},function p(I){this.Controls.forEach(function(K,J){if(K.name().toLowerCase()==I.toLowerCase()){this.selectedTabIndex(J);return false}}.bind(this))}),_currentTab:null,_selectTab:function(J){var I;if(l.Number(J)){I=this.Controls.get(J)}else{I=J;J=this.Controls.indexOf(I)}var K=null;if(this._currentTab){this._currentTab._cssClassAdd(true,"unselected");this._currentTab._cssClassRem(true,"selected");if(this._currentTab.AssociatedControl){this._currentTab.AssociatedControl.visible(false)}K=this._currentTab}this._currentTab=I;this._currentTab._cssClassAdd(true,"selected");this._currentTab._cssClassRem(true,"unselected");if(K&&l.Function(K.OnDeselected)){K.OnDeselected()}if(l.Function(this._currentTab.OnSelected)){this._currentTab.OnSelected()}if(this._currentTab.AssociatedControl){this._currentTab.AssociatedControl.visible(true)}this.OnSelectedTabIndexChanged.fire(this,{tab:I,index:J,tabName:I.name(),previousTab:K})},_onChangeFire:function(I){if(!I.enabled()){return}var K=this.Controls.indexOf(I);var J=this.selectedTabIndex();this.selectedTabIndex(K);this.OnTabClicked.fire(this,{tab:I,tabIndex:K,currentIndex:J,changingTabs:(K!=J),tabName:I.name()})},addTab:function(Q,M,K,L,N){if(arguments.length===1&&arguments[0]&&typeof arguments[0]==="object"){var R=arguments[0];return this.addTab(l.String(R)?R:(R.name||R.toString()),R.control,R.onSelected,R.onDeselected,R.enabled)}var I=new V3.UI.HyperLink("","");var P=new V3.UI.WebControl("li");P.cssClass("tab");P.OnSelected=K;P.OnDeselected=L;P.Insert(I);P.name=I.text.bind(I);P.name(Q);P.enabled(N!==false);P.selected=new V3.Property(this,function J(){return this._currentTab===P},function O(S){this.selectedTabIndex(P.index)});if(M){M.visible(false);P.AssociatedControl=M}I.OnClick.addEventHandler(function(T,S){this._onChangeFire(P)}.bind(this));P.index=this.Controls.count();this.Controls.add(P);setTimeout(function(){if(this.selectedTabIndex()==-1){this.Controls.forEach(function(S){if(S.enabled()){S.selected(true);return false}})}}.bind(this),0);return P},removeTab:function(I){throw new Error("Not supported yet.")}});var u=function u(I){this.base("accreditation-display");this.Insert(this.lblValue,this.lblScheme);this._canBeVisible(false);this.accreditation(I);this.showLarge(false)}.InheritsFrom(V3.UI.Panel,{lblValue:V3.UI.Label(),lblScheme:V3.UI.Label().Defaults({cssClass:"scheme"}),accreditation:V3.Property(null).OnChange(function g(J,I){this._canBeVisible(!!J);if(J){if(I){this._cssClassRem(true,I.SchemeCode.toLowerCase())}this._cssClassAdd(true,J.SchemeCode.toLowerCase());this.tooltip(J.SchemeName+": "+J.ValueName);this.lblValue.text(J.ValueName);this.lblValue.cssClass("value V"+J.NumericValue.toDecimal(4).replace(".","_"));this.lblScheme.text(J.SchemeName)}}),showLarge:V3.Property(true).OnChange(function(I){this._cssClassToggle(true,I,"large","small")})});var n=function n(){this.base("display-images");this.OnVisibleChange.addEventHandler(function(){this._configureCycleTimer()});this._timerOffset=Math.random()*800}.InheritsFrom(V3.UI.Panel,{Images:V3.Collection(function y(K,I,L){L();var J=this.maxVisibleImages();if(J==0||this._visibleImageCount<J){this._addImageToUI(K)}this._configureCycleTimer()},function k(K,I,L){L();this._remImageFromUI(K);if(this.Images.count()>0){var J=this.maxVisibleImages();if(this._visibleImageCount<J&&this._visibleImageCount<this.Images.count()){this.refresh()}}this._configureCycleTimer()}).InjectOwner(),enableLightBox:V3.Property(true),maxVisibleImages:V3.Property(0).OnChange(function(J,I){this._cssClassRem(true,"max-visible-"+I);this._cssClassAdd(true,"max-visible-"+J);this.refresh()}),preferredSize:V3.Property(640).OnChange(function(J,I){this.cssClassRem("preferred-size-"+I);this.cssClassAdd("preferred-size-"+J);this.refresh()}),refresh:function(){var I=this.Images.toArray();this.Images.clear();this.Images.addRange(I)},_currentImageIndex:null,_changeImage:function(K){if(this._currentImageIndex===null){this._currentImageIndex=this.maxVisibleImages()-1}this._currentImageIndex=(this._currentImageIndex+1)%this.Images.count();var J;while(J=this.Controls.get(0)){if(J._cssClassAdd(true,"pending-dispose")){break}else{this._remImageFromUI(J.img)}}this._addImageToUI(this.Images.get(this._currentImageIndex));if(K){var I=this.autoCycleDuration();if(I){this._cycleTimerId=setTimeout(this._changeImage.bind(this,true),I)}}},_cycleTimerId:null,_configureCycleTimer:function(){var I=this.autoCycleDuration();if(!I||!this.isVisible()||this.maxVisibleImages()>=this.Images.count()){if(this._cycleTimerId){this._cssClassRem(true,"auto-cycle-enabled");clearTimeout(this._cycleTimerId);this._cycleTimerId=null}}else{if(!this._cycleTimerId){this._cssClassAdd(true,"auto-cycle-enabled");this._cycleTimerId=setTimeout(this._changeImage.bind(this,true),I+this._timerOffset)}}},autoCycleDuration:V3.Property(false).OnChange(function(I){this._configureCycleTimer()}),_visibleImageCount:0,_ctrlLookup:V3.Object(),_addImageToUI:function(J){var I=this.preferredSize();var L=null;var O=null;V3.forEach(J.Sizes,function(P){if(P.Size>=I){O=P.Url;return false}});if(V3.debugMode){O=null}if(!O){O=J.Url}var K=this.Controls.count();var M=this;var N=new V3.UI.Panel().Set({cssClass:"image "+(!L?"":" size-"+L),tooltip:J.Name,Style:{display:"inline-block",backgroundImage:'url("'+encodeURI(O).replace('"','\\"')+'")',backgroundRepeat:"no-repeat"},OnClick:function(P,Q){if(M.enableLightBox()){M.showLightBox(J)}}}).Insert(new V3.UI.Image(O).Style({visibility:"hidden"}));N.img=J;this._ctrlLookup[J.Id]=N;this._visibleImageCount++;this.Insert(N)},_remImageFromUI:function(I){if(!I){return}var J=this._ctrlLookup[I.Id];if(J){this.Controls.remove(J);delete this._ctrlLookup[I.Id];this._visibleImageCount--}},showLightBox:function(I){this._showPrettyPhotoLightBox(I)},_showPrettyPhotoLightBox:function(J){var N=[],K=[],M=[],L=[];var I;this.Images.forEach(function(O,P){if(O===J){I=P}K.add(O.Name);M.add(O.Description);N.add((V3.find(O.Sizes,function(Q){return Q.Size==1024})||O).Url);L.add((V3.find(O.Sizes,function(Q){return Q.Size==50})||V3.find(O.Sizes,function(Q){return Q.Size==180})||O).Url)});if(!this._pfId){this._pfId=V3.newId();$.fn.prettyPhoto(this._pfId,{animation_speed:"fast",slideshow:false,autoplay_slideshow:false,opacity:0.4,show_title:true,allow_resize:true,default_width:800,default_height:500,counter_separator_label:"/",theme:"V3",horizontal_padding:30,hideflash:false,wmode:"opaque",autoplay:true,modal:false,deeplinking:false,overlay_gallery:true,keyboard_shortcuts:true,social_tools:false,markup:'<div class="pp_pic_holder">   <div class="pp_top">     <div class="pp_left"></div>     <div class="pp_middle"></div>     <div class="pp_right"></div>   </div>   <div class="pp_content_container">     <div class="pp_left">       <div class="pp_right">         <div class="pp_content">           <div class="pp_loaderIcon"></div>           <div class="pp_fade">             <a href="#" class="pp_expand" title="Expand the image">Expand</a>             <div class="pp_hoverContainer">               <a class="pp_next" href="#">next</a>               <a class="pp_previous" href="#">previous</a>             </div>             <div class="pp_top_content">                             </div>            <div id="pp_full_res"></div>             <div class="pp_details">               <div class="pp_nav">                 <p class="currentTextHolder">0/0</p>                 <a href="#" class="pp_arrow_previous">Previous</a>                 <a href="#" class="pp_arrow_next">Next</a>               </div>               <a class="pp_close" href="#">Close</a>               <div class="ppt">&nbsp;</div>               <p class="pp_description"></p>             </div>           </div>         </div>       </div>     </div>   </div>   <div class="pp_bottom">     <div class="pp_left"></div>     <div class="pp_middle"></div>     <div class="pp_right"></div>   </div> </div> <div class="pp_overlay"></div>',gallery_markup:' <div class="pp_gallery">   <a href="#" class="pp_arrow_previous">Previous</a>   <div>   <ul>     {gallery}   </ul>   </div>   <a href="#" class="pp_arrow_next">Next</a> </div>',image_markup:'<img id="fullResImage" src="{path}" />',flash_markup:'<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="{width}" height="{height}"><param name="wmode" value="{wmode}" /><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="{path}" /><embed src="{path}" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="{width}" height="{height}" wmode="{wmode}"></embed></object>',quicktime_markup:'<object classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" codebase="http://www.apple.com/qtactivex/qtplugin.cab" height="{height}" width="{width}"><param name="src" value="{path}"><param name="autoplay" value="{autoplay}"><param name="type" value="video/quicktime"><embed src="{path}" height="{height}" width="{width}" autoplay="{autoplay}" type="video/quicktime" pluginspage="http://www.apple.com/quicktime/download/"></embed></object>',iframe_markup:'<iframe src ="{path}" width="{width}" height="{height}" frameborder="0" scrolling="auto"></iframe>',inline_markup:'<div class="pp_inline">{content}</div>',custom_markup:'<div class="pp_custom_container" id="" + CustomContentContainerId + @""></div>'})}$.prettyPhoto.open(N,K,M,L);if(isFinite(I)&&I!==-1){$.prettyPhoto.changePage(I)}}});var w=function w(){this.base("ul","display-features");this._canBeVisible(false)}.InheritsFrom(V3.UI.WebControlBasic,{Features:V3.Collection(function y(K,J,L){L();var I=this.maxVisibleFeatures();if(I==0||this._visibleFeatureCount<I){this._addFeatureToUI(K)}this._canBeVisible(true)},function k(K,J,L){L();this._removeFeatureFromUI(K);if(this.Features.count()==0){this._canBeVisible(false)}else{var I=this.maxVisibleFeatures();if(this._visibleFeatureCount<I&&this._visibleFeatureCount<this.Features.count()){this.refresh()}}}).InjectOwner(),refresh:function(){var I=this.Features.toArray();this.Features.clear();this.Features.addRange(I)},_visibleFeatureCount:0,maxVisibleFeatures:V3.Property(0).OnChange(function(I){this.refresh()}),_ctrlLookup:V3.Object(),_addFeatureToUI:function(I){var J=this._ctrlLookup[I.Id];if(J){return}J=new V3.UI.WebControlBasic("li").Set({}).Insert(I.Name);this._ctrlLookup[I.Id]=J;this._visibleFeatureCount++;this.Insert(J)},_remFeatureFromUI:function(I){var J=this._ctrlLookup[I.Id];if(J){this.Controls.remove(J);this._visibleFeatureCount--}}});var H=function H(I){this.base("display-address");this.Insert(this.lblIcon,this.lblLine1,this.lblLine2,this.lblLine3,this.lblCity,this.lblState,this.lblPostCode,this.lblCountry);this._canBeVisible(false);this.address(I)}.InheritsFrom(V3.UI.Panel,{lblIcon:V3.UI.Label().Defaults({cssClass:"data-icon address",tooltip:"Address"}),lblLine1:V3.UI.Label().Defaults({cssClass:"line1",autoVisibility:true}),lblLine2:V3.UI.Label().Defaults({cssClass:"line2",autoVisibility:true}),lblLine3:V3.UI.Label().Defaults({cssClass:"line3",autoVisibility:true}),lblCity:V3.UI.Label().Defaults({cssClass:"city",autoVisibility:true}),lblState:V3.UI.Label().Defaults({cssClass:"state",autoVisibility:true}),lblPostCode:V3.UI.Label().Defaults({cssClass:"postcode",autoVisibility:true}),lblCountry:V3.UI.Label().Defaults({cssClass:"country",autoVisibility:true}),address:V3.Property(null).OnChange(function(I){if(!I){this._canBeVisible(false)}else{this.lblLine1.text(I.Line1);this.lblLine2.text(I.Line2);this.lblLine3.text(I.Line3);this.lblCity.text(I.City);this.lblState.text(e.TryAbbreviateStateName(I.State));this.lblPostCode.text(I.PostCode);this.lblCountry.text(I.CountryName);this._canBeVisible(true)}})});var m=function m(J,I){this.base("ratings-reviews");this.Insert(this.lblIcon,this.lblRating);this._canBeVisible(false);this._type=I;this.rating(J)}.InheritsFrom(V3.UI.Panel,{lblIcon:V3.UI.Label().Defaults({cssClass:"data-icon rating",tooltip:"Rating"}),lblRating:V3.UI.Label().Defaults({cssClass:"line1",autoVisibility:true}),rating:V3.Property(null).OnChange(function(J){if(!J){this._canBeVisible(false)}else{var I=f.parse(this._type);if(I==f.Product){this.lblIcon._cssClassAdd(true,"orange")}this.lblRating.text(e.ProcessPlaceholders((V3.Res["EntityDisplay.Rating"]||"{score}/{max} by {number} people"),{"{score}":parseFloat(J.Value.toFixed(2)).toString(),"{min}":J.MinInclusive,"{max}":J.MaxInclusive,"{number}":J.RatingCount}));this._canBeVisible(true)}})});var a=function a(I){this.base("ul");if(window.vsDesignTime&&!I){I=window.getProviderSearchControlDefaultSettings(true).PagingSettings}V3.extend(I,false,this._DefaultSettings);this.cssClass("paging "+(I.CssClass||""));this._settings=I;this.maxPageButtonCount(I.MaxNumberOfButtons);this.showFirstPageButton(I.ShowFirstPage);this.showPrevPageButton(I.ShowPrevButton);this.showNextPageButton(I.ShowNextButton);this.showLastPageButton(I.ShowLastPage);this._construct();this.showFirstPageButton.OnChange.addEventHandler(this._construct.bind(this));this.showPrevPageButton.OnChange.addEventHandler(this._construct.bind(this));this.showNextPageButton.OnChange.addEventHandler(this._construct.bind(this));this.showLastPageButton.OnChange.addEventHandler(this._construct.bind(this));this.maxPageButtonCount.OnChange.addEventHandler(this._construct.bind(this))}.InheritsFrom(V3.UI.WebControlBasic,{_DefaultSettings:{ShowFirstPage:true,ShowPrevButton:true,ShowNextButton:true,ShowLastPage:true,MaxNumberOfButtons:10,Labels:{First:null,Prev:null,Next:null,Last:null}},OnChangePage:V3.EventPrototype("sender, e:{newPageNumber:1}"),showFirstPageButton:V3.Property(true),showPrevPageButton:V3.Property(true),showNextPageButton:V3.Property(true),showLastPageButton:V3.Property(true),maxPageButtonCount:V3.Property(5),pageNumber:V3.Property(1).OnChange(function(I){this._construct();this.OnChangePage.fire(this,{newPageNumber:I})}),numberOfPages:V3.Property(0).OnChange(function(I){this._construct()}),_changePage:function(I){this.pageNumber(I)},_construct:function(){this.Controls.clear();if(this.numberOfPages()==0){this.visible(false);return}else{this.visible(true)}if(this.showPrevPageButton()){var R=new V3.UI.WebControlBasic("li").Set({cssClass:"previous-page",visible:this.maxPageButtonCount()>=1});var K=new V3.UI.HyperLink("",this._settings.Labels.Prev||V3.Res["Paging.Previous"]||"Previous").Set({OnClick:this._changePage.bind(this,this.pageNumber()-1),enabled:(this.pageNumber()>1)});this.Insert(R.Insert(K))}if(this.showFirstPageButton()){var L=new V3.UI.WebControlBasic("li").Set({cssClass:"first-page",visible:this.maxPageButtonCount()>=3});var U=new V3.UI.HyperLink("",(this._settings.Labels.First||V3.Res["Paging.First"]||"1")).Set({OnClick:this._changePage.bind(this,1),enabled:(this.pageNumber()>1)});if(this.pageNumber()==1){L.cssClassAdd("active")}this.Insert(L.Insert(U))}var W=0,P=this.numberOfPages();if(this.maxPageButtonCount()<=6){W=this.pageNumber()-1;P=W+1}else{if(this.numberOfPages()>1){var X=this.pageNumber()-1;var Q=(this.maxPageButtonCount()-4);W=X-Math.floor(Q/2);if(W<0){W=0}P=W+Q;if(P>this.numberOfPages()){P=this.numberOfPages();W=P-Q;if(W<0){W=0}}}}if(W==0){W=1;if(P<this.numberOfPages()){P=P+1}}if(P==this.numberOfPages()){P=P-1;if(W>1){W=W-1}}var J=(P-W>=3);if(W<P){for(var O=W;O<P;O++){var V=new V3.UI.WebControlBasic("li").Set({cssClass:"page-number"});var I=new V3.UI.HyperLink("",(O+1).toString()).Set({OnClick:this._changePage.bind(this,O+1)});this.Insert(V.Insert(I));if(J){if(O==W&&O!=1){if(W!=0){V.cssClassAdd("more");I.text("...")}}}if(O+1!=this.pageNumber()){I.enabled(true)}else{I.enabled(false);V.cssClassAdd("active")}if(J){if(O+1==P&&P+1!=this.numberOfPages()){if(O+1!=this.numberOfPages()){V.cssClassAdd("more");I.text("...")}}}}}if(this.numberOfPages()>1){if(this.showLastPageButton()){var M=new V3.UI.WebControlBasic("li").Set({cssClass:"last-page",visible:this.maxPageButtonCount()>=4});var S=new V3.UI.HyperLink("",V3.CABS.Utils.ProcessPlaceholders((this._settings.Labels.Last||V3.Res["Paging.Last"]||"{page.count}"),{"{page.count}":this.numberOfPages()})).Set({OnClick:this._changePage.bind(this,this.numberOfPages()),enabled:(this.pageNumber()<this.numberOfPages())});if(this.pageNumber()==this.numberOfPages()){M.cssClassAdd("active")}this.Insert(M.Insert(S))}}if(this.showNextPageButton()){var T=new V3.UI.WebControlBasic("li").Set({cssClass:"next-page",visible:this.maxPageButtonCount()>=1});var N=new V3.UI.HyperLink("",this._settings.Labels.Next||V3.Res["Paging.Next"]||"Next").Set({OnClick:this._changePage.bind(this,this.pageNumber()+1),enabled:(this.pageNumber()<this.numberOfPages())});this.Insert(T.Insert(N))}}});var D=function(J,N,L){var I="";var M=(J.pageNumber()-1)*providerSearchControlSettings.ReviewPagingSettings.PageSize;var K=L.slice(M,M+providerSearchControlSettings.ReviewPagingSettings.PageSize);for(i=0;i<K.length;i++){I+='<div class="review"><div class="review-header"><span class="score">'+parseFloat(K[i].Rating.Value.toFixed(2))+'</span><span class="max-score">'+K[i].Rating.MaxInclusive+"</span>";if(K[i].Person){I+='<span class="user">'+e.ProcessPlaceholders(V3.Res["EntityDisplay.By"]||"by {name}",{"{name}":K[i].Person})+"</span>"}if(K[i].DateCreated){I+='<span class="date-created">'+K[i].DateCreated.toStringUI("D")+"</span>"}I+="</div>";I+='<div class=" ratings-reviews review-short">';I+='<div class="row">';if(K[i].ShortReview&&K[i].ShortReview.Positive){I+='<div class="column icon"><span class="data-icon reviews happy" title="Positives" data-tooltip-text="Positives"></span></div>';I+='<div class="column"><span>'+K[i].ShortReview.Positive+"</span></div>"}else{I+='<div class="column icon"></div>';I+='<div class="column"></div>'}if(K[i].ShortReview&&K[i].ShortReview.Negative){I+='<div class="column icon"><span class="data-icon reviews sad" title="Negatives" data-tooltip-text="Negatives"></span></div>';I+='<div class="column"><span>'+K[i].ShortReview.Negative+"</span></div>"}else{I+='<div class="column icon"></div>';I+='<div class="column"></div>'}I+="</div></div>";if(K[i].FullDescription){I+='<div class="review-full"><p>'+K[i].FullDescription+"</p></div>"}I+="</div>"}N.Set({DOMElement:{innerHTML:I}})};var C=function C(K){var J;if(!this.pnlReviewsContents){this.pnlReviewsContents=new V3.UI.Panel().Set({cssClass:"reviews-lightbox"});this.pnlReviewsInfo=new V3.UI.Panel().Set({cssClass:"reviews-info"});this.pnlReviewsLightbox=new V3.UI.Panel().Set({visible:false});this.PagingController=new a(providerSearchControlSettings.ReviewPagingSettings);this.pnlReviewsContents.DOMElement.appendChild(this.pnlReviewsInfo.DOMElement);this.pnlReviewsContents.DOMElement.appendChild(this.PagingController.DOMElement);document.body.appendChild(this.pnlReviewsLightbox.DOMElement)}var M=Math.ceil(K.length/providerSearchControlSettings.ReviewPagingSettings.PageSize);this.PagingController.Set({OnChangePage:function(O,P){D(this.PagingController,this.pnlReviewsInfo,K)}.bind(this)});this.PagingController.numberOfPages(M);this.PagingController.pageNumber(1);D(this.PagingController,this.pnlReviewsInfo,K);this.pnlReviewsLightbox.DOMElement.appendChild(this.pnlReviewsContents.DOMElement);G("#"+this.pnlReviewsContents.DOMElement.id);var L=this.pnlReviewsContents.DOMElement;if(L==null){L=J}else{J=L}var N=0;var I=setInterval(function(){if(N++>10){clearInterval(I)}var O=document.getElementById("tempLightbox");if(O){O.parentElement.appendChild(L);O.parentElement.removeChild(O);clearInterval(I)}},100);return false};var t=function t(J,I){this.base("ratings-reviews");this.Insert(this.lblIcon,this.hlReviews=new V3.UI.HyperLink("#").Set({cssClass:"view-reviews",OnClick:function(K,L){C(J);return false}}));this._canBeVisible(false);this._type=I;this.reviews(J)}.InheritsFrom(V3.UI.Panel,{lblIcon:V3.UI.Label().Defaults({cssClass:"data-icon reviews",tooltip:"Reviews"}),reviews:V3.Property(null).OnChange(function(J){if(!J){this._canBeVisible(false)}else{var I=f.parse(this._type);if(I==f.Product){this.lblIcon._cssClassAdd(true,"orange")}this.hlReviews.text(J.length+" reviews");if(J.length==1){this.hlReviews.text(e.ProcessPlaceholders((V3.Res["EntityDisplay.ReviewsSingular"]||"{number} review"),{"{number}":J.length}))}else{this.hlReviews.text(e.ProcessPlaceholders((V3.Res["EntityDisplay.ReviewsPlural"]||"{number} reviews"),{"{number}":J.length}))}this._canBeVisible(true)}})});var j=function j(J,I){this.base("entity-info");this.dbComment=document.createComment("");this.Insert(this.dbComment,this.lblCategory,this.lblHeader,this.lblMaxCapacity,this.ctrlAddress,this.ctrlRating,this.ctrlAccreditation);this._canBeVisible(false);this.entity(J);this.terminology(I)}.InheritsFrom(V3.UI.Panel,{lblCategory:V3.UI.Label().Defaults({cssClass:"category data-icon",autoVisibility:true}),lblHeader:V3.UI.Label("h3").Defaults({cssClass:"name",autoVisibility:true}),lblMaxCapacity:V3.UI.Label().Defaults({cssClass:"capacity",autoVisibility:true}),ctrlAccreditation:u(),ctrlAddress:H(),ctrlRating:m(),ctrlReviews:t(),showAccreditations:V3.Property(true).OnChange(function g(I){this.ctrlAccreditation.visible(I)}),showMaxPax:V3.Property(true).OnChange(function g(I){this.lblMaxCapacity.visible(I)}),showCategory:V3.Property(true).OnChange(function g(I){this.lblCategory.visible(I)}),showAddress:V3.Property(false).OnChange(function g(I){this.ctrlAddress.visible(I)}),showRating:V3.Property(false).OnChange(function g(I){this.ctrlRating.visible(I)}),showReviews:V3.Property(false).OnChange(function g(I){this.ctrlReviews.visible(I)}),terminology:V3.Property(null).OnChange(function g(I){this._updateGuestsLabel()}),entity:V3.Property(null).OnChange(function g(N){this._canBeVisible(!!N);if(N){if(V3.Is.Undefined(N.Type)){throw new "Type is not set, this is required."}var K="Id: "+N.Id;if(N.Type==f.Provider){K=K+", Shortname: "+N.Code}else{if(N.Parent&&N.Parent.Code){if(N.Parent.Type==f.Provider){K=K+", Parent Shortname: "+N.Parent.Code}else{K=K+", Parent Code: "+N.Parent.Code}}}this.dbComment.data=K;var J=N||DebugResponse().Entities[0];this.cssClass("");this.lblCategory.text("category data-icon");var L=f.parse(J.Type);if(L==f.Provider){this.lblCategory._cssClassAdd(true,"business")}else{if(J.IndustryCategoryGroups){var M=this;J.IndustryCategoryGroups.forEach(function(O){O=v.parse(O);var P=e.GetCssClassNameFromEnum(O);if(P){M.cssClassAdd(P);M.lblCategory.text(O.toString(true));M.lblCategory.cssClassAdd(P);return false}})}}this._cssClassAdd(true,e.GetCssClassNameFromEnum(L));if(L==f.Product){this.lblCategory._cssClassAdd(true,"orange")}var I=b.parse(J.IndustryCategory);if(I){this._cssClassAdd(true,e.GetCssClassNameFromEnum(I));this.lblCategory.text(I.toString(true));this.lblCategory.tooltip(this.lblCategory.text())}if(!V3.debugMode||V3.debugMode==="silent"){this.lblHeader.text(J.Name)}else{if(J.Type==f.Service){this.lblHeader.text(J.Name+" ["+(J.Code||"")+"] ["+((J.Parent&&J.Parent.Code)||"")+"]")}else{this.lblHeader.text(J.Name+" ["+(J.Code||"")+"]")}}this._updateGuestsLabel();if(J.Accreditations&&J.Accreditations.length>0){this.ctrlAccreditation.accreditation(J.Accreditations[0])}else{this.ctrlAccreditation.accreditation(null)}if(this.showAddress()){if(!J.PhysicalAddress||(I&&I.Accommodation.toGroup()!=v.Accommodation)){this.ctrlAddress.address(null)}else{this.ctrlAddress.address(J.PhysicalAddress)}}if(this.showRating()){if(J.Rating){this.ctrlRating.rating(J.Rating,J.Type)}}if(this.showReviews()){if(J.Reviews&&J.Reviews.length>0){this.ctrlReviews.reviews(J.Reviews,J.Type)}}}}),_updateGuestsLabel:function(){var I=this.entity();if(!I||!I.Capacity){this.lblMaxCapacity.text("")}else{this.lblMaxCapacity.text(e.ProcessPlaceholders((V3.Res["EntityDisplay.MaxGuestsText"]||"Max {max} {guests}"),{"{max}":I.Capacity.Max,"{guests}":e.GetTerm("Guests",this.terminology()||(I&&I.Settings&&I.Settings.Terminology))}))}}});var B=function B(I,J){this.base(I||"div");this.cssClass("scrolling-panel");this._debugMode=J;this.Style({overflow:"hidden",position:"relative"});this.activateContainer(new V3.UI.WebControlBasic("div").Set({cssClass:"container",Style:{position:"relative",whiteSpace:"nowrap"}}));this._templating=V3.clone(B.prototype._templating,{},this);this.OnVisibleChange.addEventHandler(function(M,L){if(L&&this._templating.shouldBeIndex!==null){var K=this._templating.shouldBeIndex;this._templating.shouldBeIndex=null;this._templating.ensureControlsAreCreatedForIndex(K);this._cssClassRem(true,"animate-scroll");this.scrollToIndex(K,false)}}.bind(this))}.InheritsFrom(V3.UI.WebControlBasic,{_offset:V3.Property(function E(){return -parseInt(this.DOMContainer.style.left,10)},function p(I){this.DOMContainer.style.left=(-I)+"px"}),_isAnimating:false,_delayTimer:0,scrollToControl:function(N,I,J){if(!this.Controls.contains(N)){throw new Error("specified control is not in collection")}var L=N.DOMElement.offsetLeft;if(this._debugMode){V3.Log.Debug("Scrolling panel to offset: "+L+"px")}if(this._isAnimating){$(this.DOMContainer).stop();this._offset(L);if(J){J(-L)}if(this._delayTimer){clearTimeout(this._delayTimer)}this._delayTimer=setTimeout(function(){this._isAnimating=false}.bind(this),800)}else{if(!I){this._offset(L);if(J){J(-L)}}else{var K=this._offset();var P=K-L;var M;if(P>0){M={left:"+="+Math.abs(P)+"px"}}else{M={left:"-="+Math.abs(P)+"px"}}var O=arguments[2];this._isAnimating=true;$(this.DOMContainer).stop().animate(M,{duration:l.Number(I)?I:400,step:(J?J:null),complete:function(){this._isAnimating=false}.bind(this)})}}},_templating:{index:-1,shouldBeIndex:null,allowedRange:{min:0,max:0},constructedRange:{min:0,max:0,lookup:{}},visibleItemCount:10,buffered:{left:7,right:7},currentSelection:{index:0,length:0},createControlCallback:function(J,I){throw new Error("Not supported")},controlDisposeCallback:function(J,I,K){},pool:[],createIndex:function(I){var J=this._templating;var K=(J.pool.length>0)?J.pool.pop():null;if(this._debugMode&&!K){V3.Log.Debug("creating new control for index: "+I)}K=J.createControlCallback(this,I,K);K.Index=I;if(this._debugMode){K.cssClassAdd("index"+I)}if(I>=J.currentSelection.index&&I<J.currentSelection.index+J.currentSelection.length){K.cssClassAdd(J.currentSelection.cssClass)}return K},removeIndex:function(I){var J=this._templating;var K=J.constructedRange.lookup[I];this.Controls.remove(K);delete J.constructedRange.lookup[I];if(J.currentSelection.cssClass){K.cssClassRem(J.currentSelection.cssClass)}K=J.controlDisposeCallback(this,I,K);if(K){J.pool.add(K)}},ensureControlsAreCreatedForIndex:function(U){var Y=this._templating;if(!this.isVisible()){Y.shouldBeIndex=U;return null}if(U===Y.index){if(this._debugMode){V3.Log.Debug("Good news, no construction required!")}return false}var T=Math.max(Y.allowedRange.min,U);var N=Math.min(Y.allowedRange.max,U+Y.visibleItemCount);var V=Y.index;if(Y.constructedRange.min<=T&&N<=Y.constructedRange.max){if(this._debugMode){V3.Log.Debug("Good news, no construction required!")}Y.index=U;return false}if(this._debugMode){V3.Log.Debug("Making changes");var X=new V3.Utils.StopWatch()}var P=false;var L=Math.max(Y.allowedRange.min,T-Y.buffered.left);var S=Math.min(Y.allowedRange.max,N+Y.buffered.right);var W=(Y.index>U);var M=W?(Y.index-U)>Y.buffered.left:(U-Y.index)>Y.buffered.right;if(M){P=true;for(var O=Y.constructedRange.min;O<Y.constructedRange.max;O++){Y.removeIndex(O)}Y.constructedRange.min=L;Y.constructedRange.max=L;Y.index=W?(S-Y.visibleItemCount):L;if(this._debugMode){V3.Log.Debug("large change detected, replacing contents now")}}else{if(this._debugMode){V3.Log.Debug("Making minor changes")}}var K=(Y.constructedRange.min>T);var R=(Y.constructedRange.max<N);var J;if(R){if(Y.constructedRange.min<L){P=true;if(this._debugMode){V3.Log.Debug("Removing "+(L-Y.constructedRange.min)+" cells from left")}for(var O=Y.constructedRange.min;O<L;O++){Y.removeIndex(O)}Y.constructedRange.min=L}J=document.createDocumentFragment();if(this._debugMode){V3.Log.Debug("Adding cells to right");X.reset(true)}this.Controls._modifyDom=false;for(var O=Y.constructedRange.max;O<S;O++){var I=Y.createIndex(O);this.Controls.add(I);J.appendChild(I.DOMElement);Y.constructedRange.lookup[O]=I}this.Controls._modifyDom=true;if(this._debugMode){X.stop();var Q=(S-Y.constructedRange.max);if(X.getDuration()/Q>5){if(X.getDuration()/Q>14){V3.Log.Error("adding cells to right took too long: "+X.getDuration()+"ms to add "+Q)}else{V3.Log.Warn("adding cells to right took a while: "+X.getDuration()+"ms to add "+Q)}}}Y.constructedRange.max=S}else{if(K){if(Y.constructedRange.max>S){if(this._debugMode){V3.Log.Debug("Removing "+(Y.constructedRange.max-S)+" cells from right")}for(var O=Y.constructedRange.max-1;O>=S;O--){Y.removeIndex(O)}Y.constructedRange.max=S}J=document.createDocumentFragment();P=true;if(this._debugMode){V3.Log.Debug("Adding cells to left");X.reset(true)}this.Controls._modifyDom=false;for(var O=L;O<Y.constructedRange.min;O++){var I=Y.createIndex(O);this.Controls.addAt(0,I);J.appendChild(I.DOMElement);Y.constructedRange.lookup[O]=I}this.Controls._modifyDom=true;if(this._debugMode){X.stop();var Q=(Y.constructedRange.min-L);if(X.getDuration()/Q>3){V3.Log.Warn("adding cells to left took a while: "+X.getDuration()+"ms to add "+Q)}}Y.constructedRange.min=L}}if(K&&this.DOMContainer.childNodes.length>0){this.DOMContainer.insertBefore(J,this.DOMContainer.childNodes[0])}else{this.DOMContainer.appendChild(J)}if(P){if(this._debugMode){V3.Log.Debug("Correcting Position Offset to index: "+Y.index+", offset: "+Y.constructedRange.lookup[Y.index].DOMElement.offsetLeft)}this._offset(Y.constructedRange.lookup[Y.index].DOMElement.offsetLeft);this.cssClassTransitionSync("animate-scroll")}if(this._debugMode){V3.Log.Watch("_templating",Y)}Y.index=U;return M},setCssClassNameOnCells:function(K,N,J,O){if(K>=N){return}var M=this._templating;for(var L=K;L<N;L++){var I=M.constructedRange.lookup[L];if(I){if(O){I.cssClassAdd(J)}else{I.cssClassRem(J)}}}},selectCells:function(M,N,I){var L=this._templating;var J=L.currentSelection;if(M===J.index&&N==J.length){if(this._debugMode){V3.Log.Debug("ensuring cells are highlighted")}L.setCssClassNameOnCells(J.index,J.index+J.length,J.cssClass,true,this)}else{if(this._debugMode){V3.Log.Debug("removing current highlight on cells")}L.setCssClassNameOnCells(J.index,J.index+J.length,J.cssClass,false,this);J.index=M;J.length=N;J.cssClass=I;if(this._debugMode){V3.Log.Debug("adding highlight on cells")}L.setCssClassNameOnCells(J.index,J.index+J.length,J.cssClass,true,this);var K=this._minDate.addDays(M);this.OnChangeSelectedCells.fire(this,{date:K,length:N})}},isInCurrentSelection:function(I){var J=this._templating.currentSelection;return(J.index<=I&&I<J.index+J.length)}},scrollToIndex:function(J,K,L){if(J<this._templating.allowedRange.min||J>=this._templating.allowedRange.max){throw new Error("index out of bounds")}var I=this._templating.ensureControlsAreCreatedForIndex(J);if(I===null){return}if(L!==false){if(V3.Utils.PageIsLoaded){this.scrollToControl(this._templating.constructedRange.lookup[J],!I&&K,L)}else{V3.Utils.OnLoad.addEventHandler(function(){this.scrollToControl(this._templating.constructedRange.lookup[J],!I&&K,L)}.bind(this))}}},enableTemplating:function(I){this._templating.allowedRange.min=I.minIndex;this._templating.allowedRange.max=I.maxIndex;this._templating.buffered.left=I.bufferLeft;this._templating.buffered.right=I.bufferRight;this._templating.visibleItemCount=I.visibleItemCount;if(I.createControlCallback){this._templating.createControlCallback=I.createControlCallback}if(I.controlDisposeCallback){this._templating.controlDisposeCallback=I.controlDisposeCallback}},get:function(I){return this._templating.constructedRange.lookup[I]},OnChangeSelectedCells:V3.EventPrototype("sender, e:{date:Date(), length:0 }"),selectCells:function(J,K,I){this._templating.selectCells(J,K,I||"selected")}});var q=function q(){this.base(this._doAdd,this._doRem)}.InheritsFrom(V3.Collection,{_index:null,_templateSettings:null,_doAdd:function(J,I,K){if(!(J instanceof B)){throw new Error("item must be an instance of ScrollingPanel")}K();this._initStrip(J,I);this._compileAnimationStepCallback()},_doRem:function(J,I,K){K();this._compileAnimationStepCallback()},_initStrip:function(J,I){if(this._templateSettings&&this._index!==null){J.enableTemplating(this._templateSettings);J.scrollToIndex(this._index,false)}},enableTemplating:function(I){this._templateSettings=I;this.forEach(function(J){J.enableTemplating(I)})},_compileAnimationStepCallback:function(){var J="";for(var I=1;I<this._collection.length;I++){J+="s["+I+"]._offset(-o); /*for(var x=0;x<10000;x++) for(var y=0;y<100000;y++);*/"}this._animationStepCallback=new Function("s","o",J).bind(this,this._collection)},_animationStepCallback:function(J){for(var I=1;I<this._collection.length;I++){this._collection[I]._offset(J)}},scrollToIndex:function(J,L,K){this._index=J;if(this.count()==0){return}var I=false;this.forEach(function(M){if(M._templating.ensureControlsAreCreatedForIndex(J)){I=true}if(!L){M._cssClassRem(true,"animate-scroll");M._cssClassRem(true,"fast-scroll")}else{M._cssClassAdd(true,"animate-scroll");if(L){if(I){M._cssClassAdd(true,"fast-scroll")}else{M._cssClassRem(true,"fast-scroll")}}}});this.forEach(function(M){var N=M.get(J);if(N){M.tempNewOffset=N.DOMElement.offsetLeft}});if(l.Function(K)){K(I)}this.forEach(function(M){if(V3.Is.Number(M.tempNewOffset)){M._offset(M.tempNewOffset);delete M.tempNewOffset}})},selectCells:function(I,J){this.forEach(function(K){K.selectCells(I,J)})}});var F=function F(I){if(!I){throw new Error("settings must be supplied")}if(!I.EndPoint){throw new Error("EndPoint must be supplied")}if(!I.Shortname){throw new Error("Shortname must be supplied")}this._endPointUrl=I.EndPoint;this._campaign=I.Campaign;this._channelShortname=I.Shortname;this._providerShortname=I.ProviderShortname;this._isInternalInjection=I.InternalInjection;this._brandingStyle=I.BrandingStyle;this._brandingView=I.BrandingView}.InheritsFrom(V3.Class,{_endPointUrl:"",_knownUrlKeys:["exl_dn","exl_psn","exl_acp","exl_dcp","exl_snc","exl_bku","exl_pgc","exl_srt","exl_dtx","exl_lid","exl_sid","exl_grp","exl_dte","exl_nts","exl_ad","exl_ch","exl_co","exl_dof"],_addOverridesThenRemove:function(I,J){this._knownUrlKeys.forEach(function(K){var L=I[K];if(V3.Is.Defined(L)){if(!V3.Is.String(L)){throw new Error("direct url parameter must be of type string, key:"+K+", value:"+L)}J[K]=L;delete I[K]}})},_doInjection:function(I,O,N){var K=document.createElement("form");K.action=this._endPointUrl;K.method="POST";K.target=(I?"_blank":"_top");var M=function(Q,R){var P=document.createElement("input");P.type="hidden";P.name=Q;if(R.toJSON){P.value=R.toJSON()}else{P.value=R.toString()}K.appendChild(P)};for(var J in O){var L=O[J];if(V3.Is.Specified(L)){M(J,L)}}if(N){for(var J in N){var L=N[J];if(V3.Is.Specified(L)){M("ext_"+J,L)}}}document.body.appendChild(K);K.submit();document.body.removeChild(K)},searchInjection:function(I){return this._gridPageInjection(I,"SearchInjection")},availabilityInjection:function(I){if(!I.ProviderShortname&&!I.exl_psn){throw new Error("ProviderShortname or exl_psn must be supplied")}return this._gridPageInjection(I,"AvailabilityInjection")},_gridPageInjection:function(R,J){if(!R){R={}}if(!R.Criteria){R.Criteria={}}if(!R.Criteria.Pax){R.Criteria.Pax={}}if(!R.Criteria.Destination){R.Criteria.Destination={}}var I=V3.extend(R.PostDto,false,{Favourites:R.Favourites,HighlightProductId:R.HighlightProductId});delete R.Favourites;var M=R.exl_acp||(this._campaign&&this._campaign.AdCampaignCode);var N=R.exl_dcp||(this._campaign&&this._campaign.DealCampaignCode);var O=null;if(M||N){if(R.exl_snc){O=R.exl_snc}else{if(R.ShowNonAdCampaignServices){if(R.ShowNonDealCampaignServices){O="true"}else{O="ad"}}else{if(R.ShowNonDealCampaignServices){O="deal"}}}}delete R.ShowNonAdCampaignServices;delete R.ShowNonDealCampaignServices;var Q=R.Criteria.Date;if(Q){if(V3.Is.Date(Q)){Q=Q.toStringFormat("date")}}var P=v.parse(R.Criteria.IndustryCategoryGroup);if(P==v.Accommodation){P="acc"}else{if(P==v.Activity){P="act"}}var K={type:J,data:JSON.stringify(I),exl_dn:R.exl_dn||this._channelShortname,exl_bs:R.exl_bs||this._brandingStyle,exl_bv:R.exl_bv||this._brandingView,exl_psn:R.exl_psn||R.ProviderShortname||this._providerShortname,exl_acp:M,exl_dcp:N,exl_snc:O,exl_pgc:!R.ServiceCodes?null:R.ServiceCodes.join(","),exl_ilc:!R.IncludedLocationCodes?null:R.IncludedLocationCodes.join(","),exl_srt:R.SortBy,exl_grp:P,exl_dtx:R.Criteria.Destination.Text,exl_lid:R.Criteria.Destination.LocationId,exl_sid:R.Criteria.Destination.ServiceId,exl_dte:Q,exl_nts:(R.Criteria&&R.Criteria.Nights),exl_ad:(R.Criteria.Pax.Adults||R.Criteria.Pax.Guests),exl_ch:(R.Criteria.Pax.Children),exl_co:(R.Criteria.Pax.Seniors),db_mod:V3.Utils.QueryString.db_mod};delete R.Criteria;if(!this._isInternalInjection){if(V3.Is.Specified(R.BackUrl)){K.exl_bku=R.BackUrl}else{K.exl_bku=document.location.href}}this._addOverridesThenRemove(R,K);K.options=JSON.stringify(R);var L=R.OpenInNewWindow;delete R.OpenInNewWindow;return this._doInjection(L,K,R.AdditionalParams)},bookingInjection:function(O,L){var J=V3.extend(L.PostDto,false,{Products:[]});if(O){O.forEach(function(P){J.Products.add({AdCampaignCode:P.AdCampaignCode,ProductId:P.ProductId,Commence:P.Commence.toStringFormat(),Conclude:P.Conclude.toStringFormat(),Pax:P.Pax,TotalPrice:P.TotalPrice,DealCampaignCode:P.DealCampaignCode})})}var K=L.exl_acp||(this._campaign&&this._campaign.AdCampaignCode);var I=L.exl_dcp||(this._campaign&&this._campaign.DealCampaignCode);var N={type:"BookingInjection",data:JSON.stringify(J),exl_dn:L.exl_dn||this._channelShortname,exl_bs:L.exl_bs||this._brandingStyle,exl_bv:L.exl_bv||this._brandingView,exl_psn:L.exl_psn||L.ProviderShortname||this._providerShortname,exl_acp:K,exl_dcp:I,db_mod:V3.Utils.QueryString.db_mod};if(!this._isInternalInjection){N.exl_bku=document.location.href}this._addOverridesThenRemove(L,N);N.options=JSON.stringify(L);var M=L.OpenInNewWindow;delete L.OpenInNewWindow;return this._doInjection(M,N,L.AdditionalParams)}});V3.Namespace("CABS");V3.CABS.EntityTypeEnum=f;V3.CABS.IndustryCategoryEnum=b;V3.CABS.IndustryCategoryGroupEnum=v;V3.CABS.AvailabilityMergeMethod=c;V3.CABS.Injection=F;V3.CABS.LocationTypeEnum=x;V3.Namespace("CABS.UI");V3.CABS.Utils=e;V3.CABS.UI.DisplayFeatures=w;V3.CABS.UI.DisplayEntityInfo=j;V3.CABS.UI.DisplayAccreditation=u;V3.CABS.UI.DisplayImages=n;V3.CABS.UI.DisplayAddress=H;V3.CABS.UI.DisplayRating=m;V3.CABS.UI.DisplayReviews=t;V3.CABS.UI.ScrollingPanel=B;V3.CABS.UI.ScrollingPanelsManager=q;V3.CABS.UI.TabsControl=s;V3.CABS.UI.ShowPrettyLightBox=G;V3.CABS.UI.PagingNavigation=a;V3.CABS.UI.ShowReviewsLightbox=C;V3.EventType.revertDefaultLoggingStatus()}); })(V3);
(function(V3){ //AUTO-GENERATED-DO NOT MODIFY 
V3.RegisterFile("V3.CABS.UI.RateGrid",1,[{FileName:"V3.Utils",Version:1.1},"V3.UI","V3.API.EntityService","V3.CABS.UI.Common"],function(){V3.Namespace("CABS.UI");var k=false;if(V3.debugMode){k=V3.debuggingEnabledFor("grid");V3.Log.Info("RateGrid in debug mode: "+k+". (db_mod=grid)")}V3.EventType.setDefaultLoggingStatus(k);var j=V3.Is;var q=V3.CABS.IndustryCategoryGroupEnum;var a=V3.CABS.IndustryCategoryEnum;var e=V3.CABS.EntityTypeEnum;var c=V3.CABS.AvailabilityMergeMethod;var h=V3.CABS.UI.DisplayEntityInfo;var s=V3.CABS.UI.ScrollingPanel;var n=V3.CABS.UI.ScrollingPanelsManager;var i=V3.CultureInfo.invariantCulture().dateTimeFormat().abbreviatedDayNames();var m={Date:new V3Date().date(),MinDate:new V3Date().date(),MaxDate:new V3Date().date().addYears(1),ShowHeader:true,ShowFullRateColumn:false,DayOfWeekAlignment:"Sunday",VisibleDays:14,HeaderRowSettings:{FormatString:'ddd"<span class=\'day\'>"d"</span>"MMM'},RateCellSettings:{Unavailable:{Text:""},Updating:{Text:""}},HighlightedDays:1};var u=function u(x){this.base(null,k);this.cssClassAdd("dates");this._minDate=x.MinDate;this._cellLookup={};this._formatString=x.FormatString}.InheritsFrom(s,{_cellLookup:{},_minDate:new V3Date(),OnDateClicked:V3.EventPrototype("sender, e:{date:V3Date}"),createCell:function(B,A,z){var y=this._minDate.addDays(A);if(!z){var x=this;z=new V3.UI.WebControlBasic("span").Set({OnClick:function(C,D){x.OnDateClicked.fire(x,{date:this.Date,cell:z})}});z.DateLabel=document.createElement("span");z.DateLabel.className="label";z.DOMElement.appendChild(z.DateLabel)}z.Date=y;z.cssClass("cell date "+i[y.getDay()].toLowerCase());z.DateLabel.innerHTML=y.toStringFormat(this._formatString,V3.CultureInfo.currentUICulture());this._cellLookup[A]=z;return z},disposeCell:function(z,y,x){delete this._cellLookup[y];return x}});var b=function b(x){this.base("span");if(window.vsDesignTime&&!x){x=window.getProviderSearchControlDefaultSettings(true).RateGridSettings.RateCellSettings}this._rateCellSettings=x;if(this._rateCellSettings.ShowCurrencySymbol){this._overrideCurrencyFormat=V3.CultureInfo.currentUICulture().currencyNumberFormat()}else{this._overrideCurrencyFormat=new V3.NumberFormatInfo({Symbol:""},V3.CultureInfo.currentUICulture().currencyNumberFormat())}this._updatingMarker.innerHTML=(this._rateCellSettings.Updating.Text||"");this.Insert(this._lbl,this._updatingMarker,this._img);this.reset()}.InheritsFrom(V3.UI.WebControlBasic,{_rateCellSettings:null,_lbl:V3.AutoConstruct(function(){var x=document.createElement("span");x.className="label";return x}),_updatingMarker:V3.AutoConstruct(function(){var x=document.createElement("span");x.className="updating-marker";x.innerHTML="Updating...";return x}),dailyRate:V3.Property(-1).OnChange(function(x){if(!x){this.cssClassAdd("unknown");this.cssClassRem("unavail");this._lbl.innerHTML=""}else{this.cssClassRem("unknown");if(x.IsAvailable){this.cssClassRem("unavail");var y=x.Rate.toStringFormat("C",this._overrideCurrencyFormat);this._lbl.innerHTML=y}else{this.cssClassAdd("unavail");this._lbl.innerHTML=(this._rateCellSettings.Unavailable.Text||"")}if(x.AvailableDealCampaignCode){if(this._rateCellSettings.Campaign&&this._rateCellSettings.Campaign.DealCampaignCode){if(x.AvailableDealCampaignCode==this._rateCellSettings.Campaign.DealCampaignCode){var z=this._rateCellSettings.Campaigns[this._rateCellSettings.Campaign.DealCampaignCode].CssClass;this.cssClassAdd("promo-mark mini "+z)}}else{if(!this._rateCellSettings.Campaigns){}else{var A=this._rateCellSettings.Campaigns[x.AvailableDealCampaignCode];if(A&&new V3Date(A.RedemptionPeriod.Start)<=new V3Date(x.Date)&&new V3Date(x.Date)<new Date(A.RedemptionPeriod.Finish)){this.cssClassAdd("promo-mark mini "+A.CssClass)}}}}}}),reset:function(){this.cssClass("cell rate unknown")}});var d=function d(y){this.base(null,k);this._rateCellSettings=y;this._minDate=y.MinDate;this.cssClassAdd("rates");var x=this.selectCells;this.selectCells=function(B,C,z){var A=x.apply(this,arguments);this._checkIfSelectedCellsAreAvailable();return A}}.InheritsFrom(s,{_cellLookup:V3.AutoConstruct(Object),_availabilityLookup:V3.AutoConstruct(Object),OnRateClicked:V3.EventPrototype("sender, e:{date:V3Date}"),OnSelectedCellsAvailabilityChanged:V3.EventPrototype("sender, e:{isAvail:true}"),_selectedCellsAreAvailable:false,createCell:function(B,A,x){var z=new V3Date(this._minDate).addDays(A);if(x){x.reset()}else{var y=this;x=new b(this._rateCellSettings).Set({OnClick:function(C,D){y.OnRateClicked.fire(y,{date:this.Date,cell:x})}})}x.Date=z;x.cssClassAdd(i[x.Date.getDay()].toLowerCase());this._cellLookup[A]=x;x.dailyRate(this._availabilityLookup[A]);return x},disposeCell:function(z,y,x){x.cssClassRem(i[x.Date.getDay()].toLowerCase());delete this._cellLookup[y];return x},_checkIfSelectedCellsAreAvailable:function(){var y=this._templating.currentSelection;var z=true;for(var x=y.index;x<y.index+y.length;x++){if(!this._availabilityLookup[x]||!this._availabilityLookup[x].IsAvailable){z=false;break}}if(z!==this._selectedCellsAreAvailable){this._selectedCellsAreAvailable=z;this.OnSelectedCellsAvailabilityChanged.fire(this,{isAvail:z})}},isMissingAvailability:function(){var x=this._templating.index;var z=x+this._templating.visibleItemCount;for(var y=x;y<z;y++){if(!this._availabilityLookup[y]){return true}}return false},setAvailability:function(B){for(var A=0;A<B.Calendar.DailyRates.length;A++){var y=B.Calendar.DailyRates[A];var z=new V3Date(y.Date).getDaysBetween(this._minDate);this._availabilityLookup[z]=y;var x=this._cellLookup[z];if(x){x.dailyRate(y)}if(this._templating.isInCurrentSelection(z)){this._checkIfSelectedCellsAreAvailable()}}},hasAvailability:function(z){var y=z.asV3Date().getDaysBetween(this._minDate);var x=this._availabilityLookup[y];if(x&&x.IsAvailable){return true}else{return false}},selectedCellsAreAvailable:function(){return this._selectedCellsAreAvailable}});var f=function f(x){this.base("row");this._owner=x;if(!x.showFullRateColumn()){this.FullRateCell=null}var y=this;this.Controls._onAdd=function(z){if(z instanceof s){y._SP=z}else{z.activateContainer()}};this.OnVisibleChange.addEventHandler(this._onVisibleChanged)}.InheritsFrom(V3.UI.Panel,{AssociatedRows:V3.Collection(function p(A,y,z){A.cssClassAdd("associated");var x=y==0?this:this.AssociatedRows.get(y-1);this._owner.Rows.insertAfter(A,x);z()},function v(z,x,y){z.cssClassRem("associated");this._owner.Rows.remove(z);y()}).InjectOwner(),_expandedHeight:null,recalculateHeight:function(A){var y=this.collapsed();if(A||y||!this._expandedHeight){var z=this.DOMElement.style.height;this.DOMElement.style.height="auto";this._expandedHeight=this.DOMElement.clientHeight;this.DOMElement.style.height=z;var B=this.DOMElement.clientHeight}var x=(y?0:this._expandedHeight);this.DOMElement.style.height=x+"px";if(this._SP){this._SP.DOMContainer.style.height=x+"px"}},_onVisibleChanged:function(y,x){if(x){setTimeout(this.recalculateHeight.bind(this),50)}},collapsed:V3.Property(false).OnChange(function(x){if(!x){this.visible(true);this.cssClassRem("collapsed");this.Style({height:this._expandedHeight})}else{this.cssClassAdd("collapsed");this.visible(false);this.Style({height:0});this.AssociatedRows.forEach(function(y){y.collapsed(true)})}})});var o=function o(x,y){this.base(x);this.enableLeftScroll=this._btnNavLeft.enabled;this.enableRightScroll=this._btnNavRight.enabled;if(!y.MinDate){throw new Error("MinDate must be supplied in the headerRowSettings")}this.Strip=new u({FormatString:y.FormatString,MinDate:y.MinDate}).Set({cssClassAdd:"cell",OnDateClicked:this.OnDateClicked});this.StripCell=this.Strip;if(x.showFullRateColumn()){this.FullRateCell=new V3.UI.Panel().Set({cssClass:"container full-rate"}).Insert("Full Rate")}this.FirstCell.OnClick.addEventHandler(function(z,A){this._btnNavLeft.performClick()}.bind(this));this.LastCell.OnClick.addEventHandler(function(z,A){this._btnNavRight.performClick()}.bind(this));this._btnNavLeft.text("");this._btnNavRight.text("");this.Insert(this.FirstCell.Insert(this._btnNavLeft.Insert(new V3.UI.Label("< Scroll left"))),this.FullRateCell,this.StripCell,this.LastCell.Insert(this._btnNavRight.Insert(new V3.UI.Label("Scroll Right >"))))}.InheritsFrom(f,{OnNavigate:V3.EventPrototype("sender, e:{direction:left | right}"),OnDateClicked:V3.EventPrototype("sender, e:{date:V3Date}"),FirstCell:V3.UI.Panel().Defaults({cssClass:"cell navigate left"}),FullRateCell:null,LastCell:V3.UI.Panel().Defaults({cssClass:"cell navigate right"}),_btnNavLeft:V3.UI.HyperLink("","< Scroll Left").Defaults({OnClick:function(x,y){if(y){y.Event.stopPropagation()}this.OnNavigate.fire(this,{direction:"left"})}}),_btnNavRight:V3.UI.HyperLink("","Scroll Right >").Defaults({OnClick:function(x,y){if(y){y.Event.stopPropagation()}this.OnNavigate.fire(this,{direction:"right"})}}),recalculateHeight:function(){}});var r=function r(y,x){this.base(y);this.cssClassAdd("rates");if(window.vsDesignTime&&!x){x=window.getProviderSearchControlDefaultSettings(true).RateGridSettings}var z=x.RateCellSettings;z.Campaign=x.Campaign;z.Campaigns=x.Campaigns;z.ShowCurrencySymbol=x.ShowCurrencySymbol;this._stripContainer=new V3.UI.Panel().Set({cssClass:"cell strip"});this.StripCell=this.Strip=new d(z).Set({cssClassAdd:"cell",OnRateClicked:this.OnRateClicked});if(y.showFullRateColumn()){this.FullRateCell=new V3.UI.Panel().Set({cssClass:"cell full-rate"}).Insert("Full Rate")}this.Insert(this.FirstCell,this.FullRateCell,this.StripCell,this.LastCell)}.InheritsFrom(f,{FirstCell:V3.UI.Panel().Defaults({cssClass:"cell name"}),FullRateCell:null,LastCell:V3.UI.Panel().Defaults({cssClass:"cell controls"}),OnRateClicked:V3.EventPrototype("sender, e:{date:V3Date}"),_fullRate:null});var w=function w(x){this.base("rate-grid");this.Controls=this.Rows;x=V3.extend(x,false,m);this._rateGridSettings=x;this._apiEntityService=new V3.API.EntityWebService(x.EntityServiceApiSettings);var y=new V3Date(x.Date||x.MinDate||x.MaxDate||null).date();this._minDate=new V3Date(x.MinDate||x.MaxDate||y.addDays(-7)).date();if(this._minDate<new V3Date()){this._minDate=new V3Date().date()}this._numberOfDays=new V3Date(x.MaxDate||this._minDate.addMonths(2)).date().getDaysBetween(this._minDate)+1;if(this._numberOfDays<x.VisibleDays){this._numberOfDays=x.VisibleDays}this.dayOfWeekAlignment(x.DayOfWeekAlignment);this.showFullRateColumn(x.ShowFullRateColumn);this.size(x.VisibleDays);this.date(y);this.highlightedDays(x.HighlightedDays);x.RateCellSettings.Date=this.date();x.RateCellSettings.MinDate=this._minDate;x.RateCellSettings.MaxDate=this._minDate.addDays(this._numberOfDays);if(x.ShowHeader){this.Insert(this.createNavigationRow(x.HeaderRowSettings))}this.OnVisibleChange.addEventHandler(function(A,z){if(z){this._updateScrollingPanelWidths()}})}.InheritsFrom(V3.UI.Panel,{OnDateChanged:V3.EventPrototype("sender, e:{date:V3Date}"),OnRowAdded:V3.EventPrototype("sender, e:{Row: row}"),Rows:V3.UI.ControlCollection(f).InjectOwner().Defaults({OnChange:function(y,z){var A=z.item;if(z.action=="add"){this._updateScrollingPanelWidths();this._updateRow(A,this.scrollingPanelWidth());this.OnRowAdded.fire(this,{Row:A})}else{if(z.action=="remove"){A.AssociatedRows.clear();if(A.Strip){this._stripManager.remove(A.Strip)}if(A.Entity){delete this._rowLookup[A.Entity.Id];delete this._pendingRowAvailability[A.Entity.Id];if(A.Entity.Children){for(var x=0;x<A.Entity.Children.length;x++){delete this._pendingRowAvailability[A.Entity.Children[x].Id]}}}}}}}),_apiEntityService:!window.vsDesignTime?null:new V3.API.EntityWebService(),_stripManager:n(),_index:0,_startIndex:0,_numberOfDays:0,_maxIndex:0,_maxVisibleIndex:0,_minDate:new V3Date(),_rowLookup:V3.Object(),_pendingRowAvailability:V3.Object(),_rateGridSettings:!window.vsDesignTime?null:window.getProviderSearchControlDefaultSettings(true).RateGridSettings,_createControlCallback:function(y,x,z){var z=y.createCell(y,x,z);return z},_controlDisposeCallback:function(y,x,z){return y.disposeCell(y,x,z)},updateInProgress:V3.Property(false).OnChange(function(y,x){if(y){this.cssClassAdd("updating")}else{this.cssClassRem("updating")}}),_canAlignDOW:function(){return(this.dayOfWeekAlignment()&&this.highlightedDays()+4<=this.size())},_updateStartDate:function(A){var z=this.date().asV3Date();var C=(z<this.startDate());if(A||C){var x=z;if(this._canAlignDOW()){x=x.getLastDOW(this.dayOfWeekAlignment(),V3.CultureInfo.invariantCulture())}x=V3Date.max(this._minDate,x);this.startDate(x)}else{var y=V3Date.max(this._minDate,z.addDays(this.highlightedDays()));var B=y>this.startDate().addDays(this.size());if(B){var x;if(this._canAlignDOW()){x=z.getLastDOW(this.dayOfWeekAlignment(),V3.CultureInfo.invariantCulture())}else{if(this.highlightedDays()<this.size()){x=z.addDays(this.highlightedDays()-this.size())}else{x=z}}x=V3Date.max(this._minDate,x);this.startDate(x)}}},ensureDateVisible:function(){this._updateStartDate()},_createRowForProduct:function(y,B,x){var C=new r(this,this._rateGridSettings).Set({cssClassAdd:"product",OnRateClicked:function(D,E){if(!this.date().equals(E.date)){this.date(E.date);E.changedDate=true}}.bind(this)});C.Entity=y;C.FirstCell.Insert(new h(y,B&&B.Settings&&B.Settings.Terminology));if(k){C.FirstCell.Insert(y.Code)}this._rowLookup[C.Entity.Id]=C;this._stripManager.add(C.Strip);C.Strip.selectCells(this._index,this.highlightedDays());if(y.Availability&&y.Availability.Calendar){this._displayAvailabilityForEntity(y)}else{this.cssClassTransitionSync("updating");this._fetchAvailability(true)}var z=this._pendingRowAvailability[y.Id];if(z){delete this._pendingRowAvailability[y.Id];for(var A=0;A<z.length;A++){C.Strip.setAvailability(z[A])}}return C},_addProductRowsForService:function(x,A){var z=new V3.UI.HyperLinkToggle("View",true).Set({cssClass:"button blue display-products",OnToggle:function(B,C){A.productRowsVisible(!C.collapsed)}});A.btnView=z;var y=this;A.OnRenderChildren=new V3.EventType("OnRenderChildren","sender",true);A.OnRenderChildren.addEventHandler(function(){A._renderChildren=V3.Constants.EMPTY_FUNCTION;x.Children.forEach(function(B){A.AssociatedRows.add(y._createRowForProduct(B,x,A))})});A.productRowsVisible=new V3.Property(A,true);A.productRowsVisible.OnChange.addEventHandler(function(B){if(B){A.OnRenderChildren.fire(this)}z.collapsed(!B);if(B){z.text(V3.Res["RateGrid.Button.View"]||"View")}else{z.text(V3.Res["RateGrid.Button.View"]||"View")}A.AssociatedRows.forEach(function(C){if(!C.Entity){return}C.collapsed(!B)});if(B){A.cssClassAdd("showing-products");if(A.Parent.Controls.indexOf(A)==1){A.Parent.Controls.get(0).cssClassAdd("showing-products")}}else{A.cssClassRem("showing-products");if(A.Parent.Controls.indexOf(A)==1){A.Parent.Controls.get(0).cssClassRem("showing-products")}}});A.productRowsVisible(false);A.LastCell.Insert(z);A.LastCell.OnClick.addEventHandler(function(B,C){z.performClick()});A.OnRateClicked.addEventHandler(function(B,C){A.productRowsVisible(C.changedDate||!A.productRowsVisible())})},_addRowForService:function(z,y,x){var A=new r(this,this._rateGridSettings).Set({cssClassAdd:"service",OnRateClicked:function(B,C){if(!this.date().equals(C.date)){this.date(C.date);C.changedDate=true}}.bind(this)});A.Entity=z;A.FirstCell.Insert(new h(z));if(k){A.FirstCell.Insert(z.Code)}this._rowLookup[A.Entity.Id]=A;this.Rows.insertAfter(A,x);if(y&&z.Children){this._addProductRowsForService(z,A)}this._stripManager.add(A.Strip);A.Strip.selectCells(this._index,this.highlightedDays());if(z.Availability&&z.Availability.Calendar){this._displayAvailabilityForEntity(z)}else{this.cssClassTransitionSync("updating");this._fetchAvailability(true)}return A},_displayAvailabilityForEntity:function(y){y=y||DebugResponse().Entities[0];if(!y.Availability||!y.Availability.Calendar){throw new Error("entityService has no availability data.")}var z=this._rowLookup[y.Id];if(z){z.Strip.setAvailability(y.Availability)}else{var x=this._pendingRowAvailability[y.Id];if(!x){x=this._pendingRowAvailability[y.Id]=[]}x.add(y.Availability)}if(y.Children&&y.Children.length>0){this._displayAvailabilityForEntities(y.Children)}},_displayAvailabilityForEntities:function(y){for(var x=0;x<y.length;x++){this._displayAvailabilityForEntity(y[x])}},_getRequestAvailability:function(){return{StartDate:this.startDate().toStringFormat("yyyy-MM-dd"),NumberOfDays:this.size(),MergeMethod:c.LowestRateForCampaign,IncludeCampaigns:true}},_fetchAvailabilityTransactionId:null,_fetchAvailabilityTimerId:null,_fetchAvailability:function(y){this._fetchAvailabilityTransactionId=null;if(this._fetchAvailabilityTimerId){if(k){V3.Log.Debug("Cancelling ajax request delay timer")}clearTimeout(this._fetchAvailabilityTimerId);this._fetchAvailabilityTimerId=null}if(V3.isEmpty(this._rowLookup)){return}this.updateInProgress(true);if(y){if(k){V3.Log.Debug("Creating ajax request delay timer for 350ms...")}this._fetchAvailabilityTimerId=setTimeout(this._fetchAvailability.bind(this),1200);return}if(k){V3.Log.Debug("Performing call for availability now")}var x=[];var z=null;V3.forEach(this._rowLookup,function(B){if(B.Strip&&B.Strip instanceof d){if(!z){z=B.Entity.Type}x.add(B.Entity.Id,true);if(B.Entity.Children){for(var A=0;A<B.Entity.Children.length;A++){x.add(B.Entity.Children[A].Id,true)}}}});this._apiEntityService.Search(this._apiAvailability_OnSuccess.bind(this),this._apiAvailability_OnFailure.bind(this),{TransactionId:this._fetchAvailabilityTransactionId=V3.newId(),CurrentCurrency:currentCurrency,Campaign:this._rateGridSettings.Campaign,Filter:{Ids:x,Type:z,MustBeInAdCampaign:false,MustBeInDealCampaign:false},Output:{Availability:this._getRequestAvailability(),Children:z==e.Product?null:{Filter:{Ids:x,Type:e.Product},Output:{Availability:this._getRequestAvailability()}}}})},_apiAvailability_OnSuccess:function(x){this._displayAvailabilityForEntities(x.Entities);if(x.TransactionId===this._fetchAvailabilityTransactionId){this.updateInProgress(false)}this._fetchAvailabilityTransactionId=null},_apiAvailability_OnFailure:function(x){if(!x.TransactionId||data.TransactionId===this._fetchAvailabilityTransactionId){alert("Failed to fetch availability. Please try again later.\r\nError: "+x.message);this.updateInProgress(false)}},showFullRateColumn:V3.Property(false,function l(x){if(x){this._cssClassAdd(true,"has-full-rate")}else{this._cssClassAdd(true,"no-full-rate")}}),highlightedDays:V3.Property(0,function l(z,x,y){if(!j.Number(z)){throw new Error("not a number")}if(z>this._numberOfDays){z=y.value=this._numberOfDays}}).OnChange(function g(x){if(x>1){if(this.date().addDays(x)>this._maxDate){this.date(this._maxDate.addDays(1-x));return}}this._updateStartDate();this._stripManager.selectCells(this._index,this.highlightedDays())}),dayOfWeekAlignment:V3.Property("Sunday",function l(x){new V3Date().getLastDOW(x,V3.CultureInfo.invariantCulture())}).OnChange(function g(x){this._updateStartDate(true)}),size:V3.Property(0,function l(y,x){if(!y||y<=0){throw new Error("size must be greater than zero")}}).OnChange(function g(x){this._maxIndex=(this._numberOfDays)-x;this._stripManager.enableTemplating({createControlCallback:this._createControlCallback.bind(this),controlDisposeCallback:this._controlDisposeCallback.bind(this),minIndex:0,maxIndex:this._numberOfDays,bufferLeft:7,bufferRight:7,visibleItemCount:x});this._updateScrollingPanelWidths()}),_updateNavigation:function(){this._cssClassToggle(true,(this.canScrollLeft()||this.canScrollRight()),"navigation-enabled","navigation-disabled")},canScrollLeft:V3.Property(true).OnChange(function(){this._updateNavigation()}),canScrollRight:V3.Property(true).OnChange(function(){this._updateNavigation()}),startDate:V3.Property(null,function l(z,x,y){z=y.value=V3Date.max(this._minDate,V3Date.min(this._minDate.addDays(this._maxIndex),new V3Date(z)));if(z==x){return false}}).OnChange(function g(y){this._startIndex=y.asV3Date().getDaysBetween(this._minDate);this.canScrollLeft(this._startIndex>0);this.canScrollRight(this._startIndex<this._maxIndex);if(k){var x=new V3.Utils.StopWatch(true)}var z=false;this._stripManager.scrollToIndex(this._startIndex,true,function(A){this._stripManager.forEach(function(B){if(B instanceof d){if(B.isMissingAvailability()){z=true;return false}}}.bind(this))}.bind(this));if(z){this._fetchAvailability(true)}this.cssClassTransitionSync("updating");if(k){x.stop();if(x.getDuration()>10&&x.getDuration()/this._stripManager.count()>35){V3.Log.Warn("Scrolling the rows took "+x.getDuration()+"ms.")}}}),date:V3.Property(null,function l(z,x,y){z=y.value=V3Date.max(this._minDate,V3Date.min(this._minDate.addDays(this._numberOfDays),new V3Date(z)));if(V3Date.equals(z,x)){return false}this._index=z.getDaysBetween(this._minDate)}).OnChange(function g(z,y){var x=(y===null);this._updateStartDate(x);this._stripManager.selectCells(this._index,this.highlightedDays());this.OnDateChanged.fire(this,{date:z})}),minDate:V3.Property(function t(){return new V3Date(this._minDate)}),maxDate:V3.Property(function t(){return this._minDate.addDays(Math.max(0,this._numberOfDays-1))}),createNavigationRow:function(x){x.MinDate=this._minDate;var y=new o(this,x).Set({cssClassAdd:"navigation",enableLeftScroll:this.canScrollLeft,enableRightScroll:this.canScrollRight,OnNavigate:function(z,A){if(A.direction==="left"){this.scrollLeft()}else{this.scrollRight()}}.bind(this),OnDateClicked:function(z,A){this.date(A.date)}.bind(this)});this._stripManager.add(y.Strip);y.Strip.selectCells(this._index,this.highlightedDays());return y},addRowForEntity:function(A,y,x,z){if(A.Type==e.Service){return this._addRowForService(A,y,x)}else{if(A.Type==e.Product){var B=this._createRowForProduct(A,z||(x&&x.Entity),x);this.Rows.add(B);return B}else{throw new Error("The specified entity is not supported.")}}},createRow:function(){var y=new f(this);var x=this;y.Controls.OnChange.addEventHandler(function(){x._updateRow(y,x.scrollingPanelWidth())});return y},scrollLeft:function(y){if(!j.Number(y)){y=7}var x=this.startDate().asV3Date().addDays(-y);if(y>=7&&this._canAlignDOW()){x=x.getLastDOW(this.dayOfWeekAlignment(),V3.CultureInfo.invariantCulture());if(this.startDate().getDaysBetween(x)>7){x=x.addDays(7)}}this.startDate(x)},scrollRight:function(y){if(!j.Number(y)){y=7}var x=this.startDate().asV3Date().addDays(y);if(y>=7&&this._canAlignDOW()){x=x.getLastDOW(this.dayOfWeekAlignment(),V3.CultureInfo.invariantCulture())}this.startDate(x)},cancelUpdate:function(){this._fetchAvailabilityTransactionId=null;if(this._fetchAvailabilityTimerId){clearTimeout(this._fetchAvailabilityTimerId)}this.updateInProgress(false)},scrollingPanelWidth:V3.Property(0).OnChange(function(x){this._updateAllRows()}),_updateAllRows:function(){var z=this.Rows.count();var y=this.scrollingPanelWidth();for(var x=0;x<z;x++){this._updateRow(this.Rows.get(x),y)}},_updateRow:function(y,x){if(y&&y.StripCell&&x){y.StripCell.DOMElement.style.width=x+"px";y.StripCell.DOMElement.style.flexBasis=x+"px";y.StripCell.DOMElement.style.msFlexPreferredSize=x+"px";if(y.StripCell.DOMContainer){y.StripCell.DOMContainer.style.width=x+"px"}}},_updateScrollingPanelWidths:function(){if(this.Rows.count()==0){return}var y=this.Rows.get(0);if(!y){return}if(y.Strip.Controls.count()==0){return}var x=y.Strip.Controls.get(0);var A=x.DOMElement.offsetWidth;var z=this.size()*A;this.scrollingPanelWidth(z)}});V3.CABS.UI.RateGrid=w;V3.CABS.UI.RateRow=r;V3.EventType.revertDefaultLoggingStatus()}); })(V3);
(function(V3){ //AUTO-GENERATED-DO NOT MODIFY 
V3.RegisterFile("V3.CABS.UI.SearchControl",1,["V3.Utils","V3.UI","V3.CABS.UI.Common"],function(){V3.Namespace("CABS.UI");var i=V3.UI;var e=V3.CABS.IndustryCategoryGroupEnum;var f=V3.CABS.LocationTypeEnum;var d={EntityServiceApiSettings:{},Campaign:null,Terminology:null,InitialDestinations:["Perth, Western Australia","Melbourne, Victoria","Brisbane","Sydney","Darwin","Adelaide","Hobart","Canberra"],CompactPax:false,MaximumPax:20,ShowTabs:true,SmallTabs:false,ShowSearchButton:true,ShowDate:true,ShowDestination:true,MinDate:new V3Date(new V3Date().toStringFormat("yyyy-MM-dd")),MaxDate:new V3Date(new V3Date().toStringFormat("yyyy-MM-dd")).addDays(365),DateFormatString:"ddd, dd-MMM-yyyy",NightsOptional:false,PaxOptional:false,ButtonText:"Search",ShowChildren:true,ShowSeniors:true,DestinationCompulsory:false,MaxDestinationsToDisplay:10,IncludeBusinesses:true,AllowedLocationCodes:null,AllowedLocationTypes:[f.City,f.Region],ShowAccommodation:true,ShowActivity:true,PriceRanges:[50,100,150,200,250,300,350,400,450,500],Criteria:{Destination:{LocationId:null,BusinessId:null,Text:null},IndustryCategoryGroup:e.Accommodation,Date:new V3Date(),Nights:2,Pax:{Adults:2,Children:0,Seniors:0}}};var b=function b(k){this.base();var m=k.InitialDestinations;var j=k.ICGroup;var n=k.EntityServiceApiSettings.EndPoint;this._shortname=k.EntityServiceApiSettings.Shortname;this._campaign=k.Campaign;this._terms=k.Terminology;this._includeBusinesses=k.CanIncludeBusinesses;this._allowedLocationParentCodes=k.AllowedLocationCodes;this._allowedLocationTypes=k.AllowedLocationTypes;this.OnVisibleChange.addEventHandler(function(p,o){if(o&&this.Controls.count()==0){this.performSearch(this._lastSearchText)}});if(m&&m.length>0){if(this._allowedLocationParentCodes&&this._allowedLocationParentCodes.length>0&&m===d.InitialDestinations){this._initialDestinations.add("%")}else{this._initialDestinations.addRange(m)}}if(!V3.WebServices||!V3.WebServices.LocationService){var l=n;if(!l){if(!window.vsDesignTime){V3.Log.Error("LocationService cannot be loaded because the serviceEndPointUrl has not been defined")}else{l="/CABS4/Services/LocationService.asmx/GetJavascript"}}V3.Dynamic.LoadScript("V3.API.LocationService",l)}}.InheritsFrom(V3.UI.Panel,{_initialDestinations:V3.AutoConstruct(Array),_initialDestinationsResponse:null,_initialDestinationsAreCodes:false,_shortname:null,_searchDelayTimerId:null,_updatingMarker:V3.UI.Label("Updating...").Defaults({cssClass:"updating-marker"}),_lastSearchText:null,OnLocationSelected:new V3.EventPrototype("sender, location"),OnBusinessSelected:new V3.EventPrototype("sender, business"),industryCategoryGroup:V3.Property(e.Accommodation).OnChange(function(j){if(this.visible()){this.performSearch(this._lastSearchText)}else{this.clearResults()}}),_getHeadingName:function(j){switch(j){case f.Country:return"Countries";case f.State:return"States/Territories";case f.Region:return"Regions";case f.City:return"Cities";case f.Landmark:return"Landmarks";case e.Accommodation:return V3.CABS.Utils.GetTerm("ICGAccommodation",this._terms);case e.Activity:return V3.CABS.Utils.GetTerm("ICGActivity",this._terms)}},_showUpdating:function(){this.cssClassAdd("no-results");this.Controls.clear();this.Insert(this._updatingMarker)},_searchFailed:function(j){this.Controls.clear();this.Insert(new V3.UI.Label(V3.Res["Search.Error.Unexpected"]||"Unexpected error has occurred").Set({cssClass:"error"}))},_searchSuccess:function(l){this.Controls.clear();var j=l.Data;var k=l.Parents;if(j.length==0){this.Insert(new V3.UI.Label(V3.Res["Search.Error.NoDestinationFound"]||"No Destinations found.").Set({cssClass:"no-results"}));return}this.cssClassRem("no-results");var m;m=null;var o=null;var p=this;var n=true;V3.forEach(j,function(s){if(m!=s.Type){m=s.Type;var t=e.parse(s.Type)||f.fromValue(s.Type);var r=new V3.UI.Panel().Set({cssClass:"type "+t.toString().toLowerCase()});if(t!=e.Accommodation&&t!=e.Activity){if(n){n=false;r.cssClassAdd("first-location")}}o=new V3.UI.WebControl("ul");var w=p._getHeadingName(t);p.Insert(r.Insert(new V3.UI.Label().Set({cssClass:"data-icon "+V3.CABS.Utils.GetCssClassNameFromEnum(t)}),new V3.UI.Label("h3",w),o))}var v=s.Name;var u=null;if(s.Type==f.City||s.Type==f.Region){var x=k[s.ParentLocationId];if(x){if(p._allowedLocationParentCodes&&p._allowedLocationParentCodes.contains(x.Code)){u=null}else{u=V3.CABS.Utils.TryAbbreviateStateName(x.Name)}}}var q=new V3.UI.HyperLink(null,v).Set({cssClass:"result",OnClick:function(z,A){var y;if(s.Type==e.Accommodation||s.Type==e.Activity){y=p.OnBusinessSelected.fire(p,s)}else{y=p.OnLocationSelected.fire(p,s)}}});if(u){q.Insert(new V3.UI.Label(" ("+u+")").Set({cssClass:"parent"}))}o.Insert(new V3.UI.WebControl("li").Insert(document.createComment(s.Id),q))})},clearResults:function(){this.Controls.clear()},maxDestinationsToDisplay:V3.Property(10),performSearch:function(l){if(!l){l=""}var j=this;if(l.length>=1){if(this._searchDelayTimerId){clearTimeout(this._searchDelayTimerId);this._searchDelayTimerId=null}this._lastSearchText=l;this._showUpdating();this._searchDelayTimerId=setTimeout(function(){V3.WebServices.LocationService.Search(j._searchSuccess.bind(j),j._searchFailed.bind(j),{Campaign:{AdCampaignCode:null,DealCampaignCode:this._campaign&&this._campaign.DealCampaignCode},ParentCodes:j._allowedLocationParentCodes,Names:["%"+l+"%"],DistributorShortname:j._shortname,IndustryCategoryGroup:j.industryCategoryGroup(),MaxResultsToReturn:j.maxDestinationsToDisplay(),Types:[].addRange(j._allowedLocationTypes).addRange(!j._includeBusinesses?[]:[e.Accommodation,e.Activity])})},600)}else{if(this._initialDestinations.length==0){this._lastSearchText=null;this.clearResults()}else{this._lastSearchText=null;if(this._initialDestinationsResponse){j._searchSuccess(j._initialDestinationsResponse)}else{this._showUpdating();V3.WebServices.LocationService.Search(function k(m){j._initialDestinationsResponse=m;j._searchSuccess(j._initialDestinationsResponse)},this._searchFailed.bind(this),{Campaign:{AdCampaignCode:null,DealCampaignCode:this._campaign&&this._campaign.DealCampaignCode},ParentCodes:j._allowedLocationParentCodes,Codes:this._initialDestinationsAreCodes?j._initialDestinations:null,Names:this._initialDestinationsAreCodes?null:j._initialDestinations,DistributorShortname:j._shortname,IndustryCategoryGroup:null,MaxResultsToReturn:j.maxDestinationsToDisplay(),Types:j._allowedLocationTypes})}}}}});var c=function c(k){this.base("destination-selector");if(k&&k.PriceRanges===null){delete k.PriceRanges}var m=V3.extend({},false,d);k=V3.extend(k,false,m);this.Style({position:"relative"});var n;var j=!!k.EntityServiceApiSettings.Shortname&&(k.IncludeBusinesses!==false);this._channelShortname=k.EntityServiceApiSettings.Shortname;var l=new V3.UI.TextBox().Set({OnChange:function(o,p){if(p.changedByUser){n.visible(true);if(!p.text){this._blockFireOnChange=true;this.location(null);this.service(null);this._blockFireOnChange=false}this.text(p.text);this._fireOnChange("text")}}.bind(this),OnFocus:function(){this.selectAll()},placeholder:V3.CABS.Utils.ProcessPlaceholders(j?(V3.Res["Search.Placeholder.DestinationOrBusinessName"]||"{wordDestination} or {wordBusiness} Name"):(V3.Res["Search.Placeholder.DestinationName"]||"{wordDestination} Name"),{"{wordDestination}":V3.CABS.Utils.GetTerm("Destination",k.Terminology),"{wordBusiness}":V3.CABS.Utils.GetTerm("Business",k.Terminology)}),maxLength:100});this.Insert(l);k.CanIncludeBusinesses=j;n=new b(k).Set({cssClass:"location-search-results",visible:false,maxDestinationsToDisplay:k.MaxDestinationsToDisplay,OnLocationSelected:function(p,o){p.visible(false);this.location(o)}.bind(this),OnBusinessSelected:function(p,o){p.visible(false);this.service(o)}.bind(this)});l.attachedPanel(n);this.industryCategoryGroup=n.industryCategoryGroup;if(k.Criteria&&k.Criteria.Destination){if(k.Criteria.Destination.LocationId){this.setLocationFromId(k.Criteria.Destination.LocationId)}else{if(k.Criteria.Destination.ServiceId){this.setServiceFromId(k.Criteria.Destination.ServiceId)}else{if(k.Criteria.Destination.Text){l.text(k.Criteria.Destination.Text)}}}}if(l.text()!=""){n.performSearch(l.text())}this._ctrlResults=n;this.TextBox=l}.InheritsFrom(V3.UI.Panel,{OnChange:V3.EventPrototype("sender, e"),_blockFireOnChange:false,_fireOnChange:function(j){if(!this._blockFireOnChange){this.OnChange.fire(this,{})}},_bound:!window.vsDesignTime?null:{obj:null,field:null},bind:function(m,l){var j=this._bound;if(m){j=this._bound={obj:m,field:l};if(!m[l]){m[l]={}}}var k;if(k=j.obj[j.field].Text){this.text(k)}if(k=j.obj[j.field].Location){this.location(k)}else{if(k=j.obj[j.field].LocationId){this.setLocationFromId(k)}}if(k=j.obj[j.field].Service){this.service(k)}else{if(k=j.obj[j.field].ServiceId){this.setServiceFromId(k)}}},setLocationFromId:function(l,k,j){var n=this;var m=function(p){if(j){j(sender,p)}};var o=function(p){if(p.Data.length==1){n.text("");n.location(p.Data[0]);if(k){k(sender,p)}}else{m({message:"Not found"})}};V3.WebServices.LocationService.Search(o,m,{Ids:[l],Types:[f.State,f.City,f.Region]})},setServiceFromId:function(n,k,j){if(!this._channelShortname){throw new Error("Channel Shortname must be set in order to display Services in the Search control")}var m=this;var l=function(p){if(j){j(sender,p)}};var o=function(p){if(p.Data.length==1){m.text(p.Data[0].Name);m.service(p.Data[0]);if(k){k(sender,p)}}else{l({message:"Not found"})}};V3.WebServices.LocationService.Search(o,l,{Ids:[n],Types:[e.Accommodation,e.Activity],DistributorShortname:this._channelShortname})},location:V3.Property(null,function g(k){var j=this._bound;if(j){j.obj[j.field].LocationId=(k&&k.Id);j.obj[j.field].Location=k}}).OnChange(function(j){this.service(null);if(j){this.TextBox.text(j.Name)}this._fireOnChange("location")}),service:V3.Property(null,function g(k){var j=this._bound;if(j){j.obj[j.field].ServiceId=(k&&k.Id);j.obj[j.field].Service=k}}).OnChange(function(j){this.location(null);if(j){this.TextBox.text(j.Name)}this._fireOnChange("service")}),text:V3.Property(null,function g(k){var j=this._bound;if(j){j.obj[j.field].Text=k}}).OnChange(function(j){this.location(null);this.service(null);if(V3.Is.String(j)){this.TextBox.text(j);this._ctrlResults.performSearch(j)}})});var h=function h(j){var k=V3.extend({},false,d);if(V3.CABS.UI.SearchControlDefaults){k=V3.extend(k,true,V3.CABS.UI.SearchControlDefaults)}j=V3.extend(j,false,k);this.base(j.DOMElement||"search-control");this._OnChange_Bound=this._OnChange_Bound.bind(this);if(!j.AllowedLocationTypes||j.AllowedLocationTypes.length==0){j.AllowedLocationTypes=d.AllowedLocationTypes}this._searchSettings=j;this._destinationCompulsory=j.DestinationCompulsory;this._boundTerms={ICGAccommodation:new V3.Property(""),ICGActivity:new V3.Property(""),Destination:new V3.Property(""),DateCommencing:new V3.Property(""),Guests:new V3.Property(""),GuestAdults:new V3.Property(""),GuestChildren:new V3.Property(""),GuestSeniors:new V3.Property("")};this.Insert(this._pnlContent.Insert(this.lblError));if(j.CssClass){this.cssClass(j.CssClass)}this._Storage={Criteria:{IndustryCategoryGroup:e.Accommodation,Destination:{Text:null,LocationId:null,ServiceId:null},Pax:{Adults:null,Children:null,Seniors:null},Nights:null,Date:null,DateIsFlexible:true,MinPrice:null,MaxPrice:null},MaxPax:j.MaximumPax||20};this.configure=function(l){this._setDTOCriteria(l.Criteria);this.showAccommodation(l.ShowAccommodation);this.showActivity(l.ShowActivity);this.minDate(l.MinDate);this.maxDate(l.MaxDate);this.compactPax(!!l.CompactPax);this.maxNights(12);this.nightsOptional(!!l.NightsOptional);this.maxPax(this._Storage.MaxPax);this.paxOptional(!!l.PaxOptional);this.showTabs(l.ShowTabs!==false);this.showDestination(l.ShowDestination!==false);this.showDate(l.ShowDate!==false);this.showNights(l.ShowNights!==false);this.showButton(l.ShowButton!==false);this.showPax(l.ShowPax!==false);this.showChildren(l.ShowChildren!==false);this.showSeniors(l.ShowSeniors!==false);this.showAdvancedSearch(l.ShowAdvancedSearch!==false);if(l.SmallTabs){this.Tabs.cssClass("")}this.terminology(l.Terminology);this.buttonText(l.ButtonText);this.criteria(l.Criteria);this._isReady=true;this._OnChange_Bound()}.bind(this);this.configure(j)}.InheritsFrom(V3.UI.Panel,{OnFailedValidation:V3.EventPrototype("sender, e"),OnPerformSearch:V3.EventPrototype("sender, e:{Criteria:{Date:V3Date, Nights:2, Pax:{Adults:2,Children:0,Seniors:0}}"),OnCriteriaChanged:V3.EventPrototype("sender, e:{Criteria:{Date:V3Date, Nights:2, Pax:{Adults:2,Children:0,Seniors:0}}"),_isReady:false,lblError:V3.UI.Label().Defaults({cssClass:"error",autoVisibility:true}),Tabs:V3.CABS.UI.TabsControl().Defaults({cssClass:"large",visible:false}),_pnlContent:V3.UI.Panel().Defaults({cssClass:"container"}),_Storage:null,_setDTOCriteria:function(k){if(V3.Is.Specified(k.IndustryCategoryGroup)){this._Storage.Criteria.IndustryCategoryGroup=e.parse(k.IndustryCategoryGroup)}if(V3.Is.Boolean(k.DateIsFlexible)){this._Storage.Criteria.DateIsFlexible=k.DateIsFlexible}if(V3.Is.Number(k.MinPrice)){this._Storage.Criteria.MinPrice=k.MinPrice}if(V3.Is.Number(k.MaxPrice)){this._Storage.Criteria.MaxPrice=k.MaxPrice}if(k.Destination){if(V3.Is.Specified(k.Destination.LocationId)){this._Storage.Criteria.Destination.LocationId=k.Destination.LocationId}if(V3.Is.Specified(k.Destination.ServiceId)){this._Storage.Criteria.Destination.ServiceId=k.Destination.ServiceId}if(V3.Is.Specified(k.Destination.Text)){this._Storage.Criteria.Destination.Text=k.Destination.Text}}if(V3.Is.Specified(k.Date)){this._Storage.Criteria.Date=k.Date}if(V3.Is.Number(k.Nights)){this._Storage.Criteria.Nights=k.Nights}if(V3.Is.Specified(k.Pax)){var j=this.maxPax();if(V3.Is.Number(k.Pax.Adults)){this._Storage.Criteria.Pax.Adults=Math.min(j,k.Pax.Adults)}if(V3.Is.Number(k.Pax.Children)){this._Storage.Criteria.Pax.Children=Math.min(j,k.Pax.Children)}if(V3.Is.Number(k.Pax.Seniors)){this._Storage.Criteria.Pax.Seniors=Math.min(j,k.Pax.Seniors)}if(this.compactPax()){this._Storage.Criteria.Pax.Adults=Math.min(j,(this._Storage.Criteria.Pax.Adults||0)+(this._Storage.Criteria.Pax.Children||0)+(this._Storage.Criteria.Pax.Seniors||0));this._Storage.Criteria.Pax.Children=0;this._Storage.Criteria.Pax.Seniors=0}}else{if(this._getTotalPax()===0){this._Storage.Criteria.Pax.Adults=1}}},_OnChange_Bound:function(j,k){if(!this._isReady){return}if(this.isValid()){this.OnCriteriaChanged.fire(this,{Criteria:this.criteria()})}else{this.OnFailedValidation.fire(this)}},_getTotalPax:function(){var j=null;if(this._ddlGuests){j=this._ddlGuests.selectedValue()}else{if(this._ddlAdults){j=j+this._ddlAdults.selectedValue()}if(this._ddlChildren){j=j+this._ddlChildren.selectedValue()}if(this._ddlSeniors){j=j+this._ddlSeniors.selectedValue()}}return j},isValid:function(){this.Controls.remove(this.lblError);this.Controls.add(this.lblError);var k=this._getTotalPax();var j=this._boundTerms.Guests();if(k==0){this.lblError.text(V3.CABS.Utils.ProcessPlaceholders((V3.Res["Search.Error.NoGuest"]||"Please enter the number of {guest}"),{"{guest}":j}));return false}else{if(k>this._Storage.MaxPax){this.lblError.text(V3.CABS.Utils.ProcessPlaceholders((V3.Res["Search.Error.MaxGuest"]||"The number of {guest} are too high, please select {maxGuest} or less {guest}."),{"{guest}":j,"{maxGuest}":this._Storage.MaxPax}));return false}}if(this._destinationCompulsory&&this.showDestination()){if(!this._Storage.Criteria.Destination.LocationId&&!this._Storage.Criteria.Destination.ServiceId){this._ctrlDestinationBox.Parent.cssClassAdd("error");this.lblError.text((V3.Res["Search.Error.NoDestination"]||"Please enter a Destination"));return false}this._ctrlDestinationBox.Parent.cssClassRem("error")}this.lblError.text("");return true},_rebind:function(){if(this._ctrlDestinationBox){this._ctrlDestinationBox.bind()}if(this._txtDate){this._txtDate.bind()}if(this._ddlNights){this._ddlNights.bind()}if(this._ddlGuests){this._ddlGuests.bind()}if(this._ddlAdults){this._ddlAdults.bind()}if(this._ddlChildren){this._ddlChildren.bind()}if(this._ddlSeniors){this._ddlSeniors.bind()}this.industryCategoryGroup(e.parse(this._Storage.Criteria.IndustryCategoryGroup))},_NightOpts:null,_updateNightOpts:function(){this._NightOpts=[];if(this.nightsOptional()){this._NightOpts.add({label:V3.Res["Search.AnyOption"]||"Any",value:null})}for(var j=1;j<=Math.min(20,this.maxNights());j++){this._NightOpts.add(j)}if(this._ddlNights){var k=this._ddlNights.selectedValue();this._ddlNights.clear();this._ddlNights.addRange(this._NightOpts);if(this._ddlNights.containsValue(k)){this._ddlNights.selectedValue(k)}}},maxNights:V3.Property(0).OnChange(function(j){this._updateNightOpts()}),nightsOptional:V3.Property(false).OnChange(function(j){this._updateNightOpts()}),_updatePaxDroplists:function(){var k=this._PaxOpts=[];if(this.compactPax()&&this.paxOptional()){this._PaxOpts.add({label:V3.Res["Search.AnyOption"]||"Any",value:null})}for(var j=(this.compactPax()?1:0);j<=Math.min(20,this._Storage.MaxPax);j++){this._PaxOpts.add(j)}[this._ddlGuests,this._ddlAdults,this._ddlChildren,this._ddlSeniors].forEach(function(m){if(m){var l=m.selectedValue();m.clear();m.addRange(k);if(m.containsValue(l)){m.selectedValue(l)}}});if(this._ddlGuests){if(this.paxOptional()){if(!this._ddlGuests.containsValue(null)){this._ddlGuests.addAt(0,V3.Res["Search.AnyOption"]||"Any",null)}}else{this._ddlGuests.remove(null)}}},paxOptional:V3.Property(false).OnChange(function(j){this._updatePaxDroplists()}),maxPax:V3.Property(0).OnChange(function(j){this._Storage.MaxPax=j;this._updatePaxDroplists()}),showChildren:V3.Property(false).OnChange(function(j){this._addOrRemovePaxBoxes();this._refreshPaxFields()}),showSeniors:V3.Property(false).OnChange(function(j){this._addOrRemovePaxBoxes();this._refreshPaxFields()}),terminology:V3.Property(null).OnChange(function(j){this._boundTerms.DateCommencing(V3.CABS.Utils.GetTerm("DateCommencing",j));this._boundTerms.Guests(V3.CABS.Utils.GetTerm("Guests",j));this._boundTerms.GuestAdults(V3.CABS.Utils.GetTerm("GuestAdults",j));this._boundTerms.GuestChildren(V3.CABS.Utils.GetTerm("GuestChildren",j));this._boundTerms.GuestSeniors(V3.CABS.Utils.GetTerm("GuestSeniors",j));this._boundTerms.Destination(V3.CABS.Utils.GetTerm("Destination",j));this._boundTerms.ICGAccommodation(V3.CABS.Utils.GetTerm("ICGAccommodation",j));this._boundTerms.ICGActivity(V3.CABS.Utils.GetTerm("ICGActivity",j));this.isValid()}),compactPax:V3.Property(null).OnChange(function(j){this._addOrRemovePaxBoxes()}),criteria:V3.Property(function a(){var j=V3.clone(this._Storage.Criteria);return j},function g(j){if(!j){throw new Error("value must be supplied")}this._setDTOCriteria(j);this._rebind();this._refreshPaxFields()}),industryCategoryGroup:V3.Property(e.Accommodation,function g(k,l,j){k=j.value=e.parse(k)}).OnChange(function(j){this._Storage.Criteria.IndustryCategoryGroup=j;if(j==e.Accommodation){if(this._ddlNights){this._ddlNights.Parent.visible(true);this._ddlNights.Parent.enabled(true)}this._cssClassAdd(true,"icg-acc");this._cssClassRem(true,"icg-act");if(this._tabAccommodation){this._tabAccommodation.selected(true)}}else{if(j==e.Activity){this._cssClassAdd(true,"icg-act");this._cssClassRem(true,"icg-acc");if(this._ddlNights){this._ddlNights.Parent.visible(false);this._ddlNights.Parent.enabled(false)}if(this._tabActivity){this._tabActivity.selected(true)}}else{this._cssClassRem(true,"icg-acc");this._cssClassRem(true,"icg-act");if(this._ddlNights&&this.showAccommodation()){this._ddlNights.Parent.visible(true);this._ddlNights.Parent.enabled(true)}}}if(this._ctrlDestinationBox){if(!j){this._ctrlDestinationBox.Parent.visible(false)}else{this._ctrlDestinationBox.industryCategoryGroup(j);this._ctrlDestinationBox.Parent.visible(true)}}this._refreshPaxFields();this._OnChange_Bound(this.Tabs,{})}),_refreshPaxFields:function(){if(this.compactPax()){return}if(this._ddlChildren){if(this.showChildren()){this._ddlChildren.Parent.visible(true)}else{this._ddlChildren.Parent.visible(false);this._ddlChildren.selectedValue(0)}}if(this._ddlSeniors){var j=this.industryCategoryGroup();if(V3.Is.Specified(j)){j=e.parse(j)}if(j==e.Accommodation||!this.showSeniors()){this._ddlSeniors.Parent.visible(false);this._ddlSeniors.selectedValue(0)}else{this._ddlSeniors.Parent.visible(true)}}},performSearch:function(){var j=this.criteria();this.OnPerformSearch.fire(this,{Criteria:j})},minDate:V3.Property(null,function g(l,j,k){if(!l){throw new Error("value must be supplied")}k.value=l.asV3Date().date()}).OnChange(function(j){if(this._txtDate){this._txtDate.minDate(j)}}),maxDate:V3.Property(null,function g(l,j,k){if(!l){throw new Error("value must be supplied")}k.value=l.asV3Date().date()}).OnChange(function(j){if(this._txtDate){this._txtDate.maxDate(j)}}),_addOrRemovePaxBoxes:function(){var k=this.showPax();var j=this.compactPax();if(!k||!j){if(this._paxContainerCompact){this._ddlGuests.bind(null);this._paxContainerCompact.visible(false)}}if(!k||j){if(this._paxContainerExpanded){if(this._ddlAdults){this._ddlAdults.bind(null)}if(this._ddlChildren){this._ddlChildren.bind(null)}if(this._ddlSeniors){this._ddlSeniors.bind(null)}this._paxContainerExpanded.visible(false)}}if(k){if(j){if(!this._paxContainerCompact){this._paxContainerCompact=new V3.UI.Panel("field-container pax compact");this._pnlContent.Controls.insertBefore(this._paxContainerCompact,(this._hlMoreOptions||this._btnSearch||{}).Parent||this._pnlAdvancedSearch);this._ddlGuests=new V3.UI.DropDownList(this._PaxOpts).Set({OnChange:this._OnChange_Bound});this._Storage.Criteria.Pax.Adults=(this._Storage.Criteria.Pax.Adults||0)+(this._Storage.Criteria.Pax.Children||0)+(this._Storage.Criteria.Pax.Seniors||0);this._Storage.Criteria.Pax.Children=0;this._Storage.Criteria.Pax.Seniors=0;this._paxContainerCompact.Insert(new V3.UI.Panel().Set({cssClass:"field guests"}).Insert(new V3.UI.Label("",this._ddlGuests).Insert(new V3.UI.Label().Set({cssClass:"data-icon guests"}),new V3.UI.Label().Set({text:this._boundTerms.Guests})),this._ddlGuests));this._updatePaxDroplists()}this._ddlGuests.bind(this._Storage.Criteria.Pax,"Adults");this._paxContainerCompact.visible(true)}else{if(!this._paxContainerExpanded){this._paxContainerExpanded=new V3.UI.Panel("field-container pax expanded");this._pnlContent.Controls.insertBefore(this._paxContainerExpanded,(this._hlMoreOptions||this._btnSearch||{}).Parent||this._pnlAdvancedSearch);this._ddlAdults=new V3.UI.DropDownList(this._PaxOpts).Set({OnChange:this._OnChange_Bound});this._paxContainerExpanded.Insert(new V3.UI.Label("",this._ddlAdults).Insert(new V3.UI.Label().Set({cssClass:"data-icon guests"}),new V3.UI.Label().Set({text:this._boundTerms.Guests})),new V3.UI.Panel().Set({cssClass:"field adults"}).Insert(this._ddlAdults,new V3.UI.Label("",this._ddlAdults).Set({text:this._boundTerms.GuestAdults})))}this._ddlAdults.bind(this._Storage.Criteria.Pax,"Adults");if(!this._ddlChildren&&this.showChildren()){this._ddlChildren=new V3.UI.DropDownList(this._PaxOpts).Set({OnChange:this._OnChange_Bound});this._paxContainerExpanded.Controls.insertAfter(new V3.UI.Panel().Set({cssClass:"field children"}).Insert(this._ddlChildren,new V3.UI.Label("",this._ddlChildren).Set({text:this._boundTerms.GuestChildren})),this._ddlAdults.Parent);this._ddlChildren.bind(this._Storage.Criteria.Pax,"Children")}if(!this._ddlSeniors&&this.showSeniors()){this._ddlSeniors=new V3.UI.DropDownList(this._PaxOpts).Set({OnChange:this._OnChange_Bound});this._paxContainerExpanded.Controls.insertAfter(new V3.UI.Panel().Set({cssClass:"field seniors"}).Insert(this._ddlSeniors,new V3.UI.Label("",this._ddlSeniors).Set({text:this._boundTerms.GuestSeniors})),(this._ddlChildren||this._ddlAdults).Parent);this._ddlSeniors.bind(this._Storage.Criteria.Pax,"Seniors")}this._paxContainerExpanded.visible(true)}}},_updateCssClassForTabs:function(){this._cssClassToggle(true,this.showTabs()&&this.showAccommodation(),"has-tab-acc");this._cssClassToggle(true,this.showTabs()&&this.showActivity(),"has-tab-act")},showTabs:V3.Property(false).OnChange(function(j){if(!this.Tabs.Parent){this.Controls.addAt(0,this.Tabs)}this.Tabs.visible(j);this._updateCssClassForTabs()}),showAccommodation:V3.Property(false).OnChange(function(j){if(!j){if(this._tabAccommodation){this._tabAccommodation.visible(false)}}else{if(!this._tabAccommodation){this._tabAccommodation=this.Tabs.addTab({name:this._boundTerms.ICGAccommodation,onSelected:function(){this.industryCategoryGroup(e.Accommodation)}.bind(this),onDeselected:function(){}})}this._tabAccommodation.visible(true)}this._updateCssClassForTabs()}),showActivity:V3.Property(false).OnChange(function(j){if(!j){if(this._tabActivity){this._tabActivity.visible(false)}}else{if(!this._tabActivity){this._tabActivity=this.Tabs.addTab({name:this._boundTerms.ICGActivity,onSelected:function(){this.industryCategoryGroup(e.Activity)}.bind(this),onDeselected:function(){}})}this._tabActivity.visible(true)}this._updateCssClassForTabs()}),showDestination:V3.Property(false).OnChange(function(j){if(!j){if(this._ctrlDestinationBox){this._ctrlDestinationBox.bind(null);this._ctrlDestinationBox.visible(false)}}else{if(!this._ctrlDestinationBox){this._ctrlDestinationBox=new c(this._searchSettings).Set({OnChange:this._OnChange_Bound});this._pnlContent.Controls.insertBefore(new V3.UI.Panel().Set({cssClass:"field destination"}).Insert(new V3.UI.Label("",this._ctrlDestinationBox.TextBox).Insert(new V3.UI.Label().Set({cssClass:"data-icon location"}),new V3.UI.Label().Set({text:this._boundTerms.Destination})),this._ctrlDestinationBox),(this._txtDate||this._ddlNights||this._ddlGuests||this._ddlAdults||this._hlMoreOptions||this._btnSearch||{}).Parent||this._pnlAdvancedSearch)}this._ctrlDestinationBox.bind(this._Storage.Criteria,"Destination")}}),showDate:V3.Property(false).OnChange(function(j){if(!j){if(this._txtDate){this._txtDate.bind(null);this._txtDate.Parent.visible(false)}}else{if(!this._txtDate){this._txtDate=new V3.UI.DateInput().Set({isRequired:true,bind:[this._Storage.Criteria,"Date"],formatString:this._searchSettings.DateFormatString,OnDateSelected:this._OnChange_Bound});this._txtDate.minDate(this.minDate());this._txtDate.maxDate(this.maxDate());this._pnlContent.Controls.insertBefore(new V3.UI.Panel().Set({cssClass:"field commencing"}).Insert(new V3.UI.Label("",this._txtDate).Insert(new V3.UI.Label().Set({cssClass:"data-icon commencing"}),new V3.UI.Label().Set({text:this._boundTerms.DateCommencing})),this._txtDate),(this._ddlNights||this._ddlGuests||this._ddlAdults||this._hlMoreOptions||this._btnSearch||{}).Parent||this._pnlAdvancedSearch)}}}),showNights:V3.Property(false).OnChange(function(j){if(!j){if(this._ddlNights){this._ddlNights.bind(null);this._ddlNights.Parent.visible(false)}}else{if(!this._ddlNights){this._ddlNights=new V3.UI.DropDownList(this._NightOpts).Set({OnChange:this._OnChange_Bound});this._pnlContent.Controls.insertBefore(new V3.UI.Panel().Set({cssClass:"field nights"}).Insert(new V3.UI.Label("",this._ddlNights).Insert(new V3.UI.Label().Set({cssClass:"data-icon nights"}),new V3.UI.Label(V3.Res["Terms.Nights"]||"Nights")),this._ddlNights),(this._ddlGuests||this._ddlAdults||this._hlMoreOptions||this._btnSearch||{}).Parent||this._pnlAdvancedSearch)}this._ddlNights.bind(this._Storage.Criteria,"Nights")}}),showPax:V3.Property(false).OnChange(function(j){this._addOrRemovePaxBoxes()}),showButton:V3.Property(false).OnChange(function(j){if(!j){if(this._btnSearch){this._btnSearch.Parent.visible(false)}this.defaultButton(null)}else{if(!this._btnSearch){this._btnSearch=new V3.UI.Button(this.buttonText()).Set({cssClass:"button search orange",OnClick:function(k){k.focus();if(this.isValid()){this.performSearch()}}.bind(this)});this._pnlContent.Controls.insertBefore(new V3.UI.Panel("field search-button-container").Insert(this._btnSearch),this._pnlAdvancedSearch)}this.defaultButton(this._btnSearch);this._btnSearch.Parent.visible(true)}}),_renderAdvancedSections:function(){var p=this.showAdvancedSearch()&&this.showPriceFilter();if(!p){if(this._hlMoreOptions){this._hlMoreOptions.collapsed(true);this._hlMoreOptions.Parent.visible(false)}return}if(this._hlMoreOptions){this._hlMoreOptions.Parent.visible(true)}if(!this._pnlAdvancedSearch){this._pnlAdvancedSearch=new V3.UI.Panel("field-container advanced-options");this._pnlContent.Insert(this._pnlAdvancedSearch);var o=this._pnlAdvancedSearch;this._hlMoreOptions=new V3.UI.HyperLinkToggle(V3.Res["Search.MoreOptions"]||"More options",this._pnlAdvancedSearch,true).Set({});this._pnlContent.Controls.insertBefore(new V3.UI.Panel("field more-options-container").Insert(this._hlMoreOptions),(this._btnSearch||{}).Parent)}var n=this;if(!p||!this.showPriceFilter()){if(this.pnlPriceFilter){this.pnlPriceFilter.visible(false)}}else{if(!this.pnlPriceFilter){this.pnlPriceFilter=new V3.UI.Panel("field price-filter");var j=[];var m=1;if(typeof _DisplayCurrencyConversionCoefficient!=="undefined"){m=_DisplayCurrencyConversionCoefficient}this._searchSettings.PriceRanges.forEach(function(q){j.add({label:(q*m).toStringFormat("C0",V3.CultureInfo.currentUICulture()),value:q})});var l=new V3.UI.DropDownList([{label:V3.Res["Search.AnyMinPrice"]||"Min",value:null}].addRange(j)).Set({selectedValue:null,bind:[this._Storage.Criteria,"MinPrice"],OnChange:function(q,r){if(!r.changedByUser){return}var t=r.selectedValue;var s=k.selectedValue();if(V3.Is.Number(t)&&V3.Is.Number(s)){if(t>=s){k.selectedIndex(l.selectedIndex())}}n._OnChange_Bound(q,r)}});var k=new V3.UI.DropDownList(j.addRange([{label:V3.Res["Search.AnyMaxPrice"]||"Max",value:null}])).Set({selectedValue:null,bind:[this._Storage.Criteria,"MaxPrice"],OnChange:function(q,r){if(!r.changedByUser){return}var t=l.selectedValue();var s=r.selectedValue;if(V3.Is.Number(t)&&V3.Is.Number(s)){if(t>=s){l.selectedIndex(Math.max(0,k.selectedIndex()))}}n._OnChange_Bound(q,r)}});this.pnlPriceFilter.Insert(new V3.UI.Label(l).Insert(new V3.UI.Label().Set({cssClass:"data-icon price"}),new V3.UI.Label(V3.Res["Search.PriceFrom"]||"Price from ")),l,new V3.UI.Label(V3.Res["Search.PriceFrom.To"]||" to ",k),k);this._pnlAdvancedSearch.Insert(this.pnlPriceFilter)}}if(!p||!this.showTravelDateFlexible()){if(this._chkDateIsFlexible){this._chkDateIsFlexible.Parent.visible(false)}}else{if(!this._chkDateIsFlexible){this._chkDateIsFlexible=new V3.UI.CheckBox().Set({bind:[this._Storage.Criteria,"DateIsFlexible"],OnChange:this._OnChange_Bound});this._pnlAdvancedSearch.Controls.insertBefore(new V3.UI.Panel("field travel-date-flexible").Insert(new V3.UI.Label(this._chkDateIsFlexible).Insert(new V3.UI.Label().Set({cssClass:"data-icon flexible"}),new V3.UI.Label().Set({text:this._boundTerms.DateCommencing}).Insert(V3.Res["Search.DateIsFlexible"]||" is flexible")),this._chkDateIsFlexible),this.pnlPriceFilter)}}},showAdvancedSearch:V3.Property(false).OnChange(function(j){this._renderAdvancedSections()}),showTravelDateFlexible:V3.Property(true).OnChange(function(j){this._renderAdvancedSections()}),showPriceFilter:V3.Property(true).OnChange(function(j){this._renderAdvancedSections()}),buttonText:V3.Property("Search").OnChange(function(j){if(this._btnSearch){this._btnSearch.text(j)}}),setLimitsFromEntities:function(o){if(!o||!o.length){throw new Error("entities must be supplied")}var k=null;var m=null;var n=null;var l=false;var j=false;o.forEach(function(r){if(r.Capacity&&(k==null||k<r.Capacity.Max)){k=r.Capacity.Max}if(r.IndustryCategoryGroups&&r.IndustryCategoryGroups.length){r.IndustryCategoryGroups.forEach(function(s){switch(e.parse(s)){case e.Activity:j=true;break;case e.Accommodation:l=true;break}})}if(r.Bookability){var q=new V3Date(r.Bookability.AvailabilityDateRange.Min);var p=new V3Date(r.Bookability.AvailabilityDateRange.Max);if(m==null||q<m){m=q}if(n==null||p>n){n=p}}});if(m<new V3Date()){m=new V3Date()}this.maxPax(k);this.minDate(m);this.maxDate(n);this.showAccommodation(l);this.showActivity(j);if(l&&j){this.showTabs(true)}if(!l){this.industryCategoryGroup(e.Activity)}else{if(!j){this.industryCategoryGroup(e.Accommodation)}}}});V3.CABS.UI.DestinationSelector=c;V3.CABS.UI.SearchControl=h}); })(V3);
var currentCurrency="GBP";
V3.Res={"Terms.GuestAdults":"Adults","Terms.GuestChildren":"Children","Terms.GuestSeniors":"Seniors","Terms.DateCommencing":"Commencing","Terms.DateConcluding":"Concluding","Terms.Guests":"Guests","Terms.ICGAccommodation":"Accommodation","Terms.ICGActivity":"Activity","Terms.Nights":"Nights","Terms.Products":"Products","Terms.Product":"Product","Terms.Business":"Provider","Terms.TimeCheckIn":"Check In","Terms.TimeCheckOut":"Check Out","Terms.Destination":"Destination","Cart.Label.Empty":"Your cart is empty.","Cart.Label.One":"You have 1 item in your cart.","Cart.Label.Many":"You have {count} items in your cart.","Cart.Label.Total":"Total:","Cart.Label.AddSuccess":"Item added successfully","Cart.Label.TotalCost":"Total cost","Cart.Label.For":"for","Cart.Label.PlusFees":"plus fees","Cart.Label.Night":"Night","Cart.Label.RunsFor":"Runs for","Cart.Notice.IsEmpty":"Cart is empty.","Cart.Button.CheckOutNow":"Check-Out Now","Cart.Button.Remove":"Remove","Product.Label.Instruction":"Please enter the details of your booking","Product.Label.ReferralBooking":"This booking will be completed by a third party, click Book Now to start the booking process in a new window.","Product.Label.SoloBooking":"This booking can only booked on its own, click Book Now to start the booking process in a new window.","Product.Note.Duration":"Note: At some times of the year this {product} requires at least {duration} Nights to be booked","Product.Button.BookNow":"Book Now","Product.Button.AddToCart":"Add to cart","Product.Button.Cancel":"Close","Product.Error.Unavailable":"Unavailable, please try a different {commencing} date or number of {guest}","Product.Error.FutureDate":"Please select a future date.","Product.Error.Duration":"This {product} requires at least {duration} Nights to be booked.","Product.Error.Unexpected":"An unexpected error has occured.","Product.Error.Fetch":"An error occured while trying to fetch a quote. Please try again later.","Search.Wishlist.Label.Empty":"Wishlist","Search.Wishlist.Label.WithItems":"Wishlist ({count})","Search.Button.Text":"Search","Search.MoreOptions":"More options","Search.DateIsFlexible":" is flexible","Search.PriceFrom":"Price from","Search.PriceFrom.To":"to","Search.AnyOption":"Any","Search.AnyMinPrice":"Min","Search.AnyMaxPrice":"Max","Search.Placeholder.DestinationName":"{wordDestination} Name","Search.Placeholder.DestinationOrBusinessName":"{wordDestination} or {wordBusiness} Name","Search.Error.NoGuest":"Please enter the number of {guest}","Search.Error.MaxGuest":"The number of {guest} are too high, please select {maxGuest} or less {guest}.","Search.Error.NoDestination":"Please enter a Destination","Search.Error.Unexpected":"Unexpected error has occurred","Search.Error.NoDestinationFound":"No Destinations found.","RateGrid.Button.View":"View","RateGrid.UpdatingNotification.Text":"Updating, Please wait...","RateGrid.NextButton":"Book","RateGrid.FooterMessage[aud]":"Rates displayed are the cheapest available, inclusive of VAT and are in Australian dollar (AUD). However the transactions shall be performed using Pound Sterling (GBP).","RateGrid.FooterMessage[bhd]":"Rates displayed are the cheapest available, inclusive of VAT and are in Bahraini dinar (BHD). However the transactions shall be performed using Pound Sterling (GBP).","RateGrid.FooterMessage[cny]":"Rates displayed are the cheapest available, inclusive of VAT and are in Chinese yuan (CNY). However the transactions shall be performed using Pound Sterling (GBP).","RateGrid.FooterMessage[inr]":"Rates displayed are the cheapest available, inclusive of VAT and are in Indian rupee (INR). However the transactions shall be performed using Pound Sterling (GBP).","RateGrid.FooterMessage[jpy]":"Rates displayed are the cheapest available, inclusive of VAT and are in Japanese Yen (JPY). However the transactions shall be performed using Pound Sterling (GBP).","RateGrid.FooterMessage[kwd]":"Rates displayed are the cheapest available, inclusive of VAT and are in Kuwaiti dinar (KWD). However the transactions shall be performed using Pound Sterling (GBP).","RateGrid.FooterMessage[omr]":"Rates displayed are the cheapest available, inclusive of VAT and are in Omani rial (OMR). However the transactions shall be performed using Pound Sterling (GBP).","RateGrid.FooterMessage[qar]":"Rates displayed are the cheapest available, inclusive of VAT and are in Qatari riyal (QAR). However the transactions shall be performed using Pound Sterling (GBP).","RateGrid.FooterMessage[sar]":"Rates displayed are the cheapest available, inclusive of VAT and are in Saudi riyal (SAR). However the transactions shall be performed using Pound Sterling (GBP).","RateGrid.FooterMessage[aed]":"Rates displayed are the cheapest available, inclusive of VAT and are in United Arab Emirates dirham (AED). However the transactions shall be performed using Pound Sterling (GBP).","RateGrid.FooterMessage[gbp]":"Rates displayed are the cheapest available, inclusive of VAT and are in Pound Sterling (GBP).","RateGrid.FooterMessage[usd]":"Rates displayed are the cheapest available, inclusive of VAT and are in United States dollar (USD). However the transactions shall be performed using Pound Sterling (GBP).","RateGrid.FooterMessage[eur]":"Rates displayed are the cheapest available, inclusive of VAT and are in Euro (EUR). However the transactions shall be performed using Pound Sterling (GBP).","Paging.First":"1","Paging.Previous":"Previous","Paging.Next":"Next","Paging.Last":"{page.count}","ProviderSearch.Error.Unexpected":"Unfortunately there was an unexpected error and the results could not be updated. Please try again later.","ProviderSearch.Error.NoResult":"No results found.","ProviderSearch.ShowMap":"Show Map","ProviderSearch.ViewProduct":"View Products","ViewBy.Label":"View by","ViewBy.Map":"Map","ViewBy.Rates":"Rates","SortBy.Label":"Sort By","SortBy.Default":"Default","SortBy.Name":"Name","SortBy.Price":"Price","SortBy.Rating":"Rating","EntityDisplay.MaxGuestsText":"Max {max} {guests}","EntityDisplay.Link.Info":"Info","EntityDisplay.Rating":"{score}/{max} by {number} people","EntityDisplay.ReviewsSingular":"{number} review","EntityDisplay.ReviewsPlural":"{number} reviews","EntityDisplay.By":"by {name}","Map.Link.ViewRates":"View Rates","Map.Button.Overview":"Overview","Words.And":"And","TimeComponent.Day":"Day","TimeComponent.Days":"Days","TimeComponent.Hour":"Hour","TimeComponent.Hours":"Hours","TimeComponent.Minute":"Minute","TimeComponent.Minutes":"Minutes","TimeComponent.Second":"Second","TimeComponent.Seconds":"Seconds","BookingProcessor.Failure.MultipleBookings":"Multiple bookings are not permitted.","BookingProcessor.Failure.ExternalPayment":"Bookings cannot be added to the cart when they are placed via a third party.","BookingProcessor.Failure.ExistInCart":"{serviceName} - {productName} is already in your cart. Only one {wordProduct} at a time can be booked for this {wordBusiness}.","BookingProcessor.Failure.DateExistInCart":"{productName} is already in your cart for this date. If you'd like to add more {wordProducts} to your cart, please click Close and choose a different {wordProduct} or date.","BookingProcessor.Failure.NightExistInCart":"{productName} is already in your cart for at least one of this nights. If you'd like to add more {wordProducts} to your cart, please click Close and choose a different {wordProduct}.","BookingProcessor.Failure.NoItem":"Please place some items into your cart before proceeding to the check-out.","Site.ViewImportantInformationOrPolicyLinkText":"View Booking Terms & Conditions","TXGB.ShoppingCart.AccommodationRestrictionNotice":"Due to UK legislation we are unable to allow the booking of Accommodation while packaged with other bookings. In order to book this Accommodation you must use the Book Now button to clear your current cart and to proceed to book this Accommodation on its own."};
(function(V3){ //AUTO-GENERATED-DO NOT MODIFY 
V3.RegisterFile("CabsToolkit",1,["V3.Utils","V3.UI","V3.API.EntityService","V3.CABS.UI.Common"],function(){V3.Namespace("CABS");var f={DistributorShortname:"aaa_mywebsite",ProviderShortname:"test_toothnnaillodge",BrandingStyle:"",BrandingView:"",EndPoints:{BookingService:"http://localhost/CABS4/Services/BookingService.asmx",EntityService:"http://localhost/CABS4/Services/EntityService.asmx",LocationService:"http://localhost/CABS4/Services/LocationService.asmx",InjectionPage:"http://localhost/CABS4/Services/Injection.aspx",SearchPage:"http://localhost/CABS4/Pages/Search.aspx",AvailabilityPage:"http://localhost/CABS4/Pages/Availability.aspx"},StyleSheetFiles:{},StyleSheetIncludes:{SearchBox:[],RateGrid:[]},Settings:{Terminology:{},PresentChildren:true,PresentSeniors:true},Overrides:{SearchBox:{},RateGrid:{}}};var e=V3.Is;var c=V3.CABS.EntityTypeEnum;var a=V3.CABS.IndustryCategoryGroupEnum;var d=V3.Enum({HyperLink:0,Image:1,Button1:2});var b=function b(g){this.base();if(window.vsDesignTime){g=f}this._config=g;this._channelShortname=g.DistributorShortname;this._providerShortname=g.ProviderShortname;this._brandingStyle=g.BrandingStyle;this._brandingView=g.BrandingView;this._isOptedIn=g.ProviderIsOptedIn;this._demoMode=g.DemoMode;this._endPoints.BookingService=g.EndPoints.BookingService;this._endPoints.EntityService=g.EndPoints.EntityService;this._endPoints.LocationService=g.EndPoints.LocationService;this._endPoints.InjectionPage=g.EndPoints.InjectionPage;this._endPoints.SearchPage=g.EndPoints.SearchPage;this._endPoints.AvailabilityPage=g.EndPoints.AvailabilityPage;this._settings=g.Settings||{};this._overrides=g.Overrides||{};this._styleSheetFiles=g.StyleSheetFiles;this._styleSheetIncludes.SearchBox=g.StyleSheetIncludes.SearchBox;this._styleSheetIncludes.RateGrid=g.StyleSheetIncludes.RateGrid;this._styleSheetIncludes.BookNowButtonStyles=g.StyleSheetIncludes.BookNowButtonStyles;this._setInjectionInstance();this._setEntityService();if(this._providerShortname){this._addProviderToolkitMethods();this._addProviderToolkitOverrides()}else{this._addDistributorToolkitMethods();this._addDistributorToolkitOverrides()}this.BookButtonStyle=d}.InheritsFrom(V3.Class,{_demoMode:false,_channelShortname:null,_providerShortname:null,_settings:null,_overrides:null,_injection:!window.vsDesignTime?null:new V3.CABS.Injection({}),_entityService:!window.vsDesignTime?null:new V3.API.EntityWebService({}),_endPoints:V3.Object({BookingService:null,EntityService:null,LocationService:null}),_styleSheetFiles:null,_styleSheetIncludes:V3.Object({SearchBox:null,RateGrid:null}),_loadStyleSheets:function(l,k,j){if(!l){return}k=!!k;j=j||0;for(var m=0,g=l.length;m<g;m++){var o=l[m];var n=(o.Id||o);var h=this._styleSheetFiles[n];V3.Dynamic.LoadSheet(n,h,(o.Prepend===true)||k,j);j++}},_getSearchboxPresetSizes:function(){return{small_accommodation:{ShowTabs:false,ShowActivity:false,ShowDestination:false,ShowDate:true,ShowNights:true,ShowPax:false,ShowAdvancedSearch:false},small_activity:{ShowTabs:false,ShowAccommodation:false,ShowDestination:false,ShowDate:true,CompactPax:true,PaxOptional:true,ShowAdvancedSearch:false,Terminology:{Guests:"Tickets"}},large:{ShowDestination:false,ShowNights:true,CompactPax:true,PaxOptional:false,ShowSeniors:false}}},_setInjectionInstance:function(){if(!this._injection){this._injection=new V3.CABS.Injection({EndPoint:this._endPoints.InjectionPage,Shortname:this._channelShortname,BrandingStyle:this._brandingStyle,BrandingView:this._brandingView})}this.Services.InjectionService=this._injection},_setEntityService:function(){if(!this._entityService){this._entityService=new V3.API.EntityWebService({Shortname:this._channelShortname,EndPoing:this._endPoints.EntityService})}this.Services.EntityService=this._entityService},_addProviderToolkitOverrides:function(){this._overrides.SearchBox.ShowDestination=false;this._overrides.SearchBox.ShowNights=false;this._overrides.SearchBox.ShowPax=false;this._overrides.SearchBox.ShowAdvancedSearch=false},_addProviderToolkitMethods:function(){this.createBookButton=function(h,g,i){return this._createBookButton.apply(this,[this._providerShortname].addRange(arguments))};this.createRateGridForProduct=function(h,g){return this.createRateGridForProducts([h],g)};this.createRateGridForProducts=function(g,h){if(!h){h={}}if(!h.ProductFilter){h.ProductFilter={}}h.ProviderShortname=this._providerShortname;h.ProductFilter.Codes=g;h.ShowServices=false;return this.createRateGrid(h)};this.createSearchBoxForProduct=function(h,g){return this.createSearchBoxForProducts([h],V3.extend(g,false,{ShowTabs:false}))};this.createSearchBoxForProducts=function(g,h){if(!V3.Is.Array(g)){throw new Error("productCodes must be an array")}h=V3.extend(h,false,{ProductFilter:{},ShowTabs:true});h.ProductFilter.Codes=g;return this.createSearchBox(h)}},_addDistributorToolkitOverrides:function(){},_addDistributorToolkitMethods:function(){var g=this;this.createBookButton=function(j,k,i,l){return this._createBookButton.apply(this,arguments)};this.createRateGridForProvider=function(j,i){return this.createRateGrid(V3.extend(i,true,{ProviderShortname:j}))};this.createSearchBoxForProvider=function(j,i){i=V3.extend(i,false,{});i.ProviderShortname=j;return this.createSearchBox(i)};var h={};this.checkProviderOptIn=function(i,j){return this.checkProviderOptIns(V3.Is.Array(i)?i:[i],function(k){return j(k[0])})};this.checkProviderOptIns=function(i,o){if(!i){throw new Error("providerShortnames must be a string")}if(!V3.Is.Function(o)){throw new Error("fCallback must be a function")}var j=[];var m=[];var l=function(){m.sort(function(q,p){return p.IsOptedIn-q.IsOptedIn});o(m)};i.forEach(function(q){var p=h[q.toLowerCase()];if(p){m.add({IsOptedIn:p.OptedIn,ProviderShortname:p.Shortname,Url:!p.OptedIn?null:g.getBookButtonUrl(q),ProviderEntity:p.Entity,Error:null})}else{if(q){j.add(q)}else{m.add({IsOptedIn:false,ProviderShortname:"",Url:null,ProviderEntity:null,Error:null})}}});if(j.length==0){l();return}return this._entityService.Search(function n(p){j.forEach(function(s){var r=p.Entities.find(function(t){return t.Code.toLowerCase()==s.toLowerCase()});var q={OptedIn:!!r,Entity:r,Shortname:r?r.Code:s};h[s.toLowerCase()]=q;m.add({IsOptedIn:q.OptedIn,ProviderShortname:q.Shortname,Url:!q.OptedIn?null:g.getBookButtonUrl(q.Shortname),ProviderEntity:q.Entity,Error:null})});l()},function k(p){j.forEach(function(q){m.add({IsOptedIn:false,ProviderShortname:q,Url:null,ProviderEntity:null,Error:p})});l()},{Filter:{Codes:j,Type:c.Provider},Output:{CommonContent:{Name:true}}})}},Services:V3.Object(),getBookButtonUrl:function(){var j,k,l;var h=0;if(this._providerShortname){j=this._providerShortname;h++}else{if(arguments[h]){j=arguments[h++]}}if(arguments[h]||arguments[h]===""){k=arguments[h++]}if(arguments[h]){l=arguments[h++]}var g=this._endPoints.AvailabilityPage+"?exl_dn="+encodeURI(this._channelShortname)+"&exl_psn="+encodeURI(j);if(this._brandingStyle){g+="&exl_bs="+encodeURI(this._brandingStyle);if(this._brandingView){g+="&exl_bv="+encodeURI(this._brandingView)}}if(k){g+="&exl_pgc="+encodeURI(k)}if(l){g+="&exl_prd="+encodeURI(l)}return g},_createBookButton:function(){var s,k,p,h,r,l,o;var n=0;if(V3.CABS.Utils.IsValidEntityCode(arguments[n])||V3.Is.Array(arguments[n])){s=arguments[n++]}else{s=null}if(arguments[n]===""||arguments[n]===null||V3.CABS.Utils.IsValidEntityCode(arguments[n])){k=arguments[n++]}else{k=null}if(arguments[n]===""||V3.CABS.Utils.IsValidEntityCode(arguments[n])){p=arguments[n++]}else{p=null}if(d.parse(arguments[n])){h=d.parse(arguments[n++])}else{h=null}if(V3.Is.String(arguments[n])){r=arguments[n++]}else{r=null}if(arguments[n]===true){o="_blank";n++}else{if(V3.Is.String(arguments[n])){o=arguments[n++]}else{o="_parent"}}if(V3.Is.String(arguments[n])){l=arguments[n++]}else{l=null}if(V3.Is.PlainObject(arguments[n])){var m=arguments[n++];if(V3.Is.String(m.ProviderShortname)||V3.Is.Array(m.ProviderShortname)){s=m.ProviderShortname}if(V3.Is.String(m.ServiceCode)){k=m.ServiceCode}if(V3.Is.String(m.ProductCode)){p=m.ProductCode}if(d.parse(m.Style)){h=d.parse(m.Style)}if(V3.Is.String(m.Text)){r=m.Text}if(V3.Is.String(m.Text2)){l=m.Text2}if(m.OpenInNewWindow===true){o="_blank"}if(V3.Is.String(m.Target)){o=m.Target}if(V3.Is.String(m.ImageUrl)){if(!h||h==d.Image){r=m.ImageUrl;h=d.Image}}}if(!V3.Is.Specified(r)){r=(s?"Check Availability":"Search")}if(!V3.Is.Specified(l)){l="Live Booking System"}var j=new V3.UI.HyperLink().Set({cssClass:"book-now-button",target:o});var g=new V3.UI.Label().Set({cssClass:"V3"}).Insert(j);g.BookButton=g;if(!h){if(/^(http:)?\/\//.test(r)){h=d.Image}else{h=d.Button1}}j.cssClassAdd("style-"+h.toString().toLowerCase());switch(d.parse(h)){case d.Button1:this._loadStyleSheets(this._styleSheetIncludes.BookNowButtonStyles,true,0);j.Insert(new V3.UI.Label(r),new V3.UI.Label().Insert(new V3.UI.SvgSimple({x:1,y:-2,width:18,height:23},"m3,9h1V6a5,5 0 0,1 12,0V9h1v11H3M14,9V6a4,4 0 1,0-8,0v3").Set({fillColor:new V3.Color(16777215),size:{width:12,height:12},addFilter:'<feGaussianBlur in="SourceAlpha" stdDeviation="0 1" result="blur"/><feOffset in="blur" dx="0" dy="-1.5" result="offsetBlur"/><feFlood flood-color="#000" flood-opacity="0.4" result="offsetColor"/><feComposite in="offsetColor" in2="offsetBlur" operator="in" result="offsetBlur"/><feMerge><feMergeNode/><feMergeNode in="SourceGraphic"/></feMerge>'}),new V3.UI.Label(l)));break;case d.Image:j.Insert(new V3.UI.Image(r));break;case d.HyperLink:j.text(r);break}if(!s){j.href(this._endPoints.SearchPage+"?exl_dn="+this._channelShortname)}else{if(this._providerShortname){j.href(this.getBookButtonUrl(this._providerShortname,k,p))}else{j.visible(false);var q=function(i){if(V3.Is.Array(i)){i=i.find(function(t){return t.IsOptedIn})||{IsOptedIn:false}}j.href(this.getBookButtonUrl(i.ProviderShortname,k,p));j.visible(i.IsOptedIn);if(this._demoMode&&!i.IsOptedIn){g.Insert(new V3.UI.Label("Not opted-in or a web call error occurred so no button was rendered").Set({cssClass:"demo error"}))}}.bind(this);if(V3.Is.Array(s)){this.checkProviderOptIns(s,q)}else{this.checkProviderOptIn(s,q)}}}return g},createSearchBox:function(l){var v=(!this._demoMode?null:{Minimal:V3.createJsonForDebug(l||{},4)});var t=V3.extend({EnableUniform:true,IncludeStyleSheet:{Prepend:true},PresetSize:"large",ProviderShortname:null,ServiceFilter:null,ProductFilter:null,SortBy:null,BeforePresentation:function(z,y,x){return(y&&x.Entities.length>0)},AdditionalParams:null,EntityServiceApiSettings:{Shortname:this._channelShortname},CssClass:"",ButtonText:"Search"},true,this._overrides.SearchBox);l=V3.extend(l,true,this._overrides.SearchBox);l.Terminology=V3.extend(l.Terminology,true,this._settings.Terminology);l.Criteria=V3.extend(l.Criteria,false,this._settings.DefaultCriteria);l=V3.extend(l,false,t);if(this._demoMode){v.Short=V3.createJsonForDebug(l,4)}if(this._providerShortname){l.ProviderShortname=this._providerShortname}var g,u,r,m=null;if(l.ProductFilter&&!(l.ProviderShortname||l.ServiceFilter)){throw new Error("ProductFilter can only be used when ProviderShortname or ServiceFilter are also supplied.")}var j=null;var o=null;if(l.ProviderShortname){l.showTabs=false;var p=false;var n={Filter:{Type:c.Provider,Codes:V3.Is.Array(l.ProviderShortname)?l.ProviderShortname:[l.ProviderShortname]},Output:{Children:{},Settings:true}};if(l.ProductFilter){n.Output.Children.Filter=l.ProductFilter||{};n.Output.Children.Filter.Type=c.Product;p=true}else{if(l.ServiceFilter){n.Output.Children.Filter=l.ServiceFilter||{};n.Output.Children.Filter.Type=c.Service;p=true}}n.Output.Children.Output={Bookability:{},CommonContent:{Capabilities:true,IndustryCategories:true}};var q=this._demoMode;var s=function(x){try{if(x.Entities.length>0){m=x.Entities[0];if(p){if(x.Entities[0].Children.length==1&&x.Entities[0].Children[0].Type==c.Product){j=x.Entities[0].Children[0].Id}else{if(x.Entities[0].Children[0].Type==c.Service){if(!o){o=[];x.Entities[0].Children.forEach(function(z){o.add(z.Code)})}}}}u.setLimitsFromEntities(x.Entities[0].Children);u.criteria(x.Entities[0].Settings.DefaultCriteria);u.configure(l)}}catch(y){V3.Log.Error("Error thrown while trying to setup searchbox with provider/service/product defaults","err",y)}if(!l.BeforePresentation||l.BeforePresentation(u,true,x)){u.visible(true)}else{if(x.Entities.length==0&&q){g.Insert(new V3.UI.Label("No results returned so no search box rendered, please check filters").Set({cssClass:"demo error"}))}}};var i=function(x){if(!l.BeforePresentation||l.BeforePresentation(u,false,x)){u.visible(true)}if(q){g.Insert(new V3.UI.Label("There was a Web Call Error so the searchbox was not rendered, error: "+x).Set({cssClass:"demo error"}))}};var h=this._entityService.Search(s,i,n);r=true}var w=this._getSearchboxPresetSizes();var k=w[(l.PresetSize||"").toLowerCase()]||w.large;if(r){k.Terminology=null}l=V3.extend(l,false,k);if(!l.CssClass.contains("horizontal")&&!l.CssClass.contains("vertical")){if((l.Orientation+"").toLowerCase()=="horizontal"){l.CssClass=l.CssClass+" horizontal"}else{l.CssClass=l.CssClass+" vertical"}}if(l.IncludeStyleSheet){this._loadStyleSheets(this._styleSheetIncludes.SearchBox,l.IncludeStyleSheet.Prepend,l.IncludeStyleSheet.NumberToSkip)}u=new V3.CABS.UI.SearchControl(l).Set({visible:!r,OnPerformSearch:function(x,y){if(l.ProviderShortname){this._injection.availabilityInjection({ProviderShortname:m.Code,Criteria:y.Criteria,IncludedLocationCodes:l.AllowedLocationCodes,SortBy:l.SortBy,HighlightProductId:j,ServiceCodes:o,AdditionalParams:l.AdditionalParams})}else{this._injection.searchInjection({Criteria:y.Criteria,IncludedLocationCodes:l.AllowedLocationCodes,SortBy:l.SortBy,AdditionalParams:l.AdditionalParams})}}.bind(this),OnVisibleChange:function(x,y){if(l.EnableUniform&&V3.jQuery&&V3.jQuery.uniform){V3.jQuery(document).ready(function(){var z={selectClass:"selector uniform double-digit",checkboxClass:"checker uniform"};var A="#"+x.DOMElement.id+".search-control select, #"+x.DOMElement.id+".search-control input[type='checkbox']";V3.jQuery(A).uniform(z);u.Tabs.OnSelectedTabIndexChanged.addEventHandler(function(B,C){V3.jQuery.uniform.update(A)})})}}});g=new V3.UI.Panel("V3");g.SearchBox=u;g.Insert(u);if(this._demoMode){V3.CABS.Utils._getDefaultTerminology(l.Terminology);v.Verbose=V3.createJsonForDebug(l,4);g.DemoJson=v}return g},createSearchBoxForService:function(h,i,g){if(arguments.length==1){i=arguments[0];h=null;g=null}else{if(arguments.length==2){if(!V3.Is.String(i)){g=arguments[1];i=arguments[0];h=null}}}return this.createSearchBoxForServices(h,[i],g)},createSearchBoxForServices:function(i,g,h){if(arguments.length==1){g=arguments[0];i=null;h=null}else{if(arguments.length==2){if(!V3.Is.String(i)){h=arguments[1];g=arguments[0];i=null}}}if(!V3.Is.Array(g)){throw new Error("productGroupCodes must be an array")}h=V3.extend(h,false,{ServiceFilter:{},ShowTabs:true});h.ProviderShortname=i;h.ServiceFilter.Codes=g;return this.createSearchBox(h)},createRateGrid:function(t){var g=this;var m=this._demoMode;var s=(!m?null:{Minimal:V3.createJsonForDebug(t||{},4)});if(!t){t={}}var w=!!t.Date;var n=!!t.MinDate;var p=!!t.MaxDate;var y=V3.extend({EnableUniform:true,IncludeStyleSheet:{Prepend:true},ShowServices:true,ShowProducts:true,ExpandProducts:false,ShowBookButtons:true,AllowDateNavigation:true,OpenInNewWindow:false,PreloadAvailability:true,ShowLoadingImage:true,BeforePresentation:function(B,A,z){return(A&&B.Rows.count()>1)},IndustryCategoryGroup:null,SortBy:null,ProductFilter:{},ServiceFilter:{TagCriteria:{}},AdditionalParams:null,ServiceCodes:null,PartnerShortname:null,ProviderShortname:null,EntityServiceApiSettings:{Shortname:this._channelShortname},HighlightedDays:t.AllowDateNavigation===false?0:1},true,this._overrides.RateGrid);t=V3.extend(t,false,y);t=V3.extend(t,false,this._settings.RateGrid);if(t.IndustryCategoryGroup){t.ServiceFilter.TagCriteria.IndustryCategoryGroups=[t.IndustryCategoryGroup]}if(m){s.Short=V3.createJsonForDebug(t,4)}t=V3.extend(t,true,this._overrides.RateGrid);t.Terminology=V3.extend(t.Terminology,true,this._settings.Terminology);t.Criteria=V3.extend(t.Criteria,false,this._settings.DefaultCriteria);if(t.IncludeStyleSheet){this._loadStyleSheets(this._styleSheetIncludes.RateGrid,t.IncludeStyleSheet.Prepend,t.IncludeStyleSheet.NumberToSkip)}if(!t.ShowServices&&!t.ShowProducts){V3.Log.Warn("ShowServices and ShowProducts is set to false, this is invalid so turning on ShowServices");t.ShowServices=true}var l=new V3.UI.Panel("V3 rate-grid-container");var r=!m?null:function(){s.Verbose=V3.createJsonForDebug(t,4);l.DemoJson=s};var i=function(A){if(m){r(t)}l.RateGrid=A;l.Insert(A);if(!t.ShowServices){A.cssClassAdd("products-only")}if(!t.ShowBookButtons){if(!t.ShowServices||!t.ShowProducts){A.cssClassAdd("no-controls")}}else{var z=function(F,E,D,C){var B={OpenInNewWindow:t.OpenInNewWindow,Criteria:{Destination:g._providerShortname?null:{ServiceId:F},IndustryCategoryGroup:D,Date:(C||(t.Criteria&&t.Criteria.Date))||(A.highlightedDays()&&A.date())},SortBy:t.SortBy,HighlightProductId:E||F,AdditionalParams:t.AdditionalParams};if(B.Criteria.Date){B.Criteria.Date=new V3Date(B.Criteria.Date).date()}if(g._providerShortname){if(E){}B.ProviderShortname=q._providerShortname;g._injection.availabilityInjection(B)}else{B.ProviderShortname=t.ProviderShortname;g._injection.availabilityInjection(B)}};A.OnRowAdded.addEventHandler(function(D,E){if(!E.Row.Entity){return}E.Row.OnRateClicked.addEventHandler(function(F,G){A.date(G.date)});if(E.Row.Entity.Type==V3.CABS.EntityTypeEnum.Service){var C=E.Row.Entity;if(!t.ShowProducts){E.Row.OnRateClicked.addEventHandler(function(F,G){z(C.Id,null,C.IndustryCategoryGroups[0],G.date)});E.Row.LastCell.Insert(new V3.UI.Button("View").Set({cssClass:"button blue",OnClick:function(F,G){z(C.Id,null,C.IndustryCategoryGroups[0],null)}}))}}else{if(E.Row.Entity.Type==V3.CABS.EntityTypeEnum.Product){var B=E.Row.Entity;E.Row.OnRateClicked.addEventHandler(function(F,G){z(B.ParentId,B.Id,B.IndustryCategoryGroups[0],G.date)});E.Row.LastCell.Insert(new V3.UI.Button("View").Set({cssClass:"button orange",OnClick:function(F,G){z(B.ParentId,B.Id,B.IndustryCategoryGroups[0],null)}}))}}})}};var x;var q=this;if(t.MinDate&&t.MaxDate){if(!t.AllowDateNavigation){t.MinDate=t.MaxDate=new V3Date(t.MinDate||t.MaxDate||t.Date||null).date()}x=new V3.CABS.UI.RateGrid(t).Set({visible:false});i(x)}else{x=null}var h=function(B){var D=null,A=null,C;B.Entities.forEach(function(G){if(G){if(G.Bookability&&G.Bookability.AvailabilityDateRange){if(D==null||D>G.Bookability.AvailabilityDateRange.Min){D=G.Bookability.AvailabilityDateRange.Min}if(A==null||A<G.Bookability.AvailabilityDateRange.Max){A=G.Bookability.AvailabilityDateRange.Max}}if(G.Settings&&G.Settings.DefaultCriteria&&G.Settings.DefaultCriteria.DateIsCustomised){if(C==null||C<G.Settings.DefaultCriteria.Date){C=G.Settings.DefaultCriteria.Date}}}});if(D&&D<new Date()){D=new V3Date()}if(x){if(!w&&C){x.date(C)}}else{if(!w&&C){t.Date=C}if(!n&&D){t.MinDate=D}if(!p&&A){t.MaxDate=A}if(!t.AllowDateNavigation){t.MinDate=t.MaxDate=new V3Date(t.Date||t.MinDate||t.MaxDate||null).date()}x=new V3.CABS.UI.RateGrid(t).Set({visible:false});i(x)}if(!t.AllowDateNavigation){t.MinDate=t.MaxDate=new V3Date(t.Date||t.MinDate||t.MaxDate||null).asV3Date().date()}x.beginBulkLoad();var F;var z=new V3.Utils.StopWatch(true);B.Entities.forEach(function(H){if(!H.Children||H.Children.length==0){return}if(t.ShowServices){var G=x.addRowForEntity(H,t.ShowProducts,null);if(t.ShowProducts&&t.ExpandProducts){G.productRowsVisible(true)}F=G}else{H.Children.forEach(function(J){var I=x.addRowForEntity(J,false,null,H)})}});z.stop();V3.Log.Info("Time to render "+x.Rows.count()+" services on grid: "+z.getDuration()+"ms");x.endBulkLoad();var E=(B.Entities.length>0);if(t.BeforePresentation&&t.BeforePresentation(x,E,B)===false){E=false}x.visible(E);if(o){o.Parent.Controls.remove(o)}if(m&&!E){l.Insert(new V3.UI.Label("No results returned so the rate grid was not rendered, please check filters").Set({cssClass:"demo error"}))}};var v=function(z){if(t.BeforePresentation){t.BeforePresentation(x,false,z)}if(l.Controls.count()==2){l.Controls.removeAt(1)}if(m){l.Insert(new V3.UI.Label("Web Call Error so no rate grid rendered, error: "+z).Set({cssClass:"demo error"}))}};var k={ProductFilter:t.ProductFilter,ServiceFilter:t.ServiceFilter};var j={ServiceOutput:V3.extend(t.ServiceOutput,false,{CommonContent:{All:false,Name:true,IndustryCategories:true,Capabilities:true},Bookability:{},Settings:true}),ProductOutput:V3.extend(t.ProductOutput,false,{CommonContent:{All:false,Name:true,IndustryCategories:true,Capabilities:true}})};if(t.PreloadAvailability){if(x){j.ServiceOutput.Availability=V3.extend(j.ServiceOutput.Availability,false,{StartDate:x.startDate(),NumberOfDays:x.size()}),j.ProductOutput.Availability=V3.extend(j.ProductOutput.Availability,false,{StartDate:x.startDate(),NumberOfDays:x.size()})}else{V3.Log.Warn("To preload availability then MinDate and MaxDate must be supplied")}}if(this._providerShortname){t.PartnerShortname=null;t.ProviderShortname=this._providerShortname}var u=null;if(this._providerShortname&&!this._isOptedIn){if(m){l.Insert(new V3.UI.Label("No results returned so no rate grid rendered, please check filters").Set({cssClass:"demo error"}))}}else{if(t.PartnerShortname){u=this._entityService.FindServicesByPartnerShortname(h,v,t.PartnerShortname,k,j)}else{if(t.ProviderShortname){u=this._entityService.FindServicesByProviderShortname(h,v,t.ProviderShortname,k,j)}else{if(t.ServiceCodes!=null&&t.ServiceCodes.length>0){u=this._entityService.GetServicesByCodes(h,v,t.ServiceCodes,k,j)}else{throw new Error("Not enough information supplied to search for Services")}}}}if(u){var o=V3.UI.Images.LoadingCircular.createInstance();if(t.ShowLoadingImage){l.Insert(o)}}else{if(x&&t.BeforePresentation&&t.BeforePresentation(x,true,null)!==false){x.visible(true)}}if(m){V3.CABS.Utils._getDefaultTerminology(t.Terminology);r()}return l},createRateGridForService:function(h,i,g){if(arguments.length==1){i=arguments[0];h=null;g=null}else{if(arguments.length==2){if(!V3.Is.String(i)){g=arguments[1];i=arguments[0];h=null}}}return this.createRateGridForServices(h,[i],g)},createRateGridForServices:function(i,g,h){if(arguments.length==1){g=arguments[0];i=null;h=null}else{if(arguments.length==2){if(!V3.Is.String(i)){h=arguments[1];g=arguments[0];i=null}}}if(!h){h={}}if(!h.ServiceFilter){h.ServiceFilter={}}h.ProviderShortname=i;h.ServiceFilter.Codes=g;h.ShowProducts=false;return this.createRateGrid(h)}});V3.CABS.Toolkit=b}); })(V3);

(function(V3){
    var settings = { 
        DistributorShortname: "welcometoyorkshire",
        ProviderShortname: null,
        ProviderIsOptedIn: false,
        BrandingStyle: null,
        BrandingView: null,
        EndPoints: {
            BookingService: "https://book.txgb.co.uk/v4/Services/BookingService.asmx",
            EntityService: "https://book.txgb.co.uk/v4/Services/EntityService.asmx",
            LocationService: "https://book.txgb.co.uk/v4/Services/LocationService.asmx",
            InjectionPage: "https://book.txgb.co.uk/v4/Services/Injection.aspx",
            SearchPage: "https://book.txgb.co.uk/v4/Pages/Search.aspx",
            AvailabilityPage: "https://book.txgb.co.uk/v4/Pages/Availability.aspx"
        },
        StyleSheetFiles:{
            Base: "https://book.txgb.co.uk/v4/Resources/Styles/base.min.css",
            Site: "https://book.txgb.co.uk/v4/Resources/Styles/site.min.css",
            BaseUtils: "https://book.txgb.co.uk/v4/Resources/Styles/base.utils.min.css",
            Search: "https://book.txgb.co.uk/v4/Resources/Styles/search.min.css",
            jQueryUI: "https://book.txgb.co.uk/v4/Resources/Libraries/jquery-theme/jquery-ui-1.8.17.custom.min.css",
        },
        StyleSheetIncludes: {
            SearchBox: [{Id:'Base', Prepend:true},'BaseUtils', 'jQueryUI', 'Site', 'Search'],
            RateGrid: [{Id:'Base', Prepend:true},'BaseUtils', 'Site', 'Search'],
            BookNowButtonStyles: ['Search']
        },
        Settings: {"RateGrid":{"ShowCurrencySymbol":false}},
        Overrides: {
            SearchBox: null,
            RateGrid: null
        }
    };
    var varName = 'DistributorToolkit';
window[varName] = new V3.CABS.Toolkit(settings);
})(V3);
