var COMPILED=true,goog=goog||{};goog.global=this;goog.DEBUG=true;goog.LOCALE="en";goog.evalWorksForGlobals_=null;goog.provide=function(a){if(!COMPILED){if(goog.getObjectByName(a)&&!goog.implicitNamespaces_[a])throw Error('Namespace "'+a+'" already declared.');for(var b=a;b=b.substring(0,b.lastIndexOf("."));)goog.implicitNamespaces_[b]=true}goog.exportPath_(a)};
goog.setTestOnly=function(a){if(COMPILED&&!goog.DEBUG){a=a||"";throw Error("Importing test-only code into non-debug environment"+a?": "+a:".");}};if(!COMPILED)goog.implicitNamespaces_={};goog.exportPath_=function(a,b,c){a=a.split(".");c=c||goog.global;!(a[0]in c)&&c.execScript&&c.execScript("var "+a[0]);for(var d;a.length&&(d=a.shift());)if(!a.length&&goog.isDef(b))c[d]=b;else c=c[d]?c[d]:(c[d]={})};
goog.getObjectByName=function(a,b){for(var c=a.split("."),d=b||goog.global,e;e=c.shift();)if(goog.isDefAndNotNull(d[e]))d=d[e];else return null;return d};goog.globalize=function(a,b){var c=b||goog.global;for(var d in a)c[d]=a[d]};
goog.addDependency=function(a,b,c){if(!COMPILED){var d;a=a.replace(/\\/g,"/");for(var e=goog.dependencies_,f=0;d=b[f];f++){e.nameToPath[d]=a;a in e.pathToNames||(e.pathToNames[a]={});e.pathToNames[a][d]=true}for(d=0;b=c[d];d++){a in e.requires||(e.requires[a]={});e.requires[a][b]=true}}};
goog.require=function(a){if(!COMPILED)if(!goog.getObjectByName(a)){var b=goog.getPathFromDeps_(a);if(b){goog.included_[b]=true;goog.writeScripts_()}else{a="goog.require could not find: "+a;goog.global.console&&goog.global.console.error(a);throw Error(a);}}};goog.basePath="";goog.nullFunction=function(){};goog.identityFunction=function(a){return a};goog.abstractMethod=function(){throw Error("unimplemented abstract method");};
goog.addSingletonGetter=function(a){a.getInstance=function(){return a.instance_||(a.instance_=new a)}};
if(!COMPILED){goog.included_={};goog.dependencies_={pathToNames:{},nameToPath:{},requires:{},visited:{},written:{}};goog.inHtmlDocument_=function(){var a=goog.global.document;return typeof a!="undefined"&&"write"in a};goog.findBasePath_=function(){if(goog.global.CLOSURE_BASE_PATH)goog.basePath=goog.global.CLOSURE_BASE_PATH;else if(goog.inHtmlDocument_())for(var a=goog.global.document.getElementsByTagName("script"),b=a.length-1;b>=0;--b){var c=a[b].src,d=c.lastIndexOf("?");d=d==-1?c.length:d;if(c.substr(d-
7,7)=="base.js"){goog.basePath=c.substr(0,d-7);return}}};goog.importScript_=function(a){var b=goog.global.CLOSURE_IMPORT_SCRIPT||goog.writeScriptTag_;if(!goog.dependencies_.written[a]&&b(a))goog.dependencies_.written[a]=true};goog.writeScriptTag_=function(a){if(goog.inHtmlDocument_()){goog.global.document.write('<script type="text/javascript" src="'+a+'"><\/script>');return true}else return false};goog.writeScripts_=function(){function a(f){if(!(f in d.written)){if(!(f in d.visited)){d.visited[f]=
true;if(f in d.requires)for(var g in d.requires[f])if(g in d.nameToPath)a(d.nameToPath[g]);else if(!goog.getObjectByName(g))throw Error("Undefined nameToPath for "+g);}if(!(f in c)){c[f]=true;b.push(f)}}}var b=[],c={},d=goog.dependencies_;for(var e in goog.included_)d.written[e]||a(e);for(e=0;e<b.length;e++)if(b[e])goog.importScript_(goog.basePath+b[e]);else throw Error("Undefined script input");};goog.getPathFromDeps_=function(a){return a in goog.dependencies_.nameToPath?goog.dependencies_.nameToPath[a]:
null};goog.findBasePath_();goog.global.CLOSURE_NO_DEPS||goog.importScript_(goog.basePath+"deps.js")}
goog.typeOf=function(a){var b=typeof a;if(b=="object")if(a){if(a instanceof Array)return"array";else if(a instanceof Object)return b;var c=Object.prototype.toString.call(a);if(c=="[object Window]")return"object";if(c=="[object Array]"||typeof a.length=="number"&&typeof a.splice!="undefined"&&typeof a.propertyIsEnumerable!="undefined"&&!a.propertyIsEnumerable("splice"))return"array";if(c=="[object Function]"||typeof a.call!="undefined"&&typeof a.propertyIsEnumerable!="undefined"&&!a.propertyIsEnumerable("call"))return"function"}else return"null";
else if(b=="function"&&typeof a.call=="undefined")return"object";return b};goog.propertyIsEnumerableCustom_=function(a,b){if(b in a)for(var c in a)if(c==b&&Object.prototype.hasOwnProperty.call(a,b))return true;return false};goog.propertyIsEnumerable_=function(a,b){return a instanceof Object?Object.prototype.propertyIsEnumerable.call(a,b):goog.propertyIsEnumerableCustom_(a,b)};goog.isDef=function(a){return a!==undefined};goog.isNull=function(a){return a===null};
goog.isDefAndNotNull=function(a){return a!=null};goog.isArray=function(a){return goog.typeOf(a)=="array"};goog.isArrayLike=function(a){var b=goog.typeOf(a);return b=="array"||b=="object"&&typeof a.length=="number"};goog.isDateLike=function(a){return goog.isObject(a)&&typeof a.getFullYear=="function"};goog.isString=function(a){return typeof a=="string"};goog.isBoolean=function(a){return typeof a=="boolean"};goog.isNumber=function(a){return typeof a=="number"};
goog.isFunction=function(a){return goog.typeOf(a)=="function"};goog.isObject=function(a){a=goog.typeOf(a);return a=="object"||a=="array"||a=="function"};goog.getUid=function(a){return a[goog.UID_PROPERTY_]||(a[goog.UID_PROPERTY_]=++goog.uidCounter_)};goog.removeUid=function(a){"removeAttribute"in a&&a.removeAttribute(goog.UID_PROPERTY_);try{delete a[goog.UID_PROPERTY_]}catch(b){}};goog.UID_PROPERTY_="closure_uid_"+Math.floor(Math.random()*2147483648).toString(36);goog.uidCounter_=0;
goog.getHashCode=goog.getUid;goog.removeHashCode=goog.removeUid;goog.cloneObject=function(a){var b=goog.typeOf(a);if(b=="object"||b=="array"){if(a.clone)return a.clone();b=b=="array"?[]:{};for(var c in a)b[c]=goog.cloneObject(a[c]);return b}return a};goog.bindNative_=function(a){return a.call.apply(a.bind,arguments)};
goog.bindJs_=function(a,b){var c=b||goog.global;if(arguments.length>2){var d=Array.prototype.slice.call(arguments,2);return function(){var e=Array.prototype.slice.call(arguments);Array.prototype.unshift.apply(e,d);return a.apply(c,e)}}else return function(){return a.apply(c,arguments)}};goog.bind=function(){goog.bind=Function.prototype.bind&&Function.prototype.bind.toString().indexOf("native code")!=-1?goog.bindNative_:goog.bindJs_;return goog.bind.apply(null,arguments)};
goog.partial=function(a){var b=Array.prototype.slice.call(arguments,1);return function(){var c=Array.prototype.slice.call(arguments);c.unshift.apply(c,b);return a.apply(this,c)}};goog.mixin=function(a,b){for(var c in b)a[c]=b[c]};goog.now=Date.now||function(){return+new Date};
goog.globalEval=function(a){if(goog.global.execScript)goog.global.execScript(a,"JavaScript");else if(goog.global.eval){if(goog.evalWorksForGlobals_==null){goog.global.eval("var _et_ = 1;");if(typeof goog.global._et_!="undefined"){delete goog.global._et_;goog.evalWorksForGlobals_=true}else goog.evalWorksForGlobals_=false}if(goog.evalWorksForGlobals_)goog.global.eval(a);else{var b=goog.global.document,c=b.createElement("script");c.type="text/javascript";c.defer=false;c.appendChild(b.createTextNode(a));
b.body.appendChild(c);b.body.removeChild(c)}}else throw Error("goog.globalEval not available");};goog.getCssName=function(a,b){var c=function(e){return goog.cssNameMapping_[e]||e},d;d=goog.cssNameMapping_?goog.cssNameMappingStyle_=="BY_WHOLE"?c:function(e){e=e.split("-");for(var f=[],g=0;g<e.length;g++)f.push(c(e[g]));return f.join("-")}:function(e){return e};return b?a+"-"+d(b):d(a)};goog.setCssNameMapping=function(a,b){goog.cssNameMapping_=a;goog.cssNameMappingStyle_=b};
goog.getMsg=function(a,b){var c=b||{};for(var d in c){var e=(""+c[d]).replace(/\$/g,"$$$$");a=a.replace(new RegExp("\\{\\$"+d+"\\}","gi"),e)}return a};goog.exportSymbol=function(a,b,c){goog.exportPath_(a,b,c)};goog.exportProperty=function(a,b,c){a[b]=c};goog.inherits=function(a,b){function c(){}c.prototype=b.prototype;a.superClass_=b.prototype;a.prototype=new c;a.prototype.constructor=a};
goog.base=function(a,b){var c=arguments.callee.caller;if(c.superClass_)return c.superClass_.constructor.apply(a,Array.prototype.slice.call(arguments,1));for(var d=Array.prototype.slice.call(arguments,2),e=false,f=a.constructor;f;f=f.superClass_&&f.superClass_.constructor)if(f.prototype[b]===c)e=true;else if(e)return f.prototype[b].apply(a,d);if(a[b]===c)return a.constructor.prototype[b].apply(a,d);else throw Error("goog.base called from a method of one name to a method of a different name");};
goog.scope=function(a){a.call(goog.global)};goog.debug={};goog.debug.Error=function(a){this.stack=(new Error).stack||"";if(a)this.message=String(a)};goog.inherits(goog.debug.Error,Error);goog.debug.Error.prototype.name="CustomError";goog.string={};goog.string.Unicode={NBSP:"\u00a0"};goog.string.startsWith=function(a,b){return a.lastIndexOf(b,0)==0};goog.string.endsWith=function(a,b){var c=a.length-b.length;return c>=0&&a.indexOf(b,c)==c};
goog.string.caseInsensitiveStartsWith=function(a,b){return goog.string.caseInsensitiveCompare(b,a.substr(0,b.length))==0};goog.string.caseInsensitiveEndsWith=function(a,b){return goog.string.caseInsensitiveCompare(b,a.substr(a.length-b.length,b.length))==0};goog.string.subs=function(a){for(var b=1;b<arguments.length;b++){var c=String(arguments[b]).replace(/\$/g,"$$$$");a=a.replace(/\%s/,c)}return a};
goog.string.collapseWhitespace=function(a){return a.replace(/[\s\xa0]+/g," ").replace(/^\s+|\s+$/g,"")};goog.string.isEmpty=function(a){return/^[\s\xa0]*$/.test(a)};goog.string.isEmptySafe=function(a){return goog.string.isEmpty(goog.string.makeSafe(a))};goog.string.isBreakingWhitespace=function(a){return!/[^\t\n\r ]/.test(a)};goog.string.isAlpha=function(a){return!/[^a-zA-Z]/.test(a)};goog.string.isNumeric=function(a){return!/[^0-9]/.test(a)};goog.string.isAlphaNumeric=function(a){return!/[^a-zA-Z0-9]/.test(a)};
goog.string.isSpace=function(a){return a==" "};goog.string.isUnicodeChar=function(a){return a.length==1&&a>=" "&&a<="~"||a>="\u0080"&&a<="\ufffd"};goog.string.stripNewlines=function(a){return a.replace(/(\r\n|\r|\n)+/g," ")};goog.string.canonicalizeNewlines=function(a){return a.replace(/(\r\n|\r|\n)/g,"\n")};goog.string.normalizeWhitespace=function(a){return a.replace(/\xa0|\s/g," ")};goog.string.normalizeSpaces=function(a){return a.replace(/\xa0|[ \t]+/g," ")};
goog.string.trim=function(a){return a.replace(/^[\s\xa0]+|[\s\xa0]+$/g,"")};goog.string.trimLeft=function(a){return a.replace(/^[\s\xa0]+/,"")};goog.string.trimRight=function(a){return a.replace(/[\s\xa0]+$/,"")};goog.string.caseInsensitiveCompare=function(a,b){var c=String(a).toLowerCase(),d=String(b).toLowerCase();return c<d?-1:c==d?0:1};goog.string.numerateCompareRegExp_=/(\.\d+)|(\d+)|(\D+)/g;
goog.string.numerateCompare=function(a,b){if(a==b)return 0;if(!a)return-1;if(!b)return 1;for(var c=a.toLowerCase().match(goog.string.numerateCompareRegExp_),d=b.toLowerCase().match(goog.string.numerateCompareRegExp_),e=Math.min(c.length,d.length),f=0;f<e;f++){var g=c[f],h=d[f];if(g!=h){c=parseInt(g,10);if(!isNaN(c)){d=parseInt(h,10);if(!isNaN(d)&&c-d)return c-d}return g<h?-1:1}}if(c.length!=d.length)return c.length-d.length;return a<b?-1:1};goog.string.encodeUriRegExp_=/^[a-zA-Z0-9\-_.!~*'()]*$/;
goog.string.urlEncode=function(a){a=String(a);if(!goog.string.encodeUriRegExp_.test(a))return encodeURIComponent(a);return a};goog.string.urlDecode=function(a){return decodeURIComponent(a.replace(/\+/g," "))};goog.string.newLineToBr=function(a,b){return a.replace(/(\r\n|\r|\n)/g,b?"<br />":"<br>")};
goog.string.htmlEscape=function(a,b){if(b)return a.replace(goog.string.amperRe_,"&amp;").replace(goog.string.ltRe_,"&lt;").replace(goog.string.gtRe_,"&gt;").replace(goog.string.quotRe_,"&quot;");else{if(!goog.string.allRe_.test(a))return a;if(a.indexOf("&")!=-1)a=a.replace(goog.string.amperRe_,"&amp;");if(a.indexOf("<")!=-1)a=a.replace(goog.string.ltRe_,"&lt;");if(a.indexOf(">")!=-1)a=a.replace(goog.string.gtRe_,"&gt;");if(a.indexOf('"')!=-1)a=a.replace(goog.string.quotRe_,"&quot;");return a}};
goog.string.amperRe_=/&/g;goog.string.ltRe_=/</g;goog.string.gtRe_=/>/g;goog.string.quotRe_=/\"/g;goog.string.allRe_=/[&<>\"]/;goog.string.unescapeEntities=function(a){if(goog.string.contains(a,"&"))return"document"in goog.global&&!goog.string.contains(a,"<")?goog.string.unescapeEntitiesUsingDom_(a):goog.string.unescapePureXmlEntities_(a);return a};
goog.string.unescapeEntitiesUsingDom_=function(a){var b=goog.global.document.createElement("div");b.innerHTML="<pre>x"+a+"</pre>";b.firstChild[goog.string.NORMALIZE_FN_]&&b.firstChild[goog.string.NORMALIZE_FN_]();a=b.firstChild.firstChild.nodeValue.slice(1);b.innerHTML="";return goog.string.canonicalizeNewlines(a)};
goog.string.unescapePureXmlEntities_=function(a){return a.replace(/&([^;]+);/g,function(b,c){switch(c){case "amp":return"&";case "lt":return"<";case "gt":return">";case "quot":return'"';default:if(c.charAt(0)=="#"){var d=Number("0"+c.substr(1));if(!isNaN(d))return String.fromCharCode(d)}return b}})};goog.string.NORMALIZE_FN_="normalize";goog.string.whitespaceEscape=function(a,b){return goog.string.newLineToBr(a.replace(/  /g," &#160;"),b)};
goog.string.stripQuotes=function(a,b){for(var c=b.length,d=0;d<c;d++){var e=c==1?b:b.charAt(d);if(a.charAt(0)==e&&a.charAt(a.length-1)==e)return a.substring(1,a.length-1)}return a};goog.string.truncate=function(a,b,c){if(c)a=goog.string.unescapeEntities(a);if(a.length>b)a=a.substring(0,b-3)+"...";if(c)a=goog.string.htmlEscape(a);return a};
goog.string.truncateMiddle=function(a,b,c,d){if(c)a=goog.string.unescapeEntities(a);if(d){if(d>b)d=b;var e=a.length-d;a=a.substring(0,b-d)+"..."+a.substring(e)}else if(a.length>b){d=Math.floor(b/2);e=a.length-d;d+=b%2;a=a.substring(0,d)+"..."+a.substring(e)}if(c)a=goog.string.htmlEscape(a);return a};goog.string.specialEscapeChars_={"\u0000":"\\0","\u0008":"\\b","\u000c":"\\f","\n":"\\n","\r":"\\r","\t":"\\t","\u000b":"\\x0B",'"':'\\"',"\\":"\\\\"};goog.string.jsEscapeCache_={"'":"\\'"};
goog.string.quote=function(a){a=String(a);if(a.quote)return a.quote();else{for(var b=['"'],c=0;c<a.length;c++){var d=a.charAt(c),e=d.charCodeAt(0);b[c+1]=goog.string.specialEscapeChars_[d]||(e>31&&e<127?d:goog.string.escapeChar(d))}b.push('"');return b.join("")}};goog.string.escapeString=function(a){for(var b=[],c=0;c<a.length;c++)b[c]=goog.string.escapeChar(a.charAt(c));return b.join("")};
goog.string.escapeChar=function(a){if(a in goog.string.jsEscapeCache_)return goog.string.jsEscapeCache_[a];if(a in goog.string.specialEscapeChars_)return goog.string.jsEscapeCache_[a]=goog.string.specialEscapeChars_[a];var b=a,c=a.charCodeAt(0);if(c>31&&c<127)b=a;else{if(c<256){b="\\x";if(c<16||c>256)b+="0"}else{b="\\u";if(c<4096)b+="0"}b+=c.toString(16).toUpperCase()}return goog.string.jsEscapeCache_[a]=b};goog.string.toMap=function(a){for(var b={},c=0;c<a.length;c++)b[a.charAt(c)]=true;return b};
goog.string.contains=function(a,b){return a.indexOf(b)!=-1};goog.string.removeAt=function(a,b,c){var d=a;if(b>=0&&b<a.length&&c>0)d=a.substr(0,b)+a.substr(b+c,a.length-b-c);return d};goog.string.remove=function(a,b){var c=new RegExp(goog.string.regExpEscape(b),"");return a.replace(c,"")};goog.string.removeAll=function(a,b){var c=new RegExp(goog.string.regExpEscape(b),"g");return a.replace(c,"")};
goog.string.regExpEscape=function(a){return String(a).replace(/([-()\[\]{}+?*.$\^|,:#<!\\])/g,"\\$1").replace(/\x08/g,"\\x08")};goog.string.repeat=function(a,b){return(new Array(b+1)).join(a)};goog.string.padNumber=function(a,b,c){a=goog.isDef(c)?a.toFixed(c):String(a);c=a.indexOf(".");if(c==-1)c=a.length;return goog.string.repeat("0",Math.max(0,b-c))+a};goog.string.makeSafe=function(a){return a==null?"":String(a)};goog.string.buildString=function(){return Array.prototype.join.call(arguments,"")};
goog.string.getRandomString=function(){return Math.floor(Math.random()*2147483648).toString(36)+Math.abs(Math.floor(Math.random()*2147483648)^goog.now()).toString(36)};
goog.string.compareVersions=function(a,b){for(var c=0,d=goog.string.trim(String(a)).split("."),e=goog.string.trim(String(b)).split("."),f=Math.max(d.length,e.length),g=0;c==0&&g<f;g++){var h=d[g]||"",k=e[g]||"",l=new RegExp("(\\d*)(\\D*)","g"),m=new RegExp("(\\d*)(\\D*)","g");do{var n=l.exec(h)||["","",""],o=m.exec(k)||["","",""];if(n[0].length==0&&o[0].length==0)break;c=n[1].length==0?0:parseInt(n[1],10);var q=o[1].length==0?0:parseInt(o[1],10);c=goog.string.compareElements_(c,q)||goog.string.compareElements_(n[2].length==
0,o[2].length==0)||goog.string.compareElements_(n[2],o[2])}while(c==0)}return c};goog.string.compareElements_=function(a,b){if(a<b)return-1;else if(a>b)return 1;return 0};goog.string.HASHCODE_MAX_=4294967296;goog.string.hashCode=function(a){for(var b=0,c=0;c<a.length;++c){b=31*b+a.charCodeAt(c);b%=goog.string.HASHCODE_MAX_}return b};goog.string.uniqueStringCounter_=Math.random()*2147483648|0;goog.string.createUniqueString=function(){return"goog_"+goog.string.uniqueStringCounter_++};
goog.string.toNumber=function(a){var b=Number(a);if(b==0&&goog.string.isEmpty(a))return NaN;return b};goog.string.toCamelCaseCache_={};goog.string.toCamelCase=function(a){return goog.string.toCamelCaseCache_[a]||(goog.string.toCamelCaseCache_[a]=String(a).replace(/\-([a-z])/g,function(b,c){return c.toUpperCase()}))};goog.string.toSelectorCaseCache_={};
goog.string.toSelectorCase=function(a){return goog.string.toSelectorCaseCache_[a]||(goog.string.toSelectorCaseCache_[a]=String(a).replace(/([A-Z])/g,"-$1").toLowerCase())};goog.asserts={};goog.asserts.ENABLE_ASSERTS=goog.DEBUG;goog.asserts.AssertionError=function(a,b){b.unshift(a);goog.debug.Error.call(this,goog.string.subs.apply(null,b));b.shift();this.messagePattern=a};goog.inherits(goog.asserts.AssertionError,goog.debug.Error);goog.asserts.AssertionError.prototype.name="AssertionError";
goog.asserts.doAssertFailure_=function(a,b,c,d){var e="Assertion failed";if(c){e+=": "+c;var f=d}else if(a){e+=": "+a;f=b}throw new goog.asserts.AssertionError(""+e,f||[]);};goog.asserts.assert=function(a,b){goog.asserts.ENABLE_ASSERTS&&!a&&goog.asserts.doAssertFailure_("",null,b,Array.prototype.slice.call(arguments,2));return a};goog.asserts.fail=function(a){if(goog.asserts.ENABLE_ASSERTS)throw new goog.asserts.AssertionError("Failure"+(a?": "+a:""),Array.prototype.slice.call(arguments,1));};
goog.asserts.assertNumber=function(a,b){goog.asserts.ENABLE_ASSERTS&&!goog.isNumber(a)&&goog.asserts.doAssertFailure_("Expected number but got %s: %s.",[goog.typeOf(a),a],b,Array.prototype.slice.call(arguments,2));return a};goog.asserts.assertString=function(a,b){goog.asserts.ENABLE_ASSERTS&&!goog.isString(a)&&goog.asserts.doAssertFailure_("Expected string but got %s: %s.",[goog.typeOf(a),a],b,Array.prototype.slice.call(arguments,2));return a};
goog.asserts.assertFunction=function(a,b){goog.asserts.ENABLE_ASSERTS&&!goog.isFunction(a)&&goog.asserts.doAssertFailure_("Expected function but got %s: %s.",[goog.typeOf(a),a],b,Array.prototype.slice.call(arguments,2));return a};goog.asserts.assertObject=function(a,b){goog.asserts.ENABLE_ASSERTS&&!goog.isObject(a)&&goog.asserts.doAssertFailure_("Expected object but got %s: %s.",[goog.typeOf(a),a],b,Array.prototype.slice.call(arguments,2));return a};
goog.asserts.assertArray=function(a,b){goog.asserts.ENABLE_ASSERTS&&!goog.isArray(a)&&goog.asserts.doAssertFailure_("Expected array but got %s: %s.",[goog.typeOf(a),a],b,Array.prototype.slice.call(arguments,2));return a};goog.asserts.assertBoolean=function(a,b){goog.asserts.ENABLE_ASSERTS&&!goog.isBoolean(a)&&goog.asserts.doAssertFailure_("Expected boolean but got %s: %s.",[goog.typeOf(a),a],b,Array.prototype.slice.call(arguments,2));return a};
goog.asserts.assertInstanceof=function(a,b,c){goog.asserts.ENABLE_ASSERTS&&!(a instanceof b)&&goog.asserts.doAssertFailure_("instanceof check failed.",null,c,Array.prototype.slice.call(arguments,3))};goog.array={};goog.array.ArrayLike={};goog.NATIVE_ARRAY_PROTOTYPES=true;goog.array.peek=function(a){return a[a.length-1]};goog.array.ARRAY_PROTOTYPE_=Array.prototype;
goog.array.indexOf=goog.NATIVE_ARRAY_PROTOTYPES&&goog.array.ARRAY_PROTOTYPE_.indexOf?function(a,b,c){goog.asserts.assert(a.length!=null);return goog.array.ARRAY_PROTOTYPE_.indexOf.call(a,b,c)}:function(a,b,c){c=c==null?0:c<0?Math.max(0,a.length+c):c;if(goog.isString(a)){if(!goog.isString(b)||b.length!=1)return-1;return a.indexOf(b,c)}for(c=c;c<a.length;c++)if(c in a&&a[c]===b)return c;return-1};
goog.array.lastIndexOf=goog.NATIVE_ARRAY_PROTOTYPES&&goog.array.ARRAY_PROTOTYPE_.lastIndexOf?function(a,b,c){goog.asserts.assert(a.length!=null);return goog.array.ARRAY_PROTOTYPE_.lastIndexOf.call(a,b,c==null?a.length-1:c)}:function(a,b,c){c=c==null?a.length-1:c;if(c<0)c=Math.max(0,a.length+c);if(goog.isString(a)){if(!goog.isString(b)||b.length!=1)return-1;return a.lastIndexOf(b,c)}for(c=c;c>=0;c--)if(c in a&&a[c]===b)return c;return-1};
goog.array.forEach=goog.NATIVE_ARRAY_PROTOTYPES&&goog.array.ARRAY_PROTOTYPE_.forEach?function(a,b,c){goog.asserts.assert(a.length!=null);goog.array.ARRAY_PROTOTYPE_.forEach.call(a,b,c)}:function(a,b,c){for(var d=a.length,e=goog.isString(a)?a.split(""):a,f=0;f<d;f++)f in e&&b.call(c,e[f],f,a)};goog.array.forEachRight=function(a,b,c){var d=a.length,e=goog.isString(a)?a.split(""):a;for(d=d-1;d>=0;--d)d in e&&b.call(c,e[d],d,a)};
goog.array.filter=goog.NATIVE_ARRAY_PROTOTYPES&&goog.array.ARRAY_PROTOTYPE_.filter?function(a,b,c){goog.asserts.assert(a.length!=null);return goog.array.ARRAY_PROTOTYPE_.filter.call(a,b,c)}:function(a,b,c){for(var d=a.length,e=[],f=0,g=goog.isString(a)?a.split(""):a,h=0;h<d;h++)if(h in g){var k=g[h];if(b.call(c,k,h,a))e[f++]=k}return e};
goog.array.map=goog.NATIVE_ARRAY_PROTOTYPES&&goog.array.ARRAY_PROTOTYPE_.map?function(a,b,c){goog.asserts.assert(a.length!=null);return goog.array.ARRAY_PROTOTYPE_.map.call(a,b,c)}:function(a,b,c){for(var d=a.length,e=new Array(d),f=goog.isString(a)?a.split(""):a,g=0;g<d;g++)if(g in f)e[g]=b.call(c,f[g],g,a);return e};goog.array.reduce=function(a,b,c,d){if(a.reduce)return d?a.reduce(goog.bind(b,d),c):a.reduce(b,c);var e=c;goog.array.forEach(a,function(f,g){e=b.call(d,e,f,g,a)});return e};
goog.array.reduceRight=function(a,b,c,d){if(a.reduceRight)return d?a.reduceRight(goog.bind(b,d),c):a.reduceRight(b,c);var e=c;goog.array.forEachRight(a,function(f,g){e=b.call(d,e,f,g,a)});return e};
goog.array.some=goog.NATIVE_ARRAY_PROTOTYPES&&goog.array.ARRAY_PROTOTYPE_.some?function(a,b,c){goog.asserts.assert(a.length!=null);return goog.array.ARRAY_PROTOTYPE_.some.call(a,b,c)}:function(a,b,c){for(var d=a.length,e=goog.isString(a)?a.split(""):a,f=0;f<d;f++)if(f in e&&b.call(c,e[f],f,a))return true;return false};
goog.array.every=goog.NATIVE_ARRAY_PROTOTYPES&&goog.array.ARRAY_PROTOTYPE_.every?function(a,b,c){goog.asserts.assert(a.length!=null);return goog.array.ARRAY_PROTOTYPE_.every.call(a,b,c)}:function(a,b,c){for(var d=a.length,e=goog.isString(a)?a.split(""):a,f=0;f<d;f++)if(f in e&&!b.call(c,e[f],f,a))return false;return true};goog.array.find=function(a,b,c){b=goog.array.findIndex(a,b,c);return b<0?null:goog.isString(a)?a.charAt(b):a[b]};
goog.array.findIndex=function(a,b,c){for(var d=a.length,e=goog.isString(a)?a.split(""):a,f=0;f<d;f++)if(f in e&&b.call(c,e[f],f,a))return f;return-1};goog.array.findRight=function(a,b,c){b=goog.array.findIndexRight(a,b,c);return b<0?null:goog.isString(a)?a.charAt(b):a[b]};goog.array.findIndexRight=function(a,b,c){var d=a.length,e=goog.isString(a)?a.split(""):a;for(d=d-1;d>=0;d--)if(d in e&&b.call(c,e[d],d,a))return d;return-1};goog.array.contains=function(a,b){return goog.array.indexOf(a,b)>=0};
goog.array.isEmpty=function(a){return a.length==0};goog.array.clear=function(a){if(!goog.isArray(a))for(var b=a.length-1;b>=0;b--)delete a[b];a.length=0};goog.array.insert=function(a,b){goog.array.contains(a,b)||a.push(b)};goog.array.insertAt=function(a,b,c){goog.array.splice(a,c,0,b)};goog.array.insertArrayAt=function(a,b,c){goog.partial(goog.array.splice,a,c,0).apply(null,b)};
goog.array.insertBefore=function(a,b,c){var d;arguments.length==2||(d=goog.array.indexOf(a,c))<0?a.push(b):goog.array.insertAt(a,b,d)};goog.array.remove=function(a,b){var c=goog.array.indexOf(a,b),d;if(d=c>=0)goog.array.removeAt(a,c);return d};goog.array.removeAt=function(a,b){goog.asserts.assert(a.length!=null);return goog.array.ARRAY_PROTOTYPE_.splice.call(a,b,1).length==1};goog.array.removeIf=function(a,b,c){b=goog.array.findIndex(a,b,c);if(b>=0){goog.array.removeAt(a,b);return true}return false};
goog.array.concat=function(){return goog.array.ARRAY_PROTOTYPE_.concat.apply(goog.array.ARRAY_PROTOTYPE_,arguments)};goog.array.clone=function(a){if(goog.isArray(a))return goog.array.concat(a);else{for(var b=[],c=0,d=a.length;c<d;c++)b[c]=a[c];return b}};goog.array.toArray=function(a){if(goog.isArray(a))return goog.array.concat(a);return goog.array.clone(a)};
goog.array.extend=function(a){for(var b=1;b<arguments.length;b++){var c=arguments[b],d;if(goog.isArray(c)||(d=goog.isArrayLike(c))&&c.hasOwnProperty("callee"))a.push.apply(a,c);else if(d)for(var e=a.length,f=c.length,g=0;g<f;g++)a[e+g]=c[g];else a.push(c)}};goog.array.splice=function(a){goog.asserts.assert(a.length!=null);return goog.array.ARRAY_PROTOTYPE_.splice.apply(a,goog.array.slice(arguments,1))};
goog.array.slice=function(a,b,c){goog.asserts.assert(a.length!=null);return arguments.length<=2?goog.array.ARRAY_PROTOTYPE_.slice.call(a,b):goog.array.ARRAY_PROTOTYPE_.slice.call(a,b,c)};goog.array.removeDuplicates=function(a,b){for(var c=b||a,d={},e=0,f=0;f<a.length;){var g=a[f++],h=goog.isObject(g)?"o"+goog.getUid(g):(typeof g).charAt(0)+g;if(!Object.prototype.hasOwnProperty.call(d,h)){d[h]=true;c[e++]=g}}c.length=e};
goog.array.binarySearch=function(a,b,c){return goog.array.binarySearch_(a,c||goog.array.defaultCompare,false,b)};goog.array.binarySelect=function(a,b,c){return goog.array.binarySearch_(a,b,true,undefined,c)};goog.array.binarySearch_=function(a,b,c,d,e){for(var f=0,g=a.length,h;f<g;){var k=f+g>>1,l;l=c?b.call(e,a[k],k,a):b(d,a[k]);if(l>0)f=k+1;else{g=k;h=!l}}return h?f:~f};goog.array.sort=function(a,b){goog.asserts.assert(a.length!=null);goog.array.ARRAY_PROTOTYPE_.sort.call(a,b||goog.array.defaultCompare)};
goog.array.stableSort=function(a,b){for(var c=0;c<a.length;c++)a[c]={index:c,value:a[c]};var d=b||goog.array.defaultCompare;goog.array.sort(a,function(e,f){return d(e.value,f.value)||e.index-f.index});for(c=0;c<a.length;c++)a[c]=a[c].value};goog.array.sortObjectsByKey=function(a,b,c){var d=c||goog.array.defaultCompare;goog.array.sort(a,function(e,f){return d(e[b],f[b])})};
goog.array.isSorted=function(a,b,c){b=b||goog.array.defaultCompare;for(var d=1;d<a.length;d++){var e=b(a[d-1],a[d]);if(e>0||e==0&&c)return false}return true};goog.array.equals=function(a,b,c){if(!goog.isArrayLike(a)||!goog.isArrayLike(b)||a.length!=b.length)return false;var d=a.length;c=c||goog.array.defaultCompareEquality;for(var e=0;e<d;e++)if(!c(a[e],b[e]))return false;return true};goog.array.compare=function(a,b,c){return goog.array.equals(a,b,c)};
goog.array.defaultCompare=function(a,b){return a>b?1:a<b?-1:0};goog.array.defaultCompareEquality=function(a,b){return a===b};goog.array.binaryInsert=function(a,b,c){c=goog.array.binarySearch(a,b,c);if(c<0){goog.array.insertAt(a,b,-(c+1));return true}return false};goog.array.binaryRemove=function(a,b,c){b=goog.array.binarySearch(a,b,c);return b>=0?goog.array.removeAt(a,b):false};goog.array.bucket=function(a,b){for(var c={},d=0;d<a.length;d++){var e=a[d],f=b(e,d,a);if(goog.isDef(f))(c[f]||(c[f]=[])).push(e)}return c};
goog.array.repeat=function(a,b){for(var c=[],d=0;d<b;d++)c[d]=a;return c};goog.array.flatten=function(){for(var a=[],b=0;b<arguments.length;b++){var c=arguments[b];goog.isArray(c)?a.push.apply(a,goog.array.flatten.apply(null,c)):a.push(c)}return a};goog.array.rotate=function(a,b){goog.asserts.assert(a.length!=null);if(a.length){b%=a.length;if(b>0)goog.array.ARRAY_PROTOTYPE_.unshift.apply(a,a.splice(-b,b));else b<0&&goog.array.ARRAY_PROTOTYPE_.push.apply(a,a.splice(0,-b))}return a};
goog.array.zip=function(){if(!arguments.length)return[];for(var a=[],b=0;;b++){for(var c=[],d=0;d<arguments.length;d++){var e=arguments[d];if(b>=e.length)return a;c.push(e[b])}a.push(c)}};goog.array.shuffle=function(a,b){for(var c=b||Math.random,d=a.length-1;d>0;d--){var e=Math.floor(c()*(d+1)),f=a[d];a[d]=a[e];a[e]=f}};goog.userAgent={};goog.userAgent.ASSUME_IE=false;goog.userAgent.ASSUME_GECKO=false;goog.userAgent.ASSUME_WEBKIT=false;goog.userAgent.ASSUME_MOBILE_WEBKIT=false;
goog.userAgent.ASSUME_OPERA=false;goog.userAgent.BROWSER_KNOWN_=goog.userAgent.ASSUME_IE||goog.userAgent.ASSUME_GECKO||goog.userAgent.ASSUME_MOBILE_WEBKIT||goog.userAgent.ASSUME_WEBKIT||goog.userAgent.ASSUME_OPERA;goog.userAgent.getUserAgentString=function(){return goog.global.navigator?goog.global.navigator.userAgent:null};goog.userAgent.getNavigator=function(){return goog.global.navigator};
goog.userAgent.init_=function(){goog.userAgent.detectedOpera_=false;goog.userAgent.detectedIe_=false;goog.userAgent.detectedWebkit_=false;goog.userAgent.detectedMobile_=false;goog.userAgent.detectedGecko_=false;var a;if(!goog.userAgent.BROWSER_KNOWN_&&(a=goog.userAgent.getUserAgentString())){var b=goog.userAgent.getNavigator();goog.userAgent.detectedOpera_=a.indexOf("Opera")==0;goog.userAgent.detectedIe_=!goog.userAgent.detectedOpera_&&a.indexOf("MSIE")!=-1;goog.userAgent.detectedWebkit_=!goog.userAgent.detectedOpera_&&
a.indexOf("WebKit")!=-1;goog.userAgent.detectedMobile_=goog.userAgent.detectedWebkit_&&a.indexOf("Mobile")!=-1;goog.userAgent.detectedGecko_=!goog.userAgent.detectedOpera_&&!goog.userAgent.detectedWebkit_&&b.product=="Gecko"}};goog.userAgent.BROWSER_KNOWN_||goog.userAgent.init_();goog.userAgent.OPERA=goog.userAgent.BROWSER_KNOWN_?goog.userAgent.ASSUME_OPERA:goog.userAgent.detectedOpera_;goog.userAgent.IE=goog.userAgent.BROWSER_KNOWN_?goog.userAgent.ASSUME_IE:goog.userAgent.detectedIe_;
goog.userAgent.GECKO=goog.userAgent.BROWSER_KNOWN_?goog.userAgent.ASSUME_GECKO:goog.userAgent.detectedGecko_;goog.userAgent.WEBKIT=goog.userAgent.BROWSER_KNOWN_?goog.userAgent.ASSUME_WEBKIT||goog.userAgent.ASSUME_MOBILE_WEBKIT:goog.userAgent.detectedWebkit_;goog.userAgent.MOBILE=goog.userAgent.ASSUME_MOBILE_WEBKIT||goog.userAgent.detectedMobile_;goog.userAgent.SAFARI=goog.userAgent.WEBKIT;goog.userAgent.determinePlatform_=function(){var a=goog.userAgent.getNavigator();return a&&a.platform||""};
goog.userAgent.PLATFORM=goog.userAgent.determinePlatform_();goog.userAgent.ASSUME_MAC=false;goog.userAgent.ASSUME_WINDOWS=false;goog.userAgent.ASSUME_LINUX=false;goog.userAgent.ASSUME_X11=false;goog.userAgent.PLATFORM_KNOWN_=goog.userAgent.ASSUME_MAC||goog.userAgent.ASSUME_WINDOWS||goog.userAgent.ASSUME_LINUX||goog.userAgent.ASSUME_X11;
goog.userAgent.initPlatform_=function(){goog.userAgent.detectedMac_=goog.string.contains(goog.userAgent.PLATFORM,"Mac");goog.userAgent.detectedWindows_=goog.string.contains(goog.userAgent.PLATFORM,"Win");goog.userAgent.detectedLinux_=goog.string.contains(goog.userAgent.PLATFORM,"Linux");goog.userAgent.detectedX11_=!!goog.userAgent.getNavigator()&&goog.string.contains(goog.userAgent.getNavigator().appVersion||"","X11")};goog.userAgent.PLATFORM_KNOWN_||goog.userAgent.initPlatform_();
goog.userAgent.MAC=goog.userAgent.PLATFORM_KNOWN_?goog.userAgent.ASSUME_MAC:goog.userAgent.detectedMac_;goog.userAgent.WINDOWS=goog.userAgent.PLATFORM_KNOWN_?goog.userAgent.ASSUME_WINDOWS:goog.userAgent.detectedWindows_;goog.userAgent.LINUX=goog.userAgent.PLATFORM_KNOWN_?goog.userAgent.ASSUME_LINUX:goog.userAgent.detectedLinux_;goog.userAgent.X11=goog.userAgent.PLATFORM_KNOWN_?goog.userAgent.ASSUME_X11:goog.userAgent.detectedX11_;
goog.userAgent.determineVersion_=function(){var a="",b;if(goog.userAgent.OPERA&&goog.global.opera){a=goog.global.opera.version;a=typeof a=="function"?a():a}else{if(goog.userAgent.GECKO)b=/rv\:([^\);]+)(\)|;)/;else if(goog.userAgent.IE)b=/MSIE\s+([^\);]+)(\)|;)/;else if(goog.userAgent.WEBKIT)b=/WebKit\/(\S+)/;if(b)a=(a=b.exec(goog.userAgent.getUserAgentString()))?a[1]:""}if(goog.userAgent.IE){b=goog.userAgent.getDocumentMode_();if(b>parseFloat(a))return String(b)}return a};
goog.userAgent.getDocumentMode_=function(){var a=goog.global.document;return a?a.documentMode:undefined};goog.userAgent.VERSION=goog.userAgent.determineVersion_();goog.userAgent.compare=function(a,b){return goog.string.compareVersions(a,b)};goog.userAgent.isVersionCache_={};goog.userAgent.isVersion=function(a){return goog.userAgent.isVersionCache_[a]||(goog.userAgent.isVersionCache_[a]=goog.string.compareVersions(goog.userAgent.VERSION,a)>=0)};goog.dom={};
goog.dom.BrowserFeature={CAN_ADD_NAME_OR_TYPE_ATTRIBUTES:!goog.userAgent.IE||goog.userAgent.isVersion("9"),CAN_USE_CHILDREN_ATTRIBUTE:!goog.userAgent.GECKO&&!goog.userAgent.IE||goog.userAgent.IE&&goog.userAgent.isVersion("9")||goog.userAgent.GECKO&&goog.userAgent.isVersion("1.9.1"),CAN_USE_INNER_TEXT:goog.userAgent.IE&&!goog.userAgent.isVersion("9"),INNER_HTML_NEEDS_SCOPED_ELEMENT:goog.userAgent.IE};
goog.dom.TagName={A:"A",ABBR:"ABBR",ACRONYM:"ACRONYM",ADDRESS:"ADDRESS",APPLET:"APPLET",AREA:"AREA",B:"B",BASE:"BASE",BASEFONT:"BASEFONT",BDO:"BDO",BIG:"BIG",BLOCKQUOTE:"BLOCKQUOTE",BODY:"BODY",BR:"BR",BUTTON:"BUTTON",CANVAS:"CANVAS",CAPTION:"CAPTION",CENTER:"CENTER",CITE:"CITE",CODE:"CODE",COL:"COL",COLGROUP:"COLGROUP",DD:"DD",DEL:"DEL",DFN:"DFN",DIR:"DIR",DIV:"DIV",DL:"DL",DT:"DT",EM:"EM",FIELDSET:"FIELDSET",FONT:"FONT",FORM:"FORM",FRAME:"FRAME",FRAMESET:"FRAMESET",H1:"H1",H2:"H2",H3:"H3",H4:"H4",
H5:"H5",H6:"H6",HEAD:"HEAD",HR:"HR",HTML:"HTML",I:"I",IFRAME:"IFRAME",IMG:"IMG",INPUT:"INPUT",INS:"INS",ISINDEX:"ISINDEX",KBD:"KBD",LABEL:"LABEL",LEGEND:"LEGEND",LI:"LI",LINK:"LINK",MAP:"MAP",MENU:"MENU",META:"META",NOFRAMES:"NOFRAMES",NOSCRIPT:"NOSCRIPT",OBJECT:"OBJECT",OL:"OL",OPTGROUP:"OPTGROUP",OPTION:"OPTION",P:"P",PARAM:"PARAM",PRE:"PRE",Q:"Q",S:"S",SAMP:"SAMP",SCRIPT:"SCRIPT",SELECT:"SELECT",SMALL:"SMALL",SPAN:"SPAN",STRIKE:"STRIKE",STRONG:"STRONG",STYLE:"STYLE",SUB:"SUB",SUP:"SUP",TABLE:"TABLE",
TBODY:"TBODY",TD:"TD",TEXTAREA:"TEXTAREA",TFOOT:"TFOOT",TH:"TH",THEAD:"THEAD",TITLE:"TITLE",TR:"TR",TT:"TT",U:"U",UL:"UL",VAR:"VAR"};goog.dom.classes={};goog.dom.classes.set=function(a,b){a.className=b};goog.dom.classes.get=function(a){return(a=a.className)&&typeof a.split=="function"?a.split(/\s+/):[]};goog.dom.classes.add=function(a){var b=goog.dom.classes.get(a),c=goog.array.slice(arguments,1);c=goog.dom.classes.add_(b,c);a.className=b.join(" ");return c};
goog.dom.classes.remove=function(a){var b=goog.dom.classes.get(a),c=goog.array.slice(arguments,1);c=goog.dom.classes.remove_(b,c);a.className=b.join(" ");return c};goog.dom.classes.add_=function(a,b){for(var c=0,d=0;d<b.length;d++)if(!goog.array.contains(a,b[d])){a.push(b[d]);c++}return c==b.length};goog.dom.classes.remove_=function(a,b){for(var c=0,d=0;d<a.length;d++)if(goog.array.contains(b,a[d])){goog.array.splice(a,d--,1);c++}return c==b.length};
goog.dom.classes.swap=function(a,b,c){for(var d=goog.dom.classes.get(a),e=false,f=0;f<d.length;f++)if(d[f]==b){goog.array.splice(d,f--,1);e=true}if(e){d.push(c);a.className=d.join(" ")}return e};goog.dom.classes.addRemove=function(a,b,c){var d=goog.dom.classes.get(a);if(goog.isString(b))goog.array.remove(d,b);else goog.isArray(b)&&goog.dom.classes.remove_(d,b);if(goog.isString(c)&&!goog.array.contains(d,c))d.push(c);else goog.isArray(c)&&goog.dom.classes.add_(d,c);a.className=d.join(" ")};
goog.dom.classes.has=function(a,b){return goog.array.contains(goog.dom.classes.get(a),b)};goog.dom.classes.enable=function(a,b,c){c?goog.dom.classes.add(a,b):goog.dom.classes.remove(a,b)};goog.dom.classes.toggle=function(a,b){var c=!goog.dom.classes.has(a,b);goog.dom.classes.enable(a,b,c);return c};goog.math={};goog.math.Coordinate=function(a,b){this.x=goog.isDef(a)?a:0;this.y=goog.isDef(b)?b:0};goog.math.Coordinate.prototype.clone=function(){return new goog.math.Coordinate(this.x,this.y)};
if(goog.DEBUG)goog.math.Coordinate.prototype.toString=function(){return"("+this.x+", "+this.y+")"};goog.math.Coordinate.equals=function(a,b){if(a==b)return true;if(!a||!b)return false;return a.x==b.x&&a.y==b.y};goog.math.Coordinate.distance=function(a,b){var c=a.x-b.x,d=a.y-b.y;return Math.sqrt(c*c+d*d)};goog.math.Coordinate.squaredDistance=function(a,b){var c=a.x-b.x,d=a.y-b.y;return c*c+d*d};goog.math.Coordinate.difference=function(a,b){return new goog.math.Coordinate(a.x-b.x,a.y-b.y)};
goog.math.Coordinate.sum=function(a,b){return new goog.math.Coordinate(a.x+b.x,a.y+b.y)};goog.math.Size=function(a,b){this.width=a;this.height=b};goog.math.Size.equals=function(a,b){if(a==b)return true;if(!a||!b)return false;return a.width==b.width&&a.height==b.height};goog.math.Size.prototype.clone=function(){return new goog.math.Size(this.width,this.height)};if(goog.DEBUG)goog.math.Size.prototype.toString=function(){return"("+this.width+" x "+this.height+")"};
goog.math.Size.prototype.getLongest=function(){return Math.max(this.width,this.height)};goog.math.Size.prototype.getShortest=function(){return Math.min(this.width,this.height)};goog.math.Size.prototype.area=function(){return this.width*this.height};goog.math.Size.prototype.perimeter=function(){return(this.width+this.height)*2};goog.math.Size.prototype.aspectRatio=function(){return this.width/this.height};goog.math.Size.prototype.isEmpty=function(){return!this.area()};
goog.math.Size.prototype.ceil=function(){this.width=Math.ceil(this.width);this.height=Math.ceil(this.height);return this};goog.math.Size.prototype.fitsInside=function(a){return this.width<=a.width&&this.height<=a.height};goog.math.Size.prototype.floor=function(){this.width=Math.floor(this.width);this.height=Math.floor(this.height);return this};goog.math.Size.prototype.round=function(){this.width=Math.round(this.width);this.height=Math.round(this.height);return this};
goog.math.Size.prototype.scale=function(a){this.width*=a;this.height*=a;return this};goog.math.Size.prototype.scaleToFit=function(a){return this.scale(this.aspectRatio()>a.aspectRatio()?a.width/this.width:a.height/this.height)};goog.object={};goog.object.forEach=function(a,b,c){for(var d in a)b.call(c,a[d],d,a)};goog.object.filter=function(a,b,c){var d={};for(var e in a)if(b.call(c,a[e],e,a))d[e]=a[e];return d};goog.object.map=function(a,b,c){var d={};for(var e in a)d[e]=b.call(c,a[e],e,a);return d};
goog.object.some=function(a,b,c){for(var d in a)if(b.call(c,a[d],d,a))return true;return false};goog.object.every=function(a,b,c){for(var d in a)if(!b.call(c,a[d],d,a))return false;return true};goog.object.getCount=function(a){var b=0;for(var c in a)b++;return b};goog.object.getAnyKey=function(a){for(var b in a)return b};goog.object.getAnyValue=function(a){for(var b in a)return a[b]};goog.object.contains=function(a,b){return goog.object.containsValue(a,b)};
goog.object.getValues=function(a){var b=[],c=0;for(var d in a)b[c++]=a[d];return b};goog.object.getKeys=function(a){var b=[],c=0;for(var d in a)b[c++]=d;return b};goog.object.getValueByKeys=function(a,b){var c=goog.isArrayLike(b),d=c?b:arguments;for(c=c?0:1;c<d.length;c++){a=a[d[c]];if(!goog.isDef(a))break}return a};goog.object.containsKey=function(a,b){return b in a};goog.object.containsValue=function(a,b){for(var c in a)if(a[c]==b)return true;return false};
goog.object.findKey=function(a,b,c){for(var d in a)if(b.call(c,a[d],d,a))return d};goog.object.findValue=function(a,b,c){return(b=goog.object.findKey(a,b,c))&&a[b]};goog.object.isEmpty=function(a){for(var b in a)return false;return true};goog.object.clear=function(a){for(var b in a)delete a[b]};goog.object.remove=function(a,b){var c;if(c=b in a)delete a[b];return c};goog.object.add=function(a,b,c){if(b in a)throw Error('The object already contains the key "'+b+'"');goog.object.set(a,b,c)};
goog.object.get=function(a,b,c){if(b in a)return a[b];return c};goog.object.set=function(a,b,c){a[b]=c};goog.object.setIfUndefined=function(a,b,c){return b in a?a[b]:(a[b]=c)};goog.object.clone=function(a){var b={};for(var c in a)b[c]=a[c];return b};goog.object.unsafeClone=function(a){var b=goog.typeOf(a);if(b=="object"||b=="array"){if(a.clone)return a.clone();b=b=="array"?[]:{};for(var c in a)b[c]=goog.object.unsafeClone(a[c]);return b}return a};
goog.object.transpose=function(a){var b={};for(var c in a)b[a[c]]=c;return b};goog.object.PROTOTYPE_FIELDS_=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"];goog.object.extend=function(a){for(var b,c,d=1;d<arguments.length;d++){c=arguments[d];for(b in c)a[b]=c[b];for(var e=0;e<goog.object.PROTOTYPE_FIELDS_.length;e++){b=goog.object.PROTOTYPE_FIELDS_[e];if(Object.prototype.hasOwnProperty.call(c,b))a[b]=c[b]}}};
goog.object.create=function(){var a=arguments.length;if(a==1&&goog.isArray(arguments[0]))return goog.object.create.apply(null,arguments[0]);if(a%2)throw Error("Uneven number of arguments");for(var b={},c=0;c<a;c+=2)b[arguments[c]]=arguments[c+1];return b};goog.object.createSet=function(){var a=arguments.length;if(a==1&&goog.isArray(arguments[0]))return goog.object.createSet.apply(null,arguments[0]);for(var b={},c=0;c<a;c++)b[arguments[c]]=true;return b};goog.dom.ASSUME_QUIRKS_MODE=false;
goog.dom.ASSUME_STANDARDS_MODE=false;goog.dom.COMPAT_MODE_KNOWN_=goog.dom.ASSUME_QUIRKS_MODE||goog.dom.ASSUME_STANDARDS_MODE;goog.dom.NodeType={ELEMENT:1,ATTRIBUTE:2,TEXT:3,CDATA_SECTION:4,ENTITY_REFERENCE:5,ENTITY:6,PROCESSING_INSTRUCTION:7,COMMENT:8,DOCUMENT:9,DOCUMENT_TYPE:10,DOCUMENT_FRAGMENT:11,NOTATION:12};goog.dom.getDomHelper=function(a){return a?new goog.dom.DomHelper(goog.dom.getOwnerDocument(a)):goog.dom.defaultDomHelper_||(goog.dom.defaultDomHelper_=new goog.dom.DomHelper)};
goog.dom.getDocument=function(){return document};goog.dom.getElement=function(a){return goog.isString(a)?document.getElementById(a):a};goog.dom.$=goog.dom.getElement;goog.dom.getElementsByTagNameAndClass=function(a,b,c){return goog.dom.getElementsByTagNameAndClass_(document,a,b,c)};
goog.dom.getElementsByClass=function(a,b){var c=b||document;if(goog.dom.canUseQuerySelector_(c))return c.querySelectorAll("."+a);else if(c.getElementsByClassName)return c.getElementsByClassName(a);return goog.dom.getElementsByTagNameAndClass_(document,"*",a,b)};goog.dom.getElementByClass=function(a,b){var c=b||document,d=null;return(d=goog.dom.canUseQuerySelector_(c)?c.querySelector("."+a):goog.dom.getElementsByClass(a,b)[0])||null};
goog.dom.canUseQuerySelector_=function(a){return a.querySelectorAll&&a.querySelector&&(!goog.userAgent.WEBKIT||goog.dom.isCss1CompatMode_(document)||goog.userAgent.isVersion("528"))};
goog.dom.getElementsByTagNameAndClass_=function(a,b,c,d){a=d||a;b=b&&b!="*"?b.toUpperCase():"";if(goog.dom.canUseQuerySelector_(a)&&(b||c))return a.querySelectorAll(b+(c?"."+c:""));if(c&&a.getElementsByClassName){a=a.getElementsByClassName(c);if(b){d={};for(var e=0,f=0,g;g=a[f];f++)if(b==g.nodeName)d[e++]=g;d.length=e;return d}else return a}a=a.getElementsByTagName(b||"*");if(c){d={};for(f=e=0;g=a[f];f++){b=g.className;if(typeof b.split=="function"&&goog.array.contains(b.split(/\s+/),c))d[e++]=g}d.length=
e;return d}else return a};goog.dom.$$=goog.dom.getElementsByTagNameAndClass;goog.dom.setProperties=function(a,b){goog.object.forEach(b,function(c,d){if(d=="style")a.style.cssText=c;else if(d=="class")a.className=c;else if(d=="for")a.htmlFor=c;else if(d in goog.dom.DIRECT_ATTRIBUTE_MAP_)a.setAttribute(goog.dom.DIRECT_ATTRIBUTE_MAP_[d],c);else a[d]=c})};
goog.dom.DIRECT_ATTRIBUTE_MAP_={cellpadding:"cellPadding",cellspacing:"cellSpacing",colspan:"colSpan",rowspan:"rowSpan",valign:"vAlign",height:"height",width:"width",usemap:"useMap",frameborder:"frameBorder",maxlength:"maxLength",type:"type"};goog.dom.getViewportSize=function(a){return goog.dom.getViewportSize_(a||window)};
goog.dom.getViewportSize_=function(a){var b=a.document;if(goog.userAgent.WEBKIT&&!goog.userAgent.isVersion("500")&&!goog.userAgent.MOBILE){if(typeof a.innerHeight=="undefined")a=window;b=a.innerHeight;var c=a.document.documentElement.scrollHeight;if(a==a.top)if(c<b)b-=15;return new goog.math.Size(a.innerWidth,b)}a=goog.dom.isCss1CompatMode_(b)?b.documentElement:b.body;return new goog.math.Size(a.clientWidth,a.clientHeight)};goog.dom.getDocumentHeight=function(){return goog.dom.getDocumentHeight_(window)};
goog.dom.getDocumentHeight_=function(a){var b=a.document,c=0;if(b){a=goog.dom.getViewportSize_(a).height;c=b.body;var d=b.documentElement;if(goog.dom.isCss1CompatMode_(b)&&d.scrollHeight)c=d.scrollHeight!=a?d.scrollHeight:d.offsetHeight;else{b=d.scrollHeight;var e=d.offsetHeight;if(d.clientHeight!=e){b=c.scrollHeight;e=c.offsetHeight}c=b>a?b>e?b:e:b<e?b:e}}return c};goog.dom.getPageScroll=function(a){return goog.dom.getDomHelper((a||goog.global||window).document).getDocumentScroll()};
goog.dom.getDocumentScroll=function(){return goog.dom.getDocumentScroll_(document)};goog.dom.getDocumentScroll_=function(a){var b=goog.dom.getDocumentScrollElement_(a);a=goog.dom.getWindow_(a);return new goog.math.Coordinate(a.pageXOffset||b.scrollLeft,a.pageYOffset||b.scrollTop)};goog.dom.getDocumentScrollElement=function(){return goog.dom.getDocumentScrollElement_(document)};
goog.dom.getDocumentScrollElement_=function(a){return!goog.userAgent.WEBKIT&&goog.dom.isCss1CompatMode_(a)?a.documentElement:a.body};goog.dom.getWindow=function(a){return a?goog.dom.getWindow_(a):window};goog.dom.getWindow_=function(a){return a.parentWindow||a.defaultView};goog.dom.createDom=function(){return goog.dom.createDom_(document,arguments)};
goog.dom.createDom_=function(a,b){var c=b[0],d=b[1];if(!goog.dom.BrowserFeature.CAN_ADD_NAME_OR_TYPE_ATTRIBUTES&&d&&(d.name||d.type)){c=["<",c];d.name&&c.push(' name="',goog.string.htmlEscape(d.name),'"');if(d.type){c.push(' type="',goog.string.htmlEscape(d.type),'"');var e={};goog.object.extend(e,d);d=e;delete d.type}c.push(">");c=c.join("")}c=a.createElement(c);if(d)if(goog.isString(d))c.className=d;else goog.isArray(d)?goog.dom.classes.add.apply(null,[c].concat(d)):goog.dom.setProperties(c,d);
b.length>2&&goog.dom.append_(a,c,b,2);return c};goog.dom.append_=function(a,b,c,d){function e(g){if(g)b.appendChild(goog.isString(g)?a.createTextNode(g):g)}for(d=d;d<c.length;d++){var f=c[d];goog.isArrayLike(f)&&!goog.dom.isNodeLike(f)?goog.array.forEach(goog.dom.isNodeList(f)?goog.array.clone(f):f,e):e(f)}};goog.dom.$dom=goog.dom.createDom;goog.dom.createElement=function(a){return document.createElement(a)};goog.dom.createTextNode=function(a){return document.createTextNode(a)};
goog.dom.createTable=function(a,b,c){return goog.dom.createTable_(document,a,b,!!c)};goog.dom.createTable_=function(a,b,c,d){for(var e=["<tr>"],f=0;f<c;f++)e.push(d?"<td>&nbsp;</td>":"<td></td>");e.push("</tr>");e=e.join("");c=["<table>"];for(f=0;f<b;f++)c.push(e);c.push("</table>");a=a.createElement(goog.dom.TagName.DIV);a.innerHTML=c.join("");return a.removeChild(a.firstChild)};goog.dom.htmlToDocumentFragment=function(a){return goog.dom.htmlToDocumentFragment_(document,a)};
goog.dom.htmlToDocumentFragment_=function(a,b){var c=a.createElement("div");if(goog.dom.BrowserFeature.INNER_HTML_NEEDS_SCOPED_ELEMENT){c.innerHTML="<br>"+b;c.removeChild(c.firstChild)}else c.innerHTML=b;if(c.childNodes.length==1)return c.removeChild(c.firstChild);else{for(var d=a.createDocumentFragment();c.firstChild;)d.appendChild(c.firstChild);return d}};goog.dom.getCompatMode=function(){return goog.dom.isCss1CompatMode()?"CSS1Compat":"BackCompat"};goog.dom.isCss1CompatMode=function(){return goog.dom.isCss1CompatMode_(document)};
goog.dom.isCss1CompatMode_=function(a){if(goog.dom.COMPAT_MODE_KNOWN_)return goog.dom.ASSUME_STANDARDS_MODE;return a.compatMode=="CSS1Compat"};goog.dom.canHaveChildren=function(a){if(a.nodeType!=goog.dom.NodeType.ELEMENT)return false;switch(a.tagName){case goog.dom.TagName.APPLET:case goog.dom.TagName.AREA:case goog.dom.TagName.BASE:case goog.dom.TagName.BR:case goog.dom.TagName.COL:case goog.dom.TagName.FRAME:case goog.dom.TagName.HR:case goog.dom.TagName.IMG:case goog.dom.TagName.INPUT:case goog.dom.TagName.IFRAME:case goog.dom.TagName.ISINDEX:case goog.dom.TagName.LINK:case goog.dom.TagName.NOFRAMES:case goog.dom.TagName.NOSCRIPT:case goog.dom.TagName.META:case goog.dom.TagName.OBJECT:case goog.dom.TagName.PARAM:case goog.dom.TagName.SCRIPT:case goog.dom.TagName.STYLE:return false}return true};
goog.dom.appendChild=function(a,b){a.appendChild(b)};goog.dom.append=function(a){goog.dom.append_(goog.dom.getOwnerDocument(a),a,arguments,1)};goog.dom.removeChildren=function(a){for(var b;b=a.firstChild;)a.removeChild(b)};goog.dom.insertSiblingBefore=function(a,b){b.parentNode&&b.parentNode.insertBefore(a,b)};goog.dom.insertSiblingAfter=function(a,b){b.parentNode&&b.parentNode.insertBefore(a,b.nextSibling)};goog.dom.insertChildAt=function(a,b,c){a.insertBefore(b,a.childNodes[c]||null)};
goog.dom.removeNode=function(a){return a&&a.parentNode?a.parentNode.removeChild(a):null};goog.dom.replaceNode=function(a,b){var c=b.parentNode;c&&c.replaceChild(a,b)};goog.dom.flattenElement=function(a){var b,c=a.parentNode;if(c&&c.nodeType!=goog.dom.NodeType.DOCUMENT_FRAGMENT)if(a.removeNode)return a.removeNode(false);else{for(;b=a.firstChild;)c.insertBefore(b,a);return goog.dom.removeNode(a)}};
goog.dom.getChildren=function(a){if(goog.dom.BrowserFeature.CAN_USE_CHILDREN_ATTRIBUTE&&a.children!=undefined)return a.children;return goog.array.filter(a.childNodes,function(b){return b.nodeType==goog.dom.NodeType.ELEMENT})};goog.dom.getFirstElementChild=function(a){if(a.firstElementChild!=undefined)return a.firstElementChild;return goog.dom.getNextElementNode_(a.firstChild,true)};
goog.dom.getLastElementChild=function(a){if(a.lastElementChild!=undefined)return a.lastElementChild;return goog.dom.getNextElementNode_(a.lastChild,false)};goog.dom.getNextElementSibling=function(a){if(a.nextElementSibling!=undefined)return a.nextElementSibling;return goog.dom.getNextElementNode_(a.nextSibling,true)};goog.dom.getPreviousElementSibling=function(a){if(a.previousElementSibling!=undefined)return a.previousElementSibling;return goog.dom.getNextElementNode_(a.previousSibling,false)};
goog.dom.getNextElementNode_=function(a,b){for(;a&&a.nodeType!=goog.dom.NodeType.ELEMENT;)a=b?a.nextSibling:a.previousSibling;return a};goog.dom.getNextNode=function(a){if(!a)return null;if(a.firstChild)return a.firstChild;for(;a&&!a.nextSibling;)a=a.parentNode;return a?a.nextSibling:null};goog.dom.getPreviousNode=function(a){if(!a)return null;if(!a.previousSibling)return a.parentNode;for(a=a.previousSibling;a&&a.lastChild;)a=a.lastChild;return a};
goog.dom.isNodeLike=function(a){return goog.isObject(a)&&a.nodeType>0};goog.dom.isWindow=function(a){return goog.isObject(a)&&a.window==a};goog.dom.contains=function(a,b){if(a.contains&&b.nodeType==goog.dom.NodeType.ELEMENT)return a==b||a.contains(b);if(typeof a.compareDocumentPosition!="undefined")return a==b||Boolean(a.compareDocumentPosition(b)&16);for(;b&&a!=b;)b=b.parentNode;return b==a};
goog.dom.compareNodeOrder=function(a,b){if(a==b)return 0;if(a.compareDocumentPosition)return a.compareDocumentPosition(b)&2?1:-1;if("sourceIndex"in a||a.parentNode&&"sourceIndex"in a.parentNode){var c=a.nodeType==goog.dom.NodeType.ELEMENT,d=b.nodeType==goog.dom.NodeType.ELEMENT;if(c&&d)return a.sourceIndex-b.sourceIndex;else{var e=a.parentNode,f=b.parentNode;if(e==f)return goog.dom.compareSiblingOrder_(a,b);if(!c&&goog.dom.contains(e,b))return-1*goog.dom.compareParentsDescendantNodeIe_(a,b);if(!d&&
goog.dom.contains(f,a))return goog.dom.compareParentsDescendantNodeIe_(b,a);return(c?a.sourceIndex:e.sourceIndex)-(d?b.sourceIndex:f.sourceIndex)}}d=goog.dom.getOwnerDocument(a);c=d.createRange();c.selectNode(a);c.collapse(true);d=d.createRange();d.selectNode(b);d.collapse(true);return c.compareBoundaryPoints(goog.global.Range.START_TO_END,d)};
goog.dom.compareParentsDescendantNodeIe_=function(a,b){var c=a.parentNode;if(c==b)return-1;for(var d=b;d.parentNode!=c;)d=d.parentNode;return goog.dom.compareSiblingOrder_(d,a)};goog.dom.compareSiblingOrder_=function(a,b){for(var c=b;c=c.previousSibling;)if(c==a)return-1;return 1};
goog.dom.findCommonAncestor=function(){var a,b=arguments.length;if(b){if(b==1)return arguments[0]}else return null;var c=[],d=Infinity;for(a=0;a<b;a++){for(var e=[],f=arguments[a];f;){e.unshift(f);f=f.parentNode}c.push(e);d=Math.min(d,e.length)}e=null;for(a=0;a<d;a++){f=c[0][a];for(var g=1;g<b;g++)if(f!=c[g][a])return e;e=f}return e};goog.dom.getOwnerDocument=function(a){return a.nodeType==goog.dom.NodeType.DOCUMENT?a:a.ownerDocument||a.document};
goog.dom.getFrameContentDocument=function(a){return goog.userAgent.WEBKIT?a.document||a.contentWindow.document:a.contentDocument||a.contentWindow.document};goog.dom.getFrameContentWindow=function(a){return a.contentWindow||goog.dom.getWindow_(goog.dom.getFrameContentDocument(a))};
goog.dom.setTextContent=function(a,b){if("textContent"in a)a.textContent=b;else if(a.firstChild&&a.firstChild.nodeType==goog.dom.NodeType.TEXT){for(;a.lastChild!=a.firstChild;)a.removeChild(a.lastChild);a.firstChild.data=b}else{goog.dom.removeChildren(a);var c=goog.dom.getOwnerDocument(a);a.appendChild(c.createTextNode(b))}};goog.dom.getOuterHtml=function(a){if("outerHTML"in a)return a.outerHTML;else{var b=goog.dom.getOwnerDocument(a).createElement("div");b.appendChild(a.cloneNode(true));return b.innerHTML}};
goog.dom.findNode=function(a,b){var c=[];return goog.dom.findNodes_(a,b,c,true)?c[0]:undefined};goog.dom.findNodes=function(a,b){var c=[];goog.dom.findNodes_(a,b,c,false);return c};goog.dom.findNodes_=function(a,b,c,d){if(a!=null)for(var e=0,f;f=a.childNodes[e];e++){if(b(f)){c.push(f);if(d)return true}if(goog.dom.findNodes_(f,b,c,d))return true}return false};goog.dom.TAGS_TO_IGNORE_={SCRIPT:1,STYLE:1,HEAD:1,IFRAME:1,OBJECT:1};goog.dom.PREDEFINED_TAG_VALUES_={IMG:" ",BR:"\n"};
goog.dom.isFocusableTabIndex=function(a){var b=a.getAttributeNode("tabindex");if(b&&b.specified){a=a.tabIndex;return goog.isNumber(a)&&a>=0}return false};goog.dom.setFocusableTabIndex=function(a,b){if(b)a.tabIndex=0;else a.removeAttribute("tabIndex")};
goog.dom.getTextContent=function(a){if(goog.dom.BrowserFeature.CAN_USE_INNER_TEXT&&"innerText"in a)a=goog.string.canonicalizeNewlines(a.innerText);else{var b=[];goog.dom.getTextContent_(a,b,true);a=b.join("")}a=a.replace(/ \xAD /g," ").replace(/\xAD/g,"");a=a.replace(/\u200B/g,"");goog.userAgent.IE||(a=a.replace(/ +/g," "));if(a!=" ")a=a.replace(/^\s*/,"");return a};goog.dom.getRawTextContent=function(a){var b=[];goog.dom.getTextContent_(a,b,false);return b.join("")};
goog.dom.getTextContent_=function(a,b,c){if(!(a.nodeName in goog.dom.TAGS_TO_IGNORE_))if(a.nodeType==goog.dom.NodeType.TEXT)c?b.push(String(a.nodeValue).replace(/(\r\n|\r|\n)/g,"")):b.push(a.nodeValue);else if(a.nodeName in goog.dom.PREDEFINED_TAG_VALUES_)b.push(goog.dom.PREDEFINED_TAG_VALUES_[a.nodeName]);else for(a=a.firstChild;a;){goog.dom.getTextContent_(a,b,c);a=a.nextSibling}};goog.dom.getNodeTextLength=function(a){return goog.dom.getTextContent(a).length};
goog.dom.getNodeTextOffset=function(a,b){for(var c=b||goog.dom.getOwnerDocument(a).body,d=[];a&&a!=c;){for(var e=a;e=e.previousSibling;)d.unshift(goog.dom.getTextContent(e));a=a.parentNode}return goog.string.trimLeft(d.join("")).replace(/ +/g," ").length};
goog.dom.getNodeAtOffset=function(a,b,c){a=[a];for(var d=0,e;a.length>0&&d<b;){e=a.pop();if(!(e.nodeName in goog.dom.TAGS_TO_IGNORE_))if(e.nodeType==goog.dom.NodeType.TEXT){var f=e.nodeValue.replace(/(\r\n|\r|\n)/g,"").replace(/ +/g," ");d+=f.length}else if(e.nodeName in goog.dom.PREDEFINED_TAG_VALUES_)d+=goog.dom.PREDEFINED_TAG_VALUES_[e.nodeName].length;else for(f=e.childNodes.length-1;f>=0;f--)a.push(e.childNodes[f])}if(goog.isObject(c)){c.remainder=e?e.nodeValue.length+b-d-1:0;c.node=e}return e};
goog.dom.isNodeList=function(a){if(a&&typeof a.length=="number")if(goog.isObject(a))return typeof a.item=="function"||typeof a.item=="string";else if(goog.isFunction(a))return typeof a.item=="function";return false};goog.dom.getAncestorByTagNameAndClass=function(a,b,c){var d=b?b.toUpperCase():null;return goog.dom.getAncestor(a,function(e){return(!d||e.nodeName==d)&&(!c||goog.dom.classes.has(e,c))},true)};
goog.dom.getAncestorByClass=function(a,b){return goog.dom.getAncestorByTagNameAndClass(a,null,b)};goog.dom.getAncestor=function(a,b,c,d){if(!c)a=a.parentNode;for(c=0;a&&(d==null||c<=d);){if(b(a))return a;a=a.parentNode;c++}return null};goog.dom.DomHelper=function(a){this.document_=a||goog.global.document||document};goog.dom.DomHelper.prototype.getDomHelper=goog.dom.getDomHelper;goog.dom.DomHelper.prototype.setDocument=function(a){this.document_=a};goog.dom.DomHelper.prototype.getDocument=function(){return this.document_};
goog.dom.DomHelper.prototype.getElement=function(a){return goog.isString(a)?this.document_.getElementById(a):a};goog.dom.DomHelper.prototype.$=goog.dom.DomHelper.prototype.getElement;goog.dom.DomHelper.prototype.getElementsByTagNameAndClass=function(a,b,c){return goog.dom.getElementsByTagNameAndClass_(this.document_,a,b,c)};goog.dom.DomHelper.prototype.getElementsByClass=function(a,b){return goog.dom.getElementsByClass(a,b||this.document_)};
goog.dom.DomHelper.prototype.getElementByClass=function(a,b){return goog.dom.getElementByClass(a,b||this.document_)};goog.dom.DomHelper.prototype.$$=goog.dom.DomHelper.prototype.getElementsByTagNameAndClass;goog.dom.DomHelper.prototype.setProperties=goog.dom.setProperties;goog.dom.DomHelper.prototype.getViewportSize=function(a){return goog.dom.getViewportSize(a||this.getWindow())};goog.dom.DomHelper.prototype.getDocumentHeight=function(){return goog.dom.getDocumentHeight_(this.getWindow())};
goog.dom.DomHelper.prototype.createDom=function(){return goog.dom.createDom_(this.document_,arguments)};goog.dom.DomHelper.prototype.$dom=goog.dom.DomHelper.prototype.createDom;goog.dom.DomHelper.prototype.createElement=function(a){return this.document_.createElement(a)};goog.dom.DomHelper.prototype.createTextNode=function(a){return this.document_.createTextNode(a)};goog.dom.DomHelper.prototype.createTable=function(a,b,c){return goog.dom.createTable_(this.document_,a,b,!!c)};
goog.dom.DomHelper.prototype.htmlToDocumentFragment=function(a){return goog.dom.htmlToDocumentFragment_(this.document_,a)};goog.dom.DomHelper.prototype.getCompatMode=function(){return this.isCss1CompatMode()?"CSS1Compat":"BackCompat"};goog.dom.DomHelper.prototype.isCss1CompatMode=function(){return goog.dom.isCss1CompatMode_(this.document_)};goog.dom.DomHelper.prototype.getWindow=function(){return goog.dom.getWindow_(this.document_)};goog.dom.DomHelper.prototype.getDocumentScrollElement=function(){return goog.dom.getDocumentScrollElement_(this.document_)};
goog.dom.DomHelper.prototype.getDocumentScroll=function(){return goog.dom.getDocumentScroll_(this.document_)};goog.dom.DomHelper.prototype.appendChild=goog.dom.appendChild;goog.dom.DomHelper.prototype.append=goog.dom.append;goog.dom.DomHelper.prototype.removeChildren=goog.dom.removeChildren;goog.dom.DomHelper.prototype.insertSiblingBefore=goog.dom.insertSiblingBefore;goog.dom.DomHelper.prototype.insertSiblingAfter=goog.dom.insertSiblingAfter;goog.dom.DomHelper.prototype.removeNode=goog.dom.removeNode;
goog.dom.DomHelper.prototype.replaceNode=goog.dom.replaceNode;goog.dom.DomHelper.prototype.flattenElement=goog.dom.flattenElement;goog.dom.DomHelper.prototype.getFirstElementChild=goog.dom.getFirstElementChild;goog.dom.DomHelper.prototype.getLastElementChild=goog.dom.getLastElementChild;goog.dom.DomHelper.prototype.getNextElementSibling=goog.dom.getNextElementSibling;goog.dom.DomHelper.prototype.getPreviousElementSibling=goog.dom.getPreviousElementSibling;
goog.dom.DomHelper.prototype.getNextNode=goog.dom.getNextNode;goog.dom.DomHelper.prototype.getPreviousNode=goog.dom.getPreviousNode;goog.dom.DomHelper.prototype.isNodeLike=goog.dom.isNodeLike;goog.dom.DomHelper.prototype.contains=goog.dom.contains;goog.dom.DomHelper.prototype.getOwnerDocument=goog.dom.getOwnerDocument;goog.dom.DomHelper.prototype.getFrameContentDocument=goog.dom.getFrameContentDocument;goog.dom.DomHelper.prototype.getFrameContentWindow=goog.dom.getFrameContentWindow;
goog.dom.DomHelper.prototype.setTextContent=goog.dom.setTextContent;goog.dom.DomHelper.prototype.findNode=goog.dom.findNode;goog.dom.DomHelper.prototype.findNodes=goog.dom.findNodes;goog.dom.DomHelper.prototype.getTextContent=goog.dom.getTextContent;goog.dom.DomHelper.prototype.getNodeTextLength=goog.dom.getNodeTextLength;goog.dom.DomHelper.prototype.getNodeTextOffset=goog.dom.getNodeTextOffset;goog.dom.DomHelper.prototype.getAncestorByTagNameAndClass=goog.dom.getAncestorByTagNameAndClass;
goog.dom.DomHelper.prototype.getAncestor=goog.dom.getAncestor;goog.json={};goog.json.isValid_=function(a){if(/^\s*$/.test(a))return false;return/^[\],:{}\s\u2028\u2029]*$/.test(a.replace(/\\["\\\/bfnrtu]/g,"@").replace(/"[^"\\\n\r\u2028\u2029\x00-\x08\x10-\x1f\x80-\x9f]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:[\s\u2028\u2029]*\[)+/g,""))};
goog.json.parse=function(a){a=String(a);if(goog.json.isValid_(a))try{return eval("("+a+")")}catch(b){}throw Error("Invalid JSON string: "+a);};goog.json.unsafeParse=function(a){return eval("("+a+")")};goog.json.serialize=function(a){return(new goog.json.Serializer).serialize(a)};goog.json.Serializer=function(){};goog.json.Serializer.prototype.serialize=function(a){var b=[];this.serialize_(a,b);return b.join("")};
goog.json.Serializer.prototype.serialize_=function(a,b){switch(typeof a){case "string":this.serializeString_(a,b);break;case "number":this.serializeNumber_(a,b);break;case "boolean":b.push(a);break;case "undefined":b.push("null");break;case "object":if(a==null){b.push("null");break}if(goog.isArray(a)){this.serializeArray_(a,b);break}this.serializeObject_(a,b);break;case "function":break;default:throw Error("Unknown type: "+typeof a);}};
goog.json.Serializer.charToJsonCharCache_={'"':'\\"',"\\":"\\\\","/":"\\/","\u0008":"\\b","\u000c":"\\f","\n":"\\n","\r":"\\r","\t":"\\t","\u000b":"\\u000b"};goog.json.Serializer.charsToReplace_=/\uffff/.test("\uffff")?/[\\\"\x00-\x1f\x7f-\uffff]/g:/[\\\"\x00-\x1f\x7f-\xff]/g;
goog.json.Serializer.prototype.serializeString_=function(a,b){b.push('"',a.replace(goog.json.Serializer.charsToReplace_,function(c){if(c in goog.json.Serializer.charToJsonCharCache_)return goog.json.Serializer.charToJsonCharCache_[c];var d=c.charCodeAt(0),e="\\u";if(d<16)e+="000";else if(d<256)e+="00";else if(d<4096)e+="0";return goog.json.Serializer.charToJsonCharCache_[c]=e+d.toString(16)}),'"')};goog.json.Serializer.prototype.serializeNumber_=function(a,b){b.push(isFinite(a)&&!isNaN(a)?a:"null")};
goog.json.Serializer.prototype.serializeArray_=function(a,b){var c=a.length;b.push("[");for(var d="",e=0;e<c;e++){b.push(d);this.serialize_(a[e],b);d=","}b.push("]")};goog.json.Serializer.prototype.serializeObject_=function(a,b){b.push("{");var c="";for(var d in a)if(Object.prototype.hasOwnProperty.call(a,d)){var e=a[d];if(typeof e!="function"){b.push(c);this.serializeString_(d,b);b.push(":");this.serialize_(e,b);c=","}}b.push("}")};goog.debug.entryPointRegistry={};goog.debug.EntryPointMonitor=function(){};
goog.debug.entryPointRegistry.refList_=[];goog.debug.entryPointRegistry.register=function(a){goog.debug.entryPointRegistry.refList_[goog.debug.entryPointRegistry.refList_.length]=a};goog.debug.entryPointRegistry.monitorAll=function(a){a=goog.bind(a.wrap,a);for(var b=0;b<goog.debug.entryPointRegistry.refList_.length;b++)goog.debug.entryPointRegistry.refList_[b](a)};goog.debug.entryPointRegistry.unmonitorAllIfPossible=function(a){a=goog.bind(a.unwrap,a);for(var b=0;b<goog.debug.entryPointRegistry.refList_.length;b++)goog.debug.entryPointRegistry.refList_[b](a)};
goog.debug.errorHandlerWeakDep={protectEntryPoint:function(a){return a}};goog.events={};goog.events.BrowserFeature={HAS_W3C_BUTTON:!goog.userAgent.IE||goog.userAgent.isVersion("9"),SET_KEY_CODE_TO_PREVENT_DEFAULT:goog.userAgent.IE&&!goog.userAgent.isVersion("8")};goog.disposable={};goog.disposable.IDisposable=function(){};goog.Disposable=function(){if(goog.Disposable.ENABLE_MONITORING)goog.Disposable.instances_[goog.getUid(this)]=this};goog.Disposable.ENABLE_MONITORING=false;
goog.Disposable.instances_={};goog.Disposable.getUndisposedObjects=function(){var a=[];for(var b in goog.Disposable.instances_)goog.Disposable.instances_.hasOwnProperty(b)&&a.push(goog.Disposable.instances_[Number(b)]);return a};goog.Disposable.clearUndisposedObjects=function(){goog.Disposable.instances_={}};goog.Disposable.prototype.disposed_=false;goog.Disposable.prototype.isDisposed=function(){return this.disposed_};goog.Disposable.prototype.getDisposed=goog.Disposable.prototype.isDisposed;
goog.Disposable.prototype.dispose=function(){if(!this.disposed_){this.disposed_=true;this.disposeInternal();if(goog.Disposable.ENABLE_MONITORING){var a=goog.getUid(this);if(!goog.Disposable.instances_.hasOwnProperty(a))throw Error(this+" did not call the goog.Disposable base constructor or was disposed of after a clearUndisposedObjects call");delete goog.Disposable.instances_[a]}}};goog.Disposable.prototype.disposeInternal=function(){};goog.dispose=function(a){a&&typeof a.dispose=="function"&&a.dispose()};
goog.events.Event=function(a,b){goog.Disposable.call(this);this.type=a;this.currentTarget=this.target=b};goog.inherits(goog.events.Event,goog.Disposable);goog.events.Event.prototype.disposeInternal=function(){delete this.type;delete this.target;delete this.currentTarget};goog.events.Event.prototype.propagationStopped_=false;goog.events.Event.prototype.returnValue_=true;goog.events.Event.prototype.stopPropagation=function(){this.propagationStopped_=true};
goog.events.Event.prototype.preventDefault=function(){this.returnValue_=false};goog.events.Event.stopPropagation=function(a){a.stopPropagation()};goog.events.Event.preventDefault=function(a){a.preventDefault()};
goog.events.EventType={CLICK:"click",DBLCLICK:"dblclick",MOUSEDOWN:"mousedown",MOUSEUP:"mouseup",MOUSEOVER:"mouseover",MOUSEOUT:"mouseout",MOUSEMOVE:"mousemove",SELECTSTART:"selectstart",KEYPRESS:"keypress",KEYDOWN:"keydown",KEYUP:"keyup",BLUR:"blur",FOCUS:"focus",DEACTIVATE:"deactivate",FOCUSIN:goog.userAgent.IE?"focusin":"DOMFocusIn",FOCUSOUT:goog.userAgent.IE?"focusout":"DOMFocusOut",CHANGE:"change",SELECT:"select",SUBMIT:"submit",INPUT:"input",PROPERTYCHANGE:"propertychange",DRAGSTART:"dragstart",
DRAGENTER:"dragenter",DRAGOVER:"dragover",DRAGLEAVE:"dragleave",DROP:"drop",TOUCHSTART:"touchstart",TOUCHMOVE:"touchmove",TOUCHEND:"touchend",TOUCHCANCEL:"touchcancel",CONTEXTMENU:"contextmenu",ERROR:"error",HELP:"help",LOAD:"load",LOSECAPTURE:"losecapture",READYSTATECHANGE:"readystatechange",RESIZE:"resize",SCROLL:"scroll",UNLOAD:"unload",HASHCHANGE:"hashchange",PAGEHIDE:"pagehide",PAGESHOW:"pageshow",POPSTATE:"popstate",COPY:"copy",PASTE:"paste",CUT:"cut",MESSAGE:"message",CONNECT:"connect"};
goog.reflect={};goog.reflect.object=function(a,b){return b};goog.reflect.sinkValue=new Function("a","return a");goog.events.BrowserEvent=function(a,b){a&&this.init(a,b)};goog.inherits(goog.events.BrowserEvent,goog.events.Event);goog.events.BrowserEvent.MouseButton={LEFT:0,MIDDLE:1,RIGHT:2};goog.events.BrowserEvent.IEButtonMap=[1,4,2];goog.events.BrowserEvent.prototype.target=null;goog.events.BrowserEvent.prototype.relatedTarget=null;goog.events.BrowserEvent.prototype.offsetX=0;
goog.events.BrowserEvent.prototype.offsetY=0;goog.events.BrowserEvent.prototype.clientX=0;goog.events.BrowserEvent.prototype.clientY=0;goog.events.BrowserEvent.prototype.screenX=0;goog.events.BrowserEvent.prototype.screenY=0;goog.events.BrowserEvent.prototype.button=0;goog.events.BrowserEvent.prototype.keyCode=0;goog.events.BrowserEvent.prototype.charCode=0;goog.events.BrowserEvent.prototype.ctrlKey=false;goog.events.BrowserEvent.prototype.altKey=false;
goog.events.BrowserEvent.prototype.shiftKey=false;goog.events.BrowserEvent.prototype.metaKey=false;goog.events.BrowserEvent.prototype.platformModifierKey=false;goog.events.BrowserEvent.prototype.event_=null;
goog.events.BrowserEvent.prototype.init=function(a,b){var c=this.type=a.type;goog.events.Event.call(this,c);this.target=a.target||a.srcElement;this.currentTarget=b;var d=a.relatedTarget;if(d){if(goog.userAgent.GECKO)try{goog.reflect.sinkValue(d.nodeName)}catch(e){d=null}}else if(c==goog.events.EventType.MOUSEOVER)d=a.fromElement;else if(c==goog.events.EventType.MOUSEOUT)d=a.toElement;this.relatedTarget=d;this.offsetX=a.offsetX!==undefined?a.offsetX:a.layerX;this.offsetY=a.offsetY!==undefined?a.offsetY:
a.layerY;this.clientX=a.clientX!==undefined?a.clientX:a.pageX;this.clientY=a.clientY!==undefined?a.clientY:a.pageY;this.screenX=a.screenX||0;this.screenY=a.screenY||0;this.button=a.button;this.keyCode=a.keyCode||0;this.charCode=a.charCode||(c=="keypress"?a.keyCode:0);this.ctrlKey=a.ctrlKey;this.altKey=a.altKey;this.shiftKey=a.shiftKey;this.metaKey=a.metaKey;this.platformModifierKey=goog.userAgent.MAC?a.metaKey:a.ctrlKey;this.state=a.state;this.event_=a;delete this.returnValue_;delete this.propagationStopped_};
goog.events.BrowserEvent.prototype.isButton=function(a){return goog.events.BrowserFeature.HAS_W3C_BUTTON?this.event_.button==a:this.type=="click"?a==goog.events.BrowserEvent.MouseButton.LEFT:!!(this.event_.button&goog.events.BrowserEvent.IEButtonMap[a])};goog.events.BrowserEvent.prototype.isMouseActionButton=function(){return this.isButton(goog.events.BrowserEvent.MouseButton.LEFT)&&!(goog.userAgent.WEBKIT&&goog.userAgent.MAC&&this.ctrlKey)};
goog.events.BrowserEvent.prototype.stopPropagation=function(){goog.events.BrowserEvent.superClass_.stopPropagation.call(this);if(this.event_.stopPropagation)this.event_.stopPropagation();else this.event_.cancelBubble=true};
goog.events.BrowserEvent.prototype.preventDefault=function(){goog.events.BrowserEvent.superClass_.preventDefault.call(this);var a=this.event_;if(a.preventDefault)a.preventDefault();else{a.returnValue=false;if(goog.events.BrowserFeature.SET_KEY_CODE_TO_PREVENT_DEFAULT)try{if(a.ctrlKey||a.keyCode>=112&&a.keyCode<=123)a.keyCode=-1}catch(b){}}};goog.events.BrowserEvent.prototype.getBrowserEvent=function(){return this.event_};
goog.events.BrowserEvent.prototype.disposeInternal=function(){goog.events.BrowserEvent.superClass_.disposeInternal.call(this);this.relatedTarget=this.currentTarget=this.target=this.event_=null};goog.events.EventWrapper=function(){};goog.events.EventWrapper.prototype.listen=function(){};goog.events.EventWrapper.prototype.unlisten=function(){};goog.events.Listener=function(){};goog.events.Listener.counter_=0;goog.events.Listener.prototype.key=0;goog.events.Listener.prototype.removed=false;
goog.events.Listener.prototype.callOnce=false;goog.events.Listener.prototype.init=function(a,b,c,d,e,f){if(goog.isFunction(a))this.isFunctionListener_=true;else if(a&&a.handleEvent&&goog.isFunction(a.handleEvent))this.isFunctionListener_=false;else throw Error("Invalid listener argument");this.listener=a;this.proxy=b;this.src=c;this.type=d;this.capture=!!e;this.handler=f;this.callOnce=false;this.key=++goog.events.Listener.counter_;this.removed=false};
goog.events.Listener.prototype.handleEvent=function(a){if(this.isFunctionListener_)return this.listener.call(this.handler||this.src,a);return this.listener.handleEvent.call(this.listener,a)};goog.structs={};goog.structs.SimplePool=function(a,b){goog.Disposable.call(this);this.maxCount_=b;this.freeQueue_=[];this.createInitial_(a)};goog.inherits(goog.structs.SimplePool,goog.Disposable);goog.structs.SimplePool.prototype.createObjectFn_=null;goog.structs.SimplePool.prototype.disposeObjectFn_=null;
goog.structs.SimplePool.prototype.setCreateObjectFn=function(a){this.createObjectFn_=a};goog.structs.SimplePool.prototype.setDisposeObjectFn=function(a){this.disposeObjectFn_=a};goog.structs.SimplePool.prototype.getObject=function(){if(this.freeQueue_.length)return this.freeQueue_.pop();return this.createObject()};goog.structs.SimplePool.prototype.releaseObject=function(a){this.freeQueue_.length<this.maxCount_?this.freeQueue_.push(a):this.disposeObject(a)};
goog.structs.SimplePool.prototype.createInitial_=function(a){if(a>this.maxCount_)throw Error("[goog.structs.SimplePool] Initial cannot be greater than max");for(var b=0;b<a;b++)this.freeQueue_.push(this.createObject())};goog.structs.SimplePool.prototype.createObject=function(){return this.createObjectFn_?this.createObjectFn_():{}};
goog.structs.SimplePool.prototype.disposeObject=function(a){if(this.disposeObjectFn_)this.disposeObjectFn_(a);else if(goog.isObject(a))if(goog.isFunction(a.dispose))a.dispose();else for(var b in a)delete a[b]};goog.structs.SimplePool.prototype.disposeInternal=function(){goog.structs.SimplePool.superClass_.disposeInternal.call(this);for(var a=this.freeQueue_;a.length;)this.disposeObject(a.pop());delete this.freeQueue_};goog.userAgent.jscript={};goog.userAgent.jscript.ASSUME_NO_JSCRIPT=false;
goog.userAgent.jscript.init_=function(){goog.userAgent.jscript.DETECTED_HAS_JSCRIPT_="ScriptEngine"in goog.global&&goog.global.ScriptEngine()=="JScript";goog.userAgent.jscript.DETECTED_VERSION_=goog.userAgent.jscript.DETECTED_HAS_JSCRIPT_?goog.global.ScriptEngineMajorVersion()+"."+goog.global.ScriptEngineMinorVersion()+"."+goog.global.ScriptEngineBuildVersion():"0"};goog.userAgent.jscript.ASSUME_NO_JSCRIPT||goog.userAgent.jscript.init_();
goog.userAgent.jscript.HAS_JSCRIPT=goog.userAgent.jscript.ASSUME_NO_JSCRIPT?false:goog.userAgent.jscript.DETECTED_HAS_JSCRIPT_;goog.userAgent.jscript.VERSION=goog.userAgent.jscript.ASSUME_NO_JSCRIPT?"0":goog.userAgent.jscript.DETECTED_VERSION_;goog.userAgent.jscript.isVersion=function(a){return goog.string.compareVersions(goog.userAgent.jscript.VERSION,a)>=0};goog.events.pools={};goog.events.ASSUME_GOOD_GC=false;
(function(){function a(){return{count_:0,remaining_:0}}function b(){return[]}function c(){var o=function(q){return g.call(o.src,o.key,q)};return o}function d(){return new goog.events.Listener}function e(){return new goog.events.BrowserEvent}var f=!goog.events.ASSUME_GOOD_GC&&goog.userAgent.jscript.HAS_JSCRIPT&&!goog.userAgent.jscript.isVersion("5.7"),g;goog.events.pools.setProxyCallbackFunction=function(o){g=o};if(f){goog.events.pools.getObject=function(){return h.getObject()};goog.events.pools.releaseObject=
function(o){h.releaseObject(o)};goog.events.pools.getArray=function(){return k.getObject()};goog.events.pools.releaseArray=function(o){k.releaseObject(o)};goog.events.pools.getProxy=function(){return l.getObject()};goog.events.pools.releaseProxy=function(){l.releaseObject(c())};goog.events.pools.getListener=function(){return m.getObject()};goog.events.pools.releaseListener=function(o){m.releaseObject(o)};goog.events.pools.getEvent=function(){return n.getObject()};goog.events.pools.releaseEvent=function(o){n.releaseObject(o)};
var h=new goog.structs.SimplePool(0,600);h.setCreateObjectFn(a);var k=new goog.structs.SimplePool(0,600);k.setCreateObjectFn(b);var l=new goog.structs.SimplePool(0,600);l.setCreateObjectFn(c);var m=new goog.structs.SimplePool(0,600);m.setCreateObjectFn(d);var n=new goog.structs.SimplePool(0,600);n.setCreateObjectFn(e)}else{goog.events.pools.getObject=a;goog.events.pools.releaseObject=goog.nullFunction;goog.events.pools.getArray=b;goog.events.pools.releaseArray=goog.nullFunction;goog.events.pools.getProxy=
c;goog.events.pools.releaseProxy=goog.nullFunction;goog.events.pools.getListener=d;goog.events.pools.releaseListener=goog.nullFunction;goog.events.pools.getEvent=e;goog.events.pools.releaseEvent=goog.nullFunction}})();goog.events.listeners_={};goog.events.listenerTree_={};goog.events.sources_={};goog.events.onString_="on";goog.events.onStringMap_={};goog.events.keySeparator_="_";
goog.events.listen=function(a,b,c,d,e){if(b)if(goog.isArray(b)){for(var f=0;f<b.length;f++)goog.events.listen(a,b[f],c,d,e);return null}else{d=!!d;var g=goog.events.listenerTree_;b in g||(g[b]=goog.events.pools.getObject());g=g[b];if(!(d in g)){g[d]=goog.events.pools.getObject();g.count_++}g=g[d];var h=goog.getUid(a),k;g.remaining_++;if(g[h]){k=g[h];for(f=0;f<k.length;f++){g=k[f];if(g.listener==c&&g.handler==e){if(g.removed)break;return k[f].key}}}else{k=g[h]=goog.events.pools.getArray();g.count_++}f=
goog.events.pools.getProxy();f.src=a;g=goog.events.pools.getListener();g.init(c,f,a,b,d,e);c=g.key;f.key=c;k.push(g);goog.events.listeners_[c]=g;goog.events.sources_[h]||(goog.events.sources_[h]=goog.events.pools.getArray());goog.events.sources_[h].push(g);if(a.addEventListener){if(a==goog.global||!a.customEvent_)a.addEventListener(b,f,d)}else a.attachEvent(goog.events.getOnString_(b),f);return c}else throw Error("Invalid event type");};
goog.events.listenOnce=function(a,b,c,d,e){if(goog.isArray(b)){for(var f=0;f<b.length;f++)goog.events.listenOnce(a,b[f],c,d,e);return null}a=goog.events.listen(a,b,c,d,e);goog.events.listeners_[a].callOnce=true;return a};goog.events.listenWithWrapper=function(a,b,c,d,e){b.listen(a,c,d,e)};
goog.events.unlisten=function(a,b,c,d,e){if(goog.isArray(b)){for(var f=0;f<b.length;f++)goog.events.unlisten(a,b[f],c,d,e);return null}d=!!d;a=goog.events.getListeners_(a,b,d);if(!a)return false;for(f=0;f<a.length;f++)if(a[f].listener==c&&a[f].capture==d&&a[f].handler==e)return goog.events.unlistenByKey(a[f].key);return false};
goog.events.unlistenByKey=function(a){if(!goog.events.listeners_[a])return false;var b=goog.events.listeners_[a];if(b.removed)return false;var c=b.src,d=b.type,e=b.proxy,f=b.capture;if(c.removeEventListener){if(c==goog.global||!c.customEvent_)c.removeEventListener(d,e,f)}else c.detachEvent&&c.detachEvent(goog.events.getOnString_(d),e);c=goog.getUid(c);e=goog.events.listenerTree_[d][f][c];if(goog.events.sources_[c]){var g=goog.events.sources_[c];goog.array.remove(g,b);g.length==0&&delete goog.events.sources_[c]}b.removed=
true;e.needsCleanup_=true;goog.events.cleanUp_(d,f,c,e);delete goog.events.listeners_[a];return true};goog.events.unlistenWithWrapper=function(a,b,c,d,e){b.unlisten(a,c,d,e)};
goog.events.cleanUp_=function(a,b,c,d){if(!d.locked_)if(d.needsCleanup_){for(var e=0,f=0;e<d.length;e++)if(d[e].removed){var g=d[e].proxy;g.src=null;goog.events.pools.releaseProxy(g);goog.events.pools.releaseListener(d[e])}else{if(e!=f)d[f]=d[e];f++}d.length=f;d.needsCleanup_=false;if(f==0){goog.events.pools.releaseArray(d);delete goog.events.listenerTree_[a][b][c];goog.events.listenerTree_[a][b].count_--;if(goog.events.listenerTree_[a][b].count_==0){goog.events.pools.releaseObject(goog.events.listenerTree_[a][b]);
delete goog.events.listenerTree_[a][b];goog.events.listenerTree_[a].count_--}if(goog.events.listenerTree_[a].count_==0){goog.events.pools.releaseObject(goog.events.listenerTree_[a]);delete goog.events.listenerTree_[a]}}}};
goog.events.removeAll=function(a,b,c){var d=0,e=b==null,f=c==null;c=!!c;if(a==null)goog.object.forEach(goog.events.sources_,function(k){for(var l=k.length-1;l>=0;l--){var m=k[l];if((e||b==m.type)&&(f||c==m.capture)){goog.events.unlistenByKey(m.key);d++}}});else{a=goog.getUid(a);if(goog.events.sources_[a]){a=goog.events.sources_[a];for(var g=a.length-1;g>=0;g--){var h=a[g];if((e||b==h.type)&&(f||c==h.capture)){goog.events.unlistenByKey(h.key);d++}}}}return d};
goog.events.getListeners=function(a,b,c){return goog.events.getListeners_(a,b,c)||[]};goog.events.getListeners_=function(a,b,c){var d=goog.events.listenerTree_;if(b in d){d=d[b];if(c in d){d=d[c];a=goog.getUid(a);if(d[a])return d[a]}}return null};goog.events.getListener=function(a,b,c,d,e){d=!!d;if(a=goog.events.getListeners_(a,b,d))for(b=0;b<a.length;b++)if(a[b].listener==c&&a[b].capture==d&&a[b].handler==e)return a[b];return null};
goog.events.hasListener=function(a,b,c){a=goog.getUid(a);var d=goog.events.sources_[a];if(d){var e=goog.isDef(b),f=goog.isDef(c);if(e&&f){d=goog.events.listenerTree_[b];return!!d&&!!d[c]&&a in d[c]}else return e||f?goog.array.some(d,function(g){return e&&g.type==b||f&&g.capture==c}):true}return false};goog.events.expose=function(a){var b=[];for(var c in a)a[c]&&a[c].id?b.push(c+" = "+a[c]+" ("+a[c].id+")"):b.push(c+" = "+a[c]);return b.join("\n")};
goog.events.getOnString_=function(a){if(a in goog.events.onStringMap_)return goog.events.onStringMap_[a];return goog.events.onStringMap_[a]=goog.events.onString_+a};goog.events.fireListeners=function(a,b,c,d){var e=goog.events.listenerTree_;if(b in e){e=e[b];if(c in e)return goog.events.fireListeners_(e[c],a,b,c,d)}return true};
goog.events.fireListeners_=function(a,b,c,d,e){var f=1;b=goog.getUid(b);if(a[b]){a.remaining_--;a=a[b];if(a.locked_)a.locked_++;else a.locked_=1;try{for(var g=a.length,h=0;h<g;h++){var k=a[h];if(k&&!k.removed)f&=goog.events.fireListener(k,e)!==false}}finally{a.locked_--;goog.events.cleanUp_(c,d,b,a)}}return Boolean(f)};goog.events.fireListener=function(a,b){var c=a.handleEvent(b);a.callOnce&&goog.events.unlistenByKey(a.key);return c};goog.events.getTotalListenerCount=function(){return goog.object.getCount(goog.events.listeners_)};
goog.events.dispatchEvent=function(a,b){var c=b.type||b,d=goog.events.listenerTree_;if(!(c in d))return true;if(goog.isString(b))b=new goog.events.Event(b,a);else if(b instanceof goog.events.Event)b.target=b.target||a;else{var e=b;b=new goog.events.Event(c,a);goog.object.extend(b,e)}e=1;var f;d=d[c];c=true in d;var g;if(c){f=[];for(g=a;g;g=g.getParentEventTarget())f.push(g);g=d[true];g.remaining_=g.count_;for(var h=f.length-1;!b.propagationStopped_&&h>=0&&g.remaining_;h--){b.currentTarget=f[h];e&=
goog.events.fireListeners_(g,f[h],b.type,true,b)&&b.returnValue_!=false}}if(false in d){g=d[false];g.remaining_=g.count_;if(c)for(h=0;!b.propagationStopped_&&h<f.length&&g.remaining_;h++){b.currentTarget=f[h];e&=goog.events.fireListeners_(g,f[h],b.type,false,b)&&b.returnValue_!=false}else for(d=a;!b.propagationStopped_&&d&&g.remaining_;d=d.getParentEventTarget()){b.currentTarget=d;e&=goog.events.fireListeners_(g,d,b.type,false,b)&&b.returnValue_!=false}}return Boolean(e)};
goog.events.protectBrowserEventEntryPoint=function(a){goog.events.handleBrowserEvent_=a.protectEntryPoint(goog.events.handleBrowserEvent_);goog.events.pools.setProxyCallbackFunction(goog.events.handleBrowserEvent_)};
goog.events.handleBrowserEvent_=function(a,b){if(!goog.events.listeners_[a])return true;var c=goog.events.listeners_[a],d=c.type,e=goog.events.listenerTree_;if(!(d in e))return true;e=e[d];var f,g;if(goog.events.synthesizeEventPropagation_()){f=b||goog.getObjectByName("window.event");var h=true in e,k=false in e;if(h){if(goog.events.isMarkedIeEvent_(f))return true;goog.events.markIeEvent_(f)}var l=goog.events.pools.getEvent();l.init(f,this);f=true;try{if(h){for(var m=goog.events.pools.getArray(),
n=l.currentTarget;n;n=n.parentNode)m.push(n);g=e[true];g.remaining_=g.count_;for(var o=m.length-1;!l.propagationStopped_&&o>=0&&g.remaining_;o--){l.currentTarget=m[o];f&=goog.events.fireListeners_(g,m[o],d,true,l)}if(k){g=e[false];g.remaining_=g.count_;for(o=0;!l.propagationStopped_&&o<m.length&&g.remaining_;o++){l.currentTarget=m[o];f&=goog.events.fireListeners_(g,m[o],d,false,l)}}}else f=goog.events.fireListener(c,l)}finally{if(m){m.length=0;goog.events.pools.releaseArray(m)}l.dispose();goog.events.pools.releaseEvent(l)}return f}d=
new goog.events.BrowserEvent(b,this);try{f=goog.events.fireListener(c,d)}finally{d.dispose()}return f};goog.events.pools.setProxyCallbackFunction(goog.events.handleBrowserEvent_);goog.events.markIeEvent_=function(a){var b=false;if(a.keyCode==0)try{a.keyCode=-1;return}catch(c){b=true}if(b||a.returnValue==undefined)a.returnValue=true};goog.events.isMarkedIeEvent_=function(a){return a.keyCode<0||a.returnValue!=undefined};goog.events.uniqueIdCounter_=0;
goog.events.getUniqueId=function(a){return a+"_"+goog.events.uniqueIdCounter_++};goog.events.synthesizeEventPropagation_=function(){if(goog.events.requiresSyntheticEventPropagation_===undefined)goog.events.requiresSyntheticEventPropagation_=goog.userAgent.IE&&!goog.global.addEventListener;return goog.events.requiresSyntheticEventPropagation_};goog.debug.entryPointRegistry.register(function(a){goog.events.handleBrowserEvent_=a(goog.events.handleBrowserEvent_);goog.events.pools.setProxyCallbackFunction(goog.events.handleBrowserEvent_)});
goog.events.EventTarget=function(){goog.Disposable.call(this)};goog.inherits(goog.events.EventTarget,goog.Disposable);goog.events.EventTarget.prototype.customEvent_=true;goog.events.EventTarget.prototype.parentEventTarget_=null;goog.events.EventTarget.prototype.getParentEventTarget=function(){return this.parentEventTarget_};goog.events.EventTarget.prototype.setParentEventTarget=function(a){this.parentEventTarget_=a};
goog.events.EventTarget.prototype.addEventListener=function(a,b,c,d){goog.events.listen(this,a,b,c,d)};goog.events.EventTarget.prototype.removeEventListener=function(a,b,c,d){goog.events.unlisten(this,a,b,c,d)};goog.events.EventTarget.prototype.dispatchEvent=function(a){return goog.events.dispatchEvent(this,a)};goog.events.EventTarget.prototype.disposeInternal=function(){goog.events.EventTarget.superClass_.disposeInternal.call(this);goog.events.removeAll(this);this.parentEventTarget_=null};
goog.ui={};goog.ui.AutoComplete=function(a,b,c){goog.events.EventTarget.call(this);this.matcher_=a;this.selectionHandler_=c;this.renderer_=b;goog.events.listen(b,[goog.ui.AutoComplete.EventType.HILITE,goog.ui.AutoComplete.EventType.SELECT,goog.ui.AutoComplete.EventType.CANCEL_DISMISS,goog.ui.AutoComplete.EventType.DISMISS],this);this.token_=null;this.rows_=[];this.hiliteId_=-1;this.firstRowId_=0;this.dismissTimer_=this.target_=null};goog.inherits(goog.ui.AutoComplete,goog.events.EventTarget);
goog.ui.AutoComplete.prototype.maxMatches_=10;goog.ui.AutoComplete.prototype.autoHilite_=true;goog.ui.AutoComplete.prototype.allowFreeSelect_=false;goog.ui.AutoComplete.prototype.wrap_=false;goog.ui.AutoComplete.prototype.triggerSuggestionsOnUpdate_=false;goog.ui.AutoComplete.EventType={HILITE:"hilite",SELECT:"select",DISMISS:"dismiss",CANCEL_DISMISS:"canceldismiss",UPDATE:"update",SUGGESTIONS_UPDATE:"suggestionsupdate"};goog.ui.AutoComplete.prototype.getRenderer=function(){return this.renderer_};
goog.ui.AutoComplete.prototype.handleEvent=function(a){if(a.target==this.renderer_)switch(a.type){case goog.ui.AutoComplete.EventType.HILITE:this.hiliteId(a.row);break;case goog.ui.AutoComplete.EventType.SELECT:this.selectHilited();break;case goog.ui.AutoComplete.EventType.CANCEL_DISMISS:this.cancelDelayedDismiss();break;case goog.ui.AutoComplete.EventType.DISMISS:this.dismissOnDelay();break}};goog.ui.AutoComplete.prototype.setMaxMatches=function(a){this.maxMatches_=a};
goog.ui.AutoComplete.prototype.setAutoHilite=function(a){this.autoHilite_=a};goog.ui.AutoComplete.prototype.setAllowFreeSelect=function(a){this.allowFreeSelect_=a};goog.ui.AutoComplete.prototype.setWrap=function(a){this.wrap_=a};goog.ui.AutoComplete.prototype.setTriggerSuggestionsOnUpdate=function(a){this.triggerSuggestionsOnUpdate_=a};
goog.ui.AutoComplete.prototype.setToken=function(a,b){if(this.token_!=a){this.token_=a;this.matcher_.requestMatchingRows(this.token_,this.maxMatches_,goog.bind(this.matchListener_,this),b);this.cancelDelayedDismiss()}};goog.ui.AutoComplete.prototype.getTarget=function(){return this.target_};goog.ui.AutoComplete.prototype.setTarget=function(a){this.target_=a};goog.ui.AutoComplete.prototype.isOpen=function(){return this.renderer_.isVisible()};goog.ui.AutoComplete.prototype.getRowCount=function(){return this.rows_.length};
goog.ui.AutoComplete.prototype.hiliteNext=function(){var a=this.firstRowId_+this.rows_.length-1;if(this.hiliteId_>=this.firstRowId_&&this.hiliteId_<a){this.hiliteId(this.hiliteId_+1);return true}else if(this.hiliteId_==-1){this.hiliteId(this.firstRowId_);return true}else if(this.hiliteId_==a)if(this.allowFreeSelect_){this.hiliteId(-1);return false}else if(this.wrap_){this.hiliteId(this.firstRowId_);return true}return false};
goog.ui.AutoComplete.prototype.hilitePrev=function(){if(this.hiliteId_>this.firstRowId_){this.hiliteId(this.hiliteId_-1);return true}else if(this.allowFreeSelect_&&this.hiliteId_==this.firstRowId_){this.hiliteId(-1);return false}else if(this.wrap_&&(this.hiliteId_==-1||this.hiliteId_==this.firstRowId_)){this.hiliteId(this.firstRowId_+this.rows_.length-1);return true}return false};
goog.ui.AutoComplete.prototype.hiliteId=function(a){this.hiliteId_=a;this.renderer_.hiliteId(a);return this.getIndexOfId(a)!=-1};
goog.ui.AutoComplete.prototype.selectHilited=function(){var a=this.getIndexOfId(this.hiliteId_);if(a!=-1){a=this.rows_[a];var b=this.selectionHandler_.selectRow(a);this.dismiss();if(!b){this.dispatchEvent({type:goog.ui.AutoComplete.EventType.UPDATE,row:a});this.triggerSuggestionsOnUpdate_&&this.selectionHandler_.update(true)}return true}else{this.dismiss();this.dispatchEvent({type:goog.ui.AutoComplete.EventType.UPDATE,row:null});return false}};
goog.ui.AutoComplete.prototype.hasHighlight=function(){return this.isOpen()&&this.getIndexOfId(this.hiliteId_)!=-1};goog.ui.AutoComplete.prototype.dismiss=function(){this.hiliteId_=-1;this.token_=null;this.firstRowId_+=this.rows_.length;this.rows_=[];window.clearTimeout(this.dismissTimer_);this.dismissTimer_=null;this.renderer_.dismiss()};goog.ui.AutoComplete.prototype.dismissOnDelay=function(){if(!this.dismissTimer_)this.dismissTimer_=window.setTimeout(goog.bind(this.dismiss,this),100)};
goog.ui.AutoComplete.prototype.cancelDelayedDismiss=function(){window.setTimeout(goog.bind(function(){if(this.dismissTimer_){window.clearTimeout(this.dismissTimer_);this.dismissTimer_=null}},this),10)};goog.ui.AutoComplete.prototype.disposeInternal=function(){goog.ui.AutoComplete.superClass_.disposeInternal.call(this);this.renderer_.dispose();this.selectionHandler_.dispose();this.matcher_=null};goog.ui.AutoComplete.prototype.matchListener_=function(a,b,c){this.token_==a&&this.renderRows(b,c)};
goog.ui.AutoComplete.prototype.renderRows=function(a,b){var c=b?this.getIndexOfId(this.hiliteId_):null;this.firstRowId_+=this.rows_.length;this.rows_=a;for(var d=[],e=0;e<a.length;++e)d.push({id:this.getIdOfIndex_(e),data:a[e]});this.renderer_.renderRows(d,this.token_,this.target_);if(this.autoHilite_&&d.length!=0&&this.token_)this.hiliteId(c!=null?this.getIdOfIndex_(c):this.firstRowId_);else this.hiliteId_=-1;this.dispatchEvent(goog.ui.AutoComplete.EventType.SUGGESTIONS_UPDATE)};
goog.ui.AutoComplete.prototype.getIndexOfId=function(a){a=a-this.firstRowId_;if(a<0||a>=this.rows_.length)return-1;return a};goog.ui.AutoComplete.prototype.getIdOfIndex_=function(a){return this.firstRowId_+a};goog.ui.AutoComplete.prototype.attachInputs=function(){var a=this.selectionHandler_;a.attachInputs.apply(a,arguments)};goog.ui.AutoComplete.prototype.detachInputs=function(){var a=this.selectionHandler_;a.detachInputs.apply(a,arguments)};goog.iter={};
goog.iter.StopIteration="StopIteration"in goog.global?goog.global.StopIteration:Error("StopIteration");goog.iter.Iterator=function(){};goog.iter.Iterator.prototype.next=function(){throw goog.iter.StopIteration;};goog.iter.Iterator.prototype.__iterator__=function(){return this};
goog.iter.toIterator=function(a){if(a instanceof goog.iter.Iterator)return a;if(typeof a.__iterator__=="function")return a.__iterator__(false);if(goog.isArrayLike(a)){var b=0,c=new goog.iter.Iterator;c.next=function(){for(;;){if(b>=a.length)throw goog.iter.StopIteration;if(b in a)return a[b++];else b++}};return c}throw Error("Not implemented");};
goog.iter.forEach=function(a,b,c){if(goog.isArrayLike(a))try{goog.array.forEach(a,b,c)}catch(d){if(d!==goog.iter.StopIteration)throw d;}else{a=goog.iter.toIterator(a);try{for(;;)b.call(c,a.next(),undefined,a)}catch(e){if(e!==goog.iter.StopIteration)throw e;}}};goog.iter.filter=function(a,b,c){a=goog.iter.toIterator(a);var d=new goog.iter.Iterator;d.next=function(){for(;;){var e=a.next();if(b.call(c,e,undefined,a))return e}};return d};
goog.iter.range=function(a,b,c){var d=0,e=a,f=c||1;if(arguments.length>1){d=a;e=b}if(f==0)throw Error("Range step argument must not be zero");var g=new goog.iter.Iterator;g.next=function(){if(f>0&&d>=e||f<0&&d<=e)throw goog.iter.StopIteration;var h=d;d+=f;return h};return g};goog.iter.join=function(a,b){return goog.iter.toArray(a).join(b)};
goog.iter.map=function(a,b,c){a=goog.iter.toIterator(a);var d=new goog.iter.Iterator;d.next=function(){for(;;){var e=a.next();return b.call(c,e,undefined,a)}};return d};goog.iter.reduce=function(a,b,c,d){var e=c;goog.iter.forEach(a,function(f){e=b.call(d,e,f)});return e};goog.iter.some=function(a,b,c){a=goog.iter.toIterator(a);try{for(;;)if(b.call(c,a.next(),undefined,a))return true}catch(d){if(d!==goog.iter.StopIteration)throw d;}return false};
goog.iter.every=function(a,b,c){a=goog.iter.toIterator(a);try{for(;;)if(!b.call(c,a.next(),undefined,a))return false}catch(d){if(d!==goog.iter.StopIteration)throw d;}return true};goog.iter.chain=function(){var a=arguments,b=a.length,c=0,d=new goog.iter.Iterator;d.next=function(){try{if(c>=b)throw goog.iter.StopIteration;return goog.iter.toIterator(a[c]).next()}catch(e){if(e!==goog.iter.StopIteration||c>=b)throw e;else{c++;return this.next()}}};return d};
goog.iter.dropWhile=function(a,b,c){a=goog.iter.toIterator(a);var d=new goog.iter.Iterator,e=true;d.next=function(){for(;;){var f=a.next();if(!(e&&b.call(c,f,undefined,a))){e=false;return f}}};return d};goog.iter.takeWhile=function(a,b,c){a=goog.iter.toIterator(a);var d=new goog.iter.Iterator,e=true;d.next=function(){for(;;)if(e){var f=a.next();if(b.call(c,f,undefined,a))return f;else e=false}else throw goog.iter.StopIteration;};return d};
goog.iter.toArray=function(a){if(goog.isArrayLike(a))return goog.array.toArray(a);a=goog.iter.toIterator(a);var b=[];goog.iter.forEach(a,function(c){b.push(c)});return b};
goog.iter.equals=function(a,b){a=goog.iter.toIterator(a);b=goog.iter.toIterator(b);var c,d;try{for(;;){c=d=false;var e=a.next();c=true;var f=b.next();d=true;if(e!=f)return false}}catch(g){if(g!==goog.iter.StopIteration)throw g;else{if(c&&!d)return false;if(!d)try{b.next();return false}catch(h){if(h!==goog.iter.StopIteration)throw h;return true}}}return false};goog.iter.nextOrValue=function(a,b){try{return goog.iter.toIterator(a).next()}catch(c){if(c!=goog.iter.StopIteration)throw c;return b}};
goog.iter.product=function(){if(goog.array.some(arguments,function(d){return!d.length})||!arguments.length)return new goog.iter.Iterator;var a=new goog.iter.Iterator,b=arguments,c=goog.array.repeat(0,b.length);a.next=function(){if(c){for(var d=goog.array.map(c,function(f,g){return b[g][f]}),e=c.length-1;e>=0;e--){goog.asserts.assert(c);if(c[e]<b[e].length-1){c[e]++;break}if(e==0){c=null;break}c[e]=0}return d}throw goog.iter.StopIteration;};return a};
goog.ui.AutoComplete.ArrayMatcher=function(a,b){this.rows_=a;this.useSimilar_=!b};goog.ui.AutoComplete.ArrayMatcher.prototype.requestMatchingRows=function(a,b,c){var d=this.getPrefixMatches(a,b);if(d.length==0&&this.useSimilar_)d=this.getSimilarRows(a,b);c(a,d)};
goog.ui.AutoComplete.ArrayMatcher.prototype.getPrefixMatches=function(a,b){var c=[];if(a!=""){var d=goog.string.regExpEscape(a),e=new RegExp("(^|\\W+)"+d,"i");goog.iter.some(this.rows_,function(f){String(f).match(e)&&c.push(f);return c.length>=b})}return c};
goog.ui.AutoComplete.ArrayMatcher.prototype.getSimilarRows=function(a,b){var c=[];goog.iter.forEach(this.rows_,function(f,g){var h=a.toLowerCase(),k=String(f).toLowerCase(),l=0;if(k.indexOf(h)!=-1)l=parseInt((k.indexOf(h)/4).toString(),10);else for(var m=h.split(""),n=-1,o=10,q=0,p;p=m[q];q++){p=k.indexOf(p);if(p>n){n=p-n-1;if(n>o-5)n=o-5;l+=n;n=p}else{l+=o;o+=5}}l<h.length*6&&c.push({str:f,score:l,index:g})});c.sort(function(f,g){var h=f.score-g.score;if(h!=0)return h;return f.index-g.index});for(var d=
[],e=0;e<b&&e<c.length;e++)d.push(c[e].str);return d};goog.Timer=function(a,b){goog.events.EventTarget.call(this);this.interval_=a||1;this.timerObject_=b||goog.Timer.defaultTimerObject;this.boundTick_=goog.bind(this.tick_,this);this.last_=goog.now()};goog.inherits(goog.Timer,goog.events.EventTarget);goog.Timer.MAX_TIMEOUT_=2147483647;goog.Timer.prototype.enabled=false;goog.Timer.defaultTimerObject=goog.global.window;goog.Timer.intervalScale=0.8;goog.Timer.prototype.timer_=null;
goog.Timer.prototype.getInterval=function(){return this.interval_};goog.Timer.prototype.setInterval=function(a){this.interval_=a;if(this.timer_&&this.enabled){this.stop();this.start()}else this.timer_&&this.stop()};
goog.Timer.prototype.tick_=function(){if(this.enabled){var a=goog.now()-this.last_;if(a>0&&a<this.interval_*goog.Timer.intervalScale)this.timer_=this.timerObject_.setTimeout(this.boundTick_,this.interval_-a);else{this.dispatchTick();if(this.enabled){this.timer_=this.timerObject_.setTimeout(this.boundTick_,this.interval_);this.last_=goog.now()}}}};goog.Timer.prototype.dispatchTick=function(){this.dispatchEvent(goog.Timer.TICK)};
goog.Timer.prototype.start=function(){this.enabled=true;if(!this.timer_){this.timer_=this.timerObject_.setTimeout(this.boundTick_,this.interval_);this.last_=goog.now()}};goog.Timer.prototype.stop=function(){this.enabled=false;if(this.timer_){this.timerObject_.clearTimeout(this.timer_);this.timer_=null}};goog.Timer.prototype.disposeInternal=function(){goog.Timer.superClass_.disposeInternal.call(this);this.stop();delete this.timerObject_};goog.Timer.TICK="tick";
goog.Timer.callOnce=function(a,b,c){if(goog.isFunction(a)){if(c)a=goog.bind(a,c)}else if(a&&typeof a.handleEvent=="function")a=goog.bind(a.handleEvent,a);else throw Error("Invalid listener argument");return b>goog.Timer.MAX_TIMEOUT_?-1:goog.Timer.defaultTimerObject.setTimeout(a,b||0)};goog.Timer.clear=function(a){goog.Timer.defaultTimerObject.clearTimeout(a)};goog.dom.a11y={};
goog.dom.a11y.State={ACTIVEDESCENDANT:"activedescendant",ATOMIC:"atomic",AUTOCOMPLETE:"autocomplete",BUSY:"busy",CHECKED:"checked",CONTROLS:"controls",DESCRIBEDBY:"describedby",DISABLED:"disabled",DROPEFFECT:"dropeffect",EXPANDED:"expanded",FLOWTO:"flowto",GRABBED:"grabbed",HASPOPUP:"haspopup",HIDDEN:"hidden",INVALID:"invalid",LABEL:"label",LABELLEDBY:"labelledby",LEVEL:"level",LIVE:"live",MULTILINE:"multiline",MULTISELECTABLE:"multiselectable",ORIENTATION:"orientation",OWNS:"owns",POSINSET:"posinset",
PRESSED:"pressed",READONLY:"readonly",RELEVANT:"relevant",REQUIRED:"required",SELECTED:"selected",SETSIZE:"setsize",SORT:"sort",VALUEMAX:"valuemax",VALUEMIN:"valuemin",VALUENOW:"valuenow",VALUETEXT:"valuetext"};
goog.dom.a11y.Role={ALERT:"alert",ALERTDIALOG:"alertdialog",APPLICATION:"application",ARTICLE:"article",BANNER:"banner",BUTTON:"button",CHECKBOX:"checkbox",COLUMNHEADER:"columnheader",COMBOBOX:"combobox",COMPLEMENTARY:"complementary",DIALOG:"dialog",DIRECTORY:"directory",DOCUMENT:"document",FORM:"form",GRID:"grid",GRIDCELL:"gridcell",GROUP:"group",HEADING:"heading",IMG:"img",LINK:"link",LIST:"list",LISTBOX:"listbox",LISTITEM:"listitem",LOG:"log",MAIN:"main",MARQUEE:"marquee",MATH:"math",MENU:"menu",
MENUBAR:"menubar",MENU_ITEM:"menuitem",MENU_ITEM_CHECKBOX:"menuitemcheckbox",MENU_ITEM_RADIO:"menuitemradio",NAVIGATION:"navigation",NOTE:"note",OPTION:"option",PRESENTATION:"presentation",PROGRESSBAR:"progressbar",RADIO:"radio",RADIOGROUP:"radiogroup",REGION:"region",ROW:"row",ROWGROUP:"rowgroup",ROWHEADER:"rowheader",SCROLLBAR:"scrollbar",SEARCH:"search",SEPARATOR:"separator",SLIDER:"slider",SPINBUTTON:"spinbutton",STATUS:"status",TAB:"tab",TAB_LIST:"tablist",TAB_PANEL:"tabpanel",TEXTBOX:"textbox",
TIMER:"timer",TOOLBAR:"toolbar",TOOLTIP:"tooltip",TREE:"tree",TREEGRID:"treegrid",TREEITEM:"treeitem"};goog.dom.a11y.setRole=function(a,b){a.setAttribute("role",b);a.roleName=b};goog.dom.a11y.getRole=function(a){return a.roleName||""};goog.dom.a11y.setState=function(a,b,c){a.setAttribute("aria-"+b,c)};goog.dom.a11y.getState=function(a,b){var c=a.getAttribute("aria-"+b);return c===true||c===false?c?"true":"false":c?String(c):""};
goog.dom.a11y.getActiveDescendant=function(a){var b=goog.dom.a11y.getState(a,goog.dom.a11y.State.ACTIVEDESCENDANT);return goog.dom.getOwnerDocument(a).getElementById(b)};goog.dom.a11y.setActiveDescendant=function(a,b){goog.dom.a11y.setState(a,goog.dom.a11y.State.ACTIVEDESCENDANT,b?b.id:"")};goog.dom.selection={};
goog.dom.selection.setStart=function(a,b){if(goog.dom.selection.useSelectionProperties_(a))a.selectionStart=b;else if(goog.userAgent.IE){var c=goog.dom.selection.getRangeIe_(a),d=c[0];if(d.inRange(c[1])){b=goog.dom.selection.canonicalizePositionIe_(a,b);d.collapse(true);d.move("character",b);d.select()}}};goog.dom.selection.getStart=function(a){return goog.dom.selection.getEndPoints_(a,true)[0]};
goog.dom.selection.getEndPointsTextareaIe_=function(a,b,c){b=b.duplicate();for(var d=a.text,e=d,f=b.text,g=f,h=false;!h;)if(a.compareEndPoints("StartToEnd",a)==0)h=true;else{a.moveEnd("character",-1);if(a.text==d)e+="\r\n";else h=true}if(c)return[e.length,-1];for(a=false;!a;)if(b.compareEndPoints("StartToEnd",b)==0)a=true;else{b.moveEnd("character",-1);if(b.text==f)g+="\r\n";else a=true}return[e.length,e.length+g.length]};
goog.dom.selection.getEndPoints=function(a){return goog.dom.selection.getEndPoints_(a,false)};
goog.dom.selection.getEndPoints_=function(a,b){var c=0,d=0;if(goog.dom.selection.useSelectionProperties_(a)){c=a.selectionStart;d=b?-1:a.selectionEnd}else if(goog.userAgent.IE){var e=goog.dom.selection.getRangeIe_(a),f=e[0];e=e[1];if(f.inRange(e)){f.setEndPoint("EndToStart",e);if(a.type=="textarea")return goog.dom.selection.getEndPointsTextareaIe_(f,e,b);c=f.text.length;d=b?-1:f.text.length+e.text.length}}return[c,d]};
goog.dom.selection.setEnd=function(a,b){if(goog.dom.selection.useSelectionProperties_(a))a.selectionEnd=b;else if(goog.userAgent.IE){var c=goog.dom.selection.getRangeIe_(a),d=c[1];if(c[0].inRange(d)){b=goog.dom.selection.canonicalizePositionIe_(a,b);c=goog.dom.selection.canonicalizePositionIe_(a,goog.dom.selection.getStart(a));d.collapse(true);d.moveEnd("character",b-c);d.select()}}};goog.dom.selection.getEnd=function(a){return goog.dom.selection.getEndPoints_(a,false)[1]};
goog.dom.selection.setCursorPosition=function(a,b){if(goog.dom.selection.useSelectionProperties_(a)){a.selectionStart=b;a.selectionEnd=b}else if(goog.userAgent.IE){b=goog.dom.selection.canonicalizePositionIe_(a,b);var c=a.createTextRange();c.collapse(true);c.move("character",b);c.select()}};
goog.dom.selection.setText=function(a,b){if(goog.dom.selection.useSelectionProperties_(a)){var c=a.value,d=a.selectionStart,e=c.substr(0,d);c=c.substr(a.selectionEnd);a.value=e+b+c;a.selectionStart=d;a.selectionEnd=d+b.length}else if(goog.userAgent.IE){e=goog.dom.selection.getRangeIe_(a);d=e[1];if(e[0].inRange(d)){e=d.duplicate();d.text=b;d.setEndPoint("StartToStart",e);d.select()}}else throw Error("Cannot set the selection end");};
goog.dom.selection.getText=function(a){if(goog.dom.selection.useSelectionProperties_(a))return a.value.substring(a.selectionStart,a.selectionEnd);if(goog.userAgent.IE){var b=goog.dom.selection.getRangeIe_(a),c=b[1];if(b[0].inRange(c)){if(a.type=="textarea")return goog.dom.selection.getSelectionRangeText_(c)}else return"";return c.text}throw Error("Cannot get the selection text");};
goog.dom.selection.getSelectionRangeText_=function(a){a=a.duplicate();for(var b=a.text,c=b,d=false;!d;)if(a.compareEndPoints("StartToEnd",a)==0)d=true;else{a.moveEnd("character",-1);if(a.text==b)c+="\r\n";else d=true}return c};goog.dom.selection.getRangeIe_=function(a){var b=a.ownerDocument||a.document,c=b.selection.createRange();if(a.type=="textarea"){b=b.body.createTextRange();b.moveToElementText(a)}else b=a.createTextRange();return[b,c]};
goog.dom.selection.canonicalizePositionIe_=function(a,b){if(a.type=="textarea"){var c=a.value.substring(0,b);b=goog.string.canonicalizeNewlines(c).length}return b};goog.dom.selection.useSelectionProperties_=function(a){try{return typeof a.selectionStart=="number"}catch(b){return false}};goog.events.EventHandler=function(a){goog.Disposable.call(this);this.handler_=a};goog.inherits(goog.events.EventHandler,goog.Disposable);goog.events.EventHandler.KEY_POOL_INITIAL_COUNT=0;
goog.events.EventHandler.KEY_POOL_MAX_COUNT=100;goog.events.EventHandler.keyPool_=new goog.structs.SimplePool(goog.events.EventHandler.KEY_POOL_INITIAL_COUNT,goog.events.EventHandler.KEY_POOL_MAX_COUNT);goog.events.EventHandler.keys_=null;goog.events.EventHandler.key_=null;goog.events.EventHandler.typeArray_=[];
goog.events.EventHandler.prototype.listen=function(a,b,c,d,e){if(!goog.isArray(b)){goog.events.EventHandler.typeArray_[0]=b;b=goog.events.EventHandler.typeArray_}for(var f=0;f<b.length;f++)this.recordListenerKey_(goog.events.listen(a,b[f],c||this,d||false,e||this.handler_||this));return this};
goog.events.EventHandler.prototype.listenOnce=function(a,b,c,d,e){if(goog.isArray(b))for(var f=0;f<b.length;f++)this.listenOnce(a,b[f],c,d,e);else this.recordListenerKey_(goog.events.listenOnce(a,b,c||this,d||false,e||this.handler_||this));return this};goog.events.EventHandler.prototype.listenWithWrapper=function(a,b,c,d,e){b.listen(a,c,d,e||this.handler_,this);return this};
goog.events.EventHandler.prototype.recordListenerKey_=function(a){if(this.keys_)this.keys_[a]=true;else if(this.key_){this.keys_=goog.events.EventHandler.keyPool_.getObject();this.keys_[this.key_]=true;this.key_=null;this.keys_[a]=true}else this.key_=a};
goog.events.EventHandler.prototype.unlisten=function(a,b,c,d,e){if(this.key_||this.keys_)if(goog.isArray(b))for(var f=0;f<b.length;f++)this.unlisten(a,b[f],c,d,e);else if(a=goog.events.getListener(a,b,c||this,d||false,e||this.handler_||this)){a=a.key;goog.events.unlistenByKey(a);if(this.keys_)goog.object.remove(this.keys_,a);else if(this.key_==a)this.key_=null}return this};goog.events.EventHandler.prototype.unlistenWithWrapper=function(a,b,c,d,e){b.unlisten(a,c,d,e||this.handler_,this);return this};
goog.events.EventHandler.prototype.removeAll=function(){if(this.keys_){for(var a in this.keys_){goog.events.unlistenByKey(a);delete this.keys_[a]}goog.events.EventHandler.keyPool_.releaseObject(this.keys_);this.keys_=null}else this.key_&&goog.events.unlistenByKey(this.key_)};goog.events.EventHandler.prototype.disposeInternal=function(){goog.events.EventHandler.superClass_.disposeInternal.call(this);this.removeAll()};
goog.events.EventHandler.prototype.handleEvent=function(){throw Error("EventHandler.handleEvent not implemented");};
goog.events.KeyCodes={MAC_ENTER:3,BACKSPACE:8,TAB:9,NUM_CENTER:12,ENTER:13,SHIFT:16,CTRL:17,ALT:18,PAUSE:19,CAPS_LOCK:20,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,PRINT_SCREEN:44,INSERT:45,DELETE:46,ZERO:48,ONE:49,TWO:50,THREE:51,FOUR:52,FIVE:53,SIX:54,SEVEN:55,EIGHT:56,NINE:57,QUESTION_MARK:63,A:65,B:66,C:67,D:68,E:69,F:70,G:71,H:72,I:73,J:74,K:75,L:76,M:77,N:78,O:79,P:80,Q:81,R:82,S:83,T:84,U:85,V:86,W:87,X:88,Y:89,Z:90,META:91,CONTEXT_MENU:93,NUM_ZERO:96,
NUM_ONE:97,NUM_TWO:98,NUM_THREE:99,NUM_FOUR:100,NUM_FIVE:101,NUM_SIX:102,NUM_SEVEN:103,NUM_EIGHT:104,NUM_NINE:105,NUM_MULTIPLY:106,NUM_PLUS:107,NUM_MINUS:109,NUM_PERIOD:110,NUM_DIVISION:111,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123,NUMLOCK:144,SEMICOLON:186,DASH:189,EQUALS:187,COMMA:188,PERIOD:190,SLASH:191,APOSTROPHE:192,SINGLE_QUOTE:222,OPEN_SQUARE_BRACKET:219,BACKSLASH:220,CLOSE_SQUARE_BRACKET:221,WIN_KEY:224,MAC_FF_META:224,WIN_IME:229,PHANTOM:255};
goog.events.KeyCodes.isTextModifyingKeyEvent=function(a){if(a.altKey&&!a.ctrlKey||a.metaKey||a.keyCode>=goog.events.KeyCodes.F1&&a.keyCode<=goog.events.KeyCodes.F12)return false;switch(a.keyCode){case goog.events.KeyCodes.ALT:case goog.events.KeyCodes.CAPS_LOCK:case goog.events.KeyCodes.CONTEXT_MENU:case goog.events.KeyCodes.CTRL:case goog.events.KeyCodes.DOWN:case goog.events.KeyCodes.END:case goog.events.KeyCodes.ESC:case goog.events.KeyCodes.HOME:case goog.events.KeyCodes.INSERT:case goog.events.KeyCodes.LEFT:case goog.events.KeyCodes.MAC_FF_META:case goog.events.KeyCodes.META:case goog.events.KeyCodes.NUMLOCK:case goog.events.KeyCodes.NUM_CENTER:case goog.events.KeyCodes.PAGE_DOWN:case goog.events.KeyCodes.PAGE_UP:case goog.events.KeyCodes.PAUSE:case goog.events.KeyCodes.PHANTOM:case goog.events.KeyCodes.PRINT_SCREEN:case goog.events.KeyCodes.RIGHT:case goog.events.KeyCodes.SHIFT:case goog.events.KeyCodes.UP:case goog.events.KeyCodes.WIN_KEY:return false;
default:return true}};goog.events.KeyCodes.firesKeyPressEvent=function(a,b,c,d,e){if(!goog.userAgent.IE&&!(goog.userAgent.WEBKIT&&goog.userAgent.isVersion("525")))return true;if(goog.userAgent.MAC&&e)return goog.events.KeyCodes.isCharacterKey(a);if(e&&!d)return false;if(!c&&(b==goog.events.KeyCodes.CTRL||b==goog.events.KeyCodes.ALT))return false;if(goog.userAgent.IE&&d&&b==a)return false;switch(a){case goog.events.KeyCodes.ENTER:return true;case goog.events.KeyCodes.ESC:return!goog.userAgent.WEBKIT}return goog.events.KeyCodes.isCharacterKey(a)};
goog.events.KeyCodes.isCharacterKey=function(a){if(a>=goog.events.KeyCodes.ZERO&&a<=goog.events.KeyCodes.NINE)return true;if(a>=goog.events.KeyCodes.NUM_ZERO&&a<=goog.events.KeyCodes.NUM_MULTIPLY)return true;if(a>=goog.events.KeyCodes.A&&a<=goog.events.KeyCodes.Z)return true;if(goog.userAgent.WEBKIT&&a==0)return true;switch(a){case goog.events.KeyCodes.SPACE:case goog.events.KeyCodes.QUESTION_MARK:case goog.events.KeyCodes.NUM_PLUS:case goog.events.KeyCodes.NUM_MINUS:case goog.events.KeyCodes.NUM_PERIOD:case goog.events.KeyCodes.NUM_DIVISION:case goog.events.KeyCodes.SEMICOLON:case goog.events.KeyCodes.DASH:case goog.events.KeyCodes.EQUALS:case goog.events.KeyCodes.COMMA:case goog.events.KeyCodes.PERIOD:case goog.events.KeyCodes.SLASH:case goog.events.KeyCodes.APOSTROPHE:case goog.events.KeyCodes.SINGLE_QUOTE:case goog.events.KeyCodes.OPEN_SQUARE_BRACKET:case goog.events.KeyCodes.BACKSLASH:case goog.events.KeyCodes.CLOSE_SQUARE_BRACKET:return true;
default:return false}};goog.events.KeyHandler=function(a,b){goog.events.EventTarget.call(this);a&&this.attach(a,b)};goog.inherits(goog.events.KeyHandler,goog.events.EventTarget);goog.events.KeyHandler.prototype.element_=null;goog.events.KeyHandler.prototype.keyPressKey_=null;goog.events.KeyHandler.prototype.keyDownKey_=null;goog.events.KeyHandler.prototype.keyUpKey_=null;goog.events.KeyHandler.prototype.lastKey_=-1;goog.events.KeyHandler.prototype.keyCode_=-1;goog.events.KeyHandler.EventType={KEY:"key"};
goog.events.KeyHandler.safariKey_={"3":goog.events.KeyCodes.ENTER,"12":goog.events.KeyCodes.NUMLOCK,"63232":goog.events.KeyCodes.UP,"63233":goog.events.KeyCodes.DOWN,"63234":goog.events.KeyCodes.LEFT,"63235":goog.events.KeyCodes.RIGHT,"63236":goog.events.KeyCodes.F1,"63237":goog.events.KeyCodes.F2,"63238":goog.events.KeyCodes.F3,"63239":goog.events.KeyCodes.F4,"63240":goog.events.KeyCodes.F5,"63241":goog.events.KeyCodes.F6,"63242":goog.events.KeyCodes.F7,"63243":goog.events.KeyCodes.F8,"63244":goog.events.KeyCodes.F9,
"63245":goog.events.KeyCodes.F10,"63246":goog.events.KeyCodes.F11,"63247":goog.events.KeyCodes.F12,"63248":goog.events.KeyCodes.PRINT_SCREEN,"63272":goog.events.KeyCodes.DELETE,"63273":goog.events.KeyCodes.HOME,"63275":goog.events.KeyCodes.END,"63276":goog.events.KeyCodes.PAGE_UP,"63277":goog.events.KeyCodes.PAGE_DOWN,"63289":goog.events.KeyCodes.NUMLOCK,"63302":goog.events.KeyCodes.INSERT};
goog.events.KeyHandler.keyIdentifier_={Up:goog.events.KeyCodes.UP,Down:goog.events.KeyCodes.DOWN,Left:goog.events.KeyCodes.LEFT,Right:goog.events.KeyCodes.RIGHT,Enter:goog.events.KeyCodes.ENTER,F1:goog.events.KeyCodes.F1,F2:goog.events.KeyCodes.F2,F3:goog.events.KeyCodes.F3,F4:goog.events.KeyCodes.F4,F5:goog.events.KeyCodes.F5,F6:goog.events.KeyCodes.F6,F7:goog.events.KeyCodes.F7,F8:goog.events.KeyCodes.F8,F9:goog.events.KeyCodes.F9,F10:goog.events.KeyCodes.F10,F11:goog.events.KeyCodes.F11,F12:goog.events.KeyCodes.F12,
"U+007F":goog.events.KeyCodes.DELETE,Home:goog.events.KeyCodes.HOME,End:goog.events.KeyCodes.END,PageUp:goog.events.KeyCodes.PAGE_UP,PageDown:goog.events.KeyCodes.PAGE_DOWN,Insert:goog.events.KeyCodes.INSERT};goog.events.KeyHandler.mozKeyCodeToKeyCodeMap_={61:187,59:186};goog.events.KeyHandler.USES_KEYDOWN_=goog.userAgent.IE||goog.userAgent.WEBKIT&&goog.userAgent.isVersion("525");
goog.events.KeyHandler.prototype.handleKeyDown_=function(a){if(goog.userAgent.WEBKIT&&(this.lastKey_==goog.events.KeyCodes.CTRL&&!a.ctrlKey||this.lastKey_==goog.events.KeyCodes.ALT&&!a.altKey))this.keyCode_=this.lastKey_=-1;if(goog.events.KeyHandler.USES_KEYDOWN_&&!goog.events.KeyCodes.firesKeyPressEvent(a.keyCode,this.lastKey_,a.shiftKey,a.ctrlKey,a.altKey))this.handleEvent(a);else this.keyCode_=goog.userAgent.GECKO&&a.keyCode in goog.events.KeyHandler.mozKeyCodeToKeyCodeMap_?goog.events.KeyHandler.mozKeyCodeToKeyCodeMap_[a.keyCode]:
a.keyCode};goog.events.KeyHandler.prototype.handleKeyup_=function(){this.keyCode_=this.lastKey_=-1};
goog.events.KeyHandler.prototype.handleEvent=function(a){var b=a.getBrowserEvent(),c,d;if(goog.userAgent.IE&&a.type==goog.events.EventType.KEYPRESS){c=this.keyCode_;d=c!=goog.events.KeyCodes.ENTER&&c!=goog.events.KeyCodes.ESC?b.keyCode:0}else if(goog.userAgent.WEBKIT&&a.type==goog.events.EventType.KEYPRESS){c=this.keyCode_;d=b.charCode>=0&&b.charCode<63232&&goog.events.KeyCodes.isCharacterKey(c)?b.charCode:0}else if(goog.userAgent.OPERA){c=this.keyCode_;d=goog.events.KeyCodes.isCharacterKey(c)?b.keyCode:
0}else{c=b.keyCode||this.keyCode_;d=b.charCode||0;if(goog.userAgent.MAC&&d==goog.events.KeyCodes.QUESTION_MARK&&!c)c=goog.events.KeyCodes.SLASH}var e=c,f=b.keyIdentifier;if(c)if(c>=63232&&c in goog.events.KeyHandler.safariKey_)e=goog.events.KeyHandler.safariKey_[c];else{if(c==25&&a.shiftKey)e=9}else if(f&&f in goog.events.KeyHandler.keyIdentifier_)e=goog.events.KeyHandler.keyIdentifier_[f];a=e==this.lastKey_;this.lastKey_=e;b=new goog.events.KeyEvent(e,d,a,b);try{this.dispatchEvent(b)}finally{b.dispose()}};
goog.events.KeyHandler.prototype.getElement=function(){return this.element_};goog.events.KeyHandler.prototype.attach=function(a,b){this.keyUpKey_&&this.detach();this.element_=a;this.keyPressKey_=goog.events.listen(this.element_,goog.events.EventType.KEYPRESS,this,b);this.keyDownKey_=goog.events.listen(this.element_,goog.events.EventType.KEYDOWN,this.handleKeyDown_,b,this);this.keyUpKey_=goog.events.listen(this.element_,goog.events.EventType.KEYUP,this.handleKeyup_,b,this)};
goog.events.KeyHandler.prototype.detach=function(){if(this.keyPressKey_){goog.events.unlistenByKey(this.keyPressKey_);goog.events.unlistenByKey(this.keyDownKey_);goog.events.unlistenByKey(this.keyUpKey_);this.keyUpKey_=this.keyDownKey_=this.keyPressKey_=null}this.element_=null;this.keyCode_=this.lastKey_=-1};goog.events.KeyHandler.prototype.disposeInternal=function(){goog.events.KeyHandler.superClass_.disposeInternal.call(this);this.detach()};
goog.events.KeyEvent=function(a,b,c,d){goog.events.BrowserEvent.call(this,d);this.type=goog.events.KeyHandler.EventType.KEY;this.keyCode=a;this.charCode=b;this.repeat=c};goog.inherits(goog.events.KeyEvent,goog.events.BrowserEvent);
goog.ui.AutoComplete.InputHandler=function(a,b,c,d){goog.Disposable.call(this);d=d||150;this.setSeparators(goog.isDefAndNotNull(a)?a:goog.ui.AutoComplete.InputHandler.STANDARD_LIST_SEPARATORS);this.literals_=b||"";this.preventDefaultOnTab_=this.multi_=c!=null?c:true;this.timer_=d>0?new goog.Timer(d):null;this.eh_=new goog.events.EventHandler(this);this.activateHandler_=new goog.events.EventHandler(this);this.keyHandler_=new goog.events.KeyHandler;this.lastKeyCode_=-1};
goog.inherits(goog.ui.AutoComplete.InputHandler,goog.Disposable);goog.ui.AutoComplete.InputHandler.STANDARD_LIST_SEPARATORS=",;";goog.ui.AutoComplete.InputHandler.QUOTE_LITERALS='"';goog.ui.AutoComplete.InputHandler.prototype.whitespaceWrapEntries_=true;goog.ui.AutoComplete.InputHandler.prototype.generateNewTokenOnLiteral_=true;goog.ui.AutoComplete.InputHandler.prototype.upsideDown_=false;goog.ui.AutoComplete.InputHandler.prototype.separatorUpdates_=true;
goog.ui.AutoComplete.InputHandler.prototype.separatorSelects_=true;goog.ui.AutoComplete.InputHandler.prototype.activeElement_=null;goog.ui.AutoComplete.InputHandler.prototype.lastValue_="";goog.ui.AutoComplete.InputHandler.prototype.waitingForIme_=false;goog.ui.AutoComplete.InputHandler.prototype.rowJustSelected_=false;goog.ui.AutoComplete.InputHandler.prototype.updateDuringTyping_=true;goog.ui.AutoComplete.InputHandler.prototype.attachAutoComplete=function(a){this.ac_=a};
goog.ui.AutoComplete.InputHandler.prototype.getAutoComplete=function(){return this.ac_};goog.ui.AutoComplete.InputHandler.prototype.getActiveElement=function(){return this.activeElement_};goog.ui.AutoComplete.InputHandler.prototype.getValue=function(){return this.activeElement_.value};goog.ui.AutoComplete.InputHandler.prototype.setValue=function(a){this.activeElement_.value=a};goog.ui.AutoComplete.InputHandler.prototype.getCursorPosition=function(){return goog.dom.selection.getStart(this.activeElement_)};
goog.ui.AutoComplete.InputHandler.prototype.setCursorPosition=function(a){goog.dom.selection.setStart(this.activeElement_,a);goog.dom.selection.setEnd(this.activeElement_,a)};goog.ui.AutoComplete.InputHandler.prototype.attachInput=function(a){goog.dom.a11y.setState(a,"haspopup",true);this.eh_.listen(a,goog.events.EventType.FOCUS,this.handleFocus);this.eh_.listen(a,goog.events.EventType.BLUR,this.handleBlur);this.activeElement_||this.activateHandler_.listen(a,goog.events.EventType.KEYDOWN,this.onKeyDownOnInactiveElement_)};
goog.ui.AutoComplete.InputHandler.prototype.detachInput=function(a){a==this.activeElement_&&this.handleBlur();this.eh_.unlisten(a,goog.events.EventType.FOCUS,this.handleFocus);this.eh_.unlisten(a,goog.events.EventType.BLUR,this.handleBlur);this.activeElement_||this.activateHandler_.unlisten(a,goog.events.EventType.KEYDOWN,this.onKeyDownOnInactiveElement_)};goog.ui.AutoComplete.InputHandler.prototype.attachInputs=function(){for(var a=0;a<arguments.length;a++)this.attachInput(arguments[a])};
goog.ui.AutoComplete.InputHandler.prototype.detachInputs=function(){for(var a=0;a<arguments.length;a++)this.detachInput(arguments[a])};goog.ui.AutoComplete.InputHandler.prototype.selectRow=function(a,b){this.setTokenText(a.toString(),b);return false};
goog.ui.AutoComplete.InputHandler.prototype.setTokenText=function(a,b){if(goog.isDef(b)?b:this.multi_){var c=this.getTokenIndex_(this.getValue(),this.getCursorPosition()),d=this.splitInput_(this.getValue()),e=a;this.separatorCheck_.test(e)||(e=goog.string.trimRight(e)+this.defaultSeparator_);if(this.whitespaceWrapEntries_){if(c!=0&&!goog.string.isEmpty(d[c-1]))e=" "+e;if(c==d.length-1)e+=" "}if(e!=d[c]){d[c]=e;e=this.activeElement_;goog.userAgent.GECKO&&e.blur();e.value=d.join("");for(var f=0,g=0;g<=
c;g++)f+=d[g].length;e.focus();this.setCursorPosition(f)}}else this.setValue(a);this.rowJustSelected_=true};goog.ui.AutoComplete.InputHandler.prototype.disposeInternal=function(){goog.ui.AutoComplete.InputHandler.superClass_.disposeInternal.call(this);this.eh_.dispose();delete this.eh_;this.activateHandler_.dispose();this.keyHandler_.dispose()};
goog.ui.AutoComplete.InputHandler.prototype.setSeparators=function(a){this.separators_=a;this.defaultSeparator_=this.separators_.substring(0,1);a=this.multi_?"[\\s"+this.separators_+"]+":"[\\s]+";this.trimmer_=new RegExp("^"+a+"|"+a+"$","g");this.separatorCheck_=new RegExp("\\s*["+this.separators_+"]$")};goog.ui.AutoComplete.InputHandler.prototype.setUpsideDown=function(a){this.upsideDown_=a};
goog.ui.AutoComplete.InputHandler.prototype.setWhitespaceWrapEntries=function(a){this.whitespaceWrapEntries_=a};goog.ui.AutoComplete.InputHandler.prototype.setGenerateNewTokenOnLiteral=function(a){this.generateNewTokenOnLiteral_=a};goog.ui.AutoComplete.InputHandler.prototype.setTrimmingRegExp=function(a){this.trimmer_=a};goog.ui.AutoComplete.InputHandler.prototype.setPreventDefaultOnTab=function(a){this.preventDefaultOnTab_=a};
goog.ui.AutoComplete.InputHandler.prototype.setSeparatorCompletes=function(a){this.separatorSelects_=this.separatorUpdates_=a};goog.ui.AutoComplete.InputHandler.prototype.setSeparatorSelects=function(a){this.separatorSelects_=a};goog.ui.AutoComplete.InputHandler.prototype.getThrottleTime=function(){return this.timer_?this.timer_.getInterval():-1};goog.ui.AutoComplete.InputHandler.prototype.setRowJustSelected=function(a){this.rowJustSelected_=a};
goog.ui.AutoComplete.InputHandler.prototype.setThrottleTime=function(a){if(a<0){this.timer_.dispose();this.timer_=null}else if(this.timer_)this.timer_.setInterval(a);else this.timer_=new goog.Timer(a)};goog.ui.AutoComplete.InputHandler.prototype.getUpdateDuringTyping=function(){return this.updateDuringTyping_};goog.ui.AutoComplete.InputHandler.prototype.setUpdateDuringTyping=function(a){this.updateDuringTyping_=a};
goog.ui.AutoComplete.InputHandler.prototype.handleKeyEvent=function(a){switch(a.keyCode){case goog.events.KeyCodes.DOWN:if(this.ac_.isOpen()){this.moveDown_();a.preventDefault();return true}else if(!this.multi_){this.update(true);a.preventDefault();return true}break;case goog.events.KeyCodes.UP:if(this.ac_.isOpen()){this.moveUp_();a.preventDefault();return true}break;case goog.events.KeyCodes.TAB:if(this.ac_.isOpen()&&!a.shiftKey){this.update();if(this.ac_.selectHilited()&&this.preventDefaultOnTab_){a.preventDefault();
return true}}else this.ac_.dismiss();break;case goog.events.KeyCodes.ENTER:if(this.ac_.isOpen()){this.update();if(this.ac_.selectHilited()){a.preventDefault();a.stopPropagation();return true}}else this.ac_.dismiss();break;case goog.events.KeyCodes.ESC:if(this.ac_.isOpen()){this.ac_.dismiss();a.preventDefault();a.stopPropagation();return true}break;case goog.events.KeyCodes.WIN_IME:if(!this.waitingForIme_){this.startWaitingForIme_();return true}break;default:if(this.timer_&&!this.updateDuringTyping_){this.timer_.stop();
this.timer_.start()}}return this.handleSeparator_(a)};goog.ui.AutoComplete.InputHandler.prototype.handleSeparator_=function(a){var b=this.multi_&&a.charCode&&this.separators_.indexOf(String.fromCharCode(a.charCode))!=-1;this.separatorUpdates_&&b&&this.update();if(this.separatorSelects_&&b)if(this.ac_.selectHilited()){a.preventDefault();return true}return false};goog.ui.AutoComplete.InputHandler.prototype.needKeyUpListener=function(){return false};
goog.ui.AutoComplete.InputHandler.prototype.handleKeyUp=function(){return false};goog.ui.AutoComplete.InputHandler.prototype.addKeyEvents_=function(){this.keyHandler_.attach(this.activeElement_);this.eh_.listen(this.keyHandler_,goog.events.KeyHandler.EventType.KEY,this.onKey_);this.needKeyUpListener()&&this.eh_.listen(this.activeElement_,goog.events.EventType.KEYUP,this.handleKeyUp);goog.userAgent.IE&&this.eh_.listen(this.activeElement_,goog.events.EventType.KEYPRESS,this.onIeKeyPress_)};
goog.ui.AutoComplete.InputHandler.prototype.removeKeyEvents_=function(){this.eh_.unlisten(this.keyHandler_,goog.events.KeyHandler.EventType.KEY,this.onKey_);this.keyHandler_.detach();this.eh_.unlisten(this.activeElement_,goog.events.EventType.KEYUP,this.handleKeyUp);goog.userAgent.IE&&this.eh_.unlisten(this.activeElement_,goog.events.EventType.KEYPRESS,this.onIeKeyPress_);this.waitingForIme_&&this.stopWaitingForIme_()};
goog.ui.AutoComplete.InputHandler.prototype.handleFocus=function(a){this.activateHandler_.removeAll();this.ac_&&this.ac_.cancelDelayedDismiss();if(a.target!=this.activeElement_){this.activeElement_=a.target||null;if(this.timer_){this.timer_.start();this.eh_.listen(this.timer_,goog.Timer.TICK,this.onTick_)}this.lastValue_=this.getValue();this.addKeyEvents_()}};
goog.ui.AutoComplete.InputHandler.prototype.handleBlur=function(){if(this.activeElement_){this.removeKeyEvents_();this.activeElement_=null;if(this.timer_){this.timer_.stop();this.eh_.unlisten(this.timer_,goog.Timer.TICK,this.onTick_)}this.ac_&&this.ac_.dismissOnDelay()}};goog.ui.AutoComplete.InputHandler.prototype.onTick_=function(){this.update()};goog.ui.AutoComplete.InputHandler.prototype.onKeyDownOnInactiveElement_=function(a){this.handleFocus(a)};
goog.ui.AutoComplete.InputHandler.prototype.onKey_=function(a){this.lastKeyCode_=a.keyCode;this.ac_&&this.handleKeyEvent(a)};goog.ui.AutoComplete.InputHandler.prototype.onKeyPress_=function(){this.waitingForIme_&&this.lastKeyCode_!=goog.events.KeyCodes.WIN_IME&&this.stopWaitingForIme_()};goog.ui.AutoComplete.InputHandler.prototype.onKeyUp_=function(a){if(this.waitingForIme_&&(a.keyCode==goog.events.KeyCodes.ENTER||a.keyCode==goog.events.KeyCodes.M&&a.ctrlKey))this.stopWaitingForIme_()};
goog.ui.AutoComplete.InputHandler.prototype.startWaitingForIme_=function(){if(!this.waitingForIme_){this.eh_.listen(this.activeElement_,goog.events.EventType.KEYUP,this.onKeyUp_);this.eh_.listen(this.activeElement_,goog.events.EventType.KEYPRESS,this.onKeyPress_);this.waitingForIme_=true}};
goog.ui.AutoComplete.InputHandler.prototype.stopWaitingForIme_=function(){if(this.waitingForIme_){this.waitingForIme_=false;this.eh_.unlisten(this.activeElement_,goog.events.EventType.KEYPRESS,this.onKeyPress_);this.eh_.unlisten(this.activeElement_,goog.events.EventType.KEYUP,this.onKeyUp_)}};goog.ui.AutoComplete.InputHandler.prototype.onIeKeyPress_=function(a){this.handleSeparator_(a)};
goog.ui.AutoComplete.InputHandler.prototype.update=function(a){if(a||this.activeElement_&&this.getValue()!=this.lastValue_){if(a||!this.rowJustSelected_){a=this.parseToken();if(this.ac_){this.ac_.setTarget(this.activeElement_);this.ac_.setToken(a,this.getValue())}}this.lastValue_=this.getValue()}this.rowJustSelected_=false};goog.ui.AutoComplete.InputHandler.prototype.parseToken=function(){return this.parseToken_()};
goog.ui.AutoComplete.InputHandler.prototype.moveUp_=function(){return this.upsideDown_?this.ac_.hiliteNext():this.ac_.hilitePrev()};goog.ui.AutoComplete.InputHandler.prototype.moveDown_=function(){return this.upsideDown_?this.ac_.hilitePrev():this.ac_.hiliteNext()};goog.ui.AutoComplete.InputHandler.prototype.parseToken_=function(){var a=this.getCursorPosition(),b=this.getValue();return this.trim_(this.splitInput_(b)[this.getTokenIndex_(b,a)])};
goog.ui.AutoComplete.InputHandler.prototype.trim_=function(a){return this.trimmer_?String(a).replace(this.trimmer_,""):a};goog.ui.AutoComplete.InputHandler.prototype.getTokenIndex_=function(a,b){var c=this.splitInput_(a);if(b==a.length)return c.length-1;for(var d=0,e=0,f=0;e<c.length&&f<b;e++){f+=c[e].length;d=e}return d};
goog.ui.AutoComplete.InputHandler.prototype.splitInput_=function(a){if(!this.multi_)return[a];a=String(a).split("");for(var b=[],c=[],d=0,e=false;d<a.length;d++)if(this.literals_&&this.literals_.indexOf(a[d])!=-1){if(this.generateNewTokenOnLiteral_&&!e){b.push(c.join(""));c.length=0}c.push(a[d]);e=!e}else if(!e&&this.separators_.indexOf(a[d])!=-1){c.push(a[d]);b.push(c.join(""));c.length=0}else c.push(a[d]);b.push(c.join(""));return b};
goog.math.Box=function(a,b,c,d){this.top=a;this.right=b;this.bottom=c;this.left=d};goog.math.Box.boundingBox=function(){for(var a=new goog.math.Box(arguments[0].y,arguments[0].x,arguments[0].y,arguments[0].x),b=1;b<arguments.length;b++){var c=arguments[b];a.top=Math.min(a.top,c.y);a.right=Math.max(a.right,c.x);a.bottom=Math.max(a.bottom,c.y);a.left=Math.min(a.left,c.x)}return a};goog.math.Box.prototype.clone=function(){return new goog.math.Box(this.top,this.right,this.bottom,this.left)};
if(goog.DEBUG)goog.math.Box.prototype.toString=function(){return"("+this.top+"t, "+this.right+"r, "+this.bottom+"b, "+this.left+"l)"};goog.math.Box.prototype.contains=function(a){return goog.math.Box.contains(this,a)};goog.math.Box.prototype.expand=function(a,b,c,d){if(goog.isObject(a)){this.top-=a.top;this.right+=a.right;this.bottom+=a.bottom;this.left-=a.left}else{this.top-=a;this.right+=b;this.bottom+=c;this.left-=d}return this};
goog.math.Box.prototype.expandToInclude=function(a){this.left=Math.min(this.left,a.left);this.top=Math.min(this.top,a.top);this.right=Math.max(this.right,a.right);this.bottom=Math.max(this.bottom,a.bottom)};goog.math.Box.equals=function(a,b){if(a==b)return true;if(!a||!b)return false;return a.top==b.top&&a.right==b.right&&a.bottom==b.bottom&&a.left==b.left};
goog.math.Box.contains=function(a,b){if(!a||!b)return false;if(b instanceof goog.math.Box)return b.left>=a.left&&b.right<=a.right&&b.top>=a.top&&b.bottom<=a.bottom;return b.x>=a.left&&b.x<=a.right&&b.y>=a.top&&b.y<=a.bottom};
goog.math.Box.distance=function(a,b){if(b.x>=a.left&&b.x<=a.right){if(b.y>=a.top&&b.y<=a.bottom)return 0;return b.y<a.top?a.top-b.y:b.y-a.bottom}if(b.y>=a.top&&b.y<=a.bottom)return b.x<a.left?a.left-b.x:b.x-a.right;return goog.math.Coordinate.distance(b,new goog.math.Coordinate(b.x<a.left?a.left:a.right,b.y<a.top?a.top:a.bottom))};goog.math.Box.intersects=function(a,b){return a.left<=b.right&&b.left<=a.right&&a.top<=b.bottom&&b.top<=a.bottom};
goog.math.Box.intersectsWithPadding=function(a,b,c){return a.left<=b.right+c&&b.left<=a.right+c&&a.top<=b.bottom+c&&b.top<=a.bottom+c};goog.math.Rect=function(a,b,c,d){this.left=a;this.top=b;this.width=c;this.height=d};goog.math.Rect.prototype.clone=function(){return new goog.math.Rect(this.left,this.top,this.width,this.height)};goog.math.Rect.prototype.toBox=function(){return new goog.math.Box(this.top,this.left+this.width,this.top+this.height,this.left)};
goog.math.Rect.createFromBox=function(a){return new goog.math.Rect(a.left,a.top,a.right-a.left,a.bottom-a.top)};if(goog.DEBUG)goog.math.Rect.prototype.toString=function(){return"("+this.left+", "+this.top+" - "+this.width+"w x "+this.height+"h)"};goog.math.Rect.equals=function(a,b){if(a==b)return true;if(!a||!b)return false;return a.left==b.left&&a.width==b.width&&a.top==b.top&&a.height==b.height};
goog.math.Rect.prototype.intersection=function(a){var b=Math.max(this.left,a.left),c=Math.min(this.left+this.width,a.left+a.width);if(b<=c){var d=Math.max(this.top,a.top);a=Math.min(this.top+this.height,a.top+a.height);if(d<=a){this.left=b;this.top=d;this.width=c-b;this.height=a-d;return true}}return false};
goog.math.Rect.intersection=function(a,b){var c=Math.max(a.left,b.left),d=Math.min(a.left+a.width,b.left+b.width);if(c<=d){var e=Math.max(a.top,b.top),f=Math.min(a.top+a.height,b.top+b.height);if(e<=f)return new goog.math.Rect(c,e,d-c,f-e)}return null};goog.math.Rect.intersects=function(a,b){return a.left<=b.left+b.width&&b.left<=a.left+a.width&&a.top<=b.top+b.height&&b.top<=a.top+a.height};goog.math.Rect.prototype.intersects=function(a){return goog.math.Rect.intersects(this,a)};
goog.math.Rect.difference=function(a,b){var c=goog.math.Rect.intersection(a,b);if(!c||!c.height||!c.width)return[a.clone()];c=[];var d=a.top,e=a.height,f=a.left+a.width,g=a.top+a.height,h=b.left+b.width,k=b.top+b.height;if(b.top>a.top){c.push(new goog.math.Rect(a.left,a.top,a.width,b.top-a.top));d=b.top;e-=b.top-a.top}if(k<g){c.push(new goog.math.Rect(a.left,k,a.width,g-k));e=k-d}b.left>a.left&&c.push(new goog.math.Rect(a.left,d,b.left-a.left,e));h<f&&c.push(new goog.math.Rect(h,d,f-h,e));return c};
goog.math.Rect.prototype.difference=function(a){return goog.math.Rect.difference(this,a)};goog.math.Rect.prototype.boundingRect=function(a){var b=Math.max(this.left+this.width,a.left+a.width),c=Math.max(this.top+this.height,a.top+a.height);this.left=Math.min(this.left,a.left);this.top=Math.min(this.top,a.top);this.width=b-this.left;this.height=c-this.top};goog.math.Rect.boundingRect=function(a,b){if(!a||!b)return null;var c=a.clone();c.boundingRect(b);return c};
goog.math.Rect.prototype.contains=function(a){return a instanceof goog.math.Rect?this.left<=a.left&&this.left+this.width>=a.left+a.width&&this.top<=a.top&&this.top+this.height>=a.top+a.height:a.x>=this.left&&a.x<=this.left+this.width&&a.y>=this.top&&a.y<=this.top+this.height};goog.math.Rect.prototype.getSize=function(){return new goog.math.Size(this.width,this.height)};goog.style={};
goog.style.setStyle=function(a,b,c){goog.isString(b)?goog.style.setStyle_(a,c,b):goog.object.forEach(b,goog.partial(goog.style.setStyle_,a))};goog.style.setStyle_=function(a,b,c){a.style[goog.string.toCamelCase(c)]=b};goog.style.getStyle=function(a,b){return a.style[goog.string.toCamelCase(b)]||""};
goog.style.getComputedStyle=function(a,b){var c=goog.dom.getOwnerDocument(a);if(c.defaultView&&c.defaultView.getComputedStyle)if(c=c.defaultView.getComputedStyle(a,null))return c[b]||c.getPropertyValue(b);return""};goog.style.getCascadedStyle=function(a,b){return a.currentStyle?a.currentStyle[b]:null};goog.style.getStyle_=function(a,b){return goog.style.getComputedStyle(a,b)||goog.style.getCascadedStyle(a,b)||a.style[b]};goog.style.getComputedPosition=function(a){return goog.style.getStyle_(a,"position")};
goog.style.getBackgroundColor=function(a){return goog.style.getStyle_(a,"backgroundColor")};goog.style.getComputedOverflowX=function(a){return goog.style.getStyle_(a,"overflowX")};goog.style.getComputedOverflowY=function(a){return goog.style.getStyle_(a,"overflowY")};goog.style.getComputedZIndex=function(a){return goog.style.getStyle_(a,"zIndex")};goog.style.getComputedTextAlign=function(a){return goog.style.getStyle_(a,"textAlign")};
goog.style.getComputedCursor=function(a){return goog.style.getStyle_(a,"cursor")};goog.style.setPosition=function(a,b,c){var d,e=goog.userAgent.GECKO&&(goog.userAgent.MAC||goog.userAgent.X11)&&goog.userAgent.isVersion("1.9");if(b instanceof goog.math.Coordinate){d=b.x;b=b.y}else{d=b;b=c}a.style.left=goog.style.getPixelStyleValue_(d,e);a.style.top=goog.style.getPixelStyleValue_(b,e)};goog.style.getPosition=function(a){return new goog.math.Coordinate(a.offsetLeft,a.offsetTop)};
goog.style.getClientViewportElement=function(a){a=a?a.nodeType==goog.dom.NodeType.DOCUMENT?a:goog.dom.getOwnerDocument(a):goog.dom.getDocument();if(goog.userAgent.IE&&!goog.userAgent.isVersion(9)&&!goog.dom.getDomHelper(a).isCss1CompatMode())return a.body;return a.documentElement};goog.style.getBoundingClientRect_=function(a){var b=a.getBoundingClientRect();if(goog.userAgent.IE){a=a.ownerDocument;b.left-=a.documentElement.clientLeft+a.body.clientLeft;b.top-=a.documentElement.clientTop+a.body.clientTop}return b};
goog.style.getOffsetParent=function(a){if(goog.userAgent.IE)return a.offsetParent;var b=goog.dom.getOwnerDocument(a),c=goog.style.getStyle_(a,"position"),d=c=="fixed"||c=="absolute";for(a=a.parentNode;a&&a!=b;a=a.parentNode){c=goog.style.getStyle_(a,"position");d=d&&c=="static"&&a!=b.documentElement&&a!=b.body;if(!d&&(a.scrollWidth>a.clientWidth||a.scrollHeight>a.clientHeight||c=="fixed"||c=="absolute"))return a}return null};
goog.style.getVisibleRectForElement=function(a){var b=new goog.math.Box(0,Infinity,Infinity,0),c=goog.dom.getDomHelper(a),d=c.getDocument().body,e=c.getDocumentScrollElement(),f;for(a=a;a=goog.style.getOffsetParent(a);)if((!goog.userAgent.IE||a.clientWidth!=0)&&(!goog.userAgent.WEBKIT||a.clientHeight!=0||a!=d)&&(a.scrollWidth!=a.clientWidth||a.scrollHeight!=a.clientHeight)&&goog.style.getStyle_(a,"overflow")!="visible"){var g=goog.style.getPageOffset(a),h=goog.style.getClientLeftTop(a);g.x+=h.x;g.y+=
h.y;b.top=Math.max(b.top,g.y);b.right=Math.min(b.right,g.x+a.clientWidth);b.bottom=Math.min(b.bottom,g.y+a.clientHeight);b.left=Math.max(b.left,g.x);f=f||a!=e}d=e.scrollLeft;e=e.scrollTop;if(goog.userAgent.WEBKIT){b.left+=d;b.top+=e}else{b.left=Math.max(b.left,d);b.top=Math.max(b.top,e)}if(!f||goog.userAgent.WEBKIT){b.right+=d;b.bottom+=e}c=c.getViewportSize();b.right=Math.min(b.right,d+c.width);b.bottom=Math.min(b.bottom,e+c.height);return b.top>=0&&b.left>=0&&b.bottom>b.top&&b.right>b.left?b:null};
goog.style.scrollIntoContainerView=function(a,b,c){var d=goog.style.getPageOffset(a),e=goog.style.getPageOffset(b),f=goog.style.getBorderBox(b),g=d.x-e.x-f.left;d=d.y-e.y-f.top;e=b.clientWidth-a.offsetWidth;a=b.clientHeight-a.offsetHeight;if(c){b.scrollLeft+=g-e/2;b.scrollTop+=d-a/2}else{b.scrollLeft+=Math.min(g,Math.max(g-e,0));b.scrollTop+=Math.min(d,Math.max(d-a,0))}};
goog.style.getClientLeftTop=function(a){if(goog.userAgent.GECKO&&!goog.userAgent.isVersion("1.9")){var b=parseFloat(goog.style.getComputedStyle(a,"borderLeftWidth"));if(goog.style.isRightToLeft(a)){var c=a.offsetWidth-a.clientWidth-b-parseFloat(goog.style.getComputedStyle(a,"borderRightWidth"));b+=c}return new goog.math.Coordinate(b,parseFloat(goog.style.getComputedStyle(a,"borderTopWidth")))}return new goog.math.Coordinate(a.clientLeft,a.clientTop)};
goog.style.getPageOffset=function(a){var b,c=goog.dom.getOwnerDocument(a),d=goog.style.getStyle_(a,"position"),e=goog.userAgent.GECKO&&c.getBoxObjectFor&&!a.getBoundingClientRect&&d=="absolute"&&(b=c.getBoxObjectFor(a))&&(b.screenX<0||b.screenY<0),f=new goog.math.Coordinate(0,0),g=goog.style.getClientViewportElement(c);if(a==g)return f;if(a.getBoundingClientRect){b=goog.style.getBoundingClientRect_(a);a=goog.dom.getDomHelper(c).getDocumentScroll();f.x=b.left+a.x;f.y=b.top+a.y}else if(c.getBoxObjectFor&&
!e){b=c.getBoxObjectFor(a);a=c.getBoxObjectFor(g);f.x=b.screenX-a.screenX;f.y=b.screenY-a.screenY}else{b=a;do{f.x+=b.offsetLeft;f.y+=b.offsetTop;if(b!=a){f.x+=b.clientLeft||0;f.y+=b.clientTop||0}if(goog.userAgent.WEBKIT&&goog.style.getComputedPosition(b)=="fixed"){f.x+=c.body.scrollLeft;f.y+=c.body.scrollTop;break}b=b.offsetParent}while(b&&b!=a);if(goog.userAgent.OPERA||goog.userAgent.WEBKIT&&d=="absolute")f.y-=c.body.offsetTop;for(b=a;(b=goog.style.getOffsetParent(b))&&b!=c.body&&b!=g;){f.x-=b.scrollLeft;
if(!goog.userAgent.OPERA||b.tagName!="TR")f.y-=b.scrollTop}}return f};goog.style.getPageOffsetLeft=function(a){return goog.style.getPageOffset(a).x};goog.style.getPageOffsetTop=function(a){return goog.style.getPageOffset(a).y};
goog.style.getFramedPageOffset=function(a,b){var c=new goog.math.Coordinate(0,0),d=goog.dom.getWindow(goog.dom.getOwnerDocument(a)),e=a;do{var f=d==b?goog.style.getPageOffset(e):goog.style.getClientPosition(e);c.x+=f.x;c.y+=f.y}while(d&&d!=b&&(e=d.frameElement)&&(d=d.parent));return c};
goog.style.translateRectForAnotherFrame=function(a,b,c){if(b.getDocument()!=c.getDocument()){var d=b.getDocument().body;c=goog.style.getFramedPageOffset(d,c.getWindow());c=goog.math.Coordinate.difference(c,goog.style.getPageOffset(d));if(goog.userAgent.IE&&!b.isCss1CompatMode())c=goog.math.Coordinate.difference(c,b.getDocumentScroll());a.left+=c.x;a.top+=c.y}};
goog.style.getRelativePosition=function(a,b){var c=goog.style.getClientPosition(a),d=goog.style.getClientPosition(b);return new goog.math.Coordinate(c.x-d.x,c.y-d.y)};
goog.style.getClientPosition=function(a){var b=new goog.math.Coordinate;if(a.nodeType==goog.dom.NodeType.ELEMENT)if(a.getBoundingClientRect){a=goog.style.getBoundingClientRect_(a);b.x=a.left;b.y=a.top}else{var c=goog.dom.getDomHelper(a).getDocumentScroll();a=goog.style.getPageOffset(a);b.x=a.x-c.x;b.y=a.y-c.y}else{c=goog.isFunction(a.getBrowserEvent);var d=a;if(a.targetTouches)d=a.targetTouches[0];else if(c&&a.getBrowserEvent().targetTouches)d=a.getBrowserEvent().targetTouches[0];b.x=d.clientX;b.y=
d.clientY}return b};goog.style.setPageOffset=function(a,b,c){var d=goog.style.getPageOffset(a);if(b instanceof goog.math.Coordinate){c=b.y;b=b.x}goog.style.setPosition(a,a.offsetLeft+(b-d.x),a.offsetTop+(c-d.y))};goog.style.setSize=function(a,b,c){if(b instanceof goog.math.Size){c=b.height;b=b.width}else{if(c==undefined)throw Error("missing height argument");c=c}goog.style.setWidth(a,b);goog.style.setHeight(a,c)};
goog.style.getPixelStyleValue_=function(a,b){if(typeof a=="number")a=(b?Math.round(a):a)+"px";return a};goog.style.setHeight=function(a,b){a.style.height=goog.style.getPixelStyleValue_(b,true)};goog.style.setWidth=function(a,b){a.style.width=goog.style.getPixelStyleValue_(b,true)};
goog.style.getSize=function(a){if(goog.style.getStyle_(a,"display")!="none")return new goog.math.Size(a.offsetWidth,a.offsetHeight);var b=a.style,c=b.display,d=b.visibility,e=b.position;b.visibility="hidden";b.position="absolute";b.display="inline";var f=a.offsetWidth;a=a.offsetHeight;b.display=c;b.position=e;b.visibility=d;return new goog.math.Size(f,a)};goog.style.getBounds=function(a){var b=goog.style.getPageOffset(a);a=goog.style.getSize(a);return new goog.math.Rect(b.x,b.y,a.width,a.height)};
goog.style.toCamelCase=function(a){return goog.string.toCamelCase(String(a))};goog.style.toSelectorCase=function(a){return goog.string.toSelectorCase(a)};goog.style.getOpacity=function(a){var b=a.style;a="";if("opacity"in b)a=b.opacity;else if("MozOpacity"in b)a=b.MozOpacity;else if("filter"in b)if(b=b.filter.match(/alpha\(opacity=([\d.]+)\)/))a=String(b[1]/100);return a==""?a:Number(a)};
goog.style.setOpacity=function(a,b){var c=a.style;if("opacity"in c)c.opacity=b;else if("MozOpacity"in c)c.MozOpacity=b;else if("filter"in c)c.filter=b===""?"":"alpha(opacity="+b*100+")"};goog.style.setTransparentBackgroundImage=function(a,b){var c=a.style;if(goog.userAgent.IE&&!goog.userAgent.isVersion("8"))c.filter='progid:DXImageTransform.Microsoft.AlphaImageLoader(src="'+b+'", sizingMethod="crop")';else{c.backgroundImage="url("+b+")";c.backgroundPosition="top left";c.backgroundRepeat="no-repeat"}};
goog.style.clearTransparentBackgroundImage=function(a){a=a.style;if("filter"in a)a.filter="";else a.backgroundImage="none"};goog.style.showElement=function(a,b){a.style.display=b?"":"none"};goog.style.isElementShown=function(a){return a.style.display!="none"};
goog.style.installStyles=function(a,b){var c=goog.dom.getDomHelper(b),d=null;if(goog.userAgent.IE){d=c.getDocument().createStyleSheet();goog.style.setStyles(d,a)}else{var e=c.getElementsByTagNameAndClass("head")[0];if(!e){d=c.getElementsByTagNameAndClass("body")[0];e=c.createDom("head");d.parentNode.insertBefore(e,d)}d=c.createDom("style");goog.style.setStyles(d,a);c.appendChild(e,d)}return d};goog.style.uninstallStyles=function(a){goog.dom.removeNode(a.ownerNode||a.owningElement||a)};
goog.style.setStyles=function(a,b){if(goog.userAgent.IE)a.cssText=b;else a[goog.userAgent.WEBKIT?"innerText":"innerHTML"]=b};goog.style.setPreWrap=function(a){a=a.style;if(goog.userAgent.IE&&!goog.userAgent.isVersion("8")){a.whiteSpace="pre";a.wordWrap="break-word"}else a.whiteSpace=goog.userAgent.GECKO?"-moz-pre-wrap":"pre-wrap"};
goog.style.setInlineBlock=function(a){a=a.style;a.position="relative";if(goog.userAgent.IE&&!goog.userAgent.isVersion("8")){a.zoom="1";a.display="inline"}else a.display=goog.userAgent.GECKO?goog.userAgent.isVersion("1.9a")?"inline-block":"-moz-inline-box":"inline-block"};goog.style.isRightToLeft=function(a){return"rtl"==goog.style.getStyle_(a,"direction")};goog.style.unselectableStyle_=goog.userAgent.GECKO?"MozUserSelect":goog.userAgent.WEBKIT?"WebkitUserSelect":null;
goog.style.isUnselectable=function(a){if(goog.style.unselectableStyle_)return a.style[goog.style.unselectableStyle_].toLowerCase()=="none";else if(goog.userAgent.IE||goog.userAgent.OPERA)return a.getAttribute("unselectable")=="on";return false};
goog.style.setUnselectable=function(a,b,c){c=!c?a.getElementsByTagName("*"):null;var d=goog.style.unselectableStyle_;if(d){b=b?"none":"";a.style[d]=b;if(c){a=0;for(var e;e=c[a];a++)e.style[d]=b}}else if(goog.userAgent.IE||goog.userAgent.OPERA){b=b?"on":"";a.setAttribute("unselectable",b);if(c)for(a=0;e=c[a];a++)e.setAttribute("unselectable",b)}};goog.style.getBorderBoxSize=function(a){return new goog.math.Size(a.offsetWidth,a.offsetHeight)};
goog.style.setBorderBoxSize=function(a,b){var c=goog.dom.getOwnerDocument(a),d=goog.dom.getDomHelper(c).isCss1CompatMode();if(goog.userAgent.IE&&(!d||!goog.userAgent.isVersion("8"))){c=a.style;if(d){d=goog.style.getPaddingBox(a);var e=goog.style.getBorderBox(a);c.pixelWidth=b.width-e.left-d.left-d.right-e.right;c.pixelHeight=b.height-e.top-d.top-d.bottom-e.bottom}else{c.pixelWidth=b.width;c.pixelHeight=b.height}}else goog.style.setBoxSizingSize_(a,b,"border-box")};
goog.style.getContentBoxSize=function(a){var b=goog.dom.getOwnerDocument(a),c=goog.userAgent.IE&&a.currentStyle;if(c&&goog.dom.getDomHelper(b).isCss1CompatMode()&&c.width!="auto"&&c.height!="auto"&&!c.boxSizing){b=goog.style.getIePixelValue_(a,c.width,"width","pixelWidth");a=goog.style.getIePixelValue_(a,c.height,"height","pixelHeight");return new goog.math.Size(b,a)}else{c=goog.style.getBorderBoxSize(a);b=goog.style.getPaddingBox(a);a=goog.style.getBorderBox(a);return new goog.math.Size(c.width-
a.left-b.left-b.right-a.right,c.height-a.top-b.top-b.bottom-a.bottom)}};
goog.style.setContentBoxSize=function(a,b){var c=goog.dom.getOwnerDocument(a),d=goog.dom.getDomHelper(c).isCss1CompatMode();if(goog.userAgent.IE&&(!d||!goog.userAgent.isVersion("8"))){c=a.style;if(d){c.pixelWidth=b.width;c.pixelHeight=b.height}else{d=goog.style.getPaddingBox(a);var e=goog.style.getBorderBox(a);c.pixelWidth=b.width+e.left+d.left+d.right+e.right;c.pixelHeight=b.height+e.top+d.top+d.bottom+e.bottom}}else goog.style.setBoxSizingSize_(a,b,"content-box")};
goog.style.setBoxSizingSize_=function(a,b,c){a=a.style;if(goog.userAgent.GECKO)a.MozBoxSizing=c;else if(goog.userAgent.WEBKIT)a.WebkitBoxSizing=c;else a.boxSizing=c;a.width=b.width+"px";a.height=b.height+"px"};goog.style.getIePixelValue_=function(a,b,c,d){if(/^\d+px?$/.test(b))return parseInt(b,10);else{var e=a.style[c],f=a.runtimeStyle[c];a.runtimeStyle[c]=a.currentStyle[c];a.style[c]=b;b=a.style[d];a.style[c]=e;a.runtimeStyle[c]=f;return b}};
goog.style.getIePixelDistance_=function(a,b){return goog.style.getIePixelValue_(a,goog.style.getCascadedStyle(a,b),"left","pixelLeft")};
goog.style.getBox_=function(a,b){if(goog.userAgent.IE){var c=goog.style.getIePixelDistance_(a,b+"Left"),d=goog.style.getIePixelDistance_(a,b+"Right"),e=goog.style.getIePixelDistance_(a,b+"Top"),f=goog.style.getIePixelDistance_(a,b+"Bottom");return new goog.math.Box(e,d,f,c)}else{c=goog.style.getComputedStyle(a,b+"Left");d=goog.style.getComputedStyle(a,b+"Right");e=goog.style.getComputedStyle(a,b+"Top");f=goog.style.getComputedStyle(a,b+"Bottom");return new goog.math.Box(parseFloat(e),parseFloat(d),
parseFloat(f),parseFloat(c))}};goog.style.getPaddingBox=function(a){return goog.style.getBox_(a,"padding")};goog.style.getMarginBox=function(a){return goog.style.getBox_(a,"margin")};goog.style.ieBorderWidthKeywords_={thin:2,medium:4,thick:6};
goog.style.getIePixelBorder_=function(a,b){if(goog.style.getCascadedStyle(a,b+"Style")=="none")return 0;var c=goog.style.getCascadedStyle(a,b+"Width");if(c in goog.style.ieBorderWidthKeywords_)return goog.style.ieBorderWidthKeywords_[c];return goog.style.getIePixelValue_(a,c,"left","pixelLeft")};
goog.style.getBorderBox=function(a){if(goog.userAgent.IE){var b=goog.style.getIePixelBorder_(a,"borderLeft"),c=goog.style.getIePixelBorder_(a,"borderRight"),d=goog.style.getIePixelBorder_(a,"borderTop");a=goog.style.getIePixelBorder_(a,"borderBottom");return new goog.math.Box(d,c,a,b)}else{b=goog.style.getComputedStyle(a,"borderLeftWidth");c=goog.style.getComputedStyle(a,"borderRightWidth");d=goog.style.getComputedStyle(a,"borderTopWidth");a=goog.style.getComputedStyle(a,"borderBottomWidth");return new goog.math.Box(parseFloat(d),
parseFloat(c),parseFloat(a),parseFloat(b))}};goog.style.getFontFamily=function(a){var b=goog.dom.getOwnerDocument(a),c="";if(b.body.createTextRange){b=b.body.createTextRange();b.moveToElementText(a);try{c=b.queryCommandValue("FontName")}catch(d){c=""}}c||(c=goog.style.getStyle_(a,"fontFamily"));a=c.split(",");if(a.length>1)c=a[0];return goog.string.stripQuotes(c,"\"'")};goog.style.lengthUnitRegex_=/[^\d]+$/;
goog.style.getLengthUnits=function(a){return(a=a.match(goog.style.lengthUnitRegex_))&&a[0]||null};goog.style.ABSOLUTE_CSS_LENGTH_UNITS_={cm:1,"in":1,mm:1,pc:1,pt:1};goog.style.CONVERTIBLE_RELATIVE_CSS_UNITS_={em:1,ex:1};
goog.style.getFontSize=function(a){var b=goog.style.getStyle_(a,"fontSize"),c=goog.style.getLengthUnits(b);if(b&&"px"==c)return parseInt(b,10);if(goog.userAgent.IE)if(c in goog.style.ABSOLUTE_CSS_LENGTH_UNITS_)return goog.style.getIePixelValue_(a,b,"left","pixelLeft");else if(a.parentNode&&a.parentNode.nodeType==goog.dom.NodeType.ELEMENT&&c in goog.style.CONVERTIBLE_RELATIVE_CSS_UNITS_){a=a.parentNode;c=goog.style.getStyle_(a,"fontSize");return goog.style.getIePixelValue_(a,b==c?"1em":b,"left","pixelLeft")}c=
goog.dom.createDom("span",{style:"visibility:hidden;position:absolute;line-height:0;padding:0;margin:0;border:0;height:1em;"});goog.dom.appendChild(a,c);b=c.offsetHeight;goog.dom.removeNode(c);return b};goog.style.parseStyleAttribute=function(a){var b={};goog.array.forEach(a.split(/\s*;\s*/),function(c){c=c.split(/\s*:\s*/);if(c.length==2)b[goog.string.toCamelCase(c[0].toLowerCase())]=c[1]});return b};
goog.style.toStyleAttribute=function(a){var b=[];goog.object.forEach(a,function(c,d){b.push(goog.string.toSelectorCase(d),":",c,";")});return b.join("")};goog.style.setFloat=function(a,b){a.style[goog.userAgent.IE?"styleFloat":"cssFloat"]=b};goog.style.getFloat=function(a){return a.style[goog.userAgent.IE?"styleFloat":"cssFloat"]||""};
goog.style.getScrollbarWidth=function(){var a=goog.dom.createElement("div");a.style.cssText="visibility:hidden;overflow:scroll;position:absolute;top:0;width:100px;height:100px";goog.dom.appendChild(goog.dom.getDocument().body,a);var b=a.offsetWidth-a.clientWidth;goog.dom.removeNode(a);return b};goog.ui.IdGenerator=function(){};goog.addSingletonGetter(goog.ui.IdGenerator);goog.ui.IdGenerator.prototype.nextId_=0;goog.ui.IdGenerator.prototype.getNextUniqueId=function(){return":"+(this.nextId_++).toString(36)};
goog.ui.IdGenerator.instance=goog.ui.IdGenerator.getInstance();
goog.ui.AutoComplete.Renderer=function(a,b,c,d){this.parent_=a||goog.dom.getDocument().body;this.dom_=goog.dom.getDomHelper(this.parent_);this.reposition_=!a;this.element_=null;this.token_="";this.rows_=[];this.startRenderingRows_=this.hilitedRow_=-1;this.visible_=false;this.className="ac-renderer";this.rowClassName="ac-row";this.legacyActiveClassName_="active";this.activeClassName="ac-active";this.highlightedClassName="ac-highlighted";this.customRenderer_=b||null;this.useStandardHighlighting_=d!=
null?d:true;this.highlightAllTokens_=false;this.rightAlign_=c!=null?c:false;this.keepAligned_=null;this.topAlign_=false};goog.inherits(goog.ui.AutoComplete.Renderer,goog.events.EventTarget);goog.ui.AutoComplete.Renderer.DELAY_BEFORE_MOUSEOVER=300;goog.ui.AutoComplete.Renderer.prototype.getElement=function(){return this.element_};goog.ui.AutoComplete.Renderer.prototype.setTopAlign=function(a){this.topAlign_=a};
goog.ui.AutoComplete.Renderer.prototype.setUseStandardHighlighting=function(a){this.useStandardHighlighting_=a};goog.ui.AutoComplete.Renderer.prototype.setHighlightAllTokens=function(a){this.highlightAllTokens_=a};goog.ui.AutoComplete.Renderer.prototype.renderRows=function(a,b,c){this.token_=b;this.rows_=a;this.hilitedRow_=-1;this.startRenderingRows_=goog.now();this.target_=c;this.rowDivs_=[];this.redraw()};
goog.ui.AutoComplete.Renderer.prototype.dismiss=function(){this.target_&&goog.dom.a11y.setActiveDescendant(this.target_,null);if(this.visible_){this.visible_=false;goog.style.showElement(this.element_,false)}};goog.ui.AutoComplete.Renderer.prototype.show=function(){if(!this.visible_){this.visible_=true;goog.style.showElement(this.element_,true)}};goog.ui.AutoComplete.Renderer.prototype.isVisible=function(){return this.visible_};
goog.ui.AutoComplete.Renderer.prototype.hiliteRow=function(a){this.hiliteNone();this.hilitedRow_=a;if(a>=0&&a<this.element_.childNodes.length){a=this.rowDivs_[a];goog.dom.classes.add(a,this.activeClassName,this.legacyActiveClassName_);this.target_&&goog.dom.a11y.setActiveDescendant(this.target_,a);goog.style.scrollIntoContainerView(a,this.element_)}};
goog.ui.AutoComplete.Renderer.prototype.hiliteNone=function(){this.hilitedRow_>=0&&goog.dom.classes.remove(this.rowDivs_[this.hilitedRow_],this.activeClassName,this.legacyActiveClassName_)};goog.ui.AutoComplete.Renderer.prototype.hiliteId=function(a){if(a==-1)this.hiliteRow(-1);else for(var b=0;b<this.rows_.length;b++)if(this.rows_[b].id==a){this.hiliteRow(b);return}};goog.ui.AutoComplete.Renderer.prototype.setMenuClasses_=function(a){goog.dom.classes.add(a,this.className)};
goog.ui.AutoComplete.Renderer.prototype.maybeCreateElement_=function(){if(!this.element_){var a=this.dom_.createDom("div",{style:"display:none"});this.element_=a;this.setMenuClasses_(a);goog.dom.a11y.setRole(a,goog.dom.a11y.Role.LISTBOX);a.id=goog.ui.IdGenerator.getInstance().getNextUniqueId();if(this.target_){goog.dom.a11y.setRole(this.target_,goog.dom.a11y.Role.COMBOBOX);goog.dom.a11y.setState(this.target_,goog.dom.a11y.State.AUTOCOMPLETE,"list");goog.dom.a11y.setState(this.target_,goog.dom.a11y.State.HASPOPUP,
true)}this.dom_.appendChild(this.parent_,a);goog.events.listen(a,goog.events.EventType.CLICK,this.handleClick_,false,this);goog.events.listen(a,goog.events.EventType.MOUSEDOWN,this.handleMouseDown_,false,this);goog.events.listen(this.dom_.getDocument(),goog.events.EventType.MOUSEDOWN,this.handleDocumentMousedown_,false,this);goog.events.listen(a,goog.events.EventType.MOUSEOVER,this.handleMouseOver_,false,this)}};
goog.ui.AutoComplete.Renderer.prototype.redraw=function(){this.maybeCreateElement_();if(this.topAlign_)this.element_.style.visibility="hidden";this.rowDivs_.length=0;this.dom_.removeChildren(this.element_);if(this.customRenderer_&&this.customRenderer_.render)this.customRenderer_.render(this,this.element_,this.rows_,this.token_);else{var a=null;goog.iter.forEach(this.rows_,function(b){b=this.renderRowHtml(b,this.token_);this.topAlign_?this.element_.insertBefore(b,a):this.dom_.appendChild(this.element_,
b);a=b},this)}if(this.rows_.length==0)this.dismiss();else{this.show();this.preventMacScrollbarResurface_(this.element_);this.reposition();goog.style.setUnselectable(this.element_,true)}};
goog.ui.AutoComplete.Renderer.prototype.reposition=function(){if(this.target_&&this.reposition_){var a=goog.style.getPageOffset(this.target_),b=goog.style.getSize(this.target_),c=goog.style.getSize(goog.style.getClientViewportElement(this.target_)),d=goog.style.getSize(this.element_);a.y=this.topAlign_?a.y-d.height:a.y+b.height;if((this.rightAlign_||a.x+d.width>c.width)&&this.keepAligned_!="LEFT"){a.x=a.x+b.width-d.width;this.keepAligned_="RIGHT"}else this.keepAligned_="LEFT";goog.style.setPageOffset(this.element_,
a);if(this.topAlign_)this.element_.style.visibility="visible"}};goog.ui.AutoComplete.Renderer.prototype.setAutoPosition=function(a){this.reposition_=a};
goog.ui.AutoComplete.Renderer.prototype.disposeInternal=function(){goog.ui.AutoComplete.Renderer.superClass_.disposeInternal.call(this);if(this.element_){goog.events.unlisten(this.element_,goog.events.EventType.CLICK,this.handleClick_,false,this);goog.events.unlisten(this.element_,goog.events.EventType.MOUSEDOWN,this.handleMouseDown_,false,this);goog.events.unlisten(this.dom_.getDocument(),goog.events.EventType.MOUSEDOWN,this.handleDocumentMousedown_,false,this);goog.events.unlisten(this.element_,
goog.events.EventType.MOUSEOVER,this.handleMouseOver_,false,this);this.dom_.removeNode(this.element_);this.element_=null;this.visible_=false}delete this.parent_};goog.ui.AutoComplete.Renderer.prototype.preventMacScrollbarResurface_=function(a){if(goog.userAgent.GECKO&&goog.userAgent.MAC){a.style.width="";a.style.overflow="visible";a.style.width=a.offsetWidth;a.style.overflow="auto"}};goog.ui.AutoComplete.Renderer.prototype.renderRowContents_=function(a,b,c){c.innerHTML=goog.string.htmlEscape(a.data.toString())};
goog.ui.AutoComplete.Renderer.prototype.hiliteMatchingText_=function(a,b){if(a.nodeType==goog.dom.NodeType.TEXT){var c=null;if(goog.isArray(b)&&b.length>1&&!this.highlightAllTokens_)c=goog.array.slice(b,1);var d=this.getTokenRegExp_(b);if(d.length!=0){var e=a.nodeValue,f=new RegExp("(.*?)(^|\\W+)("+d+")","gi");d=[];for(var g=0,h=f.exec(e),k=0;h;){k++;d.push(h[1]);d.push(h[2]);d.push(h[3]);g=f.lastIndex;h=f.exec(e)}d.push(e.substring(g));if(d.length>1){c=!this.highlightAllTokens_?1:k;for(e=0;e<c;e++){f=
3*e;a.nodeValue=d[f]+d[f+1];g=this.dom_.createElement("b");g.className=this.highlightedClassName;this.dom_.appendChild(g,this.dom_.createTextNode(d[f+2]));g=a.parentNode.insertBefore(g,a.nextSibling);a.parentNode.insertBefore(this.dom_.createTextNode(""),g.nextSibling);a=g.nextSibling}d=goog.array.slice(d,c*3);a.nodeValue=d.join("")}else c&&this.hiliteMatchingText_(a,c)}}else for(d=a.firstChild;d;){c=d.nextSibling;this.hiliteMatchingText_(d,b);d=c}};
goog.ui.AutoComplete.Renderer.prototype.getTokenRegExp_=function(a){var b="";if(!a)return b;if(this.highlightAllTokens_)if(goog.isArray(a)){a=goog.array.filter(a,function(c){return!goog.string.isEmptySafe(c)});a=goog.array.map(a,goog.string.regExpEscape);b=a.join("|")}else{b=goog.string.collapseWhitespace(a);b=goog.string.regExpEscape(b);b=b.replace(/ /g,"|")}else b=goog.isArray(a)?a.length>0?goog.string.regExpEscape(a[0]):"":goog.string.regExpEscape(a);return b};
goog.ui.AutoComplete.Renderer.prototype.renderRowHtml=function(a,b){var c=this.dom_.createDom("div",{className:this.rowClassName,id:goog.ui.IdGenerator.getInstance().getNextUniqueId()});goog.dom.a11y.setRole(c,goog.dom.a11y.Role.OPTION);this.customRenderer_&&this.customRenderer_.renderRow?this.customRenderer_.renderRow(a,b,c):this.renderRowContents_(a,b,c);b&&this.useStandardHighlighting_&&this.hiliteMatchingText_(c,b);goog.dom.classes.add(c,this.rowClassName);this.rowDivs_.push(c);return c};
goog.ui.AutoComplete.Renderer.prototype.getRowFromEventTarget_=function(a){for(;a&&a!=this.element_&&!goog.dom.classes.has(a,this.rowClassName);)a=a.parentNode;return a?goog.array.indexOf(this.rowDivs_,a):-1};goog.ui.AutoComplete.Renderer.prototype.handleClick_=function(a){var b=this.getRowFromEventTarget_(a.target);b>=0&&this.dispatchEvent({type:goog.ui.AutoComplete.EventType.SELECT,row:this.rows_[b].id});a.stopPropagation()};
goog.ui.AutoComplete.Renderer.prototype.handleMouseDown_=function(a){this.dispatchEvent(goog.ui.AutoComplete.EventType.CANCEL_DISMISS);a.stopPropagation();a.preventDefault()};goog.ui.AutoComplete.Renderer.prototype.handleDocumentMousedown_=function(){this.dispatchEvent(goog.ui.AutoComplete.EventType.DISMISS)};
goog.ui.AutoComplete.Renderer.prototype.handleMouseOver_=function(a){a=this.getRowFromEventTarget_(a.target);if(a>=0)goog.now()-this.startRenderingRows_<goog.ui.AutoComplete.Renderer.DELAY_BEFORE_MOUSEOVER||this.dispatchEvent({type:goog.ui.AutoComplete.EventType.HILITE,row:this.rows_[a].id})};goog.ui.AutoComplete.Renderer.CustomRenderer=function(){};goog.ui.AutoComplete.Renderer.CustomRenderer.prototype.render=function(){};goog.ui.AutoComplete.Renderer.CustomRenderer.prototype.renderRow=function(){};
goog.ui.AutoComplete.Basic=function(a,b,c,d){a=new goog.ui.AutoComplete.ArrayMatcher(a,!d);d=new goog.ui.AutoComplete.Renderer;c=new goog.ui.AutoComplete.InputHandler(null,null,!!c);goog.ui.AutoComplete.call(this,a,d,c);c.attachAutoComplete(this);c.attachInputs(b)};goog.inherits(goog.ui.AutoComplete.Basic,goog.ui.AutoComplete);goog.structs.getCount=function(a){if(typeof a.getCount=="function")return a.getCount();if(goog.isArrayLike(a)||goog.isString(a))return a.length;return goog.object.getCount(a)};
goog.structs.getValues=function(a){if(typeof a.getValues=="function")return a.getValues();if(goog.isString(a))return a.split("");if(goog.isArrayLike(a)){for(var b=[],c=a.length,d=0;d<c;d++)b.push(a[d]);return b}return goog.object.getValues(a)};goog.structs.getKeys=function(a){if(typeof a.getKeys=="function")return a.getKeys();if(typeof a.getValues!="function"){if(goog.isArrayLike(a)||goog.isString(a)){var b=[];a=a.length;for(var c=0;c<a;c++)b.push(c);return b}return goog.object.getKeys(a)}};
goog.structs.contains=function(a,b){if(typeof a.contains=="function")return a.contains(b);if(typeof a.containsValue=="function")return a.containsValue(b);if(goog.isArrayLike(a)||goog.isString(a))return goog.array.contains(a,b);return goog.object.containsValue(a,b)};goog.structs.isEmpty=function(a){if(typeof a.isEmpty=="function")return a.isEmpty();if(goog.isArrayLike(a)||goog.isString(a))return goog.array.isEmpty(a);return goog.object.isEmpty(a)};
goog.structs.clear=function(a){if(typeof a.clear=="function")a.clear();else goog.isArrayLike(a)?goog.array.clear(a):goog.object.clear(a)};goog.structs.forEach=function(a,b,c){if(typeof a.forEach=="function")a.forEach(b,c);else if(goog.isArrayLike(a)||goog.isString(a))goog.array.forEach(a,b,c);else for(var d=goog.structs.getKeys(a),e=goog.structs.getValues(a),f=e.length,g=0;g<f;g++)b.call(c,e[g],d&&d[g],a)};
goog.structs.filter=function(a,b,c){if(typeof a.filter=="function")return a.filter(b,c);if(goog.isArrayLike(a)||goog.isString(a))return goog.array.filter(a,b,c);var d,e=goog.structs.getKeys(a),f=goog.structs.getValues(a),g=f.length;if(e){d={};for(var h=0;h<g;h++)if(b.call(c,f[h],e[h],a))d[e[h]]=f[h]}else{d=[];for(h=0;h<g;h++)b.call(c,f[h],undefined,a)&&d.push(f[h])}return d};
goog.structs.map=function(a,b,c){if(typeof a.map=="function")return a.map(b,c);if(goog.isArrayLike(a)||goog.isString(a))return goog.array.map(a,b,c);var d,e=goog.structs.getKeys(a),f=goog.structs.getValues(a),g=f.length;if(e){d={};for(var h=0;h<g;h++)d[e[h]]=b.call(c,f[h],e[h],a)}else{d=[];for(h=0;h<g;h++)d[h]=b.call(c,f[h],undefined,a)}return d};
goog.structs.some=function(a,b,c){if(typeof a.some=="function")return a.some(b,c);if(goog.isArrayLike(a)||goog.isString(a))return goog.array.some(a,b,c);for(var d=goog.structs.getKeys(a),e=goog.structs.getValues(a),f=e.length,g=0;g<f;g++)if(b.call(c,e[g],d&&d[g],a))return true;return false};
goog.structs.every=function(a,b,c){if(typeof a.every=="function")return a.every(b,c);if(goog.isArrayLike(a)||goog.isString(a))return goog.array.every(a,b,c);for(var d=goog.structs.getKeys(a),e=goog.structs.getValues(a),f=e.length,g=0;g<f;g++)if(!b.call(c,e[g],d&&d[g],a))return false;return true};goog.structs.Map=function(a){this.map_={};this.keys_=[];var b=arguments.length;if(b>1){if(b%2)throw Error("Uneven number of arguments");for(var c=0;c<b;c+=2)this.set(arguments[c],arguments[c+1])}else a&&this.addAll(a)};
goog.structs.Map.prototype.count_=0;goog.structs.Map.prototype.version_=0;goog.structs.Map.prototype.getCount=function(){return this.count_};goog.structs.Map.prototype.getValues=function(){this.cleanupKeysArray_();for(var a=[],b=0;b<this.keys_.length;b++)a.push(this.map_[this.keys_[b]]);return a};goog.structs.Map.prototype.getKeys=function(){this.cleanupKeysArray_();return this.keys_.concat()};goog.structs.Map.prototype.containsKey=function(a){return goog.structs.Map.hasKey_(this.map_,a)};
goog.structs.Map.prototype.containsValue=function(a){for(var b=0;b<this.keys_.length;b++){var c=this.keys_[b];if(goog.structs.Map.hasKey_(this.map_,c)&&this.map_[c]==a)return true}return false};goog.structs.Map.prototype.equals=function(a,b){if(this===a)return true;if(this.count_!=a.getCount())return false;var c=b||goog.structs.Map.defaultEquals;this.cleanupKeysArray_();for(var d,e=0;d=this.keys_[e];e++)if(!c(this.get(d),a.get(d)))return false;return true};
goog.structs.Map.defaultEquals=function(a,b){return a===b};goog.structs.Map.prototype.isEmpty=function(){return this.count_==0};goog.structs.Map.prototype.clear=function(){this.map_={};this.version_=this.count_=this.keys_.length=0};goog.structs.Map.prototype.remove=function(a){if(goog.structs.Map.hasKey_(this.map_,a)){delete this.map_[a];this.count_--;this.version_++;this.keys_.length>2*this.count_&&this.cleanupKeysArray_();return true}return false};
goog.structs.Map.prototype.cleanupKeysArray_=function(){if(this.count_!=this.keys_.length){for(var a=0,b=0;a<this.keys_.length;){var c=this.keys_[a];if(goog.structs.Map.hasKey_(this.map_,c))this.keys_[b++]=c;a++}this.keys_.length=b}if(this.count_!=this.keys_.length){var d={};for(b=a=0;a<this.keys_.length;){c=this.keys_[a];if(!goog.structs.Map.hasKey_(d,c)){this.keys_[b++]=c;d[c]=1}a++}this.keys_.length=b}};
goog.structs.Map.prototype.get=function(a,b){if(goog.structs.Map.hasKey_(this.map_,a))return this.map_[a];return b};goog.structs.Map.prototype.set=function(a,b){if(!goog.structs.Map.hasKey_(this.map_,a)){this.count_++;this.keys_.push(a);this.version_++}this.map_[a]=b};goog.structs.Map.prototype.addAll=function(a){var b;if(a instanceof goog.structs.Map){b=a.getKeys();a=a.getValues()}else{b=goog.object.getKeys(a);a=goog.object.getValues(a)}for(var c=0;c<b.length;c++)this.set(b[c],a[c])};
goog.structs.Map.prototype.clone=function(){return new goog.structs.Map(this)};goog.structs.Map.prototype.transpose=function(){for(var a=new goog.structs.Map,b=0;b<this.keys_.length;b++){var c=this.keys_[b];a.set(this.map_[c],c)}return a};goog.structs.Map.prototype.toObject=function(){this.cleanupKeysArray_();for(var a={},b=0;b<this.keys_.length;b++){var c=this.keys_[b];a[c]=this.map_[c]}return a};goog.structs.Map.prototype.getKeyIterator=function(){return this.__iterator__(true)};
goog.structs.Map.prototype.getValueIterator=function(){return this.__iterator__(false)};goog.structs.Map.prototype.__iterator__=function(a){this.cleanupKeysArray_();var b=0,c=this.keys_,d=this.map_,e=this.version_,f=this,g=new goog.iter.Iterator;g.next=function(){for(;;){if(e!=f.version_)throw Error("The map has changed since the iterator was created");if(b>=c.length)throw goog.iter.StopIteration;var h=c[b++];return a?h:d[h]}};return g};
goog.structs.Map.hasKey_=function(a,b){return Object.prototype.hasOwnProperty.call(a,b)};goog.uri={};goog.uri.utils={};goog.uri.utils.CharCode_={AMPERSAND:38,EQUAL:61,HASH:35,QUESTION:63};goog.uri.utils.buildFromEncodedParts=function(a,b,c,d,e,f,g){var h=[];a&&h.push(a,":");if(c){h.push("//");b&&h.push(b,"@");h.push(c);d&&h.push(":",d)}e&&h.push(e);f&&h.push("?",f);g&&h.push("#",g);return h.join("")};goog.uri.utils.splitRe_=new RegExp("^(?:([^:/?#.]+):)?(?://(?:([^/?#]*)@)?([\\w\\d\\-\\u0100-\\uffff.%]*)(?::([0-9]+))?)?([^?#]+)?(?:\\?([^#]*))?(?:#(.*))?$");
goog.uri.utils.ComponentIndex={SCHEME:1,USER_INFO:2,DOMAIN:3,PORT:4,PATH:5,QUERY_DATA:6,FRAGMENT:7};goog.uri.utils.split=function(a){return a.match(goog.uri.utils.splitRe_)};goog.uri.utils.decodeIfPossible_=function(a){return a&&decodeURIComponent(a)};goog.uri.utils.getComponentByIndex_=function(a,b){return goog.uri.utils.split(b)[a]||null};goog.uri.utils.getScheme=function(a){return goog.uri.utils.getComponentByIndex_(goog.uri.utils.ComponentIndex.SCHEME,a)};
goog.uri.utils.getUserInfoEncoded=function(a){return goog.uri.utils.getComponentByIndex_(goog.uri.utils.ComponentIndex.USER_INFO,a)};goog.uri.utils.getUserInfo=function(a){return goog.uri.utils.decodeIfPossible_(goog.uri.utils.getUserInfoEncoded(a))};goog.uri.utils.getDomainEncoded=function(a){return goog.uri.utils.getComponentByIndex_(goog.uri.utils.ComponentIndex.DOMAIN,a)};goog.uri.utils.getDomain=function(a){return goog.uri.utils.decodeIfPossible_(goog.uri.utils.getDomainEncoded(a))};
goog.uri.utils.getPort=function(a){return Number(goog.uri.utils.getComponentByIndex_(goog.uri.utils.ComponentIndex.PORT,a))||null};goog.uri.utils.getPathEncoded=function(a){return goog.uri.utils.getComponentByIndex_(goog.uri.utils.ComponentIndex.PATH,a)};goog.uri.utils.getPath=function(a){return goog.uri.utils.decodeIfPossible_(goog.uri.utils.getPathEncoded(a))};goog.uri.utils.getQueryData=function(a){return goog.uri.utils.getComponentByIndex_(goog.uri.utils.ComponentIndex.QUERY_DATA,a)};
goog.uri.utils.getFragmentEncoded=function(a){var b=a.indexOf("#");return b<0?null:a.substr(b+1)};goog.uri.utils.setFragmentEncoded=function(a,b){return goog.uri.utils.removeFragment(a)+(b?"#"+b:"")};goog.uri.utils.getFragment=function(a){return goog.uri.utils.decodeIfPossible_(goog.uri.utils.getFragmentEncoded(a))};
goog.uri.utils.getHost=function(a){a=goog.uri.utils.split(a);return goog.uri.utils.buildFromEncodedParts(a[goog.uri.utils.ComponentIndex.SCHEME],a[goog.uri.utils.ComponentIndex.USER_INFO],a[goog.uri.utils.ComponentIndex.DOMAIN],a[goog.uri.utils.ComponentIndex.PORT])};goog.uri.utils.getPathAndAfter=function(a){a=goog.uri.utils.split(a);return goog.uri.utils.buildFromEncodedParts(null,null,null,null,a[goog.uri.utils.ComponentIndex.PATH],a[goog.uri.utils.ComponentIndex.QUERY_DATA],a[goog.uri.utils.ComponentIndex.FRAGMENT])};
goog.uri.utils.removeFragment=function(a){var b=a.indexOf("#");return b<0?a:a.substr(0,b)};goog.uri.utils.haveSameDomain=function(a,b){var c=goog.uri.utils.split(a),d=goog.uri.utils.split(b);return c[goog.uri.utils.ComponentIndex.DOMAIN]==d[goog.uri.utils.ComponentIndex.DOMAIN]&&c[goog.uri.utils.ComponentIndex.SCHEME]==d[goog.uri.utils.ComponentIndex.SCHEME]&&c[goog.uri.utils.ComponentIndex.PORT]==d[goog.uri.utils.ComponentIndex.PORT]};
goog.uri.utils.assertNoFragmentsOrQueries_=function(a){if(goog.DEBUG&&(a.indexOf("#")>=0||a.indexOf("?")>=0))throw Error("goog.uri.utils: Fragment or query identifiers are not supported: ["+a+"]");};goog.uri.utils.appendQueryData_=function(a){if(a[1]){var b=a[0],c=b.indexOf("#");if(c>=0){a.push(b.substr(c));a[0]=b=b.substr(0,c)}c=b.indexOf("?");if(c<0)a[1]="?";else if(c==b.length-1)a[1]=undefined}return a.join("")};
goog.uri.utils.appendKeyValuePairs_=function(a,b,c){if(goog.isArray(b)){b=b;for(var d=0;d<b.length;d++){c.push("&",a);b[d]!==""&&c.push("=",goog.string.urlEncode(b[d]))}}else if(b!=null){c.push("&",a);b!==""&&c.push("=",goog.string.urlEncode(b))}};goog.uri.utils.buildQueryDataBuffer_=function(a,b,c){goog.asserts.assert(Math.max(b.length-(c||0),0)%2==0,"goog.uri.utils: Key/value lists must be even in length.");for(c=c||0;c<b.length;c+=2)goog.uri.utils.appendKeyValuePairs_(b[c],b[c+1],a);return a};
goog.uri.utils.buildQueryData=function(a,b){var c=goog.uri.utils.buildQueryDataBuffer_([],a,b);c[0]="";return c.join("")};goog.uri.utils.buildQueryDataBufferFromMap_=function(a,b){for(var c in b)goog.uri.utils.appendKeyValuePairs_(c,b[c],a);return a};goog.uri.utils.buildQueryDataFromMap=function(a){a=goog.uri.utils.buildQueryDataBufferFromMap_([],a);a[0]="";return a.join("")};
goog.uri.utils.appendParams=function(a){return goog.uri.utils.appendQueryData_(arguments.length==2?goog.uri.utils.buildQueryDataBuffer_([a],arguments[1],0):goog.uri.utils.buildQueryDataBuffer_([a],arguments,1))};goog.uri.utils.appendParamsFromMap=function(a,b){return goog.uri.utils.appendQueryData_(goog.uri.utils.buildQueryDataBufferFromMap_([a],b))};goog.uri.utils.appendParam=function(a,b,c){return goog.uri.utils.appendQueryData_([a,"&",b,"=",goog.string.urlEncode(c)])};
goog.uri.utils.findParam_=function(a,b,c,d){b=b;for(var e=c.length;(b=a.indexOf(c,b))>=0&&b<d;){var f=a.charCodeAt(b-1);if(f==goog.uri.utils.CharCode_.AMPERSAND||f==goog.uri.utils.CharCode_.QUESTION){f=a.charCodeAt(b+e);if(!f||f==goog.uri.utils.CharCode_.EQUAL||f==goog.uri.utils.CharCode_.AMPERSAND||f==goog.uri.utils.CharCode_.HASH)return b}b+=e+1}return-1};goog.uri.utils.hashOrEndRe_=/#|$/;
goog.uri.utils.hasParam=function(a,b){return goog.uri.utils.findParam_(a,0,b,a.search(goog.uri.utils.hashOrEndRe_))>=0};goog.uri.utils.getParamValue=function(a,b){var c=a.search(goog.uri.utils.hashOrEndRe_),d=goog.uri.utils.findParam_(a,0,b,c);if(d<0)return null;else{var e=a.indexOf("&",d);if(e<0||e>c)e=c;d+=b.length+1;return goog.string.urlDecode(a.substr(d,e-d))}};
goog.uri.utils.getParamValues=function(a,b){for(var c=a.search(goog.uri.utils.hashOrEndRe_),d=0,e,f=[];(e=goog.uri.utils.findParam_(a,d,b,c))>=0;){d=a.indexOf("&",e);if(d<0||d>c)d=c;e+=b.length+1;f.push(goog.string.urlDecode(a.substr(e,d-e)))}return f};goog.uri.utils.trailingQueryPunctuationRe_=/[?&]($|#)/;
goog.uri.utils.removeParam=function(a,b){for(var c=a.search(goog.uri.utils.hashOrEndRe_),d=0,e,f=[];(e=goog.uri.utils.findParam_(a,d,b,c))>=0;){f.push(a.substring(d,e));d=Math.min(a.indexOf("&",e)+1||c,c)}f.push(a.substr(d));return f.join("").replace(goog.uri.utils.trailingQueryPunctuationRe_,"$1")};goog.uri.utils.setParam=function(a,b,c){return goog.uri.utils.appendParam(goog.uri.utils.removeParam(a,b),b,c)};
goog.uri.utils.appendPath=function(a,b){goog.uri.utils.assertNoFragmentsOrQueries_(a);if(goog.string.endsWith(a,"/"))a=a.substr(0,a.length-1);if(goog.string.startsWith(b,"/"))b=b.substr(1);return goog.string.buildString(a,"/",b)};goog.uri.utils.StandardQueryParam={RANDOM:"zx"};goog.uri.utils.makeUnique=function(a){return goog.uri.utils.setParam(a,goog.uri.utils.StandardQueryParam.RANDOM,goog.string.getRandomString())};
goog.Uri=function(a,b){var c;if(a instanceof goog.Uri){this.setIgnoreCase(b==null?a.getIgnoreCase():b);this.setScheme(a.getScheme());this.setUserInfo(a.getUserInfo());this.setDomain(a.getDomain());this.setPort(a.getPort());this.setPath(a.getPath());this.setQueryData(a.getQueryData().clone());this.setFragment(a.getFragment())}else if(a&&(c=goog.uri.utils.split(String(a)))){this.setIgnoreCase(!!b);this.setScheme(c[goog.uri.utils.ComponentIndex.SCHEME]||"",true);this.setUserInfo(c[goog.uri.utils.ComponentIndex.USER_INFO]||
"",true);this.setDomain(c[goog.uri.utils.ComponentIndex.DOMAIN]||"",true);this.setPort(c[goog.uri.utils.ComponentIndex.PORT]);this.setPath(c[goog.uri.utils.ComponentIndex.PATH]||"",true);this.setQuery(c[goog.uri.utils.ComponentIndex.QUERY_DATA]||"",true);this.setFragment(c[goog.uri.utils.ComponentIndex.FRAGMENT]||"",true)}else{this.setIgnoreCase(!!b);this.queryData_=new goog.Uri.QueryData(null,this,this.ignoreCase_)}};goog.Uri.RANDOM_PARAM=goog.uri.utils.StandardQueryParam.RANDOM;
goog.Uri.prototype.scheme_="";goog.Uri.prototype.userInfo_="";goog.Uri.prototype.domain_="";goog.Uri.prototype.port_=null;goog.Uri.prototype.path_="";goog.Uri.prototype.fragment_="";goog.Uri.prototype.isReadOnly_=false;goog.Uri.prototype.ignoreCase_=false;
goog.Uri.prototype.toString=function(){if(this.cachedToString_)return this.cachedToString_;var a=[];this.scheme_&&a.push(goog.Uri.encodeSpecialChars_(this.scheme_,goog.Uri.reDisallowedInSchemeOrUserInfo_),":");if(this.domain_){a.push("//");this.userInfo_&&a.push(goog.Uri.encodeSpecialChars_(this.userInfo_,goog.Uri.reDisallowedInSchemeOrUserInfo_),"@");a.push(goog.Uri.encodeString_(this.domain_));this.port_!=null&&a.push(":",String(this.getPort()))}if(this.path_){this.hasDomain()&&this.path_.charAt(0)!=
"/"&&a.push("/");a.push(goog.Uri.encodeSpecialChars_(this.path_,goog.Uri.reDisallowedInPath_))}var b=String(this.queryData_);b&&a.push("?",b);this.fragment_&&a.push("#",goog.Uri.encodeSpecialChars_(this.fragment_,goog.Uri.reDisallowedInFragment_));return this.cachedToString_=a.join("")};
goog.Uri.prototype.resolve=function(a){var b=this.clone(),c=a.hasScheme();if(c)b.setScheme(a.getScheme());else c=a.hasUserInfo();if(c)b.setUserInfo(a.getUserInfo());else c=a.hasDomain();if(c)b.setDomain(a.getDomain());else c=a.hasPort();var d=a.getPath();if(c)b.setPort(a.getPort());else if(c=a.hasPath()){if(d.charAt(0)!="/")if(this.hasDomain()&&!this.hasPath())d="/"+d;else{var e=b.getPath().lastIndexOf("/");if(e!=-1)d=b.getPath().substr(0,e+1)+d}d=goog.Uri.removeDotSegments(d)}if(c)b.setPath(d);else c=
a.hasQuery();if(c)b.setQuery(a.getDecodedQuery());else c=a.hasFragment();c&&b.setFragment(a.getFragment());return b};goog.Uri.prototype.clone=function(){return goog.Uri.create(this.scheme_,this.userInfo_,this.domain_,this.port_,this.path_,this.queryData_.clone(),this.fragment_,this.ignoreCase_)};goog.Uri.prototype.getScheme=function(){return this.scheme_};
goog.Uri.prototype.setScheme=function(a,b){this.enforceReadOnly();delete this.cachedToString_;if(this.scheme_=b?goog.Uri.decodeOrEmpty_(a):a)this.scheme_=this.scheme_.replace(/:$/,"");return this};goog.Uri.prototype.hasScheme=function(){return!!this.scheme_};goog.Uri.prototype.getUserInfo=function(){return this.userInfo_};goog.Uri.prototype.setUserInfo=function(a,b){this.enforceReadOnly();delete this.cachedToString_;this.userInfo_=b?goog.Uri.decodeOrEmpty_(a):a;return this};
goog.Uri.prototype.hasUserInfo=function(){return!!this.userInfo_};goog.Uri.prototype.getDomain=function(){return this.domain_};goog.Uri.prototype.setDomain=function(a,b){this.enforceReadOnly();delete this.cachedToString_;this.domain_=b?goog.Uri.decodeOrEmpty_(a):a;return this};goog.Uri.prototype.hasDomain=function(){return!!this.domain_};goog.Uri.prototype.getPort=function(){return this.port_};
goog.Uri.prototype.setPort=function(a){this.enforceReadOnly();delete this.cachedToString_;if(a){a=Number(a);if(isNaN(a)||a<0)throw Error("Bad port number "+a);this.port_=a}else this.port_=null;return this};goog.Uri.prototype.hasPort=function(){return this.port_!=null};goog.Uri.prototype.getPath=function(){return this.path_};goog.Uri.prototype.setPath=function(a,b){this.enforceReadOnly();delete this.cachedToString_;this.path_=b?goog.Uri.decodeOrEmpty_(a):a;return this};goog.Uri.prototype.hasPath=function(){return!!this.path_};
goog.Uri.prototype.hasQuery=function(){return this.queryData_.toString()!==""};goog.Uri.prototype.setQueryData=function(a,b){this.enforceReadOnly();delete this.cachedToString_;if(a instanceof goog.Uri.QueryData){this.queryData_=a;this.queryData_.uri_=this;this.queryData_.setIgnoreCase(this.ignoreCase_)}else{b||(a=goog.Uri.encodeSpecialChars_(a,goog.Uri.reDisallowedInQuery_));this.queryData_=new goog.Uri.QueryData(a,this,this.ignoreCase_)}return this};
goog.Uri.prototype.setQuery=function(a,b){return this.setQueryData(a,b)};goog.Uri.prototype.getEncodedQuery=function(){return this.queryData_.toString()};goog.Uri.prototype.getDecodedQuery=function(){return this.queryData_.toDecodedString()};goog.Uri.prototype.getQueryData=function(){return this.queryData_};goog.Uri.prototype.getQuery=function(){return this.getEncodedQuery()};
goog.Uri.prototype.setParameterValue=function(a,b){this.enforceReadOnly();delete this.cachedToString_;this.queryData_.set(a,b);return this};goog.Uri.prototype.setParameterValues=function(a,b){this.enforceReadOnly();delete this.cachedToString_;goog.isArray(b)||(b=[String(b)]);this.queryData_.setValues(a,b);return this};goog.Uri.prototype.getParameterValues=function(a){return this.queryData_.getValues(a)};goog.Uri.prototype.getParameterValue=function(a){return this.queryData_.get(a)};
goog.Uri.prototype.getFragment=function(){return this.fragment_};goog.Uri.prototype.setFragment=function(a,b){this.enforceReadOnly();delete this.cachedToString_;this.fragment_=b?goog.Uri.decodeOrEmpty_(a):a;return this};goog.Uri.prototype.hasFragment=function(){return!!this.fragment_};goog.Uri.prototype.hasSameDomainAs=function(a){return(!this.hasDomain()&&!a.hasDomain()||this.getDomain()==a.getDomain())&&(!this.hasPort()&&!a.hasPort()||this.getPort()==a.getPort())};
goog.Uri.prototype.makeUnique=function(){this.enforceReadOnly();this.setParameterValue(goog.Uri.RANDOM_PARAM,goog.string.getRandomString());return this};goog.Uri.prototype.removeParameter=function(a){this.enforceReadOnly();this.queryData_.remove(a);return this};goog.Uri.prototype.setReadOnly=function(a){this.isReadOnly_=a;return this};goog.Uri.prototype.isReadOnly=function(){return this.isReadOnly_};
goog.Uri.prototype.enforceReadOnly=function(){if(this.isReadOnly_)throw Error("Tried to modify a read-only Uri");};goog.Uri.prototype.setIgnoreCase=function(a){this.ignoreCase_=a;this.queryData_&&this.queryData_.setIgnoreCase(a);return this};goog.Uri.prototype.getIgnoreCase=function(){return this.ignoreCase_};goog.Uri.parse=function(a,b){return a instanceof goog.Uri?a.clone():new goog.Uri(a,b)};
goog.Uri.create=function(a,b,c,d,e,f,g,h){h=new goog.Uri(null,h);a&&h.setScheme(a);b&&h.setUserInfo(b);c&&h.setDomain(c);d&&h.setPort(d);e&&h.setPath(e);f&&h.setQueryData(f);g&&h.setFragment(g);return h};goog.Uri.resolve=function(a,b){a instanceof goog.Uri||(a=goog.Uri.parse(a));b instanceof goog.Uri||(b=goog.Uri.parse(b));return a.resolve(b)};
goog.Uri.removeDotSegments=function(a){if(a==".."||a==".")return"";else if(!goog.string.contains(a,"./")&&!goog.string.contains(a,"/."))return a;else{var b=goog.string.startsWith(a,"/");a=a.split("/");for(var c=[],d=0;d<a.length;){var e=a[d++];if(e==".")b&&d==a.length&&c.push("");else if(e==".."){if(c.length>1||c.length==1&&c[0]!="")c.pop();b&&d==a.length&&c.push("")}else{c.push(e);b=true}}return c.join("/")}};goog.Uri.decodeOrEmpty_=function(a){return a?decodeURIComponent(a):""};
goog.Uri.encodeString_=function(a){if(goog.isString(a))return encodeURIComponent(a);return null};goog.Uri.encodeSpecialRegExp_=/^[a-zA-Z0-9\-_.!~*'():\/;?]*$/;goog.Uri.encodeSpecialChars_=function(a,b){var c=null;if(goog.isString(a)){c=a;goog.Uri.encodeSpecialRegExp_.test(c)||(c=encodeURI(a));if(c.search(b)>=0)c=c.replace(b,goog.Uri.encodeChar_)}return c};goog.Uri.encodeChar_=function(a){a=a.charCodeAt(0);return"%"+(a>>4&15).toString(16)+(a&15).toString(16)};
goog.Uri.reDisallowedInSchemeOrUserInfo_=/[#\/\?@]/g;goog.Uri.reDisallowedInPath_=/[\#\?]/g;goog.Uri.reDisallowedInQuery_=/[\#\?@]/g;goog.Uri.reDisallowedInFragment_=/#/g;goog.Uri.haveSameDomain=function(a,b){var c=goog.uri.utils.split(a),d=goog.uri.utils.split(b);return c[goog.uri.utils.ComponentIndex.DOMAIN]==d[goog.uri.utils.ComponentIndex.DOMAIN]&&c[goog.uri.utils.ComponentIndex.PORT]==d[goog.uri.utils.ComponentIndex.PORT]};
goog.Uri.QueryData=function(a,b,c){this.encodedQuery_=a||null;this.uri_=b||null;this.ignoreCase_=!!c};goog.Uri.QueryData.prototype.ensureKeyMapInitialized_=function(){if(!this.keyMap_){this.keyMap_=new goog.structs.Map;if(this.encodedQuery_)for(var a=this.encodedQuery_.split("&"),b=0;b<a.length;b++){var c=a[b].indexOf("="),d=null,e=null;if(c>=0){d=a[b].substring(0,c);e=a[b].substring(c+1)}else d=a[b];d=goog.string.urlDecode(d);d=this.getKeyName_(d);this.add(d,e?goog.string.urlDecode(e):"")}}};
goog.Uri.QueryData.createFromMap=function(a,b,c){var d=goog.structs.getKeys(a);if(typeof d=="undefined")throw Error("Keys are undefined");return goog.Uri.QueryData.createFromKeysValues(d,goog.structs.getValues(a),b,c)};goog.Uri.QueryData.createFromKeysValues=function(a,b,c,d){if(a.length!=b.length)throw Error("Mismatched lengths for keys/values");c=new goog.Uri.QueryData(null,c,d);for(d=0;d<a.length;d++)c.add(a[d],b[d]);return c};goog.Uri.QueryData.prototype.keyMap_=null;
goog.Uri.QueryData.prototype.count_=null;goog.Uri.QueryData.decodedQuery_=null;goog.Uri.QueryData.prototype.getCount=function(){this.ensureKeyMapInitialized_();return this.count_};goog.Uri.QueryData.prototype.add=function(a,b){this.ensureKeyMapInitialized_();this.invalidateCache_();a=this.getKeyName_(a);if(this.containsKey(a)){var c=this.keyMap_.get(a);goog.isArray(c)?c.push(b):this.keyMap_.set(a,[c,b])}else this.keyMap_.set(a,b);this.count_++;return this};
goog.Uri.QueryData.prototype.remove=function(a){this.ensureKeyMapInitialized_();a=this.getKeyName_(a);if(this.keyMap_.containsKey(a)){this.invalidateCache_();var b=this.keyMap_.get(a);if(goog.isArray(b))this.count_-=b.length;else this.count_--;return this.keyMap_.remove(a)}return false};goog.Uri.QueryData.prototype.clear=function(){this.invalidateCache_();this.keyMap_&&this.keyMap_.clear();this.count_=0};
goog.Uri.QueryData.prototype.isEmpty=function(){this.ensureKeyMapInitialized_();return this.count_==0};goog.Uri.QueryData.prototype.containsKey=function(a){this.ensureKeyMapInitialized_();a=this.getKeyName_(a);return this.keyMap_.containsKey(a)};goog.Uri.QueryData.prototype.containsValue=function(a){var b=this.getValues();return goog.array.contains(b,a)};
goog.Uri.QueryData.prototype.getKeys=function(){this.ensureKeyMapInitialized_();for(var a=this.keyMap_.getValues(),b=this.keyMap_.getKeys(),c=[],d=0;d<b.length;d++){var e=a[d];if(goog.isArray(e))for(var f=0;f<e.length;f++)c.push(b[d]);else c.push(b[d])}return c};
goog.Uri.QueryData.prototype.getValues=function(a){this.ensureKeyMapInitialized_();if(a){a=this.getKeyName_(a);if(this.containsKey(a)){var b=this.keyMap_.get(a);if(goog.isArray(b))return b;else{a=[];a.push(b)}}else a=[]}else{b=this.keyMap_.getValues();a=[];for(var c=0;c<b.length;c++){var d=b[c];goog.isArray(d)?goog.array.extend(a,d):a.push(d)}}return a};
goog.Uri.QueryData.prototype.set=function(a,b){this.ensureKeyMapInitialized_();this.invalidateCache_();a=this.getKeyName_(a);if(this.containsKey(a)){var c=this.keyMap_.get(a);if(goog.isArray(c))this.count_-=c.length;else this.count_--}this.keyMap_.set(a,b);this.count_++;return this};goog.Uri.QueryData.prototype.get=function(a,b){this.ensureKeyMapInitialized_();a=this.getKeyName_(a);if(this.containsKey(a)){var c=this.keyMap_.get(a);return goog.isArray(c)?c[0]:c}else return b};
goog.Uri.QueryData.prototype.setValues=function(a,b){this.ensureKeyMapInitialized_();this.invalidateCache_();a=this.getKeyName_(a);if(this.containsKey(a)){var c=this.keyMap_.get(a);if(goog.isArray(c))this.count_-=c.length;else this.count_--}if(b.length>0){this.keyMap_.set(a,b);this.count_+=b.length}};
goog.Uri.QueryData.prototype.toString=function(){if(this.encodedQuery_)return this.encodedQuery_;if(!this.keyMap_)return"";for(var a=[],b=0,c=this.keyMap_.getKeys(),d=0;d<c.length;d++){var e=c[d],f=goog.string.urlEncode(e);e=this.keyMap_.get(e);if(goog.isArray(e))for(var g=0;g<e.length;g++){b>0&&a.push("&");a.push(f);e[g]!==""&&a.push("=",goog.string.urlEncode(e[g]));b++}else{b>0&&a.push("&");a.push(f);e!==""&&a.push("=",goog.string.urlEncode(e));b++}}return this.encodedQuery_=a.join("")};
goog.Uri.QueryData.prototype.toDecodedString=function(){if(!this.decodedQuery_)this.decodedQuery_=goog.Uri.decodeOrEmpty_(this.toString());return this.decodedQuery_};goog.Uri.QueryData.prototype.invalidateCache_=function(){delete this.decodedQuery_;delete this.encodedQuery_;this.uri_&&delete this.uri_.cachedToString_};goog.Uri.QueryData.prototype.filterKeys=function(a){this.ensureKeyMapInitialized_();goog.structs.forEach(this.keyMap_,function(b,c){goog.array.contains(a,c)||this.remove(c)},this);return this};
goog.Uri.QueryData.prototype.clone=function(){var a=new goog.Uri.QueryData;if(this.decodedQuery_)a.decodedQuery_=this.decodedQuery_;if(this.encodedQuery_)a.encodedQuery_=this.encodedQuery_;if(this.keyMap_)a.keyMap_=this.keyMap_.clone();return a};goog.Uri.QueryData.prototype.getKeyName_=function(a){a=String(a);if(this.ignoreCase_)a=a.toLowerCase();return a};
goog.Uri.QueryData.prototype.setIgnoreCase=function(a){if(a&&!this.ignoreCase_){this.ensureKeyMapInitialized_();this.invalidateCache_();goog.structs.forEach(this.keyMap_,function(b,c){var d=c.toLowerCase();if(c!=d){this.remove(c);this.add(d,b)}},this)}this.ignoreCase_=a};goog.Uri.QueryData.prototype.extend=function(){for(var a=0;a<arguments.length;a++)goog.structs.forEach(arguments[a],function(b,c){this.add(c,b)},this)};goog.structs.Set=function(a){this.map_=new goog.structs.Map;a&&this.addAll(a)};
goog.structs.Set.getKey_=function(a){var b=typeof a;return b=="object"&&a||b=="function"?"o"+goog.getUid(a):b.substr(0,1)+a};goog.structs.Set.prototype.getCount=function(){return this.map_.getCount()};goog.structs.Set.prototype.add=function(a){this.map_.set(goog.structs.Set.getKey_(a),a)};goog.structs.Set.prototype.addAll=function(a){a=goog.structs.getValues(a);for(var b=a.length,c=0;c<b;c++)this.add(a[c])};
goog.structs.Set.prototype.removeAll=function(a){a=goog.structs.getValues(a);for(var b=a.length,c=0;c<b;c++)this.remove(a[c])};goog.structs.Set.prototype.remove=function(a){return this.map_.remove(goog.structs.Set.getKey_(a))};goog.structs.Set.prototype.clear=function(){this.map_.clear()};goog.structs.Set.prototype.isEmpty=function(){return this.map_.isEmpty()};goog.structs.Set.prototype.contains=function(a){return this.map_.containsKey(goog.structs.Set.getKey_(a))};
goog.structs.Set.prototype.containsAll=function(a){return goog.structs.every(a,this.contains,this)};goog.structs.Set.prototype.intersection=function(a){var b=new goog.structs.Set;a=goog.structs.getValues(a);for(var c=0;c<a.length;c++){var d=a[c];this.contains(d)&&b.add(d)}return b};goog.structs.Set.prototype.getValues=function(){return this.map_.getValues()};goog.structs.Set.prototype.clone=function(){return new goog.structs.Set(this)};
goog.structs.Set.prototype.equals=function(a){return this.getCount()==goog.structs.getCount(a)&&this.isSubsetOf(a)};goog.structs.Set.prototype.isSubsetOf=function(a){var b=goog.structs.getCount(a);if(this.getCount()>b)return false;if(!(a instanceof goog.structs.Set)&&b>5)a=new goog.structs.Set(a);return goog.structs.every(this,function(c){return goog.structs.contains(a,c)})};goog.structs.Set.prototype.__iterator__=function(){return this.map_.__iterator__(false)};
goog.debug.catchErrors=function(a,b,c){c=c||goog.global;var d=c.onerror;c.onerror=function(e,f,g){d&&d(e,f,g);a({message:e,fileName:f,line:g});return Boolean(b)}};goog.debug.expose=function(a,b){if(typeof a=="undefined")return"undefined";if(a==null)return"NULL";var c=[];for(var d in a)if(!(!b&&goog.isFunction(a[d]))){var e=d+" = ";try{e+=a[d]}catch(f){e+="*** "+f+" ***"}c.push(e)}return c.join("\n")};
goog.debug.deepExpose=function(a,b){var c=new goog.structs.Set,d=[],e=function(f,g){var h=g+"  ";try{if(goog.isDef(f))if(goog.isNull(f))d.push("NULL");else if(goog.isString(f))d.push('"'+f.replace(/\n/g,"\n"+g)+'"');else if(goog.isFunction(f))d.push(String(f).replace(/\n/g,"\n"+g));else if(goog.isObject(f))if(c.contains(f))d.push("*** reference loop detected ***");else{c.add(f);d.push("{");for(var k in f)if(!(!b&&goog.isFunction(f[k]))){d.push("\n");d.push(h);d.push(k+" = ");e(f[k],h)}d.push("\n"+
g+"}")}else d.push(f);else d.push("undefined")}catch(l){d.push("*** "+l+" ***")}};e(a,"");return d.join("")};goog.debug.exposeArray=function(a){for(var b=[],c=0;c<a.length;c++)goog.isArray(a[c])?b.push(goog.debug.exposeArray(a[c])):b.push(a[c]);return"[ "+b.join(", ")+" ]"};
goog.debug.exposeException=function(a,b){try{var c=goog.debug.normalizeErrorObject(a);return"Message: "+goog.string.htmlEscape(c.message)+'\nUrl: <a href="view-source:'+c.fileName+'" target="_new">'+c.fileName+"</a>\nLine: "+c.lineNumber+"\n\nBrowser stack:\n"+goog.string.htmlEscape(c.stack+"-> ")+"[end]\n\nJS stack traversal:\n"+goog.string.htmlEscape(goog.debug.getStacktrace(b)+"-> ")}catch(d){return"Exception trying to expose exception! You win, we lose. "+d}};
goog.debug.normalizeErrorObject=function(a){var b=goog.getObjectByName("window.location.href");if(goog.isString(a))return{message:a,name:"Unknown error",lineNumber:"Not available",fileName:b,stack:"Not available"};var c,d,e=false;try{c=a.lineNumber||a.line||"Not available"}catch(f){c="Not available";e=true}try{d=a.fileName||a.filename||a.sourceURL||b}catch(g){d="Not available";e=true}if(e||!a.lineNumber||!a.fileName||!a.stack)return{message:a.message,name:a.name,lineNumber:c,fileName:d,stack:a.stack||
"Not available"};return a};goog.debug.enhanceError=function(a,b){var c=typeof a=="string"?Error(a):a;if(!c.stack)c.stack=goog.debug.getStacktrace(arguments.callee.caller);if(b){for(var d=0;c["message"+d];)++d;c["message"+d]=String(b)}return c};
goog.debug.getStacktraceSimple=function(a){for(var b=[],c=arguments.callee.caller,d=0;c&&(!a||d<a);){b.push(goog.debug.getFunctionName(c));b.push("()\n");try{c=c.caller}catch(e){b.push("[exception trying to get caller]\n");break}d++;if(d>=goog.debug.MAX_STACK_DEPTH){b.push("[...long stack...]");break}}a&&d>=a?b.push("[...reached max depth limit...]"):b.push("[end]");return b.join("")};goog.debug.MAX_STACK_DEPTH=50;
goog.debug.getStacktrace=function(a){return goog.debug.getStacktraceHelper_(a||arguments.callee.caller,[])};
goog.debug.getStacktraceHelper_=function(a,b){var c=[];if(goog.array.contains(b,a))c.push("[...circular reference...]");else if(a&&b.length<goog.debug.MAX_STACK_DEPTH){c.push(goog.debug.getFunctionName(a)+"(");for(var d=a.arguments,e=0;e<d.length;e++){e>0&&c.push(", ");var f;f=d[e];switch(typeof f){case "object":f=f?"object":"null";break;case "string":f=f;break;case "number":f=String(f);break;case "boolean":f=f?"true":"false";break;case "function":f=(f=goog.debug.getFunctionName(f))?f:"[fn]";break;
case "undefined":default:f=typeof f;break}if(f.length>40)f=f.substr(0,40)+"...";c.push(f)}b.push(a);c.push(")\n");try{c.push(goog.debug.getStacktraceHelper_(a.caller,b))}catch(g){c.push("[exception trying to get caller]\n")}}else a?c.push("[...long stack...]"):c.push("[end]");return c.join("")};goog.debug.getFunctionName=function(a){a=String(a);if(!goog.debug.fnNameCache_[a]){var b=/function ([^\(]+)/.exec(a);goog.debug.fnNameCache_[a]=b?b[1]:"[Anonymous]"}return goog.debug.fnNameCache_[a]};
goog.debug.makeWhitespaceVisible=function(a){return a.replace(/ /g,"[_]").replace(/\f/g,"[f]").replace(/\n/g,"[n]\n").replace(/\r/g,"[r]").replace(/\t/g,"[t]")};goog.debug.fnNameCache_={};goog.debug.LogRecord=function(a,b,c,d,e){this.reset(a,b,c,d,e)};goog.debug.LogRecord.prototype.sequenceNumber_=0;goog.debug.LogRecord.prototype.exception_=null;goog.debug.LogRecord.prototype.exceptionText_=null;goog.debug.LogRecord.ENABLE_SEQUENCE_NUMBERS=true;goog.debug.LogRecord.nextSequenceNumber_=0;
goog.debug.LogRecord.prototype.reset=function(a,b,c,d,e){if(goog.debug.LogRecord.ENABLE_SEQUENCE_NUMBERS)this.sequenceNumber_=typeof e=="number"?e:goog.debug.LogRecord.nextSequenceNumber_++;this.time_=d||goog.now();this.level_=a;this.msg_=b;this.loggerName_=c;delete this.exception_;delete this.exceptionText_};goog.debug.LogRecord.prototype.getLoggerName=function(){return this.loggerName_};goog.debug.LogRecord.prototype.getException=function(){return this.exception_};
goog.debug.LogRecord.prototype.setException=function(a){this.exception_=a};goog.debug.LogRecord.prototype.getExceptionText=function(){return this.exceptionText_};goog.debug.LogRecord.prototype.setExceptionText=function(a){this.exceptionText_=a};goog.debug.LogRecord.prototype.setLoggerName=function(a){this.loggerName_=a};goog.debug.LogRecord.prototype.getLevel=function(){return this.level_};goog.debug.LogRecord.prototype.setLevel=function(a){this.level_=a};
goog.debug.LogRecord.prototype.getMessage=function(){return this.msg_};goog.debug.LogRecord.prototype.setMessage=function(a){this.msg_=a};goog.debug.LogRecord.prototype.getMillis=function(){return this.time_};goog.debug.LogRecord.prototype.setMillis=function(a){this.time_=a};goog.debug.LogRecord.prototype.getSequenceNumber=function(){return this.sequenceNumber_};
goog.debug.LogBuffer=function(){goog.asserts.assert(goog.debug.LogBuffer.isBufferingEnabled(),"Cannot use goog.debug.LogBuffer without defining goog.debug.LogBuffer.CAPACITY.");this.clear()};goog.debug.LogBuffer.getInstance=function(){if(!goog.debug.LogBuffer.instance_)goog.debug.LogBuffer.instance_=new goog.debug.LogBuffer;return goog.debug.LogBuffer.instance_};goog.debug.LogBuffer.CAPACITY=0;
goog.debug.LogBuffer.prototype.addRecord=function(a,b,c){var d=(this.curIndex_+1)%goog.debug.LogBuffer.CAPACITY;this.curIndex_=d;if(this.isFull_){d=this.buffer_[d];d.reset(a,b,c);return d}this.isFull_=d==goog.debug.LogBuffer.CAPACITY-1;return this.buffer_[d]=new goog.debug.LogRecord(a,b,c)};goog.debug.LogBuffer.isBufferingEnabled=function(){return goog.debug.LogBuffer.CAPACITY>0};
goog.debug.LogBuffer.prototype.clear=function(){this.buffer_=new Array(goog.debug.LogBuffer.CAPACITY);this.curIndex_=-1;this.isFull_=false};goog.debug.LogBuffer.prototype.forEachRecord=function(a){var b=this.buffer_;if(b[0]){var c=this.curIndex_,d=this.isFull_?c:-1;do{d=(d+1)%goog.debug.LogBuffer.CAPACITY;a(b[d])}while(d!=c)}};goog.debug.Logger=function(a){this.name_=a};goog.debug.Logger.prototype.parent_=null;goog.debug.Logger.prototype.level_=null;goog.debug.Logger.prototype.children_=null;
goog.debug.Logger.prototype.handlers_=null;goog.debug.Logger.ENABLE_HIERARCHY=true;if(!goog.debug.Logger.ENABLE_HIERARCHY)goog.debug.Logger.rootHandlers_=[];goog.debug.Logger.Level=function(a,b){this.name=a;this.value=b};goog.debug.Logger.Level.prototype.toString=function(){return this.name};goog.debug.Logger.Level.OFF=new goog.debug.Logger.Level("OFF",Infinity);goog.debug.Logger.Level.SHOUT=new goog.debug.Logger.Level("SHOUT",1200);
goog.debug.Logger.Level.SEVERE=new goog.debug.Logger.Level("SEVERE",1E3);goog.debug.Logger.Level.WARNING=new goog.debug.Logger.Level("WARNING",900);goog.debug.Logger.Level.INFO=new goog.debug.Logger.Level("INFO",800);goog.debug.Logger.Level.CONFIG=new goog.debug.Logger.Level("CONFIG",700);goog.debug.Logger.Level.FINE=new goog.debug.Logger.Level("FINE",500);goog.debug.Logger.Level.FINER=new goog.debug.Logger.Level("FINER",400);goog.debug.Logger.Level.FINEST=new goog.debug.Logger.Level("FINEST",300);
goog.debug.Logger.Level.ALL=new goog.debug.Logger.Level("ALL",0);goog.debug.Logger.Level.PREDEFINED_LEVELS=[goog.debug.Logger.Level.OFF,goog.debug.Logger.Level.SHOUT,goog.debug.Logger.Level.SEVERE,goog.debug.Logger.Level.WARNING,goog.debug.Logger.Level.INFO,goog.debug.Logger.Level.CONFIG,goog.debug.Logger.Level.FINE,goog.debug.Logger.Level.FINER,goog.debug.Logger.Level.FINEST,goog.debug.Logger.Level.ALL];goog.debug.Logger.Level.predefinedLevelsCache_=null;
goog.debug.Logger.Level.createPredefinedLevelsCache_=function(){goog.debug.Logger.Level.predefinedLevelsCache_={};for(var a=0,b;b=goog.debug.Logger.Level.PREDEFINED_LEVELS[a];a++){goog.debug.Logger.Level.predefinedLevelsCache_[b.value]=b;goog.debug.Logger.Level.predefinedLevelsCache_[b.name]=b}};
goog.debug.Logger.Level.getPredefinedLevel=function(a){goog.debug.Logger.Level.predefinedLevelsCache_||goog.debug.Logger.Level.createPredefinedLevelsCache_();return goog.debug.Logger.Level.predefinedLevelsCache_[a]||null};
goog.debug.Logger.Level.getPredefinedLevelByValue=function(a){goog.debug.Logger.Level.predefinedLevelsCache_||goog.debug.Logger.Level.createPredefinedLevelsCache_();if(a in goog.debug.Logger.Level.predefinedLevelsCache_)return goog.debug.Logger.Level.predefinedLevelsCache_[a];for(var b=0;b<goog.debug.Logger.Level.PREDEFINED_LEVELS.length;++b){var c=goog.debug.Logger.Level.PREDEFINED_LEVELS[b];if(c.value<=a)return c}return null};goog.debug.Logger.getLogger=function(a){return goog.debug.LogManager.getLogger(a)};
goog.debug.Logger.prototype.getName=function(){return this.name_};goog.debug.Logger.prototype.addHandler=function(a){if(goog.debug.Logger.ENABLE_HIERARCHY){if(!this.handlers_)this.handlers_=[];this.handlers_.push(a)}else{goog.asserts.assert(!this.name_,"Cannot call addHandler on a non-root logger when goog.debug.Logger.ENABLE_HIERARCHY is false.");goog.debug.Logger.rootHandlers_.push(a)}};
goog.debug.Logger.prototype.removeHandler=function(a){var b=goog.debug.Logger.ENABLE_HIERARCHY?this.handlers_:goog.debug.Logger.rootHandlers_;return!!b&&goog.array.remove(b,a)};goog.debug.Logger.prototype.getParent=function(){return this.parent_};goog.debug.Logger.prototype.getChildren=function(){if(!this.children_)this.children_={};return this.children_};
goog.debug.Logger.prototype.setLevel=function(a){if(goog.debug.Logger.ENABLE_HIERARCHY)this.level_=a;else{goog.asserts.assert(!this.name_,"Cannot call setLevel() on a non-root logger when goog.debug.Logger.ENABLE_HIERARCHY is false.");goog.debug.Logger.rootLevel_=a}};goog.debug.Logger.prototype.getLevel=function(){return this.level_};
goog.debug.Logger.prototype.getEffectiveLevel=function(){if(!goog.debug.Logger.ENABLE_HIERARCHY)return goog.debug.Logger.rootLevel_;if(this.level_)return this.level_;if(this.parent_)return this.parent_.getEffectiveLevel();goog.asserts.fail("Root logger has no level set.");return null};goog.debug.Logger.prototype.isLoggable=function(a){return a.value>=this.getEffectiveLevel().value};goog.debug.Logger.prototype.log=function(a,b,c){this.isLoggable(a)&&this.doLogRecord_(this.getLogRecord(a,b,c))};
goog.debug.Logger.prototype.getLogRecord=function(a,b,c){var d=goog.debug.LogBuffer.isBufferingEnabled()?goog.debug.LogBuffer.getInstance().addRecord(a,b,this.name_):new goog.debug.LogRecord(a,String(b),this.name_);if(c){d.setException(c);d.setExceptionText(goog.debug.exposeException(c,arguments.callee.caller))}return d};goog.debug.Logger.prototype.shout=function(a,b){this.log(goog.debug.Logger.Level.SHOUT,a,b)};
goog.debug.Logger.prototype.severe=function(a,b){this.log(goog.debug.Logger.Level.SEVERE,a,b)};goog.debug.Logger.prototype.warning=function(a,b){this.log(goog.debug.Logger.Level.WARNING,a,b)};goog.debug.Logger.prototype.info=function(a,b){this.log(goog.debug.Logger.Level.INFO,a,b)};goog.debug.Logger.prototype.config=function(a,b){this.log(goog.debug.Logger.Level.CONFIG,a,b)};goog.debug.Logger.prototype.fine=function(a,b){this.log(goog.debug.Logger.Level.FINE,a,b)};
goog.debug.Logger.prototype.finer=function(a,b){this.log(goog.debug.Logger.Level.FINER,a,b)};goog.debug.Logger.prototype.finest=function(a,b){this.log(goog.debug.Logger.Level.FINEST,a,b)};goog.debug.Logger.prototype.logRecord=function(a){this.isLoggable(a.getLevel())&&this.doLogRecord_(a)};goog.debug.Logger.prototype.logToSpeedTracer_=function(a){goog.global.console&&goog.global.console.markTimeline&&goog.global.console.markTimeline(a)};
goog.debug.Logger.prototype.doLogRecord_=function(a){this.logToSpeedTracer_("log:"+a.getMessage());if(goog.debug.Logger.ENABLE_HIERARCHY)for(var b=this;b;){b.callPublish_(a);b=b.getParent()}else{b=0;for(var c;c=goog.debug.Logger.rootHandlers_[b++];)c(a)}};goog.debug.Logger.prototype.callPublish_=function(a){if(this.handlers_)for(var b=0,c;c=this.handlers_[b];b++)c(a)};goog.debug.Logger.prototype.setParent_=function(a){this.parent_=a};
goog.debug.Logger.prototype.addChild_=function(a,b){this.getChildren()[a]=b};goog.debug.LogManager={};goog.debug.LogManager.loggers_={};goog.debug.LogManager.rootLogger_=null;goog.debug.LogManager.initialize=function(){if(!goog.debug.LogManager.rootLogger_){goog.debug.LogManager.rootLogger_=new goog.debug.Logger("");goog.debug.LogManager.loggers_[""]=goog.debug.LogManager.rootLogger_;goog.debug.LogManager.rootLogger_.setLevel(goog.debug.Logger.Level.CONFIG)}};goog.debug.LogManager.getLoggers=function(){return goog.debug.LogManager.loggers_};
goog.debug.LogManager.getRoot=function(){goog.debug.LogManager.initialize();return goog.debug.LogManager.rootLogger_};goog.debug.LogManager.getLogger=function(a){goog.debug.LogManager.initialize();return goog.debug.LogManager.loggers_[a]||goog.debug.LogManager.createLogger_(a)};goog.debug.LogManager.createFunctionForCatchErrors=function(a){return function(b){(a||goog.debug.LogManager.getRoot()).severe("Error: "+b.message+" ("+b.fileName+" @ Line: "+b.line+")")}};
goog.debug.LogManager.createLogger_=function(a){var b=new goog.debug.Logger(a);if(goog.debug.Logger.ENABLE_HIERARCHY){var c=a.lastIndexOf("."),d=a.substr(0,c);c=a.substr(c+1);d=goog.debug.LogManager.getLogger(d);d.addChild_(c,b);b.setParent_(d)}return goog.debug.LogManager.loggers_[a]=b};goog.net={};goog.net.ErrorCode={NO_ERROR:0,ACCESS_DENIED:1,FILE_NOT_FOUND:2,FF_SILENT_ERROR:3,CUSTOM_ERROR:4,EXCEPTION:5,HTTP_ERROR:6,ABORT:7,TIMEOUT:8,OFFLINE:9};
goog.net.ErrorCode.getDebugMessage=function(a){switch(a){case goog.net.ErrorCode.NO_ERROR:return"No Error";case goog.net.ErrorCode.ACCESS_DENIED:return"Access denied to content document";case goog.net.ErrorCode.FILE_NOT_FOUND:return"File not found";case goog.net.ErrorCode.FF_SILENT_ERROR:return"Firefox silently errored";case goog.net.ErrorCode.CUSTOM_ERROR:return"Application custom error";case goog.net.ErrorCode.EXCEPTION:return"An exception occurred";case goog.net.ErrorCode.HTTP_ERROR:return"Http response at 400 or 500 level";
case goog.net.ErrorCode.ABORT:return"Request was aborted";case goog.net.ErrorCode.TIMEOUT:return"Request timed out";case goog.net.ErrorCode.OFFLINE:return"The resource is not available offline";default:return"Unrecognized error code"}};goog.net.EventType={COMPLETE:"complete",SUCCESS:"success",ERROR:"error",ABORT:"abort",READY:"ready",READY_STATE_CHANGE:"readystatechange",TIMEOUT:"timeout",INCREMENTAL_DATA:"incrementaldata",PROGRESS:"progress"};
goog.net.HttpStatus={CONTINUE:100,SWITCHING_PROTOCOLS:101,OK:200,CREATED:201,ACCEPTED:202,NON_AUTHORITATIVE_INFORMATION:203,NO_CONTENT:204,RESET_CONTENT:205,PARTIAL_CONTENT:206,MULTIPLE_CHOICES:300,MOVED_PERMANENTLY:301,FOUND:302,SEE_OTHER:303,NOT_MODIFIED:304,USE_PROXY:305,TEMPORARY_REDIRECT:307,BAD_REQUEST:400,UNAUTHORIZED:401,PAYMENT_REQUIRED:402,FORBIDDEN:403,NOT_FOUND:404,METHOD_NOT_ALLOWED:405,NOT_ACCEPTABLE:406,PROXY_AUTHENTICATION_REQUIRED:407,REQUEST_TIMEOUT:408,CONFLICT:409,GONE:410,LENGTH_REQUIRED:411,
PRECONDITION_FAILED:412,REQUEST_ENTITY_TOO_LARGE:413,REQUEST_URI_TOO_LONG:414,UNSUPPORTED_MEDIA_TYPE:415,REQUEST_RANGE_NOT_SATISFIABLE:416,EXPECTATION_FAILED:417,INTERNAL_SERVER_ERROR:500,NOT_IMPLEMENTED:501,BAD_GATEWAY:502,SERVICE_UNAVAILABLE:503,GATEWAY_TIMEOUT:504,HTTP_VERSION_NOT_SUPPORTED:505};goog.net.XmlHttpFactory=function(){};goog.net.XmlHttpFactory.prototype.cachedOptions_=null;goog.net.XmlHttpFactory.prototype.getOptions=function(){return this.cachedOptions_||(this.cachedOptions_=this.internalGetOptions())};
goog.net.WrapperXmlHttpFactory=function(a,b){goog.net.XmlHttpFactory.call(this);this.xhrFactory_=a;this.optionsFactory_=b};goog.inherits(goog.net.WrapperXmlHttpFactory,goog.net.XmlHttpFactory);goog.net.WrapperXmlHttpFactory.prototype.createInstance=function(){return this.xhrFactory_()};goog.net.WrapperXmlHttpFactory.prototype.getOptions=function(){return this.optionsFactory_()};goog.net.XmlHttp=function(){return goog.net.XmlHttp.factory_.createInstance()};goog.net.XmlHttp.getOptions=function(){return goog.net.XmlHttp.factory_.getOptions()};
goog.net.XmlHttp.OptionType={USE_NULL_FUNCTION:0,LOCAL_REQUEST_ERROR:1};goog.net.XmlHttp.ReadyState={UNINITIALIZED:0,LOADING:1,LOADED:2,INTERACTIVE:3,COMPLETE:4};goog.net.XmlHttp.setFactory=function(a,b){goog.net.XmlHttp.setGlobalFactory(new goog.net.WrapperXmlHttpFactory(a,b))};goog.net.XmlHttp.setGlobalFactory=function(a){goog.net.XmlHttp.factory_=a};goog.net.DefaultXmlHttpFactory=function(){goog.net.XmlHttpFactory.call(this)};goog.inherits(goog.net.DefaultXmlHttpFactory,goog.net.XmlHttpFactory);
goog.net.DefaultXmlHttpFactory.prototype.createInstance=function(){var a=this.getProgId_();return a?new ActiveXObject(a):new XMLHttpRequest};goog.net.DefaultXmlHttpFactory.prototype.internalGetOptions=function(){var a={};if(this.getProgId_()){a[goog.net.XmlHttp.OptionType.USE_NULL_FUNCTION]=true;a[goog.net.XmlHttp.OptionType.LOCAL_REQUEST_ERROR]=true}return a};goog.net.DefaultXmlHttpFactory.prototype.ieProgId_=null;
goog.net.DefaultXmlHttpFactory.prototype.getProgId_=function(){if(!this.ieProgId_&&typeof XMLHttpRequest=="undefined"&&typeof ActiveXObject!="undefined"){for(var a=["MSXML2.XMLHTTP.6.0","MSXML2.XMLHTTP.3.0","MSXML2.XMLHTTP","Microsoft.XMLHTTP"],b=0;b<a.length;b++){var c=a[b];try{new ActiveXObject(c);return this.ieProgId_=c}catch(d){}}throw Error("Could not create ActiveXObject. ActiveX might be disabled, or MSXML might not be installed");}return this.ieProgId_};goog.net.XmlHttp.setGlobalFactory(new goog.net.DefaultXmlHttpFactory);
goog.net.XhrMonitor_=function(){if(goog.userAgent.GECKO){this.contextsToXhr_={};this.xhrToContexts_={};this.stack_=[]}};goog.net.XhrMonitor_.getKey=function(a){return goog.isString(a)?a:goog.isObject(a)?goog.getUid(a):""};goog.net.XhrMonitor_.prototype.logger_=goog.debug.Logger.getLogger("goog.net.xhrMonitor");goog.net.XhrMonitor_.prototype.enabled_=goog.userAgent.GECKO;goog.net.XhrMonitor_.prototype.setEnabled=function(a){this.enabled_=goog.userAgent.GECKO&&a};
goog.net.XhrMonitor_.prototype.pushContext=function(a){if(this.enabled_){var b=goog.net.XhrMonitor_.getKey(a);this.logger_.finest("Pushing context: "+a+" ("+b+")");this.stack_.push(b)}};goog.net.XhrMonitor_.prototype.popContext=function(){if(this.enabled_){var a=this.stack_.pop();this.logger_.finest("Popping context: "+a);this.updateDependentContexts_(a)}};
goog.net.XhrMonitor_.prototype.isContextSafe=function(a){if(!this.enabled_)return true;var b=this.contextsToXhr_[goog.net.XhrMonitor_.getKey(a)];this.logger_.fine("Context is safe : "+a+" - "+b);return!b};goog.net.XhrMonitor_.prototype.markXhrOpen=function(a){if(this.enabled_){a=goog.getUid(a);this.logger_.fine("Opening XHR : "+a);for(var b=0;b<this.stack_.length;b++){var c=this.stack_[b];this.addToMap_(this.contextsToXhr_,c,a);this.addToMap_(this.xhrToContexts_,a,c)}}};
goog.net.XhrMonitor_.prototype.markXhrClosed=function(a){if(this.enabled_){a=goog.getUid(a);this.logger_.fine("Closing XHR : "+a);delete this.xhrToContexts_[a];for(var b in this.contextsToXhr_){goog.array.remove(this.contextsToXhr_[b],a);this.contextsToXhr_[b].length==0&&delete this.contextsToXhr_[b]}}};
goog.net.XhrMonitor_.prototype.updateDependentContexts_=function(a){var b=this.xhrToContexts_[a],c=this.contextsToXhr_[a];if(b&&c){this.logger_.finest("Updating dependent contexts");goog.array.forEach(b,function(d){goog.array.forEach(c,function(e){this.addToMap_(this.contextsToXhr_,d,e);this.addToMap_(this.xhrToContexts_,e,d)},this)},this)}};goog.net.XhrMonitor_.prototype.addToMap_=function(a,b,c){a[b]||(a[b]=[]);goog.array.contains(a[b],c)||a[b].push(c)};goog.net.xhrMonitor=new goog.net.XhrMonitor_;
goog.net.XhrIo=function(a){goog.events.EventTarget.call(this);this.headers=new goog.structs.Map;this.xmlHttpFactory_=a||null};goog.inherits(goog.net.XhrIo,goog.events.EventTarget);goog.net.XhrIo.ResponseType={DEFAULT:"",TEXT:"text",DOCUMENT:"document",BLOB:"blob",ARRAY_BUFFER:"arraybuffer"};goog.net.XhrIo.prototype.logger_=goog.debug.Logger.getLogger("goog.net.XhrIo");goog.net.XhrIo.CONTENT_TYPE_HEADER="Content-Type";goog.net.XhrIo.HTTP_SCHEME_PATTERN=/^https?:?$/i;
goog.net.XhrIo.FORM_CONTENT_TYPE="application/x-www-form-urlencoded;charset=utf-8";goog.net.XhrIo.sendInstances_=[];goog.net.XhrIo.send=function(a,b,c,d,e,f){var g=new goog.net.XhrIo;goog.net.XhrIo.sendInstances_.push(g);b&&goog.events.listen(g,goog.net.EventType.COMPLETE,b);goog.events.listen(g,goog.net.EventType.READY,goog.partial(goog.net.XhrIo.cleanupSend_,g));f&&g.setTimeoutInterval(f);g.send(a,c,d,e)};goog.net.XhrIo.cleanup=function(){for(var a=goog.net.XhrIo.sendInstances_;a.length;)a.pop().dispose()};
goog.net.XhrIo.protectEntryPoints=function(a){goog.net.XhrIo.prototype.onReadyStateChangeEntryPoint_=a.protectEntryPoint(goog.net.XhrIo.prototype.onReadyStateChangeEntryPoint_)};goog.net.XhrIo.cleanupSend_=function(a){a.dispose();goog.array.remove(goog.net.XhrIo.sendInstances_,a)};goog.net.XhrIo.prototype.active_=false;goog.net.XhrIo.prototype.xhr_=null;goog.net.XhrIo.prototype.xhrOptions_=null;goog.net.XhrIo.prototype.lastUri_="";goog.net.XhrIo.prototype.lastMethod_="";
goog.net.XhrIo.prototype.lastErrorCode_=goog.net.ErrorCode.NO_ERROR;goog.net.XhrIo.prototype.lastError_="";goog.net.XhrIo.prototype.errorDispatched_=false;goog.net.XhrIo.prototype.inSend_=false;goog.net.XhrIo.prototype.inOpen_=false;goog.net.XhrIo.prototype.inAbort_=false;goog.net.XhrIo.prototype.timeoutInterval_=0;goog.net.XhrIo.prototype.timeoutId_=null;goog.net.XhrIo.prototype.responseType_=goog.net.XhrIo.ResponseType.DEFAULT;goog.net.XhrIo.prototype.withCredentials_=false;
goog.net.XhrIo.prototype.getTimeoutInterval=function(){return this.timeoutInterval_};goog.net.XhrIo.prototype.setTimeoutInterval=function(a){this.timeoutInterval_=Math.max(0,a)};goog.net.XhrIo.prototype.setResponseType=function(a){this.responseType_=a};goog.net.XhrIo.prototype.getResponseType=function(){return this.responseType_};goog.net.XhrIo.prototype.setWithCredentials=function(a){this.withCredentials_=a};goog.net.XhrIo.prototype.getWithCredentials=function(){return this.withCredentials_};
goog.net.XhrIo.prototype.send=function(a,b,c,d){if(this.xhr_)throw Error("[goog.net.XhrIo] Object is active with another request");b=b||"GET";this.lastUri_=a;this.lastError_="";this.lastErrorCode_=goog.net.ErrorCode.NO_ERROR;this.lastMethod_=b;this.errorDispatched_=false;this.active_=true;this.xhr_=this.createXhr();this.xhrOptions_=this.xmlHttpFactory_?this.xmlHttpFactory_.getOptions():goog.net.XmlHttp.getOptions();goog.net.xhrMonitor.markXhrOpen(this.xhr_);this.xhr_.onreadystatechange=goog.bind(this.onReadyStateChange_,
this);try{this.logger_.fine(this.formatMsg_("Opening Xhr"));this.inOpen_=true;this.xhr_.open(b,a,true);this.inOpen_=false}catch(e){this.logger_.fine(this.formatMsg_("Error opening Xhr: "+e.message));this.error_(goog.net.ErrorCode.EXCEPTION,e);return}a=c||"";var f=this.headers.clone();d&&goog.structs.forEach(d,function(h,k){f.set(k,h)});b=="POST"&&!f.containsKey(goog.net.XhrIo.CONTENT_TYPE_HEADER)&&f.set(goog.net.XhrIo.CONTENT_TYPE_HEADER,goog.net.XhrIo.FORM_CONTENT_TYPE);goog.structs.forEach(f,function(h,
k){this.xhr_.setRequestHeader(k,h)},this);if(this.responseType_)this.xhr_.responseType=this.responseType_;if(goog.object.containsKey(this.xhr_,"withCredentials"))this.xhr_.withCredentials=this.withCredentials_;try{if(this.timeoutId_){goog.Timer.defaultTimerObject.clearTimeout(this.timeoutId_);this.timeoutId_=null}if(this.timeoutInterval_>0){this.logger_.fine(this.formatMsg_("Will abort after "+this.timeoutInterval_+"ms if incomplete"));this.timeoutId_=goog.Timer.defaultTimerObject.setTimeout(goog.bind(this.timeout_,
this),this.timeoutInterval_)}this.logger_.fine(this.formatMsg_("Sending request"));this.inSend_=true;this.xhr_.send(a);this.inSend_=false}catch(g){this.logger_.fine(this.formatMsg_("Send error: "+g.message));this.error_(goog.net.ErrorCode.EXCEPTION,g)}};goog.net.XhrIo.prototype.createXhr=function(){return this.xmlHttpFactory_?this.xmlHttpFactory_.createInstance():new goog.net.XmlHttp};
goog.net.XhrIo.prototype.dispatchEvent=function(a){if(this.xhr_){goog.net.xhrMonitor.pushContext(this.xhr_);try{return goog.net.XhrIo.superClass_.dispatchEvent.call(this,a)}finally{goog.net.xhrMonitor.popContext()}}else return goog.net.XhrIo.superClass_.dispatchEvent.call(this,a)};
goog.net.XhrIo.prototype.timeout_=function(){if(typeof goog!="undefined")if(this.xhr_){this.lastError_="Timed out after "+this.timeoutInterval_+"ms, aborting";this.lastErrorCode_=goog.net.ErrorCode.TIMEOUT;this.logger_.fine(this.formatMsg_(this.lastError_));this.dispatchEvent(goog.net.EventType.TIMEOUT);this.abort(goog.net.ErrorCode.TIMEOUT)}};
goog.net.XhrIo.prototype.error_=function(a,b){this.active_=false;if(this.xhr_){this.inAbort_=true;this.xhr_.abort();this.inAbort_=false}this.lastError_=b;this.lastErrorCode_=a;this.dispatchErrors_();this.cleanUpXhr_()};goog.net.XhrIo.prototype.dispatchErrors_=function(){if(!this.errorDispatched_){this.errorDispatched_=true;this.dispatchEvent(goog.net.EventType.COMPLETE);this.dispatchEvent(goog.net.EventType.ERROR)}};
goog.net.XhrIo.prototype.abort=function(a){if(this.xhr_&&this.active_){this.logger_.fine(this.formatMsg_("Aborting"));this.active_=false;this.inAbort_=true;this.xhr_.abort();this.inAbort_=false;this.lastErrorCode_=a||goog.net.ErrorCode.ABORT;this.dispatchEvent(goog.net.EventType.COMPLETE);this.dispatchEvent(goog.net.EventType.ABORT);this.cleanUpXhr_()}};
goog.net.XhrIo.prototype.disposeInternal=function(){if(this.xhr_){if(this.active_){this.active_=false;this.inAbort_=true;this.xhr_.abort();this.inAbort_=false}this.cleanUpXhr_(true)}goog.net.XhrIo.superClass_.disposeInternal.call(this)};goog.net.XhrIo.prototype.onReadyStateChange_=function(){!this.inOpen_&&!this.inSend_&&!this.inAbort_?this.onReadyStateChangeEntryPoint_():this.onReadyStateChangeHelper_()};goog.net.XhrIo.prototype.onReadyStateChangeEntryPoint_=function(){this.onReadyStateChangeHelper_()};
goog.net.XhrIo.prototype.onReadyStateChangeHelper_=function(){if(this.active_)if(typeof goog!="undefined")if(this.xhrOptions_[goog.net.XmlHttp.OptionType.LOCAL_REQUEST_ERROR]&&this.getReadyState()==goog.net.XmlHttp.ReadyState.COMPLETE&&this.getStatus()==2)this.logger_.fine(this.formatMsg_("Local request error detected and ignored"));else if(this.inSend_&&this.getReadyState()==goog.net.XmlHttp.ReadyState.COMPLETE)goog.Timer.defaultTimerObject.setTimeout(goog.bind(this.onReadyStateChange_,this),0);
else{this.dispatchEvent(goog.net.EventType.READY_STATE_CHANGE);if(this.isComplete()){this.logger_.fine(this.formatMsg_("Request complete"));this.active_=false;if(this.isSuccess()){this.dispatchEvent(goog.net.EventType.COMPLETE);this.dispatchEvent(goog.net.EventType.SUCCESS)}else{this.lastErrorCode_=goog.net.ErrorCode.HTTP_ERROR;this.lastError_=this.getStatusText()+" ["+this.getStatus()+"]";this.dispatchErrors_()}this.cleanUpXhr_()}}};
goog.net.XhrIo.prototype.cleanUpXhr_=function(a){if(this.xhr_){var b=this.xhr_,c=this.xhrOptions_[goog.net.XmlHttp.OptionType.USE_NULL_FUNCTION]?goog.nullFunction:null;this.xhrOptions_=this.xhr_=null;if(this.timeoutId_){goog.Timer.defaultTimerObject.clearTimeout(this.timeoutId_);this.timeoutId_=null}if(!a){goog.net.xhrMonitor.pushContext(b);this.dispatchEvent(goog.net.EventType.READY);goog.net.xhrMonitor.popContext()}goog.net.xhrMonitor.markXhrClosed(b);try{b.onreadystatechange=c}catch(d){this.logger_.severe("Problem encountered resetting onreadystatechange: "+
d.message)}}};goog.net.XhrIo.prototype.isActive=function(){return!!this.xhr_};goog.net.XhrIo.prototype.isComplete=function(){return this.getReadyState()==goog.net.XmlHttp.ReadyState.COMPLETE};goog.net.XhrIo.prototype.isSuccess=function(){switch(this.getStatus()){case 0:return!this.isLastUriEffectiveSchemeHttp_();case goog.net.HttpStatus.OK:case goog.net.HttpStatus.NO_CONTENT:case goog.net.HttpStatus.NOT_MODIFIED:return true;default:return false}};
goog.net.XhrIo.prototype.isLastUriEffectiveSchemeHttp_=function(){var a=goog.isString(this.lastUri_)?goog.uri.utils.getScheme(this.lastUri_):this.lastUri_.getScheme();if(a)return goog.net.XhrIo.HTTP_SCHEME_PATTERN.test(a);return self.location?goog.net.XhrIo.HTTP_SCHEME_PATTERN.test(self.location.protocol):true};goog.net.XhrIo.prototype.getReadyState=function(){return this.xhr_?this.xhr_.readyState:goog.net.XmlHttp.ReadyState.UNINITIALIZED};
goog.net.XhrIo.prototype.getStatus=function(){try{return this.getReadyState()>goog.net.XmlHttp.ReadyState.LOADED?this.xhr_.status:-1}catch(a){this.logger_.warning("Can not get status: "+a.message);return-1}};goog.net.XhrIo.prototype.getStatusText=function(){try{return this.getReadyState()>goog.net.XmlHttp.ReadyState.LOADED?this.xhr_.statusText:""}catch(a){this.logger_.fine("Can not get status: "+a.message);return""}};goog.net.XhrIo.prototype.getLastUri=function(){return String(this.lastUri_)};
goog.net.XhrIo.prototype.getResponseText=function(){try{return this.xhr_?this.xhr_.responseText:""}catch(a){this.logger_.fine("Can not get responseText: "+a.message);return""}};goog.net.XhrIo.prototype.getResponseXml=function(){try{return this.xhr_?this.xhr_.responseXML:null}catch(a){this.logger_.fine("Can not get responseXML: "+a.message);return null}};goog.net.XhrIo.prototype.getResponseJson=function(a){if(this.xhr_){var b=this.xhr_.responseText;if(a&&b.indexOf(a)==0)b=b.substring(a.length);return goog.json.parse(b)}};
goog.net.XhrIo.prototype.getResponse=function(){try{return this.xhr_&&this.xhr_.response}catch(a){this.logger_.fine("Can not get response: "+a.message);return null}};goog.net.XhrIo.prototype.getResponseHeader=function(a){return this.xhr_&&this.isComplete()?this.xhr_.getResponseHeader(a):undefined};goog.net.XhrIo.prototype.getAllResponseHeaders=function(){return this.xhr_&&this.isComplete()?this.xhr_.getAllResponseHeaders():""};goog.net.XhrIo.prototype.getLastErrorCode=function(){return this.lastErrorCode_};
goog.net.XhrIo.prototype.getLastError=function(){return goog.isString(this.lastError_)?this.lastError_:String(this.lastError_)};goog.net.XhrIo.prototype.formatMsg_=function(a){return a+" ["+this.lastMethod_+" "+this.lastUri_+" "+this.getStatus()+"]"};goog.debug.entryPointRegistry.register(function(a){goog.net.XhrIo.prototype.onReadyStateChangeEntryPoint_=a(goog.net.XhrIo.prototype.onReadyStateChangeEntryPoint_)});
goog.ui.AutoComplete.RemoteArrayMatcher=function(a,b){goog.Disposable.call(this);this.url_=a;this.useSimilar_=!b;this.xhr_=new goog.net.XhrIo};goog.inherits(goog.ui.AutoComplete.RemoteArrayMatcher,goog.Disposable);goog.ui.AutoComplete.RemoteArrayMatcher.prototype.method_="GET";goog.ui.AutoComplete.RemoteArrayMatcher.prototype.content_=undefined;goog.ui.AutoComplete.RemoteArrayMatcher.prototype.headers_=null;goog.ui.AutoComplete.RemoteArrayMatcher.prototype.lastListenerKey_=null;
goog.ui.AutoComplete.RemoteArrayMatcher.prototype.setMethod=function(a){this.method_=a};goog.ui.AutoComplete.RemoteArrayMatcher.prototype.setContent=function(a){this.content_=a};goog.ui.AutoComplete.RemoteArrayMatcher.prototype.setHeaders=function(a){this.headers_=a};goog.ui.AutoComplete.RemoteArrayMatcher.prototype.setTimeoutInterval=function(a){this.xhr_.setTimeoutInterval(a)};
goog.ui.AutoComplete.RemoteArrayMatcher.prototype.buildUrl=function(a,b,c,d){a=new goog.Uri(a);a.setParameterValue("token",b);a.setParameterValue("max_matches",String(c));a.setParameterValue("use_similar",String(Number(d)));return a.toString()};goog.ui.AutoComplete.RemoteArrayMatcher.prototype.shouldRequestMatches=function(){return true};goog.ui.AutoComplete.RemoteArrayMatcher.prototype.parseResponseText=function(a){var b=[];if(a)try{b=goog.json.unsafeParse(a)}catch(c){}return b};
goog.ui.AutoComplete.RemoteArrayMatcher.prototype.xhrCallback=function(a,b,c){c=c.target.getResponseText();b(a,this.parseResponseText(c))};
goog.ui.AutoComplete.RemoteArrayMatcher.prototype.requestMatchingRows=function(a,b,c,d){if(this.shouldRequestMatches(this.url_,a,b,this.useSimilar_,d))if(b=this.buildUrl(this.url_,a,b,this.useSimilar_,d)){a=goog.bind(this.xhrCallback,this,a,c);this.xhr_.isActive()&&this.xhr_.abort();this.lastListenerKey_&&goog.events.unlistenByKey(this.lastListenerKey_);this.lastListenerKey_=goog.events.listenOnce(this.xhr_,goog.net.EventType.SUCCESS,a);this.xhr_.send(b,this.method_,this.content_,this.headers_)}};
goog.ui.AutoComplete.RemoteArrayMatcher.prototype.disposeInternal=function(){this.xhr_.dispose();goog.ui.AutoComplete.RemoteArrayMatcher.superClass_.disposeInternal.call(this)};goog.ui.AutoComplete.Remote=function(a,b,c,d){this.matcher_=a=new goog.ui.AutoComplete.RemoteArrayMatcher(a,!d);d=new goog.ui.AutoComplete.Renderer;c=new goog.ui.AutoComplete.InputHandler(null,null,!!c,300);goog.ui.AutoComplete.call(this,a,d,c);c.attachAutoComplete(this);c.attachInputs(b)};
goog.inherits(goog.ui.AutoComplete.Remote,goog.ui.AutoComplete);goog.ui.AutoComplete.Remote.prototype.setUseStandardHighlighting=function(a){this.renderer_.setUseStandardHighlighting(a)};goog.ui.AutoComplete.Remote.prototype.getInputHandler=function(){return this.selectionHandler_};goog.ui.AutoComplete.Remote.prototype.setMethod=function(a){this.matcher_.setMethod(a)};goog.ui.AutoComplete.Remote.prototype.setContent=function(a){this.matcher_.setContent(a)};
goog.ui.AutoComplete.Remote.prototype.setHeaders=function(a){this.matcher_.setHeaders(a)};goog.ui.AutoComplete.Remote.prototype.setTimeoutInterval=function(a){this.matcher_.setTimeoutInterval(a)};goog.ui.AutoComplete.RichInputHandler=function(a,b,c,d){goog.ui.AutoComplete.InputHandler.call(this,a,b,c,d)};goog.inherits(goog.ui.AutoComplete.RichInputHandler,goog.ui.AutoComplete.InputHandler);
goog.ui.AutoComplete.RichInputHandler.prototype.selectRow=function(a){var b=goog.ui.AutoComplete.RichInputHandler.superClass_.selectRow.call(this,a);a.select(this.ac_.getTarget());return b};goog.ui.AutoComplete.RichRemoteArrayMatcher=function(a,b){goog.ui.AutoComplete.RemoteArrayMatcher.call(this,a,b);this.rowFilter_=null};goog.inherits(goog.ui.AutoComplete.RichRemoteArrayMatcher,goog.ui.AutoComplete.RemoteArrayMatcher);
goog.ui.AutoComplete.RichRemoteArrayMatcher.prototype.setRowFilter=function(a){this.rowFilter_=a};
goog.ui.AutoComplete.RichRemoteArrayMatcher.prototype.requestMatchingRows=function(a,b,c){var d=goog.bind(function(e,f){try{for(var g=[],h=0;h<f.length;h++)for(var k=goog.json.unsafeParse(f[h][0]),l=1;l<f[h].length;l++){var m=k(f[h][l]);g.push(m);if(typeof m.render=="undefined")m.render=function(o){o.innerHTML=m.toString()};if(typeof m.select=="undefined")m.select=function(o){o.value=m.toString()}}if(this.rowFilter_)g=this.rowFilter_(g);c(e,g)}catch(n){c(e,[])}},this);goog.ui.AutoComplete.RichRemoteArrayMatcher.superClass_.requestMatchingRows.call(this,
a,b,d)};goog.ui.AutoComplete.RichRemote=function(a,b,c,d){var e={};e.renderRow=function(f,g,h){return f.data.render(h,g)};this.renderer_=e=new goog.ui.AutoComplete.Renderer(null,e);this.matcher_=a=new goog.ui.AutoComplete.RichRemoteArrayMatcher(a,!d);c=new goog.ui.AutoComplete.RichInputHandler(null,null,!!c,300);goog.ui.AutoComplete.call(this,a,e,c);c.attachAutoComplete(this);c.attachInputs(b)};goog.inherits(goog.ui.AutoComplete.RichRemote,goog.ui.AutoComplete.Remote);
goog.ui.AutoComplete.RichRemote.prototype.setRowFilter=function(a){this.matcher_.setRowFilter(a)};goog.math.randomInt=function(a){return Math.floor(Math.random()*a)};goog.math.uniformRandom=function(a,b){return a+Math.random()*(b-a)};goog.math.clamp=function(a,b,c){return Math.min(Math.max(a,b),c)};goog.math.modulo=function(a,b){var c=a%b;return c*b<0?c+b:c};goog.math.lerp=function(a,b,c){return a+c*(b-a)};goog.math.nearlyEquals=function(a,b,c){return Math.abs(a-b)<=(c||1.0E-6)};
goog.math.standardAngle=function(a){return goog.math.modulo(a,360)};goog.math.toRadians=function(a){return a*Math.PI/180};goog.math.toDegrees=function(a){return a*180/Math.PI};goog.math.angleDx=function(a,b){return b*Math.cos(goog.math.toRadians(a))};goog.math.angleDy=function(a,b){return b*Math.sin(goog.math.toRadians(a))};goog.math.angle=function(a,b,c,d){return goog.math.standardAngle(goog.math.toDegrees(Math.atan2(d-b,c-a)))};
goog.math.angleDifference=function(a,b){var c=goog.math.standardAngle(b)-goog.math.standardAngle(a);if(c>180)c-=360;else if(c<=-180)c=360+c;return c};goog.math.sign=function(a){return a==0?0:a<0?-1:1};
goog.math.longestCommonSubsequence=function(a,b,c,d){c=c||function(m,n){return m==n};d=d||function(m){return a[m]};for(var e=a.length,f=b.length,g=[],h=0;h<e+1;h++){g[h]=[];g[h][0]=0}for(var k=0;k<f+1;k++)g[0][k]=0;for(h=1;h<=e;h++)for(k=1;k<=e;k++)g[h][k]=c(a[h-1],b[k-1])?g[h-1][k-1]+1:Math.max(g[h-1][k],g[h][k-1]);var l=[];h=e;for(k=f;h>0&&k>0;)if(c(a[h-1],b[k-1])){l.unshift(d(h-1,k-1));h--;k--}else if(g[h-1][k]>g[h][k-1])h--;else k--;return l};
goog.math.sum=function(){return goog.array.reduce(arguments,function(a,b){return a+b},0)};goog.math.average=function(){return goog.math.sum.apply(null,arguments)/arguments.length};goog.math.standardDeviation=function(){var a=arguments.length;if(a<2)return 0;var b=goog.math.average.apply(null,arguments);a=goog.math.sum.apply(null,goog.array.map(arguments,function(c){return Math.pow(c-b,2)}))/(a-1);return Math.sqrt(a)};goog.math.isInt=function(a){return isFinite(a)&&a%1==0};
goog.math.isFiniteNumber=function(a){return isFinite(a)&&!isNaN(a)};goog.events.MouseWheelHandler=function(a){goog.events.EventTarget.call(this);this.element_=a;this.listenKey_=goog.events.listen(this.element_,goog.userAgent.GECKO?"DOMMouseScroll":"mousewheel",this)};goog.inherits(goog.events.MouseWheelHandler,goog.events.EventTarget);goog.events.MouseWheelHandler.EventType={MOUSEWHEEL:"mousewheel"};goog.events.MouseWheelHandler.prototype.setMaxDeltaX=function(a){this.maxDeltaX_=a};
goog.events.MouseWheelHandler.prototype.setMaxDeltaY=function(a){this.maxDeltaY_=a};
goog.events.MouseWheelHandler.prototype.handleEvent=function(a){var b=0,c=0,d=0;a=a.getBrowserEvent();if(a.type=="mousewheel"){c=1;if(goog.userAgent.IE||goog.userAgent.WEBKIT&&(goog.userAgent.WINDOWS||goog.userAgent.isVersion("532.0")))c=40;d=goog.events.MouseWheelHandler.smartScale_(-a.wheelDelta,c);if(goog.isDef(a.wheelDeltaX)){b=goog.events.MouseWheelHandler.smartScale_(-a.wheelDeltaX,c);c=goog.events.MouseWheelHandler.smartScale_(-a.wheelDeltaY,c)}else c=d}else{d=a.detail;if(d>100)d=3;else if(d<
-100)d=-3;if(goog.isDef(a.axis)&&a.axis===a.HORIZONTAL_AXIS)b=d;else c=d}if(goog.isNumber(this.maxDeltaX_))b=goog.math.clamp(b,-this.maxDeltaX_,this.maxDeltaX_);if(goog.isNumber(this.maxDeltaY_))c=goog.math.clamp(c,-this.maxDeltaY_,this.maxDeltaY_);b=new goog.events.MouseWheelEvent(d,a,b,c);try{this.dispatchEvent(b)}finally{b.dispose()}};goog.events.MouseWheelHandler.smartScale_=function(a,b){return goog.userAgent.WEBKIT&&goog.userAgent.MAC&&a%b!=0?a:a/b};
goog.events.MouseWheelHandler.prototype.disposeInternal=function(){goog.events.MouseWheelHandler.superClass_.disposeInternal.call(this);goog.events.unlistenByKey(this.listenKey_);delete this.listenKey_};goog.events.MouseWheelEvent=function(a,b,c,d){goog.events.BrowserEvent.call(this,b);this.type=goog.events.MouseWheelHandler.EventType.MOUSEWHEEL;this.detail=a;this.deltaX=c;this.deltaY=d};goog.inherits(goog.events.MouseWheelEvent,goog.events.BrowserEvent);goog.fx={};
goog.fx.Animation=function(a,b,c,d){goog.events.EventTarget.call(this);if(!goog.isArray(a)||!goog.isArray(b))throw Error("Start and end parameters must be arrays");if(a.length!=b.length)throw Error("Start and end points must be the same length");this.startPoint=a;this.endPoint=b;this.duration=c;this.accel_=d;this.coords=[]};goog.inherits(goog.fx.Animation,goog.events.EventTarget);
goog.fx.Animation.EventType={PLAY:"play",BEGIN:"begin",RESUME:"resume",END:"end",STOP:"stop",FINISH:"finish",PAUSE:"pause",ANIMATE:"animate",DESTROY:"destroy"};goog.fx.Animation.State={STOPPED:0,PAUSED:-1,PLAYING:1};goog.fx.Animation.TIMEOUT=20;goog.fx.Animation.activeAnimations_={};goog.fx.Animation.globalTimer_=null;
goog.fx.Animation.cycleAnimations_=function(){goog.Timer.defaultTimerObject.clearTimeout(goog.fx.Animation.globalTimer_);var a=goog.now();for(var b in goog.fx.Animation.activeAnimations_)goog.fx.Animation.activeAnimations_[b].cycle(a);goog.fx.Animation.globalTimer_=goog.object.isEmpty(goog.fx.Animation.activeAnimations_)?null:goog.Timer.defaultTimerObject.setTimeout(goog.fx.Animation.cycleAnimations_,goog.fx.Animation.TIMEOUT)};
goog.fx.Animation.registerAnimation=function(a){var b=goog.getUid(a);b in goog.fx.Animation.activeAnimations_||(goog.fx.Animation.activeAnimations_[b]=a);if(!goog.fx.Animation.globalTimer_)goog.fx.Animation.globalTimer_=goog.Timer.defaultTimerObject.setTimeout(goog.fx.Animation.cycleAnimations_,goog.fx.Animation.TIMEOUT)};
goog.fx.Animation.unregisterAnimation=function(a){a=goog.getUid(a);delete goog.fx.Animation.activeAnimations_[a];if(goog.fx.Animation.globalTimer_&&goog.object.isEmpty(goog.fx.Animation.activeAnimations_)){goog.Timer.defaultTimerObject.clearTimeout(goog.fx.Animation.globalTimer_);goog.fx.Animation.globalTimer_=null}};goog.fx.Animation.prototype.state_=goog.fx.Animation.State.STOPPED;goog.fx.Animation.prototype.fps_=0;goog.fx.Animation.prototype.progress=0;goog.fx.Animation.prototype.startTime=null;
goog.fx.Animation.prototype.endTime=null;goog.fx.Animation.prototype.lastFrame=null;goog.fx.Animation.prototype.getStateInternal=function(){return this.state_};
goog.fx.Animation.prototype.play=function(a){if(a||this.state_==goog.fx.Animation.State.STOPPED){this.progress=0;this.coords=this.startPoint}else if(this.state_==goog.fx.Animation.State.PLAYING)return false;goog.fx.Animation.unregisterAnimation(this);this.startTime=goog.now();if(this.state_==goog.fx.Animation.State.PAUSED)this.startTime-=this.duration*this.progress;this.endTime=this.startTime+this.duration;this.lastFrame=this.startTime;this.progress||this.onBegin();this.onPlay();this.state_==goog.fx.Animation.State.PAUSED&&
this.onResume();this.state_=goog.fx.Animation.State.PLAYING;goog.fx.Animation.registerAnimation(this);this.cycle(this.startTime);return true};goog.fx.Animation.prototype.stop=function(a){goog.fx.Animation.unregisterAnimation(this);this.state_=goog.fx.Animation.State.STOPPED;if(a)this.progress=1;this.updateCoords_(this.progress);this.onStop();this.onEnd()};
goog.fx.Animation.prototype.pause=function(){if(this.state_==goog.fx.Animation.State.PLAYING){goog.fx.Animation.unregisterAnimation(this);this.state_=goog.fx.Animation.State.PAUSED;this.onPause()}};goog.fx.Animation.prototype.disposeInternal=function(){this.state_!=goog.fx.Animation.State.STOPPED&&this.stop(false);this.onDestroy();goog.fx.Animation.superClass_.disposeInternal.call(this)};goog.fx.Animation.prototype.destroy=function(){this.dispose()};
goog.fx.Animation.prototype.cycle=function(a){this.progress=(a-this.startTime)/(this.endTime-this.startTime);if(this.progress>=1)this.progress=1;this.fps_=1E3/(a-this.lastFrame);this.lastFrame=a;goog.isFunction(this.accel_)?this.updateCoords_(this.accel_(this.progress)):this.updateCoords_(this.progress);if(this.progress==1){this.state_=goog.fx.Animation.State.STOPPED;goog.fx.Animation.unregisterAnimation(this);this.onFinish();this.onEnd()}else this.state_==goog.fx.Animation.State.PLAYING&&this.onAnimate()};
goog.fx.Animation.prototype.updateCoords_=function(a){this.coords=new Array(this.startPoint.length);for(var b=0;b<this.startPoint.length;b++)this.coords[b]=(this.endPoint[b]-this.startPoint[b])*a+this.startPoint[b]};goog.fx.Animation.prototype.onAnimate=function(){this.dispatchAnimationEvent_(goog.fx.Animation.EventType.ANIMATE)};goog.fx.Animation.prototype.onBegin=function(){this.dispatchAnimationEvent_(goog.fx.Animation.EventType.BEGIN)};goog.fx.Animation.prototype.onDestroy=function(){this.dispatchAnimationEvent_(goog.fx.Animation.EventType.DESTROY)};
goog.fx.Animation.prototype.onEnd=function(){this.dispatchAnimationEvent_(goog.fx.Animation.EventType.END)};goog.fx.Animation.prototype.onFinish=function(){this.dispatchAnimationEvent_(goog.fx.Animation.EventType.FINISH)};goog.fx.Animation.prototype.onPause=function(){this.dispatchAnimationEvent_(goog.fx.Animation.EventType.PAUSE)};goog.fx.Animation.prototype.onPlay=function(){this.dispatchAnimationEvent_(goog.fx.Animation.EventType.PLAY)};goog.fx.Animation.prototype.onResume=function(){this.dispatchAnimationEvent_(goog.fx.Animation.EventType.RESUME)};
goog.fx.Animation.prototype.onStop=function(){this.dispatchAnimationEvent_(goog.fx.Animation.EventType.STOP)};goog.fx.Animation.prototype.dispatchAnimationEvent_=function(a){this.dispatchEvent(new goog.fx.AnimationEvent(a,this))};goog.fx.AnimationEvent=function(a,b){goog.events.Event.call(this,a);this.coords=b.coords;this.x=b.coords[0];this.y=b.coords[1];this.z=b.coords[2];this.duration=b.duration;this.progress=b.progress;this.fps=b.fps_;this.state=b.state_;this.anim=b};
goog.inherits(goog.fx.AnimationEvent,goog.events.Event);goog.fx.AnimationEvent.prototype.coordsAsInts=function(){return goog.array.map(this.coords,Math.round)};
goog.fx.Dragger=function(a,b,c){goog.events.EventTarget.call(this);this.target=a;this.handle=b||a;this.limits=c||new goog.math.Rect(NaN,NaN,NaN,NaN);this.document_=goog.dom.getOwnerDocument(a);this.eventHandler_=new goog.events.EventHandler(this);goog.events.listen(this.handle,[goog.events.EventType.TOUCHSTART,goog.events.EventType.MOUSEDOWN],this.startDrag,false,this)};goog.inherits(goog.fx.Dragger,goog.events.EventTarget);
goog.fx.Dragger.HAS_SET_CAPTURE_=goog.userAgent.IE||goog.userAgent.GECKO&&goog.userAgent.isVersion("1.9.3");goog.fx.Dragger.EventType={START:"start",BEFOREDRAG:"beforedrag",DRAG:"drag",END:"end"};goog.fx.Dragger.prototype.clientX=0;goog.fx.Dragger.prototype.clientY=0;goog.fx.Dragger.prototype.screenX=0;goog.fx.Dragger.prototype.screenY=0;goog.fx.Dragger.prototype.startX=0;goog.fx.Dragger.prototype.startY=0;goog.fx.Dragger.prototype.deltaX=0;goog.fx.Dragger.prototype.deltaY=0;
goog.fx.Dragger.prototype.enabled_=true;goog.fx.Dragger.prototype.dragging_=false;goog.fx.Dragger.prototype.hysteresisDistanceSquared_=0;goog.fx.Dragger.prototype.mouseDownTime_=0;goog.fx.Dragger.prototype.ieDragStartCancellingOn_=false;goog.fx.Dragger.prototype.getHandler=function(){return this.eventHandler_};goog.fx.Dragger.prototype.setLimits=function(a){this.limits=a||new goog.math.Rect(NaN,NaN,NaN,NaN)};
goog.fx.Dragger.prototype.setHysteresis=function(a){this.hysteresisDistanceSquared_=Math.pow(a,2)};goog.fx.Dragger.prototype.getHysteresis=function(){return Math.sqrt(this.hysteresisDistanceSquared_)};goog.fx.Dragger.prototype.setScrollTarget=function(a){this.scrollTarget_=a};goog.fx.Dragger.prototype.setCancelIeDragStart=function(a){this.ieDragStartCancellingOn_=a};goog.fx.Dragger.prototype.getEnabled=function(){return this.enabled_};
goog.fx.Dragger.prototype.setEnabled=function(a){this.enabled_=a};goog.fx.Dragger.prototype.disposeInternal=function(){goog.fx.Dragger.superClass_.disposeInternal.call(this);goog.events.unlisten(this.handle,[goog.events.EventType.TOUCHSTART,goog.events.EventType.MOUSEDOWN],this.startDrag,false,this);this.eventHandler_.dispose();delete this.target;delete this.handle;delete this.eventHandler_};
goog.fx.Dragger.prototype.startDrag=function(a){var b=a.type==goog.events.EventType.MOUSEDOWN;if(this.enabled_&&!this.dragging_&&(!b||a.isMouseActionButton())){this.maybeReinitTouchEvent_(a);if(this.hysteresisDistanceSquared_==0){this.initializeDrag_(a);if(this.dragging_)a.preventDefault();else return}else a.preventDefault();this.setupDragHandlers();this.clientX=this.startX=a.clientX;this.clientY=this.startY=a.clientY;this.screenX=a.screenX;this.screenY=a.screenY;this.deltaX=this.target.offsetLeft;
this.deltaY=this.target.offsetTop;this.pageScroll=goog.dom.getDomHelper(this.document_).getDocumentScroll();this.mouseDownTime_=goog.now()}};
goog.fx.Dragger.prototype.setupDragHandlers=function(){var a=this.document_,b=a.documentElement,c=!goog.fx.Dragger.HAS_SET_CAPTURE_;this.eventHandler_.listen(a,[goog.events.EventType.TOUCHMOVE,goog.events.EventType.MOUSEMOVE],this.handleMove_,c);this.eventHandler_.listen(a,[goog.events.EventType.TOUCHEND,goog.events.EventType.MOUSEUP],this.endDrag,c);if(goog.fx.Dragger.HAS_SET_CAPTURE_){b.setCapture(false);this.eventHandler_.listen(b,goog.events.EventType.LOSECAPTURE,this.endDrag)}else this.eventHandler_.listen(goog.dom.getWindow(a),
goog.events.EventType.BLUR,this.endDrag);goog.userAgent.IE&&this.ieDragStartCancellingOn_&&this.eventHandler_.listen(a,goog.events.EventType.DRAGSTART,goog.events.Event.preventDefault);this.scrollTarget_&&this.eventHandler_.listen(this.scrollTarget_,goog.events.EventType.SCROLL,this.onScroll_,c)};goog.fx.Dragger.prototype.initializeDrag_=function(a){if(this.dispatchEvent(new goog.fx.DragEvent(goog.fx.Dragger.EventType.START,this,a.clientX,a.clientY,a))!==false)this.dragging_=true};
goog.fx.Dragger.prototype.endDrag=function(a,b){this.eventHandler_.removeAll();goog.fx.Dragger.HAS_SET_CAPTURE_&&this.document_.releaseCapture();if(this.dragging_){this.maybeReinitTouchEvent_(a);this.dragging_=false;var c=this.limitX(this.deltaX),d=this.limitY(this.deltaY);this.dispatchEvent(new goog.fx.DragEvent(goog.fx.Dragger.EventType.END,this,a.clientX,a.clientY,a,c,d,b||a.type==goog.events.EventType.TOUCHCANCEL))}if(a.type==goog.events.EventType.TOUCHEND||a.type==goog.events.EventType.TOUCHCANCEL)a.preventDefault()};
goog.fx.Dragger.prototype.endDragCancel=function(a){this.endDrag(a,true)};goog.fx.Dragger.prototype.maybeReinitTouchEvent_=function(a){var b=a.type;if(b==goog.events.EventType.TOUCHSTART||b==goog.events.EventType.TOUCHMOVE)a.init(a.getBrowserEvent().targetTouches[0],a.currentTarget);else if(b==goog.events.EventType.TOUCHEND||b==goog.events.EventType.TOUCHCANCEL)a.init(a.getBrowserEvent().changedTouches[0],a.currentTarget)};
goog.fx.Dragger.prototype.handleMove_=function(a){if(this.enabled_){this.maybeReinitTouchEvent_(a);var b=a.clientX-this.clientX,c=a.clientY-this.clientY;this.clientX=a.clientX;this.clientY=a.clientY;this.screenX=a.screenX;this.screenY=a.screenY;if(!this.dragging_){var d=this.startX-this.clientX,e=this.startY-this.clientY;if(d*d+e*e>this.hysteresisDistanceSquared_){this.initializeDrag_(a);if(!this.dragging_){this.endDrag(a);return}}}c=this.calculatePosition_(b,c);b=c.x;c=c.y;if(this.dragging_)if(this.dispatchEvent(new goog.fx.DragEvent(goog.fx.Dragger.EventType.BEFOREDRAG,
this,a.clientX,a.clientY,a,b,c))!==false){this.doDrag(a,b,c,false);a.preventDefault()}}};goog.fx.Dragger.prototype.calculatePosition_=function(a,b){var c=goog.dom.getDomHelper(this.document_).getDocumentScroll();a+=c.x-this.pageScroll.x;b+=c.y-this.pageScroll.y;this.pageScroll=c;this.deltaX+=a;this.deltaY+=b;c=this.limitX(this.deltaX);var d=this.limitY(this.deltaY);return new goog.math.Coordinate(c,d)};
goog.fx.Dragger.prototype.onScroll_=function(a){var b=this.calculatePosition_(0,0);a.clientX=this.pageScroll.x-this.clientX;a.clientY=this.pageScroll.y-this.clientY;this.doDrag(a,b.x,b.y,true)};goog.fx.Dragger.prototype.doDrag=function(a,b,c){this.defaultAction(b,c);this.dispatchEvent(new goog.fx.DragEvent(goog.fx.Dragger.EventType.DRAG,this,a.clientX,a.clientY,a,b,c))};
goog.fx.Dragger.prototype.limitX=function(a){var b=this.limits,c=!isNaN(b.left)?b.left:null;b=!isNaN(b.width)?b.width:0;return Math.min(c!=null?c+b:Infinity,Math.max(c!=null?c:-Infinity,a))};goog.fx.Dragger.prototype.limitY=function(a){var b=this.limits,c=!isNaN(b.top)?b.top:null;b=!isNaN(b.height)?b.height:0;return Math.min(c!=null?c+b:Infinity,Math.max(c!=null?c:-Infinity,a))};goog.fx.Dragger.prototype.defaultAction=function(a,b){this.target.style.left=a+"px";this.target.style.top=b+"px"};
goog.fx.DragEvent=function(a,b,c,d,e,f,g,h){goog.events.Event.call(this,a);this.clientX=c;this.clientY=d;this.browserEvent=e;this.left=goog.isDef(f)?f:b.deltaX;this.top=goog.isDef(g)?g:b.deltaY;this.dragger=b;this.dragCanceled=!!h};goog.inherits(goog.fx.DragEvent,goog.events.Event);goog.color={};
goog.color.names={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",
darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",
ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",
lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370d8",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",
moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#d87093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",
seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};
goog.color.parse=function(a){var b={};a=String(a);var c=goog.color.prependPoundIfNecessary_(a);if(goog.color.isValidHexColor_(c)){b.hex=goog.color.normalizeHex(c);b.type="hex";return b}else{c=goog.color.isValidRgbColor_(a);if(c.length){b.hex=goog.color.rgbArrayToHex(c);b.type="rgb";return b}else if(goog.color.names)if(c=goog.color.names[a.toLowerCase()]){b.hex=c;b.type="named";return b}}throw Error(a+" is not a valid color string");};
goog.color.parseRgb=function(a){var b=goog.color.isValidRgbColor_(a);if(!b.length)throw Error(a+" is not a valid RGB color");return b};goog.color.hexToRgbStyle=function(a){return goog.color.rgbStyle_(goog.color.hexToRgb(a))};goog.color.hexTripletRe_=/#(.)(.)(.)/;goog.color.normalizeHex=function(a){if(!goog.color.isValidHexColor_(a))throw Error("'"+a+"' is not a valid hex color");if(a.length==4)a=a.replace(goog.color.hexTripletRe_,"#$1$1$2$2$3$3");return a.toLowerCase()};
goog.color.hexToRgb=function(a){a=goog.color.normalizeHex(a);var b=parseInt(a.substr(1,2),16),c=parseInt(a.substr(3,2),16);a=parseInt(a.substr(5,2),16);return[b,c,a]};
goog.color.rgbToHex=function(a,b,c){a=Number(a);b=Number(b);c=Number(c);if(isNaN(a)||a<0||a>255||isNaN(b)||b<0||b>255||isNaN(c)||c<0||c>255)throw Error('"('+a+","+b+","+c+'") is not a valid RGB color');a=goog.color.prependZeroIfNecessary_(a.toString(16));b=goog.color.prependZeroIfNecessary_(b.toString(16));c=goog.color.prependZeroIfNecessary_(c.toString(16));return"#"+a+b+c};goog.color.rgbArrayToHex=function(a){return goog.color.rgbToHex(a[0],a[1],a[2])};
goog.color.rgbToHsl=function(a,b,c){a=a/255;b=b/255;c=c/255;var d=Math.max(a,b,c),e=Math.min(a,b,c),f=0,g=0,h=0.5*(d+e);if(d!=e){if(d==a)f=60*(b-c)/(d-e);else if(d==b)f=60*(c-a)/(d-e)+120;else if(d==c)f=60*(a-b)/(d-e)+240;g=0<h&&h<=0.5?(d-e)/(2*h):(d-e)/(2-2*h)}return[Math.round(f+360)%360,g,h]};goog.color.rgbArrayToHsl=function(a){return goog.color.rgbToHsl(a[0],a[1],a[2])};
goog.color.hueToRgb_=function(a,b,c){if(c<0)c+=1;else if(c>1)c-=1;if(6*c<1)return a+(b-a)*6*c;else if(2*c<1)return b;else if(3*c<2)return a+(b-a)*(2/3-c)*6;return a};goog.color.hslToRgb=function(a,b,c){var d=0,e=0,f=0;a=a/360;if(b==0)d=e=f=c*255;else{var g=f=0;g=c<0.5?c*(1+b):c+b-b*c;f=2*c-g;d=255*goog.color.hueToRgb_(f,g,a+1/3);e=255*goog.color.hueToRgb_(f,g,a);f=255*goog.color.hueToRgb_(f,g,a-1/3)}return[Math.round(d),Math.round(e),Math.round(f)]};
goog.color.hslArrayToRgb=function(a){return goog.color.hslToRgb(a[0],a[1],a[2])};goog.color.validHexColorRe_=/^#(?:[0-9a-f]{3}){1,2}$/i;goog.color.isValidHexColor_=function(a){return goog.color.validHexColorRe_.test(a)};goog.color.normalizedHexColorRe_=/^#[0-9a-f]{6}$/;goog.color.isNormalizedHexColor_=function(a){return goog.color.normalizedHexColorRe_.test(a)};goog.color.rgbColorRe_=/^(?:rgb)?\((0|[1-9]\d{0,2}),\s?(0|[1-9]\d{0,2}),\s?(0|[1-9]\d{0,2})\)$/i;
goog.color.isValidRgbColor_=function(a){var b=a.match(goog.color.rgbColorRe_);if(b){a=Number(b[1]);var c=Number(b[2]);b=Number(b[3]);if(a>=0&&a<=255&&c>=0&&c<=255&&b>=0&&b<=255)return[a,c,b]}return[]};goog.color.prependZeroIfNecessary_=function(a){return a.length==1?"0"+a:a};goog.color.prependPoundIfNecessary_=function(a){return a.charAt(0)=="#"?a:"#"+a};goog.color.rgbStyle_=function(a){return"rgb("+a.join(",")+")"};
goog.color.hsvToRgb=function(a,b,c){var d=0,e=0,f=0;if(b==0)f=e=d=c;else{var g=Math.floor(a/60),h=a/60-g;a=c*(1-b);var k=c*(1-b*h);b=c*(1-b*(1-h));switch(g){case 1:d=k;e=c;f=a;break;case 2:d=a;e=c;f=b;break;case 3:d=a;e=k;f=c;break;case 4:d=b;e=a;f=c;break;case 5:d=c;e=a;f=k;break;case 6:case 0:d=c;e=b;f=a;break}}return[Math.floor(d),Math.floor(e),Math.floor(f)]};
goog.color.rgbToHsv=function(a,b,c){var d=Math.max(Math.max(a,b),c),e=Math.min(Math.min(a,b),c);if(e==d)e=a=0;else{var f=d-e;e=f/d;a=a==d?(b-c)/f:b==d?2+(c-a)/f:4+(a-b)/f;a*=60;if(a<0)a+=360;if(a>360)a-=360}return[a,e,d]};goog.color.rgbArrayToHsv=function(a){return goog.color.rgbToHsv(a[0],a[1],a[2])};goog.color.hsvArrayToRgb=function(a){return goog.color.hsvToRgb(a[0],a[1],a[2])};goog.color.hexToHsl=function(a){a=goog.color.hexToRgb(a);return goog.color.rgbToHsl(a[0],a[1],a[2])};
goog.color.hslToHex=function(a,b,c){return goog.color.rgbArrayToHex(goog.color.hslToRgb(a,b,c))};goog.color.hslArrayToHex=function(a){return goog.color.rgbArrayToHex(goog.color.hslToRgb(a[0],a[1],a[2]))};goog.color.hexToHsv=function(a){return goog.color.rgbArrayToHsv(goog.color.hexToRgb(a))};goog.color.hsvToHex=function(a,b,c){return goog.color.rgbArrayToHex(goog.color.hsvToRgb(a,b,c))};goog.color.hsvArrayToHex=function(a){return goog.color.hsvToHex(a[0],a[1],a[2])};
goog.color.hslDistance=function(a,b){var c,d;c=a[2]<=0.5?a[1]*a[2]:a[1]*(1-a[2]);d=b[2]<=0.5?b[1]*b[2]:b[1]*(1-b[2]);return(a[2]-b[2])*(a[2]-b[2])+c*c+d*d-2*c*d*Math.cos((a[0]/360-b[0]/360)*2*Math.PI)};goog.color.blend=function(a,b,c){c=goog.math.clamp(c,0,1);return[Math.round(c*a[0]+(1-c)*b[0]),Math.round(c*a[1]+(1-c)*b[1]),Math.round(c*a[2]+(1-c)*b[2])]};goog.color.darken=function(a,b){return goog.color.blend([0,0,0],a,b)};
goog.color.lighten=function(a,b){return goog.color.blend([255,255,255],a,b)};goog.color.highContrast=function(a,b){for(var c=[],d=0;d<b.length;d++)c.push({color:b[d],diff:goog.color.yiqBrightnessDiff_(b[d],a)+goog.color.colorDiff_(b[d],a)});c.sort(function(e,f){return f.diff-e.diff});return c[0].color};goog.color.yiqBrightness_=function(a){return Math.round((a[0]*299+a[1]*587+a[2]*114)/1E3)};goog.color.yiqBrightnessDiff_=function(a,b){return Math.abs(goog.color.yiqBrightness_(a)-goog.color.yiqBrightness_(b))};
goog.color.colorDiff_=function(a,b){return Math.abs(a[0]-b[0])+Math.abs(a[1]-b[1])+Math.abs(a[2]-b[2])};goog.fx.dom={};goog.fx.dom.PredefinedEffect=function(a,b,c,d,e){goog.fx.Animation.call(this,b,c,d,e);this.element=a};goog.inherits(goog.fx.dom.PredefinedEffect,goog.fx.Animation);goog.fx.dom.PredefinedEffect.prototype.updateStyle=goog.nullFunction;goog.fx.dom.PredefinedEffect.prototype.onAnimate=function(){this.updateStyle();goog.fx.dom.PredefinedEffect.superClass_.onAnimate.call(this)};
goog.fx.dom.PredefinedEffect.prototype.onEnd=function(){this.updateStyle();goog.fx.dom.PredefinedEffect.superClass_.onEnd.call(this)};goog.fx.dom.PredefinedEffect.prototype.onBegin=function(){this.updateStyle();goog.fx.dom.PredefinedEffect.superClass_.onBegin.call(this)};goog.fx.dom.Slide=function(a,b,c){if(b.length!=2||c.length!=2)throw Error("Start and end points must be 2D");goog.fx.dom.PredefinedEffect.apply(this,arguments)};goog.inherits(goog.fx.dom.Slide,goog.fx.dom.PredefinedEffect);
goog.fx.dom.Slide.prototype.updateStyle=function(){this.element.style.left=Math.round(this.coords[0])+"px";this.element.style.top=Math.round(this.coords[1])+"px"};goog.fx.dom.SlideFrom=function(a,b,c,d){goog.fx.dom.Slide.call(this,a,[a.offsetLeft,a.offsetTop],b,c,d)};goog.inherits(goog.fx.dom.SlideFrom,goog.fx.dom.Slide);goog.fx.dom.SlideFrom.prototype.onBegin=function(){this.startPoint=[this.element.offsetLeft,this.element.offsetTop];goog.fx.dom.SlideFrom.superClass_.onBegin.call(this)};
goog.fx.dom.Swipe=function(a,b,c){if(b.length!=2||c.length!=2)throw Error("Start and end points must be 2D");goog.fx.dom.PredefinedEffect.apply(this,arguments);this.maxWidth_=Math.max(this.endPoint[0],this.startPoint[0]);this.maxHeight_=Math.max(this.endPoint[1],this.startPoint[1])};goog.inherits(goog.fx.dom.Swipe,goog.fx.dom.PredefinedEffect);
goog.fx.dom.Swipe.prototype.updateStyle=function(){var a=this.coords[0],b=this.coords[1];this.clip_(Math.round(a),Math.round(b),this.maxWidth_,this.maxHeight_);this.element.style.width=Math.round(a)+"px";this.element.style.marginLeft=Math.round(a)-this.maxWidth_+"px";this.element.style.marginTop=Math.round(b)-this.maxHeight_+"px"};goog.fx.dom.Swipe.prototype.clip_=function(a,b,c,d){this.element.style.clip="rect("+(d-b)+"px "+c+"px "+d+"px "+(c-a)+"px)"};
goog.fx.dom.Scroll=function(a,b,c){if(b.length!=2||c.length!=2)throw Error("Start and end points must be 2D");goog.fx.dom.PredefinedEffect.apply(this,arguments)};goog.inherits(goog.fx.dom.Scroll,goog.fx.dom.PredefinedEffect);goog.fx.dom.Scroll.prototype.updateStyle=function(){this.element.scrollLeft=Math.round(this.coords[0]);this.element.scrollTop=Math.round(this.coords[1])};
goog.fx.dom.Resize=function(a,b,c){if(b.length!=2||c.length!=2)throw Error("Start and end points must be 2D");goog.fx.dom.PredefinedEffect.apply(this,arguments)};goog.inherits(goog.fx.dom.Resize,goog.fx.dom.PredefinedEffect);goog.fx.dom.Resize.prototype.updateStyle=function(){this.element.style.width=Math.round(this.coords[0])+"px";this.element.style.height=Math.round(this.coords[1])+"px"};goog.fx.dom.ResizeWidth=function(a,b,c,d,e){goog.fx.dom.PredefinedEffect.call(this,a,[b],[c],d,e)};
goog.inherits(goog.fx.dom.ResizeWidth,goog.fx.dom.PredefinedEffect);goog.fx.dom.ResizeWidth.prototype.updateStyle=function(){this.element.style.width=Math.round(this.coords[0])+"px"};goog.fx.dom.ResizeHeight=function(a,b,c,d,e){goog.fx.dom.PredefinedEffect.call(this,a,[b],[c],d,e)};goog.inherits(goog.fx.dom.ResizeHeight,goog.fx.dom.PredefinedEffect);goog.fx.dom.ResizeHeight.prototype.updateStyle=function(){this.element.style.height=Math.round(this.coords[0])+"px"};
goog.fx.dom.Fade=function(a,b,c,d,e){if(goog.isNumber(b))b=[b];if(goog.isNumber(c))c=[c];goog.fx.dom.PredefinedEffect.call(this,a,b,c,d,e);if(b.length!=1||c.length!=1)throw Error("Start and end points must be 1D");};goog.inherits(goog.fx.dom.Fade,goog.fx.dom.PredefinedEffect);goog.fx.dom.Fade.prototype.updateStyle=function(){goog.style.setOpacity(this.element,this.coords[0])};goog.fx.dom.Fade.prototype.show=function(){this.element.style.display=""};
goog.fx.dom.Fade.prototype.hide=function(){this.element.style.display="none"};goog.fx.dom.FadeOut=function(a,b,c){goog.fx.dom.Fade.call(this,a,1,0,b,c)};goog.inherits(goog.fx.dom.FadeOut,goog.fx.dom.Fade);goog.fx.dom.FadeIn=function(a,b,c){goog.fx.dom.Fade.call(this,a,0,1,b,c)};goog.inherits(goog.fx.dom.FadeIn,goog.fx.dom.Fade);goog.fx.dom.FadeOutAndHide=function(a,b,c){goog.fx.dom.Fade.call(this,a,1,0,b,c)};goog.inherits(goog.fx.dom.FadeOutAndHide,goog.fx.dom.Fade);
goog.fx.dom.FadeOutAndHide.prototype.onBegin=function(){this.show();goog.fx.dom.FadeOutAndHide.superClass_.onBegin.call(this)};goog.fx.dom.FadeOutAndHide.prototype.onEnd=function(){this.hide();goog.fx.dom.FadeOutAndHide.superClass_.onEnd.call(this)};goog.fx.dom.FadeInAndShow=function(a,b,c){goog.fx.dom.Fade.call(this,a,0,1,b,c)};goog.inherits(goog.fx.dom.FadeInAndShow,goog.fx.dom.Fade);goog.fx.dom.FadeInAndShow.prototype.onBegin=function(){this.show();goog.fx.dom.FadeInAndShow.superClass_.onBegin.call(this)};
goog.fx.dom.BgColorTransform=function(a,b,c){if(b.length!=3||c.length!=3)throw Error("Start and end points must be 3D");goog.fx.dom.PredefinedEffect.apply(this,arguments)};goog.inherits(goog.fx.dom.BgColorTransform,goog.fx.dom.PredefinedEffect);goog.fx.dom.BgColorTransform.prototype.setColor=function(){for(var a=[],b=0;b<this.coords.length;b++)a[b]=Math.round(this.coords[b]);this.element.style.backgroundColor="rgb("+a.join(",")+")"};goog.fx.dom.BgColorTransform.prototype.updateStyle=function(){this.setColor()};
goog.fx.dom.bgColorFadeIn=function(a,b,c,d){function e(){a.style.backgroundColor=f}var f=a.style.backgroundColor||"",g=goog.style.getBackgroundColor(a);g=g!="transparent"&&g!="rgba(0, 0, 0, 0)"?goog.color.hexToRgb(goog.color.parse(g).hex):[255,255,255];b=new goog.fx.dom.BgColorTransform(a,b,g,c);d?d.listen(b,goog.fx.Animation.EventType.END,e):goog.events.listen(b,goog.fx.Animation.EventType.END,e);b.play()};
goog.fx.dom.ColorTransform=function(a,b,c){if(b.length!=3||c.length!=3)throw Error("Start and end points must be 3D");goog.fx.dom.PredefinedEffect.apply(this,arguments)};goog.inherits(goog.fx.dom.ColorTransform,goog.fx.dom.PredefinedEffect);goog.fx.dom.ColorTransform.prototype.updateStyle=function(){for(var a=[],b=0;b<this.coords.length;b++)a[b]=Math.round(this.coords[b]);this.element.style.color="rgb("+a.join(",")+")"};
goog.ui.Component=function(a){goog.events.EventTarget.call(this);this.dom_=a||goog.dom.getDomHelper();this.rightToLeft_=goog.ui.Component.defaultRightToLeft_};goog.inherits(goog.ui.Component,goog.events.EventTarget);goog.ui.Component.prototype.idGenerator_=goog.ui.IdGenerator.getInstance();goog.ui.Component.defaultRightToLeft_=null;
goog.ui.Component.EventType={BEFORE_SHOW:"beforeshow",SHOW:"show",HIDE:"hide",DISABLE:"disable",ENABLE:"enable",HIGHLIGHT:"highlight",UNHIGHLIGHT:"unhighlight",ACTIVATE:"activate",DEACTIVATE:"deactivate",SELECT:"select",UNSELECT:"unselect",CHECK:"check",UNCHECK:"uncheck",FOCUS:"focus",BLUR:"blur",OPEN:"open",CLOSE:"close",ENTER:"enter",LEAVE:"leave",ACTION:"action",CHANGE:"change"};
goog.ui.Component.Error={NOT_SUPPORTED:"Method not supported",DECORATE_INVALID:"Invalid element to decorate",ALREADY_RENDERED:"Component already rendered",PARENT_UNABLE_TO_BE_SET:"Unable to set parent component",CHILD_INDEX_OUT_OF_BOUNDS:"Child component index out of bounds",NOT_OUR_CHILD:"Child is not in parent component",NOT_IN_DOCUMENT:"Operation not supported while component is not in document",STATE_INVALID:"Invalid component state"};
goog.ui.Component.State={ALL:255,DISABLED:1,HOVER:2,ACTIVE:4,SELECTED:8,CHECKED:16,FOCUSED:32,OPENED:64};
goog.ui.Component.getStateTransitionEvent=function(a,b){switch(a){case goog.ui.Component.State.DISABLED:return b?goog.ui.Component.EventType.DISABLE:goog.ui.Component.EventType.ENABLE;case goog.ui.Component.State.HOVER:return b?goog.ui.Component.EventType.HIGHLIGHT:goog.ui.Component.EventType.UNHIGHLIGHT;case goog.ui.Component.State.ACTIVE:return b?goog.ui.Component.EventType.ACTIVATE:goog.ui.Component.EventType.DEACTIVATE;case goog.ui.Component.State.SELECTED:return b?goog.ui.Component.EventType.SELECT:
goog.ui.Component.EventType.UNSELECT;case goog.ui.Component.State.CHECKED:return b?goog.ui.Component.EventType.CHECK:goog.ui.Component.EventType.UNCHECK;case goog.ui.Component.State.FOCUSED:return b?goog.ui.Component.EventType.FOCUS:goog.ui.Component.EventType.BLUR;case goog.ui.Component.State.OPENED:return b?goog.ui.Component.EventType.OPEN:goog.ui.Component.EventType.CLOSE;default:}throw Error(goog.ui.Component.Error.STATE_INVALID);};
goog.ui.Component.setDefaultRightToLeft=function(a){goog.ui.Component.defaultRightToLeft_=a};goog.ui.Component.prototype.id_=null;goog.ui.Component.prototype.inDocument_=false;goog.ui.Component.prototype.element_=null;goog.ui.Component.prototype.rightToLeft_=null;goog.ui.Component.prototype.model_=null;goog.ui.Component.prototype.parent_=null;goog.ui.Component.prototype.children_=null;goog.ui.Component.prototype.childIndex_=null;goog.ui.Component.prototype.wasDecorated_=false;
goog.ui.Component.prototype.getId=function(){return this.id_||(this.id_=this.idGenerator_.getNextUniqueId())};goog.ui.Component.prototype.setId=function(a){if(this.parent_&&this.parent_.childIndex_){goog.object.remove(this.parent_.childIndex_,this.id_);goog.object.add(this.parent_.childIndex_,a,this)}this.id_=a};goog.ui.Component.prototype.getElement=function(){return this.element_};goog.ui.Component.prototype.setElementInternal=function(a){this.element_=a};
goog.ui.Component.prototype.getHandler=function(){return this.googUiComponentHandler_||(this.googUiComponentHandler_=new goog.events.EventHandler(this))};goog.ui.Component.prototype.setParent=function(a){if(this==a)throw Error(goog.ui.Component.Error.PARENT_UNABLE_TO_BE_SET);if(a&&this.parent_&&this.id_&&this.parent_.getChild(this.id_)&&this.parent_!=a)throw Error(goog.ui.Component.Error.PARENT_UNABLE_TO_BE_SET);this.parent_=a;goog.ui.Component.superClass_.setParentEventTarget.call(this,a)};
goog.ui.Component.prototype.getParent=function(){return this.parent_};goog.ui.Component.prototype.setParentEventTarget=function(a){if(this.parent_&&this.parent_!=a)throw Error(goog.ui.Component.Error.NOT_SUPPORTED);goog.ui.Component.superClass_.setParentEventTarget.call(this,a)};goog.ui.Component.prototype.getDomHelper=function(){return this.dom_};goog.ui.Component.prototype.isInDocument=function(){return this.inDocument_};goog.ui.Component.prototype.createDom=function(){this.element_=this.dom_.createElement("div")};
goog.ui.Component.prototype.render=function(a){this.render_(a)};goog.ui.Component.prototype.renderBefore=function(a){this.render_(a.parentNode,a)};goog.ui.Component.prototype.render_=function(a,b){if(this.inDocument_)throw Error(goog.ui.Component.Error.ALREADY_RENDERED);this.element_||this.createDom();a?a.insertBefore(this.element_,b||null):this.dom_.getDocument().body.appendChild(this.element_);if(!this.parent_||this.parent_.isInDocument())this.enterDocument()};
goog.ui.Component.prototype.decorate=function(a){if(this.inDocument_)throw Error(goog.ui.Component.Error.ALREADY_RENDERED);else if(a&&this.canDecorate(a)){this.wasDecorated_=true;if(!this.dom_||this.dom_.getDocument()!=goog.dom.getOwnerDocument(a))this.dom_=goog.dom.getDomHelper(a);this.decorateInternal(a);this.enterDocument()}else throw Error(goog.ui.Component.Error.DECORATE_INVALID);};goog.ui.Component.prototype.canDecorate=function(){return true};goog.ui.Component.prototype.wasDecorated=function(){return this.wasDecorated_};
goog.ui.Component.prototype.decorateInternal=function(a){this.element_=a};goog.ui.Component.prototype.enterDocument=function(){this.inDocument_=true;this.forEachChild(function(a){!a.isInDocument()&&a.getElement()&&a.enterDocument()})};goog.ui.Component.prototype.exitDocument=function(){this.forEachChild(function(a){a.isInDocument()&&a.exitDocument()});this.googUiComponentHandler_&&this.googUiComponentHandler_.removeAll();this.inDocument_=false};
goog.ui.Component.prototype.disposeInternal=function(){goog.ui.Component.superClass_.disposeInternal.call(this);this.inDocument_&&this.exitDocument();if(this.googUiComponentHandler_){this.googUiComponentHandler_.dispose();delete this.googUiComponentHandler_}this.forEachChild(function(a){a.dispose()});!this.wasDecorated_&&this.element_&&goog.dom.removeNode(this.element_);this.parent_=this.model_=this.element_=this.childIndex_=this.children_=null};
goog.ui.Component.prototype.makeId=function(a){return this.getId()+"."+a};goog.ui.Component.prototype.getModel=function(){return this.model_};goog.ui.Component.prototype.setModel=function(a){this.model_=a};goog.ui.Component.prototype.getFragmentFromId=function(a){return a.substring(this.getId().length+1)};goog.ui.Component.prototype.getElementByFragment=function(a){if(!this.inDocument_)throw Error(goog.ui.Component.Error.NOT_IN_DOCUMENT);return this.dom_.getElement(this.makeId(a))};
goog.ui.Component.prototype.addChild=function(a,b){this.addChildAt(a,this.getChildCount(),b)};
goog.ui.Component.prototype.addChildAt=function(a,b,c){if(a.inDocument_&&(c||!this.inDocument_))throw Error(goog.ui.Component.Error.ALREADY_RENDERED);if(b<0||b>this.getChildCount())throw Error(goog.ui.Component.Error.CHILD_INDEX_OUT_OF_BOUNDS);if(!this.childIndex_||!this.children_){this.childIndex_={};this.children_=[]}if(a.getParent()==this){goog.object.set(this.childIndex_,a.getId(),a);goog.array.remove(this.children_,a)}else goog.object.add(this.childIndex_,a.getId(),a);a.setParent(this);goog.array.insertAt(this.children_,
a,b);if(a.inDocument_&&this.inDocument_&&a.getParent()==this){c=this.getContentElement();c.insertBefore(a.getElement(),c.childNodes[b]||null)}else if(c){this.element_||this.createDom();b=this.getChildAt(b+1);a.render_(this.getContentElement(),b?b.element_:null)}else this.inDocument_&&!a.inDocument_&&a.element_&&a.enterDocument()};goog.ui.Component.prototype.getContentElement=function(){return this.element_};
goog.ui.Component.prototype.isRightToLeft=function(){if(this.rightToLeft_==null)this.rightToLeft_=goog.style.isRightToLeft(this.inDocument_?this.element_:this.dom_.getDocument().body);return this.rightToLeft_};goog.ui.Component.prototype.setRightToLeft=function(a){if(this.inDocument_)throw Error(goog.ui.Component.Error.ALREADY_RENDERED);this.rightToLeft_=a};goog.ui.Component.prototype.hasChildren=function(){return!!this.children_&&this.children_.length!=0};
goog.ui.Component.prototype.getChildCount=function(){return this.children_?this.children_.length:0};goog.ui.Component.prototype.getChildIds=function(){var a=[];this.forEachChild(function(b){a.push(b.getId())});return a};goog.ui.Component.prototype.getChild=function(a){return this.childIndex_&&a?goog.object.get(this.childIndex_,a)||null:null};goog.ui.Component.prototype.getChildAt=function(a){return this.children_?this.children_[a]||null:null};
goog.ui.Component.prototype.forEachChild=function(a,b){this.children_&&goog.array.forEach(this.children_,a,b)};goog.ui.Component.prototype.indexOfChild=function(a){return this.children_&&a?goog.array.indexOf(this.children_,a):-1};
goog.ui.Component.prototype.removeChild=function(a,b){if(a){var c=goog.isString(a)?a:a.getId();a=this.getChild(c);if(c&&a){goog.object.remove(this.childIndex_,c);goog.array.remove(this.children_,a);if(b){a.exitDocument();a.element_&&goog.dom.removeNode(a.element_)}a.setParent(null)}}if(!a)throw Error(goog.ui.Component.Error.NOT_OUR_CHILD);return a};goog.ui.Component.prototype.removeChildAt=function(a,b){return this.removeChild(this.getChildAt(a),b)};
goog.ui.Component.prototype.removeChildren=function(a){for(;this.hasChildren();)this.removeChildAt(0,a)};goog.ui.RangeModel=function(){goog.events.EventTarget.call(this)};goog.inherits(goog.ui.RangeModel,goog.events.EventTarget);goog.ui.RangeModel.prototype.value_=0;goog.ui.RangeModel.prototype.minimum_=0;goog.ui.RangeModel.prototype.maximum_=100;goog.ui.RangeModel.prototype.extent_=0;goog.ui.RangeModel.prototype.step_=1;goog.ui.RangeModel.prototype.isChanging_=false;
goog.ui.RangeModel.prototype.mute_=false;goog.ui.RangeModel.prototype.setMute=function(a){this.mute_=a};goog.ui.RangeModel.prototype.setValue=function(a){a=this.roundToStepWithMin(a);if(this.value_!=a){this.value_=a+this.extent_>this.maximum_?this.maximum_-this.extent_:a<this.minimum_?this.minimum_:a;!this.isChanging_&&!this.mute_&&this.dispatchEvent(goog.ui.Component.EventType.CHANGE)}};goog.ui.RangeModel.prototype.getValue=function(){return this.roundToStepWithMin(this.value_)};
goog.ui.RangeModel.prototype.setExtent=function(a){a=this.roundToStepWithMin(a);if(this.extent_!=a){this.extent_=a<0?0:this.value_+a>this.maximum_?this.maximum_-this.value_:a;!this.isChanging_&&!this.mute_&&this.dispatchEvent(goog.ui.Component.EventType.CHANGE)}};goog.ui.RangeModel.prototype.getExtent=function(){return this.roundToStep(this.extent_)};
goog.ui.RangeModel.prototype.setMinimum=function(a){if(this.minimum_!=a){var b=this.isChanging_;this.isChanging_=true;this.minimum_=a;if(a+this.extent_>this.maximum_)this.extent_=this.maximum_-this.minimum_;a>this.value_&&this.setValue(a);if(a>this.maximum_){this.extent_=0;this.setMaximum(a);this.setValue(a)}this.isChanging_=b;!this.isChanging_&&!this.mute_&&this.dispatchEvent(goog.ui.Component.EventType.CHANGE)}};goog.ui.RangeModel.prototype.getMinimum=function(){return this.roundToStepWithMin(this.minimum_)};
goog.ui.RangeModel.prototype.setMaximum=function(a){a=this.roundToStepWithMin(a);if(this.maximum_!=a){var b=this.isChanging_;this.isChanging_=true;this.maximum_=a;a<this.value_+this.extent_&&this.setValue(a-this.extent_);if(a<this.minimum_){this.extent_=0;this.setMinimum(a);this.setValue(this.maximum_)}if(a<this.minimum_+this.extent_)this.extent_=this.maximum_-this.minimum_;this.isChanging_=b;!this.isChanging_&&!this.mute_&&this.dispatchEvent(goog.ui.Component.EventType.CHANGE)}};
goog.ui.RangeModel.prototype.getMaximum=function(){return this.roundToStepWithMin(this.maximum_)};goog.ui.RangeModel.prototype.getStep=function(){return this.step_};goog.ui.RangeModel.prototype.setStep=function(a){if(this.step_!=a){this.step_=a;a=this.isChanging_;this.isChanging_=true;this.setMaximum(this.getMaximum());this.setExtent(this.getExtent());this.setValue(this.getValue());this.isChanging_=a;!this.isChanging_&&!this.mute_&&this.dispatchEvent(goog.ui.Component.EventType.CHANGE)}};
goog.ui.RangeModel.prototype.roundToStepWithMin=function(a){if(this.step_==null)return a;return this.minimum_+Math.round((a-this.minimum_)/this.step_)*this.step_};goog.ui.RangeModel.prototype.roundToStep=function(a){if(this.step_==null)return a;return Math.round(a/this.step_)*this.step_};goog.ui.SliderBase=function(a){goog.ui.Component.call(this,a);this.rangeModel=new goog.ui.RangeModel;goog.events.listen(this.rangeModel,goog.ui.Component.EventType.CHANGE,this.handleRangeModelChange,false,this)};
goog.inherits(goog.ui.SliderBase,goog.ui.Component);goog.ui.SliderBase.Orientation={VERTICAL:"vertical",HORIZONTAL:"horizontal"};goog.ui.SliderBase.prototype.orientation_=goog.ui.SliderBase.Orientation.HORIZONTAL;goog.ui.SliderBase.MOUSE_DOWN_INCREMENT_INTERVAL_=200;goog.ui.SliderBase.ANIMATION_INTERVAL_=100;goog.ui.SliderBase.prototype.isAnimating_=false;goog.ui.SliderBase.prototype.moveToPointEnabled_=false;goog.ui.SliderBase.prototype.blockIncrement_=10;
goog.ui.SliderBase.prototype.minExtent_=0;goog.ui.SliderBase.prototype.createDom=function(){goog.ui.SliderBase.superClass_.createDom.call(this);this.decorateInternal(this.getDomHelper().createDom("div",this.getCssClass(this.orientation_)))};goog.ui.SliderBase.prototype.decorateInternal=function(a){goog.ui.SliderBase.superClass_.decorateInternal.call(this,a);goog.dom.classes.add(a,this.getCssClass(this.orientation_));this.createThumbs();this.setAriaRoles()};
goog.ui.SliderBase.prototype.enterDocument=function(){goog.ui.SliderBase.superClass_.enterDocument.call(this);this.valueDragger_=new goog.fx.Dragger(this.valueThumb);this.extentDragger_=new goog.fx.Dragger(this.extentThumb);this.valueDragger_.defaultAction=this.extentDragger_.defaultAction=goog.nullFunction;this.keyHandler_=new goog.events.KeyHandler(this.getElement());this.mouseWheelHandler_=new goog.events.MouseWheelHandler(this.getElement());this.getHandler().listen(this.valueDragger_,goog.fx.Dragger.EventType.BEFOREDRAG,
this.handleBeforeDrag_).listen(this.extentDragger_,goog.fx.Dragger.EventType.BEFOREDRAG,this.handleBeforeDrag_).listen(this.keyHandler_,goog.events.KeyHandler.EventType.KEY,this.handleKeyDown_).listen(this.getElement(),goog.events.EventType.MOUSEDOWN,this.handleMouseDown_).listen(this.mouseWheelHandler_,goog.events.MouseWheelHandler.EventType.MOUSEWHEEL,this.handleMouseWheel_);this.getElement().tabIndex=0;this.updateUi_()};
goog.ui.SliderBase.prototype.handleBeforeDrag_=function(a){var b=a.dragger==this.valueDragger_?this.valueThumb:this.extentThumb,c;if(this.orientation_==goog.ui.SliderBase.Orientation.VERTICAL){c=this.getElement().clientHeight-b.offsetHeight;c=(c-a.top)/c*(this.getMaximum()-this.getMinimum())+this.getMinimum()}else{c=this.getElement().clientWidth-b.offsetWidth;c=a.left/c*(this.getMaximum()-this.getMinimum())+this.getMinimum()}c=a.dragger==this.valueDragger_?Math.min(Math.max(c,this.getMinimum()),this.getValue()+
this.getExtent()):Math.min(Math.max(c,this.getValue()),this.getMaximum());this.setThumbPosition_(b,c)};
goog.ui.SliderBase.prototype.handleKeyDown_=function(a){var b=true;switch(a.keyCode){case goog.events.KeyCodes.HOME:this.animatedSetValue(this.getMinimum());break;case goog.events.KeyCodes.END:this.animatedSetValue(this.getMaximum());break;case goog.events.KeyCodes.PAGE_UP:this.moveThumbs(this.getBlockIncrement());break;case goog.events.KeyCodes.PAGE_DOWN:this.moveThumbs(-this.getBlockIncrement());break;case goog.events.KeyCodes.LEFT:case goog.events.KeyCodes.DOWN:this.moveThumbs(a.shiftKey?-this.getBlockIncrement():
-this.getUnitIncrement());break;case goog.events.KeyCodes.RIGHT:case goog.events.KeyCodes.UP:this.moveThumbs(a.shiftKey?this.getBlockIncrement():this.getUnitIncrement());break;default:b=false}b&&a.preventDefault()};
goog.ui.SliderBase.prototype.handleMouseDown_=function(a){this.getElement().focus&&this.getElement().focus();var b=a.target;if(!goog.dom.contains(this.valueThumb,b)&&!goog.dom.contains(this.extentThumb,b))this.moveToPointEnabled_?this.animatedSetValue(this.getValueFromMousePosition_(a)):this.startBlockIncrementing_(a)};goog.ui.SliderBase.prototype.handleMouseWheel_=function(a){this.moveThumbs((a.detail>0?-1:1)*this.getUnitIncrement());a.preventDefault()};
goog.ui.SliderBase.prototype.startBlockIncrementing_=function(a){this.storeMousePos_(a);this.thumbToMove_=this.getClosestThumb_(this.getValueFromMousePosition_(a));this.incrementing_=this.orientation_==goog.ui.SliderBase.Orientation.VERTICAL?this.lastMousePosition_<this.thumbToMove_.offsetTop:this.lastMousePosition_>this.thumbToMove_.offsetLeft+this.thumbToMove_.offsetWidth;a=goog.dom.getOwnerDocument(this.getElement());this.getHandler().listen(a,goog.events.EventType.MOUSEUP,this.handleMouseUp_,
true).listen(this.getElement(),goog.events.EventType.MOUSEMOVE,this.storeMousePos_);if(!this.incTimer_){this.incTimer_=new goog.Timer(goog.ui.SliderBase.MOUSE_DOWN_INCREMENT_INTERVAL_);this.getHandler().listen(this.incTimer_,goog.Timer.TICK,this.handleTimerTick_)}this.handleTimerTick_();this.incTimer_.start()};
goog.ui.SliderBase.prototype.handleTimerTick_=function(){var a;if(this.orientation_==goog.ui.SliderBase.Orientation.VERTICAL){var b=this.lastMousePosition_,c=this.thumbToMove_.offsetTop;if(this.incrementing_){if(b<c)a=this.getThumbPosition_(this.thumbToMove_)+this.getBlockIncrement()}else if(b>c+this.thumbToMove_.offsetHeight)a=this.getThumbPosition_(this.thumbToMove_)-this.getBlockIncrement()}else{b=this.lastMousePosition_;c=this.thumbToMove_.offsetLeft;if(this.incrementing_){if(b>c+this.thumbToMove_.offsetWidth)a=
this.getThumbPosition_(this.thumbToMove_)+this.getBlockIncrement()}else if(b<c)a=this.getThumbPosition_(this.thumbToMove_)-this.getBlockIncrement()}goog.isDef(a)&&this.setThumbPosition_(this.thumbToMove_,a)};goog.ui.SliderBase.prototype.handleMouseUp_=function(){this.incTimer_&&this.incTimer_.stop();var a=goog.dom.getOwnerDocument(this.getElement());this.getHandler().unlisten(a,goog.events.EventType.MOUSEUP,this.handleMouseUp_,true).unlisten(this.getElement(),goog.events.EventType.MOUSEMOVE,this.storeMousePos_)};
goog.ui.SliderBase.prototype.getRelativeMousePos_=function(a){a=goog.style.getRelativePosition(a,this.getElement());return this.orientation_==goog.ui.SliderBase.Orientation.VERTICAL?a.y:a.x};goog.ui.SliderBase.prototype.storeMousePos_=function(a){this.lastMousePosition_=this.getRelativeMousePos_(a)};
goog.ui.SliderBase.prototype.getValueFromMousePosition_=function(a){var b=this.getMinimum(),c=this.getMaximum();if(this.orientation_==goog.ui.SliderBase.Orientation.VERTICAL){var d=this.valueThumb.offsetHeight,e=this.getElement().clientHeight-d;a=this.getRelativeMousePos_(a)-d/2;return(c-b)*(e-a)/e+b}else{d=this.valueThumb.offsetWidth;e=this.getElement().clientWidth-d;a=this.getRelativeMousePos_(a)-d/2;return(c-b)*a/e+b}};
goog.ui.SliderBase.prototype.getThumbPosition_=function(a){if(a==this.valueThumb)return this.rangeModel.getValue();else if(a==this.extentThumb)return this.rangeModel.getValue()+this.rangeModel.getExtent();else throw Error("Illegal thumb element. Neither minThumb nor maxThumb");};
goog.ui.SliderBase.prototype.moveThumbs=function(a){var b=this.getThumbPosition_(this.valueThumb)+a;a=this.getThumbPosition_(this.extentThumb)+a;b=goog.math.clamp(b,this.getMinimum(),this.getMaximum()-this.minExtent_);a=goog.math.clamp(a,this.getMinimum()+this.minExtent_,this.getMaximum());this.setValueAndExtent(b,a-b)};
goog.ui.SliderBase.prototype.setThumbPosition_=function(a,b){var c=null;if(a==this.extentThumb&&b<=this.rangeModel.getMaximum()&&b>=this.rangeModel.getValue()+this.minExtent_)c=b-this.rangeModel.getValue();var d=c||this.rangeModel.getExtent();if(a==this.valueThumb&&b>=this.getMinimum()&&b<=this.rangeModel.getValue()+d-this.minExtent_){d=d-(b-this.rangeModel.getValue());if(this.rangeModel.roundToStepWithMin(b)+this.rangeModel.roundToStepWithMin(d)==this.rangeModel.roundToStepWithMin(b+d)){this.setValueAndExtent(b,
d);c=null}}c!=null&&this.rangeModel.setExtent(c)};goog.ui.SliderBase.prototype.setValueAndExtent=function(a,b){if(this.getMinimum()<=a&&a<=this.getMaximum()-b&&this.minExtent_<=b&&b<=this.getMaximum()-a)if(!(a==this.getValue()&&b==this.getExtent())){this.rangeModel.setMute(true);this.rangeModel.setExtent(0);this.rangeModel.setValue(a);this.rangeModel.setExtent(b);this.rangeModel.setMute(false);this.updateUi_();this.dispatchEvent(goog.ui.Component.EventType.CHANGE)}};
goog.ui.SliderBase.prototype.getMinimum=function(){return this.rangeModel.getMinimum()};goog.ui.SliderBase.prototype.setMinimum=function(a){this.rangeModel.setMinimum(a)};goog.ui.SliderBase.prototype.getMaximum=function(){return this.rangeModel.getMaximum()};goog.ui.SliderBase.prototype.setMaximum=function(a){this.rangeModel.setMaximum(a)};goog.ui.SliderBase.prototype.getValueThumb=function(){return this.valueThumb};goog.ui.SliderBase.prototype.getExtentThumb=function(){return this.extentThumb};
goog.ui.SliderBase.prototype.getClosestThumb_=function(a){return a<=this.rangeModel.getValue()+this.rangeModel.getExtent()/2?this.valueThumb:this.extentThumb};goog.ui.SliderBase.prototype.handleRangeModelChange=function(){this.updateUi_();this.updateAriaStates();this.dispatchEvent(goog.ui.Component.EventType.CHANGE)};
goog.ui.SliderBase.prototype.updateUi_=function(){if(this.valueThumb&&!this.isAnimating_){var a=this.getThumbCoordinateForValue_(this.getThumbPosition_(this.valueThumb)),b=this.getThumbCoordinateForValue_(this.getThumbPosition_(this.extentThumb));if(this.orientation_==goog.ui.SliderBase.Orientation.VERTICAL){this.valueThumb.style.top=a.y+"px";this.extentThumb.style.top=b.y+"px"}else{this.valueThumb.style.left=a.x+"px";this.extentThumb.style.left=b.x+"px"}}};
goog.ui.SliderBase.prototype.getThumbCoordinateForValue_=function(a){var b=new goog.math.Coordinate;if(this.valueThumb){var c=this.getMinimum(),d=this.getMaximum();a=a==c&&c==d?0:(a-c)/(d-c);if(this.orientation_==goog.ui.SliderBase.Orientation.VERTICAL){c=this.valueThumb.offsetHeight;c=this.getElement().clientHeight-c;b.y=c-Math.round(a*c)}else{c=this.getElement().clientWidth-this.valueThumb.offsetWidth;b.x=Math.round(a*c)}}return b};
goog.ui.SliderBase.prototype.animatedSetValue=function(a){a=Math.min(this.getMaximum(),Math.max(a,this.getMinimum()));this.currentAnimation_&&this.currentAnimation_.stop(true);var b=this.getClosestThumb_(a),c=this.getThumbCoordinateForValue_(a);this.currentAnimation_=c=new goog.fx.dom.SlideFrom(b,this.orientation_==goog.ui.SliderBase.Orientation.VERTICAL?[b.offsetLeft,c.y]:[c.x,b.offsetTop],goog.ui.SliderBase.ANIMATION_INTERVAL_);this.getHandler().listen(c,goog.fx.Animation.EventType.END,this.endAnimation_);
this.isAnimating_=true;this.setThumbPosition_(b,a);c.play(false)};goog.ui.SliderBase.prototype.endAnimation_=function(){this.isAnimating_=false};goog.ui.SliderBase.prototype.setOrientation=function(a){if(this.orientation_!=a){var b=this.getCssClass(this.orientation_),c=this.getCssClass(a);this.orientation_=a;if(this.getElement()){goog.dom.classes.swap(this.getElement(),b,c);this.valueThumb.style.left=this.valueThumb.style.top="";this.extentThumb.style.left=this.extentThumb.style.top="";this.updateUi_()}}};
goog.ui.SliderBase.prototype.getOrientation=function(){return this.orientation_};
goog.ui.SliderBase.prototype.disposeInternal=function(){goog.ui.SliderBase.superClass_.disposeInternal.call(this);this.incTimer_&&this.incTimer_.dispose();delete this.incTimer_;this.currentAnimation_&&this.currentAnimation_.dispose();delete this.currentAnimation_;delete this.valueThumb;delete this.extentThumb;this.rangeModel.dispose();delete this.rangeModel;if(this.keyHandler_){this.keyHandler_.dispose();delete this.keyHandler_}if(this.mouseWheelHandler_){this.mouseWheelHandler_.dispose();delete this.mouseWheelHandler_}};
goog.ui.SliderBase.prototype.getBlockIncrement=function(){return this.blockIncrement_};goog.ui.SliderBase.prototype.setBlockIncrement=function(a){this.blockIncrement_=a};goog.ui.SliderBase.prototype.setMinExtent=function(a){this.minExtent_=a};goog.ui.SliderBase.prototype.unitIncrement_=1;goog.ui.SliderBase.prototype.getUnitIncrement=function(){return this.unitIncrement_};goog.ui.SliderBase.prototype.setUnitIncrement=function(a){this.unitIncrement_=a};goog.ui.SliderBase.prototype.getStep=function(){return this.rangeModel.getStep()};
goog.ui.SliderBase.prototype.setStep=function(a){this.rangeModel.setStep(a)};goog.ui.SliderBase.prototype.getMoveToPointEnabled=function(){return this.moveToPointEnabled_};goog.ui.SliderBase.prototype.setMoveToPointEnabled=function(a){this.moveToPointEnabled_=a};goog.ui.SliderBase.prototype.getValue=function(){return this.rangeModel.getValue()};goog.ui.SliderBase.prototype.setValue=function(a){this.setThumbPosition_(this.valueThumb,a)};goog.ui.SliderBase.prototype.getExtent=function(){return this.rangeModel.getExtent()};
goog.ui.SliderBase.prototype.setExtent=function(a){this.setThumbPosition_(this.extentThumb,this.rangeModel.getValue()+a)};goog.ui.SliderBase.prototype.setVisible=function(a){goog.style.showElement(this.getElement(),a);a&&this.updateUi_()};goog.ui.SliderBase.prototype.setAriaRoles=function(){goog.dom.a11y.setRole(this.getElement(),goog.dom.a11y.Role.SLIDER);this.updateAriaStates()};
goog.ui.SliderBase.prototype.updateAriaStates=function(){var a=this.getElement();if(a){goog.dom.a11y.setState(a,goog.dom.a11y.State.VALUEMIN,this.getMinimum());goog.dom.a11y.setState(a,goog.dom.a11y.State.VALUEMAX,this.getMaximum());goog.dom.a11y.setState(a,goog.dom.a11y.State.VALUENOW,this.getValue())}};goog.ui.Slider=function(a){goog.ui.SliderBase.call(this,a);this.rangeModel.setExtent(0)};goog.inherits(goog.ui.Slider,goog.ui.SliderBase);goog.ui.Slider.Orientation=goog.ui.SliderBase.Orientation;
goog.ui.Slider.CSS_CLASS_PREFIX="goog-slider";goog.ui.Slider.THUMB_CSS_CLASS=goog.ui.Slider.CSS_CLASS_PREFIX+"-thumb";goog.ui.Slider.prototype.getCssClass=function(a){return a==goog.ui.SliderBase.Orientation.VERTICAL?goog.ui.Slider.CSS_CLASS_PREFIX+"-vertical":goog.ui.Slider.CSS_CLASS_PREFIX+"-horizontal"};
goog.ui.Slider.prototype.createThumbs=function(){var a=this.getElement(),b=goog.dom.getElementsByTagNameAndClass(null,goog.ui.Slider.THUMB_CSS_CLASS,a)[0];if(!b){b=this.createThumb_();a.appendChild(b)}this.valueThumb=this.extentThumb=b};goog.ui.Slider.prototype.createThumb_=function(){var a=this.getDomHelper().createDom("div",goog.ui.Slider.THUMB_CSS_CLASS);goog.dom.a11y.setRole(a,goog.dom.a11y.Role.BUTTON);return a};goog.ui.ControlContent={};goog.ui.ControlRenderer=function(){};goog.addSingletonGetter(goog.ui.ControlRenderer);
goog.ui.ControlRenderer.getCustomRenderer=function(a,b){var c=new a;c.getCssClass=function(){return b};return c};goog.ui.ControlRenderer.CSS_CLASS="goog-control";goog.ui.ControlRenderer.IE6_CLASS_COMBINATIONS=[];goog.ui.ControlRenderer.prototype.getAriaRole=function(){};goog.ui.ControlRenderer.prototype.createDom=function(a){return a.getDomHelper().createDom("div",this.getClassNames(a).join(" "),a.getContent())};goog.ui.ControlRenderer.prototype.getContentElement=function(a){return a};
goog.ui.ControlRenderer.prototype.enableClassName=function(a,b,c){if(a=a.getElement?a.getElement():a)if(goog.userAgent.IE&&!goog.userAgent.isVersion("7")){var d=this.getAppliedCombinedClassNames_(goog.dom.classes.get(a),b);d.push(b);goog.partial(c?goog.dom.classes.add:goog.dom.classes.remove,a).apply(null,d)}else goog.dom.classes.enable(a,b,c)};goog.ui.ControlRenderer.prototype.enableExtraClassName=function(a,b,c){this.enableClassName(a,b,c)};goog.ui.ControlRenderer.prototype.canDecorate=function(){return true};
goog.ui.ControlRenderer.prototype.decorate=function(a,b){b.id&&a.setId(b.id);var c=this.getContentElement(b);c&&c.firstChild?a.setContentInternal(c.firstChild.nextSibling?goog.array.clone(c.childNodes):c.firstChild):a.setContentInternal(null);var d=0,e=this.getCssClass(),f=this.getStructuralCssClass(),g=false,h=false;c=false;var k=goog.dom.classes.get(b);goog.array.forEach(k,function(n){if(!g&&n==e){g=true;if(f==e)h=true}else if(!h&&n==f)h=true;else d|=this.getStateFromClass(n)},this);a.setStateInternal(d);
if(!g){k.push(e);if(f==e)h=true}h||k.push(f);var l=a.getExtraClassNames();l&&k.push.apply(k,l);if(goog.userAgent.IE&&!goog.userAgent.isVersion("7")){var m=this.getAppliedCombinedClassNames_(k);if(m.length>0){k.push.apply(k,m);c=true}}if(!g||!h||l||c)goog.dom.classes.set(b,k.join(" "));return b};goog.ui.ControlRenderer.prototype.initializeDom=function(a){a.isRightToLeft()&&this.setRightToLeft(a.getElement(),true);a.isEnabled()&&this.setFocusable(a,a.isVisible())};
goog.ui.ControlRenderer.prototype.setAriaRole=function(a){var b=this.getAriaRole();b&&goog.dom.a11y.setRole(a,b)};goog.ui.ControlRenderer.prototype.setAllowTextSelection=function(a,b){goog.style.setUnselectable(a,!b,!goog.userAgent.IE&&!goog.userAgent.OPERA)};goog.ui.ControlRenderer.prototype.setRightToLeft=function(a,b){this.enableClassName(a,this.getStructuralCssClass()+"-rtl",b)};
goog.ui.ControlRenderer.prototype.isFocusable=function(a){var b;if(a.isSupportedState(goog.ui.Component.State.FOCUSED)&&(b=a.getKeyEventTarget()))return goog.dom.isFocusableTabIndex(b);return false};goog.ui.ControlRenderer.prototype.setFocusable=function(a,b){var c;if(a.isSupportedState(goog.ui.Component.State.FOCUSED)&&(c=a.getKeyEventTarget())){if(!b&&a.isFocused()){try{c.blur()}catch(d){}a.isFocused()&&a.handleBlur(null)}goog.dom.isFocusableTabIndex(c)!=b&&goog.dom.setFocusableTabIndex(c,b)}};
goog.ui.ControlRenderer.prototype.setVisible=function(a,b){goog.style.showElement(a,b)};goog.ui.ControlRenderer.prototype.setState=function(a,b,c){var d=a.getElement();if(d){var e=this.getClassForState(b);e&&this.enableClassName(a,e,c);this.updateAriaState(d,b,c)}};
goog.ui.ControlRenderer.prototype.updateAriaState=function(a,b,c){if(!goog.ui.ControlRenderer.ARIA_STATE_MAP_)goog.ui.ControlRenderer.ARIA_STATE_MAP_=goog.object.create(goog.ui.Component.State.DISABLED,goog.dom.a11y.State.DISABLED,goog.ui.Component.State.ACTIVE,goog.dom.a11y.State.PRESSED,goog.ui.Component.State.SELECTED,goog.dom.a11y.State.SELECTED,goog.ui.Component.State.CHECKED,goog.dom.a11y.State.CHECKED,goog.ui.Component.State.OPENED,goog.dom.a11y.State.EXPANDED);(b=goog.ui.ControlRenderer.ARIA_STATE_MAP_[b])&&
goog.dom.a11y.setState(a,b,c)};goog.ui.ControlRenderer.prototype.setContent=function(a,b){var c=this.getContentElement(a);if(c){goog.dom.removeChildren(c);if(b)if(goog.isString(b))goog.dom.setTextContent(c,b);else{var d=function(e){if(e){var f=goog.dom.getOwnerDocument(c);c.appendChild(goog.isString(e)?f.createTextNode(e):e)}};if(goog.isArray(b))goog.array.forEach(b,d);else goog.isArrayLike(b)&&!("nodeType"in b)?goog.array.forEach(goog.array.clone(b),d):d(b)}}};
goog.ui.ControlRenderer.prototype.getKeyEventTarget=function(a){return a.getElement()};goog.ui.ControlRenderer.prototype.getCssClass=function(){return goog.ui.ControlRenderer.CSS_CLASS};goog.ui.ControlRenderer.prototype.getIe6ClassCombinations=function(){return[]};goog.ui.ControlRenderer.prototype.getStructuralCssClass=function(){return this.getCssClass()};
goog.ui.ControlRenderer.prototype.getClassNames=function(a){var b=this.getCssClass(),c=[b],d=this.getStructuralCssClass();d!=b&&c.push(d);b=this.getClassNamesForState(a.getState());c.push.apply(c,b);(a=a.getExtraClassNames())&&c.push.apply(c,a);goog.userAgent.IE&&!goog.userAgent.isVersion("7")&&c.push.apply(c,this.getAppliedCombinedClassNames_(c));return c};
goog.ui.ControlRenderer.prototype.getAppliedCombinedClassNames_=function(a,b){var c=[];if(b)a=a.concat([b]);goog.array.forEach(this.getIe6ClassCombinations(),function(d){if(goog.array.every(d,goog.partial(goog.array.contains,a))&&(!b||goog.array.contains(d,b)))c.push(d.join("_"))});return c};goog.ui.ControlRenderer.prototype.getClassNamesForState=function(a){for(var b=[];a;){var c=a&-a;b.push(this.getClassForState(c));a&=~c}return b};
goog.ui.ControlRenderer.prototype.getClassForState=function(a){this.classByState_||this.createClassByStateMap_();return this.classByState_[a]};goog.ui.ControlRenderer.prototype.getStateFromClass=function(a){this.stateByClass_||this.createStateByClassMap_();a=parseInt(this.stateByClass_[a],10);return isNaN(a)?0:a};
goog.ui.ControlRenderer.prototype.createClassByStateMap_=function(){var a=this.getStructuralCssClass();this.classByState_=goog.object.create(goog.ui.Component.State.DISABLED,a+"-disabled",goog.ui.Component.State.HOVER,a+"-hover",goog.ui.Component.State.ACTIVE,a+"-active",goog.ui.Component.State.SELECTED,a+"-selected",goog.ui.Component.State.CHECKED,a+"-checked",goog.ui.Component.State.FOCUSED,a+"-focused",goog.ui.Component.State.OPENED,a+"-open")};
goog.ui.ControlRenderer.prototype.createStateByClassMap_=function(){this.classByState_||this.createClassByStateMap_();this.stateByClass_=goog.object.transpose(this.classByState_)};goog.ui.registry={};goog.ui.registry.getDefaultRenderer=function(a){for(var b;a;){b=goog.getUid(a);if(b=goog.ui.registry.defaultRenderers_[b])break;a=a.superClass_?a.superClass_.constructor:null}if(b)return goog.isFunction(b.getInstance)?b.getInstance():new b;return null};
goog.ui.registry.setDefaultRenderer=function(a,b){if(!goog.isFunction(a))throw Error("Invalid component class "+a);if(!goog.isFunction(b))throw Error("Invalid renderer class "+b);var c=goog.getUid(a);goog.ui.registry.defaultRenderers_[c]=b};goog.ui.registry.getDecoratorByClassName=function(a){return a in goog.ui.registry.decoratorFunctions_?goog.ui.registry.decoratorFunctions_[a]():null};
goog.ui.registry.setDecoratorByClassName=function(a,b){if(!a)throw Error("Invalid class name "+a);if(!goog.isFunction(b))throw Error("Invalid decorator function "+b);goog.ui.registry.decoratorFunctions_[a]=b};goog.ui.registry.getDecorator=function(a){for(var b=goog.dom.classes.get(a),c=0,d=b.length;c<d;c++)if(a=goog.ui.registry.getDecoratorByClassName(b[c]))return a;return null};goog.ui.registry.reset=function(){goog.ui.registry.defaultRenderers_={};goog.ui.registry.decoratorFunctions_={}};
goog.ui.registry.defaultRenderers_={};goog.ui.registry.decoratorFunctions_={};goog.ui.decorate=function(a){var b=goog.ui.registry.getDecorator(a);b&&b.decorate(a);return b};goog.ui.Control=function(a,b,c){goog.ui.Component.call(this,c);this.renderer_=b||goog.ui.registry.getDefaultRenderer(this.constructor);this.setContentInternal(a)};goog.inherits(goog.ui.Control,goog.ui.Component);goog.ui.Control.registerDecorator=goog.ui.registry.setDecoratorByClassName;goog.ui.Control.getDecorator=goog.ui.registry.getDecorator;
goog.ui.Control.decorate=goog.ui.decorate;goog.ui.Control.prototype.content_=null;goog.ui.Control.prototype.state_=0;goog.ui.Control.prototype.supportedStates_=goog.ui.Component.State.DISABLED|goog.ui.Component.State.HOVER|goog.ui.Component.State.ACTIVE|goog.ui.Component.State.FOCUSED;goog.ui.Control.prototype.autoStates_=goog.ui.Component.State.ALL;goog.ui.Control.prototype.statesWithTransitionEvents_=0;goog.ui.Control.prototype.visible_=true;goog.ui.Control.prototype.extraClassNames_=null;
goog.ui.Control.prototype.handleMouseEvents_=true;goog.ui.Control.prototype.allowTextSelection_=false;goog.ui.Control.prototype.isHandleMouseEvents=function(){return this.handleMouseEvents_};goog.ui.Control.prototype.setHandleMouseEvents=function(a){this.isInDocument()&&a!=this.handleMouseEvents_&&this.enableMouseEventHandling_(a);this.handleMouseEvents_=a};goog.ui.Control.prototype.getKeyEventTarget=function(){return this.renderer_.getKeyEventTarget(this)};
goog.ui.Control.prototype.getKeyHandler=function(){return this.keyHandler_||(this.keyHandler_=new goog.events.KeyHandler)};goog.ui.Control.prototype.getRenderer=function(){return this.renderer_};goog.ui.Control.prototype.setRenderer=function(a){if(this.isInDocument())throw Error(goog.ui.Component.Error.ALREADY_RENDERED);this.getElement()&&this.setElementInternal(null);this.renderer_=a};goog.ui.Control.prototype.getExtraClassNames=function(){return this.extraClassNames_};
goog.ui.Control.prototype.addClassName=function(a){if(a){if(this.extraClassNames_)goog.array.contains(this.extraClassNames_,a)||this.extraClassNames_.push(a);else this.extraClassNames_=[a];this.renderer_.enableExtraClassName(this,a,true)}};goog.ui.Control.prototype.removeClassName=function(a){if(a&&this.extraClassNames_){goog.array.remove(this.extraClassNames_,a);if(this.extraClassNames_.length==0)this.extraClassNames_=null;this.renderer_.enableExtraClassName(this,a,false)}};
goog.ui.Control.prototype.enableClassName=function(a,b){b?this.addClassName(a):this.removeClassName(a)};goog.ui.Control.prototype.createDom=function(){var a=this.renderer_.createDom(this);this.setElementInternal(a);this.renderer_.setAriaRole(a);this.isAllowTextSelection()||this.renderer_.setAllowTextSelection(a,false);this.isVisible()||this.renderer_.setVisible(a,false)};goog.ui.Control.prototype.getContentElement=function(){return this.renderer_.getContentElement(this.getElement())};
goog.ui.Control.prototype.canDecorate=function(a){return this.renderer_.canDecorate(a)};goog.ui.Control.prototype.decorateInternal=function(a){a=this.renderer_.decorate(this,a);this.setElementInternal(a);this.renderer_.setAriaRole(a);this.isAllowTextSelection()||this.renderer_.setAllowTextSelection(a,false);this.visible_=a.style.display!="none"};
goog.ui.Control.prototype.enterDocument=function(){goog.ui.Control.superClass_.enterDocument.call(this);this.renderer_.initializeDom(this);if(this.supportedStates_&~goog.ui.Component.State.DISABLED){this.isHandleMouseEvents()&&this.enableMouseEventHandling_(true);if(this.isSupportedState(goog.ui.Component.State.FOCUSED)){var a=this.getKeyEventTarget();if(a){var b=this.getKeyHandler();b.attach(a);this.getHandler().listen(b,goog.events.KeyHandler.EventType.KEY,this.handleKeyEvent).listen(a,goog.events.EventType.FOCUS,
this.handleFocus).listen(a,goog.events.EventType.BLUR,this.handleBlur)}}}};
goog.ui.Control.prototype.enableMouseEventHandling_=function(a){var b=this.getHandler(),c=this.getElement();if(a){b.listen(c,goog.events.EventType.MOUSEOVER,this.handleMouseOver).listen(c,goog.events.EventType.MOUSEDOWN,this.handleMouseDown).listen(c,goog.events.EventType.MOUSEUP,this.handleMouseUp).listen(c,goog.events.EventType.MOUSEOUT,this.handleMouseOut);goog.userAgent.IE&&b.listen(c,goog.events.EventType.DBLCLICK,this.handleDblClick)}else{b.unlisten(c,goog.events.EventType.MOUSEOVER,this.handleMouseOver).unlisten(c,
goog.events.EventType.MOUSEDOWN,this.handleMouseDown).unlisten(c,goog.events.EventType.MOUSEUP,this.handleMouseUp).unlisten(c,goog.events.EventType.MOUSEOUT,this.handleMouseOut);goog.userAgent.IE&&b.unlisten(c,goog.events.EventType.DBLCLICK,this.handleDblClick)}};goog.ui.Control.prototype.exitDocument=function(){goog.ui.Control.superClass_.exitDocument.call(this);this.keyHandler_&&this.keyHandler_.detach();this.isVisible()&&this.isEnabled()&&this.renderer_.setFocusable(this,false)};
goog.ui.Control.prototype.disposeInternal=function(){goog.ui.Control.superClass_.disposeInternal.call(this);if(this.keyHandler_){this.keyHandler_.dispose();delete this.keyHandler_}delete this.renderer_;this.extraClassNames_=this.content_=null};goog.ui.Control.prototype.getContent=function(){return this.content_};goog.ui.Control.prototype.setContent=function(a){this.renderer_.setContent(this.getElement(),a);this.setContentInternal(a)};
goog.ui.Control.prototype.setContentInternal=function(a){this.content_=a};goog.ui.Control.prototype.getCaption=function(){var a=this.getContent();if(!a)return"";if(goog.isString(a))return a;a=goog.isArray(a)?goog.array.map(a,goog.dom.getTextContent).join(""):goog.dom.getTextContent(a);return goog.string.trim(a)};goog.ui.Control.prototype.setCaption=function(a){this.setContent(a)};
goog.ui.Control.prototype.setRightToLeft=function(a){goog.ui.Control.superClass_.setRightToLeft.call(this,a);var b=this.getElement();b&&this.renderer_.setRightToLeft(b,a)};goog.ui.Control.prototype.isAllowTextSelection=function(){return this.allowTextSelection_};goog.ui.Control.prototype.setAllowTextSelection=function(a){this.allowTextSelection_=a;var b=this.getElement();b&&this.renderer_.setAllowTextSelection(b,a)};goog.ui.Control.prototype.isVisible=function(){return this.visible_};
goog.ui.Control.prototype.setVisible=function(a,b){if(b||this.visible_!=a&&this.dispatchEvent(a?goog.ui.Component.EventType.SHOW:goog.ui.Component.EventType.HIDE)){var c=this.getElement();c&&this.renderer_.setVisible(c,a);this.isEnabled()&&this.renderer_.setFocusable(this,a);this.visible_=a;return true}return false};goog.ui.Control.prototype.isEnabled=function(){return!this.hasState(goog.ui.Component.State.DISABLED)};
goog.ui.Control.prototype.isParentDisabled_=function(){var a=this.getParent();return!!a&&typeof a.isEnabled=="function"&&!a.isEnabled()};goog.ui.Control.prototype.setEnabled=function(a){if(!this.isParentDisabled_()&&this.isTransitionAllowed(goog.ui.Component.State.DISABLED,!a)){if(!a){this.setActive(false);this.setHighlighted(false)}this.isVisible()&&this.renderer_.setFocusable(this,a);this.setState(goog.ui.Component.State.DISABLED,!a)}};goog.ui.Control.prototype.isHighlighted=function(){return this.hasState(goog.ui.Component.State.HOVER)};
goog.ui.Control.prototype.setHighlighted=function(a){this.isTransitionAllowed(goog.ui.Component.State.HOVER,a)&&this.setState(goog.ui.Component.State.HOVER,a)};goog.ui.Control.prototype.isActive=function(){return this.hasState(goog.ui.Component.State.ACTIVE)};goog.ui.Control.prototype.setActive=function(a){this.isTransitionAllowed(goog.ui.Component.State.ACTIVE,a)&&this.setState(goog.ui.Component.State.ACTIVE,a)};goog.ui.Control.prototype.isSelected=function(){return this.hasState(goog.ui.Component.State.SELECTED)};
goog.ui.Control.prototype.setSelected=function(a){this.isTransitionAllowed(goog.ui.Component.State.SELECTED,a)&&this.setState(goog.ui.Component.State.SELECTED,a)};goog.ui.Control.prototype.isChecked=function(){return this.hasState(goog.ui.Component.State.CHECKED)};goog.ui.Control.prototype.setChecked=function(a){this.isTransitionAllowed(goog.ui.Component.State.CHECKED,a)&&this.setState(goog.ui.Component.State.CHECKED,a)};goog.ui.Control.prototype.isFocused=function(){return this.hasState(goog.ui.Component.State.FOCUSED)};
goog.ui.Control.prototype.setFocused=function(a){this.isTransitionAllowed(goog.ui.Component.State.FOCUSED,a)&&this.setState(goog.ui.Component.State.FOCUSED,a)};goog.ui.Control.prototype.isOpen=function(){return this.hasState(goog.ui.Component.State.OPENED)};goog.ui.Control.prototype.setOpen=function(a){this.isTransitionAllowed(goog.ui.Component.State.OPENED,a)&&this.setState(goog.ui.Component.State.OPENED,a)};goog.ui.Control.prototype.getState=function(){return this.state_};
goog.ui.Control.prototype.hasState=function(a){return!!(this.state_&a)};goog.ui.Control.prototype.setState=function(a,b){if(this.isSupportedState(a)&&b!=this.hasState(a)){this.renderer_.setState(this,a,b);this.state_=b?this.state_|a:this.state_&~a}};goog.ui.Control.prototype.setStateInternal=function(a){this.state_=a};goog.ui.Control.prototype.isSupportedState=function(a){return!!(this.supportedStates_&a)};
goog.ui.Control.prototype.setSupportedState=function(a,b){if(this.isInDocument()&&this.hasState(a)&&!b)throw Error(goog.ui.Component.Error.ALREADY_RENDERED);!b&&this.hasState(a)&&this.setState(a,false);this.supportedStates_=b?this.supportedStates_|a:this.supportedStates_&~a};goog.ui.Control.prototype.isAutoState=function(a){return!!(this.autoStates_&a)&&this.isSupportedState(a)};goog.ui.Control.prototype.setAutoStates=function(a,b){this.autoStates_=b?this.autoStates_|a:this.autoStates_&~a};
goog.ui.Control.prototype.isDispatchTransitionEvents=function(a){return!!(this.statesWithTransitionEvents_&a)&&this.isSupportedState(a)};goog.ui.Control.prototype.setDispatchTransitionEvents=function(a,b){this.statesWithTransitionEvents_=b?this.statesWithTransitionEvents_|a:this.statesWithTransitionEvents_&~a};
goog.ui.Control.prototype.isTransitionAllowed=function(a,b){return this.isSupportedState(a)&&this.hasState(a)!=b&&(!(this.statesWithTransitionEvents_&a)||this.dispatchEvent(goog.ui.Component.getStateTransitionEvent(a,b)))&&!this.isDisposed()};goog.ui.Control.prototype.handleMouseOver=function(a){!goog.ui.Control.isMouseEventWithinElement_(a,this.getElement())&&this.dispatchEvent(goog.ui.Component.EventType.ENTER)&&this.isEnabled()&&this.isAutoState(goog.ui.Component.State.HOVER)&&this.setHighlighted(true)};
goog.ui.Control.prototype.handleMouseOut=function(a){if(!goog.ui.Control.isMouseEventWithinElement_(a,this.getElement())&&this.dispatchEvent(goog.ui.Component.EventType.LEAVE)){this.isAutoState(goog.ui.Component.State.ACTIVE)&&this.setActive(false);this.isAutoState(goog.ui.Component.State.HOVER)&&this.setHighlighted(false)}};goog.ui.Control.isMouseEventWithinElement_=function(a,b){return!!a.relatedTarget&&goog.dom.contains(b,a.relatedTarget)};
goog.ui.Control.prototype.handleMouseDown=function(a){if(this.isEnabled()){this.isAutoState(goog.ui.Component.State.HOVER)&&this.setHighlighted(true);if(a.isMouseActionButton()){this.isAutoState(goog.ui.Component.State.ACTIVE)&&this.setActive(true);this.renderer_.isFocusable(this)&&this.getKeyEventTarget().focus()}}!this.isAllowTextSelection()&&a.isMouseActionButton()&&a.preventDefault()};
goog.ui.Control.prototype.handleMouseUp=function(a){if(this.isEnabled()){this.isAutoState(goog.ui.Component.State.HOVER)&&this.setHighlighted(true);this.isActive()&&this.performActionInternal(a)&&this.isAutoState(goog.ui.Component.State.ACTIVE)&&this.setActive(false)}};goog.ui.Control.prototype.handleDblClick=function(a){this.isEnabled()&&this.performActionInternal(a)};
goog.ui.Control.prototype.performActionInternal=function(a){this.isAutoState(goog.ui.Component.State.CHECKED)&&this.setChecked(!this.isChecked());this.isAutoState(goog.ui.Component.State.SELECTED)&&this.setSelected(true);this.isAutoState(goog.ui.Component.State.OPENED)&&this.setOpen(!this.isOpen());var b=new goog.events.Event(goog.ui.Component.EventType.ACTION,this);if(a)for(var c=["altKey","ctrlKey","metaKey","shiftKey","platformModifierKey"],d,e=0;d=c[e];e++)b[d]=a[d];return this.dispatchEvent(b)};
goog.ui.Control.prototype.handleFocus=function(){this.isAutoState(goog.ui.Component.State.FOCUSED)&&this.setFocused(true)};goog.ui.Control.prototype.handleBlur=function(){this.isAutoState(goog.ui.Component.State.ACTIVE)&&this.setActive(false);this.isAutoState(goog.ui.Component.State.FOCUSED)&&this.setFocused(false)};goog.ui.Control.prototype.handleKeyEvent=function(a){if(this.isVisible()&&this.isEnabled()&&this.handleKeyEventInternal(a)){a.preventDefault();a.stopPropagation();return true}return false};
goog.ui.Control.prototype.handleKeyEventInternal=function(a){return a.keyCode==goog.events.KeyCodes.ENTER&&this.performActionInternal(a)};goog.ui.registry.setDefaultRenderer(goog.ui.Control,goog.ui.ControlRenderer);goog.ui.registry.setDecoratorByClassName(goog.ui.ControlRenderer.CSS_CLASS,function(){return new goog.ui.Control(null)});goog.ui.TabRenderer=function(){goog.ui.ControlRenderer.call(this)};goog.inherits(goog.ui.TabRenderer,goog.ui.ControlRenderer);goog.addSingletonGetter(goog.ui.TabRenderer);
goog.ui.TabRenderer.CSS_CLASS="goog-tab";goog.ui.TabRenderer.prototype.getCssClass=function(){return goog.ui.TabRenderer.CSS_CLASS};goog.ui.TabRenderer.prototype.getAriaRole=function(){return goog.dom.a11y.Role.TAB};goog.ui.TabRenderer.prototype.createDom=function(a){var b=goog.ui.TabRenderer.superClass_.createDom.call(this,a);(a=a.getTooltip())&&this.setTooltip(b,a);return b};
goog.ui.TabRenderer.prototype.decorate=function(a,b){b=goog.ui.TabRenderer.superClass_.decorate.call(this,a,b);var c=this.getTooltip(b);c&&a.setTooltipInternal(c);if(a.isSelected())if((c=a.getParent())&&goog.isFunction(c.setSelectedTab)){a.setState(goog.ui.Component.State.SELECTED,false);c.setSelectedTab(a)}return b};goog.ui.TabRenderer.prototype.getTooltip=function(a){return a.title||""};goog.ui.TabRenderer.prototype.setTooltip=function(a,b){if(a)a.title=b||""};
goog.ui.Tab=function(a,b,c){goog.ui.Control.call(this,a,b||goog.ui.TabRenderer.getInstance(),c);this.setSupportedState(goog.ui.Component.State.SELECTED,true);this.setDispatchTransitionEvents(goog.ui.Component.State.DISABLED|goog.ui.Component.State.SELECTED,true)};goog.inherits(goog.ui.Tab,goog.ui.Control);goog.ui.Tab.prototype.getTooltip=function(){return this.tooltip_};goog.ui.Tab.prototype.setTooltip=function(a){this.getRenderer().setTooltip(this.getElement(),a);this.setTooltipInternal(a)};
goog.ui.Tab.prototype.setTooltipInternal=function(a){this.tooltip_=a};goog.ui.registry.setDecoratorByClassName(goog.ui.TabRenderer.CSS_CLASS,function(){return new goog.ui.Tab(null)});goog.ui.MenuSeparatorRenderer=function(){goog.ui.ControlRenderer.call(this)};goog.inherits(goog.ui.MenuSeparatorRenderer,goog.ui.ControlRenderer);goog.addSingletonGetter(goog.ui.MenuSeparatorRenderer);goog.ui.MenuSeparatorRenderer.CSS_CLASS="goog-menuseparator";
goog.ui.MenuSeparatorRenderer.prototype.createDom=function(a){return a.getDomHelper().createDom("div",this.getCssClass())};goog.ui.MenuSeparatorRenderer.prototype.decorate=function(a,b){if(b.tagName=="HR"){var c=b;b=this.createDom(a);goog.dom.insertSiblingBefore(b,c);goog.dom.removeNode(c)}else goog.dom.classes.add(b,this.getCssClass());return b};goog.ui.MenuSeparatorRenderer.prototype.setContent=function(){};goog.ui.MenuSeparatorRenderer.prototype.getCssClass=function(){return goog.ui.MenuSeparatorRenderer.CSS_CLASS};
goog.ui.Separator=function(a,b){goog.ui.Control.call(this,null,a||goog.ui.MenuSeparatorRenderer.getInstance(),b);this.setSupportedState(goog.ui.Component.State.DISABLED,false);this.setSupportedState(goog.ui.Component.State.HOVER,false);this.setSupportedState(goog.ui.Component.State.ACTIVE,false);this.setSupportedState(goog.ui.Component.State.FOCUSED,false);this.setStateInternal(goog.ui.Component.State.DISABLED)};goog.inherits(goog.ui.Separator,goog.ui.Control);
goog.ui.Separator.prototype.enterDocument=function(){goog.ui.Separator.superClass_.enterDocument.call(this);goog.dom.a11y.setRole(this.getElement(),"separator")};goog.ui.registry.setDecoratorByClassName(goog.ui.MenuSeparatorRenderer.CSS_CLASS,function(){return new goog.ui.Separator});goog.ui.ContainerRenderer=function(){};goog.addSingletonGetter(goog.ui.ContainerRenderer);goog.ui.ContainerRenderer.getCustomRenderer=function(a,b){var c=new a;c.getCssClass=function(){return b};return c};
goog.ui.ContainerRenderer.CSS_CLASS="goog-container";goog.ui.ContainerRenderer.prototype.getAriaRole=function(){};goog.ui.ContainerRenderer.prototype.enableTabIndex=function(a,b){if(a)a.tabIndex=b?0:-1};goog.ui.ContainerRenderer.prototype.createDom=function(a){return a.getDomHelper().createDom("div",this.getClassNames(a).join(" "))};goog.ui.ContainerRenderer.prototype.getContentElement=function(a){return a};goog.ui.ContainerRenderer.prototype.canDecorate=function(a){return a.tagName=="DIV"};
goog.ui.ContainerRenderer.prototype.decorate=function(a,b){b.id&&a.setId(b.id);var c=this.getCssClass(),d=false,e=goog.dom.classes.get(b);e&&goog.array.forEach(e,function(f){if(f==c)d=true;else f&&this.setStateFromClassName(a,f,c)},this);d||goog.dom.classes.add(b,c);this.decorateChildren(a,this.getContentElement(b));return b};
goog.ui.ContainerRenderer.prototype.setStateFromClassName=function(a,b,c){if(b==c+"-disabled")a.setEnabled(false);else if(b==c+"-horizontal")a.setOrientation(goog.ui.Container.Orientation.HORIZONTAL);else b==c+"-vertical"&&a.setOrientation(goog.ui.Container.Orientation.VERTICAL)};
goog.ui.ContainerRenderer.prototype.decorateChildren=function(a,b,c){if(b){c=c||b.firstChild;for(var d;c&&c.parentNode==b;){d=c.nextSibling;if(c.nodeType==goog.dom.NodeType.ELEMENT){var e=this.getDecoratorForChild(c);if(e){e.setElementInternal(c);a.isEnabled()||e.setEnabled(false);a.addChild(e);e.decorate(c)}}else if(!c.nodeValue||goog.string.trim(c.nodeValue)=="")b.removeChild(c);c=d}}};goog.ui.ContainerRenderer.prototype.getDecoratorForChild=function(a){return goog.ui.registry.getDecorator(a)};
goog.ui.ContainerRenderer.prototype.initializeDom=function(a){a=a.getElement();goog.style.setUnselectable(a,true,goog.userAgent.GECKO);if(goog.userAgent.IE)a.hideFocus=true;var b=this.getAriaRole();b&&goog.dom.a11y.setRole(a,b)};goog.ui.ContainerRenderer.prototype.getKeyEventTarget=function(a){return a.getElement()};goog.ui.ContainerRenderer.prototype.getCssClass=function(){return goog.ui.ContainerRenderer.CSS_CLASS};
goog.ui.ContainerRenderer.prototype.getClassNames=function(a){var b=this.getCssClass(),c=a.getOrientation()==goog.ui.Container.Orientation.HORIZONTAL;c=[b,c?b+"-horizontal":b+"-vertical"];a.isEnabled()||c.push(b+"-disabled");return c};goog.ui.ContainerRenderer.prototype.getDefaultOrientation=function(){return goog.ui.Container.Orientation.VERTICAL};goog.ui.Container=function(a,b,c){goog.ui.Component.call(this,c);this.renderer_=b||goog.ui.ContainerRenderer.getInstance();this.orientation_=a||this.renderer_.getDefaultOrientation()};
goog.inherits(goog.ui.Container,goog.ui.Component);goog.ui.Container.EventType={AFTER_SHOW:"aftershow",AFTER_HIDE:"afterhide"};goog.ui.Container.Orientation={HORIZONTAL:"horizontal",VERTICAL:"vertical"};goog.ui.Container.prototype.keyEventTarget_=null;goog.ui.Container.prototype.keyHandler_=null;goog.ui.Container.prototype.renderer_=null;goog.ui.Container.prototype.orientation_=null;goog.ui.Container.prototype.visible_=true;goog.ui.Container.prototype.enabled_=true;
goog.ui.Container.prototype.focusable_=true;goog.ui.Container.prototype.highlightedIndex_=-1;goog.ui.Container.prototype.openItem_=null;goog.ui.Container.prototype.mouseButtonPressed_=false;goog.ui.Container.prototype.allowFocusableChildren_=false;goog.ui.Container.prototype.openFollowsHighlight_=true;goog.ui.Container.prototype.childElementIdMap_=null;goog.ui.Container.prototype.getKeyEventTarget=function(){return this.keyEventTarget_||this.renderer_.getKeyEventTarget(this)};
goog.ui.Container.prototype.setKeyEventTarget=function(a){if(this.focusable_){var b=this.getKeyEventTarget(),c=this.isInDocument();this.keyEventTarget_=a;var d=this.getKeyEventTarget();if(c){this.keyEventTarget_=b;this.enableFocusHandling_(false);this.keyEventTarget_=a;this.getKeyHandler().attach(d);this.enableFocusHandling_(true)}}else throw Error("Can't set key event target for container that doesn't support keyboard focus!");};
goog.ui.Container.prototype.getKeyHandler=function(){return this.keyHandler_||(this.keyHandler_=new goog.events.KeyHandler(this.getKeyEventTarget()))};goog.ui.Container.prototype.getRenderer=function(){return this.renderer_};goog.ui.Container.prototype.setRenderer=function(a){if(this.getElement())throw Error(goog.ui.Component.Error.ALREADY_RENDERED);this.renderer_=a};goog.ui.Container.prototype.createDom=function(){this.setElementInternal(this.renderer_.createDom(this))};
goog.ui.Container.prototype.getContentElement=function(){return this.renderer_.getContentElement(this.getElement())};goog.ui.Container.prototype.canDecorate=function(a){return this.renderer_.canDecorate(a)};goog.ui.Container.prototype.decorateInternal=function(a){this.setElementInternal(this.renderer_.decorate(this,a));if(a.style.display=="none")this.visible_=false};
goog.ui.Container.prototype.enterDocument=function(){goog.ui.Container.superClass_.enterDocument.call(this);this.forEachChild(function(b){b.isInDocument()&&this.registerChildId_(b)},this);var a=this.getElement();this.renderer_.initializeDom(this);this.setVisible(this.visible_,true);this.getHandler().listen(this,goog.ui.Component.EventType.ENTER,this.handleEnterItem).listen(this,goog.ui.Component.EventType.HIGHLIGHT,this.handleHighlightItem).listen(this,goog.ui.Component.EventType.UNHIGHLIGHT,this.handleUnHighlightItem).listen(this,
goog.ui.Component.EventType.OPEN,this.handleOpenItem).listen(this,goog.ui.Component.EventType.CLOSE,this.handleCloseItem).listen(a,goog.events.EventType.MOUSEDOWN,this.handleMouseDown).listen(goog.dom.getOwnerDocument(a),goog.events.EventType.MOUSEUP,this.handleDocumentMouseUp).listen(a,[goog.events.EventType.MOUSEDOWN,goog.events.EventType.MOUSEUP,goog.events.EventType.MOUSEOVER,goog.events.EventType.MOUSEOUT],this.handleChildMouseEvents);this.isFocusable()&&this.enableFocusHandling_(true)};
goog.ui.Container.prototype.enableFocusHandling_=function(a){var b=this.getHandler(),c=this.getKeyEventTarget();a?b.listen(c,goog.events.EventType.FOCUS,this.handleFocus).listen(c,goog.events.EventType.BLUR,this.handleBlur).listen(this.getKeyHandler(),goog.events.KeyHandler.EventType.KEY,this.handleKeyEvent):b.unlisten(c,goog.events.EventType.FOCUS,this.handleFocus).unlisten(c,goog.events.EventType.BLUR,this.handleBlur).unlisten(this.getKeyHandler(),goog.events.KeyHandler.EventType.KEY,this.handleKeyEvent)};
goog.ui.Container.prototype.exitDocument=function(){this.setHighlightedIndex(-1);this.openItem_&&this.openItem_.setOpen(false);this.mouseButtonPressed_=false;goog.ui.Container.superClass_.exitDocument.call(this)};goog.ui.Container.prototype.disposeInternal=function(){goog.ui.Container.superClass_.disposeInternal.call(this);if(this.keyHandler_){this.keyHandler_.dispose();this.keyHandler_=null}this.renderer_=this.openItem_=this.childElementIdMap_=null};goog.ui.Container.prototype.handleEnterItem=function(){return true};
goog.ui.Container.prototype.handleHighlightItem=function(a){var b=this.indexOfChild(a.target);if(b>-1&&b!=this.highlightedIndex_){var c=this.getHighlighted();c&&c.setHighlighted(false);this.highlightedIndex_=b;c=this.getHighlighted();this.isMouseButtonPressed()&&c.setActive(true);if(this.openFollowsHighlight_&&this.openItem_&&c!=this.openItem_)c.isSupportedState(goog.ui.Component.State.OPENED)?c.setOpen(true):this.openItem_.setOpen(false)}goog.dom.a11y.setState(this.getElement(),goog.dom.a11y.State.ACTIVEDESCENDANT,
a.target.getElement().id)};goog.ui.Container.prototype.handleUnHighlightItem=function(a){if(a.target==this.getHighlighted())this.highlightedIndex_=-1;goog.dom.a11y.setState(this.getElement(),goog.dom.a11y.State.ACTIVEDESCENDANT,"")};goog.ui.Container.prototype.handleOpenItem=function(a){if((a=a.target)&&a!=this.openItem_&&a.getParent()==this){this.openItem_&&this.openItem_.setOpen(false);this.openItem_=a}};
goog.ui.Container.prototype.handleCloseItem=function(a){if(a.target==this.openItem_)this.openItem_=null};goog.ui.Container.prototype.handleMouseDown=function(a){this.enabled_&&this.setMouseButtonPressed(true);var b=this.getKeyEventTarget();b&&goog.dom.isFocusableTabIndex(b)?b.focus():a.preventDefault()};goog.ui.Container.prototype.handleDocumentMouseUp=function(){this.setMouseButtonPressed(false)};
goog.ui.Container.prototype.handleChildMouseEvents=function(a){var b=this.getOwnerControl(a.target);if(b)switch(a.type){case goog.events.EventType.MOUSEDOWN:b.handleMouseDown(a);break;case goog.events.EventType.MOUSEUP:b.handleMouseUp(a);break;case goog.events.EventType.MOUSEOVER:b.handleMouseOver(a);break;case goog.events.EventType.MOUSEOUT:b.handleMouseOut(a);break}};
goog.ui.Container.prototype.getOwnerControl=function(a){if(this.childElementIdMap_)for(var b=this.getElement();a&&a!==b;){var c=a.id;if(c in this.childElementIdMap_)return this.childElementIdMap_[c];a=a.parentNode}return null};goog.ui.Container.prototype.handleFocus=function(){};goog.ui.Container.prototype.handleBlur=function(){this.setHighlightedIndex(-1);this.setMouseButtonPressed(false);this.openItem_&&this.openItem_.setOpen(false)};
goog.ui.Container.prototype.handleKeyEvent=function(a){if(this.isEnabled()&&this.isVisible()&&(this.getChildCount()!=0||this.keyEventTarget_)&&this.handleKeyEventInternal(a)){a.preventDefault();a.stopPropagation();return true}return false};
goog.ui.Container.prototype.handleKeyEventInternal=function(a){var b=this.getHighlighted();if(b&&typeof b.handleKeyEvent=="function"&&b.handleKeyEvent(a))return true;if(this.openItem_&&this.openItem_!=b&&typeof this.openItem_.handleKeyEvent=="function"&&this.openItem_.handleKeyEvent(a))return true;if(a.shiftKey||a.ctrlKey||a.metaKey||a.altKey)return false;switch(a.keyCode){case goog.events.KeyCodes.ESC:if(this.isFocusable())this.getKeyEventTarget().blur();else return false;break;case goog.events.KeyCodes.HOME:this.highlightFirst();
break;case goog.events.KeyCodes.END:this.highlightLast();break;case goog.events.KeyCodes.UP:if(this.orientation_==goog.ui.Container.Orientation.VERTICAL)this.highlightPrevious();else return false;break;case goog.events.KeyCodes.LEFT:if(this.orientation_==goog.ui.Container.Orientation.HORIZONTAL)this.isRightToLeft()?this.highlightNext():this.highlightPrevious();else return false;break;case goog.events.KeyCodes.DOWN:if(this.orientation_==goog.ui.Container.Orientation.VERTICAL)this.highlightNext();else return false;
break;case goog.events.KeyCodes.RIGHT:if(this.orientation_==goog.ui.Container.Orientation.HORIZONTAL)this.isRightToLeft()?this.highlightPrevious():this.highlightNext();else return false;break;default:return false}return true};goog.ui.Container.prototype.registerChildId_=function(a){var b=a.getElement();b=b.id||(b.id=a.getId());if(!this.childElementIdMap_)this.childElementIdMap_={};this.childElementIdMap_[b]=a};
goog.ui.Container.prototype.addChild=function(a,b){goog.ui.Container.superClass_.addChild.call(this,a,b)};
goog.ui.Container.prototype.addChildAt=function(a,b,c){a.setDispatchTransitionEvents(goog.ui.Component.State.HOVER,true);a.setDispatchTransitionEvents(goog.ui.Component.State.OPENED,true);if(this.isFocusable()||!this.isFocusableChildrenAllowed())a.setSupportedState(goog.ui.Component.State.FOCUSED,false);a.setHandleMouseEvents(false);goog.ui.Container.superClass_.addChildAt.call(this,a,b,c);c&&this.isInDocument()&&this.registerChildId_(a);b<=this.highlightedIndex_&&this.highlightedIndex_++};
goog.ui.Container.prototype.removeChild=function(a,b){if(a=goog.isString(a)?this.getChild(a):a){var c=this.indexOfChild(a);if(c!=-1)if(c==this.highlightedIndex_)a.setHighlighted(false);else c<this.highlightedIndex_&&this.highlightedIndex_--;(c=a.getElement())&&c.id&&goog.object.remove(this.childElementIdMap_,c.id)}a=goog.ui.Container.superClass_.removeChild.call(this,a,b);a.setHandleMouseEvents(true);return a};goog.ui.Container.prototype.getOrientation=function(){return this.orientation_};
goog.ui.Container.prototype.setOrientation=function(a){if(this.getElement())throw Error(goog.ui.Component.Error.ALREADY_RENDERED);this.orientation_=a};goog.ui.Container.prototype.isVisible=function(){return this.visible_};
goog.ui.Container.prototype.setVisible=function(a,b){if(b||this.visible_!=a&&this.dispatchEvent(a?goog.ui.Component.EventType.SHOW:goog.ui.Component.EventType.HIDE)){this.visible_=a;var c=this.getElement();if(c){goog.style.showElement(c,a);this.isFocusable()&&this.renderer_.enableTabIndex(this.getKeyEventTarget(),this.enabled_&&this.visible_);b||this.dispatchEvent(this.visible_?goog.ui.Container.EventType.AFTER_SHOW:goog.ui.Container.EventType.AFTER_HIDE)}return true}return false};
goog.ui.Container.prototype.isEnabled=function(){return this.enabled_};
goog.ui.Container.prototype.setEnabled=function(a){if(this.enabled_!=a&&this.dispatchEvent(a?goog.ui.Component.EventType.ENABLE:goog.ui.Component.EventType.DISABLE)){if(a){this.enabled_=true;this.forEachChild(function(b){if(b.wasDisabled)delete b.wasDisabled;else b.setEnabled(true)})}else{this.forEachChild(function(b){if(b.isEnabled())b.setEnabled(false);else b.wasDisabled=true});this.enabled_=false;this.setMouseButtonPressed(false)}this.isFocusable()&&this.renderer_.enableTabIndex(this.getKeyEventTarget(),
a&&this.visible_)}};goog.ui.Container.prototype.isFocusable=function(){return this.focusable_};goog.ui.Container.prototype.setFocusable=function(a){a!=this.focusable_&&this.isInDocument()&&this.enableFocusHandling_(a);this.focusable_=a;this.enabled_&&this.visible_&&this.renderer_.enableTabIndex(this.getKeyEventTarget(),a)};goog.ui.Container.prototype.isFocusableChildrenAllowed=function(){return this.allowFocusableChildren_};
goog.ui.Container.prototype.setFocusableChildrenAllowed=function(a){this.allowFocusableChildren_=a};goog.ui.Container.prototype.isOpenFollowsHighlight=function(){return this.openFollowsHighlight_};goog.ui.Container.prototype.setOpenFollowsHighlight=function(a){this.openFollowsHighlight_=a};goog.ui.Container.prototype.getHighlightedIndex=function(){return this.highlightedIndex_};
goog.ui.Container.prototype.setHighlightedIndex=function(a){if(a=this.getChildAt(a))a.setHighlighted(true);else this.highlightedIndex_>-1&&this.getHighlighted().setHighlighted(false)};goog.ui.Container.prototype.setHighlighted=function(a){this.setHighlightedIndex(this.indexOfChild(a))};goog.ui.Container.prototype.getHighlighted=function(){return this.getChildAt(this.highlightedIndex_)};
goog.ui.Container.prototype.highlightFirst=function(){this.highlightHelper(function(a,b){return(a+1)%b},this.getChildCount()-1)};goog.ui.Container.prototype.highlightLast=function(){this.highlightHelper(function(a,b){a--;return a<0?b-1:a},0)};goog.ui.Container.prototype.highlightNext=function(){this.highlightHelper(function(a,b){return(a+1)%b},this.highlightedIndex_)};goog.ui.Container.prototype.highlightPrevious=function(){this.highlightHelper(function(a,b){a--;return a<0?b-1:a},this.highlightedIndex_)};
goog.ui.Container.prototype.highlightHelper=function(a,b){var c=b<0?this.indexOfChild(this.openItem_):b,d=this.getChildCount();c=a.call(this,c,d);for(var e=0;e<=d;){var f=this.getChildAt(c);if(f&&this.canHighlightItem(f)){this.setHighlightedIndexFromKeyEvent(c);return true}e++;c=a.call(this,c,d)}return false};goog.ui.Container.prototype.canHighlightItem=function(a){return a.isVisible()&&a.isEnabled()&&a.isSupportedState(goog.ui.Component.State.HOVER)};
goog.ui.Container.prototype.setHighlightedIndexFromKeyEvent=function(a){this.setHighlightedIndex(a)};goog.ui.Container.prototype.getOpenItem=function(){return this.openItem_};goog.ui.Container.prototype.isMouseButtonPressed=function(){return this.mouseButtonPressed_};goog.ui.Container.prototype.setMouseButtonPressed=function(a){this.mouseButtonPressed_=a};goog.ui.TabBarRenderer=function(){goog.ui.ContainerRenderer.call(this)};goog.inherits(goog.ui.TabBarRenderer,goog.ui.ContainerRenderer);goog.addSingletonGetter(goog.ui.TabBarRenderer);
goog.ui.TabBarRenderer.CSS_CLASS="goog-tab-bar";goog.ui.TabBarRenderer.prototype.getCssClass=function(){return goog.ui.TabBarRenderer.CSS_CLASS};goog.ui.TabBarRenderer.prototype.getAriaRole=function(){return goog.dom.a11y.Role.TAB_LIST};goog.ui.TabBarRenderer.prototype.setStateFromClassName=function(a,b,c){this.locationByClass_||this.createLocationByClassMap_();var d=this.locationByClass_[b];d?a.setLocation(d):goog.ui.TabBarRenderer.superClass_.setStateFromClassName.call(this,a,b,c)};
goog.ui.TabBarRenderer.prototype.getClassNames=function(a){var b=goog.ui.TabBarRenderer.superClass_.getClassNames.call(this,a);this.classByLocation_||this.createClassByLocationMap_();b.push(this.classByLocation_[a.getLocation()]);return b};
goog.ui.TabBarRenderer.prototype.createClassByLocationMap_=function(){var a=this.getCssClass();this.classByLocation_=goog.object.create(goog.ui.TabBar.Location.TOP,a+"-top",goog.ui.TabBar.Location.BOTTOM,a+"-bottom",goog.ui.TabBar.Location.START,a+"-start",goog.ui.TabBar.Location.END,a+"-end")};goog.ui.TabBarRenderer.prototype.createLocationByClassMap_=function(){this.classByLocation_||this.createClassByLocationMap_();this.locationByClass_=goog.object.transpose(this.classByLocation_)};
goog.ui.TabBar=function(a,b,c){this.setLocation(a||goog.ui.TabBar.Location.TOP);goog.ui.Container.call(this,this.getOrientation(),b||goog.ui.TabBarRenderer.getInstance(),c);this.listenToTabEvents_()};goog.inherits(goog.ui.TabBar,goog.ui.Container);goog.ui.TabBar.Location={TOP:"top",BOTTOM:"bottom",START:"start",END:"end"};goog.ui.TabBar.prototype.autoSelectTabs_=true;goog.ui.TabBar.prototype.selectedTab_=null;
goog.ui.TabBar.prototype.enterDocument=function(){goog.ui.TabBar.superClass_.enterDocument.call(this);this.listenToTabEvents_()};goog.ui.TabBar.prototype.disposeInternal=function(){goog.ui.TabBar.superClass_.disposeInternal.call(this);this.selectedTab_=null};goog.ui.TabBar.prototype.removeChild=function(a,b){this.deselectIfSelected(a);return goog.ui.TabBar.superClass_.removeChild.call(this,a,b)};goog.ui.TabBar.prototype.getLocation=function(){return this.location_};
goog.ui.TabBar.prototype.setLocation=function(a){this.setOrientation(goog.ui.TabBar.getOrientationFromLocation(a));this.location_=a};goog.ui.TabBar.prototype.isAutoSelectTabs=function(){return this.autoSelectTabs_};goog.ui.TabBar.prototype.setAutoSelectTabs=function(a){this.autoSelectTabs_=a};goog.ui.TabBar.prototype.setHighlightedIndexFromKeyEvent=function(a){goog.ui.TabBar.superClass_.setHighlightedIndexFromKeyEvent.call(this,a);this.autoSelectTabs_&&this.setSelectedTabIndex(a)};
goog.ui.TabBar.prototype.getSelectedTab=function(){return this.selectedTab_};goog.ui.TabBar.prototype.setSelectedTab=function(a){if(a)a.setSelected(true);else this.getSelectedTab()&&this.getSelectedTab().setSelected(false)};goog.ui.TabBar.prototype.getSelectedTabIndex=function(){return this.indexOfChild(this.getSelectedTab())};goog.ui.TabBar.prototype.setSelectedTabIndex=function(a){this.setSelectedTab(this.getChildAt(a))};
goog.ui.TabBar.prototype.deselectIfSelected=function(a){if(a&&a==this.getSelectedTab()){for(var b=this.indexOfChild(a),c=b-1;a=this.getChildAt(c);c--)if(this.isSelectableTab(a)){this.setSelectedTab(a);return}for(b=b+1;a=this.getChildAt(b);b++)if(this.isSelectableTab(a)){this.setSelectedTab(a);return}this.setSelectedTab(null)}};goog.ui.TabBar.prototype.isSelectableTab=function(a){return a.isVisible()&&a.isEnabled()};
goog.ui.TabBar.prototype.handleTabSelect=function(a){this.selectedTab_&&this.selectedTab_!=a.target&&this.selectedTab_.setSelected(false);this.selectedTab_=a.target};goog.ui.TabBar.prototype.handleTabUnselect=function(a){if(a.target==this.selectedTab_)this.selectedTab_=null};goog.ui.TabBar.prototype.handleTabDisable=function(a){this.deselectIfSelected(a.target)};goog.ui.TabBar.prototype.handleTabHide=function(a){this.deselectIfSelected(a.target)};
goog.ui.TabBar.prototype.handleFocus=function(){this.getHighlighted()||this.setHighlighted(this.getSelectedTab()||this.getChildAt(0))};goog.ui.TabBar.prototype.listenToTabEvents_=function(){this.getHandler().listen(this,goog.ui.Component.EventType.SELECT,this.handleTabSelect).listen(this,goog.ui.Component.EventType.UNSELECT,this.handleTabUnselect).listen(this,goog.ui.Component.EventType.DISABLE,this.handleTabDisable).listen(this,goog.ui.Component.EventType.HIDE,this.handleTabHide)};
goog.ui.TabBar.getOrientationFromLocation=function(a){return a==goog.ui.TabBar.Location.START||a==goog.ui.TabBar.Location.END?goog.ui.Container.Orientation.VERTICAL:goog.ui.Container.Orientation.HORIZONTAL};goog.ui.registry.setDecoratorByClassName(goog.ui.TabBarRenderer.CSS_CLASS,function(){return new goog.ui.TabBar});goog.fx.easing={};goog.fx.easing.easeIn=function(a){return a*a*a};goog.fx.easing.easeOut=function(a){return 1-Math.pow(1-a,3)};
goog.fx.easing.inAndOut=function(a){return 3*a*a-2*a*a*a};var boxSetElements=null,replacementText=null;
function loadPage(){$("a[rel='interstitialRedirect']").click(function(){var c=$(this).attr("href");window.open("http://a.dolimg.com/en-US/3257w/html/interstitial.html?interstitialRedirect="+c);return false});$("a[href='#shareIdeas']").click(function(){showShareYourIdeasLB()});var a=$("#mainContent").height()+180+145,b=$(window).height();a<b&&$("#main").css("min-height",b);$(window).bind("resize",function(){var c=$("#mainContent").height()+180+145,d=$(window).height();c<d&&$("#main").css("min-height",d)});switch(document.body.id){case "homePage":a=
new HomePage;analytics.trackPage("home_page");break;case "dmAccountPage":a=new DmAccountPage;analytics.trackPage("my_account");break;case "changeEmailPage":a=new ChangeEmailPage;analytics.trackPage("change_name");break;case "changePasswordPage":a=new ChangePasswordPage;analytics.trackPage("change_pass");break;case "forgotUserPage":a=new ForgotUserPage;analytics.trackPage("forgot_name");break;case "forgotPasswordPage":a=new ForgotPassPage;analytics.trackPage("forgot_pass");break;case "purchaseHistoryPage":a=
new Page;analytics.trackPage("purchase_history");break;case "ccMainPage":a=new Page;analytics.trackPage("cc_entry");analytics.trackOmnitureCookie();analytics.trackEvent("new_cc_attempt");break;case "ccUpdatePage":a=new Page;analytics.trackPage("cc_update");break;case "myVideos":a=new MyVideosPage;analytics.trackPage("mml");break;case "catalog":a=new CatalogPage;analytics.trackPage("catalog");break;case "product":a=new ProductPage;break;case "loginPage":a=new LoginPage;analytics.trackPage("login_page");
analytics.trackEvent("login_page");break;case "registrationStep1":a=new RegistrationPage(1);analytics.trackPage("reg_attempt");analytics.trackEvent("reg_attempt");break;case "registrationStep2":a=new RegistrationPage(2);break;case "registrationWelcome":a=new RegistrationPage(3);break;case "blogPage":b=getQueryStringParameter("page");a=new Page(b);analytics.trackPage("blogpage"+b);break;case "blogPost":a=new Page;a=$("#bpOmnitureTrackingName").html();analytics.trackPage("blogPost_"+a);break;case "magicCode":a=
new MagicCodePage;a=window.location.href.toLowerCase();if(a.indexOf("watch-dvds-online#redeem")!=-1){myconsole.log("tracking magicCode_redeem, URL: "+window.location.href+" from loadPage()");analytics.trackPage("magicCode_redeem")}else if(a.indexOf("watch-dvds-online")!=-1){myconsole.log("tracking magicCode_enter, URL: "+window.location.href+" from loadPage()");analytics.trackPage("magicCode_enter")}break;case "helpOverview":a=new HelpPage;analytics.trackPage("help_overview");break;case "help":a=
new HelpPage;a=getQueryStringParameter("category");b=window.location.hash;if(b.substr(0,6)!="#help=")analytics.trackPage("help_"+a);else{a=b.substr(6);analytics.trackPage("help_q_"+a)}break;case "contact":a=new ContactPage;analytics.trackPage("contact_us");break;case "syndicatedVideoPlayer":document.domain="go.com";a=new SyndicatedVideoPlayerPage;analytics.trackPage("syndicated_player");break;case "404":a=new Page;analytics.trackPage("404");break;case "sitemapPage":a=new Page;analytics.trackPage("sitemap");
break;case "invalidTermsPage":a=new Page;analytics.trackPage("invalid_terms");break;case "browser":a=new BrowserNotSupportedPage;analytics.trackPage("bad_browser");break;case "termsOfUsePage":a=new Page;analytics.trackPage("terms_conditions");break;case "aboutUsPage":a=new Page;analytics.trackPage("about_us");break;case "searchResultsPage":a=new SearchResultsPage;break;default:a=new Page;analytics.trackPage(document.body.id)}if(isLoggedIn)User.retrieve();else new User(null);attachFormValidation();
analytics.trackOmnitureCookie()}var urlBase=window.location.toString().match(/(https?:\/\/[^\/]*\/)([^\/]*\/)?/);if(urlBase==null)urlSecureBase=urlBase="";else{urlBase=urlBase[1];var urlSecureBase=urlBase.replace(/https?/,"https")}var moviePlayerFilename=getQueryStringParameter("player");if(typeof moviePlayerFilename==undefined||moviePlayerFilename==null||$.trim(moviePlayerFilename)=="")moviePlayerFilename="d2c_videoplayer_release_10_5_11_0303PM";
var moviePlayerPath="http://a.dolimg.com/en-US/3257w/swf/"+moviePlayerFilename+".swf";function attachFormValidation(){$("form").submit(validateForm)}Date.prototype.toDisplayString=function(){var a=this.getMonth()+1,b=this.getDate(),c=this.getFullYear();return(a<10?"0"+a:a)+"/"+(b<10?"0"+b:b)+"/"+c};Date.prototype.addSeconds=function(a){var b=0;if(typeof a=="string")b=parseInt(a);else if(typeof a=="number")b=a;else{a=typeof a+" is not supported";myconsole.error(a);throw a;}this.setSeconds(this.getSeconds()+b);return this};
String.prototype.capitalize=function(){return this.charAt(0).toUpperCase()+this.slice(1)};
function Page(){Page.current=this;Page.bindLoginForms();Page.attachSearchAutoComplete();this.bindPartialRegForm();this.bindFooterLinks();this.fetchTermsAndConditionsDate();document.getElementById("banner")==null&&fetchDMOBanner();Page.newVideoBoxShotLabel=$("input#newVideoBoxShotLabel").val();if(!this.overrideSearchList){this.searchList=new MovieList;Video.getAllLeanSync(this.searchList,false)}this.availableImageRequests=5;this.imageQueue=[];Page.current.enableButtons();return true}
Page.prototype={firstNameElement:"#userHeaderFirstName",lastLocationHash:"",locationPollInterval:null,imgCallback:function(a,b,c){$("img.boxImage",c).replaceWith(a);$("img:first",c).addClass("boxImage");$("img.boxImage",c).attr("title",b);$("img.boxImage",c).attr("alt",b)},fetchTermsAndConditionsDate:function(){ajaxUtils.start();$.ajax({cache:false,dataType:"text",error:function(){ajaxUtils.finished()},success:function(a){ajaxUtils.finished();if(a.length>0){a=new Date(parseInt(a));if(!isNaN(a.getYear()))if(((new Date).getTime()-
a.getTime())/1E3/60/60/24<=14){a=a.toDisplayString();$("#termsDate").html(a);$("#termsDetailInfo").show()}}},url:urlBase+"api/termsDate.txt"})},checkLocationHash:function(){document.title=document.title.replace(/#[^ ]*$/,"");if(window.location.hash!=this.lastLocationHash){lightboxOverlay.closeOverlay();this.saveLocationHash();this.handleLocationHash()}},clearWorkflowCookies:function(){clearWorkflowCookies()},resetMoviePlayers:function(){typeof Page.current.players!="undefined"&&Page.current.players!=
null&&$.each(Page.current.players,function(a,b){b.resetPlayer()})},pauseMovies:function(){typeof Page.current.players!="undefined"&&Page.current.players!=null&&$.each(Page.current.players,function(a,b){b.pauseMovie()})},partialReg:function(a){lightboxOverlay.closeOverlay();lightboxOverlay.useSlightlyNarrow("UPDATE YOUR ACCOUNT","partialRegistration",function(){analytics.trackLink("close_dmr_terms");window.location.href=urlSecureBase+"logout"});populateFormUser("partialRegistrationForm",a);if(User.current.underageUser)lightboxOverlay.showUnder13(urlBase+
"logout");else{$("#partialRegistration").addClass("nonUnderAge");lightboxOverlay.showOverlay();if(a.gender!="undefined"&&a.gender!=null)if("M"==a.gender){document.getElementById("partialRegistrationForm").regGenderM.checked=true;document.getElementById("partialRegistrationForm").regGenderF.checked=false}else if("F"==a.gender){document.getElementById("partialRegistrationForm").regGenderF.checked=true;document.getElementById("partialRegistrationForm").regGenderM.checked=false}analytics.trackEvent("partialReg_attempt")}},
dmrPartialReg:function(){ajaxUtils.finished();lightboxOverlay.closeOverlay();if(User.current.underageUser)lightboxOverlay.showUnder13(urlBase+"logout");else{lightboxOverlay.useSlightlyNarrow("COMPLETE YOUR REGISTRATION","specialPartialRegistration");$("#specialPartialRegistrationButton").unbind("click");$("#specialPartialRegistrationNoThanks").unbind("click");$("#closeSlightlyNarrowDialog").unbind("click");$("#specialPartialRegistrationButton").click(function(){User.current.dmrPartialRegAgree();document.location.hash.length<=
1&&Page.current.handleLocationHash(User.current)});$("#specialPartialRegistrationNoThanks").click(function(){$("#specialPartialRegistration").addClass("error")});$("#closeSlightlyNarrowDialog").click(function(){lightboxOverlay.closeOverlay()});lightboxOverlay.showOverlay();analytics.trackEvent("vppa_attempt")}},getLocationHashArray:function(){var a=[],b=window.location.hash.match(/#(.*)/);if(b==null)return[];b=b[1].split("&");for(var c=0;c<b.length;c++){a[c]={};var d=b[c].split("=",2);a[c].key=d[0];
a[c].value=d.length>1?d[1]:null}return a},handleLocationHash:function(){for(var a=this.getLocationHashArray(),b=0;b<a.length;b++)switch(a[b].key){case "partialReg":redirect=getQueryStringParameter("d2cAppRedirect");if(typeof redirect!=undefined&&redirect!=null)Page.current.redirectUrl=decodeURIComponent(redirect);if(User.current.dmrPartiallyRegistered)Page.current.dmrPartialReg();else if(User.current.partiallyRegistered){var c;ajaxUtils.start();$.ajax({cache:false,dataType:"text",error:function(){c=
new User(null);ajaxUtils.finished()},success:function(e){e=eval("("+e+")");ajaxUtils.finished();if(e==null)c=new User(null);else{c=new User(e);Page.current.partialReg(c)}},url:urlSecureBase+"api/pr/user.json"})}break;case "shareIdeas":showShareYourIdeasLB();break;case "a2l":lightboxOverlay.showUnder13(urlBase+"logout");break}try{Page.current.pageHandleLocationHash(a)}catch(d){myconsole.log(d)}},loggedInBehavior:function(){this.checkLocationHash();this.monitorLocationHash()},monitorLocationHash:function(){clearInterval(this.locationPollInterval);
this.locationPollInterval=setInterval(function(){Page.current.checkLocationHash()},250)},notLoggedInBehavior:function(){this.checkLocationHash();this.monitorLocationHash()},saveLocationHash:function(){this.lastLocationHash=window.location.hash},setLocationHash:function(a){if(a!=window.location.hash){location.hash=a==null||a==""?"":"#"+a;this.saveLocationHash()}},unloadAllPlayers:function(){try{typeof Page.current.players!="undefined"&&Page.current.players!=null&&$.each(Page.current.players,function(b,
c){c.unloadPlayer()})}catch(a){}},showLoginForm:function(){lightboxOverlay.useGeneric(null,"loginFormContainer");lightboxOverlay.showOverlay()},showTab:function(a){Page.current.tabBar.setSelectedTabIndex(a)},bindPartialRegForm:function(){$("#partialRegistrationForm").unbind("submit");$("#partialRegistrationForm").submit(function(){Page.current.disableButtons();$("#partialRegistrationFormgenderErrorText li").css("display","none");$("#partialRegistrationFormgenderErrorText").removeClass("error");$("#partialRegistrationFormgenderErrorTextLabel").removeClass("error");
if(!validateForm(this)){Page.current.enableButtons();return false}setSecureCookiesFromObject(this.elements);var a=document.createElement("script");a.src=urlSecureBase+"partialReg?r="+Number(new Date);document.body.appendChild(a);return false})},bindFooterLinks:function(){$("#shareYourIdeaLink").unbind("click");$("#shareYourIdeaLink").click(function(){showShareYourIdeasLB()});$("#shareLink").unbind("click");$("#shareLink").click(function(){showShareYourIdeasLB()})},rePopulateFeedbackForm:function(a){$("#problemName").val(a.name);
$("#problemEmailAddress").val(a.emailAddress);$("#problemComment").val(a.comment);$("#feedbackAcceptTC").attr("checked",a.acceptTC)},disableButtons:function(){var a=$("input:button, input:submit");a.attr("disabled","disabled");a.filter(".buttonInput").addClass("disabledBtn");a.filter(".buttonInputLg").addClass("disabledBtnLg")},enableButtons:function(){var a=$("input:button, input:submit");a.removeAttr("disabled");a.filter(".buttonInput").removeClass("disabledBtn");a.filter(".buttonInputLg").removeClass("disabledBtnLg")},
handleFeedbackResponse:function(a){var b=a.feedbackResponse.status,c=a.feedbackResponse.message;if(b==0){lightboxOverlay.useSlightlyNarrow("THANK YOU","feedbackThankYou");$("#closeSlightlyNarrowDialog").click(function(){lightboxOverlay.closeOverlay()});$("#feedbackThankYouOk").unbind("click");$("#feedbackThankYouOk").click(function(){lightboxOverlay.closeOverlay()});lightboxOverlay.showOverlay()}else if(b==-1){showShareYourIdeasLB();$("#categoryErrorDiv").hide();$("#nameErrorDiv").hide();$("#emailAddressErrorDiv").hide();
$("#commentErrorDiv").hide();$("#showGenericError").html(c);$("#showGenericError").show();Page.current.enableButtons();this.rePopulateFeedbackForm(a.feedbackResponse.feedback)}else if(b==1){b=a.feedbackResponse.errors[0];if(b!=null&&b!="undefined"){showShareYourIdeasLB();b=b[0].field;$("#categoryErrorDiv").hide();$("#nameErrorDiv").hide();$("#emailAddressErrorDiv").hide();$("#commentErrorDiv").hide();$("#showGenericError").hide();if(b!="acceptTC")b=="emailAddress"&&$("#problemEmailAddressLabel").attr("style",
"color:#DD0915");else{$("#feedbackAcceptTCLabel").attr("style","color:#DD0915");$("#d2c_terms_of_use").attr("style","color:#DD0915")}this.rePopulateFeedbackForm(a.feedbackResponse.feedback)}}ajaxUtils.finished()}};var ac1;
Page.attachSearchAutoComplete=function(){$("input.searchBox").each(function(){var a=$(this);this.defaultText=a.val();a.unbind("focus");a.focus(function(){if(a.val().trim()==this.defaultText){a.val("");a.css("color","#555555")}});a.blur(function(){if(a.val().trim()==""){a.val(this.defaultText);a.css("color","#C0C0C0")}});ac1=location.protocol.toLowerCase().indexOf("https")>=0?new goog.ui.AutoComplete.Remote(urlSecureBase+"api/search",a[0],false):new goog.ui.AutoComplete.Remote(urlBase+"api/search",
a[0],false);var b=ac1.getRenderer();b.parent_=document.getElementById("navSearchForm");b.renderRowContents_=function(e,f,g){g.innerHTML=goog.string.htmlEscape(Page.current.searchList.videosByMpm[e.data.toString()].title)};var c=b.show,d=b.dismiss;b.show=function(){c.call(b);$("#suggestText").show();$("#navSearchForm .ac-renderer > :last-child").addClass("lastSearchItem")};b.dismiss=function(){d.call(b);$("#suggestText").hide()};ac1.selectionHandler_.selectRow=function(e){analytics.trackSearch("auto:"+
seoCleanText(Page.current.searchList.videosByMpm[e].title),1);$("#OMNI_navSearchTextbox").val(goog.string.htmlEscape(Page.current.searchList.videosByMpm[e.toString()].title));window.location=urlBase+"movies/"+seoCleanText(Page.current.searchList.videosByMpm[e].title)+"-"+e+"/";return true};ac1.setAutoHilite(false)})};
Page.bindLoginForms=function(){$("form.loginForm").unbind("submit");$("form.loginForm").submit(function(){if(!validateForm(this)){if(this.id=="headerLoginForm"){var a=getFormObject(this);putFormObject(a,$("#loginForm")[0]);lightboxOverlay.useGeneric(null,"loginFormContainer",function(){analytics.trackLink("close_login_error");return false});validateForm($("#loginForm"));lightboxOverlay.showOverlay()}analytics.trackLink("login_error");return false}ajaxUtils.start();var b=this;setTimeout(function(){setSecureCookie("emailAddress",
b.emailAddress.value);setSecureCookie("gspw",b.gspw.value);var c=document.createElement("script");c.src=urlSecureBase+"login?r="+Number(new Date);document.body.appendChild(c)},20);return false})};function BrowserNotSupportedPage(){this.overrideSearchList=true;Page.call(this);this.bindContinueButton()}
BrowserNotSupportedPage.prototype={bindContinueButton:function(){$("#browser .continue_button").unbind("click");$("#browser .continue_button").click(function(){setCookie("dmo_b_nsp_c","true",true);window.location=urlBase+"home"})}};$.extend(BrowserNotSupportedPage.prototype,Page.prototype);
function HomePage(){this.overrideSearchList=true;Page.call(this);if(document.location.hash.indexOf("registration_success")==-1&&document.location.hash.indexOf("purchaseId")==-1)this.clearWorkflowCookies();else $.browser.msie&&document.location.hash.indexOf("&ie=1")==-1&&Page.current.setLocationHash(window.location.hash+"&ie=1");this.movieTabs=new HomePageMovieList;this.movieTabs.createFeaturedMovies();this.billboard=new Billboard("billboardContainer","billboardPane");this.searchList=this.movieTabs;
Page.current.video=null;Page.current.videos=this.searchList;return true}function AbstractHomePage(){}
AbstractHomePage.prototype={videoElements:[],loggedInBehavior:function(){HomePageMovieList.current.userLoggedIn();this.sizzleAutoPlay();this.checkLocationHash();this.monitorLocationHash();$("#featuredAreaLoading").css("display","none");$("#featuredArea").css("display","block")},notLoggedInBehavior:function(){this.sizzleAutoPlay();this.checkLocationHash();this.monitorLocationHash();$("#featuredAreaLoading").css("display","none");$("#featuredArea").css("display","block")},pageHandleLocationHash:function(a){for(var b=
0;b<a.length;b++)switch(a[b].key){case "contactUs":window.location="/contact";break;case "faq":window.location="/help-overview";break;case "intro":Page.current.billboard.stopAutoRotate();Page.current.billboard.playSizzleTileVideo();break;case "login":window.location="/login";break;case "redeem":window.location="/watch-dvds-online#redeem";break}},sizzleAutoPlay:function(){if(window.location.hash.length<=1){this.sizzleCookieChecked=true;if(getCookie("dmoSz")!="1"){Page.current.billboard.stopAutoRotate();
setPermanentCookie("dmoSz","1");Page.current.billboard.playSizzleTileVideo()}else{Page.current.billboard.firstVisit=false;Page.current.billboard.displayBillboardControls();Page.current.billboard.startAutoRotate()}}}};$.extend(HomePage.prototype,Page.prototype);$.extend(HomePage.prototype,AbstractHomePage.prototype);function CatalogPage(){Page.call(this);Page.current.video=null;Page.current.videos=this.searchList;AbstractHoverFunctionality.call(this)}function AbstractCatalogPage(){}
function AbstractHoverFunctionality(){function a(d){if(d!=null){d.hide();d.removeClass("left");d.removeClass("right");d.addClass("right")}}function b(d){var e=d.offset().left,f=d.parent().parent().position().left,g=$(window).width(),h=d.parent().parent().find(".info");d=d.parent().parent().find(".info").height();$.browser.msie==true&&$.browser.version<8?h.css("margin-top",-(d/2-30)):h.css("margin-top",-(d/2));if(document.body.id=="catalog"&&f>350){h.removeClass("left");h.removeClass("right");h.addClass("left")}else if(g-
e<450||$.browser.msie&&$.browser.version<8){h.removeClass("left");h.removeClass("right");h.addClass("left")}h.show();h.unbind();h.bind("mouseover",function(){clearTimeout(closeTimeOut)});h.bind("mouseout",function(){closeTimeOut=setTimeout(function(){a(h);h=null},delay)})}delay=1E3;closeTimeOut=openTimeOut=null;$("#movieList ul.movies.clearFix li.streamable.rental").each(function(d,e){var f=$(e).find(".countdownTimer span.expireDate.rentalTimer").html();new CountdownTimer($(e),eval(f))});$(".boxImage").bind("mouseover",
function(){clearTimeout(openTimeOut);var d=$(this);openTimeOut=setTimeout(function(){b(d);d=null},delay)}).bind("mouseout",function(){var d=$(this).parent().parent().find(".info");openTimeOut!=null&&clearTimeout(openTimeOut);closeTimeOut=setTimeout(function(){a(d);d=null},delay)});var c=this;$("li.purchaseLink").each(function(d,e){$(e).unbind("click");$(e).click(function(){if(User.current!=null&&User.current.internationalUser){lightboxOverlay.useSlightlyNarrow("LOCATION NOT SUPPORTED","blockedLocation");
$("#closeSlightlyNarrowDialog").click(function(){lightboxOverlay.closeOverlay()});$("#blockedLocationThankYouOk").unbind("click");$("#blockedLocationThankYouOk").click(function(){lightboxOverlay.closeOverlay()});lightboxOverlay.showOverlay();return false}var f=$(e).attr("id").replace("purchaseLink","").toLowerCase(),g=$(e).parent().parent().parent().parent().parent().attr("data-title");video=c.videos.videosByMpm[g];video.availableActions=eval("("+$("#aa-"+g).html()+")");video.populateLicenseProfiles(video.availableActions);
video.purchaseType=f;analytics.trackEvent(f+"_attempt");Page.current.video=video;video.purchase(f,false)})})}$.extend(CatalogPage.prototype,Page.prototype);$.extend(CatalogPage.prototype,AbstractCatalogPage.prototype);$.extend(CatalogPage.prototype,AbstractHoverFunctionality.prototype);
function MyVideosPage(){Page.call(this);$("#myVideosList div.myVideo.streamable.rental").each(function(b,c){var d=$(c).find(".countdownTimer span.expireDate.rentalTimer").html();new CountdownTimer($(c),eval(d))});$("#myVideosList .sliderMask").each(function(){var b=$("ul li",this).length;if(b==1)$("#"+this.id+"slider").remove();else{new Scrollbar(this.id,this.id+"slider",111,b);$(".mmlBonusExtraList",this).css("width",125*b)}});$(".viewNav.tileInactive").click(function(){$this=$(this);$this.removeClass("tileInactive");
$this.addClass("tileActive");window.location="?view=tile&switchView"});$(".viewNav.listInactive").click(function(){$this=$(this);$this.removeClass("listInactive");$this.addClass("listActive");window.location="?view=list&switchView"});Page.current.video=null;Page.current.videos=this.searchList;if(getQueryStringParameter("view")=="tile")AbstractHoverFunctionality.call(this);else{var a=this;$("li.purchaseLink").each(function(b,c){$(c).unbind("click");$(c).click(function(){if(User.current!=null&&User.current.internationalUser){lightboxOverlay.useSlightlyNarrow("LOCATION NOT SUPPORTED",
"blockedLocation");$("#closeSlightlyNarrowDialog").click(function(){lightboxOverlay.closeOverlay()});$("#blockedLocationThankYouOk").unbind("click");$("#blockedLocationThankYouOk").click(function(){lightboxOverlay.closeOverlay()});lightboxOverlay.showOverlay();return false}var d=$(c).attr("id").replace("purchaseLink","").toLowerCase(),e=$(c).parent().parent().parent().attr("data-title");video=a.videos.videosByMpm[e];video.availableActions=eval("("+$("#aa-"+e).html()+")");video.populateLicenseProfiles(video.availableActions);
video.purchaseType=d;analytics.trackEvent(d+"_attempt");Page.current.video=video;video.purchase(d,false)})})}}MyVideosPage.prototype={dmrResponse:null,boxSet:null,thankYouClasses:null,chosenMpm:null,pageHandleLocationHash:function(a){for(var b=0;b<a.length;b++)switch(a[b].key){case "titles":mpmIds=a[b].value.split(",");break;case "chooseAction":setTimeout(function(){lightboxOverlay.useWide("YOU'VE SUCCESSFULLY REGISTERED YOUR MOVIE!","magicCodeThankYou");lightboxOverlay.showOverlay()},1500);break}}};
$.extend(MyVideosPage.prototype,Page.prototype);$.extend(MyVideosPage.prototype,AbstractHoverFunctionality.prototype);function HelpPage(){Page.call(this);this.bindHelpPageLinks()}
HelpPage.prototype={currentArticle:null,bindHelpPageLinks:function(){var a=this;$("div.helpTopicHeader").unbind("click");$("div.helpTopicHeader").click(function(){a.helpToggle(this.id)});var b=new Date,c=b.getMonth()+1,d=b.getDate();b=b.getFullYear();$("#topQuestionsDate").html(c+"/"+d+"/"+b)},helpToggle:function(a){var b=this.currentArticle;if(this.currentArticle!=null){$("#"+this.currentArticle+"_parent").removeClass("open");this.currentArticle=null}if(b!=a){$("#"+a+"_parent").addClass("open");
this.currentArticle=a;$("html, body").animate({scrollTop:$("#"+a+"_parent").offset().top},1500);window.location.hash.substr(0,6)!="#help="&&analytics.trackPage("help_q_"+a)}},pageHandleLocationHash:function(a){for(var b=0;b<a.length;b++)switch(a[b].key){case "help":this.helpToggle(a[b].value);break}}};$.extend(HelpPage.prototype,Page.prototype);function ChangeEmailPage(){Page.call(this);this.bindEmailChangeOnClickLinks()}
ChangeEmailPage.prototype={bindEmailChangeOnClickLinks:function(){$("#changeEmailEmailAddress").val("");$("#changeEmailEmailAddressConfirm").val("");$("#changeEmailPageButton").unbind("click");$("#changeEmailPageButton").click(function(){if(validateForm($("#changeEmailAddressForm"))){Page.current.disableButtons();lightboxOverlay.showLoader();$("#showGenericError").hide();$("#newEmailErrorDiv").hide();$("#newEmailConfirmErrorDiv").hide();setSecureCookie("newEmailAddress",document.getElementById("changeEmailEmailAddress").value);
setSecureCookie("newEmailAddressConfirm",document.getElementById("changeEmailEmailAddressConfirm").value);var a="settings/change-email";if(-1!=window.location.toString().indexOf("-parent-"))a="settings/change-parent-email";$.ajax({cache:false,data:null,dataType:"text",error:function(){Page.current.enableButtons();lightboxOverlay.closeOverlay()},success:function(b){lightboxOverlay.closeOverlay();eval("("+b+")")},type:"POST",url:urlSecureBase+a});return false}});$("#changeEmailPageNoThanks").unbind("click");
$("#changeEmailPageNoThanks").click(function(){Page.current.disableButtons();window.location=$("#cancelEmailPageLink").val()})},handleChangeEmailResponse:function(a){var b=a["com.disney.d2c.dao.model.GenericAJAXResponse"].status,c=a["com.disney.d2c.dao.model.GenericAJAXResponse"].message;if(b==0){lightboxOverlay.useSlightlyNarrow("CHANGE E-MAIL CONFIRMATION","changeEmailThankYou");$("#closeSlightlyNarrowDialog").click(function(){lightboxOverlay.closeOverlay();window.location="/settings"});$("#changeEmailThankYouOk").click(function(){lightboxOverlay.closeOverlay();
window.location="/settings"});lightboxOverlay.showOverlay()}else if(b==-1){Page.current.enableButtons();$("#errorsMessageText").html(c);$("#showGenericError").show();$("#goregerror").show()}else if(b==1){Page.current.enableButtons();a=a["com.disney.d2c.dao.model.GenericAJAXResponse"].errors[0];if(a!=null&&a!="undefined"){a=a[0].field;$("#showGenericError").hide();$("#goregerror").hide();$("#"+a+"ErrorDiv").html(c);$("#"+a+"ErrorDiv").css("display","block")}}ajaxUtils.finished()}};
$.extend(ChangeEmailPage.prototype,Page.prototype);function ChangePasswordPage(){Page.call(this);this.bindPasswordChangeOnClickLinks()}
ChangePasswordPage.prototype={bindPasswordChangeOnClickLinks:function(){$("#changePasswordPageNoThanks").unbind("click");$("#changePasswordPageNoThanks").click(function(){Page.current.disableButtons();window.location=$("#cancelReturnLink").val()});$("#changePasswordPageButton").unbind("click");$("#changePasswordPageButton").click(function(){Page.current.disableButtons();if(!validateForm($("#changePasswordForm")[0])){$("#gspwOldErrorDiv").hide();$("#gspwErrorDiv").hide();$("#gspwConfirmErrorDiv").hide();
Page.current.enableButtons();return false}lightboxOverlay.showLoader();setSecureCookie("oldGspw",document.getElementById("changePasswordGspwOld").value);setSecureCookie("gspw",document.getElementById("changePasswordGspw").value);setSecureCookie("gspwConfirm",document.getElementById("changePasswordGspwConfirm").value);$.ajax({cache:false,data:null,dataType:"text",error:function(){Page.current.enableButtons();lightboxOverlay.closeOverlay()},success:function(a){Page.current.enableButtons();lightboxOverlay.closeOverlay();
eval("("+a+")")},type:"POST",url:urlSecureBase+"settings/change-password"});return false})},handleChangePasswordResponse:function(a){var b=a["com.disney.d2c.dao.model.GenericAJAXResponse"].status,c=a["com.disney.d2c.dao.model.GenericAJAXResponse"].message;if(b==0){$("#showGenericError").hide();$("#gspwOldErrorDiv").hide();$("#gspwConfirmErrorDiv").hide();$("#gspwErrorDiv").hide();lightboxOverlay.useSlightlyNarrow("PASSWORD UPDATED","changePasswordThankYou");$("#closeSlightlyNarrowDialog").click(function(){lightboxOverlay.closeOverlay();
window.location="/settings"});$("#changePasswordThankYouOk").click(function(){lightboxOverlay.closeOverlay();window.location="/settings"});lightboxOverlay.showOverlay()}else if(b==-1){$("#showGenericError").html(c);$("#showGenericError").show();$("#gspwOldErrorDiv").hide();$("#gspwConfirmErrorDiv").hide();$("#gspwErrorDiv").hide()}else if(b==1){a=a["com.disney.d2c.dao.model.GenericAJAXResponse"].errors[0];if(a!=null&&a!="undefined"){a=a[0].field;$("#showGenericError").hide();$("#gspwOldErrorDiv").hide();
$("#gspwConfirmErrorDiv").hide();$("#gspwErrorDiv").hide();$("#"+a+"ErrorDiv").html(c);$("#"+a+"ErrorDiv").show()}}ajaxUtils.finished()}};$.extend(ChangePasswordPage.prototype,Page.prototype);function DmAccountPage(){Page.call(this);this.bindDeleteCreditCardLink();this.bindAccountSettingsOnClickLinks();this.handleLocationHash();this.showHide()}
DmAccountPage.prototype={changeField:null,changedValue:null,fieldName:null,getField:function(a){idSplit=a.id.split("_");return theField=idSplit[1]},pageHandleLocationHash:function(a){for(var b=0;b<a.length;b++)switch(a[b].key){case "ccSaveSuccess":lightboxOverlay.useSlightlyNarrow("CREDIT CARD CONFIRMATION","creditCardUpdate");$("#closeSlightlyNarrowDialog").click(function(){lightboxOverlay.closeOverlay();Page.current.setLocationHash("")});$("#creditCardUpdateOk").click(function(){lightboxOverlay.closeOverlay();
Page.current.setLocationHash("")});$("#deleteMessageSuccess").addClass("hide");$("#updateMessageSuccess").removeClass("hide");lightboxOverlay.showOverlay();break}},showHide:function(){$("#accountForm .change").show();$("#accountForm .save").hide();$("#accountForm .fieldError").hide();$("#showGenericError").html("");$("#showGenericError").hide()},bindDeleteCreditCardLink:function(){var a=this;$("a#deleteCreditCardLink").click(function(){a.showHide();ajaxUtils.start();$.ajax({cache:false,error:function(){$("#showGenericError").html("There was a server error. Please try again later.");
$("#showGenericError").show()},success:function(){$("#creditCardInfo").hide();$("#creditCardInfo_none").show();lightboxOverlay.useSlightlyNarrow("CREDIT CARD CONFIRMATION","creditCardUpdate");$("#closeSlightlyNarrowDialog").click(function(){lightboxOverlay.closeOverlay()});$("#creditCardUpdateOk").click(function(){lightboxOverlay.closeOverlay()});$("#updateMessageSuccess").addClass("hide");$("#deleteMessageSuccess").removeClass("hide");lightboxOverlay.showOverlay()},type:"POST",url:urlBase+"api/user/pin.json"});
return false})},bindAccountSettingsOnClickLinks:function(){var a=this;$("#accountForm a.saveLink").unbind("click");$("#accountForm a.saveLink").click(function(){lightboxOverlay.showLoader();theField=a.getField(this);a.fieldName=theField;a.changeField="value_"+theField;a.changedValue=$("#new"+theField).val();name=theField.charAt(0).toLowerCase()+theField.substring(1);setSecureCookie(name,a.changedValue);postUrl=urlSecureBase;if("FirstName"==theField)postUrl+="settings/change-first-name";else if("LastName"==
theField)postUrl+="settings/change-last-name";else if("ZipCode"==theField)postUrl+="settings/change-zip-code";$.ajax({cache:false,data:null,dataType:"text",error:function(){lightboxOverlay.closeOverlay()},success:function(b){lightboxOverlay.closeOverlay();eval("("+b+")")},type:"POST",url:postUrl});return false});$("#accountForm a.cancelLink").unbind("click");$("#accountForm a.cancelLink").click(function(){a.showHide();theField=a.getField(this);$("#new"+theField).val("");return false});$("#accountForm a.changeLink").unbind("click");
$("#accountForm a.changeLink").click(function(){theField=a.getField(this);$("#new"+theField).val("");a.showHide();$("#save"+theField+"Div").show();$("#change"+theField+"Div").hide();return false});$("#registerOptIn").click(function(){lightboxOverlay.closeOverlay();lightboxOverlay.showLoader();a.showHide();a.fieldName=this.name;a.changedValue=$("#registerOptIn").is(":checked");$.ajax({cache:false,data:null,dataType:"text",error:function(){lightboxOverlay.closeOverlay()},success:function(b){lightboxOverlay.closeOverlay();
eval("("+b+")")},type:"POST",url:urlSecureBase+"settings/change-opt-in"});return false})},handleOptInResponse:function(a){var b=a.optinResponse.status,c=a.optinResponse.message,d=null;if(b==1)d=a.optinResponse.errors[0];this.handle(b,c,d)},handleDmAccountResponse:function(a){var b=a.dmAccountUpdateResponse.status,c=a.dmAccountUpdateResponse.message,d=null;if(b==1)d=a.dmAccountUpdateResponse.errors[0];this.handle(b,c,d)},handle:function(a,b,c){if(a==0){$("#showGenericError").hide();$("#zipCodeErrorDiv").hide();
$("#lastNameErrorDiv").hide();$("#firstNameErrorDiv").hide();lightboxOverlay.useSlightlyNarrow("ACCOUNT UPDATED","changeAccountThankYou");$("#closeSlightlyNarrowDialog").click(function(){lightboxOverlay.closeOverlay()});$("#changeAccountThankYouOk").click(function(){lightboxOverlay.closeOverlay()});if(this.fieldName=="optIn")$("#registerOptIn").attr("checked",this.changedValue);else{$("#"+this.changeField).html(this.changedValue);$("#change"+this.fieldName+"Div").show();$("#save"+this.fieldName+"Div").hide();
if(this.fieldName=="FirstName"){$("#userHeaderFirstName").html(this.changedValue);deleteCookie("dmo_member_n","/",".go.com");setCookie("dmo_member_n",this.changedValue)}}lightboxOverlay.showOverlay()}else if(a==-1){$("#showGenericError").html(b);$("#showGenericError").show()}else if(a==1)if(c!=null&&c!="undefined"){$("#showGenericError").hide();a=c[0].field;$("#"+a+"ErrorDiv").html(b);$("#"+a+"ErrorDiv").show()}ajaxUtils.finished()}};$.extend(DmAccountPage.prototype,Page.prototype);
function ContactPage(){Page.call(this);this.bindContactPageLinks()}
ContactPage.prototype={bindContactPageLinks:function(){$("#nameValidationError").hide();$("#emailValidationError").hide();$("#commentValidationError").hide();$("#contactCommentCharsLeft").removeAttr("style");$("#contactSubmit").unbind("click");$("#contactSubmit").click(function(){var b="";if(document.getElementById("contactName").value==null||document.getElementById("contactName").value=="undefined"||jQuery.trim(document.getElementById("contactName").value)==""){b=true;$("#nameValidationError").show()}else $("#nameValidationError").hide();
if(document.getElementById("contactEmailAddress").value==null||document.getElementById("contactEmailAddress").value=="undefined"||jQuery.trim(document.getElementById("contactEmailAddress").value)==""){b=true;$("#emailValidationError").show()}else $("#emailValidationError").hide();if(document.getElementById("contactComment").value==null||document.getElementById("contactComment").value=="undefined"||jQuery.trim(document.getElementById("contactComment").value)==""){b=true;$("#commentValidationError").show()}else $("#commentValidationError").hide();
if(b!=""){$("#nameContactErrorDiv").hide();$("#emailAddressContactErrorDiv").hide();$("#commentContactErrorDiv").hide();Page.current.enableButtons()}else{Page.current.disableButtons();lightboxOverlay.showLoader();setSecureCookie("problemReportCategory",document.getElementById("contactCategory").value);setSecureCookie("name",document.getElementById("contactName").value);setSecureCookie("emailAddress",document.getElementById("contactEmailAddress").value);setSecureCookie("cmnt",document.getElementById("contactComment").value);
setSecureCookie("acceptTC",document.getElementById("contactAcceptTC").value);b=document.createElement("script");b.src=urlSecureBase+"api/submit-feedback";document.body.appendChild(b)}});$("#contactCancel").unbind("click");$("#contactCancel").click(function(){Page.current.disableButtons();lightboxOverlay.showLoader();window.location="/help-overview"});$("#contactComment").bind("keyup",function(){var b=VALIDATION_CONSTANTS.validFeedbackComment.maxLength;if(this.value.length>b){this.value=this.value.substring(0,
b);this.scrollTop=this.scrollHeight}else{this.value.length>=775?$("#contactCommentCharsLeft").attr("style","color:#DD0915"):$("#contactCommentCharsLeft").removeAttr("style");$("#contactCommentCharsLeft").html(b-this.value.length)}});var a=$("#contactCategoryButtons .button");a.unbind("click");a.click(function(){var b={};b.contactCategory0="I have a question";b.contactCategory1="I have a technical problem";b.contactCategory4="I have a problem with my code";b.contactCategory3="I have some other problem";
if(this.id in b){$("#contactCategory").val(b[this.id]).attr("selected","selected");a.removeClass("active");$(this).addClass("active")}});return false},handleContactResponse:function(a){var b=a.feedbackResponse.status,c=a.feedbackResponse.message;lightboxOverlay.closeOverlay();if(b==0){lightboxOverlay.useSlightlyNarrow("THANK YOU","contactThankYou");lightboxOverlay.showOverlay();$("input:text, textarea").val("");$(".fieldError").hide();$("#contactThankYouOk").unbind("click");$("#contactThankYouOk").click(function(){lightboxOverlay.closeOverlay();
document.location="/help-overview"});$("#closeSlightlyNarrowDialog").click(function(){document.location="/help-overview";$("#closeSlightlyNarrowDialog").unbind("click")})}else if(b==-1){$("#categoryContactErrorDiv").hide();$("#nameContactErrorDiv").hide();$("#emailAddressContactErrorDiv").hide();$("#commentContactErrorDiv").hide();$("#contactErrorMessage").html(c);$("#showContactGenericError").show();Page.current.enableButtons()}else if(b==1){a=a.feedbackResponse.errors[0];if(a!=null&&a!="undefined"){a=
a[0].field;$("#categoryContactErrorDiv").hide();$("#nameContactErrorDiv").hide();$("#emailAddressContactErrorDiv").hide();$("#commentContactErrorDiv").hide();$("#showContactGenericError").hide();$("#"+a+"ContactErrorDiv").html(c);$("#"+a+"ContactErrorDiv").show();Page.current.enableButtons()}}ajaxUtils.finished()}};$.extend(ContactPage.prototype,Page.prototype);function ForgotUserPage(){Page.call(this);this.bindSubmitButtonLinks()}
ForgotUserPage.prototype={bindSubmitButtonLinks:function(){$("#cancelRetrieve").unbind("click");$("#cancelRetrieve").click(function(){Page.current.disableButtons();window.location.href=$("#forgotUserCancelLink").val()});$("#forgotUserFormSubmit").unbind("submit");$("#forgotUserFormSubmit").submit(function(){if($("#forgotUserEmailAddress").val()!=""){Page.current.disableButtons();lightboxOverlay.showLoader();ajaxUtils.start();setSecureCookie("emailAddress",document.getElementById("forgotUserEmailAddress").value);
$.ajax({cache:false,data:null,dataType:"text",error:function(){Page.current.enableButtons();lightboxOverlay.closeOverlay()},success:function(a){Page.current.enableButtons();lightboxOverlay.closeOverlay();eval("("+a+")")},type:"POST",url:urlBase+"forgot-user"});$("#forgotUserEmailAddressErrorText .emptyError").hide()}else $("#forgotUserEmailAddressErrorText .emptyError").show();return false});return false},handleForgotUserResponse:function(a){var b=a["com.disney.d2c.dao.model.GenericAJAXResponse"].status;
a=a["com.disney.d2c.dao.model.GenericAJAXResponse"].message;$("#goregerror").hide();if(b==0){lightboxOverlay.useSlightlyNarrow("RETRIEVE ACCOUNT ID CONFIRMATION","forgotUserConfirmation");lightboxOverlay.showOverlay();$("#forgotUserConfirmationOk").unbind("click");$("#forgotUserConfirmationOk").click(function(){lightboxOverlay.closeOverlay();document.location="/login"})}else{$("#forgotUserEmailAddressError").html(a);$("#goregerror").show()}ajaxUtils.finished()}};
$.extend(ForgotUserPage.prototype,Page.prototype);
function ForgotPassPage(){Page.call(this);$("#monthDropDown,#dayDropDown,#yearDropDown").removeClass("dummyDropDown");$("#forgotPasswordBirthMonth,#forgotPasswordBirthDayOfMonth,#forgotPasswordBirthYear").change(function(){var a=$("#forgotPasswordBirthMonth").val(),b=$("#forgotPasswordBirthDayOfMonth").val(),c=$("#forgotPasswordBirthYear").val();if(a!="-1"&&b!="-1"&&c!="-1")if(c<1998){$("#forgotPasswordAccountIdCont").show();$("#forgotPasswordLastNameCont").show()}else{$("#forgotPasswordAccountIdCont").show();$("#forgotPasswordLastNameCont").hide()}else{$("#forgotPasswordAccountIdCont").hide();
$("#forgotPasswordLastNameCont").hide()}});$("#forgotPasswordBirthMonth,#forgotPasswordBirthDayOfMonth,#forgotPasswordBirthYear").sSelect();this.bindSubmitButtonLinks()}
ForgotPassPage.prototype={bindSubmitButtonLinks:function(){$("#forgotPasswordCancel").unbind("click");$("#forgotPasswordCancel").click(function(){Page.current.disableButtons();window.location.href=$("#forgotPasswordCancelLink").val()});$("#forgotPassFormSubmit").unbind("submit");$("#forgotPassFormSubmit").submit(function(){Page.current.disableButtons();$("#forgotPasswordError").val("");$("#goregerror").hide();if(validateForm($("#forgotPasswordPage #accountForm"))){lightboxOverlay.showLoader();ajaxUtils.start();
setSecureCookie("emailAddress",document.getElementById("forgotPasswordAccountId").value);setSecureCookie("lastName",document.getElementById("forgotPasswordLastName").value);setSecureCookie("birthMonth",document.getElementById("forgotPasswordBirthMonth").value);setSecureCookie("birthDayOfMonth",document.getElementById("forgotPasswordBirthDayOfMonth").value);setSecureCookie("birthYear",document.getElementById("forgotPasswordBirthYear").value);$.ajax({cache:false,data:null,dataType:"text",error:function(){Page.current.enableButtons();
lightboxOverlay.closeOverlay()},success:function(a){Page.current.enableButtons();lightboxOverlay.closeOverlay();eval("("+a+")")},type:"POST",url:urlBase+"forgot-password"})}else Page.current.enableButtons();return false});return false},handleForgotPassResponse:function(a){var b=a["com.disney.d2c.dao.model.GenericAJAXResponse"].status;a=a["com.disney.d2c.dao.model.GenericAJAXResponse"].message;$("#goregerror").hide();if(b==0){lightboxOverlay.useSlightlyNarrow("RESET PASSWORD CONFIRMATION","forgotPassConfirmation");
lightboxOverlay.showOverlay();$("#forgotPassConfirmationOk").unbind("click");$("#forgotPassConfirmationOk").click(function(){lightboxOverlay.closeOverlay();document.location="/login"})}else{$("#forgotPasswordError").html(a);$("#goregerror").show()}ajaxUtils.finished()}};$.extend(ForgotPassPage.prototype,Page.prototype);
function RegistrationPage(a){Page.call(this);if(a==1){$("#monthDropDown,#dayDropDown,#yearDropDown").removeClass("dummyDropDown");$("#month").sSelect();$("#day").sSelect();$("#year").sSelect()}if(a==1||a==2)this.bindRegistrationForm(a);a==2&&this.bindMemberNameSuggestion();this.performOmnitureRegTrack(a)}
RegistrationPage.prototype={bindRegistrationForm:function(a){$("#registerPageNoThanks").unbind();$("#registerPageNoThanks").click(function(){Page.current.disableButtons();window.location="/home"});$("#registerForm").unbind("submit");$("#registerPageButton").unbind();$("#registerPageButton").click(function(){Page.current.disableButtons();valid=validateForm($("#registerForm"));if(a==1){var b=new Date,c=parseInt($("#month").val()),d=parseInt($("#day").val()),e=parseInt($("#year").val());if(b<new Date(e+
13,c,d)){valid=false;lightboxOverlay.showUnder13("/home")}}else if(a==2){$("#registerGenderErrorText li.emptyError").css("display","none");b=$("#registerForm input[name='gender']:checked").val();if(typeof b==undefined||b==null){$("#registerGenderErrorText li.emptyError").css("display","block");valid=false}}if(valid){lightboxOverlay.showLoader();$("#registerForm").submit()}else Page.current.enableButtons()})},bindMemberNameSuggestion:function(){$("#registerForm input#userName").blur(function(){$("#userNameSuggestionLightbox #userNameSuggestions").html("");
$(this).val()&&$.ajax({cache:false,data:null,dataType:"json",error:function(){},success:function(a){if(!a.result.isAvailable&&a.result.suggestions.length>0){var b="";j=a.result.suggestions.length;for(i=0;i<j;i++){val=a.result.suggestions[i];b+="<li><input type='radio' name='userNameSuggestion' class='memberNameOption' id='userNameSuggestion_"+i+"' value='"+val+"' ";if(0==i)b+=" checked=checked";b+="/><span>"+val+"</span></li>"}lightboxOverlay.useSlightlyNarrow("PLEASE CHOOSE ANOTHER ACCOUNT ID","userNameSuggestionLightbox");
$("#userNameSuggestionLightbox #userNameSuggestions").html(b);lightboxOverlay.showOverlay();$("#closeSlightlyNarrowDialog").click(function(){lightboxOverlay.closeOverlay();$("#userNameSuggestionLightbox #userNameSuggestions").html("")});$("#userNameSuggestionTryAgain").click(function(){lightboxOverlay.closeOverlay();$("#userNameSuggestionLightbox #userNameSuggestions").html("")});$("#userNameSuggestionContinue").click(function(){var c=$("#userNameSuggestions .memberNameOption"),d;for(i=0;i<c.length;i++)if(c[i].checked){d=
c[i].value;break}$("#registerForm input#userName").val(d);lightboxOverlay.closeOverlay();$("#userNameSuggestionLightbox #userNameSuggestions").html("")})}},type:"POST",url:urlSecureBase+"api/member-name/availability.json?userName="+this.value+"&r="+Number(new Date)});return false})},performOmnitureRegTrack:function(a){if(a==2)if($("#registerEmailAddressLabel").size()>0){analytics.trackPage("reg_adult_details");analytics.trackEvent("reg_adult_details")}else if($("#registerParentEmailAddressLabel").size()>
0){analytics.trackPage("reg_child_details");analytics.trackEvent("reg_child_details")}else analytics.trackPage("reg_ERROR_details");else if(a==3){if($("#findMovieAdult").size()>0)analytics.trackPage("reg_adult_success");else $("#findMovieChild").size()>0?analytics.trackPage("reg_child_success"):analytics.trackPage("reg_ERROR_success");analytics.trackOmnitureCookie()}}};function AbstractRegistrationPage(){}AbstractRegistrationPage.prototype={notLoggedInBehavior:function(){}};
$.extend(RegistrationPage.prototype,Page.prototype);$.extend(RegistrationPage.prototype,AbstractRegistrationPage.prototype);
function SearchResultsPage(){$("#movieList ul.movies.clearFix li.streamable.rental").each(function(b,c){var d=$(c).find(".countdownTimer span.expireDate.rentalTimer").html();new CountdownTimer($(c),eval(d))});Page.call(this);Page.current.video=null;Page.current.videos=this.searchList;AbstractHoverFunctionality.call(this);var a=$("#OMNI_searchTerm").html();typeof a!=undefined&&a!=null?analytics.trackSearch(a,$("#OMNI_searchResultSize").html()):analytics.trackSearch("no_search_entered","0")}
function AbstractSearchResultsPage(){}$.extend(SearchResultsPage.prototype,Page.prototype);$.extend(SearchResultsPage.prototype,AbstractSearchResultsPage.prototype);$.extend(SearchResultsPage.prototype,AbstractHoverFunctionality.prototype);function SyndicatedVideoPlayerPage(){Page.call(this);this.moviePlayer=new MoviePlayer("videoPlayer",moviePlayerPath);this.handleLocationHash()}function AbstractSyndicatedVideoPlayerPage(){}
AbstractSyndicatedVideoPlayerPage.prototype={players:{},handleLocationHash:function(){for(var a=this.getLocationHashArray(),b=0;b<a.length;b++)switch(a[b].key){case "intro":this.moviePlayer.siteIntro();break;case "playMovie":this.moviePlayer.playMovie(a[b].value);break;case "playTrailer":this.moviePlayer.playTrailer(a[b].value);break}},notLoggedInBehavior:function(){Page.bindLoginForms();this.bindLoginLinks()}};$.extend(SyndicatedVideoPlayerPage.prototype,Page.prototype);
$.extend(SyndicatedVideoPlayerPage.prototype,AbstractSyndicatedVideoPlayerPage.prototype);function LoginPage(){Page.call(this);this.bindLoginPageForm()}function AbstractLoginPage(){}
AbstractLoginPage.prototype={bindLoginPageForm:function(){$("#loginForm").unbind("submit");$("#loginForm").submit(function(){if(valid=validateForm(this)){Page.current.disableButtons();lightboxOverlay.showLoader();return true}else{Page.current.enableButtons();return false}});$("#joinNowBtn").unbind("click");$("#joinNowBtn").click(function(){Page.current.disableButtons();lightboxOverlay.showLoader();window.location=$("#joinNowLink").val();return true})},loggedInBehavior:function(){this.checkLocationHash();
this.monitorLocationHash()},notLoggedInBehavior:function(){this.checkLocationHash();this.monitorLocationHash()}};$.extend(LoginPage.prototype,Page.prototype);$.extend(LoginPage.prototype,AbstractLoginPage.prototype);
function ProductPage(){Page.call(this);this.movieList=this.searchList;Page.current.video=this.movieList.videosByMpm[$("#productVideo").attr("value")];Page.current.video.availableActions=eval("("+$("#aa").html()+")");Page.current.video.blocked=$("#blocked").html()=="true"?true:false;Page.current.video.populateLicenseProfiles(Page.current.video.availableActions);this.createProductTabs();this.enableVideoPlayer();$("#productFeatures .scrollable").each(function(){var a=$("#"+this.id+"Size").val();if(a==
1)$("#"+this.id+"slider").remove();else{new Scrollbar(this.id+"",this.id+"Slider",185,a);document.getElementById(this.id+"Slider").style.visibility="visible"}});$("div.clickableBonus").click(function(){Page.current.showBonusTab()});$("div.clickableExtra").click(function(){Page.current.showFreeExtrasTab()});analytics.trackPage("product_"+seoCleanText(Page.current.video.title))}function AbstractProductPage(){}
AbstractProductPage.prototype={purchaseType:null,video:null,showUpgradeLinks:true,showPurchaseUpgradeLinks:function(a){if(this.showUpgradeLinks){this.showUpgradeLinks=false;if(a=="buy"||!isLoggedIn){$("#purchaseLinkBuy").removeClass("hidden");$("#purchaseLinkUpgrade").addClass("hidden")}else if(a=="upgrade")if(typeof Page.current.video.isVaulted!=undefined&&Page.current.video.isVaulted!=null&&Page.current.video.isVaulted){$("#purchaseLinkUpgrade .purchaseLink").html("$"+Page.current.video.buyPrice+
" &nbsp;&nbsp;&nbsp; $"+Page.current.video.upgradePrice+"*");$("#movieStatusPane .vaultContainer .vaultHide").removeClass("vaultHide");$("#movieStatusPane .vaultContainer .vaultShow").addClass("vaultHide").removeClass("vaultShow");$("#movieStatusPane .testPlayback").removeClass("hidden");$("#productDetailMoviePlayerButton").removeClass("hidden");$("#movieActionsBox #movieActionsButtons").removeClass("hidden")}else if($("#purchaseLink .iconmenu #purchaseLinkUpgrade.buy.purchaseLink").hasClass("hidden")){$("#purchaseLink .iconmenu #purchaseLinkUpgrade.buy.purchaseLink .upgradePrice").html("&nbsp;&nbsp;$"+
Page.current.video.upgradePrice+"*");$("#purchaseLinkUpgrade").removeClass("hidden");$("#purchaseLinkBuy").addClass("hidden");$("#movieStatusPane .rtcol-promoBottom .notRedeemed.block").hide();$("#movieStatusPane .rtcol-promoBottom .redeemed.block").show()}}},bindPurchaseLinks:function(){var a=this;$.each($("li.purchaseLink"),function(){$(this).unbind("click");$(this).click(function(){if(User.current!=null&&User.current.internationalUser){lightboxOverlay.useSlightlyNarrow("LOCATION NOT SUPPORTED",
"blockedLocation");$("#closeSlightlyNarrowDialog").click(function(){lightboxOverlay.closeOverlay()});$("#blockedLocationThankYouOk").unbind("click");$("#blockedLocationThankYouOk").click(function(){lightboxOverlay.closeOverlay()});lightboxOverlay.showOverlay();return false}var b=$(this).attr("id").replace("purchaseLink","").toLowerCase();a.video.purchaseType=b;analytics.trackEvent(b+"_attempt");a.video.purchase(b)})});$("a#enterNewPaymentInfo").unbind("click");$("a#enterNewPaymentInfo").click(function(){User.clearCCInfo()});
$("#purchasePinForm").unbind("submit");$("#purchasePinForm").submit(function(){Page.current.disableButtons();var b=false;$("#purchasePinEntryContainer .purchasePinErrorMessage").hide();var c=$("#purchasePinInput").val();if(c-0!=c||c.length==0){$("#attemptBadInput").show();$("#purchasePinEntryContainer .redTriangleError").show()}else{b=true;$("#attemptBadInput").hide()}setSecureCookie("profilePin",$("#purchasePinInput")[0].value);setCookie("profilePinSet",true);b&&lightboxOverlay.showLoader();a.video.purchase(a.video.purchaseType);
Page.current.enableButtons();return false});$("#codeEntryLink,#purchaseDiscountLink,#vaultMagicCodeLink").unbind("click");$("#codeEntryLink,#purchaseDiscountLink,#vaultMagicCodeLink").click(function(){Page.current.showMagicCodeLB()})},createProductTabs:function(){var a=goog.dom.getElementsByTagNameAndClass("div","goog-tab-content",goog.dom.getElement("productFeatures")),b=new goog.ui.TabBar;Page.current.tabBar=b;var c=goog.dom.getElementsByTagNameAndClass("a",null,goog.dom.getElement("productTabs"));
goog.array.forEach(c,function(e){e.onclick=function(){return false}});try{b.decorate(goog.dom.getElement("productTabs"))}catch(d){myconsole.log(d)}goog.events.listen(b,goog.ui.Component.EventType.SELECT,function(e){var f=e.target,g=f.getId()+"Content";f.addClassName("active");goog.array.forEach(c,function(h){if(h.id!=f.getId())h.className=h.className.replace(/\bactive\b/,"")});goog.dom.getElement(g).style.display="block";goog.array.forEach(a,function(h){if(g=="freeExtrasTabContent"){$("#productFeatures div.borderBottom").addClass("borderBottomBlack");
$("#productFeatures div.borderTop").addClass("borderTopBlack")}else{$("#productFeatures div.borderBottom").removeClass("borderBottomBlack");$("#productFeatures div.borderTop").removeClass("borderTopBlack")}if(h.id!=g)h.style.display="none";else if(g=="freeExtrasTabContent")if(Page.current.video.isRented())analytics.trackLink("product_free_tab_rented");else Page.current.video.hasStreamingRights()?analytics.trackLink("product_free_tab_owned"):analytics.trackLink("product_free_tab");else if(g=="bonusFeaturesTabContent")if(Page.current.video.isRented())analytics.trackLink("product_bonus_tab_rented");
else Page.current.video.hasStreamingRights()?analytics.trackLink("product_bonus_tab_owned"):analytics.trackLink("product_bonus_tab");else if(Page.current.video.isRented())analytics.trackLink("product_detail_tab_rented");else Page.current.video.hasStreamingRights()?analytics.trackLink("product_detail_tab_owned"):analytics.trackLink("product_detail_tab")});return false})},displayPurchaseDialog:function(a){$("#purchasePinInput").val("");$("div#purchaseDialog").addClass(a.toLowerCase());if(a=="rent"){a=
"RENTAL";$("#purchaseDialog").removeClass("buy");$("#purchaseDialog").removeClass("upgrade");$("#thankYouDialog").removeClass("buy");$("#thankYouDialog").removeClass("upgrade");$("#movieDetails span.rentPrice").html("$"+Page.current.video.rentPrice)}else if(a=="upgrade"){a="PURCHASE";$("#purchaseDialog").removeClass("rent");$("#purchaseDialog").removeClass("buy");$("#thankYouDialog").removeClass("rent");$("#thankYouDialog").removeClass("buy");$("#movieDetails #purchaseOrginalPrice").html("$"+Page.current.video.originalPrice);
$("#purchasePriceUpgrade").html("$"+Page.current.video.upgradePrice+"*");Page.current.showPurchaseUpgradeLinks("upgrade")}else{a="PURCHASE";$("#purchaseDialog").removeClass("rent");$("#purchaseDialog").removeClass("upgrade");$("#thankYouDialog").removeClass("rent");$("#thankYouDialog").removeClass("upgrade");$("#movieDetails span.buyPrice").html("$"+Page.current.video.buyPrice)}$("#purchasePinSubmit").val($("#purchasePinText").val()+a);lightboxOverlay.useMedium("CONFIRM "+a,"purchaseDialog",function(){$("#purchaseDialog").removeClass("rent");
$("#purchaseDialog").removeClass("buy");$("#purchaseDialog").removeClass("upgrade")});lightboxOverlay.showOverlay()},enableBonusVideos:function(){if(!Page.current.video.isRented()&&Page.current.video.hasStreamingRights()){$("#bonusFeaturesTabContent .videoPreviewImage").unbind("click");$("#bonusFeaturesTabContent .videoPreviewImage").click(function(){Page.current.pauseMovies();var a=$(this).find("input.mediaId").val(),b=$(this).find("input.bonusTitle").val();lightboxOverlay.showBonusPlayer(a,b)})}},
enableVideoPlayer:function(){$("#productDetailMoviePlayerButton, .playMovie").unbind("click");$("#productDetailMoviePlayerButton, .playMovie").click(function(){Page.current.video.hasStreamingRights()?Page.current.playMovie():Page.current.playTrailer()});$(" #movieActionsButtons .playTrailer, div.testPlayback").unbind("click");$("#movieActionsButtons .playTrailer, div.testPlayback").click(function(){Page.current.playTrailer()});$("a:not(.notPausable)").click(function(){Page.current.pauseMovies()})},
loggedInBehavior:function(){this.bindPurchaseLinks();MovieList.current.userLoggedIn();Page.current.skin();this.checkLocationHash();this.monitorLocationHash();var a=getCookie("dmrCode");if(typeof a!=undefined&&a!=null&&a.length>0){clearWorkflowCookies();(new CodeRedemption(a,Page.current.video.mpmProductId)).redeem()}Page.current.video.isRented()&&!Page.current.inPurchaseFlow&&$("div.countdownTimer:not(#magicCodeThankYou .countdownTimer, #thankYouDialog .countdownTimer)").each(function(){new CountdownTimer($(this),
Page.current.video.expireDate)})},notLoggedInBehavior:function(){this.bindPurchaseLinks();this.checkLocationHash();this.monitorLocationHash()},pageHandleLocationHash:function(a){document.location.hash.indexOf("purchaseId")==-1&&clearWorkflowCookies();for(var b=0;b<a.length;b++)switch(a[b].key){case "purchaseId":lightboxOverlay.showLoader();var c=a[b].value,d=getCookie("purchasePrice"),e=getCookie("purchaseType"),f;if(typeof e!="undefined"&&e!=null)Page.current.inPurchaseFlow=true;clearWorkflowCookies();
$(Page.current.getLocationHashArray()).each(function(m,n){if(n.key=="profStat")f=n.value});var g=Page.current.video.mpmProductId!=null?Page.current.video.mpmProductId:"",h="";for(b=0;b<a.length;b++)if(a[b].key=="pid")h=a[b].value!=null?a[b].value:"";g="mpmId="+g+"&eProdId="+h+"&ePurId="+(c!=null?c:"");typeof f!=undefined&&f!=null&&f==1?User.refreshLocker("ccp=true&"+g):User.refreshLocker(g);User.syncroRetrieve();Page.current.video.isRented()&&$("#movieContainer .countdownTimer").each(function(m,n){new CountdownTimer($(n),
Page.current.video.expireDate)});e=new PurchaseResponseHandler(null,e);e.purchasePrice=d;e.purchaseId=c;e.profStat=f;e.showThankYou();break;case "playMovie":var k=true;if(!User.current.dmrPartiallyRegistered&&(!isLoggedIn||User.current.partiallyRegistered)){User.onLoggedIn(function(){if(k){User.syncLocker();User.syncroRetrieve()}Page.current.playMovie()});break}if(User.current.dmrPartiallyRegistered){User.onLoggedIn(function(){Page.current.playMovie()});this.dmrPartialReg()}else{if(window.location.hash!=
"#playMovie=noSync"&&k){User.syncLocker();User.syncroRetrieve()}Page.current.playMovie()}window.location.hash="";break;case "playTrailer":if(User.current.dmrPartiallyRegistered){this.dmrPartialReg();User.onLoggedIn(function(){Page.current.playTrailer()})}else Page.current.playTrailer();break;case "upgradeMovie":if(!isLoggedIn)window.location=urlSecureBase+"/login?d2cAppRedirect="+escape(window.location);var l=k=true;$(Page.current.getLocationHashArray()).each(function(m,n){if(n.key=="dmr"){(new CodeRedemption(null,
Page.current.video.mpmProductId)).redeemSuccess();l=false}});l&&User.onRetrieved(function(){if(User.current.dmrPartiallyRegistered){User.onLoggedIn(function(){analytics.trackEvent("upgrade_attempt");Page.current.video.purchase("upgrade")});Page.current.dmrPartialReg()}else if(isLoggedIn){if(window.location.hash!="#upgradeMovie=noSync"&&k){User.syncLocker();User.syncroRetrieve()}analytics.trackEvent("upgrade_attempt");Page.current.showPurchaseUpgradeLinks("upgrade");Page.current.video.purchase("upgrade")}else User.onLoggedIn(function(){if(window.location.hash!=
"#upgradeMovie=noSync"&&k){User.syncLocker();User.syncroRetrieve()}analytics.trackEvent("upgrade_attempt");Page.current.showPurchaseUpgradeLinks("upgrade");Page.current.video.purchase("upgrade")})});break;case "buyMovie":if(Page.current.video.hasPhysicalLicense()){window.location="#upgradeMovie";break}if(!isLoggedIn)window.location=urlSecureBase+"/login?d2cAppRedirect="+escape(window.location);k=true;User.onRetrieved(function(){if(User.current.dmrPartiallyRegistered){User.onLoggedIn(function(){analytics.trackEvent("buy_attempt");
Page.current.video.purchase("buy")});Page.current.dmrPartialReg()}else if(isLoggedIn){if(window.location.hash!="#buyMovie=noSync"&&k){User.syncLocker();User.syncroRetrieve()}analytics.trackEvent("buy_attempt");Page.current.video.purchase("buy")}else User.onLoggedIn(function(){if(window.location.hash!="#buyMovie=noSync"&&k){User.syncLocker();User.syncroRetrieve()}analytics.trackEvent("buy_attempt");Page.current.video.purchase("buy")})});break;case "rentMovie":if(!isLoggedIn)window.location=urlSecureBase+
"/login?d2cAppRedirect="+escape(window.location);k=true;User.onRetrieved(function(){if(User.current.dmrPartiallyRegistered){User.onLoggedIn(function(){analytics.trackEvent("rent_attempt");Page.current.video.purchase("rent")});Page.current.dmrPartialReg()}else if(isLoggedIn){if(window.location.hash!="#rentMovie=noSync"&&k){User.syncLocker();User.syncroRetrieve()}analytics.trackEvent("rent_attempt");Page.current.video.purchase("rent")}else User.onLoggedIn(function(){if(window.location.hash!="#rentMovie=noSync"&&
k){User.syncLocker();User.syncroRetrieve()}analytics.trackEvent("rent_attempt");Page.current.video.purchase("rent")})});break;case "freeExtras":Page.current.showFreeExtrasTab();break;case "bonus":Page.current.showBonusTab();break}},playerSize:function(){return this.video.hasStreamingRights()&&!this.video.isRented()?[756,420]:[558,310]},playMovie:function(){myconsole.log("playMovie");if(Page.current.video.blocked==true)lightboxOverlay.showBlockedLocationStreaming();else if(Page.current.video.hasStreamingRights()){this.player=
player=new MoviePlayer("productDetailMoviePlayer",moviePlayerPath,this.playerSize());player.showPlayerCompleteHash=false;player.finishCallback=function(a){$("#"+a.playerID).addClass("zhidden");a.unloadPlayer();$("div.billboardPlayer").show();$("#productDetailMoviePlayerButton").show()};$("div.billboardPlayer").hide();$("#productDetailMoviePlayerButton").hide();lightboxOverlay.closeOverlay();player.play(seoCleanText(this.video.title)+"_feature",$("#productVideo").val()+"-f")}},playTrailer:function(){myconsole.log("playTrailer");
var a=new MoviePlayer("productDetailMoviePlayer",moviePlayerPath,this.playerSize());a.showPlayerCompleteHash=false;a.finishCallback=function(b){$("#"+b.playerID).addClass("zhidden");b.unloadPlayer();$("div.billboardPlayer").show();$("#productDetailMoviePlayerButton").show();$("#"+b.playerID).hide()};$("div.billboardPlayer").hide();$("#productDetailMoviePlayerButton").hide();lightboxOverlay.closeOverlay();a.play(seoCleanText(this.video.title)+"_trailer",$("#productVideo").val()+"-t")},showBonusTab:function(){if(Page.current.video.bonusCount>
0){Page.current.showTab(1);lightboxOverlay.closeOverlay();$("html, body").animate({scrollTop:$("#productTabs").offset().top},1500)}},showFreeExtrasTab:function(){if(Page.current.video.hasStreamingRights()&&!Page.current.video.isRented()){if(Page.current.video.freeExtraCount>0&&Page.current.video.bonusCount>0&&Page.current.video.hasStreamingRights()&&!Page.current.video.isRented()){Page.current.showTab(2);lightboxOverlay.closeOverlay()}else if(Page.current.video.freeExtraCount>0){Page.current.showTab(1);
lightboxOverlay.closeOverlay()}$("html, body").animate({scrollTop:$("#productTabs").offset().top},1500)}},showMagicCodeLB:function(a){$("#magicCodeForm").unbind("submit");$("#magicCodeForm").submit(function(){Page.current.disableButtons();analytics.trackEvent("magicCode_product");var b=new CodeRedemption($("#lbMCField").val(),Page.current.video.mpmProductId);b.lightboxRedeem();Page.current.enableButtons();$("#magicCodeThankYou .enterAnotherCode").unbind("click");$("#magicCodeThankYou .enterAnotherCode").click(function(){b.closeCallBack();
$("#codeEntryLink").click()});return false});lightboxOverlay.useWide("GET A DISCOUNT ON THE STREAMING VERSION OF YOUR MOVIE!","magicCodeEntryLightBox");$("#lbMCField").each(function(){var b=$(this);this.defaultText=b.attr("defaultValue");b.val(this.defaultText);b.unbind("focus");b.focus(function(){b.val().trim()==this.defaultText&&b.val("")});b.blur(function(){b.val().trim()==""&&b.val(this.defaultText)})});a||$("#magicCodeLBError").html("");lightboxOverlay.showOverlay()},skin:function(){var a=this;
if(Page.current.video.hasStreamingRights()){if(Page.current.video.isRented()){$("body").removeClass("nonStreamable");$("body").addClass("streamable")}else{Page.current.video.freeExtraCount>0&&$("#freeExtrasTab").removeClass("hidden");$("body").removeClass("nonStreamable");$("body").addClass("streamable");$("body").addClass("fullOwn");$("#bonusFeaturesTabContent .bonusFeaturesAvailableForPurchaseOverlay").addClass("fullOwn");$("#bonusFeaturesTabContent .bonusFeaturesAvailableForPurchaseVault").addClass("fullOwn");
$("#movieContainer .borderMain").addClass("fullOwn");$("#movieContainer .borderMain .billboardProduct").css("background-image","url(http://a.dolimg.com/en-US/3257w/media/movieTiles/tile"+this.video.mpmProductId+"_756x420.jpg)");Page.current.enableBonusVideos()}var b=function(d){$("#dmoHeader").css("background-image","url(http://a.dolimg.com/en-US/3257w/media/movieHeaders/header"+d+".jpg)");$("#productbg").css("background","url(http://a.dolimg.com/en-US/3257w/media/movieBackgrounds/bg"+d+".jpg)  no-repeat center 0 #FFF");$("#productPromo").css("background",
"url(http://a.dolimg.com/en-US/3257w/media/movieLB/lb"+d+".jpg)")},c=new Image;c.onload=function(){b(a.video.mpmProductId)};c.onerror=function(){b("GENERIC")};c.src="http://a.dolimg.com/en-US/3257w/media/movieLB/lb"+a.video.mpmProductId+".jpg"}},unskin:function(){$("#bonusFeaturesTabContent .bonusFeaturesAvailableForPurchaseOverlay").removeClass("fullOwn");$("#bonusFeaturesTabContent .bonusFeaturesAvailableForPurchaseVault").removeClass("fullOwn");$("#dmoHeader").css("background-image","url(http://a.dolimg.com/en-US/3257w/img/header_bkgd.png)");$("#productbg").css("background",
"");$("#productPromo").css("background","");$("#movieContainer .borderMain").removeClass("fullOwn");$("#movieContainer .borderMain .billboardProduct").css("background-image","url(http://a.dolimg.com/en-US/3257w/media/movieTiles/tile"+this.video.mpmProductId+"_558x310.jpg)")}};$.extend(ProductPage.prototype,Page.prototype);$.extend(ProductPage.prototype,AbstractProductPage.prototype);function MagicCodePage(){Page.call(this);this.bindMagicCodeForm();this.createTabs();this.movieList=this.searchList}
function AbstractMagicCodePage(){}
AbstractMagicCodePage.prototype={bindMagicCodeForm:function(){$("input.magicCodeEntryField").each(function(){var a=$(this);this.defaultText=a.val();a.unbind("focus");a.focus(function(){a.val().trim()==this.defaultText&&a.val("")});a.blur(function(){a.val().trim()==""&&a.val(this.defaultText)})});$("#magicCodePageEntryForm").unbind("submit");$("#magicCodePageEntryForm").submit(function(){Page.current.disableButtons();var a=window.location.href.toLowerCase();if(a.indexOf("watch-dvds-online#redeem")!=-1){myconsole.log("tracking magicCode_redeem, URL: "+
window.location.href+" from GO Button click in AbstractMagicCode.prototype()");analytics.trackEvent("magicCode_redeem")}else if(a.indexOf("watch-dvds-online")!=-1){myconsole.log("tracking magicCode_enter, URL: "+window.location.href+" from GO Button click in AbstractMagicCode.prototype()");analytics.trackEvent("magicCode_enter")}a=$("#mcField").val();(new CodeRedemption(a)).redeem();Page.current.enableButtons();return false})},createTabs:function(){var a=goog.dom.getElementsByTagNameAndClass("div",
"goog-tab-content",goog.dom.getElement("magicCodeTabContents")),b=new goog.ui.TabBar,c=goog.dom.getElementsByTagNameAndClass("a",null,goog.dom.getElement("magicCodeTabs"));goog.array.forEach(c,function(e){e.onclick=function(){return false}});try{b.decorate(goog.dom.getElement("magicCodeTabs"))}catch(d){myconsole.log(d)}goog.events.listen(b,goog.ui.Component.EventType.SELECT,function(e){e=e.target;var f=e.getId()+"Content";e.addClassName("active");goog.array.forEach(c,function(g){if(g.id+"Content"!=
f)g.className=g.className.replace(/\bactive\b/,"")});goog.dom.getElement(f).style.display="block";goog.array.forEach(a,function(g){if(g.id!=f)g.style.display="none"});return false})},loggedInBehavior:function(){this.checkLocationHash();this.monitorLocationHash();var a=getCookie("dmrCode");if(typeof a!=undefined&&a!=null){clearWorkflowCookies();(new CodeRedemption(a)).redeem()}},pageHandleLocationHash:function(a){for(var b=0;b<a.length;b++)switch(a[b].key){case "redeem":$("#topSection").removeClass("nonRedeem");
$("#topSection").addClass("redeem");break}}};$.extend(MagicCodePage.prototype,Page.prototype);$.extend(MagicCodePage.prototype,AbstractMagicCodePage.prototype);function CodeRedemption(a,b,c){this.code=a;this.thankYouClasses=[];if(typeof b!="undefined")this.chosenMpm=b;this.errorElement=typeof c!="undefined"?c:this.chosenMpm!=null?"#magicCodeLBError":"#magicCodePageError"}
CodeRedemption.prototype={chosenMpm:null,code:null,dmrResponse:null,errorElement:null,redeemedMpm:null,thankYouClasses:null,boxSet:null,titleText:"YOU'VE SUCCESSFULLY REGISTERED YOUR MOVIE!",redeemRequest:function(){ajaxUtils.start();lightboxOverlay.showLoader();var a=this;$.ajax({cache:false,data:{dmrCode:this.code},dataType:"text",error:function(){ajaxUtils.finished();lightboxOverlay.useMedium("An Error Has Occurred","");lightboxOverlay.showOverlay()},success:function(b){function c(g,h){return h.uniqueIdmpmProductId==
a.chosenMpm?1:g.uniqueIdmpmProductId==a.chosenMpm?-1:0}clearWorkflowCookies();b=eval("("+b+")");ajaxUtils.finished();User.syncLocker();User.syncroRetrieve();MovieList.current.updateRights();lightboxOverlay.closeOverlay();if(b.redeemResp.boxSet.length!=undefined&&b.redeemResp.boxSet.length>0){this.boxSet=b.redeemResp.boxSet;for(var d=[1,3,17,18],e=0;e<this.boxSet.length;){var f=$.inArray(this.boxSet[e].dmrResponse.status,d);if(typeof f=="undefined"||f==-1)this.boxSet.splice(e,1);else e++}this.boxSet.sort(c);
d=this.boxSet.splice(0,1);b.redeemResp=d[0];b.redeemResp.boxSet=this.boxSet}a.dmrResponse=b;a.responseHandler(a.dmrResponse)},type:"POST",url:urlBase+"api/dmr/redeem.json"})},loggedOutRedeem:function(){this.code=getCookie("dmrCode");deleteCookie("dmrCode")},populateMovieData:function(){this.boxSet=null;if(this.dmrResponse!=undefined)if(this.dmrResponse.redeemResp.boxSet!=undefined)this.boxSet=this.dmrResponse.redeemResp.boxSet;if(this.chosenMpm!=null){var a=MovieList.current.videosByMpm[this.chosenMpm];
$("#magicCodeThankYou .otherTitle").html(a.title);$("#magicCodeThankYou .enterAnotherCode").unbind("click");$("#magicCodeThankYou .enterAnotherCode").click(function(){Page.current.showMagicCodeLB()});Page.current.video.hasStreamingRights()&&!Page.current.video.isRented()&&Page.current.resetMoviePlayers()}else{$("#magicCodeThankYou .enterAnotherCode").unbind("click");$("#magicCodeThankYou .enterAnotherCode").click(function(){lightboxOverlay.closeOverlay();for(var d=0,e=Page.current.thankYou.thankYouClasses.length;d<
e;d++)$("#magicCodeThankYou").removeClass(Page.current.thankYou.thankYouClasses[d])})}a=$.inArray("notInCatalog",this.thankYouClasses);if(typeof a=="undefined"||a==-1){if(this.redeemedMpm==null){this.redeemedMpm=this.chosenMpm;this.thankYouClasses.push("nonDCopy")}var b=MovieList.current.videosByMpm[this.redeemedMpm];if(b.isRented()){this.thankYouClasses.push("rent");$("#magicCodeThankYou .countdownTimer").each(function(d,e){new CountdownTimer($(e),b.secondsUntilExpire)})}b.populatePrices();$("#magicCodeThankYou img.boxImage").attr({alt:b.title,
title:b.title,src:b.boxShotUrl});$("#magicCodeThankYou .originalPrice").html("$"+b.originalPrice);$("#magicCodeThankYou .upgradePrice").html("$"+b.upgradePrice+"*");$("#magicCodeThankYou .videoTitle").html(b.title);$("#magicCodeThankYou span.runningTime").html(b.runningTime);$("#magicCodeThankYou span.releaseDate").html(b.releaseDate.replace(/(\d\d\d\d)-(\d\d)-(\d\d)/g,"$2/$3/$1"));b.mpaaRating=="Not Rated"?$("#magicCodeThankYou .rating").addClass("ratingNR"):$("#magicCodeThankYou .rating").addClass("rating"+
b.mpaaRating);a=(new Date).toDisplayString();$("#magicCodeThankYou span.dateAdded").html(a);if($.inArray("alreadyOwn",this.thankYouClasses)==-1&&this.boxSet!=null&&this.boxSet.length!=undefined&&this.boxSet.length>0){a=$("<div>").addClass("bestAction").addClass("PLAY").data("url",urlBase+"movies/"+seoCleanText(b.title)+"-"+b.mpmProductId+"/#playMovie=noSync").text("Play Movie").click(function(){analytics.trackLink("dcp_play");window.location=$(this).data("url")}).css("left","0px").css("position",
"static").css("top","0px");$("#magicCodeThankYou  .movieInfo .dCopy div .dateAdded:first").after(a)}if(b.bonusCount>0){if(b.hasPhysicalLicense()&&this.boxSet!=null){$("#magicCodeThankYou .extrasBonus").removeClass("extrasBonus").addClass("extrasBonusNoBG");$("#magicCodeThankYou .bonusClick").removeAttr("href").removeClass("bonusClick");$(".bonusFeatureCounterBackground").after($(".bonusFeatureCounterBackground").children("a:first").css("border","1px solid #939393").css("color","#939393")).remove();
$(".rentbuySubtxt").html(" (Unlimited Access) ")}$("#magicCodeThankYou .bonusItems").html(b.bonusCount);$("#magicCodeThankYou .bonusBUY").show();$("#magicCodeThankYou span.rentbuySubtxt").show()}else{$("#magicCodeThankYou .bonusBUY").hide();$("#magicCodeThankYou span.rentbuySubtxt").hide()}$("#magicCodeThankYou .purchaseLink").unbind("click");$("#magicCodeThankYou .purchaseLink").click(function(){if(User.current!=null&&User.current.internationalUser){lightboxOverlay.useSlightlyNarrow("LOCATION NOT SUPPORTED",
"blockedLocation");$("#closeSlightlyNarrowDialog").click(function(){lightboxOverlay.closeOverlay()});$("#blockedLocationThankYouOk").unbind("click");$("#blockedLocationThankYouOk").click(function(){lightboxOverlay.closeOverlay()});lightboxOverlay.showOverlay();return false}var d=$(this).attr("id").replace("purchaseLink","").toLowerCase();Page.current.video=b;Page.current.video.purchaseType=d;analytics.trackEvent(d+"_attempt");b.purchase(d,false)});$("#magicCodeThankYou a.bonusClick").unbind("click");
$("#magicCodeThankYou a.bonusClick").click(function(){window.location=urlBase+"movies/"+seoCleanText(b.title)+"-"+b.mpmProductId+"/#bonus"});$("#magicCodeThankYou a.freeExtrasClick").unbind("click");$("#magicCodeThankYou a.freeExtrasClick").click(function(){window.location=urlBase+"movies/"+seoCleanText(b.title)+"-"+b.mpmProductId+"/#freeExtras"});$("#magicCodeThankYou div.PLAY").unbind("click");$("#magicCodeThankYou div.PLAY").click(function(){analytics.trackLink("dcp_play");window.location=urlBase+
"movies/"+seoCleanText(b.title)+"-"+b.mpmProductId+"/#playMovie=noSync"});if(this.redeemedMpm==this.chosenMpm){try{Page.current.showPurchaseUpgradeLinks("upgrade")}catch(c){myconsole.log(c)}$("#purchaseLink .upgradePrice").show().html("&nbsp;&nbsp;$"+b.upgradePrice+"*")}this.setupBoxSet()}},setupBoxSet:function(){if(this.boxSet!=undefined)if(this.boxSet.length!=undefined&&this.boxSet.length>0){this.titleText=window.location.href.toLowerCase().indexOf("cmp=d2c_afc_dmr")!==-1?"CHOOSE AN OPTION FOR YOUR BOX SET":
"YOU'VE SUCCESSFULLY REGISTERED A BOX SET";boxSetElements=[];var a=[1,3,17,18],b="";if($.inArray("dCopy",this.thankYouClasses)!=-1)b="dCopy";else if($.inArray("nonDCopy",this.thankYouClasses)!=-1)b="nonDCopy";else if($.inArray("alreadyOwn",this.thankYouClasses)!=-1)b="alreadyOwn";else if($.inArray("notInCatalog",this.thankYouClasses)!=-1)b="notInCatalog";else if($.inArray("addToLockerFailed",this.thankYouClasses)!=-1)b="addToLockerFailed";for(var c=0;c<this.boxSet.length;c++){var d=$.inArray(this.boxSet[c].dmrResponse.status,
a);if(MovieList.current.videosByMpm[this.boxSet[c].uniqueIdmpmProductId]!=undefined)if(!(typeof d=="undefined"||d==-1)){var e=MovieList.current.videosByMpm[this.boxSet[c].uniqueIdmpmProductId];d=e.hasPhysicalLicense();var f=$("<div>").addClass(b),g=$("<div>").addClass("boxShot").addClass("boxShotContents");f.append(g);var h=$("<div>").addClass("boxCap"),k=$("<a>").addClass("boxLink").attr("href",urlBase+"movies/"+seoCleanText(e.title)+"-"+e.mpmProductId+"/#playMovie=noSync"),l=$("<div>").addClass("upgradePrice").html("$"+
e.upgradePrice+"*"),m=$("<span>").addClass("button").addClass("boxOverlay"),n=$("<img>").addClass("boxImage").attr({alt:e.title,title:e.title,src:e.boxShotUrl}),o=$("<span>").addClass("videoTitle").html(e.title);k.append(l).append(m).append(n).append(o);g.append(h).append(k);h=$("<a>").addClass("playLink").attr("href",urlBase+"movies/"+seoCleanText(e.title)+"-"+e.mpmProductId+"/#playMovie=noSync");g.append(h);g=$("<div>").addClass("countdownTimer").addClass("rent");h=$("<span>").text("RENTAL TIME REMAINING");
k=$("<span>").addClass("expireDate").addClass("rentalTimer").hide();l=$("<span>").addClass("hours").addClass("rentalTimer").text("0");m=$("<span>").addClass("hoursLabel").addClass("rentalTimer").text("h");n=$("<span>").addClass("minutes").addClass("rentalTimer").text("");o=$("<span>").addClass("minutesLabel").addClass("rentalTimer").text("m");g.append(h).append(k).append(l).append(m).append(n).append(o);g=$("<div>").addClass("movieDetails");h=$("<h3>").addClass("title");k=$("<span>").addClass("videoTitle").html(e.title);
h.append(k);k=$("<div>").addClass("mpaaRating G");var q=$("<div>").addClass("releaseDate").text("Release Date: ");l=$("<span>").addClass("releaseDate");q.append(l.html(e.releaseDate.replace(/(\d\d\d\d)-(\d\d)-(\d\d)/g,"$2/$3/$1")));var p=$("<div>").addClass("runningTime").text("Running Time: ");l=$("<span>").addClass("runningTime").html(e.runningTime+"&nbsp;Minutes");p.append(l);l=$("<li>").addClass("bonusBUY");m=$("<div>").addClass("bonusFeatureCounterBackground");if(d){var s=$("<ul>").addClass("extrasBonusNoBG");
n=$("<a>").addClass("bonusLink").css("border","1px solid #939393").css("color","#939393").text("BONUS (");l.append(n)}else{s=$("<ul>").addClass("extrasBonus");n=$("<a>").addClass("bonusClick").addClass("bonusLink").attr("href","javascript:void(0);").text("BONUS (");l.append(m.append(n))}m=$("<span>").addClass("bonusItems");n.append(m);s.append(l);var r=$("<div>").addClass("dateAdded").addClass("PURCHASED");o=(new Date).toDisplayString();n=$("<div>").addClass("icon");o=$("<div>").addClass("dateAddedHeading").text("Added To Library On: "+
o);var w=$("<span>").addClass("dateAdded");o.append(w);r.append(n).append(o);g.append(h);d||g.append(k);g.append(q).append(p).append(r);f.append(g);boxSetElements.push(f);if(d)var x=$("<ul><li> <span> Watch Instantly </span> </li> <li> <span> Unlimited Access </span> </li> <li> <span> No Download </span> </li> </ul>").addClass("bottomListText");$("#magicCodeThankYou .movieInfo > div."+b+":last").after(f).after('<br clear="all"  />');f.append(x);p.after(s);if(e.bonusCount>0){m.append(e.bonusCount+
")");l.show()}else l.hide();f=function(){p.remove();q.remove();var t=$("<div>").addClass("purchaseDividers"),y=$("<h2>").addClass("nonDCopy").css("display","block").html('Buy &nbsp;<span class="rentbuySubtxt"> (Unlimited Access)</span>'),u=$("<ul>").addClass("iconmenu").addClass("nonDCopy").css("display","block"),v=$("<li>").attr("id","purchaseLinkBuy").addClass("buy purchaseLink").html('<span class="originalPrice">$'+e.originalPrice+'</span><span class="upgradePrice">$'+e.upgradePrice+'*</span><div class="slash"></div>');
u.append(v);v.data("url",urlBase+"movies/"+seoCleanText(e.title)+"-"+e.mpmProductId+"/#upgradeMovie=noSync");v.click(function(){window.location=$(this).data("url")});s.after(u).after(y).after(t);t=$("<p>").text("*You've registered a DVD or Blue-ray of this movie and earned a 60% discount off the purchase of the Online Copy.");t.css("font-size","11px").css("font-family:",'"Myriad Pro",Arial,Verdana,sans-serif;').css("font-weight","bold").css("clear","left");u.after(t);r.remove()};if(d)f();else switch(this.boxSet[c].dmrResponse.status){case 1:f();
break;case 3:f=$("<div>").addClass("bestAction").addClass("PLAY").data("url",urlBase+"movies/"+seoCleanText(e.title)+"-"+e.mpmProductId+"/#playMovie=noSync").text("Play Movie").click(function(){analytics.trackLink("dcp_play");window.location=$(this).data("url")}).css("left","0px").css("position","static").css("top","0px");r.after(f);break;case 17:break;case 18:d=$("<div>").addClass("alreadyInLibrary");f=$("<div>").addClass("check").addClass("alreadyInLibrary").html("<p>This movie is already in your streaming library.<p>");
d.append(f);f=$("<div>").addClass("bestAction").addClass("PLAY").data("url",urlBase+"movies/"+seoCleanText(e.title)+"-"+e.mpmProductId+"/#playMovie=noSync").text("Play Movie").click(function(){analytics.trackLink("dcp_play");window.location=$(this).data("url")});r.after(f);r.after(d);break}}}$("#callToActionBox ."+b).attr("style","display:none !important");$("#callToActionBox .nonDCopy").attr("style","display: block !important");$("#magicCodeThankYou .enterAnotherCode").click(this.closeCallBack)}this.boxSet=
null},closeCallBack:function(){if(boxSetElements!=undefined&&boxSetElements instanceof Array)for(var a=0;a<boxSetElements.length;a++)boxSetElements[a].remove();$('#magicCodeThankYou .movieInfo br[clear="all"]').remove();$("#magicCodeThankYou  .movieInfo .dCopy .bestAction").remove();a=$("#callToActionBox .alreadyOwn");a.attr("style","");a=$("#callToActionBox .dCopy");a.attr("style","");a=$("#callToActionBox .nonDCopy");a.attr("style","");a=$("#callToActionBox .notInCatalog");a.attr("style","")},populateRewardsInfo:function(){if(this.dmrResponse!=
null){var a=this.dmrResponse.redeemResp.codeRewardList,b=this.dmrResponse.redeemResp.codeValue,c=a.length;$(".rewards ul li.nonPoints").remove();if(c>0||b>0)this.thankYouClasses.push("rewards");if(b>0){$(".rewards ul li.points .pointsValue").html(b);$(".rewards ul li.points").show()}else $(".rewards ul li.points").hide();if(c>0)for(b=0;b<c;b++)$(".rewards #rewardsList").append('<li class="nonPoints">'+a[b]+"</li>")}},lightboxRedeem:function(){if(this.validateInput())if(isLoggedIn)this.redeemRequest();
else{setCookie("dmrCode",this.code);window.location=getLoginUrl()}},redeem:function(){if(this.validateInput())if(isLoggedIn)this.redeemRequest();else{setCookie("dmrCode",this.code);window.location=getLoginUrl()}},redeemError:function(a){a=typeof a!="undefined"&&a!=false?"Please enter a code.":this.dmrResponse==null?"There was an error processing your request.  Please try again.":this.dmrResponse.redeemResp.statusMessage;this.errorElement=="#magicCodeLBError"?$(this.errorElement).html(a):$(this.errorElement).find(".errorMsg").html(a);
lightboxOverlay.closeOverlay();this.errorElement=="#magicCodeLBError"&&Page.current.showMagicCodeLB(true);$(this.errorElement).show()},bindResendErrorLink:function(){$("#resendEmailLink").bind("click",function(){ajaxUtils.start();varresendEmailRequest=$.ajax({async:false,cache:false,error:function(){ajaxUtils.finished();lightboxOverlay.useGeneric(null,"communicationError");lightboxOverlay.showOverlay()},success:function(){ajaxUtils.finished();lightboxOverlay.useSlightlyNarrow("THANK YOU","resendEmailThankYou");
lightboxOverlay.showOverlay();$("#resendEmailThankYouOk").bind("click",function(){lightboxOverlay.closeOverlay();window.location.reload()})},type:"POST",url:urlBase+"api/beacon/parentApproval.json"});return false})},redeemSuccess:function(){this.populateMovieData();this.populateRewardsInfo();this.showThankYou()},responseHandler:function(a){var b=function(e){if(e)analytics.trackEvent("redeem_notInCatalog");else switch(a.redeemResp.dmrResponse.status){case 1:analytics.trackEvent("redeem_nonStream");
break;case 3:analytics.trackEvent("redeem_streaming");break;case 17:analytics.trackEvent("redeem_notInCatalog");break;case 18:analytics.trackEvent("redeem_alreadyOwned");break;case 16:analytics.trackEvent("redeem_dmrOnly");break;case 5:analytics.trackEvent("redeem_alreadyOwned");break;default:break}};this.redeemedMpm=a.redeemResp.uniqueIdmpmProductId;this.chosenMpm!=null&&this.chosenMpm!=this.redeemedMpm&&this.thankYouClasses.push("other");var c=$.inArray(a.redeemResp.dmrResponse.status,[1,3,17,18]);
if(typeof c=="undefined"||c==-1){this.redeemError();switch(a.redeemResp.dmrResponse.status){case 0:case 2:case 4:case 5:case 6:case 7:case 15:case 14:case 13:case 12:case 10:this.bindResendErrorLink();break;case 16:break;default:myconsole.error("Could not recognize dmrResonse Status: "+a.redeemResp.dmrResponse.status)}b(false,a.redeemResp.dmrResponse.status)}else{c=false;var d=null;if(typeof MovieList.current.videosByMpm[a.redeemResp.uniqueIdmpmProductId]=="undefined")c=true;else d=MovieList.current.videosByMpm[a.redeemResp.uniqueIdmpmProductId];
if(a.redeemResp.addToLockerFailed==true)this.thankYouClasses.push("addToLockerFailed");else if(c)this.thankYouClasses.push("notInCatalog");else if(d.hasPhysicalLicense())this.thankYouClasses.push("nonDCopy");else switch(a.redeemResp.dmrResponse.status){case 1:this.thankYouClasses.push("nonDCopy");break;case 3:this.thankYouClasses.push("dCopy");break;case 17:this.thankYouClasses.push("notInCatalog");break;case 18:this.thankYouClasses.push("alreadyOwn");break;default:myconsole.error("Invalid dmrResonse Status. Expecting 1, 3, 17 or 18")}b(c,
a.redeemResp.dmrResponse.status);this.redeemSuccess()}},setCode:function(a){this.code=a},showThankYou:function(){Page.current.thankYou=this;$("#magicCodeThankYou").removeClass();$("#magicCodeThankYou").addClass("globalLightbox");for(var a=0,b=this.thankYouClasses.length;a<b;a++)$("#magicCodeThankYou").addClass(this.thankYouClasses[a]);lightboxOverlay.useWide(this.titleText,"magicCodeThankYou",this.closeCallBack);lightboxOverlay.showOverlay();if(typeof this.closeCallback=="undefined"&&typeof Page.current.video!=
"undefined"&&typeof Page.current.video!=undefined&&typeof Page.current.video.isVaulted!="undefined"&&typeof Page.current.video.isVaulted!=undefined&&Page.current.video.isVaulted!=null&&Page.current.video.isVaulted||this.dmrResponse!=null&&this.dmrResponse.redeemResp!=null&&this.dmrResponse.redeemResp.boxSet!=null&&window.location.href.toLowerCase().indexOf("cmp=d2c_afc_dmr")==-1){$("#closeWideDialog").unbind("click");$("#closeWideDialog").click(function(){window.location.reload();$("#closeWideDialog").unbind("click")})}else{$("#closeWideDialog").unbind("click");
$("#closeWideDialog").click(function(){lightboxOverlay.closeOverlay()})}},validateInput:function(){$(this.errorElement).hide();if(this.code==""){this.redeemError(true);return false}return true}};function RedeemResponseHandler(){}RedeemResponseHandler.prototype={};
function showShareYourIdeasLB(){Page.current.enableButtons();$("#showGenericError").hide();$("#feedbackAcceptTCLabel").removeAttr("style");$("#problemEmailAddressLabel").removeAttr("style");$("#problemCommentCharsLeft").removeAttr("style");$('select#problemReportCategory option[value="I have a question"]').attr("selected");$("#problemCategory0").addClass("active");$('select#problemReportCategory option[value="I like..."]').removeAttr("selected");$("#problemCategory1").removeClass("active");$('select#problemReportCategory option[value="I dislike..."]').removeAttr("selected");
$("#problemCategory2").removeClass("active");$('select#problemReportCategory option[value="Id like to share an idea"]').removeAttr("selected");$("#problemCategory3").removeClass("active");$("#d2c_terms_of_use").removeAttr("style");$("#problemCommentCharsLeft").html(800);lightboxOverlay.useWide("SHARE YOUR IDEAS","feedbackBodyWrap");var a=$("body").eq(0).attr("id");$("#wideDialogRoundedBottom").addClass("feedBackBottom");if(a=="product")a="product_"+$("#movieTitle").html();analytics.trackLink(a+"/shareYourIdeas",
a);User.current.underageUser?$("#problem #problemNameLabel").html("First Name: (optional)"):$("#problem #problemNameLabel").html("Name: (optional)");$("input[name=acceptTC]").attr("checked",false);$("#acceptTCErrorDiv").hide();lightboxOverlay.showOverlay();$("#problemCancel").val("CANCEL");$("#problemCancel").unbind("click");$("#problemCancel").click(function(){$("#feedbackAcceptTCLabel").removeAttr("style");$("#problemEmailAddressLabel").removeAttr("style");$("#d2c_terms_of_use").removeAttr("style");
$("#closeWideDialog").click()});$("#problemSubmit").val("SUBMIT");$("#problemSubmit").unbind("click");$("#problemSubmit").click(function(){if(!document.getElementById("feedbackAcceptTC").checked){$("#feedbackAcceptTCLabel").attr("style","color:#DD0915");return false}Page.current.disableButtons();setSecureCookie("category",document.getElementById("problemCategory").value);setSecureCookie("name",document.getElementById("problemName").value);setSecureCookie("emailAddress",document.getElementById("problemEmailAddress").value);
setSecureCookie("cmnt",document.getElementById("problemComment").value);setSecureCookie("acceptTC",document.getElementById("feedbackAcceptTC").checked);lightboxOverlay.showLoader();var c=document.createElement("script");c.src=urlSecureBase+"api/submit-feedback";document.body.appendChild(c);validateForm($("#problemForm"))||Page.current.enableButtons();return false});$("#problemComment").bind("keyup",function(){var c=VALIDATION_CONSTANTS.validFeedbackComment.maxLength;if(this.value.length>c){this.value=
this.value.substring(0,c);this.scrollTop=this.scrollHeight}else{this.value.length>=775?$("#problemCommentCharsLeft").attr("style","color:#DD0915"):$("#problemCommentCharsLeft").removeAttr("style");$("#problemCommentCharsLeft").html(c-this.value.length)}});var b=$("#problemCategoryButtons .button");b.unbind("click");b.click(function(){var c={};c.problemCategory0="I have a question";c.problemCategory1="I like...";c.problemCategory2="I dislike...";c.problemCategory3="Id like to share an idea";if(this.id in
c){$("#problemCategory").val(c[this.id]).attr("selected","selected");b.removeClass("active");$(this).addClass("active")}});return false}
function User(a){User.current=this;if(a==null)Page.current!=null&&Page.current.notLoggedInBehavior(this);else{for(var b in a.user)this[b]=a.user[b];if(this.partiallyRegistered||this.dmrPartiallyRegistered)Page.current!=null&&Page.current.notLoggedInBehavior(this);else{this.loggedIn=true;Page.current!=null&&Page.current.loggedInBehavior(this);for(User.current.underageUser==true&&$("#gde_footerLegalContainer").find("a[href=http://disneymoviesonline.go.com/privacy-policy]").attr("href","http://disneymoviesonline.go.com/kids-privacy-policy");User.loggedInQueue.length>
0;){a=User.loggedInQueue.shift();a()}var c=setInterval(keepSessionAlive,216E5);setTimeout(function(){clearInterval(c)},864E5)}}for(;User.retrievedQueue.length>0;){a=User.retrievedQueue.shift();a()}}
User.prototype={loggedIn:false,ownedMovies:null,rentedMovies:null,redeemedMovies:null,dmrPartialRegAgree:function(){ajaxUtils.start();$.ajax({async:false,cache:false,data:{acceptTC:"true"},dataType:"html",error:function(){ajaxUtils.finished();lightboxOverlay.useGeneric(null,"communicationError");lightboxOverlay.showOverlay()},success:function(){analytics.trackEvent("vppa_success");ajaxUtils.finished();User.syncLocker();User.syncroRetrieve();if(document.body.id=="loginPage"){purchaseFlow=false;$(Page.current.getLocationHashArray()).each(function(a,
b){if(b.key=="buyMovie"||b.key=="rentMovie")purchaseFlow=true});if(purchaseFlow)window.location=decodeURIComponent(Page.current.redirectUrl)+"#"+getCookie("purchaseType")+"Movie";else if(getCookie("dmrCode")||getCookie("upgradeRedeemCode"))window.location=decodeURIComponent(Page.current.redirectUrl);else if(User.current.underageUser){congratsUrl=urlBase.replace(/https/,"http")+"congratulations";if(typeof Page.current.redirectUrl!=undefined&&Page.current.redirectUrl!=null)congratsUrl+="?d2cAppRedirect="+
Page.current.redirectUrl;window.location=congratsUrl}else window.location=decodeURIComponent(Page.current.redirectUrl)}},type:"POST",url:urlBase+"api/dmrPartialReg.json"});return false},hasVideoRights:function(){return typeof this.locker.videos[0]!="undefined"&&this.locker.videos[0]!=null&&this.locker.videos.length>0},populateFilterLists:function(){this.populateOwnedMovies();this.populateRentedMovies();this.populateRedeemedMovies()},populateOwnedMovies:function(){this.ownedMovies=$.grep(this.locker.videos,
function(a){var b=false;$.each(a.availableActions,function(c,d){b=b||d[0]=="PLAY"});if(a.expiredDate==null&&b)return b})},populateRentedMovies:function(){this.rentedMovies=$.grep(this.locker.videos,function(a){return a.expireDate!=null?new Date<new Date(a.expireDate):false})},populateRedeemedMovies:function(){this.redeemedMovies=$.grep(this.locker.videos,function(a){var b=false;$.each(a.availableActions,function(c,d){b=b||d[0]=="UPGRADE"});return b})},updateMovieList:function(){for(var a=this.locker.videos,
b=0,c=a.length;b<c;b++){var d=a[b];MovieList.current.videosByMpm[d.mpmProductId]=d}}};User.current={loggedIn:false};User.clearCCInfo=function(){var a=this;$.ajax({cache:false,data:null,dataType:"text",error:function(){ajaxUtils.finished();lightboxOverlay.useGeneric(null,"communicationError");lightboxOverlay.showOverlay()},success:function(b){b=eval("("+b+")");ajaxUtils.finished();a.handleClearCCResponse(b)},type:"POST",url:urlBase+"api/user/pin.json"})};
User.handleClearCCResponse=function(){purchaseType=getCookie("purchaseType");if(typeof purchaseType==undefined&&null==purchaseType||"buy"==purchaseType)purchaseType="purchase";location.href="/"+purchaseType+"?product="+getCookie("extendProductId")+"&cancelUrl="+urlBase+"movies/"+seoCleanText(Page.current.video.title)+"-"+Page.current.video.mpmProductId+"/&successUrl="+urlBase+"movies/"+seoCleanText(Page.current.video.title)+"-"+Page.current.video.mpmProductId+"/#"};User.loggedInQueue=[];
User.retrievedQueue=[];User.onLoggedIn=function(a){isLoggedIn&&User.current.loggedIn?a():User.loggedInQueue.push(a)};User.onRetrieved=function(a){isLoggedIn?a():User.retrievedQueue.push(a)};
User.loginFailure=function(a,b){ajaxUtils.finished();lightboxOverlay.closeOverlay();lightboxOverlay.useGeneric(null,"loginFormContainer",function(){analytics.trackLink("close_login_error");return false});lightboxOverlay.showOverlay();Page.bindLoginForms();b!=null&&populateFormErrors("loginForm",b);if(a!=null){for(var c="",d=0;d<a.length;d++)c+=a[d];d=$("#loginFormContainer #goregerror");$("span",d).html(c);d.show()}analytics.trackLink("login_error")};
User.loginSuccess=function(){ajaxUtils.finished();lightboxOverlay.closeOverlay();if(document.body.id!="homePage"&&document.body.id!="")window.location="/home";User.retrieve()};User.partialRegFailure=function(a,b,c){Page.current.enableButtons();var d=$("#partialRegGoRegError");d.hide();ajaxUtils.finished();if(b==null&&c==null)Page.current.partialReg(a);else{c!=null&&populateFormErrors("partialRegistrationForm",c);if(b!=null){a="";for(c=0;c<b.length;c++)a+=b[c];$("span",d).html(a);d.show()}}};
User.partialRegSuccess=function(){Page.current.enableButtons();analytics.trackEvent("partialReg_success");ajaxUtils.finished();User.syncLocker();User.retrieve();if(document.body.id=="loginPage"){purchaseFlow=false;$(Page.current.getLocationHashArray()).each(function(a,b){if(b.key=="buyMovie"||b.key=="rentMovie")purchaseFlow=true});if(purchaseFlow)window.location=decodeURIComponent(Page.current.redirectUrl)+"#"+getCookie("purchaseType")+"Movie";else if(getCookie("dmrCode")||getCookie("upgradeRedeemCode"))window.location=
decodeURIComponent(Page.current.redirectUrl);else if(User.current.underageUser){congratsUrl=urlBase.replace(/https/,"http")+"congratulations";if(typeof Page.current.redirectUrl!=undefined&&Page.current.redirectUrl!=null)congratsUrl+="?d2cAppRedirect="+Page.current.redirectUrl;window.location=congratsUrl}else window.location=decodeURIComponent(Page.current.redirectUrl)}};
User.retrieve=function(){if(document.URL.indexOf("invalid-terms")>-1)new User(null);else{var a=urlBase+"api/";switch(document.body.id){case "homePage":var b="";$("#featuredMoviesTabContent li").each(function(){b+=$(this).attr("data-title")+","});a+="home/user.json?titles="+b;break;case "catalog":a+="catalog/user.json";break;case "searchResultsPage":a+="search/user.json";break;case "myVideos":a+="user/state.json";break;default:a+="user.json";break}ajaxUtils.start();$.ajax({cache:false,async:false,
dataType:"text",error:function(){ajaxUtils.finished();new User(null)},success:function(c){c=eval("("+c+")");ajaxUtils.finished();if(c==null)new User(null);else new User(c)},url:a})}};User.refreshLocker=function(a){ajaxUtils.start();$.ajax({async:false,type:"GET",cache:false,data:a,url:urlBase+"api/locker/refresh"});ajaxUtils.finished()};
User.syncLocker=function(){lightboxOverlay.closeOverlay();ajaxUtils.start();lightboxOverlay.useSlightlyNarrow("SYNCING YOUR ACCOUNTS","syncLockerProgress");lightboxOverlay.showOverlay();$(".closeDialog").css("display","none");$.ajax({async:false,type:"GET",url:urlBase+"api/user/locker/sync"});$(".closeDialog").css("display","block");lightboxOverlay.closeOverlay();ajaxUtils.finished()};
User.syncroRetrieve=function(a){if(document.URL.indexOf("invalid-terms")>-1)new User(null);else{apiUrl=urlBase+"api/user.json";if(typeof a!=undefined&&a!=null)apiUrl+="?"+a;ajaxUtils.start();$.ajax({async:false,cache:false,dataType:"text",error:function(){ajaxUtils.finished();new User(null)},success:function(b){b=eval("("+b+")");ajaxUtils.finished();if(b==null)new User(null);else new User(b)},url:apiUrl})}};
function Billboard(a,b){this.frameElementName=a;this.tileContainerElementName=b;this.loadTiles();this.attachHandlers()}
Billboard.prototype={autoRotating:null,buttonIdPrefix:"displayTile",nextButton:"displayNext",prevButton:"displayPrev",controlSectionId:"billboardPaginator",currentTile:1,frameElementName:null,firstVisit:true,maxTile:5,minTile:1,moviePlayerClass:"billboardMoviePlayer",startTile:1,selectedButtonClass:"active",tileContainerElementName:null,tileElementName:"tile",timer:null,attachHandlers:function(){var a=this;$("#"+this.frameElementName).unbind("click");$("#"+this.frameElementName).click(function(){a.stopAutoRotate()});
$("#"+this.nextButton).unbind("click");$("#"+this.nextButton).click(function(){a.showNextTile()});$("#"+this.prevButton).unbind("click");$("#"+this.prevButton).click(function(){a.showPrevTile()});for(var b=1,c=this.maxTile;b<=c;b++){var d=$("#"+this.buttonIdPrefix+b);d.unbind("click");d.click(function(e){return function(){a.displayTile(e)}}(b))}},autoRotate:function(){this.showNextTile();this.timer=setTimeout("Page.current.billboard.autoRotate()",5E3)},displayBillboardControls:function(){var a=$("#"+
this.controlSectionId);$(a).fadeIn(500)},displayTile:function(a){var b=$("#"+this.tileElementName+this.currentTile),c=$("#"+this.tileElementName+a),d=this.buttonIdPrefix+a;$("#"+(this.buttonIdPrefix+this.currentTile)).removeClass(this.selectedButtonClass);$("#"+d).addClass(this.selectedButtonClass);if(a!=this.currentTile){b.fadeOut(1E3);c.fadeIn(1E3);try{eval("Page.current.players.billboardPlayer"+this.currentTile+".pauseMovie()")}catch(e){}}else b.fadeIn(1E3);this.currentTile=a},showNextTile:function(){this.displayTile(this.currentTile<
this.maxTile?this.currentTile+1:this.minTile)},showPrevTile:function(){this.displayTile(this.currentTile>this.minTile?this.currentTile-1:this.maxTile)},loadTiles:function(){var a=this;$.ajax({async:false,cache:true,dataType:"text",error:function(){ajaxUtils.finished();lightboxOverlay.useGeneric(null,"communicationError");lightboxOverlay.showOverlay()},success:function(b){$("#"+a.tileContainerElementName).append(b);Page.current.players={};for(b=1;b<=5;b++){var c="#billboardPlayerButton"+b,d=$(c).parent();
$(".sizzleTile, "+c,d).unbind("click");$(".sizzleTile, "+c,d).click(function(e){return function(){var f=new MoviePlayer("billboardPlayer"+e,moviePlayerPath);f.showPlayerCompleteHash=false;f.finishCallback=function(g){$("#"+g.playerID).addClass("zhidden");if(Page.current.billboard.firstVisit){Page.current.billboard.firstVisit=false;Page.current.billboard.displayBillboardControls();Page.current.billboard.startAutoRotate()}g.unloadPlayer()};myconsole.log("#tileVideo"+e);myconsole.log($("#tileVideo"+
e).val());f.play("billboardMovie "+e,$("#tileVideo"+e).val())}}(b))}},type:"GET",url:urlBase+"billboards"})},playSizzleTileVideo:function(){this.playTileVideo(this.startTile)},playTileVideo:function(a){this.currentTile!=a&&this.displayTile(a);$("#billboardPlayerButton"+a).click()},startAutoRotate:function(){autoRotating=true;this.timer=setTimeout("Page.current.billboard.autoRotate()",5E3)},stopAutoRotate:function(){clearTimeout(this.timer);autoRotating=false}};
function AbstractMovieList(a){this._displayElement=a;AbstractMovieList.current=this}
AbstractMovieList.prototype={addVideo:function(){},getVideos:function(){},updateRights:function(){},getElements:function(){return this._getElements(this.getVideos())},_getElements:function(a){for(var b=[],c=0;c<a.length;c++)b.push(a[c].getElement());return b},getNumElements:function(){return this.getVideos().length},updateDisplay:function(){var a=AbstractMovieList.current.getElements();this._displayElement.empty();this._displayElement.append(a);$("#myVideosList .sliderMask").each(function(){var b=
$("ul li",this).length;if(b==1)$("#"+this.id+"slider").remove();else{new Scrollbar(this.id,this.id+"slider",110,b);$(".mmlBonusExtraList",this).css("width",113*b)}})}};function MovieList(a){AbstractMovieList.call(this,a);MovieList.current=this;this.videos=[];this.videosByMpm=[]}goog.inherits(MovieList,AbstractMovieList);MovieList.prototype.addVideo=function(a){this.videos.push(a);this.videosByMpm[a.mpmProductId]=a};MovieList.prototype.getVideos=function(){return this.videos.slice()};
MovieList.prototype.getElements=function(){return this._getElements(this.videos)};MovieList.prototype.getNumElements=function(){return this.videos.length};MovieList.prototype.updateRights=function(){for(var a=User.current.locker.videos,b=0;b<a.length;b++){var c=a[b],d=c.mpmProductId,e=this.videosByMpm[d];if(document.body.id=="catalog"&&document.getElementById("video"+d)!=null)e.element=document.getElementById("video"+d);typeof e!="undefined"&&e!=null&&e.updateRights(c)}};
MovieList.prototype.userLoggedIn=function(){if(typeof User.current.locker!="undefined"&&User.current.locker!=null)if(User.current.hasVideoRights())this.updateRights();else User.current.locker.videos=[];else{User.current.locker={};User.current.locker.videos=[]}};
function MovieListSorter(a,b){AbstractMovieList.call(this,a._displayElement);MovieListSorter.current=this;this._movieList=a;this._controlElements=b;this._cacheIsDirty=true;this._sortedVideos=[];this._sortFunction=this._sortAlphaAscending;this._bindLinks()}goog.inherits(MovieListSorter,AbstractMovieList);MovieListSorter.prototype.addVideo=function(a){this._cacheIsDirty=true;return this._movieList.addVideo(a)};MovieListSorter.prototype.getVideos=function(){this._rebuildCache();return this._sortedVideos.slice()};
MovieListSorter.prototype.updateRights=function(){return this._movieList.updateRights()};MovieListSorter.prototype._rebuildCache=function(){if(this._cacheIsDirty){this._sortedVideos=this._movieList.getVideos();this._sortedVideos.sort(this._sortFunction);this._cacheIsDirty=false}};MovieListSorter.prototype._bindLinks=function(){var a=this;this._controlElements.unbind("click");this._controlElements.click(function(){a._handleClick(this);return false})};
MovieListSorter.prototype._handleClick=function(a){a.blur();if($(a).hasClass("inactive"))return false;if(a.className.indexOf("alphaSortLink")>-1)this.sortAlpha();else if(a.className.indexOf("releaseSortLink")>-1)this.sortReleaseDate();else a.className.indexOf("dateAddedSortLink")>-1&&this.sortDateAdded();return false};
MovieListSorter.prototype.sortAlpha=function(){this._controlElements.removeClass("active");this._controlElements.removeClass("ascending");this._controlElements.removeClass("descending");this._controlElements.filter(".releaseSortLink").addClass("ascending");this._controlElements.filter(".dateAddedSortLink").addClass("ascending");var a=this._controlElements.filter(".alphaSortLink");a.addClass("active");if(this._sortFunction==this._sortAlphaAscending){this._sortFunction=this._sortAlphaDescending;analytics.trackLink("sort_alpha_desc");
a.addClass("descending")}else{this._sortFunction=this._sortAlphaAscending;analytics.trackLink("sort_alpha_asc");a.addClass("ascending")}this._cacheIsDirty=true;this._rebuildCache();this.updateDisplay()};
MovieListSorter.prototype.sortReleaseDate=function(){this._controlElements.removeClass("active");this._controlElements.removeClass("ascending");this._controlElements.removeClass("descending");this._controlElements.filter(".alphaSortLink").addClass("ascending");this._controlElements.filter(".dateAddedSortLink").addClass("ascending");var a=this._controlElements.filter(".releaseSortLink");a.addClass("active");if(this._sortFunction==this._sortReleaseAscending){this._sortFunction=this._sortReleaseDescending;
analytics.trackLink("sort_releasedate_desc");a.addClass("descending")}else{this._sortFunction=this._sortReleaseAscending;analytics.trackLink("sort_releasedate_asc");a.addClass("ascending")}this._cacheIsDirty=true;this._rebuildCache();this.updateDisplay()};
MovieListSorter.prototype.sortDateAdded=function(){this._controlElements.removeClass("active");this._controlElements.removeClass("ascending");this._controlElements.removeClass("descending");this._controlElements.filter(".alphaSortLink").addClass("ascending");this._controlElements.filter(".releaseSortLink").addClass("ascending");var a=this._controlElements.filter(".dateAddedSortLink");a.addClass("active");if(this._sortFunction==this._sortDateAddedAscending){this._sortFunction=this._sortDateAddedDescending;
analytics.trackLink("sort_dateadded_desc");a.addClass("descending")}else{this._sortFunction=this._sortDateAddedAscending;analytics.trackLink("sort_dateadded_asc");a.addClass("ascending")}this._cacheIsDirty=true;this._rebuildCache();this.updateDisplay()};MovieListSorter.prototype._skippedWordsForSorting=["a","an","the"];
MovieListSorter.prototype._normalizeTitleForSorting=function(a){a=a.toLowerCase();for(var b in this._skippedWordsForSorting){var c=this._skippedWordsForSorting[b];if(a.length>c.length&&a.substr(0,c.length)==c&&null!=a.substr(c.length,1).match(/[, :]/))a=a.substr(c.length+1)}return a};
MovieListSorter.prototype._sortAlphaAscending=function(a,b){var c=MovieListSorter.current._normalizeTitleForSorting(a.title),d=MovieListSorter.current._normalizeTitleForSorting(b.title);if(c<d)return-1;if(c>d)return 1;return 0};MovieListSorter.prototype._sortAlphaDescending=function(a,b){return MovieListSorter.current._sortAlphaAscending(b,a)};MovieListSorter.prototype._sortReleaseAscending=function(a,b){return a.releaseDate.replace(/-/g,"")-0-(b.releaseDate.replace(/-/g,"")-0)};
MovieListSorter.prototype._sortReleaseDescending=function(a,b){return MovieListSorter.current._sortReleaseAscending(b,a)};MovieListSorter.prototype._sortDateAddedAscending=function(a,b){return a.dateAdded.replace(/-/g,"")-0-(b.dateAdded.replace(/-/g,"")-0)};MovieListSorter.prototype._sortDateAddedDescending=function(a,b){return MovieListSorter.current._sortDateAddedAscending(b,a)};
function MovieListPager(a,b,c){AbstractMovieList.call(this,a._displayElement);MovieListPager.current=this;this._movieList=a;this._elementsPerPage=b;this._controlElements=c;this._currentPage=0;this._viewAll=false;this._bindLinks()}goog.inherits(MovieListPager,AbstractMovieList);MovieListPager.prototype.addVideo=function(a){return this._movieList.addVideo(a)};
MovieListPager.prototype.getVideos=function(){if(this._viewAll)return this._movieList.getVideos();var a=Math.min(this._currentPage*this._elementsPerPage,this._movieList.getNumElements()),b=Math.min(a+this._elementsPerPage,this._movieList.getNumElements());return this._movieList.getVideos().slice(a,b)};MovieListPager.prototype.updateRights=function(){return this._movieList.updateRights()};MovieListPager.prototype._getNumPages=function(){return Math.ceil(this._movieList.getNumElements()/this._elementsPerPage)};
MovieListPager.prototype._bindLinks=function(){var a=this;this._controlElements.click(function(){a._handleClick(this);return false})};
MovieListPager.prototype._handleClick=function(a){a.blur();if($(a).hasClass("inactive"))return false;var b=this._currentPage;if(a.className.indexOf("prevLink")>-1){b--;this._viewAll=false}else if(a.className.indexOf("nextLink")>-1){this._viewAll==false&&b++;this._viewAll=false}else if(a.className.indexOf("viewAll")>-1){b=0;this._viewAll=true}else if(a.className.indexOf("SortLink")>-1)b=0;else{b=a.className.match(/pageLink([0-9][0-9]*)/)[1]-1;this._viewAll=false}this._setPage(b);this.updateDisplay();
return false};
MovieListPager.prototype._setPage=function(a){var b=this._getNumPages();if(a>=b)a=b-1;if(a<0)a=0;if($(".browseControls a.viewAll.active").length!=0)this._viewAll||this._controlElements.filter(".browseControls a.viewAll").removeClass("active");b<=1?$("div.moviePagination, a.viewAll").hide():$("div.moviePagination, a.viewAll").show();var c,d=0;if(a+1>=1&&a+1<=b-1){$(".pageNumbers .moviePageLink").css("display","block").hide();if(a+1<=b-2&&a+1>=3){c=-1;d=3}if(a+1==1){c=0;d=5}if(a+1==2){c=0;d=4}if(a+
1==b-1){c=-2;d=2}if(a+2==b-1&&b<=3){c=0;d=3}for(c=c;c<=d;c++)$(".pageNumbers .pageLink"+(a+c)).show()}this._controlElements.filter("a.number").removeClass("active");this._controlElements.filter("a.pageLink"+(a+1)).addClass("active");this._currentPage=a;this._currentPage==0?this._controlElements.filter("a.prevLink").addClass("inactive"):this._controlElements.filter("a.prevLink").removeClass("inactive");this.currentPage==b-1?this._controlElements.filter("a.nextLink").addClass("inactive"):this._controlElements.filter("a.nextLink").removeClass("inactive");
if(this._viewAll){$(".pageNumbers .pageLink"+(a+1)).removeClass("active");this._controlElements.filter(".browseControls a.viewAll").addClass("active");this._controlElements.filter("a.prevLink").removeClass("inactive")}window.scroll(0,0)};function MovieListFilter(a,b){AbstractMovieList.call(this,a._displayElement);this._movieList=a;this._controlElements=b;this._currentFilter=null;this._bindLinks()}goog.inherits(MovieListFilter,AbstractMovieList);MovieListFilter.prototype.addVideo=function(a){return this._movieList.addVideo(a)};
MovieListFilter.prototype.getVideos=function(){return this._filter(this._movieList.getVideos())};MovieListFilter.prototype.updateRights=function(){return this._movieList.updateRights()};MovieListFilter.prototype._bindLinks=function(){var a=this;this._controlElements.click(function(){a._handleClick(this);return false})};
MovieListFilter.prototype._handleClick=function(a){a.blur();if($(a).hasClass("inactive"))return false;if(a.className.indexOf("all")>-1)this._currentFilter=null;else if(a.className.indexOf("purchased")>-1)this._currentFilter="purchased";else if(a.className.indexOf("rented")>-1)this._currentFilter="rented";else if(a.className.indexOf("redeemed")>-1)this._currentFilter="redeemed";this._controlElements.removeClass("active");$(a).addClass("active");MovieListSorter.current._cacheIsDirty=true;MovieListPager.current._setPage(0);
this.updateDisplay();return false};MovieListFilter.prototype._filter=function(a){if(this._currentFilter==null)return a;var b=[];for(var c in a)a[c].videoSource==this._currentFilter&&b.push(a[c]);return b};function HomePageMovieList(){HomePageMovieList.current=this;MovieList.current=this;this.bindLinks();this.videos=[];this.videosByMpm=[];Video.getAllLeanSync(this,false)}
HomePageMovieList.prototype={alphaSort:[],alphaSortState:null,currentPage:1,movieList:$("#movieList"),myMoviesList:goog.dom.getElement("myMoviesList"),movieListPages:[],myMovies:[],placeholderTemplate:goog.dom.getElement("placeholderTemplate"),paginationLinks:$("div.browseControls a.moviePageLink"),releaseSortState:null,titlesPerPage:20,addVideo:function(a,b){this.videos.push(a);this.videosByMpm[a.mpmProductId]=a;this.alphaSort[b]=a},bindLinks:function(){this.bindPaginationLinks()},bindPaginationLinks:function(){var a=
this;this.paginationLinks.unbind("click");this.paginationLinks.click(function(){a.handlePaginationClick(this);return false})},createFeaturedMovies:function(){var a=goog.dom.getElementsByTagNameAndClass("div","goog-tab-content",goog.dom.getElement("featuredArea")),b=new goog.ui.TabBar;Page.current.tabBar=b;var c=goog.dom.getElementsByTagNameAndClass("a",null,goog.dom.getElement("featuredTabs"));goog.array.forEach(c,function(e){e.onclick=function(){return false}});try{b.decorate(goog.dom.getElement("featuredTabs"))}catch(d){myconsole.log(d)}goog.events.listen(b,
goog.ui.Component.EventType.SELECT,function(e){var f=e.target,g=f.getId()+"Content";f.addClassName("active");goog.array.forEach(c,function(h){if(h.id!=f.getId())h.className=h.className.replace(/\bactive\b/,"")});goog.dom.getElement(g).style.display="block";goog.array.forEach(a,function(h){if(h.id!=g)h.style.display="none"});return false});b=$("#comingSoonList li").length;new Scrollbar("featuredMoviesTabContent","featuredMoviesSlider",194,10);new Scrollbar("myMoviesTabContent","myMoviesSlider",194,
10);new Scrollbar("comingSoonTabContent","comingSoonSlider",194,b);$("#comingSoonList").css("width",b*195+"px");for(b=0;b<9;b++){newNode=this.placeholderTemplate.cloneNode(true);newNode.id=null;this.myMoviesList.appendChild(newNode)}},updateRights:function(){var a=0;this.myMovies=[];for(var b=0;b<User.current.locker.videos.length;b++){var c=User.current.locker.videos[b];mpmProductId=c.mpmProductId;var d=this.videosByMpm[mpmProductId];if(typeof d!="undefined"&&d!=null){a++;if(a<11||a>=11&&$("#video"+
mpmProductId).size()>0)d.createElement();d.updateRights(c,a<11?true:false);this.myMovies.push(d)}}},userLoggedIn:function(){if(typeof User.current.locker!="undefined"&&User.current.locker!=null)if(User.current.hasVideoRights()){Page.current.showTab(1);this.updateRights()}else User.current.locker.videos=[];else{User.current.locker={};User.current.locker.videos=[]}}};
function Scrollbar(a,b,c,d){var e=document.getElementById(a),f=e.getElementsByTagName("UL")[0];c=this.calculateContentWidth(f,c,d);a=this.calculateVisibleWidth(a);var g=c-a;b=document.getElementById(b);var h=new goog.ui.Slider;try{h.decorate(b)}catch(k){myconsole.log(k)}h.addEventListener(goog.ui.Component.EventType.CHANGE,function(){var l=h.getValue();f.style.marginLeft="-"+Math.floor(l/100*g)+"px";$(e).blur()});$(e).bind("focus",function(){$(e).blur()})}
Scrollbar.prototype={calculateContentWidth:function(a,b,c){a=a.clientWidth;if(c!=null)a=b*c;return a},calculateVisibleWidth:function(a){a=document.getElementById(a);var b=a.clientWidth;if(b==0){var c=a.style.top,d=a.style.display;a.style.top="-10000px";a.style.display="block";b=a.clientWidth;if(b==0){var e=a.cloneNode(true);document.body.appendChild(e);b=e.clientWidth;document.body.removeChild(e)}a.style.display=d;a.style.top=c}return b}};
function Video(a,b){this.elementTemplate=b;for(var c in a)this[c]=a[c];typeof a.availableActions!="undefined"&&this.populateLicenseProfiles(a.availableActions);this.boxShotUrl="http://a.dolimg.com/en-US/3257w/media/boxShots/bs"+this.mpmProductId+".jpg";this.smallBoxShotUrl="http://a.dolimg.com/en-US/3257w/media/boxShots/bs"+this.mpmProductId+"x55x77.jpg";if(b!=false)try{this.createElement()}catch(d){myconsole.log(d)}}
Video.prototype={upgrading:false,licenses:[],purchaseType:"",purchaseDate:null,createElement:function(){var a;if(!(a=document.getElementById("video"+this.mpmProductId)))if(this.elementTemplate)a=this.elementTemplate.cloneNode(true);else{a=goog.dom.getElementsByTagNameAndClass("li","boxShot")[0].cloneNode(true);$("img.boxImage",a).attr("src","http://a.dolimg.com/en-US/3257w/img/1x1white.gif");a.id="video"+this.mpmProductId}var b=$(a);if(this.isNew){b.addClass("newVideo");b.append('<div class="boxCap">'+Page.newVideoBoxShotLabel+
"</div>")}else{b.removeClass("newVideo");$("#boxCap",b).remove()}this.element=a;b=this.title;var c=this.mpmProductId;if(typeof b=="undefined")b=Page.current.searchList.videosByMpm[c].title;queueImage(this.boxShotUrl,b,a);$("span.videoTitle",a).html(this.title);$("span.releaseDate",a).html(this.releaseDate.replace(/(\d\d\d\d)-(\d\d)-(\d\d)/g,"$2/$3/$1"));$("a.boxLink",a).attr("href","/movies/"+seoCleanText(this.title)+"-"+this.mpmProductId+"/");$("a.playLink",a).attr("href","/movies/"+seoCleanText(this.title)+
"-"+this.mpmProductId+"/#playMovie=noSync")},getElement:function(){return this.element},handleBadOrMissingPIN:function(a,b){lightboxOverlay.closeOverlay();var c=$("#pinEntryContainer");$(".error",c).hide();if(a=="upgrade"){$("span#chargeAmount").removeClass("buyPrice");$("span#chargeAmount").addClass("upgradePrice")}else if(a=="buy"){$("span#chargeAmount").removeClass("upgradePrice");$("span#chargeAmount").addClass("buyPrice")}if(typeof b!=undefined&&b!=null&&b<5){Page.current.displayPurchaseDialog(a);
$("#purchasePinEntryContainer .redTriangleError").show();$("#purchasePinInput").val("");if(b<0)$("#creditCardErrorMessage").show();else if(b==0){$("#creditCardErrorMessage").show();action=a;if(a=="buy")action="purchase";document.location="/"+action+"?product="+getCookie("extendProductId")+"&cancelUrl="+urlBase+"movies/"+seoCleanText(Page.current.video.title)+"-"+Page.current.video.mpmProductId+"/&successUrl="+urlBase+"movies/"+seoCleanText(Page.current.video.title)+"-"+Page.current.video.mpmProductId+
"/#"}else if(b==1)$("#onePinAttemptRemaining").show();else{$("#multiPinAttemptsRemaining").show();$("#pinAttemptsRemaining").html(b)}}else Page.current.displayPurchaseDialog(a)},handlePurchaseResponse:function(a,b,c){var d=this.purchaseType,e=this.mpmProductId;ajaxUtils.finished();if(a=="success"){User.syncroRetrieve();lightboxOverlay.closeOverlay();setCookie("purchaseId",c);Video.getSingleSync(e);a=this.purchaseType=="buy"?this.buyPrice:this.purchaseType=="upgrade"?this.upgradePrice:this.rentPrice;
b=new PurchaseResponseHandler(Page.current.video,getCookie("purchaseType"));b.purchasePrice=a;b.purchaseId=c;clearWorkflowCookies();b.showThankYou()}else switch(a){case "0":case "1":case "2":case "4":lightboxOverlay.useWide(null,"communicationError");lightboxOverlay.showOverlay();break;case "3":case "5":action=d;if(d=="buy")action="purchase";document.location="/"+action+"?product="+getCookie("extendProductId")+"&cancelUrl="+urlBase+"movies/"+seoCleanText(Page.current.video.title)+"-"+Page.current.video.mpmProductId+
"/&successUrl="+urlBase+"movies/"+seoCleanText(Page.current.video.title)+"-"+Page.current.video.mpmProductId+"/#";break;case "6":this.alreadyLicensedError();break;case "7":this.handleBadOrMissingPIN(d,b);break;case "10":lightboxOverlay.showBlockedLocationPurchase();break;default:this.handleBadOrMissingPIN(d,-1);break}return false},hasPhysicalLicense:function(){for(var a=0;a<this.availableActions.length;a++)switch(this.availableActions[a][0]){case "PLAY":return false;case "UPGRADE":return true;default:continue}return false},
hasStreamingRights:function(){for(var a=0;a<this.availableActions.length;a++)switch(this.availableActions[a][0]){case "PLAY":return true;default:continue}return false},isRented:function(){if(typeof this.expireDate!="undefined"&&this.expireDate!=null)if(new Date(this.expireDate)>new Date)if(this.hasStreamingRights())return true;return false},pinEntryRequired:function(){if(User.current.creditCardOnFile){var a=getCookie("profilePinSet");if(typeof a==undefined||a==null||a!="true")return true}return false},
populateLicenseProfiles:function(a){if(a)for(var b=0;b<a.length;b++){var c=a[b][1].displayPrice,d=a[b][1].extendProductId;switch(a[b][0]){case "UPGRADE":this.upgradePrice=c;this.upgradeExtendProductId=d;this.originalPrice=a[b][1].previousPrice;break;case "REDEEM":break;case "BUY":this.buyPrice=c;this.buyExtendProductId=d;break;case "RENT":this.rentPrice=c;this.rentExtendProductId=d;break;default:continue}}return false},populatePrices:function(){this.populateLicenseProfiles(this.availableActions)},
purchase:function(a,b){if(User.current!=null&&User.current.internationalUser||Page.current.video.blocked==true)lightboxOverlay.showBlockedLocationPurchase();else if(isLoggedIn){if(typeof b=="undefined"||b==null||b)if(this.hasStreamingRights()&&!this.isRented()){var c=new PurchaseResponseAlreadyLicensedHandler(this,"buy");return}else if(this.isRented()&&a=="rent"){c=new PurchaseResponseAlreadyLicensedHandler(this,"rent");return}setCookie("purchaseType",a);this.purchaseType=a;switch(a){case "upgrade":c=
this.upgradeExtendProductId;setCookie("purchasePrice",this.upgradePrice);$("#purchaseBonus.bonus").removeClass("hidden");break;case "buy":c=this.buyExtendProductId;setCookie("purchasePrice",this.buyPrice);$("#purchaseBonus.bonus").removeClass("hidden");break;case "rent":c=this.rentExtendProductId;setCookie("purchasePrice",this.rentPrice);$("#purchaseBonus.bonus").addClass("hidden");$("#purchaseExtras.extras").addClass("hidden");break}setCookie("extendProductId",c);Page.current.pauseMovies();if(this.pinEntryRequired())if(typeof b!=
"undefined"&&b!=null&&!b)window.location="/movies/"+seoCleanText(Page.current.video.title)+"-"+Page.current.video.mpmProductId+"/#"+a+"Movie=noSync";else{analytics.trackEvent("cc_challenge");Page.current.displayPurchaseDialog(a);$("#purchasePinEntryContainer .purchasePinErrorMessage").hide()}else{if(User.current.underageUser&&!User.current.creditCardOnFile){lightboxOverlay.useSlightlyNarrow("PARENT / GUARDIAN APPROVAL REQUIRED","parentPermissionNeeded");var d=this;c=$("#parentPermissionNeededContinue");
c.unbind("click");c.click(function(){lightboxOverlay.closeOverlay();lightboxOverlay.showLoader();d._purchaseInternal();return false});c=$("#parentPermissionNeededCancel");c.unbind("click");c.click(function(){lightboxOverlay.closeOverlay();return false});lightboxOverlay.showOverlay()}else this._purchaseInternal();return false}}else{myconsole.log("not logged in");setCookie("purchaseType",a);this.purchaseType=a;switch(a){case "upgrade":c=this.upgradeExtendProductId;setCookie("purchasePrice",this.upgradePrice);
break;case "buy":c=this.buyExtendProductId;setCookie("purchasePrice",this.buyPrice);break;case "rent":c=this.rentExtendProductId;setCookie("purchasePrice",this.rentPrice);break}setCookie("extendProductId",c);var e;if(typeof b!="undefined"&&b!=null&&!b)e="/movies/"+seoCleanText(this.title)+"-"+this.mpmProductId+"/";window.location=getLoginUrl("#"+a+"Movie",e)}},_purchaseInternal:function(){Page.current.resetMoviePlayers();ajaxUtils.start();var a=document.createElement("script");a.src=urlSecureBase+
"api/user/locker/video.json?r="+Number(new Date);document.body.appendChild(a);deleteCookie("profilePinSet")},unloadPlayer:function(){try{this.moviePlayer.unloadPlayer()}catch(a){}},updateRights:function(a){var b=false,c=false;this.availableActions=a.availableActions;if(a.secondsUntilExpire){this.secondsUntilExpire=a.secondsUntilExpire;this.expireDate=(new Date).addSeconds(a.secondsUntilExpire)}else this.expireDate=null;this.runningTime=a.runningTime;this.purchaseDate=a.purchaseDate;var d="";if(b=
this.hasStreamingRights())d="streamable";else if(c=this.hasPhysicalLicense())d="upgradeable";if(b||c){this.populateLicenseProfiles(a.availableActions);if(typeof this.element!="undefined"&&this.element!=null){b=$(this.element);b.removeClass("upgradeable");b.removeClass("streamable");b.removeClass("rental");b.addClass(d);if(typeof a.expireDate!="undefined"){b.addClass("rental");$("div.countdownTimer",b).each(function(){new CountdownTimer($(this),a.secondsUntilExpire)})}if(c){c=goog.dom.getElementsByTagNameAndClass("span",
"upgradePrice",this.element)[0];c.innerHTML="$"+this.upgradePrice;goog.style.setStyle(c,"display","block")}if(document.body.id!="myVideos"&&!this.isRented()){if(!("bonusCount"in this))this.bonusCount="bonusVideos"in this?this.bonusVideos.length:0;c=$("div.bonusExtras",this.element);$("div.bonusFeatures span.bonusExtrasQty",c).html("("+this.bonusCount+")");if(this.bonusCount>0){c.addClass("singleBox");var e=this.title,f=this.mpmProductId;if(typeof e=="undefined")e=Page.current.searchList.videosByMpm[f].title;
c.find(".bonusFeatures").unbind("click");c.find(".bonusFeatures").click(function(){window.location="/movies/"+seoCleanText(e)+"-"+f+"/#bonus"});c.find(".bonusFeatures").show()}}if(this.bonusCount<1){c=$("div.bonusExtras",this.element);c.removeClass("singleBox");c.find(".bonusFeatures").hide()}if(document.body.id=="homePage"){c=$(this.element).clone(true).attr("id","featured"+this.mpmProductId)[0];e=this.title;queueImage(this.boxShotUrl,e,c);$("div.countdownTimer",c).each(function(){new CountdownTimer($(this),
a.secondsUntilExpire)});goog.dom.insertSiblingBefore(c,HomePageMovieList.current.placeholderTemplate)}}}},buy:function(){if(isLoggedIn)if(this.hasStreamingRights())new PurchaseResponseAlreadyLicensedHandler(this,"buy");else if(this.hasPhysicalLicense())this.upgrade();else{deleteCookie("upgradeMpmProductId");this.upgrading=false;setCookie("buyMpmProductId",this.mpmProductId);setCookie("ccBuyMpmProductId",this.mpmProductId);setCookie("extendProductId",this.buyExtendProductId);if(this.pinEntryRequired())Page.current.displayPurchaseDialog("buy");
else{setCookie("ccBuyMpmProductId",this.mpmProductId);document.getElementById("watchMovieDialogFormError").innerHTML="";ajaxUtils.start();var a=document.createElement("script");a.src=urlSecureBase+"api/user/locker/video.json?r="+Number(new Date);document.body.appendChild(a);deleteCookie("profilePinSet");return false}}else{lightboxOverlay.closeOverlay();lightboxOverlay.useGeneric(null,"loginFormContainer",function(){analytics.trackLink("close_login_code");return false});lightboxOverlay.showOverlay();
analytics.trackLink("login_code");return false}}};Video.getAllSync=function(){ajaxUtils.start();$.ajax({async:false,cache:true,dataType:"text",error:function(){ajaxUtils.finished();lightboxOverlay.useGeneric(null,"communicationError");lightboxOverlay.showOverlay()},success:function(a){a=eval("("+a+")");for(var b=0;b<a.result.length;b++)MovieList.current.addVideo(new Video(a.result[b]),b);ajaxUtils.finished()},type:"GET",url:urlBase+"api/catalog/videos.json"})};
Video.getAllLeanSync=function(a,b){if(b!=false)b=null;ajaxUtils.start();$.ajax({async:false,cache:true,dataType:"text",error:function(){ajaxUtils.finished();lightboxOverlay.useGeneric(null,"communicationError");lightboxOverlay.showOverlay()},success:function(c){c=eval("("+c+")");for(var d=0;d<c.result.length;d++)a.addVideo(new Video(c.result[d],b));ajaxUtils.finished()},type:"GET",url:urlBase+"api/catalog/lean-videos.json"})};
Video.getSingleSync=function(a,b){if(b!=false)b=null;ajaxUtils.start();$.ajax({async:false,cache:true,dataType:"text",error:function(){ajaxUtils.finished();lightboxOverlay.useGeneric(null,"communicationError");lightboxOverlay.showOverlay()},success:function(c){c=eval("("+c+")");ajaxUtils.finished();globalVideo=new Video(c.video,b)},type:"GET",url:urlBase+"api/catalog/video/"+a+".json"})};
function CountdownTimer(a,b){if(typeof b!="undefined"&&b!=null){var c;switch(typeof b){case "string":case "object":c=new Date(b);break;case "number":c=(new Date).addSeconds(b);break;default:c=typeof b+" not supported";myconsole.error(c);throw c;}this.expireDate=c.getTime()}else{c=a.find(".expireDate").html();this.expireDate=c==""?null:(new Date).addSeconds(c)}if(!(typeof this.expireDate=="undefined"||this.expireDate==null)){this.hours=a.find(".hours");this.minutes=a.find(".minutes");this.updateTimer()}}
CountdownTimer.prototype={expireDate:0,hours:null,minutes:null,updateFrequency:5E3,updateTimer:function(){var a=Math.max(0,this.expireDate-(new Date).getTime()),b;b=a>=18E5?Math.ceil(a/6E4):Math.floor(a/6E4);var c=Math.floor(b/60);b=""+b%60;if(b.length==1)b="0"+b;this.hours.html(c);this.minutes.html(b);if(a==0&&b==0&&c==0){User.syncLocker();User.syncroRetrieve();window.location.reload()}else{var d=this;setTimeout(function(){d.updateTimer()},this.updateFrequency)}}};
var lightboxOverlay={useGeneric:function(a,b,c){lightboxOverlay.closeOverlay();if(typeof c!="undefined")lightboxOverlay.closeCallback=c;var d=null;c=document.getElementById("genericDialogContent");if(c.childNodes.length>0)d=c.firstChild;if(d!=null){c.removeChild(d);d.style.display="none";document.body.appendChild(d)}if(a==null){a=document.getElementById(b);c.appendChild(a);a.style.display="block";b=="loginFormContainer"&&analytics.trackEvent("login_challenge")}else document.getElementById("genericDialogContent").innerHTML=
a.trim();lightboxOverlay.populate("#genericDialog","#closeGenericDialog")},useBonusPlayer:function(a,b,c){lightboxOverlay.closeOverlay();if(typeof c!="undefined")lightboxOverlay.closeCallback=c;var d=null;c=document.getElementById("bonusPlayerDialogContent");if(c.childNodes.length>0)d=c.firstChild;if(d!=null){c.removeChild(d);d.style.display="none";document.body.appendChild(d)}a!=null&&$("#bonusPlayerDialog .lightboxTitle").text(a);a=document.getElementById(b);c.appendChild(a);a.style.display="block";
lightboxOverlay.populate("#bonusPlayerDialog","#closeBonusPlayerDialog")},showLoader:function(){lightboxOverlay.closeOverlay();if(typeof closeCallback!="undefined")lightboxOverlay.closeCallback=closeCallback;lightboxOverlay.populate("#loaderDialog","#closeLoaderDialog");lightboxOverlay.showOverlay()},useMedium:function(a,b,c){lightboxOverlay.closeOverlay();lightboxOverlay.closeCallback=typeof c!="undefined"?c:null;var d=null;c=document.getElementById("mediumDialogContent");if(c.childNodes.length>
0)d=c.firstChild;if(d!=null){c.removeChild(d);d.style.display="none";document.body.appendChild(d)}a!=null&&$("#mediumDialog .lightboxTitle").text(a);a=document.getElementById(b);if(a==null)try{console.log("empty content")}catch(e){}else{c.appendChild(a);a.style.display="block";lightboxOverlay.populate("#mediumDialog","#closeMediumDialog")}},useStreamError:function(a,b,c){lightboxOverlay.closeOverlay();if(typeof c!="undefined")lightboxOverlay.closeCallback=c;c=null;a=document.getElementById("errorCopy");
if(a.childNodes.length>0)c=a.firstChild;if(c!=null){a.removeChild(c);c.style.display="none";document.body.appendChild(c)}b=document.getElementById(b);if(b==null)try{console.log("empty content")}catch(d){}else{a.appendChild(b);b.style.display="block";lightboxOverlay.populate("#streamErrorDialog","#closeStreamErrorDialog")}},useStreamWarning:function(a,b,c){lightboxOverlay.closeOverlay();if(typeof c!="undefined")lightboxOverlay.closeCallback=c;c=null;a=document.getElementById("warningCopy");if(a.childNodes.length>
0)c=a.firstChild;if(c!=null){a.removeChild(c);c.style.display="none";document.body.appendChild(c)}b=document.getElementById(b);if(b==null)try{console.log("empty content")}catch(d){}else{a.appendChild(b);b.style.display="block";lightboxOverlay.populate("#streamWarningDialog","#closeStreamWarningDialog")}},useSlightlyNarrow:function(a,b,c){myconsole.log(" useSlightlyNarrow ");lightboxOverlay.closeOverlay();if(typeof c!="undefined")lightboxOverlay.closeCallback=c;var d=null;c=document.getElementById("slightlyNarrowDialogContent");
if(c.childNodes.length>0)d=c.firstChild;if(d!=null){c.removeChild(d);d.style.display="none";document.body.appendChild(d)}a!=null&&$("#slightlyNarrowDialog .lightboxTitle").text(a);a=document.getElementById(b);c.appendChild(a);a.style.display="block";lightboxOverlay.populate("#slightlyNarrowDialog","#closeSlightlyNarrowDialog")},useWide:function(a,b,c){lightboxOverlay.closeOverlay();if(typeof c!="undefined")lightboxOverlay.closeCallback=c;var d=null;c=document.getElementById("wideDialogContent");if(c.childNodes.length>
0)d=c.firstChild;if(d!=null){c.removeChild(d);d.style.display="none";document.body.appendChild(d)}a!=null&&$("#wideDialog .lightboxTitle").text(a);a=document.getElementById(b);c.appendChild(a);a.style.display="block";lightboxOverlay.populate("#wideDialog","#closeWideDialog")},useExtraWide:function(a,b,c){lightboxOverlay.closeOverlay();if(typeof c!="undefined")lightboxOverlay.closeCallback=c;var d=null;c=document.getElementById("extraWideDialogContent");if(c.childNodes.length>0)d=c.firstChild;if(d!=
null){c.removeChild(d);d.style.display="none";document.body.appendChild(d)}a!=null&&$("#extraWideDialog .lightboxTitle").text(a);a=document.getElementById(b);c.appendChild(a);a.style.display="block";lightboxOverlay.populate("#extraWideDialog","#closeExtraWideDialog")},populate:function(a,b,c){if(typeof c=="undefined")c=true;lightboxOverlay.reposition=c;lightboxOverlay.overlayContent=null;lightboxOverlay.overlay=$(a);lightboxOverlay.closeElement=$(b);lightboxOverlay.closeElement.unbind("click");$(window).unbind("resize");
lightboxOverlay.closeElement.click(function(){Page.current.clearWorkflowCookies();lightboxOverlay.closeOverlay();if(typeof lightboxOverlay.closeCallback!="undefined"&&lightboxOverlay.closeCallback!=null)return lightboxOverlay.closeCallback()});$(window).bind("resize",function(){if(lightboxOverlay.darkness&&lightboxOverlay.overlay.css("display")=="block"){lightboxOverlay.setLightboxBackground();lightboxOverlay.positionOverlay()}})},setLightboxBackground:function(){lightboxOverlay.darkness.style.width=
$(document).width()+"px";lightboxOverlay.darkness.style.height=$(document).height()+"px"},positionOverlay:function(){lightboxOverlay.overlay.css("position","fixed");lightboxOverlay.overlay.css("zIndex",1E3);if(lightboxOverlay.reposition){var a=lightboxOverlay.overlay.height(),b=lightboxOverlay.overlay.width(),c=$(window).height(),d=$(window).width(),e=$(document).scrollTop(),f=(c-a)/3;b=(d-b)/2;if(c<a){lightboxOverlay.overlay.css("top",e+"px");lightboxOverlay.overlay.css("position","absolute")}else{lightboxOverlay.overlay.css("position",
"fixed");lightboxOverlay.overlay.css("top",f+"px")}lightboxOverlay.overlay.css("zIndex",1E3);lightboxOverlay.overlay.css("left",b+"px")}lightboxOverlay.overlay.css("display","block")},showBlockedLocationStreaming:function(){lightboxOverlay.useSlightlyNarrow("UNAVAILABLE IN YOUR CURRENT LOCATION","blockedLocationStreaming");$("#blockedLocationStreamingThankYouOk").unbind("click");$("#blockedLocationStreamingThankYouOk").click(function(){lightboxOverlay.closeOverlay()});lightboxOverlay.showOverlay()},
showBlockedLocationPurchase:function(){lightboxOverlay.useSlightlyNarrow("LOCATION NOT SUPPORTED","blockedLocation");$("#blockedLocationThankYouOk").unbind("click");$("#blockedLocationThankYouOk").click(function(){lightboxOverlay.closeOverlay()});lightboxOverlay.showOverlay()},showUnder13:function(a){lightboxOverlay.useGeneric(null,"under13RegAttemptDialog");$("#closeUnder13RegAttemptDialog").click(function(){window.location=a});lightboxOverlay.showOverlay()},showBonusPlayer:function(a,b){$("#bonusPlayerDialogTitle").html(b);
lightboxOverlay.useBonusPlayer("","bonusPlayer",function(){Page.current.players.bonusMoviePlayer.pauseMovie();Page.current.players.bonusMoviePlayer.unloadPlayer()});lightboxOverlay.showOverlay();(new MoviePlayer("bonusMoviePlayer",moviePlayerPath,[558,310])).play(Page.current.video.title+"_bonus|"+b,a,false)},showOverlay:function(){try{Page.current.resetMoviePlayers()}catch(a){}try{if(lightboxOverlay.reposition){$(document).scrollTop();$("#main").offset()}if(!document.getElementById("lightboxDarkBg")){lightboxOverlay.darkness=
document.createElement("img");lightboxOverlay.darkness.src="http://a.dolimg.com/en-US/3257w/img/lightbox_bg.png";lightboxOverlay.darkness.id="lightboxDarkBg";lightboxOverlay.darkness.style.position="absolute";lightboxOverlay.darkness.style.zIndex=999;lightboxOverlay.darkness.style.top="0px";lightboxOverlay.darkness.style.left="0px";lightboxOverlay.darkness.style.width=$(document).width()+"px";lightboxOverlay.darkness.style.height=$(document).height()+"px";document.body.appendChild(lightboxOverlay.darkness)}lightboxOverlay.overlay.appendTo($("body"));
lightboxOverlay.positionOverlay()}catch(b){}},closeCallback:function(){return false},closeOverlay:function(){if(typeof lightboxOverlay.overlay!="undefined"){clearForms(lightboxOverlay.overlay);Page.current!=null&&Page.current.speedTestPlayer!=null&&Page.current.speedTestPlayer.unloadPlayer();var a=document.getElementById("lightboxDarkBg");a&&document.body.removeChild(a);lightboxOverlay.overlay.css("display","none")}}},ajaxUtils={start:function(){},finished:function(){}};
function MoviePlayer(a,b,c){this.playerID=a;if(typeof Page.current.players=="undefined")Page.current.players={};eval("Page.current.players."+a+" = this");var d=getCookie("SWID");if(typeof d=="undefined")d=null;if(swfobject.hasFlashPlayerVersion("9.0.00")){if(typeof c!="undefined"&&c!=null){var e=c[1];c=c[0]}else if(this.playerID=="sizzlePlayer"){e=270;c=486}else if(this.playerID.indexOf("billboardPlayer")!=-1){e=310;c=558}else{e=400;c=720}d={config:escape((new PlayerConfig("Page.current.players."+
a+".onPlayerEvent",d)).toXMLString())};swfobject.embedSWF(b,a,c,e,"10.1.00","http://a.dolimg.com/en-US/3257w/swf/expressInstall.swf",d,{allowFullScreen:"true",allowScriptAccess:"always",bgcolor:"#000000",wmode:"window"},{id:this.playerID,name:this.playerID},this.checkEmbedded)}else setTimeout(function(){window.location="http://disney.go.com/home/html/index.html?flash=false"},1E3)}
MoviePlayer.prototype={finishCallback:null,lastEventType:null,lastMediaType:null,lastMediaId:null,playerID:"",player:null,playing:false,queuedMedia:null,showPlayerCompleteHash:true,resetPlayer:function(){$("#"+this.playerID).addClass("zhidden");this.unloadPlayer();$("div.billboardPlayer").show();$("#productDetailMoviePlayerButton").show();$("#"+this.playerID).hide()},checkEmbedded:function(a){if(!a.success){$("#D2CPlayer").remove();$("#playerReplacementText").css("display","block")}},initialized:function(a){this.onPlayerEmbedded(a)},
mediaAuthFailed:function(a){myconsole.log("media auth failed");myconsole.log(a);var b=document.getElementById("playerErrorMessage"),c;if(typeof a.data=="string")c=a.data.match(/<reason>\[IS_STREAMABLE\](.*)<\/reason>/);b.innerHTML=c?c[1]:$("#defaultStreamErrorText").html();this.playing=false;analytics.trackLink("player_auth_error");if(this.showPlayerCompleteHash)document.location.hash="#playerAuthFailed";this.unloadPlayer();this.player.style.display="none";if(this.playerID!="billboardPlayer1"){lightboxOverlay.useStreamError("STREAMING ERROR",
"playerErrorMessage");lightboxOverlay.showOverlay()}$("#productDetailMoviePlayerButton").show()},mediaCompleted:function(){this.playing=false;this.finishCallback!=null&&this.finishCallback(this);if(this.showPlayerCompleteHash)document.location.hash="#playerCompleted"},mediaExpired:function(){User.syncLocker();User.syncroRetrieve();window.location=urlBase+"movies/"+seoCleanText(Page.current.video.title)+"-"+Page.current.video.mpmProductId+"/"},mediaFailed:function(a){var b=true;switch(a.data.text){case MPFErrorCodes.MEDIA_NOT_FOUND:case MPFErrorCodes.PLAYER_CALL_FAILED:case MPFErrorCodes.NETSTREAM_PLAY_FAILED:case MPFErrorCodes.NETSTREAM_FAILED:case MPFErrorCodes.FILE_STRUCTURE_INVALID:case MPFErrorCodes.NO_SUPPORTED_TRACK_FOUND:case MPFErrorCodes.NET_CONNECTION_CLOSED:break;
default:return}if(this.lastEventType=="mediaPaused")switch(this.lastMediaType){case "movie":this.playMovie(this.lastMediaId);return;case "trailer":case "intro":b=false;break}this.playing=false;analytics.trackLink("player_auth_error");if(b){a=document.getElementById("playerErrorText");a.innerHTML="The movie was unable to load.  Check your internet connection, or try again later.";a.style.display="block";this.unloadPlayer();this.player.style.display="none"}},mediaStalled:function(a){myconsole.log("media stalled");
myconsole.log(a)},pulseFailed:function(a){if("pulseFailed"==a.type){lightboxOverlay.useStreamWarning("PROBLEM STREAMING VIDEO","pulseFailedWarningText");lightboxOverlay.showOverlay()}},qualityHelpRequested:function(){this.pauseMovie();this.playerID!="productDetailMoviePlayer"&&lightboxOverlay.closeOverlay();popup("/help?category=TechCategory#help=QIVvideoQualityissues","qualityHelp",1E3,800)},qualitySpecsRequested:function(){this.pauseMovie();lightboxOverlay.closeOverlay();popup("/help?category=TechCategory#help=QIIIMinimumRequirements",
"qualityHelp",1E3,800)},getSafeTitle:function(a){return a.replace(/[^-a-zA-Z0-9]/g,"").toLowerCase()},loadUnsecureMediaWithCues:function(){var a=new MediaObject("myTitle","http://a.dolimg.com/en-US/3257w/img/test.flv","myID",MediaFormats.FLV);a.cuePointCollection=new CuePointCollection;a.cuePointCollection.addCuePoint(new CuePoint("testCue",5));a.posterURL="http://a.dolimg.com/en-US/3257w/img/poster.jpg";this.playing=true;this.player.setMedia(a);this.lastMediaType="unsecure";this.lastMediaId=null},log:function(){},onPlayerEmbedded:function(){this.player=
document.getElementById(this.playerID);this.queuedMedia!=null&&this.playMedia(this.queuedMedia)},onPlayerEvent:function(a){this.log("<strong>"+a.type+":</strong>"+a.data+"\n"+document.getElementById("debugview").value+"<br />");this[a.type]!=null&&this[a.type](a);this.lastEventType=a.type;this.lastEventType=="popoutRequested"&&this.onPopoutRequested(a)},pauseMovie:function(){try{this.player.pauseMedia()}catch(a){}},onPopoutRequested:function(a){if(this.player.m_popout&&!this.player.m_popout.closed)this.player.m_popout.setMedia(a.data);
else{this.player.m_popout=window.open("/html/mediaplayer_popout.html","popoutPlayer","width="+this.player.width+",height="+this.player.height+", scrollbars=no, resizable=no, menubar=no, location=no, toolbar=no, status=no, directories=no");this.player.m_popout.media=a.data}this.player.m_popout.focus()},pauseMovie:function(){try{this.player.pauseMedia()}catch(a){}},playMedia:function(a){if(this.player!=null)this.player.setMedia(a);else this.queuedMedia=a},setChapters:function(a){try{this.player!=null&&
this.player.setChapters(a)}catch(b){myconsole.log(b)}},reportPlayerError:function(a){a="guest_id="+getCookie("SWID")+"&client_id=Page&error_code="+a;$.ajax({cache:false,data:a,dataType:"text",error:function(){ajaxUtils.finished()},success:function(){ajaxUtils.finished()},type:"POST",url:document.getElementById("errorNotificationUrl").href})},play:function(a,b){var c=b.indexOf("-f");if(c!=-1){myconsole.log("movieplayer.play -f");this.resumable=true;this.omnitureTitle=a;this.movieId=b;c="http://a.dolimg.com/en-US/3257w/media/xml/"+
b.substring(0,c)+".jsonp?callback=parse_chapters";$.ajax({cache:false,dataType:"jsonp",type:"GET",url:c})}c=new SecureMediaObject(this.getSafeTitle(a),b);this.playing=c.resumable=true;this.playMedia(c)},playMovie:function(a){myconsole.log("movieplayer.playMovie");this.playing=true;var b=new SecureMediaObject("testMovie_feature|"+a,a+"-f");b.loadingMessage=$("#movieStartMessage").text();b.resumable=true;this.playMedia(b);analytics.trackLink("play_movie");window.scroll(0,0);this.lastMediaType="movie";
this.lastMediaId=a},playTrailer:function(a){myconsole.log("movieplayer.playTrailer");this.playing=true;var b=new SecureMediaObject("testMovie_trailer|"+a,a+"-t");b.loadingMessage=$("#trailerStartMessage").text();this.playMedia(b);this.playerID=="D2CPlayer"&&window.scroll(0,0);this.lastMediaType="trailer";this.lastMediaId=a},setUserId:function(a){this.player!=null&&this.player.setUserID(a)},unloadPlayer:function(){if(this.playing){this.playing=false;try{this.player.closeMedia();this.player=null}catch(a){}}}};
function parse_chapters(a){try{var b=new SecureMediaObject(player.getSafeTitle(player.omnitureTitle),player.movieId);b.resumable=player.resumable;myconsole.log(a);b.chapters=[];if($.browser.msie&&$.browser.version<9){var c=new ActiveXObject("MSXML.DOMDocument");c.async=false;c.loadXML(a.xml.replace("- ",""));$("chapters",c).find("chapter").each(function(e,f){var g=$(f),h=g.find("start_time").text().split(":"),k=0;k+=parseInt(h[0],10)*60*60;k+=parseInt(h[1],10)*60;k+=parseInt(h[2],10);h=g.find("file_name").text();
g=g.find("chapter_title").text();var l=player.movieId.indexOf("-f");l=player.movieId.substring(0,l);b.chapters.push(new MediaChapter(k,"http://a.dolimg.com/en-US/3257w/media/movieChapters/"+l+"/"+h,g))})}else $(a.xml).find("chapter").each(function(e,f){var g=$(f),h=g.find("start_time").text().split(":"),k=0;k+=parseInt(h[0],10)*60*60;k+=parseInt(h[1],10)*60;k+=parseInt(h[2],10);h=g.find("file_name").text();g=g.find("chapter_title").text();var l=player.movieId.indexOf("-f");l=player.movieId.substring(0,l);b.chapters.push(new MediaChapter(k,
"http://a.dolimg.com/en-US/3257w/media/movieChapters/"+l+"/"+h,g))});player.playing=true;$.browser.msie?player.setChapters(b.chapters):player.playMedia(b)}catch(d){myconsole.log(d)}}function PurchaseResponseHandler(a,b){this.purchaseType=b;this.video=a;Page.current.thankYou=this}
PurchaseResponseHandler.prototype={classesArray:["upgrade","buy","rental","rent","saved","notSaved","saveError"],dialogId:"thankYouDialog",profStat:null,purchaseId:null,purchaseMethod:"pin",purchasePrice:null,purchaseType:null,video:null,bindPlayMovieButton:function(){$("#thankYouDialog .playMovie").bind("click",function(){analytics.trackLink(a.purchaseType+"_play")});var a=this},closeCallback:function(a,b){var c=Page.current.thankYou;if(b==null)for(var d=0,e=c.classesArray.length;d<e;d++)$("#thankYouDialog").removeClass(c.classesArray[d]);
a!=null&&a()},populateLightbox:function(){$("#"+this.dialogId+" .purchaseId").html(this.purchaseId);$("#"+this.dialogId).addClass(this.purchaseType);var a=(new Date).toDisplayString();$("#thankYouDialog .addedOnDate").html(a);switch(this.profStat){case "0":$("#"+this.dialogId).addClass("notSaved");break;case "1":$("#"+this.dialogId).addClass("saved");break;case "-1":$("#"+this.dialogId).addClass("saveError");break}$("#thankYouDialog .purchasePrice").html(this.purchasePrice);if(this.purchaseMethod==
"pin"&&this.purchaseType=="rent"){$("#thankYouDialog .countdownTimer").each(function(b,c){new CountdownTimer($(c),Page.current.video.expireDate)});$("#movieStatusPane .rentButtons").hide();$("#movieStatusPane .largeCountdownTimer").show()}clearWorkflowCookies();this.bindPlayMovieButton()},showThankYou:function(){analytics.trackEvent(this.purchaseType+"_success");this.populateLightbox();lightboxOverlay.useMedium("THANK YOU - ENJOY YOUR MOVIE!",this.dialogId,this.closeCallback);lightboxOverlay.showOverlay();
Page.current.skin()}};function PurchaseResponseAlreadyLicensedHandler(a,b){try{$("#alreadyOwnDialog span.addedOnDate").html((new Date(a.purchaseDate)).toDisplayString())}catch(c){}$("#alreadyOwnDialog").removeClass().addClass("hidden "+b);lightboxOverlay.useSlightlyNarrow("ENJOY YOUR MOVIE","alreadyOwnDialog",function(){window.location.hash=""});lightboxOverlay.showOverlay()}
function getFormObject(a){for(var b=0;b<a.length;b++)if(a[b].name.length>0)a[b].type=="checkbox"?eval('formFields["'+a[b].name+'"] = fields[i].checked'):eval('formFields["'+a[b].name+'"] = fields[i].value;');return{}}
function setSecureCookiesFromObject(a){for(var b=0;b<a.length;b++)if(a[b].name.length>0)if(a[b].type=="checkbox")setSecureCookie(a[b].name,a[b].checked);else if(a[b].name=="comment")setSecureCookie("cmnt",a[b].value);else if(a[b].type=="radio")a[b].checked&&setSecureCookie(a[b].name,a[b].value);else setSecureCookie(a[b].name,a[b].value)}function deleteCookiesFromObject(a){for(var b=0;b<a.length;b++)a[b].name.length>0&&deleteCookie(a[b].name)}
function popup(a,b,c,d){c||(c=400);d||(d=200);if(!window.focus)return true;window.open(typeof a=="string"?a:a.href,b,"width="+c+",height="+d+",scrollbars=yes,resizable=yes");return false}function putFormObject(a,b){for(key in a)b[key].value=a[key]}function printPage(){window.print()}
function setCookie(a,b,c,d){var e=new Date;e.setMinutes(e.getMinutes()+30);document.cookie=d!=null&&d==true?a+"="+escape(b)+(c==null?";expires="+e.toGMTString():""):a+"="+escape(b)+(c==null?";expires="+e.toGMTString():"")+";path=/"}function setPermanentCookie(a,b,c,d){c=new Date;c.setSeconds(c.getSeconds()+31536E3);document.cookie=d!=null&&d==true?a+"="+escape(b)+";expires="+c.toGMTString():a+"="+escape(b)+";expires="+c.toGMTString()+";path=/"}
function setSecureCookie(a,b,c){var d=new Date;d.setSeconds(d.getSeconds()+5);document.cookie=c!=null&&c==true?a+"="+escape(b)+";expires="+d.toGMTString()+";secure":a+"="+escape(b)+";expires="+d.toGMTString()+";path=/;secure;"}function deleteCookie(a,b,c){if(getCookie(a)){if(typeof b=="undefined"||b==null)b="/";document.cookie=a+"="+(b?";path="+b:"")+(c?";domain="+c:"")+";expires=Thu, 01-Jan-1970 00:00:01 GMT"}}String.prototype.trim=function(){return this.replace(/(^\s*)|(\s*$)/g,"")};
function getHeight(a){var b=$(a).css("height");if(b=="auto")b=$(a)[0].offsetHeight+"px";return b}function clearForms(a){$(".clientValidationErrorText li",$(a)).css("display","none");$("input[type!=checkbox][type!=hidden][type!=button][type!=submit]",$(a)).attr("value","");$("textarea",$(a)).empty();$("textarea",$(a)).attr("value","");$("label",$(a)).removeClass("error")}
var VALIDATION_CONSTANTS={validCreditCard:{regex:null,maxLength:19},validEmail:{regex:/^[a-zA-Z0-9\._\-\+]*@[a-zA-Z\.\-0-9]*\.[a-zA-Z]+$/,maxLength:null},validPassword:{regex:/^[^ '"]*$/,maxLength:null},validName:{regex:/^[a-zA-Z\.,' ]*$/,maxLength:80},validPhone:{regex:/^[0-9-\(\) ]*$/,maxLength:null},validPostalCode:{regex:/^[a-zA-Z0-9- ]{5,}$/,maxLength:7},validFeedbackName:{regex:/^[a-zA-Z0-9\.,' ]*$/,maxLength:80},validFeedbackComment:{regex:null,maxLength:800},validProblemComment:{regex:null,
maxLength:800},validPin:{regex:/^[0-9]{4}$/,maxLength:4}};
function validateForm(a){var b=document.getElementById("goregerror");b!=null&&b!="undefined"&&$("span",b).html("");var c=document.getElementById("partialRegGoRegError");if(c!=null&&c!="undefined"){$("span",c).html("");$("h3.error").hide()}$("h3.message").hide();if(typeof a.elements=="undefined"&&typeof a.jquery=="undefined")a=this;$(a);var d=true;$(b).css("display","none");$("#emailAddressSpecialError").hide();$(":input",a).each(function(){var e=true;$("#"+this.id+"Error li").css("display","none");
$("#"+this.id+"ErrorText li").css("display","none");$(this).removeClass("error");$("#"+this.id+"Label").removeClass("error");switch(this.tagName.toLowerCase()){case "input":switch(this.type.toLowerCase()){case "text":case "password":var f=validateField(this);if(f==false)e=false;break;case "checkbox":if(this.checked==false)if(this.className.indexOf("required")>-1){$("#"+this.id+"ErrorText li.falseError").css("display","block");e=false}break;case "radio":if(this.className.indexOf("required")>-1)if((f=
$("input[name="+this.name+"]:checked",a))&&f.length<=0){$("#"+(a.id+this.name)+"ErrorText li.emptyError").css("display","block");e=false}break}break;case "select":if(this.selectedIndex==0)if(this.className.indexOf("required")>-1){$("#"+this.id+"ErrorText li.emptyError").css("display","block");e=false}break;case "textarea":f=validateField(this);if(f==false)e=false;break}if(!e){$(this).addClass("error");$("#"+this.id+"Label").addClass("error");d=false}});return d}
function validateField(a){var b=true,c=true;if(a.type.toLowerCase()!="password")a.value=a.value.trim();if(!(a.value.length>0)){if(a.className.indexOf("required")>-1){$("#"+a.id+"ErrorText li.emptyError").css("display","block");b=false}c=false}if(c){c=$("#"+a.id+"Confirm");if(c.length>0)if(c[0].value!=a.value){$("#"+a.id+"ErrorText li.notMatchingError").css("display","block");b=false}c=a.className.match(/valid\w*/);if(b&&c!=null&&typeof VALIDATION_CONSTANTS[c]!=undefined){if(VALIDATION_CONSTANTS[c].regex!=
null&&!a.value.match(VALIDATION_CONSTANTS[c].regex)){$("#"+a.id+"ErrorText li.invalidError").css("display","block");b=false}if(VALIDATION_CONSTANTS[c].maxLength!=null&&a.value.length>VALIDATION_CONSTANTS[c].maxLength){$("#"+a.id+"ErrorText li.tooLongError").css("display","block");b=false}}if(c=="validCreditCard")if(!isValidCreditCard(a.value)){$("#"+a.id+"ErrorText li.invalidError").css("display","block");b=false}}return b}
function populateFormErrors(a,b){for(var c=document.getElementById(a),d=0;d<b.length;d++){var e=b[d].code.split("."),f=e[0];e=e[1];if(typeof c[f]!="undefined"){var g=c[f];if(g){f=g.length>1?a+f:g.id;$("#"+f+"ErrorText li."+e+"Error").css("display","block");$(g).addClass("error");$("#"+f+"Label").addClass("error")}}}}
function populateFormUser(a,b){var c=document.getElementById(a);for(var d in b)if(typeof c[d]!="undefined"){var e=c[d];if(e.type=="checkbox"&&b[d]!=null&&typeof b[d]!=undefined&&b[d]!="")e.checked=true;e.value=b[d]}}function preloadImage(a){var b=$("#imageLoad");img=document.createElement("IMG");img.src=a;b.append(img)}
function isValidCreditCard(a){a=a.trim();a=a.replace("-","");cardRegexes={visa:/^4\d{3}\d{4}\d{4}\d{4}$/,mc:/^5[1-5]\d{2}\d{4}\d{4}\d{4}$/,disc:/^6011\d{4}\d{4}\d{4}$/,amex:/^3[4,7]\d{13}$/,diners:/^3[0,6,8]\d{12}$/};var b=false;for(var c in cardRegexes)if(cardRegexes[c].test(a))b=true;c=0;for(var d=2-a.length%2;d<=a.length;d+=2)c+=parseInt(a.charAt(d-1));for(d=a.length%2+1;d<a.length;d+=2){var e=parseInt(a.charAt(d-1))*2;c+=e<10?e:e-9}return c%10==0&&b==true?true:false}
function seoCleanText(a){if(a!=null&&a.trim()!="")return escape(a.trim().replace(/\s+/g,"-").replace(/[^-\w]/g,"").replace(/\-+/g,"-").toLowerCase());return a}
function clearWorkflowCookies(){deleteCookie("purchaseType");deleteCookie("extendProductId");deleteCookie("profilePin");deleteCookie("dmrCode");deleteCookie("upgradeMpmProductId");deleteCookie("profilePinSet");deleteCookie("buyMpmProductId");deleteCookie("upgradeRedeemCode");deleteCookie("upgradeMpmProductId");deleteCookie("ccBuyMpmProductId");deleteCookie("ccUpgradeMpmProductId");deleteCookie("purchaseId");deleteCookie("purchasePrice");deleteCookie("profStat")}
function getLoginUrl(a,b){appRedirect=getQueryStringParameter("d2cAppRedirect");if(typeof appRedirect!=undefined&&appRedirect!=null&&$.trim(appRedirect)!="")return urlSecureBase+="login?d2cAppRedirect="+appRedirect;else{if(typeof b==undefined||b==null||$.trim(b)=="")b=window.location.href;if(document.URL.indexOf("invalid-terms")>-1)b="/home";if(typeof a!="undefined"&&a!=null)b+=a;return urlSecureBase+="login?d2cAppRedirect="+encodeURIComponent(b)}}
function getRegistrationUrl(a){appRedirect=getQueryStringParameter("d2cAppRedirect");if(typeof appRedirect!=undefined&&appRedirect!=null&&$.trim(appRedirect)!="")return urlSecureBase+="register?d2cAppRedirect="+appRedirect;else{redirect=window.location.href;if(document.URL.indexOf("invalid-terms")>-1)redirect="/home";if(typeof a!="undefined"&&a!=null)redirect+=a;return urlSecureBase+="register?d2cAppRedirect="+encodeURIComponent(redirect)}}
function fetchDMOBanner(){ajaxUtils.start();$.ajax({cache:false,dataType:"json",error:function(){ajaxUtils.finished()},success:function(a){ajaxUtils.finished();if(a!=null)if(a["com.disney.d2c.dao.model.Banner"]!=null)if(document.getElementById("banner")==null)if(document.getElementById("homePage")!=null&&"true"==a["com.disney.d2c.dao.model.Banner"].homePageEnabled){$("#mainHeader").append(a["com.disney.d2c.dao.model.Banner"].bannerContent);$("#banner").css("background-color",a["com.disney.d2c.dao.model.Banner"].color);
a=$("#banner p").height();$("#banner p").css("padding-top",Math.floor((44-a)/2))}else if("false"==a["com.disney.d2c.dao.model.Banner"].homePageEnabled){$("#mainHeader").append(a["com.disney.d2c.dao.model.Banner"].bannerContent);$("#banner").css("background-color",a["com.disney.d2c.dao.model.Banner"].color);a=$("#banner p").height();$("#banner p").css("padding-top",Math.floor((44-a)/2))}},type:"GET",url:urlBase+"api/banner.json"})}
function keepSessionAlive(){$.ajax({cache:false,dataType:"text",error:function(){window.location.reload()},success:function(){return true},type:"GET",url:urlBase+"keepsessionalive"})}function getQueryStringParameter(a){a=a.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");a=(new RegExp("[\\?&]"+a+"=([^&#]*)")).exec(window.location.href);return a==null?"":a[1]}
var analytics={cto:null,eventQueue:[],trackEvent:function(a){this.eventQueue.push(a);this.eventFlush()},eventFlush:function(){if(typeof s_gi==="function")for(;this.eventQueue.length>0;){var a=this.eventQueue.shift();try{switch(a){case "login_success":analytics.cto.login="d2c:"+a;analytics.cto.genre="d2c:"+a;break;case "reg_attempt":analytics.cto.regAttempt="d2c:"+a;analytics.cto.genre="d2c:"+a;analytics.cto.leadType="d2c:"+a;break;case "reg_child_details":case "reg_adult_details":analytics.cto.leadType=
"d2c:"+a;break;case "reg_child_success":case "reg_adult_success":analytics.cto.registration="d2c:"+a;analytics.cto.genre="d2c:"+a;analytics.cto.leadType="d2c:"+a;break;case "buy_attempt":case "buy_success":case "upgrade_attempt":case "upgrade_success":case "rent_attempt":case "rent_success":case "partialReg_attempt":case "partialReg_success":case "vppa_attempt":case "vppa_success":case "get_movie":case "redeem_attempt":case "redeem_dmrOnly":case "redeem_notInCatalog":case "redeem_alreadyOwned":case "redeem_nonStream":case "redeem_streaming":analytics.cto.leadType=
"d2c:"+a;analytics.cto.genre="d2c:"+a;break;case "login_page":case "new_cc_attempt":case "cc_challenge":case "magicCode_redeem":case "magicCode_enter":case "magicCode_product":analytics.cto.genre="d2c:"+a;break}analytics.cto.trackEvent()}catch(b){try{console.log(b)}catch(c){}}}else setTimeout("analytics.eventFlush()",75)},trackLink:function(a,b){try{if(analytics.cto!=null){analytics.cto.linkId=a;if(typeof b!="undefined")analytics.cto.linkPosition=b;analytics.cto.trackLink();analytics.cto.linkObj=
"";analytics.cto.linkId="";analytics.cto.linkPosition="";analytics.cto.linkType=""}}catch(c){try{console.log(c)}catch(d){}}},trackPage:function(a){try{this.createNewCTO();analytics.cto.pageName=a;var b="d2c";switch(a){case "my_account":case "change_name":case "change_pass":case "purchase_history":b+=":account";break;case "cc_entry":case "cc_update":b+=":commerce";break;case "reg_attempt":b+=":registration:step1";break;case "reg_child_details":case "reg_adult_details":b+=":registration:step2";break;
case "reg_child_success":case "reg_adult_success":b+=":registration:success";break;case "help_overview":b+=":faq";break;default:if(a.indexOf("help_")!=-1)b+=":faq";break}analytics.cto.siteSection=b}catch(c){try{console.log(c)}catch(d){}}},trackSearch:function(a,b){try{this.createNewCTO();analytics.cto.siteSection="d2c";analytics.cto.contentType="search";analytics.cto.property="";analytics.cto.searchRefinement="";analytics.cto.searchType="global";if(a=="no_search_entered"){analytics.cto.pageName="blank";
analytics.cto.internalSearchPhrase="no_search_entered"}else{analytics.cto.pageName=typeof b==undefined||b==null||b==0?"failed":"success";analytics.cto.internalSearchPhrase=a}analytics.cto.numSearchResults=b;analytics.cto.track()}catch(c){try{console.log(c)}catch(d){}}},trackOmnitureCookie:function(){var a=getCookie("track_event");if(typeof a!="undefined"&&a!=null){analytics.trackEvent(a);deleteCookie("track_event","/","."+document.domain)}},createNewCTO:function(){analytics.cto=new CTO;analytics.cto.account=
omniAccount;analytics.cto.category="dcore";analytics.cto.site="dcom";analytics.cto.brandSegment="core"}},TCs="TCs",privacy="privacy",systemReqs="systemReqs",myconsole={log:function(a){try{console.log(a)}catch(b){}},error:function(a){try{console.log(a);console.trace()}catch(b){}}};function AnalyticsTrack(){try{analytics.cto.engagementType="hover";analytics.cto.trackLink();analytics.cto.engagementType=""}catch(a){myconsole.log(a)}}var globalVideo;
(function(){window.flushImageQueue=function(){if(Page.current.imageQueue.length>0)if(Page.current.availableImageRequests>0){Page.current.availableImageRequests--;var a=Page.current.imageQueue.shift(),b=a[0],c=a[1];a=a[2];var d=new Image;d.onload=function(){Page.current.availableImageRequests++;setTimeout("flushImageQueue()",200)};d.src=b;Page.current.imgCallback(d,c,a)}}})();var queueImage=function(a,b,c){Page.current.imageQueue.push([a,b,c]);flushImageQueue()};preLoadPage();
function preLoadPage(){getCookie("dmo_member_n")!=null&&(typeof isLoggedIn=="undefined"||isLoggedIn==null)?setTimeout(preLoadPage,33):loadPage()};

