//
// Copyright 2006 The Closure Library Authors. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//      http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS-IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
var COMPILED=false;
var goog=goog||{};
goog.global=this;
goog.DEBUG=true;
goog.LOCALE="en";
goog.evalWorksForGlobals_=null;
goog.provide=function(_1){
if(!COMPILED){
if(goog.getObjectByName(_1)&&!goog.implicitNamespaces_[_1]){
throw Error("Namespace \""+_1+"\" already declared.");
}
var _2=_1;
while((_2=_2.substring(0,_2.lastIndexOf(".")))){
goog.implicitNamespaces_[_2]=true;
}
}
goog.exportPath_(_1);
};
if(!COMPILED){
goog.implicitNamespaces_={};
}
goog.exportPath_=function(_3,_4,_5){
var _6=_3.split(".");
var _7=_5||goog.global;
if(!(_6[0] in _7)&&_7.execScript){
_7.execScript("var "+_6[0]);
}
for(var _8;_6.length&&(_8=_6.shift());){
if(!_6.length&&goog.isDef(_4)){
_7[_8]=_4;
}else{
if(_7[_8]){
_7=_7[_8];
}else{
_7=_7[_8]={};
}
}
}
};
goog.getObjectByName=function(_9,_a){
var _b=_9.split(".");
var _c=_a||goog.global;
for(var _d;_d=_b.shift();){
if(_c[_d]){
_c=_c[_d];
}else{
return null;
}
}
return _c;
};
goog.globalize=function(_e,_f){
var _10=_f||goog.global;
for(var x in _e){
_10[x]=_e[x];
}
};
goog.addDependency=function(_12,_13,_14){
if(!COMPILED){
var _15,require;
var _16=_12.replace(/\\/g,"/");
var _17=goog.dependencies_;
for(var i=0;_15=_13[i];i++){
_17.nameToPath[_15]=_16;
if(!(_16 in _17.pathToNames)){
_17.pathToNames[_16]={};
}
_17.pathToNames[_16][_15]=true;
}
for(var j=0;require=_14[j];j++){
if(!(_16 in _17.requires)){
_17.requires[_16]={};
}
_17.requires[_16][require]=true;
}
}
};
goog.require=function(_1a){
if(!COMPILED){
if(goog.getObjectByName(_1a)){
return;
}
var _1b=goog.getPathFromDeps_(_1a);
if(_1b){
goog.included_[_1b]=true;
goog.writeScripts_();
}else{
var _1c="goog.require could not find: "+_1a;
if(goog.global.console){
goog.global.console["error"](_1c);
}
throw Error(_1c);
}
}
};
goog.basePath="";
goog.global.CLOSURE_BASE_PATH;
goog.global.CLOSURE_NO_DEPS;
goog.nullFunction=function(){
};
goog.identityFunction=function(_1d){
return arguments[0];
};
goog.abstractMethod=function(){
throw Error("unimplemented abstract method");
};
goog.addSingletonGetter=function(_1e){
_1e.getInstance=function(){
return _1e.instance_||(_1e.instance_=new _1e());
};
};
if(!COMPILED){
goog.included_={};
goog.dependencies_={pathToNames:{},nameToPath:{},requires:{},visited:{},written:{}};
goog.inHtmlDocument_=function(){
var doc=goog.global.document;
return typeof doc!="undefined"&&"write" in doc;
};
goog.findBasePath_=function(){
if(!goog.inHtmlDocument_()){
return;
}
var doc=goog.global.document;
if(goog.global.CLOSURE_BASE_PATH){
goog.basePath=goog.global.CLOSURE_BASE_PATH;
return;
}
var _21=doc.getElementsByTagName("script");
for(var i=_21.length-1;i>=0;--i){
var src=_21[i].src;
var l=src.length;
if(src.substr(l-7)=="base.js"){
goog.basePath=src.substr(0,l-7);
return;
}
}
};
goog.writeScriptTag_=function(src){
if(goog.inHtmlDocument_()&&!goog.dependencies_.written[src]){
goog.dependencies_.written[src]=true;
var doc=goog.global.document;
doc.write("<script type=\"text/javascript\" src=\""+src+"\"></"+"script>");
}
};
goog.writeScripts_=function(){
var _27=[];
var _28={};
var _29=goog.dependencies_;
function visitNode(_2a){
if(_2a in _29.written){
return;
}
if(_2a in _29.visited){
if(!(_2a in _28)){
_28[_2a]=true;
_27.push(_2a);
}
return;
}
_29.visited[_2a]=true;
if(_2a in _29.requires){
for(var _2b in _29.requires[_2a]){
if(_2b in _29.nameToPath){
visitNode(_29.nameToPath[_2b]);
}else{
if(!goog.getObjectByName(_2b)){
throw Error("Undefined nameToPath for "+_2b);
}
}
}
}
if(!(_2a in _28)){
_28[_2a]=true;
_27.push(_2a);
}
}
for(var _2c in goog.included_){
if(!_29.written[_2c]){
visitNode(_2c);
}
}
for(var i=0;i<_27.length;i++){
if(_27[i]){
goog.writeScriptTag_(goog.basePath+_27[i]);
}else{
throw Error("Undefined script input");
}
}
};
goog.getPathFromDeps_=function(_2e){
if(_2e in goog.dependencies_.nameToPath){
return goog.dependencies_.nameToPath[_2e];
}else{
return null;
}
};
goog.findBasePath_();
if(!goog.global.CLOSURE_NO_DEPS){
/*goog.writeScriptTag_(goog.basePath+"deps.js");*/
}
}
goog.typeOf=function(_2f){
var s=typeof _2f;
if(s=="object"){
if(_2f){
if(_2f instanceof Array||(!(_2f instanceof Object)&&(Object.prototype.toString.call((_2f))=="[object Array]")||typeof _2f.length=="number"&&typeof _2f.splice!="undefined"&&typeof _2f.propertyIsEnumerable!="undefined"&&!_2f.propertyIsEnumerable("splice"))){
return "array";
}
if(!(_2f instanceof Object)&&(Object.prototype.toString.call((_2f))=="[object Function]"||typeof _2f.call!="undefined"&&typeof _2f.propertyIsEnumerable!="undefined"&&!_2f.propertyIsEnumerable("call"))){
return "function";
}
}else{
return "null";
}
}else{
if(s=="function"&&typeof _2f.call=="undefined"){
return "object";
}
}
return s;
};
goog.propertyIsEnumerableCustom_=function(_31,_32){
if(_32 in _31){
for(var key in _31){
if(key==_32&&Object.prototype.hasOwnProperty.call(_31,_32)){
return true;
}
}
}
return false;
};
goog.propertyIsEnumerable_=function(_34,_35){
if(_34 instanceof Object){
return Object.prototype.propertyIsEnumerable.call(_34,_35);
}else{
return goog.propertyIsEnumerableCustom_(_34,_35);
}
};
goog.isDef=function(val){
return val!==undefined;
};
goog.isNull=function(val){
return val===null;
};
goog.isDefAndNotNull=function(val){
return val!=null;
};
goog.isArray=function(val){
return goog.typeOf(val)=="array";
};
goog.isArrayLike=function(val){
var _3b=goog.typeOf(val);
return _3b=="array"||_3b=="object"&&typeof val.length=="number";
};
goog.isDateLike=function(val){
return goog.isObject(val)&&typeof val.getFullYear=="function";
};
goog.isString=function(val){
return typeof val=="string";
};
goog.isBoolean=function(val){
return typeof val=="boolean";
};
goog.isNumber=function(val){
return typeof val=="number";
};
goog.isFunction=function(val){
return goog.typeOf(val)=="function";
};
goog.isObject=function(val){
var _42=goog.typeOf(val);
return _42=="object"||_42=="array"||_42=="function";
};
goog.getUid=function(obj){
if(obj.hasOwnProperty&&obj.hasOwnProperty(goog.UID_PROPERTY_)){
return obj[goog.UID_PROPERTY_];
}
if(!obj[goog.UID_PROPERTY_]){
obj[goog.UID_PROPERTY_]=++goog.uidCounter_;
}
return obj[goog.UID_PROPERTY_];
};
goog.removeUid=function(obj){
if("removeAttribute" in obj){
obj.removeAttribute(goog.UID_PROPERTY_);
}
try{
delete obj[goog.UID_PROPERTY_];
}
catch(ex){
}
};
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(obj){
var _46=goog.typeOf(obj);
if(_46=="object"||_46=="array"){
if(obj.clone){
return obj.clone();
}
var _47=_46=="array"?[]:{};
for(var key in obj){
_47[key]=goog.cloneObject(obj[key]);
}
return _47;
}
return obj;
};
Object.prototype.clone;
goog.bind=function(fn,_4a,_4b){
var _4c=_4a||goog.global;
if(arguments.length>2){
var _4d=Array.prototype.slice.call(arguments,2);
return function(){
var _4e=Array.prototype.slice.call(arguments);
Array.prototype.unshift.apply(_4e,_4d);
return fn.apply(_4c,_4e);
};
}else{
return function(){
return fn.apply(_4c,arguments);
};
}
};
goog.partial=function(fn,_50){
var _51=Array.prototype.slice.call(arguments,1);
return function(){
var _52=Array.prototype.slice.call(arguments);
_52.unshift.apply(_52,_51);
return fn.apply(this,_52);
};
};
goog.mixin=function(_53,_54){
for(var x in _54){
_53[x]=_54[x];
}
};
goog.now=Date.now||(function(){
return +new Date();
});
goog.globalEval=function(_56){
if(goog.global.execScript){
goog.global.execScript(_56,"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(_56);
}else{
var doc=goog.global.document;
var _58=doc.createElement("script");
_58.type="text/javascript";
_58.defer=false;
_58.appendChild(doc.createTextNode(_56));
doc.body.appendChild(_58);
doc.body.removeChild(_58);
}
}else{
throw Error("goog.globalEval not available");
}
}
};
goog.typedef=true;
goog.cssNameMapping_;
goog.getCssName=function(_59,_5a){
var _5b=_59+(_5a?"-"+_5a:"");
return (goog.cssNameMapping_&&(_5b in goog.cssNameMapping_))?goog.cssNameMapping_[_5b]:_5b;
};
goog.setCssNameMapping=function(_5c){
goog.cssNameMapping_=_5c;
};
goog.getMsg=function(str,_5e){
var _5f=_5e||{};
for(var key in _5f){
var _61=(""+_5f[key]).replace(/\$/g,"$$$$");
str=str.replace(new RegExp("\\{\\$"+key+"\\}","gi"),_61);
}
return str;
};
goog.exportSymbol=function(_62,_63,_64){
goog.exportPath_(_62,_63,_64);
};
goog.exportProperty=function(_65,_66,_67){
_65[_66]=_67;
};
goog.inherits=function(_68,_69){
function tempCtor(){
}
tempCtor.prototype=_69.prototype;
_68.superClass_=_69.prototype;
_68.prototype=new tempCtor();
_68.prototype.constructor=_68;
};
goog.base=function(me,_6b,_6c){
var _6d=arguments.callee.caller;
if(_6d.superClass_){
return _6d.superClass_.constructor.apply(me,Array.prototype.slice.call(arguments,1));
}
var _6e=Array.prototype.slice.call(arguments,2);
var _6f=false;
for(var _70=me.constructor;_70;_70=_70.superClass_&&_70.superClass_.constructor){
if(_70.prototype[_6b]===_6d){
_6f=true;
}else{
if(_6f){
return _70.prototype[_6b].apply(me,_6e);
}
}
}
if(me[_6b]===_6d){
return me.constructor.prototype[_6b].apply(me,_6e);
}else{
throw Error("goog.base called from a method of one name "+"to a method of a different name");
}
};
goog.scope=function(fn){
fn.call(goog.global);
};
goog.provide("goog.debug.Error");
goog.debug.Error=function(_72){
this.stack=new Error().stack||"";
if(_72){
this.message=String(_72);
}
};
goog.inherits(goog.debug.Error,Error);
goog.debug.Error.prototype.name="CustomError";
goog.provide("goog.string");
goog.provide("goog.string.Unicode");
goog.string.Unicode={NBSP:"\xa0"};
goog.string.startsWith=function(str,_74){
return str.lastIndexOf(_74,0)==0;
};
goog.string.endsWith=function(str,_76){
var l=str.length-_76.length;
return l>=0&&str.indexOf(_76,l)==l;
};
goog.string.caseInsensitiveStartsWith=function(str,_79){
return goog.string.caseInsensitiveCompare(_79,str.substr(0,_79.length))==0;
};
goog.string.caseInsensitiveEndsWith=function(str,_7b){
return goog.string.caseInsensitiveCompare(_7b,str.substr(str.length-_7b.length,_7b.length))==0;
};
goog.string.subs=function(str,_7d){
for(var i=1;i<arguments.length;i++){
var _7f=String(arguments[i]).replace(/\$/g,"$$$$");
str=str.replace(/\%s/,_7f);
}
return str;
};
goog.string.collapseWhitespace=function(str){
return str.replace(/[\s\xa0]+/g," ").replace(/^\s+|\s+$/g,"");
};
goog.string.isEmpty=function(str){
return /^[\s\xa0]*$/.test(str);
};
goog.string.isEmptySafe=function(str){
return goog.string.isEmpty(goog.string.makeSafe(str));
};
goog.string.isBreakingWhitespace=function(str){
return !/[^\t\n\r ]/.test(str);
};
goog.string.isAlpha=function(str){
return !/[^a-zA-Z]/.test(str);
};
goog.string.isNumeric=function(str){
return !/[^0-9]/.test(str);
};
goog.string.isAlphaNumeric=function(str){
return !/[^a-zA-Z0-9]/.test(str);
};
goog.string.isSpace=function(ch){
return ch==" ";
};
goog.string.isUnicodeChar=function(ch){
return ch.length==1&&ch>=" "&&ch<="~"||ch>="\x80"&&ch<="\ufffd";
};
goog.string.stripNewlines=function(str){
return str.replace(/(\r\n|\r|\n)+/g," ");
};
goog.string.canonicalizeNewlines=function(str){
return str.replace(/(\r\n|\r|\n)/g,"\n");
};
goog.string.normalizeWhitespace=function(str){
return str.replace(/\xa0|\s/g," ");
};
goog.string.normalizeSpaces=function(str){
return str.replace(/\xa0|[ \t]+/g," ");
};
goog.string.trim=function(str){
return str.replace(/^[\s\xa0]+|[\s\xa0]+$/g,"");
};
goog.string.trimLeft=function(str){
return str.replace(/^[\s\xa0]+/,"");
};
goog.string.trimRight=function(str){
return str.replace(/[\s\xa0]+$/,"");
};
goog.string.caseInsensitiveCompare=function(_90,_91){
var _92=String(_90).toLowerCase();
var _93=String(_91).toLowerCase();
if(_92<_93){
return -1;
}else{
if(_92==_93){
return 0;
}else{
return 1;
}
}
};
goog.string.numerateCompareRegExp_=/(\.\d+)|(\d+)|(\D+)/g;
goog.string.numerateCompare=function(_94,_95){
if(_94==_95){
return 0;
}
if(!_94){
return -1;
}
if(!_95){
return 1;
}
var _96=_94.toLowerCase().match(goog.string.numerateCompareRegExp_);
var _97=_95.toLowerCase().match(goog.string.numerateCompareRegExp_);
var _98=Math.min(_96.length,_97.length);
for(var i=0;i<_98;i++){
var a=_96[i];
var b=_97[i];
if(a!=b){
var _9c=parseInt(a,10);
if(!isNaN(_9c)){
var _9d=parseInt(b,10);
if(!isNaN(_9d)&&_9c-_9d){
return _9c-_9d;
}
}
return a<b?-1:1;
}
}
if(_96.length!=_97.length){
return _96.length-_97.length;
}
return _94<_95?-1:1;
};
goog.string.encodeUriRegExp_=/^[a-zA-Z0-9\-_.!~*'()]*$/;
goog.string.urlEncode=function(str){
str=String(str);
if(!goog.string.encodeUriRegExp_.test(str)){
return encodeURIComponent(str);
}
return str;
};
goog.string.urlDecode=function(str){
return decodeURIComponent(str.replace(/\+/g," "));
};
goog.string.newLineToBr=function(str,_a1){
return str.replace(/(\r\n|\r|\n)/g,_a1?"<br />":"<br>");
};
goog.string.htmlEscape=function(str,_a3){
if(_a3){
return str.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(str)){
return str;
}
if(str.indexOf("&")!=-1){
str=str.replace(goog.string.amperRe_,"&amp;");
}
if(str.indexOf("<")!=-1){
str=str.replace(goog.string.ltRe_,"&lt;");
}
if(str.indexOf(">")!=-1){
str=str.replace(goog.string.gtRe_,"&gt;");
}
if(str.indexOf("\"")!=-1){
str=str.replace(goog.string.quotRe_,"&quot;");
}
return str;
}
};
goog.string.amperRe_=/&/g;
goog.string.ltRe_=/</g;
goog.string.gtRe_=/>/g;
goog.string.quotRe_=/\"/g;
goog.string.allRe_=/[&<>\"]/;
goog.string.unescapeEntities=function(str){
if(goog.string.contains(str,"&")){
if("document" in goog.global&&!goog.string.contains(str,"<")){
return goog.string.unescapeEntitiesUsingDom_(str);
}else{
return goog.string.unescapePureXmlEntities_(str);
}
}
return str;
};
goog.string.unescapeEntitiesUsingDom_=function(str){
var el=goog.global["document"]["createElement"]("a");
el["innerHTML"]=str;
if(el[goog.string.NORMALIZE_FN_]){
el[goog.string.NORMALIZE_FN_]();
}
str=el["firstChild"]["nodeValue"];
el["innerHTML"]="";
return str;
};
goog.string.unescapePureXmlEntities_=function(str){
return str.replace(/&([^;]+);/g,function(s,_a9){
switch(_a9){
case "amp":
return "&";
case "lt":
return "<";
case "gt":
return ">";
case "quot":
return "\"";
default:
if(_a9.charAt(0)=="#"){
var n=Number("0"+_a9.substr(1));
if(!isNaN(n)){
return String.fromCharCode(n);
}
}
return s;
}
});
};
goog.string.NORMALIZE_FN_="normalize";
goog.string.whitespaceEscape=function(str,_ac){
return goog.string.newLineToBr(str.replace(/  /g," &#160;"),_ac);
};
goog.string.stripQuotes=function(str,_ae){
var _af=_ae.length;
for(var i=0;i<_af;i++){
var _b1=_af==1?_ae:_ae.charAt(i);
if(str.charAt(0)==_b1&&str.charAt(str.length-1)==_b1){
return str.substring(1,str.length-1);
}
}
return str;
};
goog.string.truncate=function(str,_b3,_b4){
if(_b4){
str=goog.string.unescapeEntities(str);
}
if(str.length>_b3){
str=str.substring(0,_b3-3)+"...";
}
if(_b4){
str=goog.string.htmlEscape(str);
}
return str;
};
goog.string.truncateMiddle=function(str,_b6,_b7){
if(_b7){
str=goog.string.unescapeEntities(str);
}
if(str.length>_b6){
var _b8=Math.floor(_b6/2);
var _b9=str.length-_b8;
_b8+=_b6%2;
str=str.substring(0,_b8)+"..."+str.substring(_b9);
}
if(_b7){
str=goog.string.htmlEscape(str);
}
return str;
};
goog.string.specialEscapeChars_={"\x00":"\\0","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r","\t":"\\t","\v":"\\x0B","\"":"\\\"","\\":"\\\\"};
goog.string.jsEscapeCache_={"'":"\\'"};
goog.string.quote=function(s){
s=String(s);
if(s.quote){
return s.quote();
}else{
var sb=["\""];
for(var i=0;i<s.length;i++){
var ch=s.charAt(i);
var cc=ch.charCodeAt(0);
sb[i+1]=goog.string.specialEscapeChars_[ch]||((cc>31&&cc<127)?ch:goog.string.escapeChar(ch));
}
sb.push("\"");
return sb.join("");
}
};
goog.string.escapeString=function(str){
var sb=[];
for(var i=0;i<str.length;i++){
sb[i]=goog.string.escapeChar(str.charAt(i));
}
return sb.join("");
};
goog.string.escapeChar=function(c){
if(c in goog.string.jsEscapeCache_){
return goog.string.jsEscapeCache_[c];
}
if(c in goog.string.specialEscapeChars_){
return goog.string.jsEscapeCache_[c]=goog.string.specialEscapeChars_[c];
}
var rv=c;
var cc=c.charCodeAt(0);
if(cc>31&&cc<127){
rv=c;
}else{
if(cc<256){
rv="\\x";
if(cc<16||cc>256){
rv+="0";
}
}else{
rv="\\u";
if(cc<4096){
rv+="0";
}
}
rv+=cc.toString(16).toUpperCase();
}
return goog.string.jsEscapeCache_[c]=rv;
};
goog.string.toMap=function(s){
var rv={};
for(var i=0;i<s.length;i++){
rv[s.charAt(i)]=true;
}
return rv;
};
goog.string.contains=function(s,ss){
return s.indexOf(ss)!=-1;
};
goog.string.removeAt=function(s,_cb,_cc){
var _cd=s;
if(_cb>=0&&_cb<s.length&&_cc>0){
_cd=s.substr(0,_cb)+s.substr(_cb+_cc,s.length-_cb-_cc);
}
return _cd;
};
goog.string.remove=function(s,ss){
var re=new RegExp(goog.string.regExpEscape(ss),"");
return s.replace(re,"");
};
goog.string.removeAll=function(s,ss){
var re=new RegExp(goog.string.regExpEscape(ss),"g");
return s.replace(re,"");
};
goog.string.regExpEscape=function(s){
return String(s).replace(/([-()\[\]{}+?*.$\^|,:#<!\\])/g,"\\$1").replace(/\x08/g,"\\x08");
};
goog.string.repeat=function(_d5,_d6){
return new Array(_d6+1).join(_d5);
};
goog.string.padNumber=function(num,_d8,_d9){
var s=goog.isDef(_d9)?num.toFixed(_d9):String(num);
var _db=s.indexOf(".");
if(_db==-1){
_db=s.length;
}
return goog.string.repeat("0",Math.max(0,_d8-_db))+s;
};
goog.string.makeSafe=function(obj){
return obj==null?"":String(obj);
};
goog.string.buildString=function(_dd){
return Array.prototype.join.call(arguments,"");
};
goog.string.getRandomString=function(){
return Math.floor(Math.random()*2147483648).toString(36)+(Math.floor(Math.random()*2147483648)^goog.now()).toString(36);
};
goog.string.compareVersions=function(_de,_df){
var _e0=0;
var _e1=goog.string.trim(String(_de)).split(".");
var _e2=goog.string.trim(String(_df)).split(".");
var _e3=Math.max(_e1.length,_e2.length);
for(var _e4=0;_e0==0&&_e4<_e3;_e4++){
var _e5=_e1[_e4]||"";
var _e6=_e2[_e4]||"";
var _e7=new RegExp("(\\d*)(\\D*)","g");
var _e8=new RegExp("(\\d*)(\\D*)","g");
do{
var _e9=_e7.exec(_e5)||["","",""];
var _ea=_e8.exec(_e6)||["","",""];
if(_e9[0].length==0&&_ea[0].length==0){
break;
}
var _eb=_e9[1].length==0?0:parseInt(_e9[1],10);
var _ec=_ea[1].length==0?0:parseInt(_ea[1],10);
_e0=goog.string.compareElements_(_eb,_ec)||goog.string.compareElements_(_e9[2].length==0,_ea[2].length==0)||goog.string.compareElements_(_e9[2],_ea[2]);
}while(_e0==0);
}
return _e0;
};
goog.string.compareElements_=function(_ed,_ee){
if(_ed<_ee){
return -1;
}else{
if(_ed>_ee){
return 1;
}
}
return 0;
};
goog.string.HASHCODE_MAX_=4294967296;
goog.string.hashCode=function(str){
var _f0=0;
for(var i=0;i<str.length;++i){
_f0=31*_f0+str.charCodeAt(i);
_f0%=goog.string.HASHCODE_MAX_;
}
return _f0;
};
goog.string.uniqueStringCounter_=Math.random()*2147483648|0;
goog.string.createUniqueString=function(){
return "goog_"+goog.string.uniqueStringCounter_++;
};
goog.string.toNumber=function(str){
var num=Number(str);
if(num==0&&goog.string.isEmpty(str)){
return NaN;
}
return num;
};
goog.provide("goog.asserts");
goog.provide("goog.asserts.AssertionError");
goog.require("goog.debug.Error");
goog.require("goog.string");
goog.asserts.ENABLE_ASSERTS=goog.DEBUG;
goog.asserts.AssertionError=function(_f4,_f5){
_f5.unshift(_f4);
goog.debug.Error.call(this,goog.string.subs.apply(null,_f5));
_f5.shift();
this.messagePattern=_f4;
};
goog.inherits(goog.asserts.AssertionError,goog.debug.Error);
goog.asserts.AssertionError.prototype.name="AssertionError";
goog.asserts.doAssertFailure_=function(_f6,_f7,_f8,_f9){
var _fa="Assertion failed";
if(_f8){
_fa+=": "+_f8;
var _fb=_f9;
}else{
if(_f6){
_fa+=": "+_f6;
_fb=_f7;
}
}
throw new goog.asserts.AssertionError(""+_fa,_fb||[]);
};
goog.asserts.assert=function(_fc,_fd,_fe){
if(goog.asserts.ENABLE_ASSERTS&&!_fc){
goog.asserts.doAssertFailure_("",null,_fd,Array.prototype.slice.call(arguments,2));
}
};
goog.asserts.fail=function(_ff,_100){
if(goog.asserts.ENABLE_ASSERTS){
throw new goog.asserts.AssertionError("Failure"+(_ff?": "+_ff:""),Array.prototype.slice.call(arguments,1));
}
};
goog.asserts.assertNumber=function(_101,_102,_103){
if(goog.asserts.ENABLE_ASSERTS&&!goog.isNumber(_101)){
goog.asserts.doAssertFailure_("Expected number but got %s.",[_101],_102,Array.prototype.slice.call(arguments,2));
}
return (_101);
};
goog.asserts.assertString=function(_104,_105,_106){
if(goog.asserts.ENABLE_ASSERTS&&!goog.isString(_104)){
goog.asserts.doAssertFailure_("Expected string but got %s.",[_104],_105,Array.prototype.slice.call(arguments,2));
}
return (_104);
};
goog.asserts.assertFunction=function(_107,_108,_109){
if(goog.asserts.ENABLE_ASSERTS&&!goog.isFunction(_107)){
goog.asserts.doAssertFailure_("Expected function but got %s.",[_107],_108,Array.prototype.slice.call(arguments,2));
}
return (_107);
};
goog.asserts.assertObject=function(_10a,_10b,_10c){
if(goog.asserts.ENABLE_ASSERTS&&!goog.isObject(_10a)){
goog.asserts.doAssertFailure_("Expected object but got %s.",[_10a],_10b,Array.prototype.slice.call(arguments,2));
}
return (_10a);
};
goog.asserts.assertArray=function(_10d,_10e,_10f){
if(goog.asserts.ENABLE_ASSERTS&&!goog.isArray(_10d)){
goog.asserts.doAssertFailure_("Expected array but got %s.",[_10d],_10e,Array.prototype.slice.call(arguments,2));
}
return (_10d);
};
goog.asserts.assertInstanceof=function(_110,type,_112,_113){
if(goog.asserts.ENABLE_ASSERTS&&!(_110 instanceof type)){
goog.asserts.doAssertFailure_("instanceof check failed.",null,_112,Array.prototype.slice.call(arguments,3));
}
};
goog.provide("goog.array");
goog.require("goog.asserts");
goog.array.ArrayLike;
goog.array.peek=function(_114){
return _114[_114.length-1];
};
goog.array.ARRAY_PROTOTYPE_=Array.prototype;
goog.array.indexOf=goog.array.ARRAY_PROTOTYPE_.indexOf?function(arr,obj,_117){
goog.asserts.assert(arr||goog.isString(arr));
goog.asserts.assertNumber(arr.length);
return goog.array.ARRAY_PROTOTYPE_.indexOf.call(arr,obj,_117);
}:function(arr,obj,_11a){
var _11b=_11a==null?0:(_11a<0?Math.max(0,arr.length+_11a):_11a);
if(goog.isString(arr)){
if(!goog.isString(obj)||obj.length!=1){
return -1;
}
return arr.indexOf(obj,_11b);
}
for(var i=_11b;i<arr.length;i++){
if(i in arr&&arr[i]===obj){
return i;
}
}
return -1;
};
goog.array.lastIndexOf=goog.array.ARRAY_PROTOTYPE_.lastIndexOf?function(arr,obj,_11f){
goog.asserts.assert(arr||goog.isString(arr));
goog.asserts.assertNumber(arr.length);
var _120=_11f==null?arr.length-1:_11f;
return goog.array.ARRAY_PROTOTYPE_.lastIndexOf.call(arr,obj,_120);
}:function(arr,obj,_123){
var _124=_123==null?arr.length-1:_123;
if(_124<0){
_124=Math.max(0,arr.length+_124);
}
if(goog.isString(arr)){
if(!goog.isString(obj)||obj.length!=1){
return -1;
}
return arr.lastIndexOf(obj,_124);
}
for(var i=_124;i>=0;i--){
if(i in arr&&arr[i]===obj){
return i;
}
}
return -1;
};
goog.array.forEach=goog.array.ARRAY_PROTOTYPE_.forEach?function(arr,f,_128){
goog.asserts.assert(arr||goog.isString(arr));
goog.asserts.assertNumber(arr.length);
goog.array.ARRAY_PROTOTYPE_.forEach.call(arr,f,_128);
}:function(arr,f,_12b){
var l=arr.length;
var arr2=goog.isString(arr)?arr.split(""):arr;
for(var i=0;i<l;i++){
if(i in arr2){
f.call(_12b,arr2[i],i,arr);
}
}
};
goog.array.forEachRight=function(arr,f,_131){
var l=arr.length;
var arr2=goog.isString(arr)?arr.split(""):arr;
for(var i=l-1;i>=0;--i){
if(i in arr2){
f.call(_131,arr2[i],i,arr);
}
}
};
goog.array.filter=goog.array.ARRAY_PROTOTYPE_.filter?function(arr,f,_137){
goog.asserts.assert(arr||goog.isString(arr));
goog.asserts.assertNumber(arr.length);
return goog.array.ARRAY_PROTOTYPE_.filter.call(arr,f,_137);
}:function(arr,f,_13a){
var l=arr.length;
var res=[];
var _13d=0;
var arr2=goog.isString(arr)?arr.split(""):arr;
for(var i=0;i<l;i++){
if(i in arr2){
var val=arr2[i];
if(f.call(_13a,val,i,arr)){
res[_13d++]=val;
}
}
}
return res;
};
goog.array.map=goog.array.ARRAY_PROTOTYPE_.map?function(arr,f,_143){
goog.asserts.assert(arr||goog.isString(arr));
goog.asserts.assertNumber(arr.length);
return goog.array.ARRAY_PROTOTYPE_.map.call(arr,f,_143);
}:function(arr,f,_146){
var l=arr.length;
var res=new Array(l);
var arr2=goog.isString(arr)?arr.split(""):arr;
for(var i=0;i<l;i++){
if(i in arr2){
res[i]=f.call(_146,arr2[i],i,arr);
}
}
return res;
};
goog.array.reduce=function(arr,f,val,_14e){
if(arr.reduce){
if(_14e){
return arr.reduce(goog.bind(f,_14e),val);
}else{
return arr.reduce(f,val);
}
}
var rval=val;
goog.array.forEach(arr,function(val,_151){
rval=f.call(_14e,rval,val,_151,arr);
});
return rval;
};
goog.array.reduceRight=function(arr,f,val,_155){
if(arr.reduceRight){
if(_155){
return arr.reduceRight(goog.bind(f,_155),val);
}else{
return arr.reduceRight(f,val);
}
}
var rval=val;
goog.array.forEachRight(arr,function(val,_158){
rval=f.call(_155,rval,val,_158,arr);
});
return rval;
};
goog.array.some=goog.array.ARRAY_PROTOTYPE_.some?function(arr,f,_15b){
goog.asserts.assert(arr||goog.isString(arr));
goog.asserts.assertNumber(arr.length);
return goog.array.ARRAY_PROTOTYPE_.some.call(arr,f,_15b);
}:function(arr,f,_15e){
var l=arr.length;
var arr2=goog.isString(arr)?arr.split(""):arr;
for(var i=0;i<l;i++){
if(i in arr2&&f.call(_15e,arr2[i],i,arr)){
return true;
}
}
return false;
};
goog.array.every=goog.array.ARRAY_PROTOTYPE_.every?function(arr,f,_164){
goog.asserts.assert(arr||goog.isString(arr));
goog.asserts.assertNumber(arr.length);
return goog.array.ARRAY_PROTOTYPE_.every.call(arr,f,_164);
}:function(arr,f,_167){
var l=arr.length;
var arr2=goog.isString(arr)?arr.split(""):arr;
for(var i=0;i<l;i++){
if(i in arr2&&!f.call(_167,arr2[i],i,arr)){
return false;
}
}
return true;
};
goog.array.find=function(arr,f,_16d){
var i=goog.array.findIndex(arr,f,_16d);
return i<0?null:goog.isString(arr)?arr.charAt(i):arr[i];
};
goog.array.findIndex=function(arr,f,_171){
var l=arr.length;
var arr2=goog.isString(arr)?arr.split(""):arr;
for(var i=0;i<l;i++){
if(i in arr2&&f.call(_171,arr2[i],i,arr)){
return i;
}
}
return -1;
};
goog.array.findRight=function(arr,f,_177){
var i=goog.array.findIndexRight(arr,f,_177);
return i<0?null:goog.isString(arr)?arr.charAt(i):arr[i];
};
goog.array.findIndexRight=function(arr,f,_17b){
var l=arr.length;
var arr2=goog.isString(arr)?arr.split(""):arr;
for(var i=l-1;i>=0;i--){
if(i in arr2&&f.call(_17b,arr2[i],i,arr)){
return i;
}
}
return -1;
};
goog.array.contains=function(arr,obj){
return goog.array.indexOf(arr,obj)>=0;
};
goog.array.isEmpty=function(arr){
return arr.length==0;
};
goog.array.clear=function(arr){
if(!goog.isArray(arr)){
for(var i=arr.length-1;i>=0;i--){
delete arr[i];
}
}
arr.length=0;
};
goog.array.insert=function(arr,obj){
if(!goog.array.contains(arr,obj)){
arr.push(obj);
}
};
goog.array.insertAt=function(arr,obj,_188){
goog.array.splice(arr,_188,0,obj);
};
goog.array.insertArrayAt=function(arr,_18a,_18b){
goog.partial(goog.array.splice,arr,_18b,0).apply(null,_18a);
};
goog.array.insertBefore=function(arr,obj,_18e){
var i;
if(arguments.length==2||(i=goog.array.indexOf(arr,_18e))<0){
arr.push(obj);
}else{
goog.array.insertAt(arr,obj,i);
}
};
goog.array.remove=function(arr,obj){
var i=goog.array.indexOf(arr,obj);
var rv;
if((rv=i>=0)){
goog.array.removeAt(arr,i);
}
return rv;
};
goog.array.removeAt=function(arr,i){
goog.asserts.assert(arr||goog.isString(arr));
goog.asserts.assertNumber(arr.length);
return goog.array.ARRAY_PROTOTYPE_.splice.call(arr,i,1).length==1;
};
goog.array.removeIf=function(arr,f,_198){
var i=goog.array.findIndex(arr,f,_198);
if(i>=0){
goog.array.removeAt(arr,i);
return true;
}
return false;
};
goog.array.concat=function(_19a){
return goog.array.ARRAY_PROTOTYPE_.concat.apply(goog.array.ARRAY_PROTOTYPE_,arguments);
};
goog.array.clone=function(arr){
if(goog.isArray(arr)){
return goog.array.concat((arr));
}else{
var rv=[];
for(var i=0,len=arr.length;i<len;i++){
rv[i]=arr[i];
}
return rv;
}
};
goog.array.toArray=function(_19e){
if(goog.isArray(_19e)){
return goog.array.concat((_19e));
}
return goog.array.clone((_19e));
};
goog.array.extend=function(arr1,_1a0){
for(var i=1;i<arguments.length;i++){
var arr2=arguments[i];
var _1a3;
if(goog.isArray(arr2)||(_1a3=goog.isArrayLike(arr2))&&arr2.hasOwnProperty("callee")){
arr1.push.apply(arr1,arr2);
}else{
if(_1a3){
var len1=arr1.length;
var len2=arr2.length;
for(var j=0;j<len2;j++){
arr1[len1+j]=arr2[j];
}
}else{
arr1.push(arr2);
}
}
}
};
goog.array.splice=function(arr,_1a8,_1a9,_1aa){
goog.asserts.assert(arr||goog.isString(arr));
goog.asserts.assertNumber(arr.length);
return goog.array.ARRAY_PROTOTYPE_.splice.apply(arr,goog.array.slice(arguments,1));
};
goog.array.slice=function(arr,_1ac,_1ad){
goog.asserts.assert(arr||goog.isString(arr));
goog.asserts.assertNumber(arr.length);
if(arguments.length<=2){
return goog.array.ARRAY_PROTOTYPE_.slice.call(arr,_1ac);
}else{
return goog.array.ARRAY_PROTOTYPE_.slice.call(arr,_1ac,_1ad);
}
};
goog.array.removeDuplicates=function(arr,_1af){
var rv=_1af||arr;
var seen={},cursorInsert=0,cursorRead=0;
while(cursorRead<arr.length){
var _1b2=arr[cursorRead++];
var uid=goog.isObject(_1b2)?goog.getUid(_1b2):_1b2;
if(!Object.prototype.hasOwnProperty.call(seen,uid)){
seen[uid]=true;
rv[cursorInsert++]=_1b2;
}
}
rv.length=cursorInsert;
};
goog.array.binarySearch=function(arr,_1b5,_1b6){
return goog.array.binarySearch_(arr,_1b6||goog.array.defaultCompare,false,_1b5);
};
goog.array.binarySelect=function(arr,_1b8,_1b9){
return goog.array.binarySearch_(arr,_1b8,true,undefined,_1b9);
};
goog.array.binarySearch_=function(arr,_1bb,_1bc,_1bd,_1be){
var left=0;
var _1c0=arr.length;
var _1c1;
while(left<_1c0){
var _1c2=(left+_1c0)>>1;
var _1c3;
if(_1bc){
_1c3=_1bb.call(_1be,arr[_1c2],_1c2,arr);
}else{
_1c3=_1bb(_1bd,arr[_1c2]);
}
if(_1c3>0){
left=_1c2+1;
}else{
_1c0=_1c2;
_1c1=!_1c3;
}
}
return _1c1?left:~left;
};
goog.array.sort=function(arr,_1c5){
goog.asserts.assert(arr||goog.isString(arr));
goog.asserts.assertNumber(arr.length);
goog.array.ARRAY_PROTOTYPE_.sort.call(arr,_1c5||goog.array.defaultCompare);
};
goog.array.stableSort=function(arr,_1c7){
for(var i=0;i<arr.length;i++){
arr[i]={index:i,value:arr[i]};
}
var _1c9=_1c7||goog.array.defaultCompare;
function stableCompareFn(obj1,obj2){
return _1c9(obj1.value,obj2.value)||obj1.index-obj2.index;
}
goog.array.sort(arr,stableCompareFn);
for(var i=0;i<arr.length;i++){
arr[i]=arr[i].value;
}
};
goog.array.sortObjectsByKey=function(arr,key,_1ce){
var _1cf=_1ce||goog.array.defaultCompare;
goog.array.sort(arr,function(a,b){
return _1cf(a[key],b[key]);
});
};
goog.array.equals=function(arr1,arr2,_1d4){
if(!goog.isArrayLike(arr1)||!goog.isArrayLike(arr2)||arr1.length!=arr2.length){
return false;
}
var l=arr1.length;
var _1d6=_1d4||goog.array.defaultCompareEquality;
for(var i=0;i<l;i++){
if(!_1d6(arr1[i],arr2[i])){
return false;
}
}
return true;
};
goog.array.compare=function(arr1,arr2,_1da){
return goog.array.equals(arr1,arr2,_1da);
};
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(_1df,_1e0,_1e1){
var _1e2=goog.array.binarySearch(_1df,_1e0,_1e1);
if(_1e2<0){
goog.array.insertAt(_1df,_1e0,-(_1e2+1));
return true;
}
return false;
};
goog.array.binaryRemove=function(_1e3,_1e4,_1e5){
var _1e6=goog.array.binarySearch(_1e3,_1e4,_1e5);
return (_1e6>=0)?goog.array.removeAt(_1e3,_1e6):false;
};
goog.array.bucket=function(_1e7,_1e8){
var _1e9={};
for(var i=0;i<_1e7.length;i++){
var _1eb=_1e7[i];
var key=_1e8(_1eb,i,_1e7);
if(goog.isDef(key)){
var _1ed=_1e9[key]||(_1e9[key]=[]);
_1ed.push(_1eb);
}
}
return _1e9;
};
goog.array.repeat=function(_1ee,n){
var _1f0=[];
for(var i=0;i<n;i++){
_1f0[i]=_1ee;
}
return _1f0;
};
goog.array.flatten=function(_1f2){
var _1f3=[];
for(var i=0;i<arguments.length;i++){
var _1f5=arguments[i];
if(goog.isArray(_1f5)){
_1f3.push.apply(_1f3,goog.array.flatten.apply(null,_1f5));
}else{
_1f3.push(_1f5);
}
}
return _1f3;
};
goog.array.rotate=function(_1f6,n){
goog.asserts.assert(_1f6||goog.isString(_1f6));
goog.asserts.assertNumber(_1f6.length);
if(_1f6.length){
n%=_1f6.length;
if(n>0){
goog.array.ARRAY_PROTOTYPE_.unshift.apply(_1f6,_1f6.splice(-n,n));
}else{
if(n<0){
goog.array.ARRAY_PROTOTYPE_.push.apply(_1f6,_1f6.splice(0,-n));
}
}
}
return _1f6;
};
goog.array.zip=function(_1f8){
if(!arguments.length){
return [];
}
var _1f9=[];
for(var i=0;true;i++){
var _1fb=[];
for(var j=0;j<arguments.length;j++){
var arr=arguments[j];
if(i>=arr.length){
return _1f9;
}
_1fb.push(arr[i]);
}
_1f9.push(_1fb);
}
};
goog.provide("goog.dom.TagName");
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",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.provide("goog.dom.classes");
goog.require("goog.array");
goog.dom.classes.set=function(_1fe,_1ff){
_1fe.className=_1ff;
};
goog.dom.classes.get=function(_200){
var _201=_200.className;
return _201&&typeof _201.split=="function"?_201.split(/\s+/):[];
};
goog.dom.classes.add=function(_202,_203){
var _204=goog.dom.classes.get(_202);
var args=goog.array.slice(arguments,1);
var b=goog.dom.classes.add_(_204,args);
_202.className=_204.join(" ");
return b;
};
goog.dom.classes.remove=function(_207,_208){
var _209=goog.dom.classes.get(_207);
var args=goog.array.slice(arguments,1);
var b=goog.dom.classes.remove_(_209,args);
_207.className=_209.join(" ");
return b;
};
goog.dom.classes.add_=function(_20c,args){
var rv=0;
for(var i=0;i<args.length;i++){
if(!goog.array.contains(_20c,args[i])){
_20c.push(args[i]);
rv++;
}
}
return rv==args.length;
};
goog.dom.classes.remove_=function(_210,args){
var rv=0;
for(var i=0;i<_210.length;i++){
if(goog.array.contains(args,_210[i])){
goog.array.splice(_210,i--,1);
rv++;
}
}
return rv==args.length;
};
goog.dom.classes.swap=function(_214,_215,_216){
var _217=goog.dom.classes.get(_214);
var _218=false;
for(var i=0;i<_217.length;i++){
if(_217[i]==_215){
goog.array.splice(_217,i--,1);
_218=true;
}
}
if(_218){
_217.push(_216);
_214.className=_217.join(" ");
}
return _218;
};
goog.dom.classes.addRemove=function(_21a,_21b,_21c){
var _21d=goog.dom.classes.get(_21a);
if(goog.isString(_21b)){
goog.array.remove(_21d,_21b);
}else{
if(goog.isArray(_21b)){
goog.dom.classes.remove_(_21d,_21b);
}
}
if(goog.isString(_21c)&&!goog.array.contains(_21d,_21c)){
_21d.push(_21c);
}else{
if(goog.isArray(_21c)){
goog.dom.classes.add_(_21d,_21c);
}
}
_21a.className=_21d.join(" ");
};
goog.dom.classes.has=function(_21e,_21f){
return goog.array.contains(goog.dom.classes.get(_21e),_21f);
};
goog.dom.classes.enable=function(_220,_221,_222){
if(_222){
goog.dom.classes.add(_220,_221);
}else{
goog.dom.classes.remove(_220,_221);
}
};
goog.dom.classes.toggle=function(_223,_224){
var add=!goog.dom.classes.has(_223,_224);
goog.dom.classes.enable(_223,_224,add);
return add;
};
goog.provide("goog.math.Coordinate");
goog.math.Coordinate=function(_226,_227){
this.x=goog.isDef(_226)?_226:0;
this.y=goog.isDef(_227)?_227: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 dx=a.x-b.x;
var dy=a.y-b.y;
return Math.sqrt(dx*dx+dy*dy);
};
goog.math.Coordinate.squaredDistance=function(a,b){
var dx=a.x-b.x;
var dy=a.y-b.y;
return dx*dx+dy*dy;
};
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.provide("goog.math.Size");
goog.math.Size=function(_236,_237){
this.width=_236;
this.height=_237;
};
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.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(_23a){
return this.width<=_23a.width&&this.height<=_23a.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(s){
this.width*=s;
this.height*=s;
return this;
};
goog.math.Size.prototype.scaleToFit=function(_23c){
var s=this.aspectRatio()>_23c.aspectRatio()?_23c.width/this.width:_23c.height/this.height;
return this.scale(s);
};
goog.provide("goog.object");
goog.object.forEach=function(obj,f,_240){
for(var key in obj){
f.call(_240,obj[key],key,obj);
}
};
goog.object.filter=function(obj,f,_244){
var res={};
for(var key in obj){
if(f.call(_244,obj[key],key,obj)){
res[key]=obj[key];
}
}
return res;
};
goog.object.map=function(obj,f,_249){
var res={};
for(var key in obj){
res[key]=f.call(_249,obj[key],key,obj);
}
return res;
};
goog.object.some=function(obj,f,_24e){
for(var key in obj){
if(f.call(_24e,obj[key],key,obj)){
return true;
}
}
return false;
};
goog.object.every=function(obj,f,_252){
for(var key in obj){
if(!f.call(_252,obj[key],key,obj)){
return false;
}
}
return true;
};
goog.object.getCount=function(obj){
var rv=0;
for(var key in obj){
rv++;
}
return rv;
};
goog.object.getAnyKey=function(obj){
for(var key in obj){
return key;
}
};
goog.object.getAnyValue=function(obj){
for(var key in obj){
return obj[key];
}
};
goog.object.contains=function(obj,val){
return goog.object.containsValue(obj,val);
};
goog.object.getValues=function(obj){
var res=[];
var i=0;
for(var key in obj){
res[i++]=obj[key];
}
return res;
};
goog.object.getKeys=function(obj){
var res=[];
var i=0;
for(var key in obj){
res[i++]=key;
}
return res;
};
goog.object.containsKey=function(obj,key){
return key in obj;
};
goog.object.containsValue=function(obj,val){
for(var key in obj){
if(obj[key]==val){
return true;
}
}
return false;
};
goog.object.findKey=function(obj,f,_26c){
for(var key in obj){
if(f.call(_26c,obj[key],key,obj)){
return key;
}
}
return undefined;
};
goog.object.findValue=function(obj,f,_270){
var key=goog.object.findKey(obj,f,_270);
return key&&obj[key];
};
goog.object.isEmpty=function(obj){
for(var key in obj){
return false;
}
return true;
};
goog.object.clear=function(obj){
var keys=goog.object.getKeys(obj);
for(var i=keys.length-1;i>=0;i--){
goog.object.remove(obj,keys[i]);
}
};
goog.object.remove=function(obj,key){
var rv;
if((rv=key in obj)){
delete obj[key];
}
return rv;
};
goog.object.add=function(obj,key,val){
if(key in obj){
throw Error("The object already contains the key \""+key+"\"");
}
goog.object.set(obj,key,val);
};
goog.object.get=function(obj,key,_27f){
if(key in obj){
return obj[key];
}
return _27f;
};
goog.object.set=function(obj,key,_282){
obj[key]=_282;
};
goog.object.setIfUndefined=function(obj,key,_285){
return key in obj?obj[key]:(obj[key]=_285);
};
goog.object.clone=function(obj){
var res={};
for(var key in obj){
res[key]=obj[key];
}
return res;
};
goog.object.transpose=function(obj){
var _28a={};
for(var key in obj){
_28a[obj[key]]=key;
}
return _28a;
};
goog.object.PROTOTYPE_FIELDS_=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"];
goog.object.extend=function(_28c,_28d){
var key,source;
for(var i=1;i<arguments.length;i++){
source=arguments[i];
for(key in source){
_28c[key]=source[key];
}
for(var j=0;j<goog.object.PROTOTYPE_FIELDS_.length;j++){
key=goog.object.PROTOTYPE_FIELDS_[j];
if(Object.prototype.hasOwnProperty.call(source,key)){
_28c[key]=source[key];
}
}
}
};
goog.object.create=function(_291){
var _292=arguments.length;
if(_292==1&&goog.isArray(arguments[0])){
return goog.object.create.apply(null,arguments[0]);
}
if(_292%2){
throw Error("Uneven number of arguments");
}
var rv={};
for(var i=0;i<_292;i+=2){
rv[arguments[i]]=arguments[i+1];
}
return rv;
};
goog.object.createSet=function(_295){
var _296=arguments.length;
if(_296==1&&goog.isArray(arguments[0])){
return goog.object.createSet.apply(null,arguments[0]);
}
var rv={};
for(var i=0;i<_296;i++){
rv[arguments[i]]=true;
}
return rv;
};
goog.provide("goog.userAgent");
goog.require("goog.string");
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 ua;
if(!goog.userAgent.BROWSER_KNOWN_&&(ua=goog.userAgent.getUserAgentString())){
var _29a=goog.userAgent.getNavigator();
goog.userAgent.detectedOpera_=ua.indexOf("Opera")==0;
goog.userAgent.detectedIe_=!goog.userAgent.detectedOpera_&&ua.indexOf("MSIE")!=-1;
goog.userAgent.detectedWebkit_=!goog.userAgent.detectedOpera_&&ua.indexOf("WebKit")!=-1;
goog.userAgent.detectedMobile_=goog.userAgent.detectedWebkit_&&ua.indexOf("Mobile")!=-1;
goog.userAgent.detectedGecko_=!goog.userAgent.detectedOpera_&&!goog.userAgent.detectedWebkit_&&_29a.product=="Gecko";
}
};
if(!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 _29b=goog.userAgent.getNavigator();
return _29b&&_29b.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");
};
if(!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 _29c="",re;
if(goog.userAgent.OPERA&&goog.global["opera"]){
var _29d=goog.global["opera"].version;
_29c=typeof _29d=="function"?_29d():_29d;
}else{
if(goog.userAgent.GECKO){
re=/rv\:([^\);]+)(\)|;)/;
}else{
if(goog.userAgent.IE){
re=/MSIE\s+([^\);]+)(\)|;)/;
}else{
if(goog.userAgent.WEBKIT){
re=/WebKit\/(\S+)/;
}
}
}
if(re){
var arr=re.exec(goog.userAgent.getUserAgentString());
_29c=arr?arr[1]:"";
}
}
return _29c;
};
goog.userAgent.VERSION=goog.userAgent.determineVersion_();
goog.userAgent.compare=function(v1,v2){
return goog.string.compareVersions(v1,v2);
};
goog.userAgent.isVersionCache_={};
goog.userAgent.isVersion=function(_2a1){
return goog.userAgent.isVersionCache_[_2a1]||(goog.userAgent.isVersionCache_[_2a1]=goog.string.compareVersions(goog.userAgent.VERSION,_2a1)>=0);
};
goog.provide("goog.dom");
goog.provide("goog.dom.DomHelper");
goog.provide("goog.dom.NodeType");
goog.require("goog.array");
goog.require("goog.dom.TagName");
goog.require("goog.dom.classes");
goog.require("goog.math.Coordinate");
goog.require("goog.math.Size");
goog.require("goog.object");
goog.require("goog.string");
goog.require("goog.userAgent");
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(_2a2){
return _2a2?new goog.dom.DomHelper(goog.dom.getOwnerDocument(_2a2)):(goog.dom.defaultDomHelper_||(goog.dom.defaultDomHelper_=new goog.dom.DomHelper()));
};
goog.dom.defaultDomHelper_;
goog.dom.getDocument=function(){
return document;
};
goog.dom.getElement=function(_2a3){
return goog.isString(_2a3)?document.getElementById(_2a3):_2a3;
};
goog.dom.$=goog.dom.getElement;
goog.dom.getElementsByTagNameAndClass=function(_2a4,_2a5,_2a6){
return goog.dom.getElementsByTagNameAndClass_(document,_2a4,_2a5,_2a6);
};
goog.dom.getElementsByClass=function(_2a7,_2a8){
var _2a9=_2a8||document;
if(goog.dom.canUseQuerySelector_(_2a9)){
return _2a9.querySelectorAll("."+_2a7);
}else{
if(_2a9.getElementsByClassName){
return _2a9.getElementsByClassName(_2a7);
}
}
return goog.dom.getElementsByTagNameAndClass_(document,"*",_2a7,_2a8);
};
goog.dom.getElementByClass=function(_2aa,_2ab){
var _2ac=_2ab||document;
var _2ad=null;
if(goog.dom.canUseQuerySelector_(_2ac)){
_2ad=_2ac.querySelector("."+_2aa);
}else{
_2ad=goog.dom.getElementsByClass(_2aa,_2ab)[0];
}
return _2ad||null;
};
goog.dom.canUseQuerySelector_=function(_2ae){
return _2ae.querySelectorAll&&_2ae.querySelector&&(!goog.userAgent.WEBKIT||goog.dom.isCss1CompatMode_(document)||goog.userAgent.isVersion("528"));
};
goog.dom.getElementsByTagNameAndClass_=function(doc,_2b0,_2b1,_2b2){
var _2b3=_2b2||doc;
var _2b4=(_2b0&&_2b0!="*")?_2b0.toUpperCase():"";
if(goog.dom.canUseQuerySelector_(_2b3)&&(_2b4||_2b1)){
var _2b5=_2b4+(_2b1?"."+_2b1:"");
return _2b3.querySelectorAll(_2b5);
}
if(_2b1&&_2b3.getElementsByClassName){
var els=_2b3.getElementsByClassName(_2b1);
if(_2b4){
var _2b7={};
var len=0;
for(var i=0,el;el=els[i];i++){
if(_2b4==el.nodeName){
_2b7[len++]=el;
}
}
_2b7.length=len;
return _2b7;
}else{
return els;
}
}
var els=_2b3.getElementsByTagName(_2b4||"*");
if(_2b1){
var _2b7={};
var len=0;
for(var i=0,el;el=els[i];i++){
var _2ba=el.className;
if(typeof _2ba.split=="function"&&goog.array.contains(_2ba.split(/\s+/),_2b1)){
_2b7[len++]=el;
}
}
_2b7.length=len;
return _2b7;
}else{
return els;
}
};
goog.dom.$$=goog.dom.getElementsByTagNameAndClass;
goog.dom.setProperties=function(_2bb,_2bc){
goog.object.forEach(_2bc,function(val,key){
if(key=="style"){
_2bb.style.cssText=val;
}else{
if(key=="class"){
_2bb.className=val;
}else{
if(key=="for"){
_2bb.htmlFor=val;
}else{
if(key in goog.dom.DIRECT_ATTRIBUTE_MAP_){
_2bb.setAttribute(goog.dom.DIRECT_ATTRIBUTE_MAP_[key],val);
}else{
_2bb[key]=val;
}
}
}
}
});
};
goog.dom.DIRECT_ATTRIBUTE_MAP_={"cellpadding":"cellPadding","cellspacing":"cellSpacing","colspan":"colSpan","rowspan":"rowSpan","valign":"vAlign","height":"height","width":"width","usemap":"useMap","frameborder":"frameBorder","type":"type"};
goog.dom.getViewportSize=function(_2bf){
return goog.dom.getViewportSize_(_2bf||window);
};
goog.dom.getViewportSize_=function(win){
var doc=win.document;
if(goog.userAgent.WEBKIT&&!goog.userAgent.isVersion("500")&&!goog.userAgent.MOBILE){
if(typeof win.innerHeight=="undefined"){
win=window;
}
var _2c2=win.innerHeight;
var _2c3=win.document.documentElement.scrollHeight;
if(win==win.top){
if(_2c3<_2c2){
_2c2-=15;
}
}
return new goog.math.Size(win.innerWidth,_2c2);
}
var _2c4=goog.dom.isCss1CompatMode_(doc);
if(goog.userAgent.OPERA&&!goog.userAgent.isVersion("9.50")){
_2c4=false;
}
var el=_2c4?doc.documentElement:doc.body;
return new goog.math.Size(el.clientWidth,el.clientHeight);
};
goog.dom.getDocumentHeight=function(){
return goog.dom.getDocumentHeight_(window);
};
goog.dom.getDocumentHeight_=function(win){
var doc=win.document;
var _2c8=0;
if(doc){
var vh=goog.dom.getViewportSize_(win).height;
var body=doc.body;
var _2cb=doc.documentElement;
if(goog.dom.isCss1CompatMode_(doc)&&_2cb.scrollHeight){
_2c8=_2cb.scrollHeight!=vh?_2cb.scrollHeight:_2cb.offsetHeight;
}else{
var sh=_2cb.scrollHeight;
var oh=_2cb.offsetHeight;
if(_2cb.clientHeight!=oh){
sh=body.scrollHeight;
oh=body.offsetHeight;
}
if(sh>vh){
_2c8=sh>oh?sh:oh;
}else{
_2c8=sh<oh?sh:oh;
}
}
}
return _2c8;
};
goog.dom.getPageScroll=function(_2ce){
var win=_2ce||goog.global||window;
return goog.dom.getDomHelper(win.document).getDocumentScroll();
};
goog.dom.getDocumentScroll=function(){
return goog.dom.getDocumentScroll_(document);
};
goog.dom.getDocumentScroll_=function(doc){
var el=goog.dom.getDocumentScrollElement_(doc);
return new goog.math.Coordinate(el.scrollLeft,el.scrollTop);
};
goog.dom.getDocumentScrollElement=function(){
return goog.dom.getDocumentScrollElement_(document);
};
goog.dom.getDocumentScrollElement_=function(doc){
return !goog.userAgent.WEBKIT&&goog.dom.isCss1CompatMode_(doc)?doc.documentElement:doc.body;
};
goog.dom.getWindow=function(_2d3){
return _2d3?goog.dom.getWindow_(_2d3):window;
};
goog.dom.getWindow_=function(doc){
return doc.parentWindow||doc.defaultView;
};
goog.dom.createDom=function(_2d5,_2d6,_2d7){
return goog.dom.createDom_(document,arguments);
};
goog.dom.createDom_=function(doc,args){
var _2da=args[0];
var _2db=args[1];
if(goog.userAgent.IE&&_2db&&(_2db.name||_2db.type)){
var _2dc=["<",_2da];
if(_2db.name){
_2dc.push(" name=\"",goog.string.htmlEscape(_2db.name),"\"");
}
if(_2db.type){
_2dc.push(" type=\"",goog.string.htmlEscape(_2db.type),"\"");
var _2dd={};
goog.object.extend(_2dd,_2db);
_2db=_2dd;
delete _2db.type;
}
_2dc.push(">");
_2da=_2dc.join("");
}
var _2de=doc.createElement(_2da);
if(_2db){
if(goog.isString(_2db)){
_2de.className=_2db;
}else{
if(goog.isArray(_2db)){
goog.dom.classes.add.apply(null,[_2de].concat(_2db));
}else{
goog.dom.setProperties(_2de,_2db);
}
}
}
if(args.length>2){
goog.dom.append_(doc,_2de,args,2);
}
return _2de;
};
goog.dom.append_=function(doc,_2e0,args,_2e2){
function childHandler(_2e3){
if(_2e3){
_2e0.appendChild(goog.isString(_2e3)?doc.createTextNode(_2e3):_2e3);
}
}
for(var i=_2e2;i<args.length;i++){
var arg=args[i];
if(goog.isArrayLike(arg)&&!goog.dom.isNodeLike(arg)){
goog.array.forEach(goog.dom.isNodeList(arg)?goog.array.clone(arg):arg,childHandler);
}else{
childHandler(arg);
}
}
};
goog.dom.$dom=goog.dom.createDom;
goog.dom.createElement=function(name){
return document.createElement(name);
};
goog.dom.createTextNode=function(_2e7){
return document.createTextNode(_2e7);
};
goog.dom.createTable=function(rows,_2e9,_2ea){
return goog.dom.createTable_(document,rows,_2e9,!!_2ea);
};
goog.dom.createTable_=function(doc,rows,_2ed,_2ee){
var _2ef=["<tr>"];
for(var i=0;i<_2ed;i++){
_2ef.push(_2ee?"<td>&nbsp;</td>":"<td></td>");
}
_2ef.push("</tr>");
_2ef=_2ef.join("");
var _2f1=["<table>"];
for(i=0;i<rows;i++){
_2f1.push(_2ef);
}
_2f1.push("</table>");
var elem=doc.createElement(goog.dom.TagName.DIV);
elem.innerHTML=_2f1.join("");
return (elem.removeChild(elem.firstChild));
};
goog.dom.htmlToDocumentFragment=function(_2f3){
return goog.dom.htmlToDocumentFragment_(document,_2f3);
};
goog.dom.htmlToDocumentFragment_=function(doc,_2f5){
var _2f6=doc.createElement("div");
_2f6.innerHTML=_2f5;
if(_2f6.childNodes.length==1){
return (_2f6.removeChild(_2f6.firstChild));
}else{
var _2f7=doc.createDocumentFragment();
while(_2f6.firstChild){
_2f7.appendChild(_2f6.firstChild);
}
return _2f7;
}
};
goog.dom.getCompatMode=function(){
return goog.dom.isCss1CompatMode()?"CSS1Compat":"BackCompat";
};
goog.dom.isCss1CompatMode=function(){
return goog.dom.isCss1CompatMode_(document);
};
goog.dom.isCss1CompatMode_=function(doc){
if(goog.dom.COMPAT_MODE_KNOWN_){
return goog.dom.ASSUME_STANDARDS_MODE;
}
return doc.compatMode=="CSS1Compat";
};
goog.dom.canHaveChildren=function(node){
if(node.nodeType!=goog.dom.NodeType.ELEMENT){
return false;
}
if("canHaveChildren" in node){
return node.canHaveChildren;
}
switch(node.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(_2fa,_2fb){
_2fa.appendChild(_2fb);
};
goog.dom.append=function(_2fc,_2fd){
goog.dom.append_(goog.dom.getOwnerDocument(_2fc),_2fc,arguments,1);
};
goog.dom.removeChildren=function(node){
var _2ff;
while((_2ff=node.firstChild)){
node.removeChild(_2ff);
}
};
goog.dom.insertSiblingBefore=function(_300,_301){
if(_301.parentNode){
_301.parentNode.insertBefore(_300,_301);
}
};
goog.dom.insertSiblingAfter=function(_302,_303){
if(_303.parentNode){
_303.parentNode.insertBefore(_302,_303.nextSibling);
}
};
goog.dom.removeNode=function(node){
return node&&node.parentNode?node.parentNode.removeChild(node):null;
};
goog.dom.replaceNode=function(_305,_306){
var _307=_306.parentNode;
if(_307){
_307.replaceChild(_305,_306);
}
};
goog.dom.flattenElement=function(_308){
var _309,parent=_308.parentNode;
if(parent&&parent.nodeType!=goog.dom.NodeType.DOCUMENT_FRAGMENT){
if(_308.removeNode){
return (_308.removeNode(false));
}else{
while((_309=_308.firstChild)){
parent.insertBefore(_309,_308);
}
return (goog.dom.removeNode(_308));
}
}
};
goog.dom.getFirstElementChild=function(node){
return goog.dom.getNextElementNode_(node.firstChild,true);
};
goog.dom.getLastElementChild=function(node){
return goog.dom.getNextElementNode_(node.lastChild,false);
};
goog.dom.getNextElementSibling=function(node){
return goog.dom.getNextElementNode_(node.nextSibling,true);
};
goog.dom.getPreviousElementSibling=function(node){
return goog.dom.getNextElementNode_(node.previousSibling,false);
};
goog.dom.getNextElementNode_=function(node,_30f){
while(node&&node.nodeType!=goog.dom.NodeType.ELEMENT){
node=_30f?node.nextSibling:node.previousSibling;
}
return (node);
};
goog.dom.getNextNode=function(node){
if(!node){
return null;
}
if(node.firstChild){
return node.firstChild;
}
while(node&&!node.nextSibling){
node=node.parentNode;
}
return node?node.nextSibling:null;
};
goog.dom.getPreviousNode=function(node){
if(!node){
return null;
}
if(!node.previousSibling){
return node.parentNode;
}
node=node.previousSibling;
while(node&&node.lastChild){
node=node.lastChild;
}
return node;
};
goog.dom.isNodeLike=function(obj){
return goog.isObject(obj)&&obj.nodeType>0;
};
goog.dom.contains=function(_313,_314){
if(_313.contains&&_314.nodeType==goog.dom.NodeType.ELEMENT){
return _313==_314||_313.contains(_314);
}
if(typeof _313.compareDocumentPosition!="undefined"){
return _313==_314||Boolean(_313.compareDocumentPosition(_314)&16);
}
while(_314&&_313!=_314){
_314=_314.parentNode;
}
return _314==_313;
};
goog.dom.compareNodeOrder=function(_315,_316){
if(_315==_316){
return 0;
}
if(_315.compareDocumentPosition){
return _315.compareDocumentPosition(_316)&2?1:-1;
}
if("sourceIndex" in _315||(_315.parentNode&&"sourceIndex" in _315.parentNode)){
var _317=_315.nodeType==goog.dom.NodeType.ELEMENT;
var _318=_316.nodeType==goog.dom.NodeType.ELEMENT;
if(_317&&_318){
return _315.sourceIndex-_316.sourceIndex;
}else{
var _319=_315.parentNode;
var _31a=_316.parentNode;
if(_319==_31a){
return goog.dom.compareSiblingOrder_(_315,_316);
}
if(!_317&&goog.dom.contains(_319,_316)){
return -1*goog.dom.compareParentsDescendantNodeIe_(_315,_316);
}
if(!_318&&goog.dom.contains(_31a,_315)){
return goog.dom.compareParentsDescendantNodeIe_(_316,_315);
}
return (_317?_315.sourceIndex:_319.sourceIndex)-(_318?_316.sourceIndex:_31a.sourceIndex);
}
}
var doc=goog.dom.getOwnerDocument(_315);
var _31c,range2;
_31c=doc.createRange();
_31c.selectNode(_315);
_31c.collapse(true);
range2=doc.createRange();
range2.selectNode(_316);
range2.collapse(true);
return _31c.compareBoundaryPoints(goog.global["Range"].START_TO_END,range2);
};
goog.dom.compareParentsDescendantNodeIe_=function(_31d,node){
var _31f=_31d.parentNode;
if(_31f==node){
return -1;
}
var _320=node;
while(_320.parentNode!=_31f){
_320=_320.parentNode;
}
return goog.dom.compareSiblingOrder_(_320,_31d);
};
goog.dom.compareSiblingOrder_=function(_321,_322){
var s=_322;
while((s=s.previousSibling)){
if(s==_321){
return -1;
}
}
return 1;
};
goog.dom.findCommonAncestor=function(_324){
var i,count=arguments.length;
if(!count){
return null;
}else{
if(count==1){
return arguments[0];
}
}
var _326=[];
var _327=Infinity;
for(i=0;i<count;i++){
var _328=[];
var node=arguments[i];
while(node){
_328.unshift(node);
node=node.parentNode;
}
_326.push(_328);
_327=Math.min(_327,_328.length);
}
var _32a=null;
for(i=0;i<_327;i++){
var _32b=_326[0][i];
for(var j=1;j<count;j++){
if(_32b!=_326[j][i]){
return _32a;
}
}
_32a=_32b;
}
return _32a;
};
goog.dom.getOwnerDocument=function(node){
return (node.nodeType==goog.dom.NodeType.DOCUMENT?node:node.ownerDocument||node.document);
};
goog.dom.getFrameContentDocument=function(_32e){
var doc;
if(goog.userAgent.WEBKIT){
doc=(_32e.document||_32e.contentWindow.document);
}else{
doc=(_32e.contentDocument||_32e.contentWindow.document);
}
return doc;
};
goog.dom.getFrameContentWindow=function(_330){
return _330.contentWindow||goog.dom.getWindow_(goog.dom.getFrameContentDocument(_330));
};
goog.dom.setTextContent=function(_331,text){
if("textContent" in _331){
_331.textContent=text;
}else{
if(_331.firstChild&&_331.firstChild.nodeType==goog.dom.NodeType.TEXT){
while(_331.lastChild!=_331.firstChild){
_331.removeChild(_331.lastChild);
}
_331.firstChild.data=text;
}else{
goog.dom.removeChildren(_331);
var doc=goog.dom.getOwnerDocument(_331);
_331.appendChild(doc.createTextNode(text));
}
}
};
goog.dom.getOuterHtml=function(_334){
if("outerHTML" in _334){
return _334.outerHTML;
}else{
var doc=goog.dom.getOwnerDocument(_334);
var div=doc.createElement("div");
div.appendChild(_334.cloneNode(true));
return div.innerHTML;
}
};
goog.dom.findNode=function(root,p){
var rv=[];
var _33a=goog.dom.findNodes_(root,p,rv,true);
return _33a?rv[0]:undefined;
};
goog.dom.findNodes=function(root,p){
var rv=[];
goog.dom.findNodes_(root,p,rv,false);
return rv;
};
goog.dom.findNodes_=function(root,p,rv,_341){
if(root!=null){
for(var i=0,child;child=root.childNodes[i];i++){
if(p(child)){
rv.push(child);
if(_341){
return true;
}
}
if(goog.dom.findNodes_(child,p,rv,_341)){
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(_343){
var _344=_343.getAttributeNode("tabindex");
if(_344&&_344.specified){
var _345=_343.tabIndex;
return goog.isNumber(_345)&&_345>=0;
}
return false;
};
goog.dom.setFocusableTabIndex=function(_346,_347){
if(_347){
_346.tabIndex=0;
}else{
_346.removeAttribute("tabIndex");
}
};
goog.dom.getTextContent=function(node){
var _349;
if(goog.userAgent.IE&&("innerText" in node)){
_349=goog.string.canonicalizeNewlines(node.innerText);
}else{
var buf=[];
goog.dom.getTextContent_(node,buf,true);
_349=buf.join("");
}
_349=_349.replace(/\xAD/g,"");
_349=_349.replace(/ +/g," ");
if(_349!=" "){
_349=_349.replace(/^\s*/,"");
}
return _349;
};
goog.dom.getRawTextContent=function(node){
var buf=[];
goog.dom.getTextContent_(node,buf,false);
return buf.join("");
};
goog.dom.getTextContent_=function(node,buf,_34f){
if(node.nodeName in goog.dom.TAGS_TO_IGNORE_){
}else{
if(node.nodeType==goog.dom.NodeType.TEXT){
if(_34f){
buf.push(String(node.nodeValue).replace(/(\r\n|\r|\n)/g,""));
}else{
buf.push(node.nodeValue);
}
}else{
if(node.nodeName in goog.dom.PREDEFINED_TAG_VALUES_){
buf.push(goog.dom.PREDEFINED_TAG_VALUES_[node.nodeName]);
}else{
var _350=node.firstChild;
while(_350){
goog.dom.getTextContent_(_350,buf,_34f);
_350=_350.nextSibling;
}
}
}
}
};
goog.dom.getNodeTextLength=function(node){
return goog.dom.getTextContent(node).length;
};
goog.dom.getNodeTextOffset=function(node,_353){
var root=_353||goog.dom.getOwnerDocument(node).body;
var buf=[];
while(node&&node!=root){
var cur=node;
while((cur=cur.previousSibling)){
buf.unshift(goog.dom.getTextContent(cur));
}
node=node.parentNode;
}
return goog.string.trimLeft(buf.join("")).replace(/ +/g," ").length;
};
goog.dom.getNodeAtOffset=function(_357,_358,_359){
var _35a=[_357],pos=0,cur;
while(_35a.length>0&&pos<_358){
cur=_35a.pop();
if(cur.nodeName in goog.dom.TAGS_TO_IGNORE_){
}else{
if(cur.nodeType==goog.dom.NodeType.TEXT){
var text=cur.nodeValue.replace(/(\r\n|\r|\n)/g,"").replace(/ +/g," ");
pos+=text.length;
}else{
if(cur.nodeName in goog.dom.PREDEFINED_TAG_VALUES_){
pos+=goog.dom.PREDEFINED_TAG_VALUES_[cur.nodeName].length;
}else{
for(var i=cur.childNodes.length-1;i>=0;i--){
_35a.push(cur.childNodes[i]);
}
}
}
}
}
if(goog.isObject(_359)){
_359.remainder=cur?cur.nodeValue.length+_358-pos-1:0;
_359.node=cur;
}
return cur;
};
goog.dom.isNodeList=function(val){
if(val&&typeof val.length=="number"){
if(goog.isObject(val)){
return typeof val.item=="function"||typeof val.item=="string";
}else{
if(goog.isFunction(val)){
return typeof val.item=="function";
}
}
}
return false;
};
goog.dom.getAncestorByTagNameAndClass=function(_35e,_35f,_360){
var _361=_35f?_35f.toUpperCase():null;
return goog.dom.getAncestor(_35e,function(node){
return (!_361||node.nodeName==_361)&&(!_360||goog.dom.classes.has(node,_360));
},true);
};
goog.dom.getAncestor=function(_363,_364,_365,_366){
if(!_365){
_363=_363.parentNode;
}
var _367=_366==null;
var _368=0;
while(_363&&(_367||_368<=_366)){
if(_364(_363)){
return _363;
}
_363=_363.parentNode;
_368++;
}
return null;
};
goog.dom.DomHelper=function(_369){
this.document_=_369||goog.global.document||document;
};
goog.dom.DomHelper.prototype.getDomHelper=goog.dom.getDomHelper;
goog.dom.DomHelper.prototype.setDocument=function(_36a){
this.document_=_36a;
};
goog.dom.DomHelper.prototype.getDocument=function(){
return this.document_;
};
goog.dom.DomHelper.prototype.getElement=function(_36b){
if(goog.isString(_36b)){
return this.document_.getElementById(_36b);
}else{
return _36b;
}
};
goog.dom.DomHelper.prototype.$=goog.dom.DomHelper.prototype.getElement;
goog.dom.DomHelper.prototype.getElementsByTagNameAndClass=function(_36c,_36d,_36e){
return goog.dom.getElementsByTagNameAndClass_(this.document_,_36c,_36d,_36e);
};
goog.dom.DomHelper.prototype.getElementsByClass=function(_36f,_370){
var doc=_370||this.document_;
return goog.dom.getElementsByClass(_36f,doc);
};
goog.dom.DomHelper.prototype.getElementByClass=function(_372,_373){
var doc=_373||this.document_;
return goog.dom.getElementByClass(_372,doc);
};
goog.dom.DomHelper.prototype.$$=goog.dom.DomHelper.prototype.getElementsByTagNameAndClass;
goog.dom.DomHelper.prototype.setProperties=goog.dom.setProperties;
goog.dom.DomHelper.prototype.getViewportSize=function(_375){
return goog.dom.getViewportSize(_375||this.getWindow());
};
goog.dom.DomHelper.prototype.getDocumentHeight=function(){
return goog.dom.getDocumentHeight_(this.getWindow());
};
goog.dom.Appendable;
goog.dom.DomHelper.prototype.createDom=function(_376,_377,_378){
return goog.dom.createDom_(this.document_,arguments);
};
goog.dom.DomHelper.prototype.$dom=goog.dom.DomHelper.prototype.createDom;
goog.dom.DomHelper.prototype.createElement=function(name){
return this.document_.createElement(name);
};
goog.dom.DomHelper.prototype.createTextNode=function(_37a){
return this.document_.createTextNode(_37a);
};
goog.dom.DomHelper.prototype.createTable=function(rows,_37c,_37d){
return goog.dom.createTable_(this.document_,rows,_37c,!!_37d);
};
goog.dom.DomHelper.prototype.htmlToDocumentFragment=function(_37e){
return goog.dom.htmlToDocumentFragment_(this.document_,_37e);
};
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.provide("goog.debug.errorHandlerWeakDep");
goog.debug.errorHandlerWeakDep={protectEntryPoint:function(fn,_380){
return fn;
}};
goog.provide("goog.Disposable");
goog.provide("goog.dispose");
goog.Disposable=function(){
};
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();
}
};
goog.Disposable.prototype.disposeInternal=function(){
};
goog.dispose=function(obj){
if(obj&&typeof obj.dispose=="function"){
obj.dispose();
}
};
goog.provide("goog.events.Event");
goog.require("goog.Disposable");
goog.events.Event=function(type,_383){
goog.Disposable.call(this);
this.type=type;
this.target=_383;
this.currentTarget=this.target;
};
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(e){
e.stopPropagation();
};
goog.events.Event.preventDefault=function(e){
e.preventDefault();
};
goog.provide("goog.events.BrowserEvent");
goog.provide("goog.events.BrowserEvent.MouseButton");
goog.require("goog.events.Event");
goog.require("goog.userAgent");
goog.events.BrowserEvent=function(_386,_387){
if(_386){
this.init(_386,_387);
}
};
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.currentTarget;
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(e,_389){
var type=this.type=e.type;
this.target=e.target||e.srcElement;
this.currentTarget=_389;
var _38b=(e.relatedTarget);
if(_38b){
if(goog.userAgent.GECKO){
try{
_38b=_38b.nodeName&&_38b;
}
catch(err){
_38b=null;
}
}
}else{
if(type=="mouseover"){
_38b=e.fromElement;
}else{
if(type=="mouseout"){
_38b=e.toElement;
}
}
}
this.relatedTarget=_38b;
this.offsetX=e.offsetX!==undefined?e.offsetX:e.layerX;
this.offsetY=e.offsetY!==undefined?e.offsetY:e.layerY;
this.clientX=e.clientX!==undefined?e.clientX:e.pageX;
this.clientY=e.clientY!==undefined?e.clientY:e.pageY;
this.screenX=e.screenX||0;
this.screenY=e.screenY||0;
this.button=e.button;
this.keyCode=e.keyCode||0;
this.charCode=e.charCode||(type=="keypress"?e.keyCode:0);
this.ctrlKey=e.ctrlKey;
this.altKey=e.altKey;
this.shiftKey=e.shiftKey;
this.metaKey=e.metaKey;
this.platformModifierKey=goog.userAgent.MAC?e.metaKey:e.ctrlKey;
this.event_=e;
delete this.returnValue_;
delete this.propagationStopped_;
};
goog.events.BrowserEvent.prototype.isButton=function(_38c){
if(goog.userAgent.IE){
if(this.type=="click"){
return _38c==goog.events.BrowserEvent.MouseButton.LEFT;
}else{
return !!(this.event_.button&goog.events.BrowserEvent.IEButtonMap_[_38c]);
}
}else{
return this.event_.button==_38c;
}
};
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.IE7_SET_KEY_CODE_TO_PREVENT_DEFAULT_=goog.userAgent.IE&&!goog.userAgent.isVersion("8");
goog.events.BrowserEvent.prototype.preventDefault=function(){
goog.events.BrowserEvent.superClass_.preventDefault.call(this);
var be=this.event_;
if(!be.preventDefault){
be.returnValue=false;
if(goog.events.BrowserEvent.IE7_SET_KEY_CODE_TO_PREVENT_DEFAULT_){
try{
var _38e=112;
var _38f=123;
if(be.ctrlKey||be.keyCode>=_38e&&be.keyCode<=_38f){
be.keyCode=-1;
}
}
catch(ex){
}
}
}else{
be.preventDefault();
}
};
goog.events.BrowserEvent.prototype.getBrowserEvent=function(){
return this.event_;
};
goog.events.BrowserEvent.prototype.disposeInternal=function(){
goog.events.BrowserEvent.superClass_.disposeInternal.call(this);
this.event_=null;
this.target=null;
this.currentTarget=null;
this.relatedTarget=null;
};
goog.provide("goog.events.EventWrapper");
goog.events.EventWrapper=function(){
};
goog.events.EventWrapper.prototype.listen=function(src,_391,_392,_393,_394){
};
goog.events.EventWrapper.prototype.unlisten=function(src,_396,_397,_398,_399){
};
goog.provide("goog.events.Listener");
goog.events.Listener=function(){
};
goog.events.Listener.counter_=0;
goog.events.Listener.prototype.isFunctionListener_;
goog.events.Listener.prototype.listener;
goog.events.Listener.prototype.proxy;
goog.events.Listener.prototype.src;
goog.events.Listener.prototype.type;
goog.events.Listener.prototype.capture;
goog.events.Listener.prototype.handler;
goog.events.Listener.prototype.key=0;
goog.events.Listener.prototype.removed=false;
goog.events.Listener.prototype.callOnce=false;
goog.events.Listener.prototype.init=function(_39a,_39b,src,type,_39e,_39f){
if(goog.isFunction(_39a)){
this.isFunctionListener_=true;
}else{
if(_39a&&_39a.handleEvent&&goog.isFunction(_39a.handleEvent)){
this.isFunctionListener_=false;
}else{
throw Error("Invalid listener argument");
}
}
this.listener=_39a;
this.proxy=_39b;
this.src=src;
this.type=type;
this.capture=!!_39e;
this.handler=_39f;
this.callOnce=false;
this.key=++goog.events.Listener.counter_;
this.removed=false;
};
goog.events.Listener.prototype.handleEvent=function(_3a0){
if(this.isFunctionListener_){
return this.listener.call(this.handler||this.src,_3a0);
}
return this.listener.handleEvent.call(this.listener,_3a0);
};
goog.provide("goog.structs.SimplePool");
goog.require("goog.Disposable");
goog.structs.SimplePool=function(_3a1,_3a2){
goog.Disposable.call(this);
this.maxCount_=_3a2;
this.freeQueue_=[];
this.createInitial_(_3a1);
};
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(_3a3){
this.createObjectFn_=_3a3;
};
goog.structs.SimplePool.prototype.setDisposeObjectFn=function(_3a4){
this.disposeObjectFn_=_3a4;
};
goog.structs.SimplePool.prototype.getObject=function(){
if(this.freeQueue_.length){
return this.freeQueue_.pop();
}
return this.createObject();
};
goog.structs.SimplePool.prototype.releaseObject=function(obj){
if(this.freeQueue_.length<this.maxCount_){
this.freeQueue_.push(obj);
}else{
this.disposeObject(obj);
}
};
goog.structs.SimplePool.prototype.createInitial_=function(_3a6){
if(_3a6>this.maxCount_){
throw Error("[goog.structs.SimplePool] Initial cannot be greater than max");
}
for(var i=0;i<_3a6;i++){
this.freeQueue_.push(this.createObject());
}
};
goog.structs.SimplePool.prototype.createObject=function(){
if(this.createObjectFn_){
return this.createObjectFn_();
}else{
return {};
}
};
goog.structs.SimplePool.prototype.disposeObject=function(obj){
if(this.disposeObjectFn_){
this.disposeObjectFn_(obj);
}else{
if(goog.isObject(obj)){
if(goog.isFunction(obj.dispose)){
obj.dispose();
}else{
for(var i in obj){
delete obj[i];
}
}
}
}
};
goog.structs.SimplePool.prototype.disposeInternal=function(){
goog.structs.SimplePool.superClass_.disposeInternal.call(this);
var _3aa=this.freeQueue_;
while(_3aa.length){
this.disposeObject(_3aa.pop());
}
delete this.freeQueue_;
};
goog.provide("goog.userAgent.jscript");
goog.require("goog.string");
goog.userAgent.jscript.ASSUME_NO_JSCRIPT=false;
goog.userAgent.jscript.init_=function(){
var _3ab="ScriptEngine" in goog.global;
goog.userAgent.jscript.DETECTED_HAS_JSCRIPT_=_3ab&&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";
};
if(!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(_3ac){
return goog.string.compareVersions(goog.userAgent.jscript.VERSION,_3ac)>=0;
};
goog.provide("goog.events.pools");
goog.require("goog.events.BrowserEvent");
goog.require("goog.events.Listener");
goog.require("goog.structs.SimplePool");
goog.require("goog.userAgent.jscript");
goog.events.pools.getObject;
goog.events.pools.releaseObject;
goog.events.pools.getArray;
goog.events.pools.releaseArray;
goog.events.pools.getProxy;
goog.events.pools.setProxyCallbackFunction;
goog.events.pools.releaseProxy;
goog.events.pools.getListener;
goog.events.pools.releaseListener;
goog.events.pools.getEvent;
goog.events.pools.releaseEvent;
(function(){
var _3ad=goog.userAgent.jscript.HAS_JSCRIPT&&!goog.userAgent.jscript.isVersion("5.7");
function getObject(){
return {count_:0,remaining_:0};
}
function getArray(){
return [];
}
var _3ae;
goog.events.pools.setProxyCallbackFunction=function(cb){
_3ae=cb;
};
function getProxy(){
var f=function(_3b1){
return _3ae.call(f.src,f.key,_3b1);
};
return f;
}
function getListener(){
return new goog.events.Listener();
}
function getEvent(){
return new goog.events.BrowserEvent();
}
if(!_3ad){
goog.events.pools.getObject=getObject;
goog.events.pools.releaseObject=goog.nullFunction;
goog.events.pools.getArray=getArray;
goog.events.pools.releaseArray=goog.nullFunction;
goog.events.pools.getProxy=getProxy;
goog.events.pools.releaseProxy=goog.nullFunction;
goog.events.pools.getListener=getListener;
goog.events.pools.releaseListener=goog.nullFunction;
goog.events.pools.getEvent=getEvent;
goog.events.pools.releaseEvent=goog.nullFunction;
}else{
goog.events.pools.getObject=function(){
return objectPool.getObject();
};
goog.events.pools.releaseObject=function(obj){
objectPool.releaseObject(obj);
};
goog.events.pools.getArray=function(){
return (arrayPool.getObject());
};
goog.events.pools.releaseArray=function(obj){
arrayPool.releaseObject(obj);
};
goog.events.pools.getProxy=function(){
return (proxyPool.getObject());
};
goog.events.pools.releaseProxy=function(obj){
proxyPool.releaseObject(getProxy());
};
goog.events.pools.getListener=function(){
return (listenerPool.getObject());
};
goog.events.pools.releaseListener=function(obj){
listenerPool.releaseObject(obj);
};
goog.events.pools.getEvent=function(){
return (eventPool.getObject());
};
goog.events.pools.releaseEvent=function(obj){
eventPool.releaseObject(obj);
};
var _3b7=0;
var _3b8=600;
var _3b9=new goog.structs.SimplePool(_3b7,_3b8);
_3b9.setCreateObjectFn(getObject);
var _3ba=0;
var _3bb=600;
var _3bc=new goog.structs.SimplePool(_3ba,_3bb);
_3bc.setCreateObjectFn(getArray);
var _3bd=0;
var _3be=600;
var _3bf=new goog.structs.SimplePool(_3bd,_3be);
_3bf.setCreateObjectFn(getProxy);
var _3c0=0;
var _3c1=600;
var _3c2=new goog.structs.SimplePool(_3c0,_3c1);
_3c2.setCreateObjectFn(getListener);
var _3c3=0;
var _3c4=600;
var _3c5=new goog.structs.SimplePool(_3c3,_3c4);
_3c5.setCreateObjectFn(getEvent);
}
})();
goog.provide("goog.events");
goog.provide("goog.events.EventType");
goog.require("goog.array");
goog.require("goog.debug.errorHandlerWeakDep");
goog.require("goog.events.BrowserEvent");
goog.require("goog.events.Event");
goog.require("goog.events.EventWrapper");
goog.require("goog.events.pools");
goog.require("goog.object");
goog.require("goog.userAgent");
goog.events.listeners_={};
goog.events.listenerTree_={};
goog.events.sources_={};
goog.events.onString_="on";
goog.events.onStringMap_={};
goog.events.keySeparator_="_";
goog.events.requiresSyntheticEventPropagation_;
goog.events.listen=function(src,type,_3c8,_3c9,_3ca){
if(!type){
throw Error("Invalid event type");
}else{
if(goog.isArray(type)){
for(var i=0;i<type.length;i++){
goog.events.listen(src,type[i],_3c8,_3c9,_3ca);
}
return null;
}else{
var _3cc=!!_3c9;
var map=goog.events.listenerTree_;
if(!(type in map)){
map[type]=goog.events.pools.getObject();
}
map=map[type];
if(!(_3cc in map)){
map[_3cc]=goog.events.pools.getObject();
map.count_++;
}
map=map[_3cc];
var _3ce=goog.getUid(src);
var _3cf,listenerObj;
map.remaining_++;
if(!map[_3ce]){
_3cf=map[_3ce]=goog.events.pools.getArray();
map.count_++;
}else{
_3cf=map[_3ce];
for(var i=0;i<_3cf.length;i++){
listenerObj=_3cf[i];
if(listenerObj.listener==_3c8&&listenerObj.handler==_3ca){
if(listenerObj.removed){
break;
}
return _3cf[i].key;
}
}
}
var _3d0=goog.events.pools.getProxy();
_3d0.src=src;
listenerObj=goog.events.pools.getListener();
listenerObj.init(_3c8,_3d0,src,type,_3cc,_3ca);
var key=listenerObj.key;
_3d0.key=key;
_3cf.push(listenerObj);
goog.events.listeners_[key]=listenerObj;
if(!goog.events.sources_[_3ce]){
goog.events.sources_[_3ce]=goog.events.pools.getArray();
}
goog.events.sources_[_3ce].push(listenerObj);
if(src.addEventListener){
if(src==goog.global||!src.customEvent_){
src.addEventListener(type,_3d0,_3cc);
}
}else{
src.attachEvent(goog.events.getOnString_(type),_3d0);
}
return key;
}
}
};
goog.events.listenOnce=function(src,type,_3d4,_3d5,_3d6){
if(goog.isArray(type)){
for(var i=0;i<type.length;i++){
goog.events.listenOnce(src,type[i],_3d4,_3d5,_3d6);
}
return null;
}
var key=goog.events.listen(src,type,_3d4,_3d5,_3d6);
var _3d9=goog.events.listeners_[key];
_3d9.callOnce=true;
return key;
};
goog.events.listenWithWrapper=function(src,_3db,_3dc,_3dd,_3de){
_3db.listen(src,_3dc,_3dd,_3de);
};
goog.events.unlisten=function(src,type,_3e1,_3e2,_3e3){
if(goog.isArray(type)){
for(var i=0;i<type.length;i++){
goog.events.unlisten(src,type[i],_3e1,_3e2,_3e3);
}
return null;
}
var _3e5=!!_3e2;
var _3e6=goog.events.getListeners_(src,type,_3e5);
if(!_3e6){
return false;
}
for(var i=0;i<_3e6.length;i++){
if(_3e6[i].listener==_3e1&&_3e6[i].capture==_3e5&&_3e6[i].handler==_3e3){
return goog.events.unlistenByKey(_3e6[i].key);
}
}
return false;
};
goog.events.unlistenByKey=function(key){
if(!goog.events.listeners_[key]){
return false;
}
var _3e8=goog.events.listeners_[key];
if(_3e8.removed){
return false;
}
var src=_3e8.src;
var type=_3e8.type;
var _3eb=_3e8.proxy;
var _3ec=_3e8.capture;
if(src.removeEventListener){
if(src==goog.global||!src.customEvent_){
src.removeEventListener(type,_3eb,_3ec);
}
}else{
if(src.detachEvent){
src.detachEvent(goog.events.getOnString_(type),_3eb);
}
}
var _3ed=goog.getUid(src);
var _3ee=goog.events.listenerTree_[type][_3ec][_3ed];
if(goog.events.sources_[_3ed]){
var _3ef=goog.events.sources_[_3ed];
goog.array.remove(_3ef,_3e8);
if(_3ef.length==0){
delete goog.events.sources_[_3ed];
}
}
_3e8.removed=true;
_3ee.needsCleanup_=true;
goog.events.cleanUp_(type,_3ec,_3ed,_3ee);
delete goog.events.listeners_[key];
return true;
};
goog.events.unlistenWithWrapper=function(src,_3f1,_3f2,_3f3,_3f4){
_3f1.unlisten(src,_3f2,_3f3,_3f4);
};
goog.events.cleanUp_=function(type,_3f6,_3f7,_3f8){
if(!_3f8.locked_){
if(_3f8.needsCleanup_){
for(var _3f9=0,newIndex=0;_3f9<_3f8.length;_3f9++){
if(_3f8[_3f9].removed){
var _3fa=_3f8[_3f9].proxy;
_3fa.src=null;
goog.events.pools.releaseProxy(_3fa);
goog.events.pools.releaseListener(_3f8[_3f9]);
continue;
}
if(_3f9!=newIndex){
_3f8[newIndex]=_3f8[_3f9];
}
newIndex++;
}
_3f8.length=newIndex;
_3f8.needsCleanup_=false;
if(newIndex==0){
goog.events.pools.releaseArray(_3f8);
delete goog.events.listenerTree_[type][_3f6][_3f7];
goog.events.listenerTree_[type][_3f6].count_--;
if(goog.events.listenerTree_[type][_3f6].count_==0){
goog.events.pools.releaseObject(goog.events.listenerTree_[type][_3f6]);
delete goog.events.listenerTree_[type][_3f6];
goog.events.listenerTree_[type].count_--;
}
if(goog.events.listenerTree_[type].count_==0){
goog.events.pools.releaseObject(goog.events.listenerTree_[type]);
delete goog.events.listenerTree_[type];
}
}
}
}
};
goog.events.removeAll=function(_3fb,_3fc,_3fd){
var _3fe=0;
var _3ff=_3fb==null;
var _400=_3fc==null;
var _401=_3fd==null;
_3fd=!!_3fd;
if(!_3ff){
var _402=goog.getUid((_3fb));
if(goog.events.sources_[_402]){
var _403=goog.events.sources_[_402];
for(var i=_403.length-1;i>=0;i--){
var _405=_403[i];
if((_400||_3fc==_405.type)&&(_401||_3fd==_405.capture)){
goog.events.unlistenByKey(_405.key);
_3fe++;
}
}
}
}else{
goog.object.forEach(goog.events.sources_,function(_406){
for(var i=_406.length-1;i>=0;i--){
var _408=_406[i];
if((_400||_3fc==_408.type)&&(_401||_3fd==_408.capture)){
goog.events.unlistenByKey(_408.key);
_3fe++;
}
}
});
}
return _3fe;
};
goog.events.getListeners=function(obj,type,_40b){
return goog.events.getListeners_(obj,type,_40b)||[];
};
goog.events.getListeners_=function(obj,type,_40e){
var map=goog.events.listenerTree_;
if(type in map){
map=map[type];
if(_40e in map){
map=map[_40e];
var _410=goog.getUid(obj);
if(map[_410]){
return map[_410];
}
}
}
return null;
};
goog.events.getListener=function(src,type,_413,_414,_415){
var _416=!!_414;
var _417=goog.events.getListeners_(src,type,_416);
if(_417){
for(var i=0;i<_417.length;i++){
if(_417[i].listener==_413&&_417[i].capture==_416&&_417[i].handler==_415){
return _417[i];
}
}
}
return null;
};
goog.events.hasListener=function(obj,_41a,_41b){
var _41c=goog.getUid(obj);
var _41d=goog.events.sources_[_41c];
if(_41d){
var _41e=goog.isDef(_41a);
var _41f=goog.isDef(_41b);
if(_41e&&_41f){
var map=goog.events.listenerTree_[_41a];
return !!map&&!!map[_41b]&&_41c in map[_41b];
}else{
if(!(_41e||_41f)){
return true;
}else{
return goog.array.some(_41d,function(_421){
return (_41e&&_421.type==_41a)||(_41f&&_421.capture==_41b);
});
}
}
}
return false;
};
goog.events.expose=function(e){
var str=[];
for(var key in e){
if(e[key]&&e[key].id){
str.push(key+" = "+e[key]+" ("+e[key].id+")");
}else{
str.push(key+" = "+e[key]);
}
}
return str.join("\n");
};
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",DRAGSTART:"dragstart",DRAGENTER:"dragenter",DRAGOVER:"dragover",DRAGLEAVE:"dragleave",DROP:"drop",CONTEXTMENU:"contextmenu",ERROR:"error",HELP:"help",LOAD:"load",LOSECAPTURE:"losecapture",READYSTATECHANGE:"readystatechange",RESIZE:"resize",SCROLL:"scroll",UNLOAD:"unload",HASHCHANGE:"hashchange",POPSTATE:"popstate"};
goog.events.getOnString_=function(type){
if(type in goog.events.onStringMap_){
return goog.events.onStringMap_[type];
}
return goog.events.onStringMap_[type]=goog.events.onString_+type;
};
goog.events.fireListeners=function(obj,type,_428,_429){
var map=goog.events.listenerTree_;
if(type in map){
map=map[type];
if(_428 in map){
return goog.events.fireListeners_(map[_428],obj,type,_428,_429);
}
}
return true;
};
goog.events.fireListeners_=function(map,obj,type,_42e,_42f){
var _430=1;
var _431=goog.getUid(obj);
if(map[_431]){
map.remaining_--;
var _432=map[_431];
if(!_432.locked_){
_432.locked_=1;
}else{
_432.locked_++;
}
try{
var _433=_432.length;
for(var i=0;i<_433;i++){
var _435=_432[i];
if(_435&&!_435.removed){
_430&=goog.events.fireListener(_435,_42f)!==false;
}
}
}
finally{
_432.locked_--;
goog.events.cleanUp_(type,_42e,_431,_432);
}
}
return Boolean(_430);
};
goog.events.fireListener=function(_436,_437){
var rv=_436.handleEvent(_437);
if(_436.callOnce){
goog.events.unlistenByKey(_436.key);
}
return rv;
};
goog.events.getTotalListenerCount=function(){
return goog.object.getCount(goog.events.listeners_);
};
goog.events.dispatchEvent=function(src,e){
if(goog.isString(e)){
e=new goog.events.Event(e,src);
}else{
if(!(e instanceof goog.events.Event)){
var _43b=e;
e=new goog.events.Event(e.type,src);
goog.object.extend(e,_43b);
}else{
e.target=e.target||src;
}
}
var rv=1,ancestors;
var type=e.type;
var map=goog.events.listenerTree_;
if(!(type in map)){
return true;
}
map=map[type];
var _43f=true in map;
var _440;
if(_43f){
ancestors=[];
for(var _441=src;_441;_441=_441.getParentEventTarget()){
ancestors.push(_441);
}
_440=map[true];
_440.remaining_=_440.count_;
for(var i=ancestors.length-1;!e.propagationStopped_&&i>=0&&_440.remaining_;i--){
e.currentTarget=ancestors[i];
rv&=goog.events.fireListeners_(_440,ancestors[i],e.type,true,e)&&e.returnValue_!=false;
}
}
var _443=false in map;
if(_443){
_440=map[false];
_440.remaining_=_440.count_;
if(_43f){
for(var i=0;!e.propagationStopped_&&i<ancestors.length&&_440.remaining_;i++){
e.currentTarget=ancestors[i];
rv&=goog.events.fireListeners_(_440,ancestors[i],e.type,false,e)&&e.returnValue_!=false;
}
}else{
for(var _444=src;!e.propagationStopped_&&_444&&_440.remaining_;_444=_444.getParentEventTarget()){
e.currentTarget=_444;
rv&=goog.events.fireListeners_(_440,_444,e.type,false,e)&&e.returnValue_!=false;
}
}
}
return Boolean(rv);
};
goog.events.protectBrowserEventEntryPoint=function(_445,_446){
goog.events.handleBrowserEvent_=_445.protectEntryPoint(goog.events.handleBrowserEvent_,_446);
goog.events.pools.setProxyCallbackFunction(goog.events.handleBrowserEvent_);
};
goog.events.handleBrowserEvent_=function(key,_448){
if(!goog.events.listeners_[key]){
return true;
}
var _449=goog.events.listeners_[key];
var type=_449.type;
var map=goog.events.listenerTree_;
if(!(type in map)){
return true;
}
map=map[type];
var _44c,targetsMap;
if(goog.events.synthesizeEventPropagation_()){
var _44d=_448||(goog.getObjectByName("window.event"));
var _44e=true in map;
var _44f=false in map;
if(_44e){
if(goog.events.isMarkedIeEvent_(_44d)){
return true;
}
goog.events.markIeEvent_(_44d);
}
var evt=goog.events.pools.getEvent();
evt.init(_44d,this);
_44c=true;
try{
if(_44e){
var _451=goog.events.pools.getArray();
for(var _452=evt.currentTarget;_452;_452=_452.parentNode){
_451.push(_452);
}
targetsMap=map[true];
targetsMap.remaining_=targetsMap.count_;
for(var i=_451.length-1;!evt.propagationStopped_&&i>=0&&targetsMap.remaining_;i--){
evt.currentTarget=_451[i];
_44c&=goog.events.fireListeners_(targetsMap,_451[i],type,true,evt);
}
if(_44f){
targetsMap=map[false];
targetsMap.remaining_=targetsMap.count_;
for(var i=0;!evt.propagationStopped_&&i<_451.length&&targetsMap.remaining_;i++){
evt.currentTarget=_451[i];
_44c&=goog.events.fireListeners_(targetsMap,_451[i],type,false,evt);
}
}
}else{
_44c=goog.events.fireListener(_449,evt);
}
}
finally{
if(_451){
_451.length=0;
goog.events.pools.releaseArray(_451);
}
evt.dispose();
goog.events.pools.releaseEvent(evt);
}
return _44c;
}
var be=new goog.events.BrowserEvent(_448,this);
try{
_44c=goog.events.fireListener(_449,be);
}
finally{
be.dispose();
}
return _44c;
};
goog.events.pools.setProxyCallbackFunction(goog.events.handleBrowserEvent_);
goog.events.markIeEvent_=function(e){
var _456=false;
if(e.keyCode==0){
try{
e.keyCode=-1;
return;
}
catch(ex){
_456=true;
}
}
if(_456||(e.returnValue)==undefined){
e.returnValue=true;
}
};
goog.events.isMarkedIeEvent_=function(e){
return e.keyCode<0||e.returnValue!=undefined;
};
goog.events.uniqueIdCounter_=0;
goog.events.getUniqueId=function(_458){
return _458+"_"+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.provide("goog.events.EventTarget");
goog.require("goog.Disposable");
goog.require("goog.events");
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(_459){
this.parentEventTarget_=_459;
};
goog.events.EventTarget.prototype.addEventListener=function(type,_45b,_45c,_45d){
goog.events.listen(this,type,_45b,_45c,_45d);
};
goog.events.EventTarget.prototype.removeEventListener=function(type,_45f,_460,_461){
goog.events.unlisten(this,type,_45f,_460,_461);
};
goog.events.EventTarget.prototype.dispatchEvent=function(e){
return goog.events.dispatchEvent(this,e);
};
goog.events.EventTarget.prototype.disposeInternal=function(){
goog.events.EventTarget.superClass_.disposeInternal.call(this);
goog.events.removeAll(this);
this.parentEventTarget_=null;
};
goog.provide("goog.math");
goog.require("goog.array");
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(_466,min,max){
return Math.min(Math.max(_466,min),max);
};
goog.math.modulo=function(a,b){
var r=a%b;
return (r*b<0)?r+b:r;
};
goog.math.lerp=function(a,b,x){
return a+x*(b-a);
};
goog.math.nearlyEquals=function(a,b,_471){
return Math.abs(a-b)<=(_471||0.000001);
};
goog.math.standardAngle=function(_472){
return goog.math.modulo(_472,360);
};
goog.math.toRadians=function(_473){
return _473*Math.PI/180;
};
goog.math.toDegrees=function(_474){
return _474*180/Math.PI;
};
goog.math.angleDx=function(_475,_476){
return _476*Math.cos(goog.math.toRadians(_475));
};
goog.math.angleDy=function(_477,_478){
return _478*Math.sin(goog.math.toRadians(_477));
};
goog.math.angle=function(x1,y1,x2,y2){
return goog.math.standardAngle(goog.math.toDegrees(Math.atan2(y2-y1,x2-x1)));
};
goog.math.angleDifference=function(_47d,_47e){
var d=goog.math.standardAngle(_47e)-goog.math.standardAngle(_47d);
if(d>180){
d=d-360;
}else{
if(d<=-180){
d=360+d;
}
}
return d;
};
goog.math.sign=function(x){
return x==0?0:(x<0?-1:1);
};
goog.math.longestCommonSubsequence=function(_481,_482,_483,_484){
var _485=_483||function(a,b){
return a==b;
};
var _488=_484||function(i1,i2){
return _481[i1];
};
var _48b=_481.length;
var _48c=_482.length;
var arr=[];
for(var i=0;i<_48b+1;i++){
arr[i]=[];
arr[i][0]=0;
}
for(var j=0;j<_48c+1;j++){
arr[0][j]=0;
}
for(i=1;i<=_48b;i++){
for(j=1;j<=_48b;j++){
if(_485(_481[i-1],_482[j-1])){
arr[i][j]=arr[i-1][j-1]+1;
}else{
arr[i][j]=Math.max(arr[i-1][j],arr[i][j-1]);
}
}
}
var _490=[];
var i=_48b,j=_48c;
while(i>0&&j>0){
if(_485(_481[i-1],_482[j-1])){
_490.unshift(_488(i-1,j-1));
i--;
j--;
}else{
if(arr[i-1][j]>arr[i][j-1]){
i--;
}else{
j--;
}
}
}
return _490;
};
goog.math.sum=function(_491){
return (goog.array.reduce(arguments,function(sum,_493){
return sum+_493;
},0));
};
goog.math.average=function(_494){
return goog.math.sum.apply(null,arguments)/arguments.length;
};
goog.math.standardDeviation=function(_495){
var _496=arguments.length;
if(_496<2){
return 0;
}
var mean=goog.math.average.apply(null,arguments);
var _498=goog.math.sum.apply(null,goog.array.map(arguments,function(val){
return Math.pow(val-mean,2);
}))/(_496-1);
return Math.sqrt(_498);
};
goog.math.isInt=function(num){
return isFinite(num)&&num%1==0;
};
goog.math.isFiniteNumber=function(num){
return isFinite(num)&&!isNaN(num);
};
goog.provide("goog.events.MouseWheelEvent");
goog.provide("goog.events.MouseWheelHandler");
goog.provide("goog.events.MouseWheelHandler.EventType");
goog.require("goog.events");
goog.require("goog.events.BrowserEvent");
goog.require("goog.events.EventTarget");
goog.require("goog.math");
goog.require("goog.userAgent");
goog.events.MouseWheelHandler=function(_49c){
goog.events.EventTarget.call(this);
this.element_=_49c;
var type=goog.userAgent.GECKO?"DOMMouseScroll":"mousewheel";
};
goog.inherits(goog.events.MouseWheelHandler,goog.events.EventTarget);
goog.events.MouseWheelHandler.EventType={MOUSEWHEEL:"mousewheel"};
goog.events.MouseWheelHandler.prototype.maxDeltaX_;
goog.events.MouseWheelHandler.prototype.maxDeltaY_;
goog.events.MouseWheelHandler.prototype.setMaxDeltaX=function(_49e){
this.maxDeltaX_=_49e;
};
goog.events.MouseWheelHandler.prototype.setMaxDeltaY=function(_49f){
this.maxDeltaY_=_49f;
};
goog.events.MouseWheelHandler.prototype.handleEvent=function(e){
var _4a1=0;
var _4a2=0;
var _4a3=0;
var be=e.getBrowserEvent();
if(be.type=="mousewheel"){
var _4a5=1;
if(goog.userAgent.IE||goog.userAgent.WEBKIT&&(goog.userAgent.WINDOWS||goog.userAgent.isVersion("532.0"))){
_4a5=40;
}
_4a3=-be.wheelDelta/_4a5;
if(goog.isDef(be.wheelDeltaX)){
_4a1=-be.wheelDeltaX/_4a5;
_4a2=-be.wheelDeltaY/_4a5;
}else{
_4a2=_4a3;
}
}else{
_4a3=be.detail;
if(_4a3>100){
_4a3=3;
}else{
if(_4a3<-100){
_4a3=-3;
}
}
if(goog.isDef(be.axis)&&be.axis===be.HORIZONTAL_AXIS){
_4a1=_4a3;
}else{
_4a2=_4a3;
}
}
if(goog.isNumber(this.maxDeltaX_)){
_4a1=goog.math.clamp(_4a1,-this.maxDeltaX_,this.maxDeltaX_);
}
if(goog.isNumber(this.maxDeltaY_)){
_4a2=goog.math.clamp(_4a2,-this.maxDeltaY_,this.maxDeltaY_);
}
var _4a6=new goog.events.MouseWheelEvent(_4a3,be,_4a1,_4a2);
try{
this.dispatchEvent(_4a6);
}
finally{
_4a6.dispose();
}
};
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(_4a7,_4a8,_4a9,_4aa){
goog.events.BrowserEvent.call(this,_4a8);
this.type=goog.events.MouseWheelHandler.EventType.MOUSEWHEEL;
this.detail=_4a7;
this.deltaX=_4a9;
this.deltaY=_4aa;
};
goog.inherits(goog.events.MouseWheelEvent,goog.events.BrowserEvent);
goog.provide("goog.color.names");
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.provide("goog.color");
goog.require("goog.color.names");
goog.require("goog.math");
goog.color.parse=function(str){
var _4ac={};
str=String(str);
var _4ad=goog.color.prependPoundIfNecessary_(str);
if(goog.color.isValidHexColor_(_4ad)){
_4ac.hex=goog.color.normalizeHex(_4ad);
_4ac.type="hex";
return _4ac;
}else{
var rgb=goog.color.isValidRgbColor_(str);
if(rgb.length){
_4ac.hex=goog.color.rgbArrayToHex(rgb);
_4ac.type="rgb";
return _4ac;
}else{
if(goog.color.names){
var hex=goog.color.names[str.toLowerCase()];
if(hex){
_4ac.hex=hex;
_4ac.type="named";
return _4ac;
}
}
}
}
throw Error(str+" is not a valid color string");
};
goog.color.parseRgb=function(str){
var rgb=goog.color.isValidRgbColor_(str);
if(!rgb.length){
throw Error(str+" is not a valid RGB color");
}
return rgb;
};
goog.color.hexToRgbStyle=function(_4b2){
return goog.color.rgbStyle_(goog.color.hexToRgb(_4b2));
};
goog.color.hexTripletRe_=/#(.)(.)(.)/;
goog.color.normalizeHex=function(_4b3){
if(!goog.color.isValidHexColor_(_4b3)){
throw Error("'"+_4b3+"' is not a valid hex color");
}
if(_4b3.length==4){
_4b3=_4b3.replace(goog.color.hexTripletRe_,"#$1$1$2$2$3$3");
}
return _4b3.toLowerCase();
};
goog.color.hexToRgb=function(_4b4){
_4b4=goog.color.normalizeHex(_4b4);
var r=parseInt(_4b4.substr(1,2),16);
var g=parseInt(_4b4.substr(3,2),16);
var b=parseInt(_4b4.substr(5,2),16);
return [r,g,b];
};
goog.color.rgbToHex=function(r,g,b){
r=Number(r);
g=Number(g);
b=Number(b);
if(isNaN(r)||r<0||r>255||isNaN(g)||g<0||g>255||isNaN(b)||b<0||b>255){
throw Error("\"("+r+","+g+","+b+"\") is not a valid RGB color");
}
var hexR=goog.color.prependZeroIfNecessary_(r.toString(16));
var hexG=goog.color.prependZeroIfNecessary_(g.toString(16));
var hexB=goog.color.prependZeroIfNecessary_(b.toString(16));
return "#"+hexR+hexG+hexB;
};
goog.color.rgbArrayToHex=function(rgb){
return goog.color.rgbToHex(rgb[0],rgb[1],rgb[2]);
};
goog.color.rgbToHsl=function(r,g,b){
var _4c2=r/255;
var _4c3=g/255;
var _4c4=b/255;
var max=Math.max(_4c2,_4c3,_4c4);
var min=Math.min(_4c2,_4c3,_4c4);
var h=0;
var s=0;
var l=0.5*(max+min);
if(max!=min){
if(max==_4c2){
h=60*(_4c3-_4c4)/(max-min);
}else{
if(max==_4c3){
h=60*(_4c4-_4c2)/(max-min)+120;
}else{
if(max==_4c4){
h=60*(_4c2-_4c3)/(max-min)+240;
}
}
}
if(0<l&&l<=0.5){
s=(max-min)/(2*l);
}else{
s=(max-min)/(2-2*l);
}
}
return [Math.round(h+360)%360,s,l];
};
goog.color.rgbArrayToHsl=function(rgb){
return goog.color.rgbToHsl(rgb[0],rgb[1],rgb[2]);
};
goog.color.hueToRgb_=function(v1,v2,vH){
if(vH<0){
vH+=1;
}else{
if(vH>1){
vH-=1;
}
}
if((6*vH)<1){
return (v1+(v2-v1)*6*vH);
}else{
if(2*vH<1){
return v2;
}else{
if(3*vH<2){
return (v1+(v2-v1)*((2/3)-vH)*6);
}
}
}
return v1;
};
goog.color.hslToRgb=function(h,s,l){
var r=0;
var g=0;
var b=0;
var _4d4=h/360;
if(s==0){
r=g=b=l*255;
}else{
var _4d5=0;
var _4d6=0;
if(l<0.5){
_4d6=l*(1+s);
}else{
_4d6=l+s-(s*l);
}
_4d5=2*l-_4d6;
r=255*goog.color.hueToRgb_(_4d5,_4d6,_4d4+(1/3));
g=255*goog.color.hueToRgb_(_4d5,_4d6,_4d4);
b=255*goog.color.hueToRgb_(_4d5,_4d6,_4d4-(1/3));
}
return [Math.round(r),Math.round(g),Math.round(b)];
};
goog.color.hslArrayToRgb=function(hsl){
return goog.color.hslToRgb(hsl[0],hsl[1],hsl[2]);
};
goog.color.validHexColorRe_=/^#(?:[0-9a-f]{3}){1,2}$/i;
goog.color.isValidHexColor_=function(str){
return goog.color.validHexColorRe_.test(str);
};
goog.color.normalizedHexColorRe_=/^#[0-9a-f]{6}$/;
goog.color.isNormalizedHexColor_=function(str){
return goog.color.normalizedHexColorRe_.test(str);
};
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(str){
var _4db=str.match(goog.color.rgbColorRe_);
if(_4db){
var r=Number(_4db[1]);
var g=Number(_4db[2]);
var b=Number(_4db[3]);
if(r>=0&&r<=255&&g>=0&&g<=255&&b>=0&&b<=255){
return [r,g,b];
}
}
return [];
};
goog.color.prependZeroIfNecessary_=function(hex){
return hex.length==1?"0"+hex:hex;
};
goog.color.prependPoundIfNecessary_=function(str){
return str.charAt(0)=="#"?str:"#"+str;
};
goog.color.rgbStyle_=function(rgb){
return "rgb("+rgb.join(",")+")";
};
goog.color.hsvToRgb=function(h,s,_4e4){
var red=0;
var _4e6=0;
var blue=0;
if(s==0){
red=_4e4;
_4e6=_4e4;
blue=_4e4;
}else{
var _4e8=Math.floor(h/60);
var _4e9=(h/60)-_4e8;
var val1=_4e4*(1-s);
var val2=_4e4*(1-(s*_4e9));
var val3=_4e4*(1-(s*(1-_4e9)));
switch(_4e8){
case 1:
red=val2;
_4e6=_4e4;
blue=val1;
break;
case 2:
red=val1;
_4e6=_4e4;
blue=val3;
break;
case 3:
red=val1;
_4e6=val2;
blue=_4e4;
break;
case 4:
red=val3;
_4e6=val1;
blue=_4e4;
break;
case 5:
red=_4e4;
_4e6=val1;
blue=val2;
break;
case 6:
case 0:
red=_4e4;
_4e6=val3;
blue=val1;
break;
}
}
return [Math.floor(red),Math.floor(_4e6),Math.floor(blue)];
};
goog.color.rgbToHsv=function(red,_4ee,blue){
var max=Math.max(Math.max(red,_4ee),blue);
var min=Math.min(Math.min(red,_4ee),blue);
var hue;
var _4f3;
var _4f4=max;
if(min==max){
hue=0;
_4f3=0;
}else{
var _4f5=(max-min);
_4f3=_4f5/max;
if(red==max){
hue=(_4ee-blue)/_4f5;
}else{
if(_4ee==max){
hue=2+((blue-red)/_4f5);
}else{
hue=4+((red-_4ee)/_4f5);
}
}
hue*=60;
if(hue<0){
hue+=360;
}
if(hue>360){
hue-=360;
}
}
return [hue,_4f3,_4f4];
};
goog.color.rgbArrayToHsv=function(rgb){
return goog.color.rgbToHsv(rgb[0],rgb[1],rgb[2]);
};
goog.color.hsvArrayToRgb=function(hsv){
return goog.color.hsvToRgb(hsv[0],hsv[1],hsv[2]);
};
goog.color.hexToHsl=function(hex){
var rgb=goog.color.hexToRgb(hex);
return goog.color.rgbToHsl(rgb[0],rgb[1],rgb[2]);
};
goog.color.hslToHex=function(h,s,l){
return goog.color.rgbArrayToHex(goog.color.hslToRgb(h,s,l));
};
goog.color.hslArrayToHex=function(hsl){
return goog.color.rgbArrayToHex(goog.color.hslToRgb(hsl[0],hsl[1],hsl[2]));
};
goog.color.hexToHsv=function(hex){
return goog.color.rgbArrayToHsv(goog.color.hexToRgb(hex));
};
goog.color.hsvToHex=function(h,s,v){
return goog.color.rgbArrayToHex(goog.color.hsvToRgb(h,s,v));
};
goog.color.hsvArrayToHex=function(hsv){
return goog.color.hsvToHex(hsv[0],hsv[1],hsv[2]);
};
goog.color.hslDistance=function(hsl1,hsl2){
var sl1,sl2;
if(hsl1[2]<=0.5){
sl1=hsl1[1]*hsl1[2];
}else{
sl1=hsl1[1]*(1-hsl1[2]);
}
if(hsl2[2]<=0.5){
sl2=hsl2[1]*hsl2[2];
}else{
sl2=hsl2[1]*(1-hsl2[2]);
}
var h1=hsl1[0]/360;
var h2=hsl2[0]/360;
var dh=(h1-h2)*2*Math.PI;
return (hsl1[2]-hsl2[2])*(hsl1[2]-hsl2[2])+sl1*sl1+sl2*sl2-2*sl1*sl2*Math.cos(dh);
};
goog.color.blend=function(rgb1,rgb2,_50b){
_50b=goog.math.clamp(_50b,0,1);
return [Math.round(_50b*rgb1[0]+(1-_50b)*rgb2[0]),Math.round(_50b*rgb1[1]+(1-_50b)*rgb2[1]),Math.round(_50b*rgb1[2]+(1-_50b)*rgb2[2])];
};
goog.color.darken=function(rgb,_50d){
var _50e=[0,0,0];
return goog.color.blend(_50e,rgb,_50d);
};
goog.color.lighten=function(rgb,_510){
var _511=[255,255,255];
return goog.color.blend(_511,rgb,_510);
};
goog.color.highContrast=function(_512,_513){
var _514=[];
for(var i=0;i<_513.length;i++){
_514.push({color:_513[i],diff:goog.color.yiqBrightnessDiff_(_513[i],_512)+goog.color.colorDiff_(_513[i],_512)});
}
_514.sort(function(a,b){
return b.diff-a.diff;
});
return _514[0].color;
};
goog.color.yiqBrightness_=function(rgb){
return Math.round((rgb[0]*299+rgb[1]*587+rgb[2]*114)/1000);
};
goog.color.yiqBrightnessDiff_=function(rgb1,rgb2){
return Math.abs(goog.color.yiqBrightness_(rgb1)-goog.color.yiqBrightness_(rgb2));
};
goog.color.colorDiff_=function(rgb1,rgb2){
return Math.abs(rgb1[0]-rgb2[0])+Math.abs(rgb1[1]-rgb2[1])+Math.abs(rgb1[2]-rgb2[2]);
};
goog.provide("goog.Timer");
goog.require("goog.events.EventTarget");
goog.Timer=function(_51d,_51e){
goog.events.EventTarget.call(this);
this.interval_=_51d||1;
this.timerObject_=_51e||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(_51f){
this.interval_=_51f;
if(this.timer_&&this.enabled){
this.stop();
this.start();
}else{
if(this.timer_){
this.stop();
}
}
};
goog.Timer.prototype.tick_=function(){
if(this.enabled){
var _520=goog.now()-this.last_;
if(_520>0&&_520<this.interval_*goog.Timer.intervalScale){
this.timer_=this.timerObject_.setTimeout(this.boundTick_,this.interval_-_520);
return;
}
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(_521,_522,_523){
if(goog.isFunction(_521)){
if(_523){
_521=goog.bind(_521,_523);
}
}else{
if(_521&&typeof _521.handleEvent=="function"){
_521=goog.bind(_521.handleEvent,_521);
}else{
throw Error("Invalid listener argument");
}
}
if(_522>goog.Timer.MAX_TIMEOUT_){
return -1;
}else{
return goog.Timer.defaultTimerObject.setTimeout(_521,_522||0);
}
};
goog.Timer.clear=function(_524){
goog.Timer.defaultTimerObject.clearTimeout(_524);
};
goog.provide("goog.fx.Animation");
goog.provide("goog.fx.Animation.EventType");
goog.provide("goog.fx.Animation.State");
goog.provide("goog.fx.AnimationEvent");
goog.require("goog.Timer");
goog.require("goog.array");
goog.require("goog.events.Event");
goog.require("goog.events.EventTarget");
goog.require("goog.object");
goog.fx.Animation=function(_525,end,_527,_528){
goog.events.EventTarget.call(this);
if(!goog.isArray(_525)||!goog.isArray(end)){
throw Error("Start and end parameters must be arrays");
}
if(_525.length!=end.length){
throw Error("Start and end points must be the same length");
}
this.startPoint=_525;
this.endPoint=end;
this.duration=_527;
this.accel_=_528;
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 now=goog.now();
for(var uid in goog.fx.Animation.activeAnimations_){
goog.fx.Animation.activeAnimations_[uid].cycle(now);
}
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(_52b){
var uid=goog.getUid(_52b);
if(!(uid in goog.fx.Animation.activeAnimations_)){
goog.fx.Animation.activeAnimations_[uid]=_52b;
}
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(_52d){
var uid=goog.getUid(_52d);
delete goog.fx.Animation.activeAnimations_[uid];
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(_52f){
if(_52f||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;
if(!this.progress){
this.onBegin();
}
this.onPlay();
if(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(_530){
goog.fx.Animation.unregisterAnimation(this);
this.state_=goog.fx.Animation.State.STOPPED;
if(_530){
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(){
if(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(now){
this.progress=(now-this.startTime)/(this.endTime-this.startTime);
if(this.progress>=1){
this.progress=1;
}
this.fps_=1000/(now-this.lastFrame);
this.lastFrame=now;
if(goog.isFunction(this.accel_)){
this.updateCoords_(this.accel_(this.progress));
}else{
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{
if(this.state_==goog.fx.Animation.State.PLAYING){
this.onAnimate();
}
}
};
goog.fx.Animation.prototype.updateCoords_=function(t){
this.coords=new Array(this.startPoint.length);
for(var i=0;i<this.startPoint.length;i++){
this.coords[i]=(this.endPoint[i]-this.startPoint[i])*t+this.startPoint[i];
}
};
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(type){
this.dispatchEvent(new goog.fx.AnimationEvent(type,this));
};
goog.fx.AnimationEvent=function(type,anim){
goog.events.Event.call(this,type);
this.coords=anim.coords;
this.x=anim.coords[0];
this.y=anim.coords[1];
this.z=anim.coords[2];
this.duration=anim.duration;
this.progress=anim.progress;
this.fps=anim.fps_;
this.state=anim.state_;
this.anim=anim;
};
goog.inherits(goog.fx.AnimationEvent,goog.events.Event);
goog.fx.AnimationEvent.prototype.coordsAsInts=function(){
return goog.array.map(this.coords,Math.round);
};
goog.provide("goog.math.Box");
goog.require("goog.math.Coordinate");
goog.math.Box=function(top,_538,_539,left){
this.top=top;
this.right=_538;
this.bottom=_539;
this.left=left;
};
goog.math.Box.boundingBox=function(_53b){
var box=new goog.math.Box(arguments[0].y,arguments[0].x,arguments[0].y,arguments[0].x);
for(var i=1;i<arguments.length;i++){
var _53e=arguments[i];
box.top=Math.min(box.top,_53e.y);
box.right=Math.max(box.right,_53e.x);
box.bottom=Math.max(box.bottom,_53e.y);
box.left=Math.min(box.left,_53e.x);
}
return box;
};
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(_53f){
return goog.math.Box.contains(this,_53f);
};
goog.math.Box.prototype.expand=function(top,_541,_542,_543){
if(goog.isObject(top)){
this.top-=top.top;
this.right+=top.right;
this.bottom+=top.bottom;
this.left-=top.left;
}else{
this.top-=top;
this.right+=_541;
this.bottom+=_542;
this.left-=_543;
}
return this;
};
goog.math.Box.prototype.expandToInclude=function(box){
this.left=Math.min(this.left,box.left);
this.top=Math.min(this.top,box.top);
this.right=Math.max(this.right,box.right);
this.bottom=Math.max(this.bottom,box.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(box,_548){
if(!box||!_548){
return false;
}
if(_548 instanceof goog.math.Box){
return _548.left>=box.left&&_548.right<=box.right&&_548.top>=box.top&&_548.bottom<=box.bottom;
}
return _548.x>=box.left&&_548.x<=box.right&&_548.y>=box.top&&_548.y<=box.bottom;
};
goog.math.Box.distance=function(box,_54a){
if(_54a.x>=box.left&&_54a.x<=box.right){
if(_54a.y>=box.top&&_54a.y<=box.bottom){
return 0;
}
return _54a.y<box.top?box.top-_54a.y:_54a.y-box.bottom;
}
if(_54a.y>=box.top&&_54a.y<=box.bottom){
return _54a.x<box.left?box.left-_54a.x:_54a.x-box.right;
}
return goog.math.Coordinate.distance(_54a,new goog.math.Coordinate(_54a.x<box.left?box.left:box.right,_54a.y<box.top?box.top:box.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.provide("goog.math.Rect");
goog.require("goog.math.Box");
goog.require("goog.math.Size");
goog.math.Rect=function(x,y,w,h){
this.left=x;
this.top=y;
this.width=w;
this.height=h;
};
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(){
var _551=this.left+this.width;
var _552=this.top+this.height;
return new goog.math.Box(this.top,_551,_552,this.left);
};
goog.math.Rect.createFromBox=function(box){
return new goog.math.Rect(box.left,box.top,box.right-box.left,box.bottom-box.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(rect){
var x0=Math.max(this.left,rect.left);
var x1=Math.min(this.left+this.width,rect.left+rect.width);
if(x0<=x1){
var y0=Math.max(this.top,rect.top);
var y1=Math.min(this.top+this.height,rect.top+rect.height);
if(y0<=y1){
this.left=x0;
this.top=y0;
this.width=x1-x0;
this.height=y1-y0;
return true;
}
}
return false;
};
goog.math.Rect.intersection=function(a,b){
var x0=Math.max(a.left,b.left);
var x1=Math.min(a.left+a.width,b.left+b.width);
if(x0<=x1){
var y0=Math.max(a.top,b.top);
var y1=Math.min(a.top+a.height,b.top+b.height);
if(y0<=y1){
return new goog.math.Rect(x0,y0,x1-x0,y1-y0);
}
}
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(rect){
return goog.math.Rect.intersects(this,rect);
};
goog.math.Rect.difference=function(a,b){
var _566=goog.math.Rect.intersection(a,b);
if(!_566||!_566.height||!_566.width){
return [a.clone()];
}
var _567=[];
var top=a.top;
var _569=a.height;
var ar=a.left+a.width;
var ab=a.top+a.height;
var br=b.left+b.width;
var bb=b.top+b.height;
if(b.top>a.top){
_567.push(new goog.math.Rect(a.left,a.top,a.width,b.top-a.top));
top=b.top;
_569-=b.top-a.top;
}
if(bb<ab){
_567.push(new goog.math.Rect(a.left,bb,a.width,ab-bb));
_569=bb-top;
}
if(b.left>a.left){
_567.push(new goog.math.Rect(a.left,top,b.left-a.left,_569));
}
if(br<ar){
_567.push(new goog.math.Rect(br,top,ar-br,_569));
}
return _567;
};
goog.math.Rect.prototype.difference=function(rect){
return goog.math.Rect.difference(this,rect);
};
goog.math.Rect.prototype.boundingRect=function(rect){
var _570=Math.max(this.left+this.width,rect.left+rect.width);
var _571=Math.max(this.top+this.height,rect.top+rect.height);
this.left=Math.min(this.left,rect.left);
this.top=Math.min(this.top,rect.top);
this.width=_570-this.left;
this.height=_571-this.top;
};
goog.math.Rect.boundingRect=function(a,b){
if(!a||!b){
return null;
}
var _574=a.clone();
_574.boundingRect(b);
return _574;
};
goog.math.Rect.prototype.contains=function(_575){
if(_575 instanceof goog.math.Rect){
return this.left<=_575.left&&this.left+this.width>=_575.left+_575.width&&this.top<=_575.top&&this.top+this.height>=_575.top+_575.height;
}else{
return _575.x>=this.left&&_575.x<=this.left+this.width&&_575.y>=this.top&&_575.y<=this.top+this.height;
}
};
goog.math.Rect.prototype.getSize=function(){
return new goog.math.Size(this.width,this.height);
};
goog.provide("goog.style");
goog.require("goog.array");
goog.require("goog.dom");
goog.require("goog.math.Box");
goog.require("goog.math.Coordinate");
goog.require("goog.math.Rect");
goog.require("goog.math.Size");
goog.require("goog.object");
goog.require("goog.userAgent");
goog.style.setStyle=function(_576,_577,_578){
if(goog.isString(_577)){
goog.style.setStyle_(_576,_578,_577);
}else{
goog.object.forEach(_577,goog.partial(goog.style.setStyle_,_576));
}
};
goog.style.setStyle_=function(_579,_57a,_57b){
_579.style[goog.style.toCamelCase(_57b)]=_57a;
};
goog.style.getStyle=function(_57c,_57d){
return _57c.style[goog.style.toCamelCase(_57d)];
};
goog.style.getComputedStyle=function(_57e,_57f){
var doc=goog.dom.getOwnerDocument(_57e);
if(doc.defaultView&&doc.defaultView.getComputedStyle){
var _581=doc.defaultView.getComputedStyle(_57e,"");
if(_581){
return _581[_57f];
}
}
return null;
};
goog.style.getCascadedStyle=function(_582,_583){
return _582.currentStyle?_582.currentStyle[_583]:null;
};
goog.style.getStyle_=function(_584,_585){
return goog.style.getComputedStyle(_584,_585)||goog.style.getCascadedStyle(_584,_585)||_584.style[_585];
};
goog.style.getComputedPosition=function(_586){
return goog.style.getStyle_(_586,"position");
};
goog.style.getBackgroundColor=function(_587){
return goog.style.getStyle_(_587,"backgroundColor");
};
goog.style.getComputedOverflowX=function(_588){
return goog.style.getStyle_(_588,"overflowX");
};
goog.style.getComputedOverflowY=function(_589){
return goog.style.getStyle_(_589,"overflowY");
};
goog.style.getComputedZIndex=function(_58a){
return goog.style.getStyle_(_58a,"zIndex");
};
goog.style.getComputedTextAlign=function(_58b){
return goog.style.getStyle_(_58b,"textAlign");
};
goog.style.getComputedCursor=function(_58c){
return goog.style.getStyle_(_58c,"cursor");
};
goog.style.setPosition=function(el,arg1,_58f){
var x,y;
var _591=goog.userAgent.GECKO&&(goog.userAgent.MAC||goog.userAgent.X11)&&goog.userAgent.isVersion("1.9");
if(arg1 instanceof goog.math.Coordinate){
x=arg1.x;
y=arg1.y;
}else{
x=arg1;
y=_58f;
}
goog.style.setPixelStyleProperty_("left",_591,el,(x));
goog.style.setPixelStyleProperty_("top",_591,el,(y));
};
goog.style.getPosition=function(_592){
return new goog.math.Coordinate(_592.offsetLeft,_592.offsetTop);
};
goog.style.getClientViewportElement=function(_593){
var doc;
if(_593){
if(_593.nodeType==goog.dom.NodeType.DOCUMENT){
doc=_593;
}else{
doc=goog.dom.getOwnerDocument(_593);
}
}else{
doc=goog.dom.getDocument();
}
if(goog.userAgent.IE&&!goog.dom.getDomHelper(doc).isCss1CompatMode()){
return doc.body;
}
return doc.documentElement;
};
goog.style.getBoundingClientRect_=function(el){
var rect=el.getBoundingClientRect();
if(goog.userAgent.IE){
var doc=el.ownerDocument;
rect.left-=doc.documentElement.clientLeft+doc.body.clientLeft;
rect.top-=doc.documentElement.clientTop+doc.body.clientTop;
}
return (rect);
};
goog.style.getOffsetParent=function(_598){
if(goog.userAgent.IE){
return _598.offsetParent;
}
var doc=goog.dom.getOwnerDocument(_598);
var _59a=goog.style.getStyle_(_598,"position");
var _59b=_59a=="fixed"||_59a=="absolute";
for(var _59c=_598.parentNode;_59c&&_59c!=doc;_59c=_59c.parentNode){
_59a=goog.style.getStyle_((_59c),"position");
_59b=_59b&&_59a=="static"&&_59c!=doc.documentElement&&_59c!=doc.body;
if(!_59b&&(_59c.scrollWidth>_59c.clientWidth||_59c.scrollHeight>_59c.clientHeight||_59a=="fixed"||_59a=="absolute")){
return (_59c);
}
}
return null;
};
goog.style.getVisibleRectForElement=function(_59d){
var _59e=new goog.math.Box(0,Infinity,Infinity,0);
var dom=goog.dom.getDomHelper(_59d);
var body=dom.getDocument().body;
var _5a1=dom.getDocumentScrollElement();
var _5a2;
for(var el=_59d;el=goog.style.getOffsetParent(el);){
if((!goog.userAgent.IE||el.clientWidth!=0)&&(!goog.userAgent.WEBKIT||el.clientHeight!=0||el!=body)&&(el.scrollWidth!=el.clientWidth||el.scrollHeight!=el.clientHeight)&&goog.style.getStyle_(el,"overflow")!="visible"){
var pos=goog.style.getPageOffset(el);
var _5a5=goog.style.getClientLeftTop(el);
pos.x+=_5a5.x;
pos.y+=_5a5.y;
_59e.top=Math.max(_59e.top,pos.y);
_59e.right=Math.min(_59e.right,pos.x+el.clientWidth);
_59e.bottom=Math.min(_59e.bottom,pos.y+el.clientHeight);
_59e.left=Math.max(_59e.left,pos.x);
_5a2=_5a2||el!=_5a1;
}
}
var _5a6=_5a1.scrollLeft,scrollY=_5a1.scrollTop;
if(goog.userAgent.WEBKIT){
_59e.left+=_5a6;
_59e.top+=scrollY;
}else{
_59e.left=Math.max(_59e.left,_5a6);
_59e.top=Math.max(_59e.top,scrollY);
}
if(!_5a2||goog.userAgent.WEBKIT){
_59e.right+=_5a6;
_59e.bottom+=scrollY;
}
var _5a7=dom.getViewportSize();
_59e.right=Math.min(_59e.right,_5a6+_5a7.width);
_59e.bottom=Math.min(_59e.bottom,scrollY+_5a7.height);
return _59e.top>=0&&_59e.left>=0&&_59e.bottom>_59e.top&&_59e.right>_59e.left?_59e:null;
};
goog.style.scrollIntoContainerView=function(_5a8,_5a9,_5aa){
var _5ab=goog.style.getPageOffset(_5a8);
var _5ac=goog.style.getPageOffset(_5a9);
var _5ad=goog.style.getBorderBox(_5a9);
var relX=_5ab.x-_5ac.x-_5ad.left;
var relY=_5ab.y-_5ac.y-_5ad.top;
var _5b0=_5a9.clientWidth-_5a8.offsetWidth;
var _5b1=_5a9.clientHeight-_5a8.offsetHeight;
if(_5aa){
_5a9.scrollLeft+=relX-_5b0/2;
_5a9.scrollTop+=relY-_5b1/2;
}else{
_5a9.scrollLeft+=Math.min(relX,Math.max(relX-_5b0,0));
_5a9.scrollTop+=Math.min(relY,Math.max(relY-_5b1,0));
}
};
goog.style.getClientLeftTop=function(el){
if(goog.userAgent.GECKO&&!goog.userAgent.isVersion("1.9")){
var left=parseFloat(goog.style.getComputedStyle(el,"borderLeftWidth"));
if(goog.style.isRightToLeft(el)){
var _5b4=el.offsetWidth-el.clientWidth-left-parseFloat(goog.style.getComputedStyle(el,"borderRightWidth"));
left+=_5b4;
}
return new goog.math.Coordinate(left,parseFloat(goog.style.getComputedStyle(el,"borderTopWidth")));
}
return new goog.math.Coordinate(el.clientLeft,el.clientTop);
};
goog.style.getPageOffset=function(el){
var box,doc=goog.dom.getOwnerDocument(el);
var _5b7=goog.style.getStyle_(el,"position");
var _5b8=goog.userAgent.GECKO&&doc.getBoxObjectFor&&!el.getBoundingClientRect&&_5b7=="absolute"&&(box=doc.getBoxObjectFor(el))&&(box.screenX<0||box.screenY<0);
var pos=new goog.math.Coordinate(0,0);
var _5ba=goog.style.getClientViewportElement(doc);
if(el==_5ba){
return pos;
}
if(el.getBoundingClientRect){
box=goog.style.getBoundingClientRect_(el);
var _5bb=goog.dom.getDomHelper(doc).getDocumentScroll();
pos.x=box.left+_5bb.x;
pos.y=box.top+_5bb.y;
}else{
if(doc.getBoxObjectFor&&!_5b8){
box=doc.getBoxObjectFor(el);
var _5bc=doc.getBoxObjectFor(_5ba);
pos.x=box.screenX-_5bc.screenX;
pos.y=box.screenY-_5bc.screenY;
}else{
var _5bd=el;
do{
pos.x+=_5bd.offsetLeft;
pos.y+=_5bd.offsetTop;
if(_5bd!=el){
pos.x+=_5bd.clientLeft||0;
pos.y+=_5bd.clientTop||0;
}
if(goog.userAgent.WEBKIT&&goog.style.getComputedPosition(_5bd)=="fixed"){
pos.x+=doc.body.scrollLeft;
pos.y+=doc.body.scrollTop;
break;
}
_5bd=_5bd.offsetParent;
}while(_5bd&&_5bd!=el);
if(goog.userAgent.OPERA||(goog.userAgent.WEBKIT&&_5b7=="absolute")){
pos.y-=doc.body.offsetTop;
}
for(_5bd=el;(_5bd=goog.style.getOffsetParent(_5bd))&&_5bd!=doc.body&&_5bd!=_5ba;){
pos.x-=_5bd.scrollLeft;
if(!goog.userAgent.OPERA||_5bd.tagName!="TR"){
pos.y-=_5bd.scrollTop;
}
}
}
}
return pos;
};
goog.style.getPageOffsetLeft=function(el){
return goog.style.getPageOffset(el).x;
};
goog.style.getPageOffsetTop=function(el){
return goog.style.getPageOffset(el).y;
};
goog.style.getFramedPageOffset=function(el,_5c1){
var _5c2=new goog.math.Coordinate(0,0);
var _5c3=goog.dom.getWindow(goog.dom.getOwnerDocument(el));
var _5c4=el;
do{
var _5c5=_5c3==_5c1?goog.style.getPageOffset(_5c4):goog.style.getClientPosition(_5c4);
_5c2.x+=_5c5.x;
_5c2.y+=_5c5.y;
}while(_5c3&&_5c3!=_5c1&&(_5c4=_5c3.frameElement)&&(_5c3=_5c3.parent));
return _5c2;
};
goog.style.translateRectForAnotherFrame=function(rect,_5c7,_5c8){
if(_5c7.getDocument()!=_5c8.getDocument()){
var body=_5c7.getDocument().body;
var pos=goog.style.getFramedPageOffset(body,_5c8.getWindow());
pos=goog.math.Coordinate.difference(pos,goog.style.getPageOffset(body));
if(goog.userAgent.IE&&!_5c7.isCss1CompatMode()){
pos=goog.math.Coordinate.difference(pos,_5c7.getDocumentScroll());
}
rect.left+=pos.x;
rect.top+=pos.y;
}
};
goog.style.getRelativePosition=function(a,b){
var ap=goog.style.getClientPosition(a);
var bp=goog.style.getClientPosition(b);
return new goog.math.Coordinate(ap.x-bp.x,ap.y-bp.y);
};
goog.style.getClientPosition=function(el){
var pos=new goog.math.Coordinate;
if(el.nodeType==goog.dom.NodeType.ELEMENT){
if(el.getBoundingClientRect){
var box=goog.style.getBoundingClientRect_((el));
pos.x=box.left;
pos.y=box.top;
}else{
var _5d2=goog.dom.getDomHelper((el)).getDocumentScroll();
var _5d3=goog.style.getPageOffset((el));
pos.x=_5d3.x-_5d2.x;
pos.y=_5d3.y-_5d2.y;
}
}else{
pos.x=el.clientX;
pos.y=el.clientY;
}
return pos;
};
goog.style.setPageOffset=function(el,x,_5d6){
var cur=goog.style.getPageOffset(el);
if(x instanceof goog.math.Coordinate){
_5d6=x.y;
x=x.x;
}
var dx=x-cur.x;
var dy=_5d6-cur.y;
goog.style.setPosition(el,el.offsetLeft+dx,el.offsetTop+dy);
};
goog.style.setSize=function(_5da,w,_5dc){
var h;
if(w instanceof goog.math.Size){
h=w.height;
w=w.width;
}else{
if(_5dc==undefined){
throw Error("missing height argument");
}
h=_5dc;
}
goog.style.setWidth(_5da,(w));
goog.style.setHeight(_5da,(h));
};
goog.style.setPixelStyleProperty_=function(_5de,_5df,_5e0,_5e1){
if(typeof _5e1=="number"){
_5e1=(_5df?Math.round(_5e1):_5e1)+"px";
}
_5e0.style[_5de]=(_5e1);
};
goog.style.setHeight=goog.partial(goog.style.setPixelStyleProperty_,"height",true);
goog.style.setWidth=goog.partial(goog.style.setPixelStyleProperty_,"width",true);
goog.style.getSize=function(_5e2){
var _5e3=goog.userAgent.OPERA&&!goog.userAgent.isVersion("10");
if(goog.style.getStyle_(_5e2,"display")!="none"){
if(_5e3){
return new goog.math.Size(_5e2.offsetWidth||_5e2.clientWidth,_5e2.offsetHeight||_5e2.clientHeight);
}else{
return new goog.math.Size(_5e2.offsetWidth,_5e2.offsetHeight);
}
}
var _5e4=_5e2.style;
var _5e5=_5e4.display;
var _5e6=_5e4.visibility;
var _5e7=_5e4.position;
_5e4.visibility="hidden";
_5e4.position="absolute";
_5e4.display="inline";
var _5e8,originalHeight;
if(_5e3){
_5e8=_5e2.offsetWidth||_5e2.clientWidth;
originalHeight=_5e2.offsetHeight||_5e2.clientHeight;
}else{
_5e8=_5e2.offsetWidth;
originalHeight=_5e2.offsetHeight;
}
_5e4.display=_5e5;
_5e4.position=_5e7;
_5e4.visibility=_5e6;
return new goog.math.Size(_5e8,originalHeight);
};
goog.style.getBounds=function(_5e9){
var o=goog.style.getPageOffset(_5e9);
var s=goog.style.getSize(_5e9);
return new goog.math.Rect(o.x,o.y,s.width,s.height);
};
goog.style.toCamelCaseCache_={};
goog.style.toCamelCase=function(_5ec){
return goog.style.toCamelCaseCache_[_5ec]||(goog.style.toCamelCaseCache_[_5ec]=String(_5ec).replace(/\-([a-z])/g,function(all,_5ee){
return _5ee.toUpperCase();
}));
};
goog.style.toSelectorCaseCache_={};
goog.style.toSelectorCase=function(_5ef){
return goog.style.toSelectorCaseCache_[_5ef]||(goog.style.toSelectorCaseCache_[_5ef]=_5ef.replace(/([A-Z])/g,"-$1").toLowerCase());
};
goog.style.getOpacity=function(el){
var _5f1=el.style;
var _5f2="";
if("opacity" in _5f1){
_5f2=_5f1.opacity;
}else{
if("MozOpacity" in _5f1){
_5f2=_5f1.MozOpacity;
}else{
if("filter" in _5f1){
var _5f3=_5f1.filter.match(/alpha\(opacity=([\d.]+)\)/);
if(_5f3){
_5f2=String(_5f3[1]/100);
}
}
}
}
return _5f2==""?_5f2:Number(_5f2);
};
goog.style.setOpacity=function(el,_5f5){
var _5f6=el.style;
if("opacity" in _5f6){
_5f6.opacity=_5f5;
}else{
if("MozOpacity" in _5f6){
_5f6.MozOpacity=_5f5;
}else{
if("filter" in _5f6){
if(_5f5===""){
_5f6.filter="";
}else{
_5f6.filter="alpha(opacity="+_5f5*100+")";
}
}
}
}
};
goog.style.setTransparentBackgroundImage=function(el,src){
var _5f9=el.style;
if(goog.userAgent.IE&&!goog.userAgent.isVersion("8")){
_5f9.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader("+"src=\""+src+"\", sizingMethod=\"crop\")";
}else{
_5f9.backgroundImage="url("+src+")";
_5f9.backgroundPosition="top left";
_5f9.backgroundRepeat="no-repeat";
}
};
goog.style.clearTransparentBackgroundImage=function(el){
var _5fb=el.style;
if("filter" in _5fb){
_5fb.filter="";
}else{
_5fb.backgroundImage="none";
}
};
goog.style.showElement=function(el,_5fd){
el.style.display=_5fd?"":"none";
};
goog.style.isElementShown=function(el){
return el.style.display!="none";
};
goog.style.installStyles=function(_5ff,_600){
var dh=goog.dom.getDomHelper(_600);
var _602=null;
if(goog.userAgent.IE){
_602=dh.getDocument().createStyleSheet();
goog.style.setStyles(_602,_5ff);
}else{
var head=dh.getElementsByTagNameAndClass("head")[0];
if(!head){
var body=dh.getElementsByTagNameAndClass("body")[0];
head=dh.createDom("head");
body.parentNode.insertBefore(head,body);
}
_602=dh.createDom("style");
goog.style.setStyles(_602,_5ff);
dh.appendChild(head,_602);
}
return _602;
};
goog.style.uninstallStyles=function(_605){
var node=_605.ownerNode||_605.owningElement||(_605);
goog.dom.removeNode(node);
};
goog.style.setStyles=function(_607,_608){
if(goog.userAgent.IE){
_607.cssText=_608;
}else{
var _609=goog.userAgent.WEBKIT?"innerText":"innerHTML";
_607[_609]=_608;
}
};
goog.style.setPreWrap=function(el){
var _60b=el.style;
if(goog.userAgent.IE&&!goog.userAgent.isVersion("8")){
_60b.whiteSpace="pre";
_60b.wordWrap="break-word";
}else{
if(goog.userAgent.GECKO){
_60b.whiteSpace="-moz-pre-wrap";
}else{
if(goog.userAgent.OPERA){
_60b.whiteSpace="-o-pre-wrap";
}else{
_60b.whiteSpace="pre-wrap";
}
}
}
};
goog.style.setInlineBlock=function(el){
var _60d=el.style;
_60d.position="relative";
if(goog.userAgent.IE&&!goog.userAgent.isVersion("8")){
_60d.zoom="1";
_60d.display="inline";
}else{
if(goog.userAgent.GECKO){
_60d.display=goog.userAgent.isVersion("1.9a")?"inline-block":"-moz-inline-box";
}else{
_60d.display="inline-block";
}
}
};
goog.style.isRightToLeft=function(el){
return "rtl"==goog.style.getStyle_(el,"direction");
};
goog.style.unselectableStyle_=goog.userAgent.GECKO?"MozUserSelect":goog.userAgent.WEBKIT?"WebkitUserSelect":null;
goog.style.isUnselectable=function(el){
if(goog.style.unselectableStyle_){
return el.style[goog.style.unselectableStyle_].toLowerCase()=="none";
}else{
if(goog.userAgent.IE||goog.userAgent.OPERA){
return el.getAttribute("unselectable")=="on";
}
}
return false;
};
goog.style.setUnselectable=function(el,_611,_612){
var _613=!_612?el.getElementsByTagName("*"):null;
var name=goog.style.unselectableStyle_;
if(name){
var _615=_611?"none":"";
el.style[name]=_615;
if(_613){
for(var i=0,descendant;descendant=_613[i];i++){
descendant.style[name]=_615;
}
}
}else{
if(goog.userAgent.IE||goog.userAgent.OPERA){
var _615=_611?"on":"";
el.setAttribute("unselectable",_615);
if(_613){
for(var i=0,descendant;descendant=_613[i];i++){
descendant.setAttribute("unselectable",_615);
}
}
}
}
};
goog.style.getBorderBoxSize=function(_617){
return new goog.math.Size(_617.offsetWidth,_617.offsetHeight);
};
goog.style.setBorderBoxSize=function(_618,size){
var doc=goog.dom.getOwnerDocument(_618);
var _61b=goog.dom.getDomHelper(doc).isCss1CompatMode();
if(goog.userAgent.IE&&(!_61b||!goog.userAgent.isVersion("8"))){
var _61c=_618.style;
if(_61b){
var _61d=goog.style.getPaddingBox(_618);
var _61e=goog.style.getBorderBox(_618);
_61c.pixelWidth=size.width-_61e.left-_61d.left-_61d.right-_61e.right;
_61c.pixelHeight=size.height-_61e.top-_61d.top-_61d.bottom-_61e.bottom;
}else{
_61c.pixelWidth=size.width;
_61c.pixelHeight=size.height;
}
}else{
goog.style.setBoxSizingSize_(_618,size,"border-box");
}
};
goog.style.getContentBoxSize=function(_61f){
var doc=goog.dom.getOwnerDocument(_61f);
var _621=goog.userAgent.IE&&_61f.currentStyle;
if(_621&&goog.dom.getDomHelper(doc).isCss1CompatMode()&&_621.width!="auto"&&_621.height!="auto"&&!_621.boxSizing){
var _622=goog.style.getIePixelValue_(_61f,_621.width,"width","pixelWidth");
var _623=goog.style.getIePixelValue_(_61f,_621.height,"height","pixelHeight");
return new goog.math.Size(_622,_623);
}else{
var _624=goog.style.getBorderBoxSize(_61f);
var _625=goog.style.getPaddingBox(_61f);
var _626=goog.style.getBorderBox(_61f);
return new goog.math.Size(_624.width-_626.left-_625.left-_625.right-_626.right,_624.height-_626.top-_625.top-_625.bottom-_626.bottom);
}
};
goog.style.setContentBoxSize=function(_627,size){
var doc=goog.dom.getOwnerDocument(_627);
var _62a=goog.dom.getDomHelper(doc).isCss1CompatMode();
if(goog.userAgent.IE&&(!_62a||!goog.userAgent.isVersion("8"))){
var _62b=_627.style;
if(_62a){
_62b.pixelWidth=size.width;
_62b.pixelHeight=size.height;
}else{
var _62c=goog.style.getPaddingBox(_627);
var _62d=goog.style.getBorderBox(_627);
_62b.pixelWidth=size.width+_62d.left+_62c.left+_62c.right+_62d.right;
_62b.pixelHeight=size.height+_62d.top+_62c.top+_62c.bottom+_62d.bottom;
}
}else{
goog.style.setBoxSizingSize_(_627,size,"content-box");
}
};
goog.style.setBoxSizingSize_=function(_62e,size,_630){
var _631=_62e.style;
if(goog.userAgent.GECKO){
_631.MozBoxSizing=_630;
}else{
if(goog.userAgent.WEBKIT){
_631.WebkitBoxSizing=_630;
}else{
if(goog.userAgent.OPERA&&!goog.userAgent.isVersion("9.50")){
if(_630){
_631.setProperty("box-sizing",_630);
}else{
_631.removeProperty("box-sizing");
}
}else{
_631.boxSizing=_630;
}
}
}
_631.width=size.width+"px";
_631.height=size.height+"px";
};
goog.style.getIePixelValue_=function(_632,_633,name,_635){
if(/^\d+px?$/.test(_633)){
return parseInt(_633,10);
}else{
var _636=_632.style[name];
var _637=_632.runtimeStyle[name];
_632.runtimeStyle[name]=_632.currentStyle[name];
_632.style[name]=_633;
var _638=_632.style[_635];
_632.style[name]=_636;
_632.runtimeStyle[name]=_637;
return _638;
}
};
goog.style.getIePixelDistance_=function(_639,_63a){
return goog.style.getIePixelValue_(_639,goog.style.getCascadedStyle(_639,_63a),"left","pixelLeft");
};
goog.style.getBox_=function(_63b,_63c){
if(goog.userAgent.IE){
var left=goog.style.getIePixelDistance_(_63b,_63c+"Left");
var _63e=goog.style.getIePixelDistance_(_63b,_63c+"Right");
var top=goog.style.getIePixelDistance_(_63b,_63c+"Top");
var _640=goog.style.getIePixelDistance_(_63b,_63c+"Bottom");
return new goog.math.Box(top,_63e,_640,left);
}else{
var left=(goog.style.getComputedStyle(_63b,_63c+"Left"));
var _63e=(goog.style.getComputedStyle(_63b,_63c+"Right"));
var top=(goog.style.getComputedStyle(_63b,_63c+"Top"));
var _640=(goog.style.getComputedStyle(_63b,_63c+"Bottom"));
return new goog.math.Box(parseFloat(top),parseFloat(_63e),parseFloat(_640),parseFloat(left));
}
};
goog.style.getPaddingBox=function(_641){
return goog.style.getBox_(_641,"padding");
};
goog.style.getMarginBox=function(_642){
return goog.style.getBox_(_642,"margin");
};
goog.style.ieBorderWidthKeywords_={"thin":2,"medium":4,"thick":6};
goog.style.getIePixelBorder_=function(_643,prop){
if(goog.style.getCascadedStyle(_643,prop+"Style")=="none"){
return 0;
}
var _645=goog.style.getCascadedStyle(_643,prop+"Width");
if(_645 in goog.style.ieBorderWidthKeywords_){
return goog.style.ieBorderWidthKeywords_[_645];
}
return goog.style.getIePixelValue_(_643,_645,"left","pixelLeft");
};
goog.style.getBorderBox=function(_646){
if(goog.userAgent.IE){
var left=goog.style.getIePixelBorder_(_646,"borderLeft");
var _648=goog.style.getIePixelBorder_(_646,"borderRight");
var top=goog.style.getIePixelBorder_(_646,"borderTop");
var _64a=goog.style.getIePixelBorder_(_646,"borderBottom");
return new goog.math.Box(top,_648,_64a,left);
}else{
var left=(goog.style.getComputedStyle(_646,"borderLeftWidth"));
var _648=(goog.style.getComputedStyle(_646,"borderRightWidth"));
var top=(goog.style.getComputedStyle(_646,"borderTopWidth"));
var _64a=(goog.style.getComputedStyle(_646,"borderBottomWidth"));
return new goog.math.Box(parseFloat(top),parseFloat(_648),parseFloat(_64a),parseFloat(left));
}
};
goog.style.getFontFamily=function(el){
var doc=goog.dom.getOwnerDocument(el);
var font="";
if(doc.body.createTextRange){
var _64e=doc.body.createTextRange();
_64e.moveToElementText(el);
font=_64e.queryCommandValue("FontName");
}
if(!font){
font=goog.style.getStyle_(el,"fontFamily");
if(goog.userAgent.OPERA&&goog.userAgent.LINUX){
font=font.replace(/ \[[^\]]*\]/,"");
}
}
var _64f=font.split(",");
if(_64f.length>1){
font=_64f[0];
}
return goog.string.stripQuotes(font,"\"'");
};
goog.style.lengthUnitRegex_=/[^\d]+$/;
goog.style.getLengthUnits=function(_650){
var _651=_650.match(goog.style.lengthUnitRegex_);
return _651&&_651[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(el){
var _653=goog.style.getStyle_(el,"fontSize");
var _654=goog.style.getLengthUnits(_653);
if(_653&&"px"==_654){
return parseInt(_653,10);
}
if(goog.userAgent.IE){
if(_654 in goog.style.ABSOLUTE_CSS_LENGTH_UNITS_){
return goog.style.getIePixelValue_(el,_653,"left","pixelLeft");
}else{
if(el.parentNode&&el.parentNode.nodeType==goog.dom.NodeType.ELEMENT&&_654 in goog.style.CONVERTIBLE_RELATIVE_CSS_UNITS_){
var _655=(el.parentNode);
var _656=goog.style.getStyle_(_655,"fontSize");
return goog.style.getIePixelValue_(_655,_653==_656?"1em":_653,"left","pixelLeft");
}
}
}
var _657=goog.dom.createDom("span",{"style":"visibility:hidden;position:absolute;"+"line-height:0;padding:0;margin:0;border:0;height:1em;"});
goog.dom.appendChild(el,_657);
_653=_657.offsetHeight;
goog.dom.removeNode(_657);
return _653;
};
goog.style.parseStyleAttribute=function(_658){
var _659={};
goog.array.forEach(_658.split(/\s*;\s*/),function(pair){
var _65b=pair.split(/\s*:\s*/);
if(_65b.length==2){
_659[goog.style.toCamelCase(_65b[0].toLowerCase())]=_65b[1];
}
});
return _659;
};
goog.style.toStyleAttribute=function(obj){
var _65d=[];
goog.object.forEach(obj,function(_65e,key){
_65d.push(goog.style.toSelectorCase(key),":",_65e,";");
});
return _65d.join("");
};
goog.style.setFloat=function(el,_661){
el.style[goog.userAgent.IE?"styleFloat":"cssFloat"]=_661;
};
goog.style.getFloat=function(el){
return el.style[goog.userAgent.IE?"styleFloat":"cssFloat"]||"";
};
goog.style.getScrollbarWidth=function(){
var _663=goog.dom.createElement("div");
_663.style.cssText="visibility:hidden;overflow:scroll;"+"position:absolute;top:0;width:100px;height:100px";
goog.dom.appendChild(goog.dom.getDocument().body,_663);
var _664=_663.offsetWidth-_663.clientWidth;
goog.dom.removeNode(_663);
return _664;
};
goog.provide("goog.fx.dom");
goog.provide("goog.fx.dom.BgColorTransform");
goog.provide("goog.fx.dom.ColorTransform");
goog.provide("goog.fx.dom.Fade");
goog.provide("goog.fx.dom.FadeIn");
goog.provide("goog.fx.dom.FadeInAndShow");
goog.provide("goog.fx.dom.FadeOut");
goog.provide("goog.fx.dom.FadeOutAndHide");
goog.provide("goog.fx.dom.PredefinedEffect");
goog.provide("goog.fx.dom.Resize");
goog.provide("goog.fx.dom.ResizeHeight");
goog.provide("goog.fx.dom.ResizeWidth");
goog.provide("goog.fx.dom.Scroll");
goog.provide("goog.fx.dom.Slide");
goog.provide("goog.fx.dom.SlideFrom");
goog.provide("goog.fx.dom.Swipe");
goog.require("goog.color");
goog.require("goog.events");
goog.require("goog.fx.Animation");
goog.require("goog.fx.Animation.EventType");
goog.require("goog.style");
goog.fx.dom.PredefinedEffect=function(_665,_666,end,time,_669){
goog.fx.Animation.call(this,_666,end,time,_669);
this.element=_665;
};
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(_66a,_66b,end,time,_66e){
if(_66b.length!=2||end.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(_66f,end,time,_672){
var _673=[_66f.offsetLeft,_66f.offsetTop];
goog.fx.dom.Slide.call(this,_66f,_673,end,time,_672);
};
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(_674,_675,end,time,_678){
if(_675.length!=2||end.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 x=this.coords[0];
var y=this.coords[1];
this.clip_(Math.round(x),Math.round(y),this.maxWidth_,this.maxHeight_);
this.element.style.width=Math.round(x)+"px";
this.element.style.marginLeft=Math.round(x)-this.maxWidth_+"px";
this.element.style.marginTop=Math.round(y)-this.maxHeight_+"px";
};
goog.fx.dom.Swipe.prototype.clip_=function(x,y,w,h){
this.element.style.clip="rect("+(h-y)+"px "+w+"px "+h+"px "+(w-x)+"px)";
};
goog.fx.dom.Scroll=function(_67f,_680,end,time,_683){
if(_680.length!=2||end.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(_684,_685,end,time,_688){
if(_685.length!=2||end.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(_689,_68a,end,time,_68d){
goog.fx.dom.PredefinedEffect.call(this,_689,[_68a],[end],time,_68d);
};
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(_68e,_68f,end,time,_692){
goog.fx.dom.PredefinedEffect.call(this,_68e,[_68f],[end],time,_692);
};
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(_693,_694,end,time,_697){
if(goog.isNumber(_694)){
_694=[_694];
}
if(goog.isNumber(end)){
end=[end];
}
goog.fx.dom.PredefinedEffect.call(this,_693,_694,end,time,_697);
if(_694.length!=1||end.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(_698,time,_69a){
goog.fx.dom.Fade.call(this,_698,1,0,time,_69a);
};
goog.inherits(goog.fx.dom.FadeOut,goog.fx.dom.Fade);
goog.fx.dom.FadeIn=function(_69b,time,_69d){
goog.fx.dom.Fade.call(this,_69b,0,1,time,_69d);
};
goog.inherits(goog.fx.dom.FadeIn,goog.fx.dom.Fade);
goog.fx.dom.FadeOutAndHide=function(_69e,time,_6a0){
goog.fx.dom.Fade.call(this,_69e,1,0,time,_6a0);
};
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(_6a1,time,_6a3){
goog.fx.dom.Fade.call(this,_6a1,0,1,time,_6a3);
};
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(_6a4,_6a5,end,time,_6a8){
if(_6a5.length!=3||end.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(){
var _6a9=[];
for(var i=0;i<this.coords.length;i++){
_6a9[i]=Math.round(this.coords[i]);
}
var _6ab="rgb("+_6a9.join(",")+")";
this.element.style.backgroundColor=_6ab;
};
goog.fx.dom.BgColorTransform.prototype.updateStyle=function(){
this.setColor();
};
goog.fx.dom.bgColorFadeIn=function(_6ac,_6ad,time){
var _6af=_6ac.style.backgroundColor||"";
var _6b0=goog.style.getBackgroundColor(_6ac);
var end;
if(_6b0!="transparent"&&_6b0!="rgba(0, 0, 0, 0)"){
end=goog.color.hexToRgb(goog.color.parse(_6b0).hex);
}else{
end=[255,255,255];
}
var anim=new goog.fx.dom.BgColorTransform(_6ac,_6ad,end,time);
goog.events.listen(anim,goog.fx.Animation.EventType.END,function(){
_6ac.style.backgroundColor=_6af;
});
anim.play();
};
goog.fx.dom.ColorTransform=function(_6b3,_6b4,end,time,_6b7){
if(_6b4.length!=3||end.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(){
var _6b8=[];
for(var i=0;i<this.coords.length;i++){
_6b8[i]=Math.round(this.coords[i]);
}
var _6ba="rgb("+_6b8.join(",")+")";
this.element.style.color=_6ba;
};
goog.provide("goog.structs");
goog.require("goog.array");
goog.require("goog.object");
goog.structs.getCount=function(col){
if(typeof col.getCount=="function"){
return col.getCount();
}
if(goog.isArrayLike(col)||goog.isString(col)){
return col.length;
}
return goog.object.getCount(col);
};
goog.structs.getValues=function(col){
if(typeof col.getValues=="function"){
return col.getValues();
}
if(goog.isString(col)){
return col.split("");
}
if(goog.isArrayLike(col)){
var rv=[];
var l=col.length;
for(var i=0;i<l;i++){
rv.push(col[i]);
}
return rv;
}
return goog.object.getValues(col);
};
goog.structs.getKeys=function(col){
if(typeof col.getKeys=="function"){
return col.getKeys();
}
if(typeof col.getValues=="function"){
return undefined;
}
if(goog.isArrayLike(col)||goog.isString(col)){
var rv=[];
var l=col.length;
for(var i=0;i<l;i++){
rv.push(i);
}
return rv;
}
return goog.object.getKeys(col);
};
goog.structs.contains=function(col,val){
if(typeof col.contains=="function"){
return col.contains(val);
}
if(typeof col.containsValue=="function"){
return col.containsValue(val);
}
if(goog.isArrayLike(col)||goog.isString(col)){
return goog.array.contains((col),val);
}
return goog.object.containsValue(col,val);
};
goog.structs.isEmpty=function(col){
if(typeof col.isEmpty=="function"){
return col.isEmpty();
}
if(goog.isArrayLike(col)||goog.isString(col)){
return goog.array.isEmpty((col));
}
return goog.object.isEmpty(col);
};
goog.structs.clear=function(col){
if(typeof col.clear=="function"){
col.clear();
}else{
if(goog.isArrayLike(col)){
goog.array.clear((col));
}else{
goog.object.clear(col);
}
}
};
goog.structs.forEach=function(col,f,_6ca){
if(typeof col.forEach=="function"){
col.forEach(f,_6ca);
}else{
if(goog.isArrayLike(col)||goog.isString(col)){
goog.array.forEach((col),f,_6ca);
}else{
var keys=goog.structs.getKeys(col);
var _6cc=goog.structs.getValues(col);
var l=_6cc.length;
for(var i=0;i<l;i++){
f.call(_6ca,_6cc[i],keys&&keys[i],col);
}
}
}
};
goog.structs.filter=function(col,f,_6d1){
if(typeof col.filter=="function"){
return col.filter(f,_6d1);
}
if(goog.isArrayLike(col)||goog.isString(col)){
return goog.array.filter((col),f,_6d1);
}
var rv;
var keys=goog.structs.getKeys(col);
var _6d4=goog.structs.getValues(col);
var l=_6d4.length;
if(keys){
rv={};
for(var i=0;i<l;i++){
if(f.call(_6d1,_6d4[i],keys[i],col)){
rv[keys[i]]=_6d4[i];
}
}
}else{
rv=[];
for(var i=0;i<l;i++){
if(f.call(_6d1,_6d4[i],undefined,col)){
rv.push(_6d4[i]);
}
}
}
return rv;
};
goog.structs.map=function(col,f,_6d9){
if(typeof col.map=="function"){
return col.map(f,_6d9);
}
if(goog.isArrayLike(col)||goog.isString(col)){
return goog.array.map((col),f,_6d9);
}
var rv;
var keys=goog.structs.getKeys(col);
var _6dc=goog.structs.getValues(col);
var l=_6dc.length;
if(keys){
rv={};
for(var i=0;i<l;i++){
rv[keys[i]]=f.call(_6d9,_6dc[i],keys[i],col);
}
}else{
rv=[];
for(var i=0;i<l;i++){
rv[i]=f.call(_6d9,_6dc[i],undefined,col);
}
}
return rv;
};
goog.structs.some=function(col,f,_6e1){
if(typeof col.some=="function"){
return col.some(f,_6e1);
}
if(goog.isArrayLike(col)||goog.isString(col)){
return goog.array.some((col),f,_6e1);
}
var keys=goog.structs.getKeys(col);
var _6e3=goog.structs.getValues(col);
var l=_6e3.length;
for(var i=0;i<l;i++){
if(f.call(_6e1,_6e3[i],keys&&keys[i],col)){
return true;
}
}
return false;
};
goog.structs.every=function(col,f,_6e8){
if(typeof col.every=="function"){
return col.every(f,_6e8);
}
if(goog.isArrayLike(col)||goog.isString(col)){
return goog.array.every((col),f,_6e8);
}
var keys=goog.structs.getKeys(col);
var _6ea=goog.structs.getValues(col);
var l=_6ea.length;
for(var i=0;i<l;i++){
if(!f.call(_6e8,_6ea[i],keys&&keys[i],col)){
return false;
}
}
return true;
};
goog.provide("goog.iter");
goog.provide("goog.iter.Iterator");
goog.provide("goog.iter.StopIteration");
goog.require("goog.array");
goog.iter.Iterable;
if("StopIteration" in goog.global){
goog.iter.StopIteration=goog.global["StopIteration"];
}else{
goog.iter.StopIteration=Error("StopIteration");
}
goog.iter.Iterator=function(){
};
goog.iter.Iterator.prototype.next=function(){
throw goog.iter.StopIteration;
};
goog.iter.Iterator.prototype.__iterator__=function(_6ed){
return this;
};
goog.iter.toIterator=function(_6ee){
if(_6ee instanceof goog.iter.Iterator){
return _6ee;
}
if(typeof _6ee.__iterator__=="function"){
return _6ee.__iterator__(false);
}
if(goog.isArrayLike(_6ee)){
var i=0;
var _6f0=new goog.iter.Iterator;
_6f0.next=function(){
while(true){
if(i>=_6ee.length){
throw goog.iter.StopIteration;
}
if(!(i in _6ee)){
i++;
continue;
}
return _6ee[i++];
}
};
return _6f0;
}
throw Error("Not implemented");
};
goog.iter.forEach=function(_6f1,f,_6f3){
if(goog.isArrayLike(_6f1)){
try{
goog.array.forEach((_6f1),f,_6f3);
}
catch(ex){
if(ex!==goog.iter.StopIteration){
throw ex;
}
}
}else{
_6f1=goog.iter.toIterator(_6f1);
try{
while(true){
f.call(_6f3,_6f1.next(),undefined,_6f1);
}
}
catch(ex){
if(ex!==goog.iter.StopIteration){
throw ex;
}
}
}
};
goog.iter.filter=function(_6f4,f,_6f6){
_6f4=goog.iter.toIterator(_6f4);
var _6f7=new goog.iter.Iterator;
_6f7.next=function(){
while(true){
var val=_6f4.next();
if(f.call(_6f6,val,undefined,_6f4)){
return val;
}
}
};
return _6f7;
};
goog.iter.range=function(_6f9,_6fa,_6fb){
var _6fc=0;
var stop=_6f9;
var step=_6fb||1;
if(arguments.length>1){
_6fc=_6f9;
stop=_6fa;
}
if(step==0){
throw Error("Range step argument must not be zero");
}
var _6ff=new goog.iter.Iterator;
_6ff.next=function(){
if(step>0&&_6fc>=stop||step<0&&_6fc<=stop){
throw goog.iter.StopIteration;
}
var rv=_6fc;
_6fc+=step;
return rv;
};
return _6ff;
};
goog.iter.join=function(_701,_702){
return goog.iter.toArray(_701).join(_702);
};
goog.iter.map=function(_703,f,_705){
_703=goog.iter.toIterator(_703);
var _706=new goog.iter.Iterator;
_706.next=function(){
while(true){
var val=_703.next();
return f.call(_705,val,undefined,_703);
}
};
return _706;
};
goog.iter.reduce=function(_708,f,val,_70b){
var rval=val;
goog.iter.forEach(_708,function(val){
rval=f.call(_70b,rval,val);
});
return rval;
};
goog.iter.some=function(_70e,f,_710){
_70e=goog.iter.toIterator(_70e);
try{
while(true){
if(f.call(_710,_70e.next(),undefined,_70e)){
return true;
}
}
}
catch(ex){
if(ex!==goog.iter.StopIteration){
throw ex;
}
}
return false;
};
goog.iter.every=function(_711,f,_713){
_711=goog.iter.toIterator(_711);
try{
while(true){
if(!f.call(_713,_711.next(),undefined,_711)){
return false;
}
}
}
catch(ex){
if(ex!==goog.iter.StopIteration){
throw ex;
}
}
return true;
};
goog.iter.chain=function(_714){
var args=arguments;
var _716=args.length;
var i=0;
var _718=new goog.iter.Iterator;
_718.next=function(){
try{
if(i>=_716){
throw goog.iter.StopIteration;
}
var _719=goog.iter.toIterator(args[i]);
return _719.next();
}
catch(ex){
if(ex!==goog.iter.StopIteration||i>=_716){
throw ex;
}else{
i++;
return this.next();
}
}
};
return _718;
};
goog.iter.dropWhile=function(_71a,f,_71c){
_71a=goog.iter.toIterator(_71a);
var _71d=new goog.iter.Iterator;
var _71e=true;
_71d.next=function(){
while(true){
var val=_71a.next();
if(_71e&&f.call(_71c,val,undefined,_71a)){
continue;
}else{
_71e=false;
}
return val;
}
};
return _71d;
};
goog.iter.takeWhile=function(_720,f,_722){
_720=goog.iter.toIterator(_720);
var _723=new goog.iter.Iterator;
var _724=true;
_723.next=function(){
while(true){
if(_724){
var val=_720.next();
if(f.call(_722,val,undefined,_720)){
return val;
}else{
_724=false;
}
}else{
throw goog.iter.StopIteration;
}
}
};
return _723;
};
goog.iter.toArray=function(_726){
if(goog.isArrayLike(_726)){
return goog.array.toArray((_726));
}
_726=goog.iter.toIterator(_726);
var _727=[];
goog.iter.forEach(_726,function(val){
_727.push(val);
});
return _727;
};
goog.iter.equals=function(_729,_72a){
_729=goog.iter.toIterator(_729);
_72a=goog.iter.toIterator(_72a);
var b1,b2;
try{
while(true){
b1=b2=false;
var val1=_729.next();
b1=true;
var val2=_72a.next();
b2=true;
if(val1!=val2){
return false;
}
}
}
catch(ex){
if(ex!==goog.iter.StopIteration){
throw ex;
}else{
if(b1&&!b2){
return false;
}
if(!b2){
try{
val2=_72a.next();
return false;
}
catch(ex1){
if(ex1!==goog.iter.StopIteration){
throw ex1;
}
return true;
}
}
}
}
return false;
};
goog.iter.nextOrValue=function(_72e,_72f){
try{
return goog.iter.toIterator(_72e).next();
}
catch(e){
if(e!=goog.iter.StopIteration){
throw e;
}
return _72f;
}
};
goog.provide("goog.structs.Map");
goog.require("goog.iter.Iterator");
goog.require("goog.iter.StopIteration");
goog.require("goog.object");
goog.require("goog.structs");
goog.structs.Map=function(_730,_731){
this.map_={};
this.keys_=[];
var _732=arguments.length;
if(_732>1){
if(_732%2){
throw Error("Uneven number of arguments");
}
for(var i=0;i<_732;i+=2){
this.set(arguments[i],arguments[i+1]);
}
}else{
if(_730){
this.addAll((_730));
}
}
};
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_();
var rv=[];
for(var i=0;i<this.keys_.length;i++){
var key=this.keys_[i];
rv.push(this.map_[key]);
}
return rv;
};
goog.structs.Map.prototype.getKeys=function(){
this.cleanupKeysArray_();
return (this.keys_.concat());
};
goog.structs.Map.prototype.containsKey=function(key){
return goog.structs.Map.hasKey_(this.map_,key);
};
goog.structs.Map.prototype.containsValue=function(val){
for(var i=0;i<this.keys_.length;i++){
var key=this.keys_[i];
if(goog.structs.Map.hasKey_(this.map_,key)&&this.map_[key]==val){
return true;
}
}
return false;
};
goog.structs.Map.prototype.equals=function(_73b,_73c){
if(this===_73b){
return true;
}
if(this.count_!=_73b.getCount()){
return false;
}
var _73d=_73c||goog.structs.Map.defaultEquals;
this.cleanupKeysArray_();
for(var key,i=0;key=this.keys_[i];i++){
if(!_73d(this.get(key),_73b.get(key))){
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.keys_.length=0;
this.count_=0;
this.version_=0;
};
goog.structs.Map.prototype.remove=function(key){
if(goog.structs.Map.hasKey_(this.map_,key)){
delete this.map_[key];
this.count_--;
this.version_++;
if(this.keys_.length>2*this.count_){
this.cleanupKeysArray_();
}
return true;
}
return false;
};
goog.structs.Map.prototype.cleanupKeysArray_=function(){
if(this.count_!=this.keys_.length){
var _742=0;
var _743=0;
while(_742<this.keys_.length){
var key=this.keys_[_742];
if(goog.structs.Map.hasKey_(this.map_,key)){
this.keys_[_743++]=key;
}
_742++;
}
this.keys_.length=_743;
}
if(this.count_!=this.keys_.length){
var seen={};
var _742=0;
var _743=0;
while(_742<this.keys_.length){
var key=this.keys_[_742];
if(!(goog.structs.Map.hasKey_(seen,key))){
this.keys_[_743++]=key;
seen[key]=1;
}
_742++;
}
this.keys_.length=_743;
}
};
goog.structs.Map.prototype.get=function(key,_747){
if(goog.structs.Map.hasKey_(this.map_,key)){
return this.map_[key];
}
return _747;
};
goog.structs.Map.prototype.set=function(key,_749){
if(!(goog.structs.Map.hasKey_(this.map_,key))){
this.count_++;
this.keys_.push(key);
this.version_++;
}
this.map_[key]=_749;
};
goog.structs.Map.prototype.addAll=function(map){
var keys,values;
if(map instanceof goog.structs.Map){
keys=map.getKeys();
values=map.getValues();
}else{
keys=goog.object.getKeys(map);
values=goog.object.getValues(map);
}
for(var i=0;i<keys.length;i++){
this.set(keys[i],values[i]);
}
};
goog.structs.Map.prototype.clone=function(){
return new goog.structs.Map(this);
};
goog.structs.Map.prototype.transpose=function(){
var _74d=new goog.structs.Map();
for(var i=0;i<this.keys_.length;i++){
var key=this.keys_[i];
var _750=this.map_[key];
_74d.set(_750,key);
}
return _74d;
};
goog.structs.Map.prototype.toObject=function(){
this.cleanupKeysArray_();
var obj={};
for(var i=0;i<this.keys_.length;i++){
var key=this.keys_[i];
obj[key]=this.map_[key];
}
return obj;
};
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(_754){
this.cleanupKeysArray_();
var i=0;
var keys=this.keys_;
var map=this.map_;
var _758=this.version_;
var _759=this;
var _75a=new goog.iter.Iterator;
_75a.next=function(){
while(true){
if(_758!=_759.version_){
throw Error("The map has changed since the iterator was created");
}
if(i>=keys.length){
throw goog.iter.StopIteration;
}
var key=keys[i++];
return _754?key:map[key];
}
};
return _75a;
};
goog.structs.Map.hasKey_=function(obj,key){
return Object.prototype.hasOwnProperty.call(obj,key);
};
goog.provide("goog.uri.utils");
goog.provide("goog.uri.utils.ComponentIndex");
goog.require("goog.asserts");
goog.require("goog.string");
goog.uri.utils.CharCode_={AMPERSAND:38,EQUAL:61,HASH:35,QUESTION:63};
goog.uri.utils.buildFromEncodedParts=function(_75e,_75f,_760,_761,_762,_763,_764){
var out=[];
if(_75e){
out.push(_75e,":");
}
if(_760){
out.push("//");
if(_75f){
out.push(_75f,"@");
}
out.push(_760);
if(_761){
out.push(":",_761);
}
}
if(_762){
out.push(_762);
}
if(_763){
out.push("?",_763);
}
if(_764){
out.push("#",_764);
}
return out.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(uri){
return (uri.match(goog.uri.utils.splitRe_));
};
goog.uri.utils.decodeIfPossible_=function(uri){
return uri&&decodeURIComponent(uri);
};
goog.uri.utils.getComponentByIndex_=function(_768,uri){
return goog.uri.utils.split(uri)[_768]||null;
};
goog.uri.utils.getScheme=function(uri){
return goog.uri.utils.getComponentByIndex_(goog.uri.utils.ComponentIndex.SCHEME,uri);
};
goog.uri.utils.getUserInfoEncoded=function(uri){
return goog.uri.utils.getComponentByIndex_(goog.uri.utils.ComponentIndex.USER_INFO,uri);
};
goog.uri.utils.getUserInfo=function(uri){
return goog.uri.utils.decodeIfPossible_(goog.uri.utils.getUserInfoEncoded(uri));
};
goog.uri.utils.getDomainEncoded=function(uri){
return goog.uri.utils.getComponentByIndex_(goog.uri.utils.ComponentIndex.DOMAIN,uri);
};
goog.uri.utils.getDomain=function(uri){
return goog.uri.utils.decodeIfPossible_(goog.uri.utils.getDomainEncoded(uri));
};
goog.uri.utils.getPort=function(uri){
return Number(goog.uri.utils.getComponentByIndex_(goog.uri.utils.ComponentIndex.PORT,uri))||null;
};
goog.uri.utils.getPathEncoded=function(uri){
return goog.uri.utils.getComponentByIndex_(goog.uri.utils.ComponentIndex.PATH,uri);
};
goog.uri.utils.getPath=function(uri){
return goog.uri.utils.decodeIfPossible_(goog.uri.utils.getPathEncoded(uri));
};
goog.uri.utils.getQueryData=function(uri){
return goog.uri.utils.getComponentByIndex_(goog.uri.utils.ComponentIndex.QUERY_DATA,uri);
};
goog.uri.utils.getFragmentEncoded=function(uri){
var _774=uri.indexOf("#");
return _774<0?null:uri.substr(_774+1);
};
goog.uri.utils.setFragmentEncoded=function(uri,_776){
return goog.uri.utils.removeFragment(uri)+(_776?"#"+_776:"");
};
goog.uri.utils.getFragment=function(uri){
return goog.uri.utils.decodeIfPossible_(goog.uri.utils.getFragmentEncoded(uri));
};
goog.uri.utils.getHost=function(uri){
var _779=goog.uri.utils.split(uri);
return goog.uri.utils.buildFromEncodedParts(_779[goog.uri.utils.ComponentIndex.SCHEME],_779[goog.uri.utils.ComponentIndex.USER_INFO],_779[goog.uri.utils.ComponentIndex.DOMAIN],_779[goog.uri.utils.ComponentIndex.PORT]);
};
goog.uri.utils.getPathAndAfter=function(uri){
var _77b=goog.uri.utils.split(uri);
return goog.uri.utils.buildFromEncodedParts(null,null,null,null,_77b[goog.uri.utils.ComponentIndex.PATH],_77b[goog.uri.utils.ComponentIndex.QUERY_DATA],_77b[goog.uri.utils.ComponentIndex.FRAGMENT]);
};
goog.uri.utils.removeFragment=function(uri){
var _77d=uri.indexOf("#");
return _77d<0?uri:uri.substr(0,_77d);
};
goog.uri.utils.haveSameDomain=function(uri1,uri2){
var _780=goog.uri.utils.split(uri1);
var _781=goog.uri.utils.split(uri2);
return _780[goog.uri.utils.ComponentIndex.DOMAIN]==_781[goog.uri.utils.ComponentIndex.DOMAIN]&&_780[goog.uri.utils.ComponentIndex.SCHEME]==_781[goog.uri.utils.ComponentIndex.SCHEME]&&_780[goog.uri.utils.ComponentIndex.PORT]==_781[goog.uri.utils.ComponentIndex.PORT];
};
goog.uri.utils.assertNoFragmentsOrQueries_=function(uri){
if(goog.DEBUG&&(uri.indexOf("#")>=0||uri.indexOf("?")>=0)){
throw Error("goog.uri.utils: Fragment or query identifiers are not "+"supported: ["+uri+"]");
}
};
goog.uri.utils.QueryValue;
goog.uri.utils.QueryArray;
goog.uri.utils.appendQueryData_=function(_783){
if(_783[1]){
var _784=(_783[0]);
var _785=_784.indexOf("#");
if(_785>=0){
_783.push(_784.substr(_785));
_783[0]=_784=_784.substr(0,_785);
}
var _786=_784.indexOf("?");
if(_786<0){
_783[1]="?";
}else{
if(_786==_784.length-1){
_783[1]=undefined;
}
}
}
return _783.join("");
};
goog.uri.utils.appendKeyValuePairs_=function(key,_788,_789){
if(goog.isArray(_788)){
_788=(_788);
for(var j=0;j<_788.length;j++){
_789.push("&",key);
if(_788[j]!==""){
_789.push("=",goog.string.urlEncode(_788[j]));
}
}
}else{
if(_788!=null){
_789.push("&",key);
if(_788!==""){
_789.push("=",goog.string.urlEncode(_788));
}
}
}
};
goog.uri.utils.buildQueryDataBuffer_=function(_78b,_78c,_78d){
goog.asserts.assert(Math.max(_78c.length-(_78d||0),0)%2==0,"goog.uri.utils: Key/value lists must be even in length.");
for(var i=_78d||0;i<_78c.length;i+=2){
goog.uri.utils.appendKeyValuePairs_(_78c[i],_78c[i+1],_78b);
}
return _78b;
};
goog.uri.utils.buildQueryData=function(_78f,_790){
var _791=goog.uri.utils.buildQueryDataBuffer_([],_78f,_790);
_791[0]="";
return _791.join("");
};
goog.uri.utils.buildQueryDataBufferFromMap_=function(_792,map){
for(var key in map){
goog.uri.utils.appendKeyValuePairs_(key,map[key],_792);
}
return _792;
};
goog.uri.utils.buildQueryDataFromMap=function(map){
var _796=goog.uri.utils.buildQueryDataBufferFromMap_([],map);
_796[0]="";
return _796.join("");
};
goog.uri.utils.appendParams=function(uri,_798){
return goog.uri.utils.appendQueryData_(arguments.length==2?goog.uri.utils.buildQueryDataBuffer_([uri],arguments[1],0):goog.uri.utils.buildQueryDataBuffer_([uri],arguments,1));
};
goog.uri.utils.appendParamsFromMap=function(uri,map){
return goog.uri.utils.appendQueryData_(goog.uri.utils.buildQueryDataBufferFromMap_([uri],map));
};
goog.uri.utils.appendParam=function(uri,key,_79d){
return goog.uri.utils.appendQueryData_([uri,"&",key,"=",goog.string.urlEncode(_79d)]);
};
goog.uri.utils.findParam_=function(uri,_79f,_7a0,_7a1){
var _7a2=_79f;
var _7a3=_7a0.length;
while((_7a2=uri.indexOf(_7a0,_7a2))>=0&&_7a2<_7a1){
var _7a4=uri.charCodeAt(_7a2-1);
if(_7a4==goog.uri.utils.CharCode_.AMPERSAND||_7a4==goog.uri.utils.CharCode_.QUESTION){
var _7a5=uri.charCodeAt(_7a2+_7a3);
if(!_7a5||_7a5==goog.uri.utils.CharCode_.EQUAL||_7a5==goog.uri.utils.CharCode_.AMPERSAND||_7a5==goog.uri.utils.CharCode_.HASH){
return _7a2;
}
}
_7a2+=_7a3+1;
}
return -1;
};
goog.uri.utils.hashOrEndRe_=/#|$/;
goog.uri.utils.hasParam=function(uri,_7a7){
return goog.uri.utils.findParam_(uri,0,_7a7,uri.search(goog.uri.utils.hashOrEndRe_))>=0;
};
goog.uri.utils.getParamValue=function(uri,_7a9){
var _7aa=uri.search(goog.uri.utils.hashOrEndRe_);
var _7ab=goog.uri.utils.findParam_(uri,0,_7a9,_7aa);
if(_7ab<0){
return null;
}else{
var _7ac=uri.indexOf("&",_7ab);
if(_7ac<0||_7ac>_7aa){
_7ac=_7aa;
}
_7ab+=_7a9.length+1;
return goog.string.urlDecode(uri.substr(_7ab,_7ac-_7ab));
}
};
goog.uri.utils.getParamValues=function(uri,_7ae){
var _7af=uri.search(goog.uri.utils.hashOrEndRe_);
var _7b0=0;
var _7b1;
var _7b2=[];
while((_7b1=goog.uri.utils.findParam_(uri,_7b0,_7ae,_7af))>=0){
_7b0=uri.indexOf("&",_7b1);
if(_7b0<0||_7b0>_7af){
_7b0=_7af;
}
_7b1+=_7ae.length+1;
_7b2.push(goog.string.urlDecode(uri.substr(_7b1,_7b0-_7b1)));
}
return _7b2;
};
goog.uri.utils.trailingQueryPunctuationRe_=/[?&]($|#)/;
goog.uri.utils.removeParam=function(uri,_7b4){
var _7b5=uri.search(goog.uri.utils.hashOrEndRe_);
var _7b6=0;
var _7b7;
var _7b8=[];
while((_7b7=goog.uri.utils.findParam_(uri,_7b6,_7b4,_7b5))>=0){
_7b8.push(uri.substring(_7b6,_7b7));
_7b6=Math.min((uri.indexOf("&",_7b7)+1)||_7b5,_7b5);
}
_7b8.push(uri.substr(_7b6));
return _7b8.join("").replace(goog.uri.utils.trailingQueryPunctuationRe_,"$1");
};
goog.uri.utils.setParam=function(uri,_7ba,_7bb){
return goog.uri.utils.appendParam(goog.uri.utils.removeParam(uri,_7ba),_7ba,_7bb);
};
goog.uri.utils.appendPath=function(_7bc,path){
goog.uri.utils.assertNoFragmentsOrQueries_(_7bc);
if(goog.string.endsWith(_7bc,"/")){
_7bc=_7bc.substr(0,_7bc.length-1);
}
if(goog.string.startsWith(path,"/")){
path=path.substr(1);
}
return goog.string.buildString(_7bc,"/",path);
};
goog.uri.utils.StandardQueryParam={RANDOM:"zx"};
goog.uri.utils.makeUnique=function(uri){
return goog.uri.utils.setParam(uri,goog.uri.utils.StandardQueryParam.RANDOM,goog.string.getRandomString());
};
goog.provide("goog.Uri");
goog.provide("goog.Uri.QueryData");
goog.require("goog.array");
goog.require("goog.string");
goog.require("goog.structs");
goog.require("goog.structs.Map");
goog.require("goog.uri.utils");
goog.require("goog.uri.utils.ComponentIndex");
goog.Uri=function(_7bf,_7c0){
var m;
if(_7bf instanceof goog.Uri){
this.setIgnoreCase(_7c0==null?_7bf.getIgnoreCase():_7c0);
this.setScheme(_7bf.getScheme());
this.setUserInfo(_7bf.getUserInfo());
this.setDomain(_7bf.getDomain());
this.setPort(_7bf.getPort());
this.setPath(_7bf.getPath());
this.setQueryData(_7bf.getQueryData().clone());
this.setFragment(_7bf.getFragment());
}else{
if(_7bf&&(m=goog.uri.utils.split(String(_7bf)))){
this.setIgnoreCase(!!_7c0);
this.setScheme(m[goog.uri.utils.ComponentIndex.SCHEME]||"",true);
this.setUserInfo(m[goog.uri.utils.ComponentIndex.USER_INFO]||"",true);
this.setDomain(m[goog.uri.utils.ComponentIndex.DOMAIN]||"",true);
this.setPort(m[goog.uri.utils.ComponentIndex.PORT]);
this.setPath(m[goog.uri.utils.ComponentIndex.PATH]||"",true);
this.setQuery(m[goog.uri.utils.ComponentIndex.QUERY_DATA]||"",true);
this.setFragment(m[goog.uri.utils.ComponentIndex.FRAGMENT]||"",true);
}else{
this.setIgnoreCase(!!_7c0);
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.queryData_;
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 out=[];
if(this.scheme_){
out.push(goog.Uri.encodeSpecialChars_(this.scheme_,goog.Uri.reDisallowedInSchemeOrUserInfo_),":");
}
if(this.domain_){
out.push("//");
if(this.userInfo_){
out.push(goog.Uri.encodeSpecialChars_(this.userInfo_,goog.Uri.reDisallowedInSchemeOrUserInfo_),"@");
}
out.push(goog.Uri.encodeString_(this.domain_));
if(this.port_!=null){
out.push(":",String(this.getPort()));
}
}
if(this.path_){
if(this.hasDomain()&&this.path_.charAt(0)!="/"){
out.push("/");
}
out.push(goog.Uri.encodeSpecialChars_(this.path_,goog.Uri.reDisallowedInPath_));
}
var _7c3=String(this.queryData_);
if(_7c3){
out.push("?",_7c3);
}
if(this.fragment_){
out.push("#",goog.Uri.encodeSpecialChars_(this.fragment_,goog.Uri.reDisallowedInFragment_));
}
return this.cachedToString_=out.join("");
};
goog.Uri.prototype.resolve=function(_7c4){
var _7c5=this.clone();
var _7c6=_7c4.hasScheme();
if(_7c6){
_7c5.setScheme(_7c4.getScheme());
}else{
_7c6=_7c4.hasUserInfo();
}
if(_7c6){
_7c5.setUserInfo(_7c4.getUserInfo());
}else{
_7c6=_7c4.hasDomain();
}
if(_7c6){
_7c5.setDomain(_7c4.getDomain());
}else{
_7c6=_7c4.hasPort();
}
var path=_7c4.getPath();
if(_7c6){
_7c5.setPort(_7c4.getPort());
}else{
_7c6=_7c4.hasPath();
if(_7c6){
if(path.charAt(0)!="/"){
if(this.hasDomain()&&!this.hasPath()){
path="/"+path;
}else{
var _7c8=_7c5.getPath().lastIndexOf("/");
if(_7c8!=-1){
path=_7c5.getPath().substr(0,_7c8+1)+path;
}
}
}
path=goog.Uri.removeDotSegments(path);
}
}
if(_7c6){
_7c5.setPath(path);
}else{
_7c6=_7c4.hasQuery();
}
if(_7c6){
_7c5.setQuery(_7c4.getDecodedQuery());
}else{
_7c6=_7c4.hasFragment();
}
if(_7c6){
_7c5.setFragment(_7c4.getFragment());
}
return _7c5;
};
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(_7c9,_7ca){
this.enforceReadOnly();
delete this.cachedToString_;
this.scheme_=_7ca?goog.Uri.decodeOrEmpty_(_7c9):_7c9;
if(this.scheme_){
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(_7cb,_7cc){
this.enforceReadOnly();
delete this.cachedToString_;
this.userInfo_=_7cc?goog.Uri.decodeOrEmpty_(_7cb):_7cb;
return this;
};
goog.Uri.prototype.hasUserInfo=function(){
return !!this.userInfo_;
};
goog.Uri.prototype.getDomain=function(){
return this.domain_;
};
goog.Uri.prototype.setDomain=function(_7cd,_7ce){
this.enforceReadOnly();
delete this.cachedToString_;
this.domain_=_7ce?goog.Uri.decodeOrEmpty_(_7cd):_7cd;
return this;
};
goog.Uri.prototype.hasDomain=function(){
return !!this.domain_;
};
goog.Uri.prototype.getPort=function(){
return this.port_;
};
goog.Uri.prototype.setPort=function(_7cf){
this.enforceReadOnly();
delete this.cachedToString_;
if(_7cf){
_7cf=Number(_7cf);
if(isNaN(_7cf)||_7cf<0){
throw Error("Bad port number "+_7cf);
}
this.port_=_7cf;
}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(_7d0,_7d1){
this.enforceReadOnly();
delete this.cachedToString_;
this.path_=_7d1?goog.Uri.decodeOrEmpty_(_7d0):_7d0;
return this;
};
goog.Uri.prototype.hasPath=function(){
return !!this.path_;
};
goog.Uri.prototype.hasQuery=function(){
return this.queryData_.toString()!=="";
};
goog.Uri.prototype.setQueryData=function(_7d2,_7d3){
this.enforceReadOnly();
delete this.cachedToString_;
if(_7d2 instanceof goog.Uri.QueryData){
this.queryData_=_7d2;
this.queryData_.uri_=this;
this.queryData_.setIgnoreCase(this.ignoreCase_);
}else{
if(!_7d3){
_7d2=goog.Uri.encodeSpecialChars_(_7d2,goog.Uri.reDisallowedInQuery_);
}
this.queryData_=new goog.Uri.QueryData(_7d2,this,this.ignoreCase_);
}
return this;
};
goog.Uri.prototype.setQuery=function(_7d4,_7d5){
return this.setQueryData(_7d4,_7d5);
};
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(key,_7d7){
this.enforceReadOnly();
delete this.cachedToString_;
this.queryData_.set(key,_7d7);
return this;
};
goog.Uri.prototype.setParameterValues=function(key,_7d9){
this.enforceReadOnly();
delete this.cachedToString_;
if(!goog.isArray(_7d9)){
_7d9=[String(_7d9)];
}
this.queryData_.setValues(key,(_7d9));
return this;
};
goog.Uri.prototype.getParameterValues=function(name){
return this.queryData_.getValues(name);
};
goog.Uri.prototype.getParameterValue=function(_7db){
return this.queryData_.get(_7db);
};
goog.Uri.prototype.getFragment=function(){
return this.fragment_;
};
goog.Uri.prototype.setFragment=function(_7dc,_7dd){
this.enforceReadOnly();
delete this.cachedToString_;
this.fragment_=_7dd?goog.Uri.decodeOrEmpty_(_7dc):_7dc;
return this;
};
goog.Uri.prototype.hasFragment=function(){
return !!this.fragment_;
};
goog.Uri.prototype.hasSameDomainAs=function(uri2){
return ((!this.hasDomain()&&!uri2.hasDomain())||this.getDomain()==uri2.getDomain())&&((!this.hasPort()&&!uri2.hasPort())||this.getPort()==uri2.getPort());
};
goog.Uri.prototype.makeUnique=function(){
this.enforceReadOnly();
this.setParameterValue(goog.Uri.RANDOM_PARAM,goog.string.getRandomString());
return this;
};
goog.Uri.prototype.removeParameter=function(key){
this.enforceReadOnly();
this.queryData_.remove(key);
return this;
};
goog.Uri.prototype.setReadOnly=function(_7e0){
this.isReadOnly_=_7e0;
};
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(_7e1){
this.ignoreCase_=_7e1;
if(this.queryData_){
this.queryData_.setIgnoreCase(_7e1);
}
};
goog.Uri.prototype.getIgnoreCase=function(){
return this.ignoreCase_;
};
goog.Uri.parse=function(uri,_7e3){
return uri instanceof goog.Uri?uri.clone():new goog.Uri(uri,_7e3);
};
goog.Uri.create=function(_7e4,_7e5,_7e6,_7e7,_7e8,_7e9,_7ea,_7eb){
var uri=new goog.Uri(null,_7eb);
_7e4&&uri.setScheme(_7e4);
_7e5&&uri.setUserInfo(_7e5);
_7e6&&uri.setDomain(_7e6);
_7e7&&uri.setPort(_7e7);
_7e8&&uri.setPath(_7e8);
_7e9&&uri.setQueryData(_7e9);
_7ea&&uri.setFragment(_7ea);
return uri;
};
goog.Uri.resolve=function(base,rel){
if(!(base instanceof goog.Uri)){
base=goog.Uri.parse(base);
}
if(!(rel instanceof goog.Uri)){
rel=goog.Uri.parse(rel);
}
return base.resolve(rel);
};
goog.Uri.removeDotSegments=function(path){
if(path==".."||path=="."){
return "";
}else{
if(!goog.string.contains(path,"./")&&!goog.string.contains(path,"/.")){
return path;
}else{
var _7f0=goog.string.startsWith(path,"/");
var _7f1=path.split("/");
var out=[];
for(var pos=0;pos<_7f1.length;){
var _7f4=_7f1[pos++];
if(_7f4=="."){
if(_7f0&&pos==_7f1.length){
out.push("");
}
}else{
if(_7f4==".."){
if(out.length>1||out.length==1&&out[0]!=""){
out.pop();
}
if(_7f0&&pos==_7f1.length){
out.push("");
}
}else{
out.push(_7f4);
_7f0=true;
}
}
}
return out.join("/");
}
}
};
goog.Uri.decodeOrEmpty_=function(val){
return val?decodeURIComponent(val):"";
};
goog.Uri.encodeString_=function(_7f6){
if(goog.isString(_7f6)){
return encodeURIComponent(_7f6);
}
return null;
};
goog.Uri.encodeSpecialRegExp_=/^[a-zA-Z0-9\-_.!~*'():\/;?]*$/;
goog.Uri.encodeSpecialChars_=function(_7f7,_7f8){
var ret=null;
if(goog.isString(_7f7)){
ret=_7f7;
if(!goog.Uri.encodeSpecialRegExp_.test(ret)){
ret=encodeURI(_7f7);
}
if(ret.search(_7f8)>=0){
ret=ret.replace(_7f8,goog.Uri.encodeChar_);
}
}
return ret;
};
goog.Uri.encodeChar_=function(ch){
var n=ch.charCodeAt(0);
return "%"+((n>>4)&15).toString(16)+(n&15).toString(16);
};
goog.Uri.reDisallowedInSchemeOrUserInfo_=/[#\/\?@]/g;
goog.Uri.reDisallowedInPath_=/[\#\?]/g;
goog.Uri.reDisallowedInQuery_=/[\#\?@]/g;
goog.Uri.reDisallowedInFragment_=/#/g;
goog.Uri.haveSameDomain=function(_7fc,_7fd){
var _7fe=goog.uri.utils.split(_7fc);
var _7ff=goog.uri.utils.split(_7fd);
return _7fe[goog.uri.utils.ComponentIndex.DOMAIN]==_7ff[goog.uri.utils.ComponentIndex.DOMAIN]&&_7fe[goog.uri.utils.ComponentIndex.PORT]==_7ff[goog.uri.utils.ComponentIndex.PORT];
};
goog.Uri.QueryData=function(_800,_801,_802){
this.encodedQuery_=_800||null;
this.uri_=_801||null;
this.ignoreCase_=!!_802;
};
goog.Uri.QueryData.prototype.ensureKeyMapInitialized_=function(){
if(!this.keyMap_){
this.keyMap_=new goog.structs.Map();
if(this.encodedQuery_){
var _803=this.encodedQuery_.split("&");
for(var i=0;i<_803.length;i++){
var _805=_803[i].indexOf("=");
var name=null;
var _807=null;
if(_805>=0){
name=_803[i].substring(0,_805);
_807=_803[i].substring(_805+1);
}else{
name=_803[i];
}
name=goog.string.urlDecode(name);
name=this.getKeyName_(name);
this.add(name,_807?goog.string.urlDecode(_807):"");
}
}
}
};
goog.Uri.QueryData.createFromMap=function(map,_809,_80a){
var keys=goog.structs.getKeys(map);
if(typeof keys=="undefined"){
throw Error("Keys are undefined");
}
return goog.Uri.QueryData.createFromKeysValues(keys,goog.structs.getValues(map),_809,_80a);
};
goog.Uri.QueryData.createFromKeysValues=function(keys,_80d,_80e,_80f){
if(keys.length!=_80d.length){
throw Error("Mismatched lengths for keys/values");
}
var _810=new goog.Uri.QueryData(null,_80e,_80f);
for(var i=0;i<keys.length;i++){
_810.add(keys[i],_80d[i]);
}
return _810;
};
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(key,_813){
this.ensureKeyMapInitialized_();
this.invalidateCache_();
key=this.getKeyName_(key);
if(!this.containsKey(key)){
this.keyMap_.set(key,_813);
}else{
var _814=this.keyMap_.get(key);
if(goog.isArray(_814)){
_814.push(_813);
}else{
this.keyMap_.set(key,[_814,_813]);
}
}
this.count_++;
return this;
};
goog.Uri.QueryData.prototype.remove=function(key){
this.ensureKeyMapInitialized_();
key=this.getKeyName_(key);
if(this.keyMap_.containsKey(key)){
this.invalidateCache_();
var old=this.keyMap_.get(key);
if(goog.isArray(old)){
this.count_-=old.length;
}else{
this.count_--;
}
return this.keyMap_.remove(key);
}
return false;
};
goog.Uri.QueryData.prototype.clear=function(){
this.invalidateCache_();
if(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(key){
this.ensureKeyMapInitialized_();
key=this.getKeyName_(key);
return this.keyMap_.containsKey(key);
};
goog.Uri.QueryData.prototype.containsValue=function(_818){
var vals=this.getValues();
return goog.array.contains(vals,_818);
};
goog.Uri.QueryData.prototype.getKeys=function(){
this.ensureKeyMapInitialized_();
var vals=this.keyMap_.getValues();
var keys=this.keyMap_.getKeys();
var rv=[];
for(var i=0;i<keys.length;i++){
var val=vals[i];
if(goog.isArray(val)){
for(var j=0;j<val.length;j++){
rv.push(keys[i]);
}
}else{
rv.push(keys[i]);
}
}
return rv;
};
goog.Uri.QueryData.prototype.getValues=function(_820){
this.ensureKeyMapInitialized_();
var rv;
if(_820){
var key=this.getKeyName_(_820);
if(this.containsKey(key)){
var _823=this.keyMap_.get(key);
if(goog.isArray(_823)){
return _823;
}else{
rv=[];
rv.push(_823);
}
}else{
rv=[];
}
}else{
var vals=this.keyMap_.getValues();
rv=[];
for(var i=0;i<vals.length;i++){
var val=vals[i];
if(goog.isArray(val)){
goog.array.extend(rv,val);
}else{
rv.push(val);
}
}
}
return rv;
};
goog.Uri.QueryData.prototype.set=function(key,_828){
this.ensureKeyMapInitialized_();
this.invalidateCache_();
key=this.getKeyName_(key);
if(this.containsKey(key)){
var old=this.keyMap_.get(key);
if(goog.isArray(old)){
this.count_-=old.length;
}else{
this.count_--;
}
}
this.keyMap_.set(key,_828);
this.count_++;
return this;
};
goog.Uri.QueryData.prototype.get=function(key,_82b){
this.ensureKeyMapInitialized_();
key=this.getKeyName_(key);
if(this.containsKey(key)){
var val=this.keyMap_.get(key);
if(goog.isArray(val)){
return val[0];
}else{
return val;
}
}else{
return _82b;
}
};
goog.Uri.QueryData.prototype.setValues=function(key,_82e){
this.ensureKeyMapInitialized_();
this.invalidateCache_();
key=this.getKeyName_(key);
if(this.containsKey(key)){
var old=this.keyMap_.get(key);
if(goog.isArray(old)){
this.count_-=old.length;
}else{
this.count_--;
}
}
if(_82e.length>0){
this.keyMap_.set(key,_82e);
this.count_+=_82e.length;
}
};
goog.Uri.QueryData.prototype.toString=function(){
if(this.encodedQuery_){
return this.encodedQuery_;
}
if(!this.keyMap_){
return "";
}
var sb=[];
var _831=0;
var keys=this.keyMap_.getKeys();
for(var i=0;i<keys.length;i++){
var key=keys[i];
var _835=goog.string.urlEncode(key);
var val=this.keyMap_.get(key);
if(goog.isArray(val)){
for(var j=0;j<val.length;j++){
if(_831>0){
sb.push("&");
}
sb.push(_835);
if(val[j]!==""){
sb.push("=",goog.string.urlEncode(val[j]));
}
_831++;
}
}else{
if(_831>0){
sb.push("&");
}
sb.push(_835);
if(val!==""){
sb.push("=",goog.string.urlEncode(val));
}
_831++;
}
}
return this.encodedQuery_=sb.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_;
if(this.uri_){
delete this.uri_.cachedToString_;
}
};
goog.Uri.QueryData.prototype.filterKeys=function(keys){
this.ensureKeyMapInitialized_();
goog.structs.forEach(this.keyMap_,function(_839,key,map){
if(!goog.array.contains(keys,key)){
this.remove(key);
}
},this);
return this;
};
goog.Uri.QueryData.prototype.clone=function(){
var rv=new goog.Uri.QueryData();
if(this.decodedQuery_){
rv.decodedQuery_=this.decodedQuery_;
}
if(this.encodedQuery_){
rv.encodedQuery_=this.encodedQuery_;
}
if(this.keyMap_){
rv.keyMap_=this.keyMap_.clone();
}
return rv;
};
goog.Uri.QueryData.prototype.getKeyName_=function(arg){
var _83e=String(arg);
if(this.ignoreCase_){
_83e=_83e.toLowerCase();
}
return _83e;
};
goog.Uri.QueryData.prototype.setIgnoreCase=function(_83f){
var _840=_83f&&!this.ignoreCase_;
if(_840){
this.ensureKeyMapInitialized_();
this.invalidateCache_();
goog.structs.forEach(this.keyMap_,function(_841,key,map){
var _844=key.toLowerCase();
if(key!=_844){
this.remove(key);
this.add(_844,_841);
}
},this);
}
this.ignoreCase_=_83f;
};
goog.Uri.QueryData.prototype.extend=function(_845){
for(var i=0;i<arguments.length;i++){
var data=arguments[i];
goog.structs.forEach(data,function(_848,key){
this.add(key,_848);
},this);
}
};
goog.provide("swivel_viewer.Swivel");
goog.require("goog.dom");
goog.require("goog.events");
goog.require("goog.events.MouseWheelHandler");
goog.require("goog.math.Size");
goog.require("goog.fx.dom.FadeOutAndHide");
goog.require("goog.string");
goog.require("goog.style");
goog.require("goog.Uri");
swivel_viewer.Swivel=function(_84a,_84b,_84c,_84d){
if(_84a==null){
this.swivelContents_=document.createElement("div");
this.swivelContents_.id="SwivelContents";
this.swivelContents_.style.width=_84c+"px";
this.swivelContents_.style.height=_84d+"px";
this.swivelContents_.style.position="relative";
document.body.appendChild(this.swivelContents_);
}else{
this.swivelContents_=_84a;
}
this.doc_=document;
this.nPreloadImages_=6;
var last=_84b.pop();
if(last!=null){
_84b.push(last);
}
this.imageUrls_=_84b;
this.swivelWidth_=_84c;
this.swivelHeight_=_84d;
this.imageWidth_=_84c;
this.imageHeight_=_84d;
this.swivelSize_=new goog.math.Size(_84c,_84d);
this.imageSize_=new goog.math.Size(_84c,_84d);
this.mouseWheelHandler_=null;
this.autoSpin_=true;
this.onSpin_=0;
this.rewriteURLs_=false;
this.showImageIsWaitingForATimeout_=false;
this.initImages();
};
swivel_viewer.Swivel.prototype.zoomFadeFx_=null;
swivel_viewer.Swivel.REDISPLAY_IMAGE_DELAY=1000;
swivel_viewer.Swivel.IMAGE_DISPLAY_RETRIES=10;
swivel_viewer.Swivel.HELP_ICON_WIDTH=200;
swivel_viewer.Swivel.HELP_ICON_HEIGHT=90;
swivel_viewer.Swivel.SCALE_INCREMENT=0.1;
swivel_viewer.Swivel.MIN_SCALE=0.25;
swivel_viewer.Swivel.MAX_SCALE=10;
swivel_viewer.Swivel.ZOOM_INCREMENT=0.25;
swivel_viewer.Swivel.MIN_ZOOM=1;
swivel_viewer.Swivel.MAX_ZOOM=1;
swivel_viewer.Swivel.MAX_IMAGE_DIMENSION=1600;
swivel_viewer.Swivel.ZOOM_FADE_TIMEOUT=1200;
swivel_viewer.Swivel.prototype.initializeSizeAndOffset=function(){
if(!this.imageSize_.fitsInside(this.swivelSize_)){
this.imageSize_=this.imageSize_.scaleToFit(this.swivelSize_);
}
this.leftIncrement_=0;
var _84f=this.swivelSize_.width-this.imageSize_.width;
if(_84f>0){
this.leftIncrement_=Math.floor(_84f/2);
}
this.topIncrement_=0;
var _850=this.swivelSize_.height-this.imageSize_.height;
if(_850>0){
this.topIncrement_=Math.floor(_850/2);
}
};
swivel_viewer.Swivel.prototype.initImages=function(){
var _851=this.imageUrls_.length;
this.imageArray_=new Array(_851);
this.initializeSizeAndOffset();
var i=0;
var _853=new Array();
var incr=_851/this.nPreloadImages_;
while(i<_851){
this.createImage(i);
i++;
if(i>=_851){
break;
}
for(var skip=1;skip<incr;skip++){
_853.push(i);
this.imageArray_[i]=null;
i++;
if(i>=_851){
break;
}
}
}
this.initDisplay(_853);
};
swivel_viewer.Swivel.prototype.autoRotate=function(_856,_857){
if(!this.autoSpin_&&!_857){
return false;
}
var _858=this.imageUrls_.length;
this.addToPos_=_856>0?1:-1;
var wrap=(this.currentPos_+this.addToPos_)%_858;
var _85a=(wrap<0)?_858+wrap:wrap;
var img=this.imageArray_[_85a];
if(this.hasLoadedInBrowser(img)){
for(var i=0;i<_858;i++){
if(this.imageArray_[i]!=null){
this.hideImage(this.imageArray_[i]);
}
}
this.showImage(_85a,1);
}
this.currentPos_+=this.addToPos_;
return true;
};
swivel_viewer.Swivel.prototype.updateURLs=function(_85d,_85e){
if(!this.rewriteURLs_){
return;
}
var _85f=[32,48,64,72,94,104,110,128,144,150,160,200,220,288,320,400,512,576,640,720,800,912,1024,1152,1280,1440,1600];
var _860=_85f[_85f.length-1];
for(var n=0;n<_85f.length;n++){
var size=_85f[n];
var _863,thumb_height;
if(_85d==_85e){
_863=size;
thumb_height=size;
}else{
if(_85d>_85e){
_863=size;
thumb_height=parseInt((size*_85e)/_85d,10);
}else{
_863=parseInt((size*_85d)/_85e,10);
thumb_height=size;
}
}
if((_863>=_85d)||(thumb_height>=_85e)){
_860=size;
break;
}
}
for(var n=0;n<this.imageUrls_.length;n++){
var _864=this.imageUrls_[n].split("/");
var _865=_864.pop();
_864.pop();
_864.push("s"+_860);
_864.push(_865);
this.imageUrls_[n]=_864.join("/");
}
};
swivel_viewer.Swivel.prototype.createImage=function(indx){
var dom=new goog.dom.DomHelper(this.doc_);
var _868=dom.createDom("img",{"src":this.imageUrls_[indx],"galleryImage":"no","unselectable":"on"});
this.imageArray_[indx]=_868;
this.resizeImage_(indx);
this.hideImage(_868);
goog.dom.appendChild(this.swivelContents_,_868);
};
swivel_viewer.Swivel.prototype.reloadImages_=function(){
for(var indx=0;indx<this.imageArray_.length;++indx){
var _86a=this.imageArray_[indx];
_86a.src=this.imageUrls_[indx];
}
};
swivel_viewer.Swivel.prototype.resizeSheet_=function(_86b){
_86b.style.width=this.swivelSize_.width+"px";
_86b.style.height=this.swivelSize_.height+"px";
_86b.style.position="absolute";
_86b.style.zIndex="5";
_86b.style.top=0+"px";
_86b.style.left=0+"px";
};
swivel_viewer.Swivel.prototype.resizeImage_=function(indx){
var _86d=this.imageArray_[indx];
_86d.style.width=this.imageSize_.width;
_86d.style.height=this.imageSize_.height;
_86d.style.left=this.leftIncrement_+"px";
_86d.style.top=this.topIncrement_+"px";
_86d.style.overflow="hidden";
_86d.style.position="relative";
_86d.style.zIndex="2";
};
swivel_viewer.Swivel.prototype.initDisplay=function(_86e){
this.initHelpIcon();
this.initZoomIndicator();
var _86f=this.imageArray_.length;
this.currentPos_=0;
this.addToPos_=0;
this.mouseXOrig_=0;
this.mouseX_=0;
this.mouseY_=0;
this.mouseIsDown_=false;
this.currentZoom_=1;
this.currentScale_=1;
var dom=new goog.dom.getDomHelper(this.doc_);
var _871=dom.createDom("div",{"class":"sheet"});
_871.id="sheet";
this.resizeSheet_(_871);
goog.style.setOpacity(_871,0);
goog.dom.appendChild(this.swivelContents_,_871);
goog.events.listen(this.swivelContents_,goog.events.EventType.MOUSEMOVE,this.doMouseMove,true,this);
goog.events.listen(this.swivelContents_,goog.events.EventType.MOUSEDOWN,this.doMouseDown,false,this);
goog.events.listen(this.swivelContents_,goog.events.EventType.MOUSEUP,this.doMouseUp,true,this);
goog.events.listen(this.swivelContents_,goog.events.EventType.MOUSEOVER,this.doMouseIn,false,this);
goog.events.listen(this.swivelContents_,goog.events.EventType.MOUSEOUT,this.doMouseOut,false,this);
this.mouseWheelHandler_=new goog.events.MouseWheelHandler(this.swivelContents_);
goog.events.listen(this.mouseWheelHandler_,goog.events.MouseWheelHandler.EventType.MOUSEWHEEL,this.zoom,false,this);
this.currentPos_=0;
for(var n=0;n<_86e.length;n++){
this.createImage(_86e[n]);
}
this.showImage(this.currentPos_,1);
};
swivel_viewer.Swivel.prototype.showHideElement=function(id,show){
var _875=goog.dom.getElement(id);
goog.style.showElement(_875,show);
};
swivel_viewer.Swivel.prototype.initHelpIcon=function(){
var _876="/images/arrows_curved_small.png";
if(goog.userAgent.IE){
_876="/images/arrows_curved_small.png";
}
var dom=new goog.dom.getDomHelper(this.doc_);
this.helpIcon_=dom.createDom("img",{"src":_876,"class":"helpIcon"});
this.helpIcon_.id="helpIcon";
this.resizeHelpIcon_();
goog.dom.appendChild(this.swivelContents_,this.helpIcon_);
};
swivel_viewer.Swivel.prototype.resizeHelpIcon_=function(){
var _878=new goog.math.Size(swivel_viewer.Swivel.HELP_ICON_WIDTH,swivel_viewer.Swivel.HELP_ICON_HEIGHT);
if(!_878.fitsInside(this.swivelSize_)){
_878=_878.scaleToFit(this.swivelSize_);
}
this.helpIcon_.style.position="absolute";
this.helpIcon_.style.zIndex="4";
this.helpIcon_.style.width=_878.width+"px";
this.helpIcon_.style.height=_878.height+"px";
this.helpIcon_.style.left=Math.floor((this.swivelSize_.width-_878.width)/2);
this.helpIcon_.style.top=Math.floor((this.swivelSize_.height-_878.height)/2);
};
swivel_viewer.Swivel.prototype.initZoomIndicator=function(){
var _879="color:gray;position:absolute;top:0;left:0;z-index:3;";
if(goog.userAgent.IE&&!goog.userAgent.isVersion("7")){
_879+="background-color:white;";
}
var dom=new goog.dom.getDomHelper(this.doc_);
this.zoomIndicator_=dom.createDom("span",{"style":_879});
goog.dom.appendChild(this.swivelContents_,this.zoomIndicator_);
};
swivel_viewer.Swivel.prototype.doMouseIn=function(e){
if(this.mouseIsDown_){
e.stopPropagation();
e.preventDefault();
return;
}
this.cursorSwivel(e);
};
swivel_viewer.Swivel.prototype.doMouseOut=function(e){
if(this.mouseIsDown_){
var sx=0,sy=0,x=0,y=0;
var x=0,y=0,f=e.currentTarget;
for(;f&&f.offsetParent;f=f.offsetParent){
x+=f.offsetLeft;
y+=f.offsetTop;
}
if(document.documentElement&&document.documentElement.scrollTop){
sx=document.documentElement.scrollLeft;
sy=document.documentElement.scrollTop;
}else{
if(document.body&&document.body.scrollTop){
sx=document.body.scrollLeft;
sy=document.body.scrollTop;
}else{
if(typeof (window.pageXOffset)=="number"){
sx=window.pageXOffset;
}
if(typeof (window.pageYOffset)=="number"){
sy=window.pageYOffset;
}
}
}
var _87f=e.clientX+sx;
var _880=e.clientY+sy;
var _881=e.currentTarget.offsetWidth;
var _882=e.currentTarget.offsetHeight;
_87f-=x;
_880-=y;
if(_87f<0||_87f>=_881||_880<0||_880>=_882){
this.doMouseUp(e);
this.cursorDefault();
}
e.stopPropagation();
e.preventDefault();
return;
}
this.doMouseUp(e);
this.cursorDefault();
};
swivel_viewer.Swivel.prototype.doMouseDown=function(e){
e.stopPropagation();
e.preventDefault();
this.showHideElement(this.helpIcon_,false);
this.cursorSwivel(e);
this.getMouseXY(e);
this.mouseXOrig_=this.mouseX_;
this.mouseYOrig_=this.mouseY_;
this.addToPos_=0;
this.mouseIsDown_=true;
};
swivel_viewer.Swivel.prototype.doMouseUp=function(e){
e.stopPropagation();
e.preventDefault();
goog.events.listen(this.swivelContents_,goog.events.EventType.MOUSEOVER,this.doMouseIn,false,this);
goog.events.listen(this.swivelContents_,goog.events.EventType.MOUSEOUT,this.doMouseOut,false,this);
this.currentPos_+=this.addToPos_;
this.mouseIsDown_=false;
this.cursorSwivel(e);
};
swivel_viewer.Swivel.prototype.doMouseMove=function(e){
if(!this.mouseIsDown_){
this.cursorSwivel(e);
return;
}
e.stopPropagation();
e.preventDefault();
if(e.shiftKey){
this.doPan(e);
}else{
this.autoSpin_=false;
this.doRotate(e);
}
};
swivel_viewer.Swivel.prototype.doRotate=function(e){
this.getMouseXY(e);
var _887=this.imageUrls_.length;
var step=this.swivelSize_.width/_887;
var _889=-this.mouseX_+this.mouseXOrig_;
this.addToPos_=Math.round(_889/step);
if(this.addToPos_!=0){
var wrap=(this.currentPos_+this.addToPos_)%_887;
var _88b=(wrap<0)?_887+wrap:wrap;
var img=this.imageArray_[_88b];
if(this.hasLoadedInBrowser(img)){
for(var i=0;i<_887;i++){
if(this.imageArray_[i]!=null){
this.hideImage(this.imageArray_[i]);
}
}
this.showImage(_88b,1);
}
}
return false;
};
swivel_viewer.Swivel.prototype.doScale=function(_88e){
var inc=(_88e.detail>0?-swivel_viewer.Swivel.SCALE_INCREMENT:+swivel_viewer.Swivel.SCALE_INCREMENT);
var _890=this.currentScale_+inc;
if(inc>0&&_890>swivel_viewer.Swivel.MAX_SCALE){
return;
}
if(inc<0&&_890<swivel_viewer.Swivel.MIN_SCALE){
return;
}
this.swivelContents_.resizeCallback(this.swivelWidth_*_890,this.swivelHeight_*_890);
this.swivelSize_=new goog.math.Size(this.swivelWidth_*_890,this.swivelHeight_*_890);
this.imageSize_=new goog.math.Size(this.imageWidth_*_890,this.imageHeight_*_890);
this.removeSwivelListeners();
goog.dom.removeChildren(this.swivelContents_);
this.swivelContents_.style.width=this.swivelWidth_*_890+"px";
this.swivelContents_.style.height=this.swivelHeight_*_890+"px";
this.updateURLs(this.imageSize_.width,this.imageSize_.height);
this.initImages();
this.currentScale_=_890;
};
swivel_viewer.Swivel.prototype.doPan=function(e){
this.mouseXOrig_=this.mouseX_;
this.mouseYOrig_=this.mouseY_;
this.getMouseXY(e);
this.leftIncrement_-=(this.mouseXOrig_-this.mouseX_);
this.topIncrement_-=(this.mouseYOrig_-this.mouseY_);
var _892=Math.floor(this.imageSize_.width*this.currentZoom_);
var _893=Math.floor(this.imageSize_.height*this.currentZoom_);
if(this.swivelSize_.width<=_892){
this.leftIncrement_=goog.math.clamp(this.leftIncrement_,this.swivelSize_.width-_892,0);
}else{
this.leftIncrement_=goog.math.clamp(this.leftIncrement_,0,this.swivelSize_.width-_892);
}
if(this.swivelSize_.height<=_893){
this.topIncrement_=goog.math.clamp(this.topIncrement_,this.swivelSize_.height-_893,0);
}else{
this.topIncrement_=goog.math.clamp(this.topIncrement_,0,this.swivelSize_.height-_893);
}
var _894=this.imageArray_.length;
for(var i=0;i<_894;i++){
var _896=this.imageArray_[i];
_896.style.top=this.topIncrement_+"px";
_896.style.left=this.leftIncrement_+"px";
}
};
swivel_viewer.Swivel.prototype.hasLoadedInBrowser=function(img){
if(!img||!img.complete){
return false;
}
if(typeof img.naturalWidth!="undefined"&&img.naturalWidth==0){
return false;
}
return true;
};
swivel_viewer.Swivel.prototype.getMouseXY=function(e){
if(goog.userAgent.IE){
this.mouseX_=e.clientX+document.body.scrollLeft;
this.mouseY_=e.clientY+document.body.scrollTop;
if(this.mouseX_<0){
this.mouseX_=0;
}
if(this.mouseY_<0){
this.mouseY_=0;
}
}else{
this.mouseX_=e.offsetX;
this.mouseY_=e.offsetY;
}
};
swivel_viewer.Swivel.prototype.getLeft=function(_899){
var x=0;
while(_899){
x+=_899.offsetLeft;
_899=_899.offsetParent;
}
return x;
};
swivel_viewer.Swivel.prototype.hideImage=function(img){
this.showHideElement(img,false);
};
swivel_viewer.Swivel.prototype.showImage=function(indx,_89d){
var img=this.imageArray_[indx];
if(_89d>1&&!this.showImageIsWaitingForATimeout_){
return;
}
this.showImageIsWaitingForATimeout_=false;
if(this.hasLoadedInBrowser(img)){
this.showHideElement(img,true);
this.cursorSwivel();
}else{
if(_89d<(swivel_viewer.Swivel.IMAGE_DISPLAY_RETRIES+1)){
this.cursorWait();
_89d++;
this.showImageIsWaitingForATimeout_=true;
goog.global.setTimeout(goog.bind(this.showImage,this,indx,_89d),swivel_viewer.Swivel.REDISPLAY_IMAGE_DELAY);
}else{
this.cursorSwivel();
}
}
};
swivel_viewer.Swivel.prototype.cursorWait=function(){
document.body.style.cursor="wait";
};
swivel_viewer.Swivel.prototype.cursorSwivel=function(_89f){
if(_89f&&_89f.shiftKey){
document.body.style.cursor="move";
}else{
document.body.style.cursor="col-resize";
}
};
swivel_viewer.Swivel.prototype.cursorDefault=function(){
document.body.style.cursor="default";
};
swivel_viewer.Swivel.prototype.removeSwivelListeners=function(){
goog.events.unlisten(this.swivelContents_,goog.events.EventType.MOUSEMOVE,this.doRotate,true,this);
goog.events.unlisten(this.swivelContents_,goog.events.EventType.MOUSEDOWN,this.doMouseDown,false,this);
goog.events.unlisten(this.swivelContents_,goog.events.EventType.MOUSEUP,this.doMouseUp,true,this);
goog.events.unlisten(this.swivelContents_,goog.events.EventType.MOUSEOVER,this.doMouseIn,false,this);
goog.events.unlisten(this.swivelContents_,goog.events.EventType.MOUSEOUT,this.doMouseOut,false,this);
goog.events.removeAll(this.mouseWheelHandler_,goog.events.EventType.MOUSEWHEEL);
};
swivel_viewer.Swivel.prototype.getCropRatio=function(){
var _8a0=new Array();
var _8a1=Math.floor(this.imageSize_.width*this.currentZoom_);
var _8a2=Math.floor(this.imageSize_.height*this.currentZoom_);
_8a0["left"]=Math.abs(this.leftIncrement_)/_8a1;
_8a0["right"]=1-_8a0.left-this.swivelSize_.width/_8a1;
_8a0["top"]=Math.abs(this.topIncrement_)/_8a2;
_8a0["bottom"]=1-_8a0.top-this.swivelSize_.height/_8a2;
return _8a0;
};
swivel_viewer.Swivel.prototype.zoom=function(_8a3){
_8a3.stopPropagation();
_8a3.preventDefault();
if(_8a3.shiftKey){
this.doScale(_8a3);
return;
}
var inc=(_8a3.detail>0?-swivel_viewer.Swivel.ZOOM_INCREMENT:swivel_viewer.Swivel.ZOOM_INCREMENT);
if((this.currentZoom_==swivel_viewer.Swivel.MIN_ZOOM&&inc<0)||(this.currentZoom_==swivel_viewer.Swivel.MAX_ZOOM&&inc>0)){
return;
}
var _8a5=Math.floor(this.imageSize_.width*this.currentZoom_);
var _8a6=Math.floor(this.imageSize_.height*this.currentZoom_);
if(inc>0&&(_8a5>=swivel_viewer.Swivel.MAX_IMAGE_DIMENSION||_8a6>=swivel_viewer.Swivel.MAX_IMAGE_DIMENSION)){
return;
}
this.updateURLs(_8a5,_8a6);
this.reloadImages_();
var _8a7=this.leftIncrement_+_8a5/2;
var _8a8=this.topIncrement_+_8a6/2;
this.getMouseXY(_8a3);
var _8a9=(this.mouseX_-_8a7)/this.currentZoom_;
var _8aa=(this.mouseY_-_8a8)/this.currentZoom_;
var _8ab=this.currentZoom_;
this.currentZoom_+=inc;
this.currentZoom_=goog.math.clamp(this.currentZoom_,swivel_viewer.Swivel.MIN_ZOOM,swivel_viewer.Swivel.MAX_ZOOM);
_8a5=Math.floor(this.imageSize_.width*this.currentZoom_);
_8a6=Math.floor(this.imageSize_.height*this.currentZoom_);
_8a9*=this.currentZoom_;
_8aa*=this.currentZoom_;
if(inc>0){
_8a7=this.mouseX_-_8a9;
_8a8=this.mouseY_-_8aa;
}else{
var _8ac=(this.currentZoom_-swivel_viewer.Swivel.MIN_ZOOM)/(_8ab-swivel_viewer.Swivel.MIN_ZOOM);
_8a7=_8ac*_8a7+(1-_8ac)*this.swivelSize_.width/2;
_8a8=_8ac*_8a8+(1-_8ac)*this.swivelSize_.height/2;
}
this.leftIncrement_=Math.floor(_8a7-_8a5/2);
this.topIncrement_=Math.floor(_8a8-_8a6/2);
this.leftIncrement_=goog.math.clamp(this.leftIncrement_,-_8a5,this.swivelSize_.width);
this.topIncrement_=goog.math.clamp(this.topIncrement_,-_8a6,this.swivelSize_.height);
var _8ad=this.imageArray_.length;
for(var i=0;i<_8ad;i++){
var _8af=this.imageArray_[i];
_8af.style.width=_8a5;
_8af.style.height=_8a6;
_8af.style.top=this.topIncrement_+"px";
_8af.style.left=this.leftIncrement_+"px";
_8af.style.overflow="hidden";
}
this.zoomIndicator_.innerHTML=(this.currentZoom_*100)+"%";
if(this.zoomFadeFx_!=null){
this.zoomFadeFx_.stop(false);
goog.style.setOpacity(this.zoomIndicator_,1);
}
this.showHideElement(this.zoomIndicator_,true);
if(this.zoomFadeFx_==null){
this.zoomFadeFx_=new goog.fx.dom.FadeOutAndHide(this.zoomIndicator_,swivel_viewer.Swivel.ZOOM_FADE_TIMEOUT);
}
this.zoomFadeFx_.play(true);
this.showHideElement(this.helpIcon_,false);
};
swivel_viewer.Swivel.prototype.stopSpin=function(){
this.onSpin_=0;
};
swivel_viewer.Swivel.prototype.startSpin=function(dir){
var t=Math.abs(dir);
this.onSpin_=dir;
this.doSpin(t<50?50:t);
};
swivel_viewer.Swivel.prototype.doSpin=function(_8b2){
if(this.onSpin_){
this.autoRotate(this.onSpin_,1);
var me=this,t=_8b2;
setTimeout(function(){
me.doSpin(t);
},t);
}
this.cursorDefault();
};


