
if(!window.Mixins){window.Mixins={};}
Object.extend(Mixins,{Observable:(function(){var observers=[];return{observe:function(event,callback){observers.push({self:this,event:event,callback:callback});},fire:function(event){var self=this;var parameters=[];for(var i=1;i<arguments.length;i++){parameters.push(arguments[i]);}
observers.each(function(candidate){if(candidate.self===self&&candidate.event===event){candidate.callback.apply(self,parameters);}});}};})()});Ajax.Responders.register({onException:function(request,exception){console.error(exception);console.info(request);}});Element.Methods.overlapsViewport=function(element){function get(element,properties){var sum=0;var layout=new Element.Layout(element);properties.split(/\s+/).each(function(property){if(['scrollTop'].indexOf(property)>=0){sum=sum+element[property];}else{sum=sum+layout.get(property);}});return sum;}
function positionInScrolling(element){var container=element.up();if(container===element.offsetParent){return get(element,'top');}
return get(element,'top')-get(container,'margin-top top border-top padding-top scrollTop');}
function elementHeight(element){return get(element,'border-top padding-top height padding-bottom border-bottom');}
function overlapsContainerViewport(element){var elementPosition=positionInScrolling(element);var elementEndY=elementPosition+elementHeight(element);var containerHeight=get(element.up(),'height');if(elementEndY<0){return null;}
if(elementPosition>containerHeight){return null;}
return{top:Math.max(elementPosition,0),height:Math.min(elementEndY,containerHeight)};}
var childOverlap=null;while(true){overlap=overlapsContainerViewport(element);if(childOverlap){overlap.top=overlap.top+childOverlap.top;overlap.height=Math.min(overlap.height,childOverlap.height);}
if(overlap===null){return false;}
element=element.up();if(element===document.documentElement){if(overlap.top>document.viewport.getScrollOffsets()[1]+document.viewport.getHeight()){return false;}
if(overlap.top+overlap.height<document.viewport.getScrollOffsets()[1]){return false;}
return overlap;}
childOverlap=overlap;}};Element.Methods.scrollToViewport=function(element){if(Element.Methods.overlapsViewport(element)){return;}
var parentsScrolls=[];element.ancestors().each(function(parent){parentsScrolls.push({element:parent,scrollTop:parent.scrollTop});});parentsScrolls.reverse();for(var omissions=parentsScrolls.length;omissions>=0;omissions--){element.scrollIntoView();for(var pIter=0;pIter<omissions;pIter++){var parent=parentsScrolls[pIter];parent.element.scrollTop=parent.scrollTop;}
if(Element.Methods.overlapsViewport(element)){return;}}};Element.Methods.clipOverflowingText=function(element){if(document.createElement('p').style.textOverflow===undefined){var spaceWidth=new Element.Layout(element).get('width');var range=document.createRange();range.selectNodeContents(element);if(range.getBoundingClientRect().width>spaceWidth){var parents=element.ancestors();parents.unshift(element);var ellipis=new Element('span');ellipis.setStyle({position:'absolute',right:'0px',paddingLeft:'0.1em',background:parents.map(function(e){return window.getComputedStyle(e,null).backgroundColor;}).filter(function(color){return color!=='transparent';})[0]});ellipis.appendChild(document.createTextNode('…'));if(window.getComputedStyle(element,null).position==='static'){element.setStyle({position:'relative'});}
element.appendChild(ellipis);}}};Array.prototype.contains=function(value){return this.indexOf(value)!==-1;}
Form.simulate=function(targetUrl,parameters){var form=new Element('form',{method:'post',action:targetUrl});var hash=new Hash(parameters);hash.each(function(pair){form.insert(new Element('input',{type:'hidden',name:pair.key,value:pair.value}));});$(document.body).insert(form);form.submit();}
Ajax.DomFetcher=Class.create(Ajax.Request,{initialize:function($super,url,options,exceptionHandlers){var $self=this;if(!options){options={};}
var defaults={onSuccess:function(response){var text=response.responseText;var container=new Element('div');container.innerHTML=text;var elements=document.createDocumentFragment();var evalString='';function addScript(child){evalString=evalString+child.innerHTML;child.parentNode.removeChild(child);}
while(container.childNodes.length){var child=container.childNodes[0];if(child.nodeType===1&&child.tagName.toLowerCase()==='script'){addScript(child);}else{if(child.nodeType===1){$A(child.getElementsByTagName('script')).each(addScript);}
if(child.id&&document.getElementById(child.id)){var old=document.getElementById(child.id);old.parentNode.replaceChild(child,old);}else{elements.appendChild(child);}}}
eval('(function(){"use strict";'+evalString+'})()');},onFailure:function(response){var ajaxException=new Ajax.Exception(response);response.responseJSON.exception.classes.each(function(exceptionClass){var handler=$self.exceptionHandlers[exceptionClass];if(typeof(handler)==='function'){try{handler(ajaxException);throw $break;}catch(e){if(e!==ajaxException){throw e;}}}});}};this.exceptionHandlers={};Object.extend(this.exceptionHandlers,this.defaultExceptionHandlers);if(exceptionHandlers!==undefined){Object.extend(this.exceptionHandlers,exceptionHandlers);}
$super(url,Object.extend(defaults,options));},exceptionHandlers:null,defaultExceptionHandlers:{MapMatters_Exception_LoginRequired:function(ajaxException){Form.simulate(CONST.ROOT_DIR+'user/login-required',{message:ajaxException.json().msg});},Exception:function(ajaxException){alert(ajaxException.json().msg);}}});Ajax.Exception=function(response){this.response=response;};Ajax.Exception.prototype=new Error();Ajax.Exception.prototype.response=null;Ajax.Exception.prototype.json=function(){return this.response.responseJSON;};var COMPILED=!0,goog=goog||{};goog.global=this;goog.DEBUG=!0;goog.LOCALE="en";goog.evalWorksForGlobals_=null;goog.provide=function(a){if(!COMPILED){if(goog.getObjectByName(a)&&!goog.implicitNamespaces_[a])throw Error('Namespace "'+a+'" already declared.');for(var b=a;b=b.substring(0,b.lastIndexOf("."));)goog.implicitNamespaces_[b]=!0}goog.exportPath_(a)};if(!COMPILED)goog.implicitNamespaces_={};goog.exportPath_=function(a,b,c){a=a.split(".");c=c||goog.global;!(a[0]in c)&&c.execScript&&c.execScript("var "+a[0]);for(var d;a.length&&(d=a.shift());)!a.length&&goog.isDef(b)?c[d]=b:c=c[d]?c[d]:c[d]={}};goog.getObjectByName=function(a,b){for(var c=a.split("."),d=b||goog.global,e;e=c.shift();)if(d[e])d=d[e];else return null;return d};goog.globalize=function(a,b){var c=b||goog.global,d;for(d in a)c[d]=a[d]};goog.addDependency=function(a,b,c){if(!COMPILED){for(var d,a=a.replace(/\\/g,"/"),e=goog.dependencies_,f=0;d=b[f];f++)e.nameToPath[d]=a,a in e.pathToNames||(e.pathToNames[a]={}),e.pathToNames[a][d]=!0;for(d=0;b=c[d];d++)a in e.requires||(e.requires[a]={}),e.requires[a][b]=!0}};goog.require=function(a){if(!COMPILED&&!goog.getObjectByName(a)){var b=goog.getPathFromDeps_(a);if(b)goog.included_[b]=!0,goog.writeScripts_();else throw a="goog.require could not find: "+a,goog.global.console&&goog.global.console.error(a),Error(a);}};goog.useStrictRequires=!1;goog.basePath="";goog.nullFunction=function(){};goog.identityFunction=function(a){return a};goog.abstractMethod=function(){throw Error("unimplemented abstract method");};goog.addSingletonGetter=function(a){a.getInstance=function(){return a.instance_||(a.instance_=new a)}};if(!COMPILED)goog.included_={},goog.dependencies_={pathToNames:{},nameToPath:{},requires:{},visited:{},written:{}},goog.inHtmlDocument_=function(){var a=goog.global.document;return typeof a!="undefined"&&"write"in a},goog.findBasePath_=function(){if(goog.inHtmlDocument_()){var a=goog.global.document;if(goog.global.CLOSURE_BASE_PATH)goog.basePath=goog.global.CLOSURE_BASE_PATH;else for(var a=a.getElementsByTagName("script"),b=a.length-1;b>=0;--b){var c=a[b].src,d=c.length;if(c.substr(d-7)=="base.js"){goog.basePath=c.substr(0,d-7);break}}}},goog.writeScriptTag_=function(a){goog.inHtmlDocument_()&&!goog.dependencies_.written[a]&&(goog.dependencies_.written[a]=!0,goog.global.document.write('<script type="text/javascript" src="'+a+'"><\/script>'))},goog.writeScripts_=function(){function a(e){if(!(e in d.written)){if(!(e in d.visited)&&(d.visited[e]=!0,e in d.requires))for(var g in d.requires[e])if(g in d.nameToPath)a(d.nameToPath[g]);else if(!goog.getObjectByName(g))throw Error("Undefined nameToPath for "+g);e in
c||(c[e]=!0,b.push(e))}}var b=[],c={},d=goog.dependencies_,e;for(e in goog.included_)d.written[e]||a(e);for(e=0;e<b.length;e++)if(b[e])goog.writeScriptTag_(goog.basePath+b[e]);else throw Error("Undefined script input");},goog.getPathFromDeps_=function(a){return a in goog.dependencies_.nameToPath?goog.dependencies_.nameToPath[a]:null},goog.findBasePath_(),goog.global.CLOSURE_NO_DEPS||goog.writeScriptTag_(goog.basePath+"deps.js");goog.typeOf=function(a){var b=typeof a;if(b=="object")if(a){if(a instanceof Array||!(a instanceof Object)&&Object.prototype.toString.call(a)=="[object Array]"||typeof a.length=="number"&&typeof a.splice!="undefined"&&typeof a.propertyIsEnumerable!="undefined"&&!a.propertyIsEnumerable("splice"))return"array";if(!(a instanceof Object)&&(Object.prototype.toString.call(a)=="[object Function]"||typeof a.call!="undefined"&&typeof a.propertyIsEnumerable!="undefined"&&!a.propertyIsEnumerable("call")))return"function"}else return"null";else if(b=="function"&&typeof a.call=="undefined")return"object";return b};goog.propertyIsEnumerableCustom_=function(a,b){if(b in a)for(var c in a)if(c==b&&Object.prototype.hasOwnProperty.call(a,b))return!0;return!1};goog.propertyIsEnumerable_=function(a,b){return a instanceof Object?Object.prototype.propertyIsEnumerable.call(a,b):goog.propertyIsEnumerableCustom_(a,b)};goog.isDef=function(a){return a!==void 0};goog.isNull=function(a){return a===null};goog.isDefAndNotNull=function(a){return a!=null};goog.isArray=function(a){return goog.typeOf(a)=="array"};goog.isArrayLike=function(a){var b=goog.typeOf(a);return b=="array"||b=="object"&&typeof a.length=="number"};goog.isDateLike=function(a){return goog.isObject(a)&&typeof a.getFullYear=="function"};goog.isString=function(a){return typeof a=="string"};goog.isBoolean=function(a){return typeof a=="boolean"};goog.isNumber=function(a){return typeof a=="number"};goog.isFunction=function(a){return goog.typeOf(a)=="function"};goog.isObject=function(a){a=goog.typeOf(a);return a=="object"||a=="array"||a=="function"};goog.getHashCode=function(a){if(a.hasOwnProperty&&a.hasOwnProperty(goog.HASH_CODE_PROPERTY_))return a[goog.HASH_CODE_PROPERTY_];a[goog.HASH_CODE_PROPERTY_]||(a[goog.HASH_CODE_PROPERTY_]=++goog.hashCodeCounter_);return a[goog.HASH_CODE_PROPERTY_]};goog.removeHashCode=function(a){"removeAttribute"in a&&a.removeAttribute(goog.HASH_CODE_PROPERTY_);try{delete a[goog.HASH_CODE_PROPERTY_]}catch(b){}};goog.HASH_CODE_PROPERTY_="closure_hashCode_"+Math.floor(Math.random()*2147483648).toString(36);goog.hashCodeCounter_=0;goog.cloneObject=function(a){var b=goog.typeOf(a);if(b=="object"||b=="array"){if(a.clone)return a.clone.call(a);var b=b=="array"?[]:{},c;for(c in a)b[c]=goog.cloneObject(a[c]);return b}return a};goog.bind=function(a,b,c){var d=b||goog.global;if(arguments.length>2){var e=Array.prototype.slice.call(arguments,2);return function(){var b=Array.prototype.slice.call(arguments);Array.prototype.unshift.apply(b,e);return a.apply(d,b)}}else return function(){return a.apply(d,arguments)}};goog.partial=function(a,b){var c=Array.prototype.slice.call(arguments,1);return function(){var b=Array.prototype.slice.call(arguments);b.unshift.apply(b,c);return a.apply(this,b)}};goog.mixin=function(a,b){for(var c in b)a[c]=b[c]};goog.now=Date.now||function(){return+new Date};goog.globalEval=function(a){if(goog.global.execScript)goog.global.execScript(a,"JavaScript");else if(goog.global.eval){if(goog.evalWorksForGlobals_==null)goog.global.eval("var _et_ = 1;"),typeof goog.global._et_!="undefined"?(delete goog.global._et_,goog.evalWorksForGlobals_=!0):goog.evalWorksForGlobals_=!1;if(goog.evalWorksForGlobals_)goog.global.eval(a);else{var b=goog.global.document,c=b.createElement("script");c.type="text/javascript";c.defer=!1;c.appendChild(b.createTextNode(a));b.body.appendChild(c);b.body.removeChild(c)}}else throw Error("goog.globalEval not available");};goog.typedef=!0;goog.getCssName=function(a,b){var c=a+(b?"-"+b:"");return goog.cssNameMapping_&&c in goog.cssNameMapping_?goog.cssNameMapping_[c]:c};goog.setCssNameMapping=function(a){goog.cssNameMapping_=a};goog.getMsg=function(a,b){var c=b||{},d;for(d in c)a=a.replace(RegExp("\\{\\$"+d+"\\}","gi"),c[d]);return a};goog.exportSymbol=function(a,b,c){goog.exportPath_(a,b,c)};goog.exportProperty=function(a,b,c){a[b]=c};goog.inherits=function(a,b){function c(){}c.prototype=b.prototype;a.superClass_=b.prototype;a.prototype=new c;a.prototype.constructor=a};goog.math={};goog.math.Coordinate=function(a,b){this.x=goog.isDef(a)?a:0;this.y=goog.isDef(b)?b:0};goog.math.Coordinate.prototype.clone=function(){return new goog.math.Coordinate(this.x,this.y)};if(goog.DEBUG)goog.math.Coordinate.prototype.toString=function(){return"("+this.x+", "+this.y+")"};goog.math.Coordinate.equals=function(a,b){return a==b?!0:!a||!b?!1:a.x==b.x&&a.y==b.y};goog.math.Coordinate.distance=function(a,b){var c=a.x-b.x,d=a.y-b.y;return Math.sqrt(c*c+d*d)};goog.math.Coordinate.squaredDistance=function(a,b){var c=a.x-b.x,d=a.y-b.y;return c*c+d*d};goog.math.Coordinate.difference=function(a,b){return new goog.math.Coordinate(a.x-b.x,a.y-b.y)};goog.math.Coordinate.sum=function(a,b){return new goog.math.Coordinate(a.x+b.x,a.y+b.y)};goog.math.Box=function(a,b,c,d){this.top=a;this.right=b;this.bottom=c;this.left=d};goog.math.Box.boundingBox=function(a){for(var b=new goog.math.Box(arguments[0].y,arguments[0].x,arguments[0].y,arguments[0].x),c=1;c<arguments.length;c++){var d=arguments[c];b.top=Math.min(b.top,d.y);b.right=Math.max(b.right,d.x);b.bottom=Math.max(b.bottom,d.y);b.left=Math.min(b.left,d.x)}return b};goog.math.Box.prototype.clone=function(){return new goog.math.Box(this.top,this.right,this.bottom,this.left)};if(goog.DEBUG)goog.math.Box.prototype.toString=function(){return"("+this.top+"t, "+this.right+"r, "+this.bottom+"b, "+this.left+"l)"};goog.math.Box.prototype.contains=function(a){return goog.math.Box.contains(this,a)};goog.math.Box.prototype.expand=function(a,b,c,d){goog.isObject(a)?(this.top-=a.top,this.right+=a.right,this.bottom+=a.bottom,this.left-=a.left):(this.top-=a,this.right+=b,this.bottom+=c,this.left-=d);return this};goog.math.Box.equals=function(a,b){return a==b?!0:!a||!b?!1:a.top==b.top&&a.right==b.right&&a.bottom==b.bottom&&a.left==b.left};goog.math.Box.contains=function(a,b){return!a||!b?!1:b instanceof goog.math.Box?b.left>=a.left&&b.right<=a.right&&b.top>=a.top&&b.bottom<=a.bottom:b.x>=a.left&&b.x<=a.right&&b.y>=a.top&&b.y<=a.bottom};goog.math.Box.distance=function(a,b){return b.x>=a.left&&b.x<=a.right?b.y>=a.top&&b.y<=a.bottom?0:b.y<a.top?a.top-b.y:b.y-a.bottom:b.y>=a.top&&b.y<=a.bottom?b.x<a.left?a.left-b.x:b.x-a.right:goog.math.Coordinate.distance(b,new goog.math.Coordinate(b.x<a.left?a.left:a.right,b.y<a.top?a.top:a.bottom))};goog.array={};goog.array.ArrayLike=goog.typedef;goog.array.peek=function(a){return a[a.length-1]};goog.array.ARRAY_PROTOTYPE_=Array.prototype;goog.array.indexOf=goog.array.ARRAY_PROTOTYPE_.indexOf?function(a,b,c){return goog.array.ARRAY_PROTOTYPE_.indexOf.call(a,b,c)}:function(a,b,c){for(c=c==null?0:c<0?Math.max(0,a.length+c):c;c<a.length;c++)if(c in a&&a[c]===b)return c;return-1};goog.array.lastIndexOf=goog.array.ARRAY_PROTOTYPE_.lastIndexOf?function(a,b,c){return goog.array.ARRAY_PROTOTYPE_.lastIndexOf.call(a,b,c==null?a.length-1:c)}:function(a,b,c){c=c==null?a.length-1:c;for(c<0&&(c=Math.max(0,a.length+c));c>=0;c--)if(c in a&&a[c]===b)return c;return-1};goog.array.forEach=goog.array.ARRAY_PROTOTYPE_.forEach?function(a,b,c){goog.array.ARRAY_PROTOTYPE_.forEach.call(a,b,c)}:function(a,b,c){for(var d=a.length,e=goog.isString(a)?a.split(""):a,f=0;f<d;f++)f in e&&b.call(c,e[f],f,a)};goog.array.forEachRight=function(a,b,c){var d=a.length,e=goog.isString(a)?a.split(""):a;for(d-=1;d>=0;--d)d in e&&b.call(c,e[d],d,a)};goog.array.filter=goog.array.ARRAY_PROTOTYPE_.filter?function(a,b,c){return goog.array.ARRAY_PROTOTYPE_.filter.call(a,b,c)}:function(a,b,c){for(var d=a.length,e=[],f=0,g=goog.isString(a)?a.split(""):a,h=0;h<d;h++)if(h in g){var i=g[h];b.call(c,i,h,a)&&(e[f++]=i)}return e};goog.array.map=goog.array.ARRAY_PROTOTYPE_.map?function(a,b,c){return goog.array.ARRAY_PROTOTYPE_.map.call(a,b,c)}:function(a,b,c){for(var d=a.length,e=[],f=0,g=goog.isString(a)?a.split(""):a,h=0;h<d;h++)h in g&&(e[f++]=b.call(c,g[h],h,a));return e};goog.array.reduce=function(a,b,c,d){if(a.reduce)return d?a.reduce(goog.bind(b,d),c):a.reduce(b,c);var e=c;goog.array.forEach(a,function(c,g){e=b.call(d,e,c,g,a)});return e};goog.array.reduceRight=function(a,b,c,d){if(a.reduceRight)return d?a.reduceRight(goog.bind(b,d),c):a.reduceRight(b,c);var e=c;goog.array.forEachRight(a,function(c,g){e=b.call(d,e,c,g,a)});return e};goog.array.some=goog.array.ARRAY_PROTOTYPE_.some?function(a,b,c){return goog.array.ARRAY_PROTOTYPE_.some.call(a,b,c)}:function(a,b,c){for(var d=a.length,e=goog.isString(a)?a.split(""):a,f=0;f<d;f++)if(f in e&&b.call(c,e[f],f,a))return!0;return!1};goog.array.every=goog.array.ARRAY_PROTOTYPE_.every?function(a,b,c){return goog.array.ARRAY_PROTOTYPE_.every.call(a,b,c)}:function(a,b,c){for(var d=a.length,e=goog.isString(a)?a.split(""):a,f=0;f<d;f++)if(f in e&&!b.call(c,e[f],f,a))return!1;return!0};goog.array.find=function(a,b,c){b=goog.array.findIndex(a,b,c);return b<0?null:goog.isString(a)?a.charAt(b):a[b]};goog.array.findIndex=function(a,b,c){for(var d=a.length,e=goog.isString(a)?a.split(""):a,f=0;f<d;f++)if(f in e&&b.call(c,e[f],f,a))return f;return-1};goog.array.findRight=function(a,b,c){b=goog.array.findIndexRight(a,b,c);return b<0?null:goog.isString(a)?a.charAt(b):a[b]};goog.array.findIndexRight=function(a,b,c){var d=a.length,e=goog.isString(a)?a.split(""):a;for(d-=1;d>=0;d--)if(d in e&&b.call(c,e[d],d,a))return d;return-1};goog.array.contains=function(a,b){return goog.array.indexOf(a,b)>=0};goog.array.isEmpty=function(a){return a.length==0};goog.array.clear=function(a){if(!goog.isArray(a))for(var b=a.length-1;b>=0;b--)delete a[b];a.length=0};goog.array.insert=function(a,b){goog.array.contains(a,b)||a.push(b)};goog.array.insertAt=function(a,b,c){goog.array.splice(a,c,0,b)};goog.array.insertArrayAt=function(a,b,c){goog.partial(goog.array.splice,a,c,0).apply(null,b)};goog.array.insertBefore=function(a,b,c){var d;arguments.length==2||(d=goog.array.indexOf(a,c))<0?a.push(b):goog.array.insertAt(a,b,d)};goog.array.remove=function(a,b){var c=goog.array.indexOf(a,b),d;(d=c>=0)&&goog.array.removeAt(a,c);return d};goog.array.removeAt=function(a,b){return goog.array.ARRAY_PROTOTYPE_.splice.call(a,b,1).length==1};goog.array.removeIf=function(a,b,c){b=goog.array.findIndex(a,b,c);return b>=0?(goog.array.removeAt(a,b),!0):!1};goog.array.clone=function(a){if(goog.isArray(a))return a.concat();else{for(var b=[],c=0,d=a.length;c<d;c++)b[c]=a[c];return b}};goog.array.toArray=function(a){return goog.isArray(a)?a.concat():goog.array.clone(a)};goog.array.extend=function(a,b){for(var c=1;c<arguments.length;c++){var d=arguments[c];goog.isArrayLike(d)?(d=goog.array.toArray(d),a.push.apply(a,d)):a.push(d)}};goog.array.splice=function(a,b,c,d){return goog.array.ARRAY_PROTOTYPE_.splice.apply(a,goog.array.slice(arguments,1))};goog.array.slice=function(a,b,c){return arguments.length<=2?goog.array.ARRAY_PROTOTYPE_.slice.call(a,b):goog.array.ARRAY_PROTOTYPE_.slice.call(a,b,c)};goog.array.removeDuplicates=function(a,b){for(var c=b||a,d={},e=0,f=0;f<a.length;){var g=a[f++],h=goog.isObject(g)?goog.getHashCode(g):g;Object.prototype.hasOwnProperty.call(d,h)||(d[h]=!0,c[e++]=g)}c.length=e};goog.array.binarySearch=function(a,b,c){for(var d=0,e=a.length-1,c=c||goog.array.defaultCompare;d<=e;){var f=d+e>>1,g=c(b,a[f]);if(g>0)d=f+1;else if(g<0)e=f-1;else return f}return-(d+1)};goog.array.sort=function(a,b){goog.array.ARRAY_PROTOTYPE_.sort.call(a,b||goog.array.defaultCompare)};goog.array.stableSort=function(a,b){for(var c=0;c<a.length;c++)a[c]={index:c,value:a[c]};var d=b||goog.array.defaultCompare;goog.array.sort(a,function(a,b){return d(a.value,b.value)||a.index-b.index});for(c=0;c<a.length;c++)a[c]=a[c].value};goog.array.sortObjectsByKey=function(a,b,c){var d=c||goog.array.defaultCompare;goog.array.sort(a,function(a,c){return d(a[b],c[b])})};goog.array.equals=function(a,b,c){if(!goog.isArrayLike(a)||!goog.isArrayLike(b)||a.length!=b.length)return!1;for(var d=a.length,c=c||goog.array.defaultCompareEquality,e=0;e<d;e++)if(!c(a[e],b[e]))return!1;return!0};goog.array.compare=function(a,b,c){return goog.array.equals(a,b,c)};goog.array.defaultCompare=function(a,b){return a>b?1:a<b?-1:0};goog.array.defaultCompareEquality=function(a,b){return a===b};goog.array.binaryInsert=function(a,b,c){c=goog.array.binarySearch(a,b,c);return c<0?(goog.array.insertAt(a,b,-(c+1)),!0):!1};goog.array.binaryRemove=function(a,b,c){b=goog.array.binarySearch(a,b,c);return b>=0?goog.array.removeAt(a,b):!1};goog.array.bucket=function(a,b){for(var c={},d=0;d<a.length;d++){var e=a[d],f=b(e,d,a);goog.isDef(f)&&(c[f]||(c[f]=[])).push(e)}return c};goog.array.repeat=function(a,b){for(var c=[],d=0;d<b;d++)c[d]=a;return c};goog.array.flatten=function(a){for(var b=[],c=0;c<arguments.length;c++){var d=arguments[c];goog.isArray(d)?b.push.apply(b,goog.array.flatten.apply(null,d)):b.push(d)}return b};goog.array.rotate=function(a,b){a.length&&(b%=a.length,b>0?goog.array.ARRAY_PROTOTYPE_.unshift.apply(a,a.splice(-b,b)):b<0&&goog.array.ARRAY_PROTOTYPE_.push.apply(a,a.splice(0,-b)));return a};goog.dom={};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.dom.classes={};goog.dom.classes.set=function(a,b){a.className=b};goog.dom.classes.get=function(a){return(a=a.className)&&typeof a.split=="function"?a.split(" "):[]};goog.dom.classes.add=function(a,b){var c=goog.dom.classes.get(a),d=goog.array.slice(arguments,1),d=goog.dom.classes.add_(c,d);a.className=c.join(" ");return d};goog.dom.classes.remove=function(a,b){var c=goog.dom.classes.get(a),d=goog.array.slice(arguments,1),d=goog.dom.classes.remove_(c,d);a.className=c.join(" ");return d};goog.dom.classes.add_=function(a,b){for(var c=0,d=0;d<b.length;d++)goog.array.contains(a,b[d])||(a.push(b[d]),c++);return c==b.length};goog.dom.classes.remove_=function(a,b){for(var c=0,d=0;d<a.length;d++)goog.array.contains(b,a[d])&&(goog.array.splice(a,d--,1),c++);return c==b.length};goog.dom.classes.swap=function(a,b,c){for(var d=goog.dom.classes.get(a),e=!1,f=0;f<d.length;f++)d[f]==b&&(goog.array.splice(d,f--,1),e=!0);if(e)d.push(c),a.className=d.join(" ");return e};goog.dom.classes.addRemove=function(a,b,c){var d=goog.dom.classes.get(a);goog.isString(b)?goog.array.remove(d,b):goog.isArray(b)&&goog.dom.classes.remove_(d,b);goog.isString(c)&&!goog.array.contains(d,c)?d.push(c):goog.isArray(c)&&goog.dom.classes.add_(d,c);a.className=d.join(" ")};goog.dom.classes.has=function(a,b){return goog.array.contains(goog.dom.classes.get(a),b)};goog.dom.classes.enable=function(a,b,c){c?goog.dom.classes.add(a,b):goog.dom.classes.remove(a,b)};goog.dom.classes.toggle=function(a,b){var c=!goog.dom.classes.has(a,b);goog.dom.classes.enable(a,b,c);return c};goog.math.Size=function(a,b){this.width=a;this.height=b};goog.math.Size.equals=function(a,b){return a==b?!0:!a||!b?!1: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(a){return this.width<=a.width&&this.height<=a.height};goog.math.Size.prototype.floor=function(){this.width=Math.floor(this.width);this.height=Math.floor(this.height);return this};goog.math.Size.prototype.round=function(){this.width=Math.round(this.width);this.height=Math.round(this.height);return this};goog.math.Size.prototype.scale=function(a){this.width*=a;this.height*=a;return this};goog.math.Size.prototype.scaleToFit=function(a){return this.scale(this.aspectRatio()>a.aspectRatio()?a.width/this.width:a.height/this.height)};goog.object={};goog.object.forEach=function(a,b,c){for(var d in a)b.call(c,a[d],d,a)};goog.object.filter=function(a,b,c){var d={},e;for(e in a)b.call(c,a[e],e,a)&&(d[e]=a[e]);return d};goog.object.map=function(a,b,c){var d={},e;for(e in a)d[e]=b.call(c,a[e],e,a);return d};goog.object.some=function(a,b,c){for(var d in a)if(b.call(c,a[d],d,a))return!0;return!1};goog.object.every=function(a,b,c){for(var d in a)if(!b.call(c,a[d],d,a))return!1;return!0};goog.object.getCount=function(a){var b=0,c;for(c in a)b++;return b};goog.object.getAnyKey=function(a){for(var b in a)return b};goog.object.getAnyValue=function(a){for(var b in a)return a[b]};goog.object.contains=function(a,b){return goog.object.containsValue(a,b)};goog.object.getValues=function(a){var b=[],c=0,d;for(d in a)b[c++]=a[d];return b};goog.object.getKeys=function(a){var b=[],c=0,d;for(d in a)b[c++]=d;return b};goog.object.containsKey=function(a,b){return b in a};goog.object.containsValue=function(a,b){for(var c in a)if(a[c]==b)return!0;return!1};goog.object.findKey=function(a,b,c){for(var d in a)if(b.call(c,a[d],d,a))return d};goog.object.findValue=function(a,b,c){return(b=goog.object.findKey(a,b,c))&&a[b]};goog.object.isEmpty=function(a){for(var b in a)return!1;return!0};goog.object.clear=function(a){for(var b=goog.object.getKeys(a),c=b.length-1;c>=0;c--)goog.object.remove(a,b[c])};goog.object.remove=function(a,b){var c;(c=b in a)&&delete a[b];return c};goog.object.add=function(a,b,c){if(b in a)throw Error('The object already contains the key "'+b+'"');goog.object.set(a,b,c)};goog.object.get=function(a,b,c){return b in a?a[b]:c};goog.object.set=function(a,b,c){a[b]=c};goog.object.setIfUndefined=function(a,b,c){return b in a?a[b]:a[b]=c};goog.object.clone=function(a){var b={},c;for(c in a)b[c]=a[c];return b};goog.object.transpose=function(a){var b={},c;for(c in a)b[a[c]]=c;return b};goog.object.PROTOTYPE_FIELDS_="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",");goog.object.extend=function(a,b){for(var c,d,e=1;e<arguments.length;e++){d=arguments[e];for(c in d)a[c]=d[c];for(var f=0;f<goog.object.PROTOTYPE_FIELDS_.length;f++)c=goog.object.PROTOTYPE_FIELDS_[f],Object.prototype.hasOwnProperty.call(d,c)&&(a[c]=d[c])}};goog.object.create=function(a){var b=arguments.length;if(b==1&&goog.isArray(arguments[0]))return goog.object.create.apply(null,arguments[0]);if(b%2)throw Error("Uneven number of arguments");for(var c={},d=0;d<b;d+=2)c[arguments[d]]=arguments[d+1];return c};goog.object.createSet=function(a){var b=arguments.length;if(b==1&&goog.isArray(arguments[0]))return goog.object.createSet.apply(null,arguments[0]);for(var c={},d=0;d<b;d++)c[arguments[d]]=!0;return c};goog.string={};goog.string.Unicode={NBSP:"\u00a0"};goog.string.startsWith=function(a,b){return a.indexOf(b)==0};goog.string.endsWith=function(a,b){var c=a.length-b.length;return c>=0&&a.lastIndexOf(b,c)==c};goog.string.caseInsensitiveStartsWith=function(a,b){return goog.string.caseInsensitiveCompare(b,a.substr(0,b.length))==0};goog.string.caseInsensitiveEndsWith=function(a,b){return goog.string.caseInsensitiveCompare(b,a.substr(a.length-b.length,b.length))==0};goog.string.subs=function(a,b){for(var c=1;c<arguments.length;c++)var d=String(arguments[c]).replace(/\$/g,"$$$$"),a=a.replace(/\%s/,d);return a};goog.string.collapseWhitespace=function(a){return a.replace(/[\s\xa0]+/g," ").replace(/^\s+|\s+$/g,"")};goog.string.isEmpty=function(a){return/^[\s\xa0]*$/.test(a)};goog.string.isEmptySafe=function(a){return goog.string.isEmpty(goog.string.makeSafe(a))};goog.string.isBreakingWhitespace=function(a){return!/[^\t\n\r ]/.test(a)};goog.string.isAlpha=function(a){return!/[^a-zA-Z]/.test(a)};goog.string.isNumeric=function(a){return!/[^0-9]/.test(a)};goog.string.isAlphaNumeric=function(a){return!/[^a-zA-Z0-9]/.test(a)};goog.string.isSpace=function(a){return a==" "};goog.string.isUnicodeChar=function(a){return a.length==1&&a>=" "&&a<="~"||a>="\u0080"&&a<="\ufffd"};goog.string.stripNewlines=function(a){return a.replace(/(\r\n|\r|\n)+/g," ")};goog.string.canonicalizeNewlines=function(a){return a.replace(/(\r\n|\r|\n)/g,"\n")};goog.string.normalizeWhitespace=function(a){return a.replace(/\xa0|\s/g," ")};goog.string.normalizeSpaces=function(a){return a.replace(/\xa0|[ \t]+/g," ")};goog.string.trim=function(a){return a.replace(/^[\s\xa0]+|[\s\xa0]+$/g,"")};goog.string.trimLeft=function(a){return a.replace(/^[\s\xa0]+/,"")};goog.string.trimRight=function(a){return a.replace(/[\s\xa0]+$/,"")};goog.string.caseInsensitiveCompare=function(a,b){var c=String(a).toLowerCase(),d=String(b).toLowerCase();return c<d?-1:c==d?0:1};goog.string.numerateCompareRegExp_=/(\.\d+)|(\d+)|(\D+)/g;goog.string.numerateCompare=function(a,b){if(a==b)return 0;if(!a)return-1;if(!b)return 1;for(var c=a.toLowerCase().match(goog.string.numerateCompareRegExp_),d=b.toLowerCase().match(goog.string.numerateCompareRegExp_),e=Math.min(c.length,d.length),f=0;f<e;f++){var g=c[f],h=d[f];if(g!=h){c=parseInt(g,10);return!isNaN(c)&&(d=parseInt(h,10),!isNaN(d)&&c-d)?c-d:g<h?-1:1}}return c.length!=d.length?c.length-d.length:a<b?-1:1};goog.string.encodeUriRegExp_=/^[a-zA-Z0-9\-_.!~*'()]*$/;goog.string.urlEncode=function(a){a=String(a);return!goog.string.encodeUriRegExp_.test(a)?encodeURIComponent(a):a};goog.string.urlDecode=function(a){return decodeURIComponent(a.replace(/\+/g," "))};goog.string.newLineToBr=function(a,b){return a.replace(/(\r\n|\r|\n)/g,b?"<br />":"<br>")};goog.string.htmlEscape=function(a,b){if(b)return a.replace(goog.string.amperRe_,"&amp;").replace(goog.string.ltRe_,"&lt;").replace(goog.string.gtRe_,"&gt;").replace(goog.string.quotRe_,"&quot;");else{if(!goog.string.allRe_.test(a))return a;a.indexOf("&")!=-1&&(a=a.replace(goog.string.amperRe_,"&amp;"));a.indexOf("<")!=-1&&(a=a.replace(goog.string.ltRe_,"&lt;"));a.indexOf(">")!=-1&&(a=a.replace(goog.string.gtRe_,"&gt;"));a.indexOf('"')!=-1&&(a=a.replace(goog.string.quotRe_,"&quot;"));return a}};goog.string.amperRe_=/&/g;goog.string.ltRe_=/</g;goog.string.gtRe_=/>/g;goog.string.quotRe_=/\"/g;goog.string.allRe_=/[&<>\"]/;goog.string.unescapeEntities=function(a){return goog.string.contains(a,"&")?"document"in goog.global&&!goog.string.contains(a,"<")?goog.string.unescapeEntitiesUsingDom_(a):goog.string.unescapePureXmlEntities_(a):a};goog.string.unescapeEntitiesUsingDom_=function(a){var b=goog.global.document.createElement("a");b.innerHTML=a;if(b[goog.string.NORMALIZE_FN_])b[goog.string.NORMALIZE_FN_]();a=b.firstChild.nodeValue;b.innerHTML="";return a};goog.string.unescapePureXmlEntities_=function(a){return a.replace(/&([^;]+);/g,function(a,c){switch(c){case"amp":return"&";case"lt":return"<";case"gt":return">";case"quot":return'"';default:if(c.charAt(0)=="#"){var d=Number("0"+c.substr(1));if(!isNaN(d))return String.fromCharCode(d)}return a}})};goog.string.NORMALIZE_FN_="normalize";goog.string.whitespaceEscape=function(a,b){return goog.string.newLineToBr(a.replace(/  /g," &#160;"),b)};goog.string.stripQuotes=function(a,b){for(var c=b.length,d=0;d<c;d++){var e=c==1?b:b.charAt(d);if(a.charAt(0)==e&&a.charAt(a.length-1)==e)return a.substring(1,a.length-1)}return a};goog.string.truncate=function(a,b,c){c&&(a=goog.string.unescapeEntities(a));a.length>b&&(a=a.substring(0,b-3)+"...");c&&(a=goog.string.htmlEscape(a));return a};goog.string.truncateMiddle=function(a,b,c){c&&(a=goog.string.unescapeEntities(a));if(a.length>b){var d=Math.floor(b/2),e=a.length-d;d+=b%2;a=a.substring(0,d)+"..."+a.substring(e)}c&&(a=goog.string.htmlEscape(a));return a};goog.string.jsEscapeCache_={"\u0008":"\\b","\u000c":"\\f","\n":"\\n","\r":"\\r","\t":"\\t","\u000b":"\\x0B",'"':'\\"',"'":"\\'","\\":"\\\\"};goog.string.quote=function(a){a=String(a);if(a.quote)return a.quote();else{for(var b=['"'],c=0;c<a.length;c++)b[c+1]=goog.string.escapeChar(a.charAt(c));b.push('"');return b.join("")}};goog.string.escapeChar=function(a){if(a in goog.string.jsEscapeCache_)return goog.string.jsEscapeCache_[a];var b=a,c=a.charCodeAt(0);if(c>31&&c<127)b=a;else{if(c<256){if(b="\\x",c<16||c>256)b+="0"}else b="\\u",c<4096&&(b+="0");b+=c.toString(16).toUpperCase()}return goog.string.jsEscapeCache_[a]=b};goog.string.toMap=function(a){for(var b={},c=0;c<a.length;c++)b[a.charAt(c)]=!0;return b};goog.string.contains=function(a,b){return a.indexOf(b)!=-1};goog.string.removeAt=function(a,b,c){var d=a;b>=0&&b<a.length&&c>0&&(d=a.substr(0,b)+a.substr(b+c,a.length-b-c));return d};goog.string.remove=function(a,b){var c=RegExp(goog.string.regExpEscape(b),"");return a.replace(c,"")};goog.string.removeAll=function(a,b){var c=RegExp(goog.string.regExpEscape(b),"g");return a.replace(c,"")};goog.string.regExpEscape=function(a){return String(a).replace(/([-()\[\]{}+?*.$\^|,:#<!\\])/g,"\\$1").replace(/\x08/g,"\\x08")};goog.string.repeat=function(a,b){return Array(b+1).join(a)};goog.string.padNumber=function(a,b,c){a=goog.isDef(c)?a.toFixed(c):String(a);c=a.indexOf(".");if(c==-1)c=a.length;return goog.string.repeat("0",Math.max(0,b-c))+a};goog.string.makeSafe=function(a){return a==null?"":String(a)};goog.string.buildString=function(a){return Array.prototype.join.call(arguments,"")};goog.string.getRandomString=function(){return Math.floor(Math.random()*2147483648).toString(36)+(Math.floor(Math.random()*2147483648)^(new Date).getTime()).toString(36)};goog.string.compareVersions=function(a,b){for(var c=0,d=goog.string.trim(String(a)).split("."),e=goog.string.trim(String(b)).split("."),f=Math.max(d.length,e.length),g=0;c==0&&g<f;g++){var h=d[g]||"",i=e[g]||"",j=RegExp("(\\d*)(\\D*)","g"),l=RegExp("(\\d*)(\\D*)","g");do{var k=j.exec(h)||["","",""],m=l.exec(i)||["","",""];if(k[0].length==0&&m[0].length==0)break;var c=k[1].length==0?0:parseInt(k[1],10),n=m[1].length==0?0:parseInt(m[1],10),c=goog.string.compareElements_(c,n)||goog.string.compareElements_(k[2].length==0,m[2].length==0)||goog.string.compareElements_(k[2],m[2])}while(c==0)}return c};goog.string.compareElements_=function(a,b){if(a<b)return-1;else if(a>b)return 1;return 0};goog.string.HASHCODE_MAX_=4294967296;goog.string.hashCode=function(a){for(var b=0,c=0;c<a.length;++c)b=31*b+a.charCodeAt(c),b%=goog.string.HASHCODE_MAX_;return b};goog.string.uniqueStringCounter_=goog.now();goog.string.createUniqueString=function(){return"goog_"+goog.string.uniqueStringCounter_++};goog.string.toNumber=function(a){var b=Number(a);return b==0&&goog.string.isEmpty(a)?NaN:b};goog.userAgent={};goog.userAgent.ASSUME_IE=!1;goog.userAgent.ASSUME_GECKO=!1;goog.userAgent.ASSUME_WEBKIT=!1;goog.userAgent.ASSUME_MOBILE_WEBKIT=!1;goog.userAgent.ASSUME_OPERA=!1;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_=!1;goog.userAgent.detectedIe_=!1;goog.userAgent.detectedWebkit_=!1;goog.userAgent.detectedMobile_=!1;goog.userAgent.detectedGecko_=!1;var a;if(!goog.userAgent.BROWSER_KNOWN_&&(a=goog.userAgent.getUserAgentString())){var b=goog.userAgent.getNavigator();goog.userAgent.detectedOpera_=a.indexOf("Opera")==0;goog.userAgent.detectedIe_=!goog.userAgent.detectedOpera_&&a.indexOf("MSIE")!=-1;goog.userAgent.detectedWebkit_=!goog.userAgent.detectedOpera_&&a.indexOf("WebKit")!=-1;goog.userAgent.detectedMobile_=goog.userAgent.detectedWebkit_&&a.indexOf("Mobile")!=-1;goog.userAgent.detectedGecko_=!goog.userAgent.detectedOpera_&&!goog.userAgent.detectedWebkit_&&b.product=="Gecko"}};goog.userAgent.BROWSER_KNOWN_||goog.userAgent.init_();goog.userAgent.OPERA=goog.userAgent.BROWSER_KNOWN_?goog.userAgent.ASSUME_OPERA:goog.userAgent.detectedOpera_;goog.userAgent.IE=goog.userAgent.BROWSER_KNOWN_?goog.userAgent.ASSUME_IE:goog.userAgent.detectedIe_;goog.userAgent.GECKO=goog.userAgent.BROWSER_KNOWN_?goog.userAgent.ASSUME_GECKO:goog.userAgent.detectedGecko_;goog.userAgent.WEBKIT=goog.userAgent.BROWSER_KNOWN_?goog.userAgent.ASSUME_WEBKIT||goog.userAgent.ASSUME_MOBILE_WEBKIT:goog.userAgent.detectedWebkit_;goog.userAgent.MOBILE=goog.userAgent.ASSUME_MOBILE_WEBKIT||goog.userAgent.detectedMobile_;goog.userAgent.SAFARI=goog.userAgent.WEBKIT;goog.userAgent.determinePlatform_=function(){var a=goog.userAgent.getNavigator();return a&&a.platform||""};goog.userAgent.PLATFORM=goog.userAgent.determinePlatform_();goog.userAgent.ASSUME_MAC=!1;goog.userAgent.ASSUME_WINDOWS=!1;goog.userAgent.ASSUME_LINUX=!1;goog.userAgent.ASSUME_X11=!1;goog.userAgent.PLATFORM_KNOWN_=goog.userAgent.ASSUME_MAC||goog.userAgent.ASSUME_WINDOWS||goog.userAgent.ASSUME_LINUX||goog.userAgent.ASSUME_X11;goog.userAgent.initPlatform_=function(){goog.userAgent.detectedMac_=goog.string.contains(goog.userAgent.PLATFORM,"Mac");goog.userAgent.detectedWindows_=goog.string.contains(goog.userAgent.PLATFORM,"Win");goog.userAgent.detectedLinux_=goog.string.contains(goog.userAgent.PLATFORM,"Linux");goog.userAgent.detectedX11_=!!goog.userAgent.getNavigator()&&goog.string.contains(goog.userAgent.getNavigator().appVersion||"","X11")};goog.userAgent.PLATFORM_KNOWN_||goog.userAgent.initPlatform_();goog.userAgent.MAC=goog.userAgent.PLATFORM_KNOWN_?goog.userAgent.ASSUME_MAC:goog.userAgent.detectedMac_;goog.userAgent.WINDOWS=goog.userAgent.PLATFORM_KNOWN_?goog.userAgent.ASSUME_WINDOWS:goog.userAgent.detectedWindows_;goog.userAgent.LINUX=goog.userAgent.PLATFORM_KNOWN_?goog.userAgent.ASSUME_LINUX:goog.userAgent.detectedLinux_;goog.userAgent.X11=goog.userAgent.PLATFORM_KNOWN_?goog.userAgent.ASSUME_X11:goog.userAgent.detectedX11_;goog.userAgent.determineVersion_=function(){var a="",b;goog.userAgent.OPERA&&goog.global.opera?(a=goog.global.opera.version,a=typeof a=="function"?a():a):(goog.userAgent.GECKO?b=/rv\:([^\);]+)(\)|;)/:goog.userAgent.IE?b=/MSIE\s+([^\);]+)(\)|;)/:goog.userAgent.WEBKIT&&(b=/WebKit\/(\S+)/),b&&(a=(a=b.exec(goog.userAgent.getUserAgentString()))?a[1]:""));return a};goog.userAgent.VERSION=goog.userAgent.determineVersion_();goog.userAgent.compare=function(a,b){return goog.string.compareVersions(a,b)};goog.userAgent.isVersionCache_={};goog.userAgent.isVersion=function(a){return goog.userAgent.isVersionCache_[a]||(goog.userAgent.isVersionCache_[a]=goog.string.compareVersions(goog.userAgent.VERSION,a)>=0)};goog.dom.ASSUME_QUIRKS_MODE=!1;goog.dom.ASSUME_STANDARDS_MODE=!1;goog.dom.COMPAT_MODE_KNOWN_=goog.dom.ASSUME_QUIRKS_MODE||goog.dom.ASSUME_STANDARDS_MODE;goog.dom.NodeType={ELEMENT:1,ATTRIBUTE:2,TEXT:3,CDATA_SECTION:4,ENTITY_REFERENCE:5,ENTITY:6,PROCESSING_INSTRUCTION:7,COMMENT:8,DOCUMENT:9,DOCUMENT_TYPE:10,DOCUMENT_FRAGMENT:11,NOTATION:12};goog.dom.getDomHelper=function(a){return a?new goog.dom.DomHelper(goog.dom.getOwnerDocument(a)):goog.dom.defaultDomHelper_||(goog.dom.defaultDomHelper_=new goog.dom.DomHelper)};goog.dom.getDocument=function(){return document};goog.dom.getElement=function(a){return goog.isString(a)?document.getElementById(a):a};goog.dom.$=goog.dom.getElement;goog.dom.getElementsByTagNameAndClass=function(a,b,c){return goog.dom.getElementsByTagNameAndClass_(document,a,b,c)};goog.dom.getElementsByTagNameAndClass_=function(a,b,c,d){d=d||a;b=b&&b!="*"?b.toLowerCase():"";if(d.querySelectorAll&&(b||c)&&(!goog.userAgent.WEBKIT||goog.dom.isCss1CompatMode_(a)||goog.userAgent.isVersion("528")))return d.querySelectorAll(b+(c?"."+c:""));if(c&&d.getElementsByClassName)if(a=d.getElementsByClassName(c),b){for(var d={},e=0,f=0,g;g=a[f];f++)b==g.nodeName.toLowerCase()&&(d[e++]=g);d.length=e;return d}else return a;a=d.getElementsByTagName(b||"*");if(c){d={};for(f=e=0;g=a[f];f++)b=g.className,typeof b.split=="function"&&goog.array.contains(b.split(" "),c)&&(d[e++]=g);d.length=e;return d}else return a};goog.dom.$$=goog.dom.getElementsByTagNameAndClass;goog.dom.setProperties=function(a,b){goog.object.forEach(b,function(b,d){d=="style"?a.style.cssText=b:d=="class"?a.className=b:d=="for"?a.htmlFor=b:d in goog.dom.DIRECT_ATTRIBUTE_MAP_?a.setAttribute(goog.dom.DIRECT_ATTRIBUTE_MAP_[d],b):a[d]=b})};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(a){return goog.dom.getViewportSize_(a||window)};goog.dom.getViewportSize_=function(a){var b=a.document;if(goog.userAgent.WEBKIT&&!goog.userAgent.isVersion("500")&&!goog.userAgent.MOBILE){typeof a.innerHeight=="undefined"&&(a=window);var b=a.innerHeight,c=a.document.documentElement.scrollHeight;a==a.top&&c<b&&(b-=15);return new goog.math.Size(a.innerWidth,b)}a=goog.dom.isCss1CompatMode_(b)&&(!goog.userAgent.OPERA||goog.userAgent.OPERA&&goog.userAgent.isVersion("9.50"))?b.documentElement:b.body;return new goog.math.Size(a.clientWidth,a.clientHeight)};goog.dom.getDocumentHeight=function(){return goog.dom.getDocumentHeight_(window)};goog.dom.getDocumentHeight_=function(a){var b=a.document,c=0;if(b){var a=goog.dom.getViewportSize_(a).height,c=b.body,d=b.documentElement;if(goog.dom.isCss1CompatMode_(b)&&d.scrollHeight)c=d.scrollHeight!=a?d.scrollHeight:d.offsetHeight;else{var b=d.scrollHeight,e=d.offsetHeight;if(d.clientHeight!=e)b=c.scrollHeight,e=c.offsetHeight;c=b>a?b>e?b:e:b<e?b:e}}return c};goog.dom.getPageScroll=function(a){return goog.dom.getDomHelper((a||goog.global||window).document).getDocumentScroll()};goog.dom.getDocumentScroll=function(){return goog.dom.getDocumentScroll_(document)};goog.dom.getDocumentScroll_=function(a){a=goog.dom.getDocumentScrollElement_(a);return new goog.math.Coordinate(a.scrollLeft,a.scrollTop)};goog.dom.getDocumentScrollElement=function(){return goog.dom.getDocumentScrollElement_(document)};goog.dom.getDocumentScrollElement_=function(a){return!goog.userAgent.WEBKIT&&goog.dom.isCss1CompatMode_(a)?a.documentElement:a.body};goog.dom.getWindow=function(a){return a?goog.dom.getWindow_(a):window};goog.dom.getWindow_=function(a){if(a.parentWindow)return a.parentWindow;if(goog.userAgent.WEBKIT&&!goog.userAgent.isVersion("500")&&!goog.userAgent.MOBILE){var b=a.createElement("script");b.innerHTML="document.parentWindow=window";var c=a.documentElement;c.appendChild(b);c.removeChild(b);return a.parentWindow}return a.defaultView};goog.dom.createDom=function(a,b,c){return goog.dom.createDom_(document,arguments)};goog.dom.createDom_=function(a,b){var c=b[0],d=b[1];if(goog.userAgent.IE&&d&&(d.name||d.type))c=["<",c],d.name&&c.push(' name="',goog.string.htmlEscape(d.name),'"'),d.type&&(c.push(' type="',goog.string.htmlEscape(d.type),'"'),d=goog.cloneObject(d),delete d.type),c.push(">"),c=c.join("");var e=a.createElement(c);if(d)goog.isString(d)?e.className=d:goog.dom.setProperties(e,d);if(b.length>2){d=function(b){b&&e.appendChild(goog.isString(b)?a.createTextNode(b):b)};for(c=2;c<b.length;c++){var f=b[c];goog.isArrayLike(f)&&!goog.dom.isNodeLike(f)?goog.array.forEach(goog.dom.isNodeList(f)?goog.array.clone(f):f,d):d(f)}}return e};goog.dom.$dom=goog.dom.createDom;goog.dom.createElement=function(a){return document.createElement(a)};goog.dom.createTextNode=function(a){return document.createTextNode(a)};goog.dom.htmlToDocumentFragment=function(a){return goog.dom.htmlToDocumentFragment_(document,a)};goog.dom.htmlToDocumentFragment_=function(a,b){var c=a.createElement("div");c.innerHTML=b;if(c.childNodes.length==1)return c.firstChild;else{for(var d=a.createDocumentFragment();c.firstChild;)d.appendChild(c.firstChild);return d}};goog.dom.getCompatMode=function(){return goog.dom.isCss1CompatMode()?"CSS1Compat":"BackCompat"};goog.dom.isCss1CompatMode=function(){return goog.dom.isCss1CompatMode_(document)};goog.dom.isCss1CompatMode_=function(a){return goog.dom.COMPAT_MODE_KNOWN_?goog.dom.ASSUME_STANDARDS_MODE:a.compatMode=="CSS1Compat"};goog.dom.canHaveChildren=function(a){if(a.nodeType!=goog.dom.NodeType.ELEMENT)return!1;if("canHaveChildren"in a)return a.canHaveChildren;switch(a.tagName){case goog.dom.TagName.APPLET:case goog.dom.TagName.AREA: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!1}return!0};goog.dom.appendChild=function(a,b){a.appendChild(b)};goog.dom.removeChildren=function(a){for(var b;b=a.firstChild;)a.removeChild(b)};goog.dom.insertSiblingBefore=function(a,b){b.parentNode&&b.parentNode.insertBefore(a,b)};goog.dom.insertSiblingAfter=function(a,b){b.parentNode&&b.parentNode.insertBefore(a,b.nextSibling)};goog.dom.removeNode=function(a){return a&&a.parentNode?a.parentNode.removeChild(a):null};goog.dom.replaceNode=function(a,b){var c=b.parentNode;c&&c.replaceChild(a,b)};goog.dom.flattenElement=function(a){var b,c=a.parentNode;if(c&&c.nodeType!=goog.dom.NodeType.DOCUMENT_FRAGMENT)if(a.removeNode)return a.removeNode(!1);else{for(;b=a.firstChild;)c.insertBefore(b,a);return goog.dom.removeNode(a)}};goog.dom.getFirstElementChild=function(a){return goog.dom.getNextElementNode_(a.firstChild,!0)};goog.dom.getLastElementChild=function(a){return goog.dom.getNextElementNode_(a.lastChild,!1)};goog.dom.getNextElementSibling=function(a){return goog.dom.getNextElementNode_(a.nextSibling,!0)};goog.dom.getPreviousElementSibling=function(a){return goog.dom.getNextElementNode_(a.previousSibling,!1)};goog.dom.getNextElementNode_=function(a,b){for(;a&&a.nodeType!=goog.dom.NodeType.ELEMENT;)a=b?a.nextSibling:a.previousSibling;return a};goog.dom.isNodeLike=function(a){return goog.isObject(a)&&a.nodeType>0};goog.dom.BAD_CONTAINS_WEBKIT_=goog.userAgent.WEBKIT&&goog.userAgent.isVersion("522");goog.dom.contains=function(a,b){if(typeof a.contains!="undefined"&&!goog.dom.BAD_CONTAINS_WEBKIT_&&b.nodeType==goog.dom.NodeType.ELEMENT)return a==b||a.contains(b);if(typeof a.compareDocumentPosition!="undefined")return a==b||Boolean(a.compareDocumentPosition(b)&16);for(;b&&a!=b;)b=b.parentNode;return b==a};goog.dom.compareNodeOrder=function(a,b){if(a==b)return 0;if(a.compareDocumentPosition)return a.compareDocumentPosition(b)&2?1:-1;if("sourceIndex"in a||a.parentNode&&"sourceIndex"in a.parentNode){var c=a.nodeType==goog.dom.NodeType.ELEMENT,d=b.nodeType==goog.dom.NodeType.ELEMENT;if(c&&d)return a.sourceIndex-b.sourceIndex;else{var e=a.parentNode,f=b.parentNode;return e==f?goog.dom.compareSiblingOrder_(a,b):!c&&goog.dom.contains(e,b)?-1*goog.dom.compareParentsDescendantNodeIe_(a,b):!d&&goog.dom.contains(f,a)?goog.dom.compareParentsDescendantNodeIe_(b,a):(c?a.sourceIndex:e.sourceIndex)-(d?b.sourceIndex:f.sourceIndex)}}d=goog.dom.getOwnerDocument(a);c=d.createRange();c.selectNode(a);c.collapse(!0);d=d.createRange();d.selectNode(b);d.collapse(!0);return c.compareBoundaryPoints(goog.global.Range.START_TO_END,d)};goog.dom.compareParentsDescendantNodeIe_=function(a,b){var c=a.parentNode;if(c==b)return-1;for(var d=b;d.parentNode!=c;)d=d.parentNode;return goog.dom.compareSiblingOrder_(d,a)};goog.dom.compareSiblingOrder_=function(a,b){for(var c=b;c=c.previousSibling;)if(c==a)return-1;return 1};goog.dom.findCommonAncestor=function(a){var b,c=arguments.length;if(c){if(c==1)return arguments[0]}else return null;var d=[],e=Infinity;for(b=0;b<c;b++){for(var f=[],g=arguments[b];g;)f.unshift(g),g=g.parentNode;d.push(f);e=Math.min(e,f.length)}f=null;for(b=0;b<e;b++){for(var g=d[0][b],h=1;h<c;h++)if(g!=d[h][b])return f;f=g}return f};goog.dom.getOwnerDocument=function(a){return a.nodeType==goog.dom.NodeType.DOCUMENT?a:a.ownerDocument||a.document};goog.dom.getFrameContentDocument=function(a){return goog.userAgent.WEBKIT?a.document||a.contentWindow.document:a.contentDocument||a.contentWindow.document};goog.dom.getFrameContentWindow=function(a){return a.contentWindow||goog.dom.getWindow_(goog.dom.getFrameContentDocument(a))};goog.dom.setTextContent=function(a,b){if("textContent"in a)a.textContent=b;else if(a.firstChild&&a.firstChild.nodeType==goog.dom.NodeType.TEXT){for(;a.lastChild!=a.firstChild;)a.removeChild(a.lastChild);a.firstChild.data=b}else{goog.dom.removeChildren(a);var c=goog.dom.getOwnerDocument(a);a.appendChild(c.createTextNode(b))}};goog.dom.getOuterHtml=function(a){if("outerHTML"in a)return a.outerHTML;else{var b=goog.dom.getOwnerDocument(a).createElement("div");b.appendChild(a.cloneNode(!0));return b.innerHTML}};goog.dom.findNode=function(a,b){var c=[];return goog.dom.findNodes_(a,b,c,!0)?c[0]:void 0};goog.dom.findNodes=function(a,b){var c=[];goog.dom.findNodes_(a,b,c,!1);return c};goog.dom.findNodes_=function(a,b,c,d){if(a!=null)for(var e=0,f;f=a.childNodes[e];e++){if(b(f)&&(c.push(f),d))return!0;if(goog.dom.findNodes_(f,b,c,d))return!0}return!1};goog.dom.TAGS_TO_IGNORE_={SCRIPT:1,STYLE:1,HEAD:1,IFRAME:1,OBJECT:1};goog.dom.PREDEFINED_TAG_VALUES_={IMG:" ",BR:"\n"};goog.dom.isFocusableTabIndex=function(a){var b=a.getAttributeNode("tabindex");return b&&b.specified?(a=a.tabIndex,goog.isNumber(a)&&a>=0):!1};goog.dom.setFocusableTabIndex=function(a,b){b?a.tabIndex=0:a.removeAttribute("tabIndex")};goog.dom.getTextContent=function(a){if(goog.userAgent.IE&&"innerText"in a)a=goog.string.canonicalizeNewlines(a.innerText);else{var b=[];goog.dom.getTextContent_(a,b,!0);a=b.join("")}a=a.replace(/\xAD/g,"");a=a.replace(/ +/g," ");a!=" "&&(a=a.replace(/^\s*/,""));return a};goog.dom.getRawTextContent=function(a){var b=[];goog.dom.getTextContent_(a,b,!1);return b.join("")};goog.dom.getTextContent_=function(a,b,c){if(!(a.nodeName in goog.dom.TAGS_TO_IGNORE_))if(a.nodeType==goog.dom.NodeType.TEXT)c?b.push(String(a.nodeValue).replace(/(\r\n|\r|\n)/g,"")):b.push(a.nodeValue);else if(a.nodeName in goog.dom.PREDEFINED_TAG_VALUES_)b.push(goog.dom.PREDEFINED_TAG_VALUES_[a.nodeName]);else for(a=a.firstChild;a;)goog.dom.getTextContent_(a,b,c),a=a.nextSibling};goog.dom.getNodeTextLength=function(a){return goog.dom.getTextContent(a).length};goog.dom.getNodeTextOffset=function(a,b){for(var c=b||goog.dom.getOwnerDocument(a).body,d=[];a&&a!=c;){for(var e=a;e=e.previousSibling;)d.unshift(goog.dom.getTextContent(e));a=a.parentNode}return goog.string.trimLeft(d.join("")).replace(/ +/g," ").length};goog.dom.getNodeAtOffset=function(a,b,c){for(var a=[a],d=0,e;a.length>0&&d<b;)if(e=a.pop(),!(e.nodeName in goog.dom.TAGS_TO_IGNORE_))if(e.nodeType==goog.dom.NodeType.TEXT){var f=e.nodeValue.replace(/(\r\n|\r|\n)/g,"").replace(/ +/g," ");d+=f.length}else if(e.nodeName in goog.dom.PREDEFINED_TAG_VALUES_)d+=goog.dom.PREDEFINED_TAG_VALUES_[e.nodeName].length;else for(f=e.childNodes.length-1;f>=0;f--)a.push(e.childNodes[f]);if(goog.isObject(c))c.remainder=e?e.nodeValue.length+b-d-1:0,c.node=e;return e};goog.dom.isNodeList=function(a){if(a&&typeof a.length=="number")if(goog.isObject(a))return typeof a.item=="function"||typeof a.item=="string";else if(goog.isFunction(a))return typeof a.item=="function";return!1};goog.dom.getAncestorByTagNameAndClass=function(a,b,c){return goog.dom.getAncestor(a,function(a){return(!b||a.nodeName==b)&&(!c||goog.dom.classes.has(a,c))},!0)};goog.dom.getAncestor=function(a,b,c,d){if(!c)a=a.parentNode;for(var c=d==null,e=0;a&&(c||e<=d);){if(b(a))return a;a=a.parentNode;e++}return null};goog.dom.DomHelper=function(a){this.document_=a||goog.global.document||document};goog.dom.DomHelper.prototype.getDomHelper=goog.dom.getDomHelper;goog.dom.DomHelper.prototype.setDocument=function(a){this.document_=a};goog.dom.DomHelper.prototype.getDocument=function(){return this.document_};goog.dom.DomHelper.prototype.getElement=function(a){return goog.isString(a)?this.document_.getElementById(a):a};goog.dom.DomHelper.prototype.$=goog.dom.DomHelper.prototype.getElement;goog.dom.DomHelper.prototype.getElementsByTagNameAndClass=function(a,b,c){return goog.dom.getElementsByTagNameAndClass_(this.document_,a,b,c)};goog.dom.DomHelper.prototype.$$=goog.dom.DomHelper.prototype.getElementsByTagNameAndClass;goog.dom.DomHelper.prototype.setProperties=goog.dom.setProperties;goog.dom.DomHelper.prototype.getViewportSize=function(a){return goog.dom.getViewportSize(a||this.getWindow())};goog.dom.DomHelper.prototype.getDocumentHeight=function(){return goog.dom.getDocumentHeight_(this.getWindow())};goog.dom.DomHelper.prototype.createDom=function(a,b,c){return goog.dom.createDom_(this.document_,arguments)};goog.dom.DomHelper.prototype.$dom=goog.dom.DomHelper.prototype.createDom;goog.dom.DomHelper.prototype.createElement=function(a){return this.document_.createElement(a)};goog.dom.DomHelper.prototype.createTextNode=function(a){return this.document_.createTextNode(a)};goog.dom.DomHelper.prototype.htmlToDocumentFragment=function(a){return goog.dom.htmlToDocumentFragment_(this.document_,a)};goog.dom.DomHelper.prototype.getCompatMode=function(){return this.isCss1CompatMode()?"CSS1Compat":"BackCompat"};goog.dom.DomHelper.prototype.isCss1CompatMode=function(){return goog.dom.isCss1CompatMode_(this.document_)};goog.dom.DomHelper.prototype.getWindow=function(){return goog.dom.getWindow_(this.document_)};goog.dom.DomHelper.prototype.getDocumentScrollElement=function(){return goog.dom.getDocumentScrollElement_(this.document_)};goog.dom.DomHelper.prototype.getDocumentScroll=function(){return goog.dom.getDocumentScroll_(this.document_)};goog.dom.DomHelper.prototype.appendChild=goog.dom.appendChild;goog.dom.DomHelper.prototype.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.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.debug={};goog.debug.errorHandlerWeakDep={protectEntryPoint:function(a){return a}};goog.Disposable=function(){};goog.Disposable.prototype.disposed_=!1;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_=!0,this.disposeInternal()};goog.Disposable.prototype.disposeInternal=function(){};goog.dispose=function(a){a&&typeof a.dispose=="function"&&a.dispose()};goog.events={};goog.events.Event=function(a,b){goog.Disposable.call(this);this.type=a;this.currentTarget=this.target=b};goog.inherits(goog.events.Event,goog.Disposable);goog.events.Event.prototype.disposeInternal=function(){delete this.type;delete this.target;delete this.currentTarget};goog.events.Event.prototype.propagationStopped_=!1;goog.events.Event.prototype.returnValue_=!0;goog.events.Event.prototype.stopPropagation=function(){this.propagationStopped_=!0};goog.events.Event.prototype.preventDefault=function(){this.returnValue_=!1};goog.events.BrowserEvent=function(a,b){a&&this.init(a,b)};goog.inherits(goog.events.BrowserEvent,goog.events.Event);goog.events.BrowserEvent.MouseButton={LEFT:0,MIDDLE:1,RIGHT:2};goog.events.BrowserEvent.IEButtonMap_=[1,4,2];goog.events.BrowserEvent.prototype.target=null;goog.events.BrowserEvent.prototype.relatedTarget=null;goog.events.BrowserEvent.prototype.offsetX=0;goog.events.BrowserEvent.prototype.offsetY=0;goog.events.BrowserEvent.prototype.clientX=0;goog.events.BrowserEvent.prototype.clientY=0;goog.events.BrowserEvent.prototype.screenX=0;goog.events.BrowserEvent.prototype.screenY=0;goog.events.BrowserEvent.prototype.button=0;goog.events.BrowserEvent.prototype.keyCode=0;goog.events.BrowserEvent.prototype.charCode=0;goog.events.BrowserEvent.prototype.ctrlKey=!1;goog.events.BrowserEvent.prototype.altKey=!1;goog.events.BrowserEvent.prototype.shiftKey=!1;goog.events.BrowserEvent.prototype.metaKey=!1;goog.events.BrowserEvent.prototype.event_=null;goog.events.BrowserEvent.prototype.init=function(a,b){var c=this.type=a.type;this.target=a.target||a.srcElement;this.currentTarget=b;var d=a.relatedTarget;if(d){if(goog.userAgent.GECKO)try{d=d.nodeName&&d}catch(e){}}else if(c=="mouseover")d=a.fromElement;else if(c=="mouseout")d=a.toElement;this.relatedTarget=d;this.offsetX=a.offsetX!==void 0?a.offsetX:a.layerX;this.offsetY=a.offsetY!==void 0?a.offsetY:a.layerY;this.clientX=a.clientX!==void 0?a.clientX:a.pageX;this.clientY=a.clientY!==void 0?a.clientY:a.pageY;this.screenX=a.screenX||0;this.screenY=a.screenY||0;this.button=a.button;this.keyCode=a.keyCode||0;this.charCode=a.charCode||(c=="keypress"?a.keyCode:0);this.ctrlKey=a.ctrlKey;this.altKey=a.altKey;this.shiftKey=a.shiftKey;this.metaKey=a.metaKey;this.event_=a;delete this.returnValue_;delete this.propagationStopped_};goog.events.BrowserEvent.prototype.isButton=function(a){return goog.userAgent.IE?this.type=="click"?a==goog.events.BrowserEvent.MouseButton.LEFT:!!(this.event_.button&goog.events.BrowserEvent.IEButtonMap_[a]):this.event_.button==a};goog.events.BrowserEvent.prototype.stopPropagation=function(){this.propagationStopped_=!0;this.event_.stopPropagation?this.event_.stopPropagation():this.event_.cancelBubble=!0};goog.events.BrowserEvent.IE7_SET_KEY_CODE_TO_PREVENT_DEFAULT_=goog.userAgent.IE&&!goog.userAgent.isVersion("8");goog.events.BrowserEvent.prototype.preventDefault=function(){this.returnValue_=!1;var a=this.event_;if(a.preventDefault)a.preventDefault();else if(a.returnValue=!1,goog.events.BrowserEvent.IE7_SET_KEY_CODE_TO_PREVENT_DEFAULT_)try{if(a.ctrlKey||a.keyCode>=112&&a.keyCode<=123)a.keyCode=-1}catch(b){}};goog.events.BrowserEvent.prototype.getBrowserEvent=function(){return this.event_};goog.events.BrowserEvent.prototype.disposeInternal=function(){goog.events.BrowserEvent.superClass_.disposeInternal.call(this);this.relatedTarget=this.currentTarget=this.target=this.event_=null};goog.events.EventWrapper=function(){};goog.events.EventWrapper.prototype.listen=function(){};goog.events.EventWrapper.prototype.unlisten=function(){};goog.events.Listener=function(){};goog.events.Listener.counter_=0;goog.events.Listener.prototype.key=0;goog.events.Listener.prototype.removed=!1;goog.events.Listener.prototype.callOnce=!1;goog.events.Listener.prototype.init=function(a,b,c,d,e,f){if(goog.isFunction(a))this.isFunctionListener_=!0;else if(a&&a.handleEvent&&goog.isFunction(a.handleEvent))this.isFunctionListener_=!1;else throw Error("Invalid listener argument");this.listener=a;this.proxy=b;this.src=c;this.type=d;this.capture=!!e;this.handler=f;this.callOnce=!1;this.key=++goog.events.Listener.counter_;this.removed=!1};goog.events.Listener.prototype.handleEvent=function(a){return this.isFunctionListener_?this.listener.call(this.handler||this.src,a):this.listener.handleEvent.call(this.listener,a)};goog.structs={};goog.structs.SimplePool=function(a,b){goog.Disposable.call(this);this.maxCount_=b;this.freeQueue_=[];this.createInitial_(a)};goog.inherits(goog.structs.SimplePool,goog.Disposable);goog.structs.SimplePool.prototype.createObjectFn_=null;goog.structs.SimplePool.prototype.disposeObjectFn_=null;goog.structs.SimplePool.prototype.setCreateObjectFn=function(a){this.createObjectFn_=a};goog.structs.SimplePool.prototype.setDisposeObjectFn=function(a){this.disposeObjectFn_=a};goog.structs.SimplePool.prototype.getObject=function(){return this.freeQueue_.length?this.freeQueue_.pop():this.createObject()};goog.structs.SimplePool.prototype.releaseObject=function(a){this.freeQueue_.length<this.maxCount_?this.freeQueue_.push(a):this.disposeObject(a)};goog.structs.SimplePool.prototype.createInitial_=function(a){if(a>this.maxCount_)throw Error("[goog.structs.SimplePool] Initial cannot be greater than max");for(var b=0;b<a;b++)this.freeQueue_.push(this.createObject())};goog.structs.SimplePool.prototype.createObject=function(){return this.createObjectFn_?this.createObjectFn_():{}};goog.structs.SimplePool.prototype.disposeObject=function(a){if(this.disposeObjectFn_)this.disposeObjectFn_(a);else if(goog.isFunction(a.dispose))a.dispose();else for(var b in a)delete a[b]};goog.structs.SimplePool.prototype.disposeInternal=function(){goog.structs.SimplePool.superClass_.disposeInternal.call(this);for(var a=this.freeQueue_;a.length;)this.disposeObject(a.pop());delete this.freeQueue_};goog.userAgent.jscript={};goog.userAgent.jscript.ASSUME_NO_JSCRIPT=!1;goog.userAgent.jscript.init_=function(){goog.userAgent.jscript.DETECTED_HAS_JSCRIPT_="ScriptEngine"in goog.global&&goog.global.ScriptEngine()=="JScript";goog.userAgent.jscript.DETECTED_VERSION_=goog.userAgent.jscript.DETECTED_HAS_JSCRIPT_?goog.global.ScriptEngineMajorVersion()+"."+goog.global.ScriptEngineMinorVersion()+"."+goog.global.ScriptEngineBuildVersion():"0"};goog.userAgent.jscript.ASSUME_NO_JSCRIPT||goog.userAgent.jscript.init_();goog.userAgent.jscript.HAS_JSCRIPT=goog.userAgent.jscript.ASSUME_NO_JSCRIPT?!1:goog.userAgent.jscript.DETECTED_HAS_JSCRIPT_;goog.userAgent.jscript.VERSION=goog.userAgent.jscript.ASSUME_NO_JSCRIPT?"0":goog.userAgent.jscript.DETECTED_VERSION_;goog.userAgent.jscript.isVersion=function(a){return goog.string.compareVersions(goog.userAgent.jscript.VERSION,a)>=0};goog.events.pools={};(function(){function a(){return{count_:0,remaining_:0}}function b(){return[]}function c(){var a=function(b){return g.call(a.src,a.key,b)};return a}function d(){return new goog.events.Listener}function e(){return new goog.events.BrowserEvent}var f=goog.userAgent.jscript.HAS_JSCRIPT&&!goog.userAgent.jscript.isVersion("5.7"),g;goog.events.pools.setProxyCallbackFunction=function(a){g=a};if(f){goog.events.pools.getObject=function(){return h.getObject()};goog.events.pools.releaseObject=function(a){h.releaseObject(a)};goog.events.pools.getArray=function(){return i.getObject()};goog.events.pools.releaseArray=function(a){i.releaseObject(a)};goog.events.pools.getProxy=function(){return j.getObject()};goog.events.pools.releaseProxy=function(){j.releaseObject(c())};goog.events.pools.getListener=function(){return l.getObject()};goog.events.pools.releaseListener=function(a){l.releaseObject(a)};goog.events.pools.getEvent=function(){return k.getObject()};goog.events.pools.releaseEvent=function(a){k.releaseObject(a)};var h=new goog.structs.SimplePool(0,600);h.setCreateObjectFn(a);var i=new goog.structs.SimplePool(0,600);i.setCreateObjectFn(b);var j=new goog.structs.SimplePool(0,600);j.setCreateObjectFn(c);var l=new goog.structs.SimplePool(0,600);l.setCreateObjectFn(d);var k=new goog.structs.SimplePool(0,600);k.setCreateObjectFn(e)}else goog.events.pools.getObject=a,goog.events.pools.releaseObject=goog.nullFunction,goog.events.pools.getArray=b,goog.events.pools.releaseArray=goog.nullFunction,goog.events.pools.getProxy=c,goog.events.pools.releaseProxy=goog.nullFunction,goog.events.pools.getListener=d,goog.events.pools.releaseListener=goog.nullFunction,goog.events.pools.getEvent=e,goog.events.pools.releaseEvent=goog.nullFunction})();goog.events.listeners_={};goog.events.listenerTree_={};goog.events.sources_={};goog.events.onString_="on";goog.events.onStringMap_={};goog.events.keySeparator_="_";goog.events.listen=function(a,b,c,d,e){if(b)if(goog.isArray(b)){for(var f=0;f<b.length;f++)goog.events.listen(a,b[f],c,d,e);return null}else{var d=!!d,g=goog.events.listenerTree_;b in g||(g[b]=goog.events.pools.getObject());g=g[b];d in g||(g[d]=goog.events.pools.getObject(),g.count_++);var g=g[d],h=goog.getHashCode(a),i;g.remaining_++;if(g[h]){i=g[h];for(f=0;f<i.length;f++)if(g=i[f],g.listener==c&&g.handler==e){if(g.removed)break;return i[f].key}}else i=g[h]=goog.events.pools.getArray(),g.count_++;f=goog.events.pools.getProxy();f.src=a;g=goog.events.pools.getListener();g.init(c,f,a,b,d,e);c=g.key;f.key=c;i.push(g);goog.events.listeners_[c]=g;goog.events.sources_[h]||(goog.events.sources_[h]=goog.events.pools.getArray());goog.events.sources_[h].push(g);a.addEventListener?(a==goog.global||!a.customEvent_)&&a.addEventListener(b,f,d):a.attachEvent(goog.events.getOnString_(b),f);return c}else throw Error("Invalid event type");};goog.events.listenOnce=function(a,b,c,d,e){if(goog.isArray(b)){for(var f=0;f<b.length;f++)goog.events.listenOnce(a,b[f],c,d,e);return null}a=goog.events.listen(a,b,c,d,e);goog.events.listeners_[a].callOnce=!0;return a};goog.events.listenWithWrapper=function(a,b,c,d,e){b.listen(a,c,d,e)};goog.events.unlisten=function(a,b,c,d,e){if(goog.isArray(b)){for(var f=0;f<b.length;f++)goog.events.unlisten(a,b[f],c,d,e);return null}d=!!d;a=goog.events.getListeners_(a,b,d);if(!a)return!1;for(f=0;f<a.length;f++)if(a[f].listener==c&&a[f].capture==d&&a[f].handler==e)return goog.events.unlistenByKey(a[f].key);return!1};goog.events.unlistenByKey=function(a){if(!goog.events.listeners_[a])return!1;var b=goog.events.listeners_[a];if(b.removed)return!1;var c=b.src,d=b.type,e=b.proxy,f=b.capture;c.removeEventListener?(c==goog.global||!c.customEvent_)&&c.removeEventListener(d,e,f):c.detachEvent&&c.detachEvent(goog.events.getOnString_(d),e);c=goog.getHashCode(c);e=goog.events.listenerTree_[d][f][c];if(goog.events.sources_[c]){var g=goog.events.sources_[c];goog.array.remove(g,b);g.length==0&&delete goog.events.sources_[c]}b.removed=!0;e.needsCleanup_=!0;goog.events.cleanUp_(d,f,c,e);delete goog.events.listeners_[a];return!0};goog.events.unlistenWithWrapper=function(a,b,c,d,e){b.unlisten(a,c,d,e)};goog.events.cleanUp_=function(a,b,c,d){if(!d.locked_&&d.needsCleanup_){for(var e=0,f=0;e<d.length;e++)if(d[e].removed){var g=d[e].proxy;g.src=null;goog.events.pools.releaseProxy(g);goog.events.pools.releaseListener(d[e])}else e!=f&&(d[f]=d[e]),f++;d.length=f;d.needsCleanup_=!1;f==0&&(goog.events.pools.releaseArray(d),delete goog.events.listenerTree_[a][b][c],goog.events.listenerTree_[a][b].count_--,goog.events.listenerTree_[a][b].count_==0&&(goog.events.pools.releaseObject(goog.events.listenerTree_[a][b]),delete goog.events.listenerTree_[a][b],goog.events.listenerTree_[a].count_--),goog.events.listenerTree_[a].count_==0&&(goog.events.pools.releaseObject(goog.events.listenerTree_[a]),delete goog.events.listenerTree_[a]))}};goog.events.removeAll=function(a,b,c){var d=0,e=b==null,f=c==null,c=!!c;if(a==null)goog.object.forEach(goog.events.sources_,function(a){for(var g=a.length-1;g>=0;g--){var h=a[g];if((e||b==h.type)&&(f||c==h.capture))goog.events.unlistenByKey(h.key),d++}});else if(a=goog.getHashCode(a),goog.events.sources_[a])for(var a=goog.events.sources_[a],g=a.length-1;g>=0;g--){var h=a[g];if((e||b==h.type)&&(f||c==h.capture))goog.events.unlistenByKey(h.key),d++}return d};goog.events.getListeners=function(a,b,c){return goog.events.getListeners_(a,b,c)||[]};goog.events.getListeners_=function(a,b,c){var d=goog.events.listenerTree_;return b in d&&(d=d[b],c in d&&(d=d[c],a=goog.getHashCode(a),d[a]))?d[a]:null};goog.events.getListener=function(a,b,c,d,e){d=!!d;if(a=goog.events.getListeners_(a,b,d))for(b=0;b<a.length;b++)if(a[b].listener==c&&a[b].capture==d&&a[b].handler==e)return a[b];return null};goog.events.hasListener=function(a,b,c){var a=goog.getHashCode(a),d=goog.events.sources_[a];if(d){var e=goog.isDef(b),f=goog.isDef(c);return e&&f?(d=goog.events.listenerTree_[b],!!d&&!!d[c]&&a in d[c]):!e&&!f?!0:goog.array.some(d,function(a){return e&&a.type==b||f&&a.capture==c})}return!1};goog.events.expose=function(a){var b=[],c;for(c in a)a[c]&&a[c].id?b.push(c+" = "+a[c]+" ("+a[c].id+")"):b.push(c+" = "+a[c]);return b.join("\n")};goog.events.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",CONTEXTMENU:"contextmenu",DRAGSTART:"dragstart",ERROR:"error",HASHCHANGE:"hashchange",HELP:"help",LOAD:"load",LOSECAPTURE:"losecapture",READYSTATECHANGE:"readystatechange",RESIZE:"resize",SCROLL:"scroll",UNLOAD:"unload"};goog.events.getOnString_=function(a){return a in goog.events.onStringMap_?goog.events.onStringMap_[a]:goog.events.onStringMap_[a]=goog.events.onString_+a};goog.events.fireListeners=function(a,b,c,d){var e=goog.events.listenerTree_;return b in e&&(e=e[b],c in e)?goog.events.fireListeners_(e[c],a,b,c,d):!0};goog.events.fireListeners_=function(a,b,c,d,e){var f=1,b=goog.getHashCode(b);if(a[b]){a.remaining_--;a=a[b];a.locked_?a.locked_++:a.locked_=1;try{for(var g=a.length,h=0;h<g;h++){var i=a[h];i&&!i.removed&&(f&=goog.events.fireListener(i,e)!==!1)}}finally{a.locked_--,goog.events.cleanUp_(c,d,b,a)}}return Boolean(f)};goog.events.fireListener=function(a,b){var c=a.handleEvent(b);a.callOnce&&goog.events.unlistenByKey(a.key);return c};goog.events.getTotalListenerCount=function(){return goog.object.getCount(goog.events.listeners_)};goog.events.dispatchEvent=function(a,b){if(goog.isString(b))b=new goog.events.Event(b,a);else if(b instanceof goog.events.Event)b.target=b.target||a;else{var c=b,b=new goog.events.Event(b.type,a);goog.object.extend(b,c)}var c=1,d,e=b.type,f=goog.events.listenerTree_;if(!(e in f))return!0;var f=f[e],e=!0 in f,g;if(e){d=[];for(g=a;g;g=g.getParentEventTarget())d.push(g);g=f[!0];g.remaining_=g.count_;for(var h=d.length-1;!b.propagationStopped_&&h>=0&&g.remaining_;h--)b.currentTarget=d[h],c&=goog.events.fireListeners_(g,d[h],b.type,!0,b)&&b.returnValue_!=!1}if(!1 in f)if(g=f[!1],g.remaining_=g.count_,e)for(h=0;!b.propagationStopped_&&h<d.length&&g.remaining_;h++)b.currentTarget=d[h],c&=goog.events.fireListeners_(g,d[h],b.type,!1,b)&&b.returnValue_!=!1;else for(d=a;!b.propagationStopped_&&d&&g.remaining_;d=d.getParentEventTarget())b.currentTarget=d,c&=goog.events.fireListeners_(g,d,b.type,!1,b)&&b.returnValue_!=!1;return Boolean(c)};goog.events.protectBrowserEventEntryPoint=function(a,b){goog.events.handleBrowserEvent_=a.protectEntryPoint(goog.events.handleBrowserEvent_,b);goog.events.pools.setProxyCallbackFunction(goog.events.handleBrowserEvent_)};goog.events.handleBrowserEvent_=function(a,b){if(!goog.events.listeners_[a])return!0;var c=goog.events.listeners_[a],d=c.type,e=goog.events.listenerTree_;if(!(d in e))return!0;var e=e[d],f,g;if(goog.userAgent.IE){f=b||goog.getObjectByName("window.event");var h=!0 in e,i=!1 in e;if(h){if(goog.events.isMarkedIeEvent_(f))return!0;goog.events.markIeEvent_(f)}var j=goog.events.pools.getEvent();j.init(f,this);f=!0;try{if(h){for(var l=goog.events.pools.getArray(),k=j.currentTarget;k;k=k.parentNode)l.push(k);g=e[!0];g.remaining_=g.count_;for(var m=l.length-1;!j.propagationStopped_&&m>=0&&g.remaining_;m--)j.currentTarget=l[m],f&=goog.events.fireListeners_(g,l[m],d,!0,j);if(i){g=e[!1];g.remaining_=g.count_;for(m=0;!j.propagationStopped_&&m<l.length&&g.remaining_;m++)j.currentTarget=l[m],f&=goog.events.fireListeners_(g,l[m],d,!1,j)}}else f=goog.events.fireListener(c,j)}finally{if(l)l.length=0,goog.events.pools.releaseArray(l);j.dispose();goog.events.pools.releaseEvent(j)}return f}d=new goog.events.BrowserEvent(b,this);try{f=goog.events.fireListener(c,d)}finally{d.dispose()}return f};goog.events.pools.setProxyCallbackFunction(goog.events.handleBrowserEvent_);goog.events.markIeEvent_=function(a){var b=!1;if(a.keyCode==0)try{a.keyCode=-1;return}catch(c){b=!0}if(b||a.returnValue==void 0)a.returnValue=!0};goog.events.isMarkedIeEvent_=function(a){return a.keyCode<0||a.returnValue!=void 0};goog.events.uniqueIdCounter_=0;goog.events.getUniqueId=function(a){return a+"_"+goog.events.uniqueIdCounter_++};goog.events.EventTarget=function(){goog.Disposable.call(this)};goog.inherits(goog.events.EventTarget,goog.Disposable);goog.events.EventTarget.prototype.customEvent_=!0;goog.events.EventTarget.prototype.parentEventTarget_=null;goog.events.EventTarget.prototype.getParentEventTarget=function(){return this.parentEventTarget_};goog.events.EventTarget.prototype.setParentEventTarget=function(a){this.parentEventTarget_=a};goog.events.EventTarget.prototype.addEventListener=function(a,b,c,d){goog.events.listen(this,a,b,c,d)};goog.events.EventTarget.prototype.removeEventListener=function(a,b,c,d){goog.events.unlisten(this,a,b,c,d)};goog.events.EventTarget.prototype.dispatchEvent=function(a){return goog.events.dispatchEvent(this,a)};goog.events.EventTarget.prototype.disposeInternal=function(){goog.events.EventTarget.superClass_.disposeInternal.call(this);goog.events.removeAll(this);this.parentEventTarget_=null};goog.math.Rect=function(a,b,c,d){this.left=a;this.top=b;this.width=c;this.height=d};goog.math.Rect.prototype.clone=function(){return new goog.math.Rect(this.left,this.top,this.width,this.height)};goog.math.Rect.prototype.toBox=function(){return new goog.math.Box(this.top,this.left+this.width,this.top+this.height,this.left)};goog.math.Rect.createFromBox=function(a){return new goog.math.Rect(a.left,a.top,a.right-a.left,a.bottom-a.top)};if(goog.DEBUG)goog.math.Rect.prototype.toString=function(){return"("+this.left+", "+this.top+" - "+this.width+"w x "+this.height+"h)"};goog.math.Rect.equals=function(a,b){return a==b?!0:!a||!b?!1:a.left==b.left&&a.width==b.width&&a.top==b.top&&a.height==b.height};goog.math.Rect.prototype.intersection=function(a){var b=Math.max(this.left,a.left),c=Math.min(this.left+this.width,a.left+a.width);if(b<=c){var d=Math.max(this.top,a.top),a=Math.min(this.top+this.height,a.top+a.height);if(d<=a)return this.left=b,this.top=d,this.width=c-b,this.height=a-d,!0}return!1};goog.math.Rect.intersection=function(a,b){var c=Math.max(a.left,b.left),d=Math.min(a.left+a.width,b.left+b.width);if(c<=d){var e=Math.max(a.top,b.top),f=Math.min(a.top+a.height,b.top+b.height);if(e<=f)return new goog.math.Rect(c,e,d-c,f-e)}return null};goog.math.Rect.intersects=function(a,b){var c=Math.max(a.left,b.left),d=Math.min(a.left+a.width,b.left+b.width);return c<=d&&(c=Math.max(a.top,b.top),d=Math.min(a.top+a.height,b.top+b.height),c<=d)?!0:!1};goog.math.Rect.prototype.intersects=function(a){return goog.math.Rect.intersects(this,a)};goog.math.Rect.difference=function(a,b){var c=goog.math.Rect.intersection(a,b);if(!c||!c.height||!c.width)return[a.clone()];var c=[],d=a.top,e=a.height,f=a.left+a.width,g=a.top+a.height,h=b.left+b.width,i=b.top+b.height;if(b.top>a.top)c.push(new goog.math.Rect(a.left,a.top,a.width,b.top-a.top)),d=b.top,e-=b.top-a.top;i<g&&(c.push(new goog.math.Rect(a.left,i,a.width,g-i)),e=i-d);b.left>a.left&&c.push(new goog.math.Rect(a.left,d,b.left-a.left,e));h<f&&c.push(new goog.math.Rect(h,d,f-h,e));return c};goog.math.Rect.prototype.difference=function(a){return goog.math.Rect.difference(this,a)};goog.math.Rect.prototype.boundingRect=function(a){var b=Math.max(this.left+this.width,a.left+a.width),c=Math.max(this.top+this.height,a.top+a.height);this.left=Math.min(this.left,a.left);this.top=Math.min(this.top,a.top);this.width=b-this.left;this.height=c-this.top};goog.math.Rect.boundingRect=function(a,b){if(!a||!b)return null;var c=a.clone();c.boundingRect(b);return c};goog.math.Rect.prototype.contains=function(a){return a instanceof goog.math.Rect?this.left<=a.left&&this.left+this.width>=a.left+a.width&&this.top<=a.top&&this.top+this.height>=a.top+a.height:a.x>=this.left&&a.x<=this.left+this.width&&a.y>=this.top&&a.y<=this.top+this.height};goog.math.Rect.prototype.getSize=function(){return new goog.math.Size(this.width,this.height)};goog.userAgent.product={};goog.userAgent.product.ASSUME_FIREFOX=!1;goog.userAgent.product.ASSUME_CAMINO=!1;goog.userAgent.product.ASSUME_IPHONE=!1;goog.userAgent.product.ASSUME_ANDROID=!1;goog.userAgent.product.ASSUME_CHROME=!1;goog.userAgent.product.ASSUME_SAFARI=!1;goog.userAgent.product.PRODUCT_KNOWN_=goog.userAgent.ASSUME_IE||goog.userAgent.ASSUME_OPERA||goog.userAgent.product.ASSUME_FIREFOX||goog.userAgent.product.ASSUME_CAMINO||goog.userAgent.product.ASSUME_IPHONE||goog.userAgent.product.ASSUME_ANDROID||goog.userAgent.product.ASSUME_CHROME||goog.userAgent.product.ASSUME_SAFARI;goog.userAgent.product.init_=function(){goog.userAgent.product.detectedFirefox_=!1;goog.userAgent.product.detectedCamino_=!1;goog.userAgent.product.detectedIphone_=!1;goog.userAgent.product.detectedAndroid_=!1;goog.userAgent.product.detectedChrome_=!1;goog.userAgent.product.detectedSafari_=!1;var a=goog.userAgent.getUserAgentString();if(a)if(a.indexOf("Firefox")!=-1)goog.userAgent.product.detectedFirefox_=!0;else if(a.indexOf("Camino")!=-1)goog.userAgent.product.detectedCamino_=!0;else if(a.indexOf("iPhone")!=-1||a.indexOf("iPod")!=-1)goog.userAgent.product.detectedIphone_=!0;else if(a.indexOf("Android")!=-1)goog.userAgent.product.detectedAndroid_=!0;else if(a.indexOf("Chrome")!=-1)goog.userAgent.product.detectedChrome_=!0;else if(a.indexOf("Safari")!=-1)goog.userAgent.product.detectedSafari_=!0};goog.userAgent.product.PRODUCT_KNOWN_||goog.userAgent.product.init_();goog.userAgent.product.OPERA=goog.userAgent.OPERA;goog.userAgent.product.IE=goog.userAgent.IE;goog.userAgent.product.FIREFOX=goog.userAgent.product.PRODUCT_KNOWN_?goog.userAgent.product.ASSUME_FIREFOX:goog.userAgent.product.detectedFirefox_;goog.userAgent.product.CAMINO=goog.userAgent.product.PRODUCT_KNOWN_?goog.userAgent.product.ASSUME_CAMINO:goog.userAgent.product.detectedCamino_;goog.userAgent.product.IPHONE=goog.userAgent.product.PRODUCT_KNOWN_?goog.userAgent.product.ASSUME_IPHONE:goog.userAgent.product.detectedIphone_;goog.userAgent.product.ANDROID=goog.userAgent.product.PRODUCT_KNOWN_?goog.userAgent.product.ASSUME_ANDROID:goog.userAgent.product.detectedAndroid_;goog.userAgent.product.CHROME=goog.userAgent.product.PRODUCT_KNOWN_?goog.userAgent.product.ASSUME_CHROME:goog.userAgent.product.detectedChrome_;goog.userAgent.product.SAFARI=goog.userAgent.product.PRODUCT_KNOWN_?goog.userAgent.product.ASSUME_SAFARI:goog.userAgent.product.detectedSafari_;goog.style={};goog.style.setStyle=function(a,b,c){goog.isString(b)?goog.style.setStyle_(a,c,b):goog.object.forEach(b,goog.partial(goog.style.setStyle_,a))};goog.style.setStyle_=function(a,b,c){a.style[goog.style.toCamelCase(c)]=b};goog.style.getStyle=function(a,b){return a.style[goog.style.toCamelCase(b)]};goog.style.getComputedStyle=function(a,b){var c=goog.dom.getOwnerDocument(a);return c.defaultView&&c.defaultView.getComputedStyle&&(c=c.defaultView.getComputedStyle(a,""))?c[b]:null};goog.style.getCascadedStyle=function(a,b){return a.currentStyle?a.currentStyle[b]:null};goog.style.getStyle_=function(a,b){return goog.style.getComputedStyle(a,b)||goog.style.getCascadedStyle(a,b)||a.style[b]};goog.style.getComputedPosition=function(a){return goog.style.getStyle_(a,"position")};goog.style.getBackgroundColor=function(a){return goog.style.getStyle_(a,"backgroundColor")};goog.style.getComputedOverflowX=function(a){return goog.style.getStyle_(a,"overflowX")};goog.style.getComputedOverflowY=function(a){return goog.style.getStyle_(a,"overflowY")};goog.style.getComputedZIndex=function(a){return goog.style.getStyle_(a,"zIndex")};goog.style.getComputedTextAlign=function(a){return goog.style.getStyle_(a,"textAlign")};goog.style.getComputedCursor=function(a){return goog.style.getStyle_(a,"cursor")};goog.style.setPosition=function(a,b,c){var d,e=goog.userAgent.GECKO&&(goog.userAgent.MAC||goog.userAgent.X11)&&goog.userAgent.isVersion("1.9");b instanceof goog.math.Coordinate?(d=b.x,b=b.y):(d=b,b=c);a.style.left=typeof d=="number"?(e?Math.round(d):d)+"px":d;a.style.top=typeof b=="number"?(e?Math.round(b):b)+"px":b};goog.style.getPosition=function(a){return new goog.math.Coordinate(a.offsetLeft,a.offsetTop)};goog.style.getClientViewportElement=function(a){a=a?a.nodeType==goog.dom.NodeType.DOCUMENT?a:goog.dom.getOwnerDocument(a):goog.dom.getDocument();return goog.userAgent.IE&&!goog.dom.getDomHelper(a).isCss1CompatMode()?a.body:a.documentElement};goog.style.getBoundingClientRect_=function(a){var b=a.getBoundingClientRect();if(goog.userAgent.IE)a=a.ownerDocument,b.left-=a.documentElement.clientLeft+a.body.clientLeft,b.top-=a.documentElement.clientTop+a.body.clientTop;return b};goog.style.getOffsetParent=function(a){if(goog.userAgent.IE)return a.offsetParent;for(var b=goog.dom.getOwnerDocument(a),c=goog.style.getStyle_(a,"position"),d=c=="fixed"||c=="absolute",a=a.parentNode;a&&a!=b;a=a.parentNode)if(c=goog.style.getStyle_(a,"position"),d=d&&c=="static"&&a!=b.documentElement&&a!=b.body,!d&&(a.scrollWidth>a.clientWidth||a.scrollHeight>a.clientHeight||c=="fixed"||c=="absolute"))return a;return null};goog.style.getVisibleRectForElement=function(a){for(var b=new goog.math.Box(0,Infinity,Infinity,0),c=goog.dom.getDomHelper(a),d=c.getDocumentScrollElement(),e;a=goog.style.getOffsetParent(a);)if((!goog.userAgent.IE||a.clientWidth!=0)&&(a.scrollWidth!=a.clientWidth||a.scrollHeight!=a.clientHeight)&&goog.style.getStyle_(a,"overflow")!="visible"){var f=goog.style.getPageOffset(a),g=goog.style.getClientLeftTop(a);f.x+=g.x;f.y+=g.y;b.top=Math.max(b.top,f.y);b.right=Math.min(b.right,f.x+a.clientWidth);b.bottom=Math.min(b.bottom,f.y+a.clientHeight);b.left=Math.max(b.left,f.x);e=e||a!=d}a=d.scrollLeft;d=d.scrollTop;goog.userAgent.WEBKIT?(b.left+=a,b.top+=d):(b.left=Math.max(b.left,a),b.top=Math.max(b.top,d));if(!e||goog.userAgent.WEBKIT)b.right+=a,b.bottom+=d;c=c.getViewportSize();b.right=Math.min(b.right,a+c.width);b.bottom=Math.min(b.bottom,d+c.height);return b.top>=0&&b.left>=0&&b.bottom>b.top&&b.right>b.left?b:null};goog.style.scrollIntoContainerView=function(a,b,c){var d=goog.style.getPageOffset(a),e=goog.style.getPageOffset(b),f=goog.style.getBorderBox(b),g=d.x-e.x-f.left,d=d.y-e.y-f.top,e=b.clientWidth-a.offsetWidth,a=b.clientHeight-a.offsetHeight;c?(b.scrollLeft+=g-e/2,b.scrollTop+=d-a/2):(b.scrollLeft+=Math.min(g,Math.max(g-e,0)),b.scrollTop+=Math.min(d,Math.max(d-a,0)))};goog.style.getClientLeftTop=function(a){if(goog.userAgent.GECKO&&!goog.userAgent.isVersion("1.9")){var b=parseFloat(goog.style.getComputedStyle(a,"borderLeftWidth"));if(goog.style.isRightToLeft(a)){var c=a.offsetWidth-a.clientWidth-b-parseFloat(goog.style.getComputedStyle(a,"borderRightWidth"));b+=c}return new goog.math.Coordinate(b,parseFloat(goog.style.getComputedStyle(a,"borderTopWidth")))}return new goog.math.Coordinate(a.clientLeft,a.clientTop)};goog.style.getPageOffset=function(a){var b,c=goog.dom.getOwnerDocument(a),d=goog.style.getStyle_(a,"position"),e=goog.userAgent.GECKO&&c.getBoxObjectFor&&!a.getBoundingClientRect&&d=="absolute"&&(b=c.getBoxObjectFor(a))&&(b.screenX<0||b.screenY<0),f=new goog.math.Coordinate(0,0),g=goog.style.getClientViewportElement(c);if(a==g)return f;if(a.getBoundingClientRect)b=goog.style.getBoundingClientRect_(a),a=goog.dom.getDomHelper(c).getDocumentScroll(),f.x=b.left+a.x,f.y=b.top+a.y;else if(c.getBoxObjectFor&&!e)b=c.getBoxObjectFor(a),a=c.getBoxObjectFor(g),f.x=b.screenX-a.screenX,f.y=b.screenY-a.screenY;else{b=a;do{f.x+=b.offsetLeft;f.y+=b.offsetTop;b!=a&&(f.x+=b.clientLeft||0,f.y+=b.clientTop||0);if(goog.userAgent.WEBKIT&&goog.style.getComputedPosition(b)=="fixed"){f.x+=c.body.scrollLeft;f.y+=c.body.scrollTop;break}b=b.offsetParent}while(b&&b!=a);if(goog.userAgent.OPERA||goog.userAgent.WEBKIT&&d=="absolute")f.y-=c.body.offsetTop;for(b=a;(b=goog.style.getOffsetParent(b))&&b!=c.body&&b!=g;)if(f.x-=b.scrollLeft,!goog.userAgent.OPERA||b.tagName!="TR")f.y-=b.scrollTop}return f};goog.style.getPageOffsetLeft=function(a){return goog.style.getPageOffset(a).x};goog.style.getPageOffsetTop=function(a){return goog.style.getPageOffset(a).y};goog.style.getFramedPageOffset=function(a,b){var c=new goog.math.Coordinate(0,0),d=goog.dom.getWindow(goog.dom.getOwnerDocument(a)),e=a;do{var f=d==b?goog.style.getPageOffset(e):goog.style.getClientPosition(e);c.x+=f.x;c.y+=f.y}while(d&&d!=b&&(e=d.frameElement)&&(d=d.parent));return c};goog.style.translateRectForAnotherFrame=function(a,b,c){if(b.getDocument()!=c.getDocument()){var d=b.getDocument().body,c=goog.style.getFramedPageOffset(d,c.getWindow()),c=goog.math.Coordinate.difference(c,goog.style.getPageOffset(d));goog.userAgent.IE&&!b.isCss1CompatMode()&&(c=goog.math.Coordinate.difference(c,b.getDocumentScroll()));a.left+=c.x;a.top+=c.y}};goog.style.getRelativePosition=function(a,b){var c=goog.style.getClientPosition(a),d=goog.style.getClientPosition(b);return new goog.math.Coordinate(c.x-d.x,c.y-d.y)};goog.style.getClientPosition=function(a){var b=new goog.math.Coordinate;if(a.nodeType==goog.dom.NodeType.ELEMENT)if(a.getBoundingClientRect){var c=goog.style.getBoundingClientRect_(a);b.x=c.left;b.y=c.top}else c=goog.dom.getDomHelper(a).getDocumentScroll(),a=goog.style.getPageOffset(a),b.x=a.x-c.x,b.y=a.y-c.y;else b.x=a.clientX,b.y=a.clientY;return b};goog.style.setPageOffset=function(a,b,c){var d=goog.style.getPageOffset(a);if(b instanceof goog.math.Coordinate)c=b.y,b=b.x;goog.style.setPosition(a,a.offsetLeft+(b-d.x),a.offsetTop+(c-d.y))};goog.style.setSize=function(a,b,c){if(b instanceof goog.math.Size)c=b.height,b=b.width;else if(c==void 0)throw Error("missing height argument");a.style.width=typeof b=="number"?Math.round(b)+"px":b;a.style.height=typeof c=="number"?Math.round(c)+"px":c};goog.style.getSize=function(a){var b=goog.userAgent.OPERA&&!goog.userAgent.isVersion("10");if(goog.style.getStyle_(a,"display")!="none")return b?new goog.math.Size(a.offsetWidth||a.clientWidth,a.offsetHeight||a.clientHeight):new goog.math.Size(a.offsetWidth,a.offsetHeight);var c=a.style,d=c.display,e=c.visibility,f=c.position;c.visibility="hidden";c.position="absolute";c.display="inline";b?(b=a.offsetWidth||a.clientWidth,a=a.offsetHeight||a.clientHeight):(b=a.offsetWidth,a=a.offsetHeight);c.display=d;c.position=f;c.visibility=e;return new goog.math.Size(b,a)};goog.style.getBounds=function(a){var b=goog.style.getPageOffset(a),a=goog.style.getSize(a);return new goog.math.Rect(b.x,b.y,a.width,a.height)};goog.style.toCamelCaseCache_={};goog.style.toCamelCase=function(a){return goog.style.toCamelCaseCache_[a]||(goog.style.toCamelCaseCache_[a]=String(a).replace(/\-([a-z])/g,function(a,c){return c.toUpperCase()}))};goog.style.toSelectorCase=function(a){return a.replace(/([A-Z])/g,"-$1").toLowerCase()};goog.style.getOpacity=function(a){var b=a.style,a="";"opacity"in b?a=b.opacity:"MozOpacity"in b?a=b.MozOpacity:"filter"in b&&(b=b.filter.match(/alpha\(opacity=([\d.]+)\)/))&&(a=String(b[1]/100));return a==""?a:Number(a)};goog.style.setOpacity=function(a,b){var c=a.style;if("opacity"in c)c.opacity=b;else if("MozOpacity"in c)c.MozOpacity=b;else if("filter"in c)c.filter=b===""?"":"alpha(opacity="+b*100+")"};goog.style.setTransparentBackgroundImage=function(a,b){var c=a.style;goog.userAgent.IE&&!goog.userAgent.isVersion("8")?c.filter='progid:DXImageTransform.Microsoft.AlphaImageLoader(src="'+b+'", sizingMethod="crop")':(c.backgroundImage="url("+b+")",c.backgroundPosition="top left",c.backgroundRepeat="no-repeat")};goog.style.clearTransparentBackgroundImage=function(a){a=a.style;"filter"in a?a.filter="":a.backgroundImage="none"};goog.style.showElement=function(a,b){a.style.display=b?"":"none"};goog.style.isElementShown=function(a){return a.style.display!="none"};goog.style.installStyles=function(a,b){var c=goog.dom.getDomHelper(b),d=null;if(goog.userAgent.IE)d=c.getDocument().createStyleSheet(),goog.style.setStyles(d,a);else{var e=c.getElementsByTagNameAndClass("head")[0];e||(d=c.getElementsByTagNameAndClass("body")[0],e=c.createDom("head"),d.parentNode.insertBefore(e,d));d=c.createDom("style");goog.style.setStyles(d,a);c.appendChild(e,d)}return d};goog.style.uninstallStyles=function(a){goog.dom.removeNode(a.ownerNode||a.owningElement||a)};goog.style.setStyles=function(a,b){goog.userAgent.IE?a.cssText=b:a[goog.userAgent.WEBKIT?"innerText":"innerHTML"]=b};goog.style.setPreWrap=function(a){a=a.style;goog.userAgent.IE&&!goog.userAgent.isVersion("8")?(a.whiteSpace="pre",a.wordWrap="break-word"):a.whiteSpace=goog.userAgent.GECKO?"-moz-pre-wrap":goog.userAgent.OPERA?"-o-pre-wrap":"pre-wrap"};goog.style.setInlineBlock=function(a){a=a.style;a.position="relative";goog.userAgent.IE&&!goog.userAgent.isVersion("8")?(a.zoom="1",a.display="inline"):a.display=goog.userAgent.GECKO?goog.userAgent.isVersion("1.9a")?"inline-block":"-moz-inline-box":"inline-block"};goog.style.isRightToLeft=function(a){return"rtl"==goog.style.getStyle_(a,"direction")};goog.style.unselectableStyle_=goog.userAgent.GECKO?"MozUserSelect":goog.userAgent.WEBKIT?"WebkitUserSelect":null;goog.style.isUnselectable=function(a){if(goog.style.unselectableStyle_)return a.style[goog.style.unselectableStyle_].toLowerCase()=="none";else if(goog.userAgent.IE||goog.userAgent.OPERA)return a.getAttribute("unselectable")=="on";return!1};goog.style.setUnselectable=function(a,b,c){var c=!c?a.getElementsByTagName("*"):null,d=goog.style.unselectableStyle_;if(d){if(b=b?"none":"",a.style[d]=b,c)for(var a=0,e;e=c[a];a++)e.style[d]=b}else if(goog.userAgent.IE||goog.userAgent.OPERA)if(b=b?"on":"",a.setAttribute("unselectable",b),c)for(a=0;e=c[a];a++)e.setAttribute("unselectable",b)};goog.style.getBorderBoxSize=function(a){return new goog.math.Size(a.offsetWidth,a.offsetHeight)};goog.style.setBorderBoxSize=function(a,b){var c=goog.dom.getOwnerDocument(a),d=goog.dom.getDomHelper(c).isCss1CompatMode();if(goog.userAgent.IE&&(!d||!goog.userAgent.isVersion("8")))if(c=a.style,d){var d=goog.style.getPaddingBox(a),e=goog.style.getBorderBox(a);c.pixelWidth=b.width-e.left-d.left-d.right-e.right;c.pixelHeight=b.height-e.top-d.top-d.bottom-e.bottom}else c.pixelWidth=b.width,c.pixelHeight=b.height;else goog.style.setBoxSizingSize_(a,b,"border-box")};goog.style.getContentBoxSize=function(a){var b=goog.dom.getOwnerDocument(a),c=goog.userAgent.IE&&a.currentStyle;return c&&goog.dom.getDomHelper(b).isCss1CompatMode()&&c.width!="auto"&&c.height!="auto"&&!c.boxSizing?(b=goog.style.getIePixelValue_(a,c.width,"width","pixelWidth"),a=goog.style.getIePixelValue_(a,c.height,"height","pixelHeight"),new goog.math.Size(b,a)):(c=goog.style.getBorderBoxSize(a),b=goog.style.getPaddingBox(a),a=goog.style.getBorderBox(a),new goog.math.Size(c.width-a.left-b.left-
b.right-a.right,c.height-a.top-b.top-b.bottom-a.bottom))};goog.style.setContentBoxSize=function(a,b){var c=goog.dom.getOwnerDocument(a),d=goog.dom.getDomHelper(c).isCss1CompatMode();if(goog.userAgent.IE&&(!d||!goog.userAgent.isVersion("8")))if(c=a.style,d)c.pixelWidth=b.width,c.pixelHeight=b.height;else{var d=goog.style.getPaddingBox(a),e=goog.style.getBorderBox(a);c.pixelWidth=b.width+e.left+d.left+d.right+e.right;c.pixelHeight=b.height+e.top+d.top+d.bottom+e.bottom}else goog.style.setBoxSizingSize_(a,b,"content-box")};goog.style.setBoxSizingSize_=function(a,b,c){a=a.style;goog.userAgent.GECKO?a.MozBoxSizing=c:goog.userAgent.WEBKIT?a.WebkitBoxSizing=c:goog.userAgent.OPERA&&!goog.userAgent.isVersion("9.50")?c?a.setProperty("box-sizing",c):a.removeProperty("box-sizing"):a.boxSizing=c;a.width=b.width+"px";a.height=b.height+"px"};goog.style.getIePixelValue_=function(a,b,c,d){if(/^\d+px?$/.test(b))return parseInt(b,10);else{var e=a.style[c],f=a.runtimeStyle[c];a.runtimeStyle[c]=a.currentStyle[c];a.style[c]=b;b=a.style[d];a.style[c]=e;a.runtimeStyle[c]=f;return b}};goog.style.getIePixelDistance_=function(a,b){return goog.style.getIePixelValue_(a,goog.style.getCascadedStyle(a,b),"left","pixelLeft")};goog.style.getBox_=function(a,b){if(goog.userAgent.IE){var c=goog.style.getIePixelDistance_(a,b+"Left"),d=goog.style.getIePixelDistance_(a,b+"Right"),e=goog.style.getIePixelDistance_(a,b+"Top"),f=goog.style.getIePixelDistance_(a,b+"Bottom");return new goog.math.Box(e,d,f,c)}else return c=goog.style.getComputedStyle(a,b+"Left"),d=goog.style.getComputedStyle(a,b+"Right"),e=goog.style.getComputedStyle(a,b+"Top"),f=goog.style.getComputedStyle(a,b+"Bottom"),new goog.math.Box(parseFloat(e),parseFloat(d),parseFloat(f),parseFloat(c))};goog.style.getPaddingBox=function(a){return goog.style.getBox_(a,"padding")};goog.style.getMarginBox=function(a){return goog.style.getBox_(a,"margin")};goog.style.ieBorderWidthKeywords_={thin:2,medium:4,thick:6};goog.style.getIePixelBorder_=function(a,b){if(goog.style.getCascadedStyle(a,b+"Style")=="none")return 0;var c=goog.style.getCascadedStyle(a,b+"Width");return c in goog.style.ieBorderWidthKeywords_?goog.style.ieBorderWidthKeywords_[c]:goog.style.getIePixelValue_(a,c,"left","pixelLeft")};goog.style.getBorderBox=function(a){if(goog.userAgent.IE){var b=goog.style.getIePixelBorder_(a,"borderLeft"),c=goog.style.getIePixelBorder_(a,"borderRight"),d=goog.style.getIePixelBorder_(a,"borderTop"),a=goog.style.getIePixelBorder_(a,"borderBottom");return new goog.math.Box(d,c,a,b)}else return b=goog.style.getComputedStyle(a,"borderLeftWidth"),c=goog.style.getComputedStyle(a,"borderRightWidth"),d=goog.style.getComputedStyle(a,"borderTopWidth"),a=goog.style.getComputedStyle(a,"borderBottomWidth"),new goog.math.Box(parseFloat(d),parseFloat(c),parseFloat(a),parseFloat(b))};goog.style.getFontFamily=function(a){var b=goog.dom.getOwnerDocument(a),c="";b.createTextRange&&(c=b.body.createTextRange(),c.moveToElementText(a),c=c.queryCommandValue("FontName"));c||(c=goog.style.getStyle_(a,"fontFamily"),goog.userAgent.OPERA&&goog.userAgent.LINUX&&(c=c.replace(/ \[[^\]]*\]/,"")));a=c.split(",");a.length>1&&(c=a[0]);return goog.string.stripQuotes(c,"\"'")};goog.style.lengthUnitRegex_=/[^\d]+$/;goog.style.getLengthUnits=function(a){return(a=a.match(goog.style.lengthUnitRegex_))&&a[0]||null};goog.style.ABSOLUTE_CSS_LENGTH_UNITS_={cm:1,"in":1,mm:1,pc:1,pt:1};goog.style.CONVERTIBLE_RELATIVE_CSS_UNITS_={em:1,ex:1};goog.style.getFontSize=function(a){var b=goog.style.getStyle_(a,"fontSize"),c=goog.style.getLengthUnits(b);if(b&&"px"==c)return parseInt(b,10);if(goog.userAgent.IE)if(c in goog.style.ABSOLUTE_CSS_LENGTH_UNITS_)return goog.style.getIePixelValue_(a,b,"left","pixelLeft");else if(a.parentNode&&a.parentNode.nodeType==goog.dom.NodeType.ELEMENT&&c in goog.style.CONVERTIBLE_RELATIVE_CSS_UNITS_)return a=a.parentNode,c=goog.style.getStyle_(a,"fontSize"),goog.style.getIePixelValue_(a,b==c?"1em":b,"left","pixelLeft");c=goog.dom.createDom("span",{style:"visibility:hidden;position:absolute;line-height:0;padding:0;margin:0;border:0;height:1em;"});goog.dom.appendChild(a,c);b=c.offsetHeight;goog.dom.removeNode(c);return b};goog.style.parseStyleAttribute=function(a){var b={};goog.array.forEach(a.split(/\s*;\s*/),function(a){a=a.split(/\s*:\s*/);a.length==2&&(b[goog.style.toCamelCase(a[0].toLowerCase())]=a[1])});return b};goog.style.toStyleAttribute=function(a){var b=[];goog.object.forEach(a,function(a,d){b.push(goog.style.toSelectorCase(d),":",a,";")});return b.join("")};goog.style.setFloat=function(a,b){a.style[goog.userAgent.IE?"styleFloat":"cssFloat"]=b};goog.style.getFloat=function(a){return a.style[goog.userAgent.IE?"styleFloat":"cssFloat"]||""};goog.positioning={};goog.positioning.Corner={TOP_LEFT:0,TOP_RIGHT:2,BOTTOM_LEFT:1,BOTTOM_RIGHT:3,TOP_START:4,TOP_END:6,BOTTOM_START:5,BOTTOM_END:7};goog.positioning.CornerBit={BOTTOM:1,RIGHT:2,FLIP_RTL:4};goog.positioning.Overflow={IGNORE:0,ADJUST_X:1,FAIL_X:2,ADJUST_Y:4,FAIL_Y:8,RESIZE_WIDTH:16,RESIZE_HEIGHT:32};goog.positioning.OverflowStatus={NONE:0,ADJUSTED_X:1,ADJUSTED_Y:2,WIDTH_ADJUSTED:4,HEIGHT_ADJUSTED:8,FAILED_LEFT:16,FAILED_RIGHT:32,FAILED_TOP:64,FAILED_BOTTOM:128,FAILED_OUTSIDE_VIEWPORT:256};goog.positioning.OverflowStatus.FAILED=goog.positioning.OverflowStatus.FAILED_LEFT|goog.positioning.OverflowStatus.FAILED_RIGHT|goog.positioning.OverflowStatus.FAILED_TOP|goog.positioning.OverflowStatus.FAILED_BOTTOM|goog.positioning.OverflowStatus.FAILED_OUTSIDE_VIEWPORT;goog.positioning.positionAtAnchor=function(a,b,c,d,e,f,g,h){var i,j=c.offsetParent;if(j){var l=j.tagName==goog.dom.TagName.HTML||j.tagName==goog.dom.TagName.BODY;if(!l||goog.style.getComputedPosition(j)!="static")i=goog.style.getPageOffset(j),l||(i=goog.math.Coordinate.difference(i,new goog.math.Coordinate(j.scrollLeft,j.scrollTop)))}j=goog.positioning.getVisiblePart_(a);goog.style.translateRectForAnotherFrame(j,goog.dom.getDomHelper(a),goog.dom.getDomHelper(c));a=goog.positioning.getEffectiveCorner(a,b);b=new goog.math.Coordinate(a&goog.positioning.CornerBit.RIGHT?j.left+j.width:j.left,a&goog.positioning.CornerBit.BOTTOM?j.top+j.height:j.top);i&&(b=goog.math.Coordinate.difference(b,i));e&&(b.x+=(a&goog.positioning.CornerBit.RIGHT?-1:1)*e.x,b.y+=(a&goog.positioning.CornerBit.BOTTOM?-1:1)*e.y);var k;if(g&&(k=goog.style.getVisibleRectForElement(c))&&i)k.top=Math.max(0,k.top-i.y),k.right-=i.x,k.bottom-=i.y,k.left=Math.max(0,k.left-i.x);return goog.positioning.positionAtCoordinate(b,c,d,f,k,g,h)};goog.positioning.getVisiblePart_=function(a){var b=goog.style.getBounds(a);(a=goog.style.getVisibleRectForElement(a))&&b.intersection(goog.math.Rect.createFromBox(a));return b};goog.positioning.positionAtCoordinate=function(a,b,c,d,e,f,g){var a=a.clone(),h=goog.positioning.OverflowStatus.NONE,c=goog.positioning.getEffectiveCorner(b,c),i=goog.style.getSize(b),g=g?g.clone():i;if(d||c!=goog.positioning.Corner.TOP_LEFT)c&goog.positioning.CornerBit.RIGHT?a.x-=g.width+(d?d.right:0):d&&(a.x+=d.left),c&goog.positioning.CornerBit.BOTTOM?a.y-=g.height+(d?d.bottom:0):d&&(a.y+=d.top);if(f&&(h=e?goog.positioning.adjustForViewport(a,g,e,f):goog.positioning.OverflowStatus.FAILED_OUTSIDE_VIEWPORT,h&goog.positioning.OverflowStatus.FAILED))return h;goog.style.setPosition(b,a);goog.math.Size.equals(i,g)||goog.style.setSize(b,g);return h};goog.positioning.adjustForViewport=function(a,b,c,d){var e=goog.positioning.OverflowStatus.NONE;if(a.x<c.left&&d&goog.positioning.Overflow.ADJUST_X)a.x=c.left,e|=goog.positioning.OverflowStatus.ADJUSTED_X;a.x<c.left&&a.x+b.width>c.right&&d&goog.positioning.Overflow.RESIZE_WIDTH&&(b.width-=a.x+b.width-c.right,e|=goog.positioning.OverflowStatus.WIDTH_ADJUSTED);if(a.x+b.width>c.right&&d&goog.positioning.Overflow.ADJUST_X)a.x=Math.max(c.right-b.width,c.left),e|=goog.positioning.OverflowStatus.ADJUSTED_X;d&goog.positioning.Overflow.FAIL_X&&(e|=(a.x<c.left?goog.positioning.OverflowStatus.FAILED_LEFT:0)|(a.x+b.width>c.right?goog.positioning.OverflowStatus.FAILED_RIGHT:0));if(a.y<c.top&&d&goog.positioning.Overflow.ADJUST_Y)a.y=c.top,e|=goog.positioning.OverflowStatus.ADJUSTED_Y;a.y>=c.top&&a.y+b.height>c.bottom&&d&goog.positioning.Overflow.RESIZE_HEIGHT&&(b.height-=a.y+b.height-c.bottom,e|=goog.positioning.OverflowStatus.HEIGHT_ADJUSTED);if(a.y+b.height>c.bottom&&d&goog.positioning.Overflow.ADJUST_Y)a.y=Math.max(c.bottom-b.height,c.top),e|=goog.positioning.OverflowStatus.ADJUSTED_Y;d&goog.positioning.Overflow.FAIL_Y&&(e|=(a.y<c.top?goog.positioning.OverflowStatus.FAILED_TOP:0)|(a.y+b.height>c.bottom?goog.positioning.OverflowStatus.FAILED_BOTTOM:0));return e};goog.positioning.getEffectiveCorner=function(a,b){return(b&goog.positioning.CornerBit.FLIP_RTL&&goog.style.isRightToLeft(a)?b^goog.positioning.CornerBit.RIGHT:b)&~goog.positioning.CornerBit.FLIP_RTL};goog.positioning.flipCornerHorizontal=function(a){return a^goog.positioning.CornerBit.RIGHT};goog.positioning.flipCornerVertical=function(a){return a^goog.positioning.CornerBit.BOTTOM};goog.positioning.flipCorner=function(a){return a^goog.positioning.CornerBit.BOTTOM^goog.positioning.CornerBit.RIGHT};goog.positioning.AbstractPosition=function(){};goog.positioning.AbstractPosition.prototype.reposition=function(){};goog.positioning.AbsolutePosition=function(a,b){this.coordinate=a instanceof goog.math.Coordinate?a:new goog.math.Coordinate(a,b)};goog.inherits(goog.positioning.AbsolutePosition,goog.positioning.AbstractPosition);goog.positioning.AbsolutePosition.prototype.reposition=function(a,b,c,d){goog.positioning.positionAtCoordinate(this.coordinate,a,b,c,null,null,d)};goog.positioning.AnchoredPosition=function(a,b){this.element=a;this.corner=b};goog.inherits(goog.positioning.AnchoredPosition,goog.positioning.AbstractPosition);goog.positioning.AnchoredPosition.prototype.reposition=function(a,b,c){goog.positioning.positionAtAnchor(this.element,this.corner,a,b,void 0,c)};goog.positioning.AnchoredViewportPosition=function(a,b,c){goog.positioning.AnchoredPosition.call(this,a,b);this.adjust_=c};goog.inherits(goog.positioning.AnchoredViewportPosition,goog.positioning.AnchoredPosition);goog.positioning.AnchoredViewportPosition.prototype.reposition=function(a,b,c,d){var e=goog.positioning.positionAtAnchor(this.element,this.corner,a,b,null,c,goog.positioning.Overflow.FAIL_X|goog.positioning.Overflow.FAIL_Y,d)&goog.positioning.OverflowStatus.FAILED;e&&(e=goog.positioning.positionAtAnchor(this.element,b,a,this.corner,null,c,goog.positioning.Overflow.FAIL_X|goog.positioning.Overflow.FAIL_Y,d)&goog.positioning.OverflowStatus.FAILED)&&(this.adjust_?goog.positioning.positionAtAnchor(this.element,this.corner,a,b,null,c,goog.positioning.Overflow.ADJUST_X|goog.positioning.Overflow.ADJUST_Y,d):goog.positioning.positionAtAnchor(this.element,this.corner,a,b,null,c,goog.positioning.Overflow.IGNORE,d))};goog.positioning.ClientPosition=function(a,b){this.coordinate=a instanceof goog.math.Coordinate?a:new goog.math.Coordinate(a,b)};goog.inherits(goog.positioning.ClientPosition,goog.positioning.AbstractPosition);goog.positioning.ClientPosition.prototype.reposition=function(a,b,c,d){var e=goog.style.getClientViewportElement(a),f=new goog.math.Coordinate(this.coordinate.x+e.scrollLeft,this.coordinate.y+e.scrollTop);goog.positioning.positionAtAnchor(e,goog.positioning.Corner.TOP_LEFT,a,b,f,c,null,d)};goog.positioning.ViewportClientPosition=function(a,b){goog.positioning.ClientPosition.call(this,a,b)};goog.inherits(goog.positioning.ViewportClientPosition,goog.positioning.ClientPosition);goog.positioning.ViewportClientPosition.prototype.reposition=function(a,b,c,d){var e=goog.style.getClientViewportElement(a),e=goog.style.getVisibleRectForElement(e),f=goog.dom.getDomHelper(a).getDocumentScrollElement(),f=new goog.math.Coordinate(this.coordinate.x+f.scrollLeft,this.coordinate.y+f.scrollTop),g=goog.positioning.Overflow.FAIL_X|goog.positioning.Overflow.FAIL_Y,h=b,i=goog.positioning.positionAtCoordinate(f,a,h,c,e,g,d);if((i&goog.positioning.OverflowStatus.FAILED)!=0){if(i&goog.positioning.OverflowStatus.FAILED_LEFT||i&goog.positioning.OverflowStatus.FAILED_RIGHT)h=goog.positioning.flipCornerHorizontal(h);if(i&goog.positioning.OverflowStatus.FAILED_TOP||i&goog.positioning.OverflowStatus.FAILED_BOTTOM)h=goog.positioning.flipCornerVertical(h);i=goog.positioning.positionAtCoordinate(f,a,h,c,e,g,d);(i&goog.positioning.OverflowStatus.FAILED)!=0&&goog.positioning.positionAtCoordinate(f,a,b,c,e,void 0,d)}};goog.positioning.ViewportPosition=function(a,b){this.coordinate=a instanceof goog.math.Coordinate?a:new goog.math.Coordinate(a,b)};goog.inherits(goog.positioning.ViewportPosition,goog.positioning.AbstractPosition);goog.positioning.ViewportPosition.prototype.reposition=function(a,b,c,d){goog.positioning.positionAtAnchor(goog.style.getClientViewportElement(a),goog.positioning.Corner.TOP_LEFT,a,b,this.coordinate,c,null,d)};goog.Timer=function(a,b){goog.events.EventTarget.call(this);this.interval_=a||1;this.timerObject_=b||goog.Timer.defaultTimerObject;this.boundTick_=goog.bind(this.tick_,this);this.last_=goog.now()};goog.inherits(goog.Timer,goog.events.EventTarget);goog.Timer.MAX_TIMEOUT_=2147483647;goog.Timer.prototype.enabled=!1;goog.Timer.defaultTimerObject=goog.global.window;goog.Timer.intervalScale=0.8;goog.Timer.prototype.timer_=null;goog.Timer.prototype.getInterval=function(){return this.interval_};goog.Timer.prototype.setInterval=function(a){this.interval_=a;this.timer_&&this.enabled?(this.stop(),this.start()):this.timer_&&this.stop()};goog.Timer.prototype.tick_=function(){if(this.enabled){var a=goog.now()-this.last_;if(a>0&&a<this.interval_*goog.Timer.intervalScale)this.timer_=this.timerObject_.setTimeout(this.boundTick_,this.interval_-a);else if(this.dispatchTick(),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=!0;if(!this.timer_)this.timer_=this.timerObject_.setTimeout(this.boundTick_,this.interval_),this.last_=goog.now()};goog.Timer.prototype.stop=function(){this.enabled=!1;if(this.timer_)this.timerObject_.clearTimeout(this.timer_),this.timer_=null};goog.Timer.prototype.disposeInternal=function(){goog.Timer.superClass_.disposeInternal.call(this);this.stop();delete this.timerObject_};goog.Timer.TICK="tick";goog.Timer.callOnce=function(a,b,c){if(goog.isFunction(a))c&&(a=goog.bind(a,c));else if(a&&typeof a.handleEvent=="function")a=goog.bind(a.handleEvent,a);else throw Error("Invalid listener argument");return b>goog.Timer.MAX_TIMEOUT_?-1:goog.Timer.defaultTimerObject.setTimeout(a,b||0)};goog.Timer.clear=function(a){goog.Timer.defaultTimerObject.clearTimeout(a)};goog.events.EventHandler=function(a){this.handler_=a};goog.inherits(goog.events.EventHandler,goog.Disposable);goog.events.EventHandler.KEY_POOL_INITIAL_COUNT=0;goog.events.EventHandler.KEY_POOL_MAX_COUNT=100;goog.events.EventHandler.keyPool_=new goog.structs.SimplePool(goog.events.EventHandler.KEY_POOL_INITIAL_COUNT,goog.events.EventHandler.KEY_POOL_MAX_COUNT);goog.events.EventHandler.keys_=null;goog.events.EventHandler.key_=null;goog.events.EventHandler.prototype.listen=function(a,b,c,d,e){if(goog.isArray(b))for(var f=0;f<b.length;f++)this.listen(a,b[f],c,d,e);else this.recordListenerKey_(goog.events.listen(a,b,c||this,d||!1,e||this.handler_||this));return this};goog.events.EventHandler.prototype.listenOnce=function(a,b,c,d,e){if(goog.isArray(b))for(var f=0;f<b.length;f++)this.listenOnce(a,b[f],c,d,e);else this.recordListenerKey_(goog.events.listenOnce(a,b,c||this,d||!1,e||this.handler_||this));return this};goog.events.EventHandler.prototype.listenWithWrapper=function(a,b,c,d,e){b.listen(a,c,d,e||this.handler_,this);return this};goog.events.EventHandler.prototype.recordListenerKey_=function(a){this.keys_?this.keys_[a]=!0:this.key_?(this.keys_=goog.events.EventHandler.keyPool_.getObject(),this.keys_[this.key_]=!0,this.key_=null,this.keys_[a]=!0):this.key_=a};goog.events.EventHandler.prototype.unlisten=function(a,b,c,d,e){if(this.key_||this.keys_)if(goog.isArray(b))for(var f=0;f<b.length;f++)this.unlisten(a,b[f],c,d,e);else if(a=goog.events.getListener(a,b,c||this,d||!1,e||this.handler_||this))if(a=a.key,goog.events.unlistenByKey(a),this.keys_)goog.object.remove(this.keys_,a);else if(this.key_==a)this.key_=null;return this};goog.events.EventHandler.prototype.unlistenWithWrapper=function(a,b,c,d,e){b.unlisten(a,c,d,e||this.handler_,this);return this};goog.events.EventHandler.prototype.removeAll=function(){if(this.keys_){for(var a in this.keys_)goog.events.unlistenByKey(a),delete this.keys_[a];goog.events.EventHandler.keyPool_.releaseObject(this.keys_);this.keys_=null}else this.key_&&goog.events.unlistenByKey(this.key_)};goog.events.EventHandler.prototype.disposeInternal=function(){goog.events.EventHandler.superClass_.disposeInternal.call(this);this.removeAll()};goog.events.EventHandler.prototype.handleEvent=function(){throw Error("EventHandler.handleEvent not implemented");};goog.events.KeyCodes={MAC_ENTER:3,BACKSPACE:8,TAB:9,NUM_CENTER:12,ENTER:13,SHIFT:16,CTRL:17,ALT:18,PAUSE:19,CAPS_LOCK:20,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,PRINT_SCREEN:44,INSERT:45,DELETE:46,ZERO:48,ONE:49,TWO:50,THREE:51,FOUR:52,FIVE:53,SIX:54,SEVEN:55,EIGHT:56,NINE:57,QUESTION_MARK:63,A:65,B:66,C:67,D:68,E:69,F:70,G:71,H:72,I:73,J:74,K:75,L:76,M:77,N:78,O:79,P:80,Q:81,R:82,S:83,T:84,U:85,V:86,W:87,X:88,Y:89,Z:90,META:91,CONTEXT_MENU:93,NUM_ZERO:96,NUM_ONE:97,NUM_TWO:98,NUM_THREE:99,NUM_FOUR:100,NUM_FIVE:101,NUM_SIX:102,NUM_SEVEN:103,NUM_EIGHT:104,NUM_NINE:105,NUM_MULTIPLY:106,NUM_PLUS:107,NUM_MINUS:109,NUM_PERIOD:110,NUM_DIVISION:111,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123,NUMLOCK:144,SEMICOLON:186,DASH:189,EQUALS:187,COMMA:188,PERIOD:190,SLASH:191,APOSTROPHE:192,SINGLE_QUOTE:222,OPEN_SQUARE_BRACKET:219,BACKSLASH:220,CLOSE_SQUARE_BRACKET:221,WIN_KEY:224,MAC_FF_META:224,WIN_IME:229};goog.events.KeyCodes.isTextModifyingKeyEvent=function(a){if(a.altKey&&!a.ctrlKey||a.metaKey||a.keyCode>=goog.events.KeyCodes.F1&&a.keyCode<=goog.events.KeyCodes.F12)return!1;switch(a.keyCode){case goog.events.KeyCodes.ALT:case goog.events.KeyCodes.SHIFT:case goog.events.KeyCodes.CTRL:case goog.events.KeyCodes.PAUSE:case goog.events.KeyCodes.CAPS_LOCK:case goog.events.KeyCodes.ESC:case goog.events.KeyCodes.PAGE_UP:case goog.events.KeyCodes.PAGE_DOWN:case goog.events.KeyCodes.HOME:case goog.events.KeyCodes.END:case goog.events.KeyCodes.LEFT:case goog.events.KeyCodes.RIGHT:case goog.events.KeyCodes.UP:case goog.events.KeyCodes.DOWN:case goog.events.KeyCodes.INSERT:case goog.events.KeyCodes.NUMLOCK:case goog.events.KeyCodes.CONTEXT_MENU:case goog.events.KeyCodes.PRINT_SCREEN:return!1;default:return!0}};goog.events.KeyCodes.firesKeyPressEvent=function(a,b,c,d,e){if(!goog.userAgent.IE&&(!goog.userAgent.WEBKIT||!goog.userAgent.isVersion("525")))return!0;if(goog.userAgent.MAC&&e)return goog.events.KeyCodes.isCharacterKey(a);if(e&&!d)return!1;if(goog.userAgent.IE&&!c&&(b==goog.events.KeyCodes.CTRL||b==goog.events.KeyCodes.ALT))return!1;if(goog.userAgent.IE&&d&&b==a)return!1;switch(a){case goog.events.KeyCodes.ENTER:return!0;case goog.events.KeyCodes.ESC:return!goog.userAgent.WEBKIT}return goog.events.KeyCodes.isCharacterKey(a)};goog.events.KeyCodes.isCharacterKey=function(a){if(a>=goog.events.KeyCodes.ZERO&&a<=goog.events.KeyCodes.NINE)return!0;if(a>=goog.events.KeyCodes.NUM_ZERO&&a<=goog.events.KeyCodes.NUM_MULTIPLY)return!0;if(a>=goog.events.KeyCodes.A&&a<=goog.events.KeyCodes.Z)return!0;switch(a){case goog.events.KeyCodes.SPACE:case goog.events.KeyCodes.QUESTION_MARK:case goog.events.KeyCodes.NUM_PLUS:case goog.events.KeyCodes.NUM_MINUS:case goog.events.KeyCodes.NUM_PERIOD:case goog.events.KeyCodes.NUM_DIVISION:case goog.events.KeyCodes.SEMICOLON:case goog.events.KeyCodes.DASH:case goog.events.KeyCodes.EQUALS:case goog.events.KeyCodes.COMMA:case goog.events.KeyCodes.PERIOD:case goog.events.KeyCodes.SLASH:case goog.events.KeyCodes.APOSTROPHE:case goog.events.KeyCodes.SINGLE_QUOTE:case goog.events.KeyCodes.OPEN_SQUARE_BRACKET:case goog.events.KeyCodes.BACKSLASH:case goog.events.KeyCodes.CLOSE_SQUARE_BRACKET:return!0;default:return!1}};goog.ui={};goog.ui.PopupBase=function(a,b){this.handler_=new goog.events.EventHandler(this);this.setElement(a||null);b&&this.setType(b)};goog.inherits(goog.ui.PopupBase,goog.events.EventTarget);goog.ui.PopupBase.Type={TOGGLE_DISPLAY:"toggle_display",MOVE_OFFSCREEN:"move_offscreen"};goog.ui.PopupBase.prototype.element_=null;goog.ui.PopupBase.prototype.autoHide_=!0;goog.ui.PopupBase.prototype.autoHideRegion_=null;goog.ui.PopupBase.prototype.isVisible_=!1;goog.ui.PopupBase.prototype.shouldHideAsync_=!1;goog.ui.PopupBase.prototype.lastShowTime_=-1;goog.ui.PopupBase.prototype.lastHideTime_=-1;goog.ui.PopupBase.prototype.hideOnEscape_=!1;goog.ui.PopupBase.prototype.enableCrossIframeDismissal_=!0;goog.ui.PopupBase.prototype.type_=goog.ui.PopupBase.Type.TOGGLE_DISPLAY;goog.ui.PopupBase.EventType={BEFORE_SHOW:"beforeshow",SHOW:"show",BEFORE_HIDE:"beforehide",HIDE:"hide"};goog.ui.PopupBase.DEBOUNCE_DELAY_MS=150;goog.ui.PopupBase.prototype.getType=function(){return this.type_};goog.ui.PopupBase.prototype.setType=function(a){this.type_=a};goog.ui.PopupBase.prototype.shouldHideAsync=function(){return this.shouldHideAsync_};goog.ui.PopupBase.prototype.setShouldHideAsync=function(a){this.shouldHideAsync_=a};goog.ui.PopupBase.prototype.getElement=function(){return this.element_};goog.ui.PopupBase.prototype.setElement=function(a){this.ensureNotVisible_();this.element_=a};goog.ui.PopupBase.prototype.getAutoHide=function(){return this.autoHide_};goog.ui.PopupBase.prototype.setAutoHide=function(a){this.ensureNotVisible_();this.autoHide_=a};goog.ui.PopupBase.prototype.getHideOnEscape=function(){return this.hideOnEscape_};goog.ui.PopupBase.prototype.setHideOnEscape=function(a){this.ensureNotVisible_();this.hideOnEscape_=a};goog.ui.PopupBase.prototype.getEnableCrossIframeDismissal=function(){return this.enableCrossIframeDismissal_};goog.ui.PopupBase.prototype.setEnableCrossIframeDismissal=function(a){this.enableCrossIframeDismissal_=a};goog.ui.PopupBase.prototype.getAutoHideRegion=function(){return this.autoHideRegion_};goog.ui.PopupBase.prototype.setAutoHideRegion=function(a){this.autoHideRegion_=a};goog.ui.PopupBase.prototype.getLastShowTime=function(){return this.lastShowTime_};goog.ui.PopupBase.prototype.getLastHideTime=function(){return this.lastHideTime_};goog.ui.PopupBase.prototype.ensureNotVisible_=function(){if(this.isVisible_)throw Error("Can not change this state of the popup while showing.");};goog.ui.PopupBase.prototype.isVisible=function(){return this.isVisible_};goog.ui.PopupBase.prototype.isOrWasRecentlyVisible=function(){return this.isVisible_||goog.now()-this.lastHideTime_<goog.ui.PopupBase.DEBOUNCE_DELAY_MS};goog.ui.PopupBase.prototype.setVisible=function(a){a?this.show_():this.hide_()};goog.ui.PopupBase.prototype.reposition=goog.nullFunction;goog.ui.PopupBase.prototype.show_=function(){if(!this.isVisible_&&this.onBeforeShow()){if(!this.element_)throw Error("Caller must call setElement before trying to show the popup");this.reposition();var a=goog.dom.getOwnerDocument(this.element_);this.hideOnEscape_&&this.handler_.listen(a,goog.events.EventType.KEYDOWN,this.onDocumentKeyDown_,!0);if(this.autoHide_)if(this.handler_.listen(a,goog.events.EventType.MOUSEDOWN,this.onDocumentMouseDown_,!0),goog.userAgent.IE){for(var b=a.activeElement;b&&b.nodeName=="IFRAME";){try{var c=goog.dom.getFrameContentDocument(b)}catch(d){break}a=c;b=a.activeElement}this.handler_.listen(a,goog.events.EventType.MOUSEDOWN,this.onDocumentMouseDown_,!0);this.handler_.listen(a,goog.events.EventType.DEACTIVATE,this.onDocumentBlur_)}else this.handler_.listen(a,goog.events.EventType.BLUR,this.onDocumentBlur_);this.type_==goog.ui.PopupBase.Type.TOGGLE_DISPLAY?this.showPopupElement():this.type_==goog.ui.PopupBase.Type.MOVE_OFFSCREEN&&this.reposition();this.isVisible_=!0;this.onShow_()}};goog.ui.PopupBase.prototype.hide_=function(a){if(!this.isVisible_||!this.onBeforeHide_(a))return!1;this.handler_&&this.handler_.removeAll();this.type_==goog.ui.PopupBase.Type.TOGGLE_DISPLAY?this.shouldHideAsync_?goog.Timer.callOnce(this.hidePopupElement_,0,this):this.hidePopupElement_():this.type_==goog.ui.PopupBase.Type.MOVE_OFFSCREEN&&this.moveOffscreen_();this.isVisible_=!1;this.onHide_(a);return!0};goog.ui.PopupBase.prototype.showPopupElement=function(){this.element_.style.visibility="visible";goog.style.showElement(this.element_,!0)};goog.ui.PopupBase.prototype.hidePopupElement_=function(){this.element_.style.visibility="hidden";goog.style.showElement(this.element_,!1)};goog.ui.PopupBase.prototype.moveOffscreen_=function(){this.element_.style.left="-200px";this.element_.style.top="-200px"};goog.ui.PopupBase.prototype.onBeforeShow=function(){return this.dispatchEvent(goog.ui.PopupBase.EventType.BEFORE_SHOW)};goog.ui.PopupBase.prototype.onShow_=function(){this.lastShowTime_=goog.now();this.lastHideTime_=-1;this.dispatchEvent(goog.ui.PopupBase.EventType.SHOW)};goog.ui.PopupBase.prototype.onBeforeHide_=function(a){return this.dispatchEvent({type:goog.ui.PopupBase.EventType.BEFORE_HIDE,target:a})};goog.ui.PopupBase.prototype.onHide_=function(a){this.lastHideTime_=goog.now();this.dispatchEvent({type:goog.ui.PopupBase.EventType.HIDE,target:a})};goog.ui.PopupBase.prototype.onDocumentMouseDown_=function(a){a=a.target;!goog.dom.contains(this.element_,a)&&(!this.autoHideRegion_||goog.dom.contains(this.autoHideRegion_,a))&&!this.shouldDebounce_()&&this.hide_(a)};goog.ui.PopupBase.prototype.onDocumentKeyDown_=function(a){a.keyCode==goog.events.KeyCodes.ESC&&this.hide_(a.target)&&(a.preventDefault(),a.stopPropagation())};goog.ui.PopupBase.prototype.onDocumentBlur_=function(a){if(this.enableCrossIframeDismissal_){var b=goog.dom.getOwnerDocument(this.element_);if(goog.userAgent.IE||goog.userAgent.OPERA){if((a=b.activeElement)&&goog.dom.contains(this.element_,a))return}else if(a.target!=b)return;this.shouldDebounce_()||this.hide_()}};goog.ui.PopupBase.prototype.shouldDebounce_=function(){return goog.now()-this.lastShowTime_<goog.ui.PopupBase.DEBOUNCE_DELAY_MS};goog.ui.PopupBase.prototype.disposeInternal=function(){goog.ui.PopupBase.superClass_.disposeInternal.call(this);this.handler_.dispose();delete this.element_;delete this.handler_};goog.ui.Popup=function(a,b){this.popupCorner_=goog.positioning.Corner.TOP_START;this.position_=b||void 0;goog.ui.PopupBase.call(this,a)};goog.inherits(goog.ui.Popup,goog.ui.PopupBase);goog.ui.Popup.Corner=goog.positioning.Corner;goog.ui.Popup.Overflow=goog.positioning.Overflow;goog.ui.Popup.prototype.getPinnedCorner=function(){return this.popupCorner_};goog.ui.Popup.prototype.setPinnedCorner=function(a){this.popupCorner_=a;this.isVisible()&&this.reposition()};goog.ui.Popup.prototype.getPosition=function(){return this.position_||null};goog.ui.Popup.prototype.setPosition=function(a){this.position_=a||void 0;this.isVisible()&&this.reposition()};goog.ui.Popup.prototype.getMargin=function(){return this.margin_||null};goog.ui.Popup.prototype.setMargin=function(a,b,c,d){this.margin_=a==null||a instanceof goog.math.Box?a:new goog.math.Box(a,b,c,d);this.isVisible()&&this.reposition()};goog.ui.Popup.prototype.reposition=function(){if(this.position_){var a=!this.isVisible()&&this.getType()!=goog.ui.PopupBase.Type.MOVE_OFFSCREEN,b=this.getElement();if(a)b.style.visibility="hidden",goog.style.showElement(b,!0);this.position_.reposition(b,this.popupCorner_,this.margin_);a&&goog.style.showElement(b,!1)}};goog.ui.Popup.positionPopup=function(a,b,c,d,e,f,g){return(goog.positioning.positionAtAnchor(a,b,c,d,e,f,g)&goog.positioning.OverflowStatus.FAILED)==0};goog.ui.Popup.positionAtCoordinate=function(a,b,c,d){goog.positioning.positionAtCoordinate(a,b,c,d);return!0};goog.ui.Popup.AnchoredPosition=goog.positioning.AnchoredPosition;goog.ui.Popup.AnchoredViewPortPosition=goog.positioning.AnchoredViewportPosition;goog.ui.Popup.AbsolutePosition=goog.positioning.AbsolutePosition;goog.ui.Popup.ViewPortPosition=goog.positioning.ViewportPosition;goog.ui.Popup.ClientPosition=goog.positioning.ClientPosition;goog.ui.Popup.ViewPortClientPosition=goog.positioning.ViewportClientPosition;goog.dom.a11y={};goog.dom.a11y.State={ACTIVEDESCENDANT:"activedescendant",AUTOCOMPLETE:"autocomplete",CHECKED:"checked",DISABLED:"disabled",EXPANDED:"expanded",HASPOPUP:"haspopup",LABELLEDBY:"labelledby",LEVEL:"level",PRESSED:"pressed",SELECTED:"selected",VALUEMAX:"valuemax",VALUEMIN:"valuemin",VALUENOW:"valuenow"};goog.dom.a11y.Role={BUTTON:"button",CHECKBOX:"checkbox",COMBOBOX:"combobox",DIALOG:"dialog",LINK:"link",LISTBOX:"listbox",MAIN:"main",MENU:"menu",MENUBAR:"menubar",MENU_ITEM:"menuitem",MENU_ITEM_CHECKBOX:"menuitemcheckbox",MENU_ITEM_RADIO:"menuitemradio",NAVIGATION:"navigation",OPTION:"option",GROUP:"group",SLIDER:"slider",TAB:"tab",TAB_LIST:"tablist",TAB_PANEL:"tabpanel",TOOLBAR:"toolbar"};goog.dom.a11y.setRole=function(a,b){if(goog.userAgent.GECKO||goog.dom.a11y.noBrowserCheck_)a.setAttribute("role",b),a.roleName=b};goog.dom.a11y.getRole=function(a){return a.roleName||""};goog.dom.a11y.setState=function(a,b,c){(goog.userAgent.GECKO||goog.dom.a11y.noBrowserCheck_)&&a.setAttribute("aria-"+b,c)};goog.dom.a11y.getState=function(a,b){return a.getAttribute("aria-"+b)||""};goog.dom.a11y.getNoBrowserCheck=function(){return!!goog.dom.a11y.noBrowserCheck_};goog.dom.a11y.setNoBrowserCheck=function(a){goog.dom.a11y.noBrowserCheck_=a};goog.dom.a11y.getActiveDescendant=function(a){var b=goog.dom.a11y.getState(a,goog.dom.a11y.State.ACTIVEDESCENDANT);return goog.dom.getOwnerDocument(a).getElementById(b)};goog.dom.a11y.setActiveDescendant=function(a,b){goog.dom.a11y.setState(a,goog.dom.a11y.State.ACTIVEDESCENDANT,b?b.id:"")};goog.dom.iframe={};goog.dom.iframe.BLANK_SOURCE='javascript:""';goog.dom.iframe.createBlank=function(a){return a.createDom("iframe",{frameborder:0,style:"border: 0; vertical-align: bottom",src:goog.dom.iframe.BLANK_SOURCE})};goog.events.FocusHandler=function(a){goog.events.EventTarget.call(this);this.element_=a;a=goog.userAgent.IE?"focusout":"blur";this.listenKeyIn_=goog.events.listen(this.element_,goog.userAgent.IE?"focusin":"focus",this,!goog.userAgent.IE);this.listenKeyOut_=goog.events.listen(this.element_,a,this,!goog.userAgent.IE)};goog.inherits(goog.events.FocusHandler,goog.events.EventTarget);goog.events.FocusHandler.EventType={FOCUSIN:"focusin",FOCUSOUT:"focusout"};goog.events.FocusHandler.prototype.handleEvent=function(a){var b=a.getBrowserEvent(),b=new goog.events.BrowserEvent(b);b.type=a.type=="focusin"||a.type=="focus"?goog.events.FocusHandler.EventType.FOCUSIN:goog.events.FocusHandler.EventType.FOCUSOUT;try{this.dispatchEvent(b)}finally{b.dispose()}};goog.events.FocusHandler.prototype.disposeInternal=function(){goog.events.FocusHandler.superClass_.disposeInternal.call(this);goog.events.unlistenByKey(this.listenKeyIn_);goog.events.unlistenByKey(this.listenKeyOut_);delete this.element_};goog.fx={};goog.fx.Dragger=function(a,b,c){this.target=a;this.handle=b||a;this.limits=c||new goog.math.Rect(NaN,NaN,NaN,NaN);this.document_=goog.dom.getOwnerDocument(a);this.eventHandler_=new goog.events.EventHandler(this);goog.events.listen(this.handle,goog.events.EventType.MOUSEDOWN,this.startDrag,!1,this)};goog.inherits(goog.fx.Dragger,goog.events.EventTarget);goog.fx.Dragger.HAS_SET_CAPTURE_=goog.userAgent.IE||goog.userAgent.GECKO&&goog.userAgent.isVersion("1.9.3");goog.fx.Dragger.EventType={START:"start",BEFOREDRAG:"beforedrag",DRAG:"drag",END:"end"};goog.fx.Dragger.prototype.screenX=0;goog.fx.Dragger.prototype.screenY=0;goog.fx.Dragger.prototype.startX=0;goog.fx.Dragger.prototype.startY=0;goog.fx.Dragger.prototype.deltaX=0;goog.fx.Dragger.prototype.deltaY=0;goog.fx.Dragger.prototype.enabled_=!0;goog.fx.Dragger.prototype.dragging_=!1;goog.fx.Dragger.prototype.hysteresisDistanceSquared_=0;goog.fx.Dragger.prototype.mouseDownTime_=0;goog.fx.Dragger.prototype.ieDragStartCancellingOn_=!1;goog.fx.Dragger.cancelIeDragStart=function(a){a.preventDefault()};goog.fx.Dragger.prototype.setLimits=function(a){this.limits=a||new goog.math.Rect(NaN,NaN,NaN,NaN)};goog.fx.Dragger.prototype.setHysteresis=function(a){this.hysteresisDistanceSquared_=Math.pow(a,2)};goog.fx.Dragger.prototype.getHysteresis=function(){return Math.sqrt(this.hysteresisDistanceSquared_)};goog.fx.Dragger.prototype.setScrollTarget=function(a){this.scrollTarget_=a};goog.fx.Dragger.prototype.setCancelIeDragStart=function(a){this.ieDragStartCancellingOn_=a};goog.fx.Dragger.prototype.getEnabled=function(){return this.enabled_};goog.fx.Dragger.prototype.setEnabled=function(a){this.enabled_=a};goog.fx.Dragger.prototype.disposeInternal=function(){goog.fx.Dragger.superClass_.disposeInternal.call(this);goog.events.unlisten(this.handle,goog.events.EventType.MOUSEDOWN,this.startDrag,!1,this);this.eventHandler_.dispose();delete this.target;delete this.handle;delete this.eventHandler_};goog.fx.Dragger.prototype.startDrag=function(a){if(this.enabled_&&!this.dragging_&&(a.type!=goog.events.EventType.MOUSEDOWN||a.isButton(goog.events.BrowserEvent.MouseButton.LEFT))){if(this.hysteresisDistanceSquared_==0)if(this.initializeDrag_(a),this.dragging_)a.preventDefault();else return;else a.preventDefault();this.setupDragHandlers();this.screenX=this.startX=a.screenX;this.screenY=this.startY=a.screenY;this.deltaX=this.target.offsetLeft;this.deltaY=this.target.offsetTop;this.pageScroll=goog.dom.getDomHelper(this.document_).getDocumentScroll();this.mouseDownTime_=goog.now()}};goog.fx.Dragger.prototype.setupDragHandlers=function(){var a=this.document_,b=a.documentElement;this.eventHandler_.listen(a,goog.events.EventType.MOUSEMOVE,this.mouseMoved_,!0);this.eventHandler_.listen(a,goog.events.EventType.MOUSEUP,this.endDrag,!0);goog.fx.Dragger.HAS_SET_CAPTURE_?(b.setCapture(!1),this.eventHandler_.listen(b,goog.events.EventType.LOSECAPTURE,this.endDrag)):this.eventHandler_.listen(goog.dom.getWindow(a),goog.events.EventType.BLUR,this.endDrag);goog.userAgent.IE&&this.ieDragStartCancellingOn_&&this.eventHandler_.listen(a,goog.events.EventType.DRAGSTART,goog.fx.Dragger.cancelIeDragStart);this.scrollTarget_&&this.eventHandler_.listen(this.scrollTarget_,goog.events.EventType.SCROLL,this.onScroll_,!0)};goog.fx.Dragger.prototype.initializeDrag_=function(a){if(this.dispatchEvent(new goog.fx.DragEvent(goog.fx.Dragger.EventType.START,this,a.clientX,a.clientY,a))!==!1)this.dragging_=!0};goog.fx.Dragger.prototype.endDrag=function(a,b){this.eventHandler_.removeAll();goog.fx.Dragger.HAS_SET_CAPTURE_&&this.document_.releaseCapture();if(this.dragging_){this.dragging_=!1;var c=this.limitX(this.deltaX),d=this.limitY(this.deltaY);this.dispatchEvent(new goog.fx.DragEvent(goog.fx.Dragger.EventType.END,this,a.clientX,a.clientY,a,c,d,b))}};goog.fx.Dragger.prototype.endDragCancel=function(a){this.endDrag(a,!0)};goog.fx.Dragger.prototype.mouseMoved_=function(a){if(this.enabled_){var b=a.screenX-this.screenX,c=a.screenY-this.screenY;this.screenX=a.screenX;this.screenY=a.screenY;if(!this.dragging_){var d=this.startX-this.screenX,e=this.startY-this.screenY;if(d*d+e*e>this.hysteresisDistanceSquared_&&(this.initializeDrag_(a),!this.dragging_)){this.endDrag(a);return}}c=this.calculatePosition_(b,c);b=c.x;c=c.y;this.dragging_&&this.dispatchEvent(new goog.fx.DragEvent(goog.fx.Dragger.EventType.BEFOREDRAG,this,a.clientX,a.clientY,a,b,c))!==!1&&(this.doDrag(a,b,c,!1),a.preventDefault())}};goog.fx.Dragger.prototype.calculatePosition_=function(a,b){var c=goog.dom.getDomHelper(this.document_).getDocumentScroll();a+=c.x-this.pageScroll.x;b+=c.y-this.pageScroll.y;this.pageScroll=c;this.deltaX+=a;this.deltaY+=b;var c=this.limitX(this.deltaX),d=this.limitY(this.deltaY);return new goog.math.Coordinate(c,d)};goog.fx.Dragger.prototype.onScroll_=function(a){var b=this.calculatePosition_(0,0);a.clientX=this.pageScroll.x-this.screenX;a.clientY=this.pageScroll.x-this.screenY;this.doDrag(a,b.x,b.y,!0)};goog.fx.Dragger.prototype.doDrag=function(a,b,c){this.defaultAction(b,c);this.dispatchEvent(new goog.fx.DragEvent(goog.fx.Dragger.EventType.DRAG,this,a.clientX,a.clientY,a,b,c))};goog.fx.Dragger.prototype.limitX=function(a){var b=this.limits,c=!isNaN(b.left)?b.left:null,b=!isNaN(b.width)?b.width:0;return Math.min(c!=null?c+b:Infinity,Math.max(c!=null?c:-Infinity,a))};goog.fx.Dragger.prototype.limitY=function(a){var b=this.limits,c=!isNaN(b.top)?b.top:null,b=!isNaN(b.height)?b.height:0;return Math.min(c!=null?c+b:Infinity,Math.max(c!=null?c:-Infinity,a))};goog.fx.Dragger.prototype.defaultAction=function(a,b){this.target.style.left=a+"px";this.target.style.top=b+"px"};goog.fx.DragEvent=function(a,b,c,d,e,f,g,h){goog.events.Event.call(this,a);this.clientX=c;this.clientY=d;this.browserEvent=e;this.left=goog.isDef(f)?f:b.deltaX;this.top=goog.isDef(g)?g:b.deltaY;this.dragger=b;this.dragCanceled=!!h};goog.inherits(goog.fx.DragEvent,goog.events.Event);goog.structs.getCount=function(a){return typeof a.getCount=="function"?a.getCount():goog.isArrayLike(a)||goog.isString(a)?a.length:goog.object.getCount(a)};goog.structs.getValues=function(a){if(typeof a.getValues=="function")return a.getValues();if(goog.isString(a))return a.split("");if(goog.isArrayLike(a)){for(var b=[],c=a.length,d=0;d<c;d++)b.push(a[d]);return b}return goog.object.getValues(a)};goog.structs.getKeys=function(a){if(typeof a.getKeys=="function")return a.getKeys();if(typeof a.getValues!="function"){if(goog.isArrayLike(a)||goog.isString(a)){for(var b=[],a=a.length,c=0;c<a;c++)b.push(c);return b}return goog.object.getKeys(a)}};goog.structs.contains=function(a,b){return typeof a.contains=="function"?a.contains(b):typeof a.containsValue=="function"?a.containsValue(b):goog.isArrayLike(a)||goog.isString(a)?goog.array.contains(a,b):goog.object.containsValue(a,b)};goog.structs.isEmpty=function(a){return typeof a.isEmpty=="function"?a.isEmpty():goog.isArrayLike(a)||goog.isString(a)?goog.array.isEmpty(a):goog.object.isEmpty(a)};goog.structs.clear=function(a){typeof a.clear=="function"?a.clear():goog.isArrayLike(a)?goog.array.clear(a):goog.object.clear(a)};goog.structs.forEach=function(a,b,c){if(typeof a.forEach=="function")a.forEach(b,c);else if(goog.isArrayLike(a)||goog.isString(a))goog.array.forEach(a,b,c);else for(var d=goog.structs.getKeys(a),e=goog.structs.getValues(a),f=e.length,g=0;g<f;g++)b.call(c,e[g],d&&d[g],a)};goog.structs.filter=function(a,b,c){if(typeof a.filter=="function")return a.filter(b,c);if(goog.isArrayLike(a)||goog.isString(a))return goog.array.filter(a,b,c);var d,e=goog.structs.getKeys(a),f=goog.structs.getValues(a),g=f.length;if(e){d={};for(var h=0;h<g;h++)b.call(c,f[h],e[h],a)&&(d[e[h]]=f[h])}else{d=[];for(h=0;h<g;h++)b.call(c,f[h],void 0,a)&&d.push(f[h])}return d};goog.structs.map=function(a,b,c){if(typeof a.map=="function")return a.map(b,c);if(goog.isArrayLike(a)||goog.isString(a))return goog.array.map(a,b,c);var d,e=goog.structs.getKeys(a),f=goog.structs.getValues(a),g=f.length;if(e){d={};for(var h=0;h<g;h++)d[e[h]]=b.call(c,f[h],e[h],a)}else{d=[];for(h=0;h<g;h++)d[h]=b.call(c,f[h],void 0,a)}return d};goog.structs.some=function(a,b,c){if(typeof a.some=="function")return a.some(b,c);if(goog.isArrayLike(a)||goog.isString(a))return goog.array.some(a,b,c);for(var d=goog.structs.getKeys(a),e=goog.structs.getValues(a),f=e.length,g=0;g<f;g++)if(b.call(c,e[g],d&&d[g],a))return!0;return!1};goog.structs.every=function(a,b,c){if(typeof a.every=="function")return a.every(b,c);if(goog.isArrayLike(a)||goog.isString(a))return goog.array.every(a,b,c);for(var d=goog.structs.getKeys(a),e=goog.structs.getValues(a),f=e.length,g=0;g<f;g++)if(!b.call(c,e[g],d&&d[g],a))return!1;return!0};goog.iter={};goog.iter.Iterable=goog.typedef;goog.iter.StopIteration="StopIteration"in goog.global?goog.global.StopIteration:Error("StopIteration");goog.iter.Iterator=function(){};goog.iter.Iterator.prototype.next=function(){throw goog.iter.StopIteration;};goog.iter.Iterator.prototype.__iterator__=function(){return this};goog.iter.toIterator=function(a){if(a instanceof goog.iter.Iterator)return a;if(typeof a.__iterator__=="function")return a.__iterator__(!1);if(goog.isArrayLike(a)){var b=0,c=new goog.iter.Iterator;c.next=function(){for(;;){if(b>=a.length)throw goog.iter.StopIteration;if(b in a)return a[b++];else b++}};return c}throw Error("Not implemented");};goog.iter.forEach=function(a,b,c){if(goog.isArrayLike(a))try{goog.array.forEach(a,b,c)}catch(d){if(d!==goog.iter.StopIteration)throw d;}else{a=goog.iter.toIterator(a);try{for(;;)b.call(c,a.next(),void 0,a)}catch(e){if(e!==goog.iter.StopIteration)throw e;}}};goog.iter.filter=function(a,b,c){var a=goog.iter.toIterator(a),d=new goog.iter.Iterator;d.next=function(){for(;;){var d=a.next();if(b.call(c,d,void 0,a))return d}};return d};goog.iter.range=function(a,b,c){var d=0,e=a,f=c||1;arguments.length>1&&(d=a,e=b);if(f==0)throw Error("Range step argument must not be zero");var g=new goog.iter.Iterator;g.next=function(){if(f>0&&d>=e||f<0&&d<=e)throw goog.iter.StopIteration;var a=d;d+=f;return a};return g};goog.iter.join=function(a,b){return goog.iter.toArray(a).join(b)};goog.iter.map=function(a,b,c){var a=goog.iter.toIterator(a),d=new goog.iter.Iterator;d.next=function(){for(;;){var d=a.next();return b.call(c,d,void 0,a)}};return d};goog.iter.reduce=function(a,b,c,d){var e=c;goog.iter.forEach(a,function(a){e=b.call(d,e,a)});return e};goog.iter.some=function(a,b,c){a=goog.iter.toIterator(a);try{for(;;)if(b.call(c,a.next(),void 0,a))return!0}catch(d){if(d!==goog.iter.StopIteration)throw d;}return!1};goog.iter.every=function(a,b,c){a=goog.iter.toIterator(a);try{for(;;)if(!b.call(c,a.next(),void 0,a))return!1}catch(d){if(d!==goog.iter.StopIteration)throw d;}return!0};goog.iter.chain=function(a){var b=arguments,c=b.length,d=0,e=new goog.iter.Iterator;e.next=function(){try{if(d>=c)throw goog.iter.StopIteration;return goog.iter.toIterator(b[d]).next()}catch(a){if(a!==goog.iter.StopIteration||d>=c)throw a;else return d++,this.next()}};return e};goog.iter.dropWhile=function(a,b,c){var a=goog.iter.toIterator(a),d=new goog.iter.Iterator,e=!0;d.next=function(){for(;;){var d=a.next();if(!e||!b.call(c,d,void 0,a))return e=!1,d}};return d};goog.iter.takeWhile=function(a,b,c){var a=goog.iter.toIterator(a),d=new goog.iter.Iterator,e=!0;d.next=function(){for(;;)if(e){var d=a.next();if(b.call(c,d,void 0,a))return d;else e=!1}else throw goog.iter.StopIteration;};return d};goog.iter.toArray=function(a){if(goog.isArrayLike(a))return goog.array.toArray(a);var a=goog.iter.toIterator(a),b=[];goog.iter.forEach(a,function(a){b.push(a)});return b};goog.iter.equals=function(a,b){var a=goog.iter.toIterator(a),b=goog.iter.toIterator(b),c,d;try{for(;;){c=d=!1;var e=a.next();c=!0;var f=b.next();d=!0;if(e!=f)break}}catch(g){if(g!==goog.iter.StopIteration)throw g;else{if(c&&!d)return!1;if(!d)try{b.next()}catch(h){if(h!==goog.iter.StopIteration)throw h;return!0}}}return!1};goog.iter.nextOrValue=function(a,b){try{return goog.iter.toIterator(a).next()}catch(c){if(c!=goog.iter.StopIteration)throw c;return b}};goog.structs.Map=function(a,b){this.map_={};this.keys_=[];var c=arguments.length;if(c>1){if(c%2)throw Error("Uneven number of arguments");for(var d=0;d<c;d+=2)this.set(arguments[d],arguments[d+1])}else a&&this.addAll(a)};goog.structs.Map.prototype.count_=0;goog.structs.Map.prototype.version_=0;goog.structs.Map.prototype.getCount=function(){return this.count_};goog.structs.Map.prototype.getValues=function(){this.cleanupKeysArray_();for(var a=[],b=0;b<this.keys_.length;b++)a.push(this.map_[this.keys_[b]]);return a};goog.structs.Map.prototype.getKeys=function(){this.cleanupKeysArray_();return this.keys_.concat()};goog.structs.Map.prototype.containsKey=function(a){return goog.structs.Map.hasKey_(this.map_,a)};goog.structs.Map.prototype.containsValue=function(a){for(var b=0;b<this.keys_.length;b++){var c=this.keys_[b];if(goog.structs.Map.hasKey_(this.map_,c)&&this.map_[c]==a)return!0}return!1};goog.structs.Map.prototype.equals=function(a,b){if(this===a)return!0;if(this.count_!=a.getCount())return!1;var c=b||goog.structs.Map.defaultEquals;this.cleanupKeysArray_();for(var d,e=0;d=this.keys_[e];e++)if(!c(this.get(d),a.get(d)))return!1;return!0};goog.structs.Map.defaultEquals=function(a,b){return a===b};goog.structs.Map.prototype.isEmpty=function(){return this.count_==0};goog.structs.Map.prototype.clear=function(){this.map_={};this.version_=this.count_=this.keys_.length=0};goog.structs.Map.prototype.remove=function(a){return goog.structs.Map.hasKey_(this.map_,a)?(delete this.map_[a],this.count_--,this.version_++,this.keys_.length>2*this.count_&&this.cleanupKeysArray_(),!0):!1};goog.structs.Map.prototype.cleanupKeysArray_=function(){if(this.count_!=this.keys_.length){for(var a=0,b=0;a<this.keys_.length;){var c=this.keys_[a];goog.structs.Map.hasKey_(this.map_,c)&&(this.keys_[b++]=c);a++}this.keys_.length=b}if(this.count_!=this.keys_.length){for(var d={},b=a=0;a<this.keys_.length;)c=this.keys_[a],goog.structs.Map.hasKey_(d,c)||(this.keys_[b++]=c,d[c]=1),a++;this.keys_.length=b}};goog.structs.Map.prototype.get=function(a,b){return goog.structs.Map.hasKey_(this.map_,a)?this.map_[a]:b};goog.structs.Map.prototype.set=function(a,b){goog.structs.Map.hasKey_(this.map_,a)||(this.count_++,this.keys_.push(a),this.version_++);this.map_[a]=b};goog.structs.Map.prototype.addAll=function(a){var b;a instanceof goog.structs.Map?(b=a.getKeys(),a=a.getValues()):(b=goog.object.getKeys(a),a=goog.object.getValues(a));for(var c=0;c<b.length;c++)this.set(b[c],a[c])};goog.structs.Map.prototype.clone=function(){return new goog.structs.Map(this)};goog.structs.Map.prototype.transpose=function(){for(var a=new goog.structs.Map,b=0;b<this.keys_.length;b++){var c=this.keys_[b];a.set(this.map_[c],c)}return a};goog.structs.Map.prototype.getKeyIterator=function(){return this.__iterator__(!0)};goog.structs.Map.prototype.getValueIterator=function(){return this.__iterator__(!1)};goog.structs.Map.prototype.__iterator__=function(a){this.cleanupKeysArray_();var b=0,c=this.keys_,d=this.map_,e=this.version_,f=this,g=new goog.iter.Iterator;g.next=function(){for(;;){if(e!=f.version_)throw Error("The map has changed since the iterator was created");if(b>=c.length)throw goog.iter.StopIteration;var g=c[b++];return a?g:d[g]}};return g};goog.structs.Map.hasKey_=function(a,b){return Object.prototype.hasOwnProperty.call(a,b)};goog.structs.Map.getCount=function(a){return goog.structs.getCount(a)};goog.structs.Map.getValues=function(a){return goog.structs.getValues(a)};goog.structs.Map.getKeys=function(a){if(typeof a.getKeys=="function")return a.getKeys();var b=[];if(goog.isArrayLike(a))for(var c=0;c<a.length;c++)b.push(c);else return goog.object.getKeys(a);return b};goog.structs.Map.containsKey=function(a,b){return typeof a.containsKey=="function"?a.containsKey(b):goog.isArrayLike(a)?Number(b)<a.length:goog.object.containsKey(a,b)};goog.structs.Map.containsValue=function(a,b){return goog.structs.contains(a,b)};goog.structs.Map.isEmpty=function(a){return goog.structs.isEmpty(a)};goog.structs.Map.clear=function(a){goog.structs.clear(a)};goog.structs.Map.remove=function(a,b){return typeof a.remove=="function"?a.remove(b):goog.isArrayLike(a)?goog.array.removeAt(a,Number(b)):goog.object.remove(a,b)};goog.structs.Map.add=function(a,b,c){if(typeof a.add=="function")a.add(b,c);else if(goog.structs.Map.containsKey(a,b))throw Error('The collection already contains the key "'+b+'"');else goog.structs.Map.set(a,b,c)};goog.structs.Map.get=function(a,b,c){return typeof a.get=="function"?a.get(b,c):goog.structs.Map.containsKey(a,b)?a[b]:c};goog.structs.Map.set=function(a,b,c){typeof a.set=="function"?a.set(b,c):a[b]=c};goog.ui.IdGenerator=function(){};goog.addSingletonGetter(goog.ui.IdGenerator);goog.ui.IdGenerator.prototype.nextId_=0;goog.ui.IdGenerator.prototype.getNextUniqueId=function(){return":"+(this.nextId_++).toString(36)};goog.ui.IdGenerator.instance=goog.ui.IdGenerator.getInstance();goog.ui.Component=function(a){goog.events.EventTarget.call(this);this.dom_=a||goog.dom.getDomHelper();this.rightToLeft_=goog.ui.Component.defaultRightToLeft_};goog.inherits(goog.ui.Component,goog.events.EventTarget);goog.ui.Component.prototype.idGenerator_=goog.ui.IdGenerator.getInstance();goog.ui.Component.defaultRightToLeft_=null;goog.ui.Component.EventType={BEFORE_SHOW:"beforeshow",SHOW:"show",HIDE:"hide",DISABLE:"disable",ENABLE:"enable",HIGHLIGHT:"highlight",UNHIGHLIGHT:"unhighlight",ACTIVATE:"activate",DEACTIVATE:"deactivate",SELECT:"select",UNSELECT:"unselect",CHECK:"check",UNCHECK:"uncheck",FOCUS:"focus",BLUR:"blur",OPEN:"open",CLOSE:"close",ENTER:"enter",LEAVE:"leave",ACTION:"action",CHANGE:"change"};goog.ui.Component.Error={NOT_SUPPORTED:"Method not supported",DECORATE_INVALID:"Invalid element to decorate",ALREADY_RENDERED:"Component already rendered",PARENT_UNABLE_TO_BE_SET:"Unable to set parent component",CHILD_INDEX_OUT_OF_BOUNDS:"Child component index out of bounds",NOT_OUR_CHILD:"Child is not in parent component",NOT_IN_DOCUMENT:"Operation not supported while component is not in document",STATE_INVALID:"Invalid component state"};goog.ui.Component.State={ALL:255,DISABLED:1,HOVER:2,ACTIVE:4,SELECTED:8,CHECKED:16,FOCUSED:32,OPENED:64};goog.ui.Component.getStateTransitionEvent=function(a,b){switch(a){case goog.ui.Component.State.DISABLED:return b?goog.ui.Component.EventType.DISABLE:goog.ui.Component.EventType.ENABLE;case goog.ui.Component.State.HOVER:return b?goog.ui.Component.EventType.HIGHLIGHT:goog.ui.Component.EventType.UNHIGHLIGHT;case goog.ui.Component.State.ACTIVE:return b?goog.ui.Component.EventType.ACTIVATE:goog.ui.Component.EventType.DEACTIVATE;case goog.ui.Component.State.SELECTED:return b?goog.ui.Component.EventType.SELECT:goog.ui.Component.EventType.UNSELECT;case goog.ui.Component.State.CHECKED:return b?goog.ui.Component.EventType.CHECK:goog.ui.Component.EventType.UNCHECK;case goog.ui.Component.State.FOCUSED:return b?goog.ui.Component.EventType.FOCUS:goog.ui.Component.EventType.BLUR;case goog.ui.Component.State.OPENED:return b?goog.ui.Component.EventType.OPEN:goog.ui.Component.EventType.CLOSE}throw Error(goog.ui.Component.Error.STATE_INVALID);};goog.ui.Component.setDefaultRightToLeft=function(a){goog.ui.Component.defaultRightToLeft_=a};goog.ui.Component.prototype.id_=null;goog.ui.Component.prototype.dom_=null;goog.ui.Component.prototype.inDocument_=!1;goog.ui.Component.prototype.element_=null;goog.ui.Component.prototype.rightToLeft_=null;goog.ui.Component.prototype.model_=null;goog.ui.Component.prototype.parent_=null;goog.ui.Component.prototype.children_=null;goog.ui.Component.prototype.childIndex_=null;goog.ui.Component.prototype.wasDecorated_=!1;goog.ui.Component.prototype.getId=function(){return this.id_||(this.id_=this.idGenerator_.getNextUniqueId())};goog.ui.Component.prototype.setId=function(a){this.parent_&&this.parent_.childIndex_&&(goog.object.remove(this.parent_.childIndex_,this.id_),goog.object.add(this.parent_.childIndex_,a,this));this.id_=a};goog.ui.Component.prototype.getElement=function(){return this.element_};goog.ui.Component.prototype.setElementInternal=function(a){this.element_=a};goog.ui.Component.prototype.getHandler=function(){return this.googUiComponentHandler_||(this.googUiComponentHandler_=new goog.events.EventHandler(this))};goog.ui.Component.prototype.setParent=function(a){if(this==a)throw Error(goog.ui.Component.Error.PARENT_UNABLE_TO_BE_SET);if(a&&this.parent_&&this.id_&&this.parent_.getChild(this.id_)&&this.parent_!=a)throw Error(goog.ui.Component.Error.PARENT_UNABLE_TO_BE_SET);this.parent_=a;goog.ui.Component.superClass_.setParentEventTarget.call(this,a)};goog.ui.Component.prototype.getParent=function(){return this.parent_};goog.ui.Component.prototype.setParentEventTarget=function(a){if(this.parent_&&this.parent_!=a)throw Error(goog.ui.Component.Error.NOT_SUPPORTED);goog.ui.Component.superClass_.setParentEventTarget.call(this,a)};goog.ui.Component.prototype.getDomHelper=function(){return this.dom_};goog.ui.Component.prototype.isInDocument=function(){return this.inDocument_};goog.ui.Component.prototype.createDom=function(){this.element_=this.dom_.createElement("div")};goog.ui.Component.prototype.render=function(a){this.render_(a)};goog.ui.Component.prototype.renderBefore=function(a){this.render_(a.parentNode,a)};goog.ui.Component.prototype.render_=function(a,b){if(this.inDocument_)throw Error(goog.ui.Component.Error.ALREADY_RENDERED);this.element_||this.createDom();a?a.insertBefore(this.element_,b||null):this.dom_.getDocument().body.appendChild(this.element_);(!this.parent_||this.parent_.isInDocument())&&this.enterDocument()};goog.ui.Component.prototype.decorate=function(a){if(this.inDocument_)throw Error(goog.ui.Component.Error.ALREADY_RENDERED);else if(a&&this.canDecorate(a)){this.wasDecorated_=!0;if(!this.dom_||this.dom_.getDocument()!=goog.dom.getOwnerDocument(a))this.dom_=goog.dom.getDomHelper(a);this.decorateInternal(a);this.enterDocument()}else throw Error(goog.ui.Component.Error.DECORATE_INVALID);};goog.ui.Component.prototype.canDecorate=function(){return!0};goog.ui.Component.prototype.wasDecorated=function(){return this.wasDecorated_};goog.ui.Component.prototype.decorateInternal=function(a){this.element_=a};goog.ui.Component.prototype.enterDocument=function(){this.inDocument_=!0;this.forEachChild(function(a){!a.isInDocument()&&a.getElement()&&a.enterDocument()})};goog.ui.Component.prototype.exitDocument=function(){this.forEachChild(function(a){a.isInDocument()&&a.exitDocument()});this.googUiComponentHandler_&&this.googUiComponentHandler_.removeAll();this.inDocument_=!1};goog.ui.Component.prototype.disposeInternal=function(){goog.ui.Component.superClass_.disposeInternal.call(this);this.inDocument_&&this.exitDocument();this.googUiComponentHandler_&&(this.googUiComponentHandler_.dispose(),delete this.googUiComponentHandler_);this.forEachChild(function(a){a.dispose()});!this.wasDecorated_&&this.element_&&goog.dom.removeNode(this.element_);this.parent_=this.model_=this.element_=this.childIndex_=this.children_=null};goog.ui.Component.prototype.makeId=function(a){return this.getId()+"."+a};goog.ui.Component.prototype.getModel=function(){return this.model_};goog.ui.Component.prototype.setModel=function(a){this.model_=a};goog.ui.Component.prototype.getFragmentFromId=function(a){return a.substring(this.getId().length+1)};goog.ui.Component.prototype.getElementByFragment=function(a){if(!this.inDocument_)throw Error(goog.ui.Component.Error.NOT_IN_DOCUMENT);return this.dom_.getElement(this.makeId(a))};goog.ui.Component.prototype.addChild=function(a,b){this.addChildAt(a,this.getChildCount(),b)};goog.ui.Component.prototype.addChildAt=function(a,b,c){if(a.inDocument_&&(c||!this.inDocument_))throw Error(goog.ui.Component.Error.ALREADY_RENDERED);if(b<0||b>this.getChildCount())throw Error(goog.ui.Component.Error.CHILD_INDEX_OUT_OF_BOUNDS);if(!this.childIndex_||!this.children_)this.childIndex_={},this.children_=[];a.getParent()==this?(goog.object.set(this.childIndex_,a.getId(),a),goog.array.remove(this.children_,a)):goog.object.add(this.childIndex_,a.getId(),a);a.setParent(this);goog.array.insertAt(this.children_,a,b);a.inDocument_&&this.inDocument_&&a.getParent()==this?(c=this.getContentElement(),c.insertBefore(a.getElement(),c.childNodes[b+1]||null)):c?(this.element_||this.createDom(),b=this.getChildAt(b+1),a.render_(this.getContentElement(),b?b.element_:null)):this.inDocument_&&!a.inDocument_&&a.element_&&a.enterDocument()};goog.ui.Component.prototype.getContentElement=function(){return this.element_};goog.ui.Component.prototype.isRightToLeft=function(){if(this.rightToLeft_==null)this.rightToLeft_=goog.style.isRightToLeft(this.inDocument_?this.element_:this.dom_.getDocument().body);return this.rightToLeft_};goog.ui.Component.prototype.setRightToLeft=function(a){if(this.inDocument_)throw Error(goog.ui.Component.Error.ALREADY_RENDERED);this.rightToLeft_=a};goog.ui.Component.prototype.hasChildren=function(){return!!this.children_&&this.children_.length!=0};goog.ui.Component.prototype.getChildCount=function(){return this.children_?this.children_.length:0};goog.ui.Component.prototype.getChildIds=function(){var a=[];this.forEachChild(function(b){a.push(b.getId())});return a};goog.ui.Component.prototype.getChild=function(a){return this.childIndex_&&a?goog.object.get(this.childIndex_,a)||null:null};goog.ui.Component.prototype.getChildAt=function(a){return this.children_?this.children_[a]||null:null};goog.ui.Component.prototype.forEachChild=function(a,b){this.children_&&goog.array.forEach(this.children_,a,b)};goog.ui.Component.prototype.indexOfChild=function(a){return this.children_&&a?goog.array.indexOf(this.children_,a):-1};goog.ui.Component.prototype.removeChild=function(a,b){if(a){var c=goog.isString(a)?a:a.getId(),a=this.getChild(c);c&&a&&(goog.object.remove(this.childIndex_,c),goog.array.remove(this.children_,a),b&&(a.exitDocument(),a.element_&&goog.dom.removeNode(a.element_)),a.setParent(null))}if(!a)throw Error(goog.ui.Component.Error.NOT_OUR_CHILD);return a};goog.ui.Component.prototype.removeChildAt=function(a,b){return this.removeChild(this.getChildAt(a),b)};goog.ui.Component.prototype.removeChildren=function(a){for(;this.hasChildren();)this.removeChildAt(0,a)};goog.ui.Dialog=function(a,b,c){goog.ui.Component.call(this,c);this.class_=a||"modal-dialog";this.useIframeMask_=!!b;this.buttons_=goog.ui.Dialog.ButtonSet.OK_CANCEL;this.focusHandler_=new goog.events.FocusHandler(this.getDomHelper().getDocument())};goog.inherits(goog.ui.Dialog,goog.ui.Component);goog.ui.Dialog.prototype.useIframeMask_=!1;goog.ui.Dialog.prototype.modal_=!0;goog.ui.Dialog.prototype.draggable_=!0;goog.ui.Dialog.prototype.backgroundElementOpacity_=0.3;goog.ui.Dialog.prototype.title_="";goog.ui.Dialog.prototype.content_="";goog.ui.Dialog.prototype.buttons_=null;goog.ui.Dialog.prototype.dragger_=null;goog.ui.Dialog.prototype.visible_=!1;goog.ui.Dialog.prototype.disposeOnHide_=!1;goog.ui.Dialog.prototype.bgEl_=null;goog.ui.Dialog.prototype.bgIframeEl_=null;goog.ui.Dialog.prototype.titleEl_=null;goog.ui.Dialog.prototype.titleTextEl_=null;goog.ui.Dialog.prototype.titleId_=null;goog.ui.Dialog.prototype.titleCloseEl_=null;goog.ui.Dialog.prototype.contentEl_=null;goog.ui.Dialog.prototype.buttonEl_=null;goog.ui.Dialog.prototype.setTitle=function(a){this.title_=a;this.titleTextEl_&&goog.dom.setTextContent(this.titleTextEl_,a)};goog.ui.Dialog.prototype.getTitle=function(){return this.title_};goog.ui.Dialog.prototype.setContent=function(a){this.content_=a;if(this.contentEl_)this.contentEl_.innerHTML=a};goog.ui.Dialog.prototype.getContent=function(){return this.content_};goog.ui.Dialog.prototype.getContentElement=function(){this.contentEl_||this.render();return this.contentEl_};goog.ui.Dialog.prototype.getTitleElement=function(){this.isInDocument()||this.render();return this.titleEl_};goog.ui.Dialog.prototype.getTitleTextElement=function(){this.isInDocument()||this.render();return this.titleTextEl_};goog.ui.Dialog.prototype.getTitleCloseElement=function(){this.isInDocument()||this.render();return this.titleCloseEl_};goog.ui.Dialog.prototype.getButtonElement=function(){this.isInDocument()||this.render();return this.buttonEl_};goog.ui.Dialog.prototype.getDialogElement=function(){this.isInDocument()||this.render();return this.getElement()};goog.ui.Dialog.prototype.getBackgroundElement=function(){this.isInDocument()||this.render();return this.bgEl_};goog.ui.Dialog.prototype.getBackgroundElementOpacity=function(){return this.backgroundElementOpacity_};goog.ui.Dialog.prototype.setBackgroundElementOpacity=function(a){this.backgroundElementOpacity_=a;this.bgEl_&&goog.style.setOpacity(this.bgEl_,this.backgroundElementOpacity_)};goog.ui.Dialog.prototype.setModal=function(a){this.modal_=a;this.manageBackgroundDom_()};goog.ui.Dialog.prototype.getModal=function(){return this.modal_};goog.ui.Dialog.prototype.getClass=function(){return this.class_};goog.ui.Dialog.prototype.setDraggable=function(a){if((this.draggable_=a)&&!this.dragger_&&this.getElement())this.dragger_=this.createDraggableTitleDom_();else if(!this.draggable_&&this.dragger_)this.getElement()&&goog.dom.classes.remove(this.titleEl_,this.class_+"-title-draggable"),this.dragger_.dispose(),this.dragger_=null};goog.ui.Dialog.prototype.createDraggableTitleDom_=function(){var a=new goog.fx.Dragger(this.getElement(),this.titleEl_);goog.dom.classes.add(this.titleEl_,this.class_+"-title-draggable");return a};goog.ui.Dialog.prototype.getDraggable=function(){return this.draggable_};goog.ui.Dialog.prototype.createDom=function(){this.manageBackgroundDom_();var a=this.getDomHelper();this.setElementInternal(a.createDom("div",{className:this.class_,tabIndex:0},this.titleEl_=a.createDom("div",{className:this.class_+"-title",id:this.getId()},this.titleTextEl_=a.createDom("span",this.class_+"-title-text",this.title_),this.titleCloseEl_=a.createDom("span",this.class_+"-title-close")),this.contentEl_=a.createDom("div",this.class_+"-content"),this.buttonEl_=a.createDom("div",this.class_+"-buttons"),this.tabCatcherEl_=a.createDom("span",{tabIndex:0})));this.titleId_=this.titleEl_.id;goog.dom.a11y.setRole(this.getElement(),"dialog");goog.dom.a11y.setState(this.getElement(),"labelledby",this.titleId_||"");if(this.content_)this.contentEl_.innerHTML=this.content_;goog.style.showElement(this.getElement(),!1);this.buttons_&&this.buttons_.attachToElement(this.buttonEl_)};goog.ui.Dialog.prototype.manageBackgroundDom_=function(){if(this.useIframeMask_&&this.modal_&&!this.bgIframeEl_)this.bgIframeEl_=goog.dom.iframe.createBlank(this.getDomHelper()),this.bgIframeEl_.className=this.class_+"-bg",goog.style.showElement(this.bgIframeEl_,!1),goog.style.setOpacity(this.bgIframeEl_,0);else if((!this.useIframeMask_||!this.modal_)&&this.bgIframeEl_)goog.dom.removeNode(this.bgIframeEl_),this.bgIframeEl_=null;if(this.modal_&&!this.bgEl_)this.bgEl_=this.getDomHelper().createDom("div",this.class_+"-bg"),goog.style.setOpacity(this.bgEl_,this.backgroundElementOpacity_),goog.style.showElement(this.bgEl_,!1);else if(!this.modal_&&this.bgEl_)goog.dom.removeNode(this.bgEl_),this.bgEl_=null};goog.ui.Dialog.prototype.render=function(a){if(this.isInDocument())throw Error(goog.ui.Component.Error.ALREADY_RENDERED);this.getElement()||this.createDom();a=a||this.getDomHelper().getDocument().body;this.renderBackground_(a);goog.ui.Dialog.superClass_.render.call(this,a)};goog.ui.Dialog.prototype.renderBackground_=function(a){this.bgIframeEl_&&a.appendChild(this.bgIframeEl_);this.bgEl_&&a.appendChild(this.bgEl_)};goog.ui.Dialog.prototype.renderBefore=function(){throw Error(goog.ui.Component.Error.NOT_SUPPORTED);};goog.ui.Dialog.prototype.canDecorate=function(a){return a&&a.tagName&&a.tagName=="DIV"&&goog.ui.Dialog.superClass_.canDecorate.call(this,a)};goog.ui.Dialog.prototype.decorateInternal=function(a){goog.ui.Dialog.superClass_.decorateInternal.call(this,a);goog.dom.classes.add(this.getElement(),this.class_);a=this.class_+"-content";if(this.contentEl_=goog.dom.$$(null,a,this.getElement())[0])this.content_=this.contentEl_.innerHTML;else{this.contentEl_=this.getDomHelper().createDom("div",a);if(this.content_)this.contentEl_.innerHTML=this.content_;this.getElement().appendChild(this.contentEl_)}var a=this.class_+"-title",b=this.class_+"-title-text",c=this.class_+"-title-close";(this.titleEl_=goog.dom.$$(null,a,this.getElement())[0])?(this.titleTextEl_=goog.dom.$$(null,b,this.titleEl_)[0],this.titleCloseEl_=goog.dom.$$(null,c,this.titleEl_)[0]):(this.titleEl_=this.getDomHelper().createDom("div",a),this.getElement().insertBefore(this.titleEl_,this.contentEl_));this.titleTextEl_?this.title_=goog.dom.getTextContent(this.titleTextEl_):(this.titleTextEl_=this.getDomHelper().createDom("span",b,this.title_),this.titleEl_.appendChild(this.titleTextEl_));goog.dom.a11y.setState(this.getElement(),"labelledby",this.titleId_||"");if(!this.titleCloseEl_)this.titleCloseEl_=this.getDomHelper().createDom("span",c),this.titleEl_.appendChild(this.titleCloseEl_);a=this.class_+"-buttons";(this.buttonEl_=goog.dom.$$(null,a,this.getElement())[0])?(this.buttons_=new goog.ui.Dialog.ButtonSet(this.getDomHelper()),this.buttons_.decorate(this.buttonEl_)):(this.buttonEl_=this.getDomHelper().createDom("div",a),this.getElement().appendChild(this.buttonEl_),this.buttons_&&this.buttons_.attachToElement(this.buttonEl_));this.manageBackgroundDom_();this.renderBackground_(goog.dom.getOwnerDocument(this.getElement()).body);goog.style.showElement(this.getElement(),!1)};goog.ui.Dialog.prototype.enterDocument=function(){goog.ui.Dialog.superClass_.enterDocument.call(this);if(this.draggable_&&!this.dragger_)this.dragger_=this.createDraggableTitleDom_();this.getHandler().listen(this.titleCloseEl_,goog.events.EventType.CLICK,this.onTitleCloseClick_).listen(this.focusHandler_,goog.events.FocusHandler.EventType.FOCUSIN,this.onFocus_);goog.dom.a11y.setRole(this.getElement(),"dialog");this.titleTextEl_.id!==""&&goog.dom.a11y.setState(this.getElement(),"labelledby",this.titleTextEl_.id)};goog.ui.Dialog.prototype.exitDocument=function(){this.isVisible()&&this.setVisible(!1);if(this.dragger_)this.dragger_.dispose(),this.dragger_=null;goog.ui.Dialog.superClass_.exitDocument.call(this)};goog.ui.Dialog.prototype.setVisible=function(a){if(a!=this.visible_){var b=this.getDomHelper().getDocument(),c=goog.dom.getWindow(b)||window;this.isInDocument()||this.render(b.body);a?(this.resizeBackground_(),this.reposition(),this.getHandler().listen(this.getElement(),goog.events.EventType.KEYDOWN,this.onKeyDown_,!0).listen(c,goog.events.EventType.RESIZE,this.onResize_,!0)):this.getHandler().unlisten(this.getElement(),goog.events.EventType.KEYDOWN,this.onKeyDown_,!0).unlisten(c,goog.events.EventType.RESIZE,this.onResize_,!0);this.bgIframeEl_&&goog.style.showElement(this.bgIframeEl_,a);this.bgEl_&&goog.style.showElement(this.bgEl_,a);goog.style.showElement(this.getElement(),a);if(a&&(goog.userAgent.GECKO&&this.getElement().focus(),this.getButtonSet()&&(c=this.getButtonSet().getDefault())))for(var d=this.buttonEl_.getElementsByTagName("button"),e=0,f;f=d[e];e++)if(f.name==c){try{if(goog.userAgent.WEBKIT||goog.userAgent.OPERA){var g=b.createElement("input");g.style.cssText="position:fixed;width:0;height:0";this.getElement().appendChild(g);g.focus();this.getElement().removeChild(g)}f.focus()}catch(h){}break}(this.visible_=a)?this.getHandler().listen(this.buttonEl_,goog.events.EventType.CLICK,this.onButtonClick_):(this.getHandler().unlisten(this.buttonEl_,goog.events.EventType.CLICK,this.onButtonClick_),this.dispatchEvent(goog.ui.Dialog.EventType.AFTER_HIDE),this.disposeOnHide_&&this.dispose())}};goog.ui.Dialog.prototype.isVisible=function(){return this.visible_};goog.ui.Dialog.prototype.resizeBackground_=function(){this.bgIframeEl_&&goog.style.showElement(this.bgIframeEl_,!1);this.bgEl_&&goog.style.showElement(this.bgEl_,!1);var a=this.getDomHelper().getDocument(),b=goog.dom.getWindow(a)||window,c=goog.dom.getViewportSize(b),b=a.body.scrollWidth,a=Math.max(a.body.scrollHeight,c.height);this.bgIframeEl_&&(goog.style.showElement(this.bgIframeEl_,!0),goog.style.setSize(this.bgIframeEl_,b,a));this.bgEl_&&(goog.style.showElement(this.bgEl_,!0),goog.style.setSize(this.bgEl_,b,a));if(this.draggable_)c=goog.style.getSize(this.getElement()),this.dragger_.limits=new goog.math.Rect(0,0,b-c.width,a-c.height)};goog.ui.Dialog.prototype.reposition=function(){var a=this.getDomHelper().getDocument(),b=goog.dom.getWindow(a)||window;if(goog.style.getComputedPosition(this.getElement())=="fixed")var c=a=0;else c=this.getDomHelper().getDocumentScroll(),a=c.x,c=c.y;var d=goog.style.getSize(this.getElement()),b=goog.dom.getViewportSize(b),a=Math.max(a+b.width/2-d.width/2,0),c=Math.max(c+b.height/2-d.height/2,0);goog.style.setPosition(this.getElement(),a,c)};goog.ui.Dialog.prototype.onTitleCloseClick_=function(){var a=this.getButtonSet(),b=a&&a.getCancel();b?(a=a.get(b),this.dispatchEvent(new goog.ui.Dialog.Event(b,a))&&this.setVisible(!1)):this.setVisible(!1)};goog.ui.Dialog.prototype.setDisposeOnHide=function(a){this.disposeOnHide_=a};goog.ui.Dialog.prototype.getDisposeOnHide=function(){return this.disposeOnHide_};goog.ui.Dialog.prototype.disposeInternal=function(){goog.ui.Dialog.superClass_.disposeInternal.call(this);if(this.focusHandler_)this.focusHandler_.dispose(),this.focusHandler_=null;if(this.bgEl_)goog.dom.removeNode(this.bgEl_),this.bgEl_=null;if(this.bgIframeEl_)goog.dom.removeNode(this.bgIframeEl_),this.bgIframeEl_=null;this.tabCatcherEl_=this.buttonEl_=this.titleCloseEl_=null};goog.ui.Dialog.prototype.setButtonSet=function(a){this.buttons_=a;if(this.buttonEl_)this.buttons_?this.buttons_.attachToElement(this.buttonEl_):this.buttonEl_.innerHTML=""};goog.ui.Dialog.prototype.getButtonSet=function(){return this.buttons_};goog.ui.Dialog.prototype.onButtonClick_=function(a){if((a=this.findParentButton_(a.target))&&!a.disabled){var a=a.name,b=this.getButtonSet().get(a);this.dispatchEvent(new goog.ui.Dialog.Event(a,b))&&this.setVisible(!1)}};goog.ui.Dialog.prototype.findParentButton_=function(a){for(;a!=null&&a!=this.buttonEl_;){if(a.tagName=="BUTTON")return a;a=a.parentNode}return null};goog.ui.Dialog.prototype.onKeyDown_=function(a){var b=!1,c=!1,d=this.getButtonSet(),e=a.target;if(a.keyCode==goog.events.KeyCodes.ESC){var f=d&&d.getCancel(),e=e.tagName=="SELECT"&&!e.disabled;f&&!e?(c=!0,b=d.get(f),b=this.dispatchEvent(new goog.ui.Dialog.Event(f,b))):e||(b=!0)}else if(a.keyCode==goog.events.KeyCodes.ENTER){if(e.tagName=="BUTTON")f=e.name;else if(d){var g=d.getDefault(),h=g&&d.getButton(g),e=(e.tagName=="TEXTAREA"||e.tagName=="SELECT")&&!e.disabled;h&&!h.disabled&&!e&&(f=g)}f&&(c=!0,b=this.dispatchEvent(new goog.ui.Dialog.Event(f,String(d.get(f)))))}else a.keyCode==goog.events.KeyCodes.TAB&&a.shiftKey&&e==this.getElement()&&(c=!0);if(b||c)a.stopPropagation(),a.preventDefault();b&&this.setVisible(!1)};goog.ui.Dialog.prototype.onResize_=function(){this.resizeBackground_()};goog.ui.Dialog.prototype.onFocus_=function(a){this.tabCatcherEl_==a.target&&goog.Timer.callOnce(this.focusElement_,0,this)};goog.ui.Dialog.prototype.focusElement_=function(){goog.userAgent.IE&&this.getDomHelper().getDocument().body.focus();this.getElement().focus()};goog.ui.Dialog.Event=function(a,b){this.type=goog.ui.Dialog.EventType.SELECT;this.key=a;this.caption=b};goog.inherits(goog.ui.Dialog.Event,goog.events.Event);goog.ui.Dialog.SELECT_EVENT="dialogselect";goog.ui.Dialog.EventType={SELECT:"dialogselect",AFTER_HIDE:"afterhide"};goog.ui.Dialog.ButtonSet=function(a){this.dom_=a||goog.dom.getDomHelper();goog.structs.Map.call(this)};goog.inherits(goog.ui.Dialog.ButtonSet,goog.structs.Map);goog.ui.Dialog.ButtonSet.prototype.class_="goog-buttonset";goog.ui.Dialog.ButtonSet.prototype.defaultButton_=null;goog.ui.Dialog.ButtonSet.prototype.element_=null;goog.ui.Dialog.ButtonSet.prototype.cancelButton_=null;goog.ui.Dialog.ButtonSet.prototype.set=function(a,b,c,d){goog.structs.Map.prototype.set.call(this,a,b);if(c)this.defaultButton_=a;if(d)this.cancelButton_=a;return this};goog.ui.Dialog.ButtonSet.prototype.attachToElement=function(a){this.element_=a;this.render()};goog.ui.Dialog.ButtonSet.prototype.render=function(){if(this.element_){this.element_.innerHTML="";var a=goog.dom.getDomHelper(this.element_);goog.structs.forEach(this,function(b,c){var d=a.createDom("button",{name:c},b);if(c==this.defaultButton_)d.className=this.class_+"-default";this.element_.appendChild(d)},this)}};goog.ui.Dialog.ButtonSet.prototype.decorate=function(a){if(a&&a.nodeType==goog.dom.NodeType.ELEMENT){this.element_=a;for(var a=this.element_.getElementsByTagName("button"),b=0,c,d,e;c=a[b];b++)if(d=c.name||c.id,e=goog.dom.getTextContent(c)||c.value,d){var f=b==0;this.set(d,e,f,c.name==goog.ui.Dialog.DefaultButtonKeys.CANCEL);f&&goog.dom.classes.add(c,this.class_+"-default")}}};goog.ui.Dialog.ButtonSet.prototype.setDefault=function(a){this.defaultButton_=a};goog.ui.Dialog.ButtonSet.prototype.getDefault=function(){return this.defaultButton_};goog.ui.Dialog.ButtonSet.prototype.setCancel=function(a){this.cancelButton_=a};goog.ui.Dialog.ButtonSet.prototype.getCancel=function(){return this.cancelButton_};goog.ui.Dialog.ButtonSet.prototype.getButton=function(a){for(var b=this.getAllButtons(),c=0,d;d=b[c];c++)if(d.name==a||d.id==a)return d;return null};goog.ui.Dialog.ButtonSet.prototype.getAllButtons=function(){return this.element_.getElementsByTagName(goog.dom.TagName.BUTTON)};goog.ui.Dialog.DefaultButtonKeys={OK:"ok",CANCEL:"cancel",YES:"yes",NO:"no",SAVE:"save",CONTINUE:"continue"};(function(){var a=goog.getMsg("OK"),b=goog.getMsg("Cancel"),c=goog.getMsg("Yes"),d=goog.getMsg("No"),e=goog.getMsg("Save"),f=goog.getMsg("Continue");goog.ui.Dialog.ButtonSet.OK=(new goog.ui.Dialog.ButtonSet).set(goog.ui.Dialog.DefaultButtonKeys.OK,a,!0);goog.ui.Dialog.ButtonSet.OK_CANCEL=(new goog.ui.Dialog.ButtonSet).set(goog.ui.Dialog.DefaultButtonKeys.OK,a,!0).set(goog.ui.Dialog.DefaultButtonKeys.CANCEL,b,!1,!0);goog.ui.Dialog.ButtonSet.YES_NO=(new goog.ui.Dialog.ButtonSet).set(goog.ui.Dialog.DefaultButtonKeys.YES,c,!0).set(goog.ui.Dialog.DefaultButtonKeys.NO,d,!1,!0);goog.ui.Dialog.ButtonSet.YES_NO_CANCEL=(new goog.ui.Dialog.ButtonSet).set(goog.ui.Dialog.DefaultButtonKeys.YES,c).set(goog.ui.Dialog.DefaultButtonKeys.NO,d,!0).set(goog.ui.Dialog.DefaultButtonKeys.CANCEL,b,!1,!0);goog.ui.Dialog.ButtonSet.CONTINUE_SAVE_CANCEL=(new goog.ui.Dialog.ButtonSet).set(goog.ui.Dialog.DefaultButtonKeys.CONTINUE,f).set(goog.ui.Dialog.DefaultButtonKeys.SAVE,e).set(goog.ui.Dialog.DefaultButtonKeys.CANCEL,b,!0,!0)})();GUI={initialMapHeight:0,initialMapWidth:0,popupFts:null,popupLayerInfo:null};GUI.showFTSResults=function(a,b){var c={};c.query=a;c.page=b;if(!b)c.page=1;c.ext=null;if($("cb_fts_map_extent").checked){var d=map.getExtent().toArray();c.ext=Object.toJSON(d)}d=document.getElementById("popup_fts");GUI.popupFts=new goog.ui.Popup(d);GUI.popupFts.setAutoHide(!1);new Ajax.Updater("popup_fts_content",CONST.ROOT_DIR+"layer/fts",{onSuccess:function(){GUI.popupFts.setVisible(!0);$("btn_close_fts_popup").observe("click",function(){GUI.popupFts.setVisible(!1);GUI.popupFts.dispose()})},parameters:c,asynchronous:!0,method:"post",evalScripts:!0})};GUI.showLayerInfo=function(a){GUI.popupLayerInfo&&(GUI.popupLayerInfo.setVisible(!1),GUI.popupLayerInfo.dispose());GUI.popupLayerInfo=new goog.ui.Dialog;GUI.popupLayerInfo.setId("popup_layer_info");GUI.popupLayerInfo.setContent('<div id="popup_layer_info_content"></div>');GUI.popupLayerInfo.setTitle("Layer Info");GUI.popupLayerInfo.setDisposeOnHide(!0);GUI.popupLayerInfo.setButtonSet(null);GUI.popupLayerInfo.setVisible(!0);$("popup_layer_info").hide();GUI.popupLayerInfo.setModal(!0);new Ajax.Updater("popup_layer_info_content",CONST.ROOT_DIR+"layer/tabbed-info-dialog",{onSuccess:function(){GUI.popupLayerInfo.reposition();$("popup_layer_info_content").style.minHeight="450px";$("popup_layer_info").show()},parameters:"layer_id="+a+"&tabbed_view=1&popup=1",asynchronous:!0,method:"post",evalScripts:!0})};GUI.disableGui=function(a){a?$("overlay").style.zIndex=3:$("overlay").style.zIndex=1};GUI.centerElement=function(a,b){var c=a.getWidth();a.style.left=(screen.width-c)/2+"px";b?a.style.top=b+"px":(c=a.getHeight(),a.style.top=(screen.width-c)/2+"px")};GUI.showPopup=function(a,b){el=$(a);contentEl=$(a+"_content");b?(GUI.disableGui(!0),GUI.centerElement($(a),80),el.style.zIndex=3,el.show()):(GUI.disableGui(!1),el.style.zIndex=1,contentEl.innerHTML="",el.hide())};GUI.showSidePanel=function(a){a?($("overlay_panel").show(),$("btn_side_panel_show").hide(),$("btn_side_panel_hide").show()):($("overlay_panel").hide(),$("btn_side_panel_hide").hide(),$("btn_side_panel_show").show());map&&map.updateSize()};GUI.DefaultValueTextField=Class.create({id:null,el:null,defaultValue:"",initialize:function(a,b){if($(a)){this.id=a;this.el=$(a);if(b)this.defaultValue=b;this.checkReset();var c=this.activate.bind(this);$(a).observe("click",c);c=this.checkReset.bind(this);$(a).observe("blur",c)}},reset:function(){this.el.style.color="#808080";this.el.value=this.defaultValue;this.el.style.zoom="1"},activate:function(){if(this.el.value==this.defaultValue)this.el.style.color="#000000",this.el.value=""},checkReset:function(){(this.el.value==""||this.el.value==this.defaultValue)&&this.reset()}});APP=new Object();APP.serviceTestManager=null;APP.subscribeLayer=function(layer_id,idPart)
{new Ajax.Request(CONST.ROOT_DIR+'layer/subscribe-layer',{onCreate:function(request)
{$('spinner_layer_info_'+layer_id+'_'+idPart).show();},onComplete:function(request)
{$('spinner_layer_info_'+layer_id+'_'+idPart).hide();if(!request.responseJSON.success)
{if(request.responseJSON.notLoggedIn)
{alert('Sie mÃ¼ssen angemeldet sein um Layer zu abonnieren');}
else
{alert('DB Fehler: '+request.responseJSON.err);}}},onError:function(request)
{},parameters:'layer_id='+layer_id,asynchronous:true,method:'post',evalScripts:true});}
APP.setLayerStatus=function(service_id){new Ajax.Request(CONST.ROOT_DIR+'layer/layer-status',{parameters:{'service_id':service_id},method:'get',asynchronous:true,evalScripts:true,onComplete:function(request)
{if(request.responseJSON)
{request.responseJSON.layers.each(function(layer){if(!layer.status_ok){$$('div#layer_'+layer.layer_id+' div.status').each(function(e){e.innerHTML=layer.reason;})}});APP.changeLayerDisplay();}}});}
APP.removeWmsTest=function(metaxml_id,testObj)
{new Ajax.Updater('test_server_list',CONST.ROOT_DIR+'service/remove-wms-test',{parameters:{'metaxml_id':metaxml_id},method:'post',asynchronous:true,evalScripts:true,onComplete:function(request)
{if(typeof(testObj)!='undefined'&&testObj!=null)
testObj.stopUpdater();}});}
APP.changeLayerDisplay=function(toggleButton){var show_valid=false;if($('disp_layer_valid').hasClassName('selected'))
{show_valid=true;}
var show_invalid=false;if($('disp_layer_invalid').hasClassName('selected'))
{show_invalid=true;}
var show_archived=false;if($('disp_layer_archived').hasClassName('selected'))
{show_archived=true;}
$H(layers_obj).each(function(layer)
{$('layer_'+layer.key).hide();if(show_valid)
{if(layer.value.indexOf('ok')>-1)
$('layer_'+layer.key).show();}
if(show_invalid)
{if(layer.value.indexOf('failed')>-1)
$('layer_'+layer.key).show();}
if(show_archived)
{if(layer.value.indexOf('archived')>-1)
$('layer_'+layer.key).show();}});}
APP.keepTrack=function(layer_id,service_id)
{if(layer_id)
{params="layer_id="+layer_id;new Ajax.Updater('status_monitoring_layer',CONST.ROOT_DIR+'monitoring/keep-track',{parameters:params,method:'post',asynchronous:true,evalScripts:true,onComplete:function(request)
{}});}
else if(service_id)
{params="service_id="+service_id;new Ajax.Updater('status_monitoring_service',CONST.ROOT_DIR+'monitoring/keep-track',{parameters:params,method:'post',asynchronous:true,evalScripts:true,onComplete:function(request)
{}});}}
APP.changeName=function()
{var params=$('form_personal_name').serialize();new Ajax.Updater('li_personal_name',CONST.ROOT_DIR+'user/change-name',{parameters:params,method:'post',asynchronous:true,evalScripts:true,onCreate:function()
{},onComplete:function(request)
{}});}
APP.changeEmail=function()
{var params=$('form_personal_email').serialize();new Ajax.Updater('li_personal_email',CONST.ROOT_DIR+'user/change-email',{parameters:params,method:'post',asynchronous:true,evalScripts:true,onCreate:function()
{},onComplete:function(request)
{}});}
APP.changePassword=function()
{var params=$('form_personal_password').serialize();new Ajax.Updater('li_personal_password',CONST.ROOT_DIR+'user/change-password',{parameters:params,method:'post',asynchronous:true,evalScripts:true,onCreate:function()
{},onComplete:function(request)
{}});}
APP.changeLocation=function()
{var params=$('form_personal_location').serialize();new Ajax.Updater('li_personal_location',CONST.ROOT_DIR+'user/change-location',{parameters:params,method:'post',asynchronous:true,evalScripts:true,onCreate:function()
{},onComplete:function(request)
{}});}
APP.changeNews=function()
{var params=$('form_personal_news').serialize();new Ajax.Updater('li_personal_news',CONST.ROOT_DIR+'user/change-news',{parameters:params,method:'post',asynchronous:true,evalScripts:true,onCreate:function()
{},onComplete:function(request)
{}});}
APP.search=function(newSearch)
{if(newSearch)
{$('search_form_page').value=1;}
var params=$('adv_search_form').serialize();new Ajax.Updater('search_results',CONST.ROOT_DIR+'search/search',{parameters:params,method:'post',asynchronous:true,evalScripts:true,onCreate:function()
{$('spinner_search').show();},onComplete:function(request)
{$('spinner_search').hide();}});}
APP.changeResultPage=function(page)
{new Ajax.Updater('search_results',CONST.ROOT_DIR+'search/search',{parameters:'page='+page,method:'post',asynchronous:true,evalScripts:true,onCreate:function(){$('spinner_search').show();},onComplete:function(){$('spinner_search').hide();}});}
APP.enlargeSearchMap=function(enlarge)
{var el=$('map_search').remove();if(enlarge)
{$('insert_map_large').appendChild(el);$('container_map_small').hide();$('container_map_large').show();$('map-layer').show();$('map_search').style.width=$('insert_map_large').getWidth()+'px';$('map_search').style.height='600px';miniMap.updateSize();miniMap.addPanZoomPanel();miniMap.initLegendPanel(true);}
else
{$('insert_map_small').appendChild(el);$('container_map_large').hide();$('map-layer').hide();$('container_map_small').show();$('map_search').style.width=$('insert_map_small').getWidth()+'px';$('map_search').style.height=$('insert_map_small').getHeight()+'px';miniMap.updateSize();miniMap.removePanZoomPanel();}}
if(typeof(window.Geops)=='undefined')
{Geops=new Object();}
Geops.IconSwitcher=Class.create({icon1:null,icon2:null,initialize:function(icon1,icon2,evt)
{if(!evt){evt='click'};this.icon1=icon1;this.icon2=icon2;if(evt=='click')
{fnOnClick1=this.onClick.bindAsEventListener(this,this.icon1);this.icon1.element.observe('click',fnOnClick1);fnOnClick2=this.onClick.bindAsEventListener(this,this.icon2);this.icon2.element.observe('click',fnOnClick2);}
else if(evt=='hover')
{fnOnMouseOver=this.onMouseOver.bindAsEventListener(this,this.icon1);this.icon1.element.observe('mouseover',fnOnMouseOver);fnOnMouseOut=this.onMouseOut.bindAsEventListener(this,this.icon2);this.icon2.element.observe('mouseout',fnOnMouseOut);}},onClick:function(evt,icon)
{if(icon==this.icon1)
{this.icon1.element.hide();this.icon2.element.show();this.icon1.onClick(evt,icon);}
else
{this.icon2.element.hide();this.icon1.element.show();this.icon2.onClick(evt,icon);}},onMouseOver:function(evt,icon)
{this.icon1.element.hide();this.icon2.element.show();},onMouseOut:function(evt,icon)
{this.icon2.element.hide();this.icon1.element.show();}});Geops.Icon=Class.create({id:null,element:null,params:null,onClick:function(evt,icon){},initialize:function(id,callback,params)
{this.id=id;this.element=$(id);this.onClick=callback;if(params!=null)
{this.params=params;}
else
{this.params=new Object();}}});if(typeof(window.Geops)=='undefined')
Geops=new Object();Geops.ToggleButton=Class.create({el:null,selected:false,fnOnClick:null,initialize:function(el_id,fnOnClick)
{if($(el_id))
this.el=$(el_id);if(this.el.hasClassName('selected'))
this.selected=true;if(fnOnClick)
this.fnOnClick=fnOnClick;fnClick=this.click.bind(this);this.el.observe('click',fnClick);},click:function()
{this.selected=!this.selected;if(this.selected)
{this.el.addClassName('selected');}
else
{this.el.removeClassName('selected');}
if(this.fnOnClick)
{this.fnOnClick(this);}}});if(typeof(window.Geops)=='undefined')
Geops=new Object();Geops.RadioGroup=Class.create({buttons:null,selectedButton:null,initialize:function()
{this.buttons=new Array();},addButton:function(button)
{this.buttons.push(button);var fnClick=this.click.bind(this,button);button.el.observe('click',fnClick);},click:function(button)
{for(var i=0;i<this.buttons.length;i++)
{this.buttons[i].setSelected(false);}
button.setSelected(true);button.fnClick();}});Geops.RadioButton=Class.create({el:null,fnClick:null,initialize:function(el_id,fnClick)
{if($(el_id))
this.el=$(el_id);if(fnClick)
this.fnClick=fnClick;},setSelected:function(selected)
{if(selected)
this.el.addClassName('selected');else
this.el.removeClassName('selected');}});if(typeof(window.Geops)=='undefined')
Geops=new Object();Geops.SimpleTabs=Class.create({tabs:null,currentTab:null,onTabSwitched:function(){},initialize:function()
{this.tabs=new Array();},addTab:function(tab)
{fnClickTab=this.clickTab.bind(this,tab)
tab.handle.observe('click',fnClickTab);this.tabs.push(tab);if(!this.currentTab)
this.currentTab=tab;},clickTab:function(tab)
{if(tab.status=='enabled')
{this.switchTab(tab);this.currentTab=tab;}},switchTab:function(tab)
{for(var i=0;i<this.tabs.length;i++)
{this.tabs[i].inactivate();}
tab.activate();this.onTabSwitched(tab);},getTab:function(handleId)
{for(var i=0;i<this.tabs.length;i++)
{if(this.tabs[i].handleId==handleId)
return this.tabs[i];}
return null;}});Geops.SimpleTab=Class.create({handleId:null,handle:null,contentId:null,content:null,loaded:false,status:'enabled',url:null,updateParams:"",updateDiv:null,onTabLoaded:function(tab){},initialize:function(handleId,contentId,url,updateParams,updateDiv)
{this.handleId=handleId;this.handle=$(handleId);this.contentId=contentId;this.content=$(contentId);if(url)
{this.url=url;if(updateParams)
this.updateParams=updateParams;}
if(updateDiv)
{this.updateDiv=updateDiv;}},setStatus:function(status)
{this.status=status;this.handle.removeClassName('enabled');this.handle.removeClassName('disabled');this.handle.removeClassName('selected');this.handle.addClassName(status);},setLoaded:function(loaded)
{this.loaded=loaded;},loadTab:function()
{},activate:function()
{this.setStatus('selected');this.show();},inactivate:function()
{this.setStatus('enabled');this.hide();},show:function(spinner_id)
{if(!this.loaded&&this.url)
{var update=this.contentId;if(this.updateDiv)
{update=this.updateDiv;}
fnOnTabLoaded=this.onTabLoaded.bind(this);new Ajax.Updater(update,CONST.ROOT_DIR+this.url,{onCreate:function(request)
{if(spinner_id&&$(spinner_id))
$(spinner_id).show();},onComplete:function(request)
{if(spinner_id&&$(spinner_id))
$(spinner_id).hide();fnOnTabLoaded(this);},onError:function(request)
{},parameters:this.updateParams,asynchronous:true,method:'post',evalScripts:true});this.loaded=true;this.content.show();}
else
{this.content.show();}},hide:function()
{this.content.hide();}});if(typeof(window.Geops)=='undefined'){Geops=new Object();}
Geops.ServiceTestManager=Class.create({tests:null,list_id:null,list_el:null,listCounter:0,TIMEOUT:60,initialize:function(list_id)
{if($(list_id))
{this.list_id=list_id;this.list_el=$(list_id);}else{throw new Error('Error: unknown id for list');}
this.tests=[];this.fetchTestsFromSession();},addTestToList:function(test)
{this.tests.push(test);},addTest:function(test)
{var added=false;for(var i=0;i<this.tests.length;i++){if(this.tests[i].url==test.url){added=true;}}
if(!added){this.addTestToList(test);this.createListElement(test);var params='url='+encodeURIComponent(test.url)+'&form=add_service_test';var fnSetError=test.setError.bind(test);var fnSetMetaxmlId=test.setMetaxmlId.bind(test);var fnSetStatus=test.setStatus.bind(test);new Ajax.Request(CONST.ROOT_DIR+'service/add-service',{onSuccess:function(request){if(request.responseJSON.errors.length>0){var msg='';for(var i=0;i<request.responseJSON.errors.length;i++)
{msg+=request.responseJSON.errors[i]+'</br>';}
fnSetError(msg);fnSetStatus('finished_err');}else if(request.responseJSON.metaxml_id){fnSetMetaxmlId(request.responseJSON.metaxml_id);}},onError:function(){throw new Error('Could not add test to server');},parameters:params,asynchronous:true,method:'post',evalScripts:true});}else{alert('URL has already been added');}},createListElement:function(test)
{this.listCounter++;var li=test.createLi(this.listCounter);var first=this.list_el.firstChild;if(first){this.list_el.insertBefore(li,first);}else{this.list_el.appendChild(li);}
var fnRemoveTest=this.removeTest.bind(this,test);$('btn_remove_service_test_'+test.index).observe('click',fnRemoveTest);$('validation_errors_service_test_'+test.index).observe('click',function(){$('validation_errors_service_test_'+test.index).hide();});},removeTest:function(test){var params='metaxml_id='+test.metaxml_id;Element.hide(test.li_el);new Ajax.Request(CONST.ROOT_DIR+'service/remove-service-test',{onSuccess:function(request){var pos=this.tests.indexOf(test);Element.remove(test.li_el);this.tests.splice(pos,1);}.bind(this),onError:function(request){Element.show(test.li_el);},parameters:params,asynchronous:true,method:'post',evalScripts:true});},fetchTestsFromSession:function()
{var fnCreateListElement=this.createListElement.bind(this);var fnAddTestToList=this.addTestToList.bind(this);new Ajax.Request(CONST.ROOT_DIR+'service/get-service-tests',{onComplete:function(request){var tests=request.responseJSON;for(var i=0;i<tests.length;i++){var test=new Geops.ServiceTest(tests[i].url,tests[i].status,tests[i].metaxml_id);fnAddTestToList(test);fnCreateListElement(test);if(tests[i].error){test.setError(tests[i].error);}
if(tests[i].has_validation_errors){test.setValidationErrors();}
if(tests[i].status=='ready'){test.setReady(tests[i].title,tests[i].service_id);}}},asynchronous:false,method:'post',evalScripts:true});},getTest:function(metaxml_id)
{for(var i=0;i<this.tests.length;i++)
{if(this.tests[i].metaxml_id==metaxml_id)
return this.tests[i];}
return false;},run:function()
{this.checkTests();var fnCheckTests=this.checkTests.bind(this);this.updater=new PeriodicalExecuter(function(pe){fnCheckTests();},15);},checkTests:function()
{var params='';this.tests.each(function(test){if(test.status=='running'&&test.metaxml_id!=null){params+='metaxml_ids[]='+test.metaxml_id+'&';}});var fnGetTest=this.getTest.bind(this);if(params!=''){new Ajax.Request(CONST.ROOT_DIR+'service/test-services',{onSuccess:function(request){var tests=request.responseJSON;tests.each(function(testData){var test=fnGetTest(testData.metaxml_id);if(testData.status=='timeout'){test.setTimeout();test.setError(testData.error)}else if(testData.ready==true){test.setReady(testData.title,testData.service_id);if(testData.has_validation_errors){test.setValidationErrors();}}});},onError:function(){throw new Error('Checking test process failed but will be tried again.');},parameters:params,asynchronous:true,method:'post',evalScripts:true});}}});Geops.ServiceTest=Class.create({metaxml_id:null,li_id:null,li_el:null,url:null,title:null,status:null,ts_start:null,index:null,error:null,initialize:function(url,status,metaxml_id)
{this.url=url;if(status){this.status=status;}else{this.status='running';}
if(metaxml_id)
this.metaxml_id=metaxml_id;this.error='';},setStatus:function(status)
{this.status=status;},createLi:function(counter)
{this.index=counter;this.li_el=document.createElement('LI');this.li_el.id='li_service_test_'+counter;var title=this.url;if(this.title)
title=this.title;var displayRunning='display: none;';if(this.status=='running')
{displayRunning='';}
var displayReady='display: none;';if(this.status=='ready')
{displayReady='';}
var html='<span id="title_'+this.index+'">'+title+'&nbsp;</span>';html+='<ul class="icons">';html+='<li class="running" id="running_'+this.index+'" style="'+displayRunning+'">running</li>';html+='<li class="ready" id="ready_'+this.index+'" style="'+displayReady+'">ready</li>';html+='<li id="btn_remove_service_test_'+this.index+'" class="remove"><a title="remove from list" href="#">remove</a></li>';html+='</ul>'
html+='<div class="subline">'+this.url+'</div>';html+='<div style="background-color: #f3f3f3; margin-right: 10px;">';html+='<div class="hint_small" id="li_service_test_'+this.index+'_hint" style="margin-top: 5px;"></div>';html+='<div class="xml_validation_errors" id="validation_errors_service_test_'+this.index+'" style="display: none;"></div>'
html+='</div>';html+='<div class="error_small" id="li_service_test_'+this.index+'_error" style="margin-top: 3px;"></div>';this.li_el.innerHTML=html;return this.li_el;},setHint:function(hint)
{$('li_service_test_'+this.index+'_hint').innerHTML=hint;},loadValidationErrors:function()
{var params='metaxml_id='+this.metaxml_id;var updateDiv='validation_errors_service_test_'+this.index;var index=this.index;if($(updateDiv).innerHTML=='')
{new Ajax.Updater(updateDiv,CONST.ROOT_DIR+'service/xml-validation-errors',{onCreate:function(request)
{$('spinner_xml_validation_errors_'+index).show();$(updateDiv).show();},onComplete:function(request)
{$('spinner_xml_validation_errors_'+index).hide();},parameters:params,asynchronous:false,method:'post',evalScripts:true});}else{$(updateDiv).show();}},setValidationErrors:function()
{$('li_service_test_'+this.index+'_hint').innerHTML='XML Validation failed. <a href="#" id="link_validation_errors_'+this.index+'" onclick="return false;">More...</a><br/><img src="'+CONST.ROOT_DIR+'img/spinner.gif" id="spinner_xml_validation_errors_'+this.index+'" style="display: none;" />';fnLoadValidationErrors=this.loadValidationErrors.bind(this);$('link_validation_errors_'+this.index).observe('click',fnLoadValidationErrors);},setError:function(error)
{$('running_'+this.index).hide();this.error=error;$('li_service_test_'+this.index+'_error').innerHTML=error;},setMetaxmlId:function(metaxml_id)
{this.metaxml_id=metaxml_id;},setReady:function(title,service_id)
{this.setStatus('ready');this.title=title;$('running_'+this.index).hide();$('ready_'+this.index).show();$('title_'+this.index).innerHTML='<a href="/server/'+service_id+'">'+title+'</a>';},setTimeout:function()
{this.setStatus('timeout');$('running_'+this.index).hide();this.setError(this.error);},writeToSession:function()
{}});SessionMgmnt=new Object();SessionMgmnt.layers=new Array();SessionMgmnt.addLayer=function(layerid){if(SessionMgmnt.layers!=undefined&&SessionMgmnt.layers.length>=3){alert('Maximum number of layers reached. Remove a layer first.');return false;}else{new Ajax.Request(CONST.ROOT_DIR+'map/ajax/addlayer/'+layerid,{asynchronous:true,method:'get',evalScripts:true,evalJson:true,onComplete:function(request){SessionMgmnt.layers=request.responseJSON.layers;SessionMgmnt.updateControls();}});return true;}};SessionMgmnt.removeLayer=function(layerid){new Ajax.Request(CONST.ROOT_DIR+'map/ajax/removelayer/'+layerid,{asynchronous:true,method:'get',evalScripts:true,evalJson:true,onComplete:function(request){SessionMgmnt.layers=request.responseJSON.layers;SessionMgmnt.updateControls();}});};SessionMgmnt.loadSession=function(){new Ajax.Request(CONST.ROOT_DIR+'map/ajax/layers',{asynchronous:true,method:'get',evalScripts:true,evalJson:true,onComplete:function(request){SessionMgmnt.layers=request.responseJSON.layers;SessionMgmnt.updateControls();}});};SessionMgmnt.updateLayerControls=function(layerid){if(SessionMgmnt.layers){var pos=SessionMgmnt.layers.indexOf(layerid);}
else{var pos=-1;}
var es=$$('div#layer_'+layerid+' div.controls');if(es.length>0){es.each(function(e){if((e!=null)&&(e!=undefined)){if(pos!==-1){e.innerHTML='<a href="javascript:SessionMgmnt.removeLayer('+layerid+');">Remove</a>';}
else{e.innerHTML='<a href="javascript:SessionMgmnt.addLayer('+layerid+');">Add</a>';}}});}};SessionMgmnt.updateControls=function(){var ide=$$('.layerid');for(var i=0;i<ide.length;i++){var layer=ide[i].innerHTML;SessionMgmnt.updateLayerControls(parseInt(layer));};};OpenLayers.Control.MMSearch=OpenLayers.Class(OpenLayers.Control,{element:null,searchfield:null,imgbutton:null,map_extent_cb:null,allowSelection:false,searchImg:CONST.ROOT_DIR+"img/search.png",initialize:function(){OpenLayers.Control.prototype.initialize.apply(this,arguments);},destroy:function(){if(this.imgbutton){OpenLayers.Event.stopObservingElement(this.imgbutton);this.element.removeChild(this.imgbutton);this.imgbutton=null;}
if(this.searchfield){OpenLayers.Event.stopObservingElement(this.searchfield);this.element.removeChild(this.searchfield);this.searchfield=null;}
if(this.element.parentNode==this.div){this.div.removeChild(this.element);}
this.element=null;OpenLayers.Control.prototype.destroy.apply(this,arguments);},performSearch:function(e){if((this.searchfield!=null)||(this.searchfield!=undefined)){var query=this.searchfield.value;if(query!=''){if(this.map_extent_cb.checked==true){GUI.showFTSResults(this.searchfield.value,1,this.map.getExtent());}
else{GUI.showFTSResults(this.searchfield.value);}}}
OpenLayers.Event.stop(e);},performSearch2:function(e){if(($('search_control_search_field')!=null)||($('search_control_search_field')!=undefined)){var query=$('search_control_search_field').value;if(query!=''){if(this.map_extent_cb.checked==true){GUI.showFTSResults($('search_control_search_field').value,1,this.map.getExtent());}
else{GUI.showFTSResults($('search_control_search_field').value);}}}
OpenLayers.Event.stop(e);},keypressSearch2:function(e){if(($('search_control_search_field')!=null)||($('search_control_search_field')!=undefined)){if(e.keyCode==13){var query=$('search_control_search_field').value;if(query!=''){if(this.map_extent_cb.checked==true){GUI.showFTSResults($('search_control_search_field').value,1,this.map.getExtent());}
else{GUI.showFTSResults($('search_control_search_field').value);}}
OpenLayers.Event.stop(e);}}},focusSearch:function(e){if((this.searchfield!=null)||(this.searchfield!=undefined)){this.searchfield.focus();}
OpenLayers.Event.stop(e);},draw:function(){OpenLayers.Control.prototype.draw.apply(this,arguments);if(!this.element){this.div.className=this.displayClass;this.element=document.createElement("div");this.div.appendChild(this.element);this.searchfield=document.createElement("input");this.searchfield.type="text";this.searchfield.name="query";this.searchfield.id="searchfield_dummy";this.searchfield.className="MMMSearch";this.searchfield.zIndex="10000";this.searchfield.style.visibility='hidden';this.element.appendChild(this.searchfield);this.imgbutton=document.createElement("img");this.imgbutton.src=this.searchImg;this.imgbutton.style.cursor='Pointer';this.imgbutton.title='search';this.element.appendChild(this.imgbutton);var br=document.createElement("br");this.element.appendChild(br);this.map_extent_cb=document.createElement("input");this.map_extent_cb.type="checkbox";this.map_extent_cb.style.verticalAlign="middle";this.element.appendChild(this.map_extent_cb);var cbLabel=document.createElement("label");cbLabel.innerHTML="search map extent only";cbLabel.style.fontSize="12px";cbLabel.style.color='white';this.element.appendChild(cbLabel);var context={'searchfield':$('search_control_search_field'),'map_extent_cb':this.map_extent_cb,'map':this.map};OpenLayers.Event.observe(this.imgbutton,"click",OpenLayers.Function.bindAsEventListener(this.performSearch2,context));OpenLayers.Event.observe($('search_control_search_field'),"keypress",OpenLayers.Function.bindAsEventListener(this.keypressSearch2,context));}
return this.div;},CLASS_NAME:"OpenLayers.Control.MMSearch"});OpenLayers.Control.MMPanZoomPanel=OpenLayers.Class(OpenLayers.Control.PanZoomBar,{zoomWorldIcon:true,allowSelection:true,initialize:function(){OpenLayers.Control.PanZoomBar.prototype.initialize.apply(this,arguments);},destroy:function(){OpenLayers.Control.PanZoomBar.prototype.destroy.apply(this,arguments);},draw:function(){var originalReturnValue=OpenLayers.Control.PanZoomBar.prototype.draw.apply(this,arguments);$(this.slider).down('img').setStyle({top:'0',display:'block'});$(this.div).setStyle({'lineHeight':'18px','fontSize':'16px'});return originalReturnValue;},CLASS_NAME:"OpenLayers.Control.MMPanZoomPanel"});OpenLayers.Layer.MM=OpenLayers.Class(OpenLayers.Layer.TMS,{baseurl:null,origUrl:null,layer_id:null,contentExtent:null,displayOutsideMaxExtent:false,trackLayer:false,displayInLayerSwitcher:false,EVENT_TYPES:["loadstart","loadend","loadcancel","visibilitychanged","move","moveend","trackingchanged"],initialize:function(name,layer_id,options){var newArguments=[];this.layer_id=layer_id;if((options==undefined)||(options==null)){options=new Object();}
else{if(options.contentExtentStr!=undefined){this.contentExtent=new OpenLayers.Bounds.fromString(options.contentExtentStr.replace(/ /g,","));}
if(options.contentExtent!=undefined){this.contentExtent=options.contentExtent;}
if(options.origUrl!=undefined){this.origUrl=options.origUrl;}}
this.baseurl=options.mm_tile_servers;options.layername=layer_id;options.type="png";options.isBaseLayer=false;options.sphericalMercator=true;newArguments.push(name,this.baseurl,options);OpenLayers.Layer.TMS.prototype.initialize.apply(this,newArguments);this.buffer=1;},destroy:function(){OpenLayers.Layer.TMS.prototype.destroy.apply(this,arguments);},clone:function(obj){if(obj==null){obj=new OpenLayers.Layer.MM(this.name,this.layer_id,this.options);}
obj=OpenLayers.Layer.TMS.prototype.clone.apply(this,[obj]);return obj;},setTracking:function(tracking){if(tracking!=this.tracking){this.tracking=tracking;this.events.triggerEvent("trackingchanged");}},zoomToXYZ:function(x,y,z){var resolution=this.map.getResolutionForZoom(z);var right=this.tileOrigin.lon+(resolution*this.tileSize.w*(x+1))
var top=this.tileOrigin.lat+(resolution*this.tileSize.h*(y+1));var left=right-(resolution*this.tileSize.w);var bottom=top-(resolution*this.tileSize.h);var bounds=new OpenLayers.Bounds(left,bottom,right,top);this.map.zoomToExtent(bounds);},CLASS_NAME:"OpenLayers.Layer.MM"});if(typeof(window.Geops)=='undefined'){Geops=new Object();}
Geops.BaseMap=OpenLayers.Class(OpenLayers.Map,{legend_panel:null,pan_zoom_panel:null,tilesLayer:null,userLayers:null,mm_tile_servers:null,visibleLayers:null,initialize:function(div,options,legend_panel)
{this.visibleLayers=new Array();this.layers=new Array();this.userLayers=new Array();this.legend_panel=legend_panel;if(options==null){options={};}
options.projection=new OpenLayers.Projection("EPSG:900913");options.displayProjection=new OpenLayers.Projection("WGS84");options.units="m";options.numZoomLevels=19;options.maxResolution=156543.0339;options.maxExtent=new OpenLayers.Bounds(-20037508.34,-20037508.34,20037508.34,20037508.34);options.controls=[];this.mm_tile_servers=options.mm_tile_servers;OpenLayers.Map.prototype.initialize.apply(this,[div,options]);this.addPanZoomPanel();this.addControl(new OpenLayers.Control.Navigation());this.addControl(new OpenLayers.Control.MousePosition());this.addControl(new OpenLayers.Control.KeyboardDefaults());this.addControl(new OpenLayers.Control.Attribution());this.addBaseLayer();var layer_style=new OpenLayers.StyleMap({'default':{fill:false,strokeOpacity:0.3,strokeColor:"${favColor}",label:"${timestr}",strokeWidth:2,fontColor:"${favColor}",fontSize:"18px",fontFamily:"Arial, Courier New, monospace",fontWeight:"bold"}});this.tilesLayer=new OpenLayers.Layer.Vector("Tiles",{styleMap:layer_style,displayInLayerSwitcher:false});this.boxesLayer=new OpenLayers.Layer.Boxes("boxes");var layerList=[];layerList.push(this.boxesLayer);layerList.push(this.tilesLayer);this.addLayers(layerList);this.zoomToExtent(new OpenLayers.Bounds(-14000000,-4000000,14000000,5000000));},showPreview:function(layer,previewUrl,x,y,z){function tile2long(x,z){return(x/Math.pow(2,z)*360-180);}
function tile2lat(y,z){var n=Math.PI-2*Math.PI*y/Math.pow(2,z);return-(180/Math.PI*Math.atan(0.5*(Math.exp(n)-Math.exp(-n))));}
var lon_deg=tile2long(x,z);var lat_deg=tile2lat(y,z);var lon_deg2=tile2long(x+1,z);var lat_deg2=tile2lat(y+1,z);var previewExtent=new OpenLayers.Bounds();previewExtent.extend(new OpenLayers.LonLat(lon_deg,lat_deg));previewExtent.extend(new OpenLayers.LonLat(lon_deg2,lat_deg2));var proj=new OpenLayers.Projection("EPSG:4326");previewExtent.transform(proj,map.getProjectionObject());var previewSize=new OpenLayers.Size(256,256);var previewLayer=new OpenLayers.Layer.Image('Preview',previewUrl,previewExtent,previewSize,{isBaseLayer:false});this.addLayer(previewLayer);var removePreview=function(){this.removeLayer(previewLayer);layer.events.unregister('loadend',this,removePreview);};layer.events.register('loadend',this,removePreview);layer.zoomToXYZ(x,y,z);},addBaseLayer:function(){var MapnikLayer=OpenLayers.Class(OpenLayers.Layer.OSM,{initialize:function(name,options){var url=["http://a.tile.openstreetmap.org/${z}/${x}/${y}.png","http://b.tile.openstreetmap.org/${z}/${x}/${y}.png","http://c.tile.openstreetmap.org/${z}/${x}/${y}.png"];options=OpenLayers.Util.extend({numZoomLevels:19,buffer:0,transitionEffect:"resize"},options);var newArguments=[name,url,options];OpenLayers.Layer.OSM.prototype.initialize.apply(this,newArguments);},CLASS_NAME:"MapnikLayer",attribution:"Base Map <a href='http://creativecommons.org/licenses/by-sa/2.0/' title='Creative Commons Attribution-ShareAlike 2.0 Generic' target='cc'>CC-By-SA</a>"
+" by <a href='http://openstreetmap.org/' target='osm'>OpenStreetMap</a>"});this.addLayers([new MapnikLayer()]);},addPanZoomPanel:function()
{this.pan_zoom_panel=new OpenLayers.Control.MMPanZoomPanel();this.addControl(this.pan_zoom_panel);},removePanZoomPanel:function()
{this.removeControl(this.pan_zoom_panel);},addMMLayer:function(name,layer_id,options)
{if(options.mm_tile_servers===undefined){if(this.mm_tile_servers instanceof Array&&this.mm_tile_servers.length>0){options.mm_tile_servers=this.mm_tile_servers;}else{throw new Error('At least 1 mapmatters tile server needs to be given.');}}
var tms=new OpenLayers.Layer.MM(name,layer_id,options);this.userLayers.push(tms);this.addLayer(tms);this.removeLayer(this.tilesLayer);this.addLayer(this.tilesLayer);tms.events.register("visibilitychanged",tms,this.showBox);tms.events.triggerEvent("visibilitychanged",this.showBox);if(tms.origUrl!=null){var ctrls=this.getControlsByClass('OpenLayers.Control.WMSGetFeatureInfo');if(ctrls.length>0){var info=ctrls[0];info.url=tms.origUrl;info.activate();}}
return tms;},removeMMLayer:function(layer_id)
{var i;for(i=0;i<this.userLayers.length;i++)
{if(this.userLayers[i].layer_id==layer_id)
{this.userLayers.splice(i,1);}}
SessionMgmnt.removeLayer(layer_id);var layers=this.getLayersBy('layer_id',layer_id);for(i=0;i<layers.length;i++){this.visibleLayers.without(layers[i]);this.removeLayer(layers[i]);}
for(i=0;i<this.boxesLayer.markers.length;i++){if(this.boxesLayer.markers[i].layer_id==layer_id){this.boxesLayer.removeMarker(this.boxesLayer.markers[i]);break;}}},showMaxTwo:function(evt){var changed=false;if((evt.layer!=undefined)&&(evt.layer.layer_id!=undefined)&&(evt.layer.CLASS_NAME=="OpenLayers.Layer.MM")&&((evt.type="addlayer")||(evt.property=="visibility"&&evt.layer[evt.property]))){while(this.visibleLayers.length>1){this.visibleLayers.shift();}
this.visibleLayers.push(evt.layer.layer_id);this.layers.each(function(l){if((l.layer_id)&&(l.CLASS_NAME=="OpenLayers.Layer.MM")&&(l.visibility)&&(l.map.visibleLayers.indexOf(l.layer_id)==-1)){l.visibility=false;changed=true;if($('checkbox_legend_user_layer_'+l.layer_id)){$('checkbox_legend_user_layer_'+l.layer_id).checked=l.visibility;}}});}
if(changed){evt.layer.redraw();evt.layer.events.triggerEvent("visibilitychanged");}},showBox:function(remove){if((!this.getVisibility())||(remove==true)){for(i=0;i<this.map.boxesLayer.markers.length;i++){if(this.map.boxesLayer.markers[i].layer_id==this.layer_id){this.map.boxesLayer.removeMarker(this.map.boxesLayer.markers[i]);break;}}}else{this.map.removeLayer(this.map.boxesLayer);this.map.addLayer(this.map.boxesLayer);if(this.contentExtent!=null){var contentExtent=this.contentExtent;var fullExtent=new OpenLayers.Bounds(-180,-90,180,90);fullExtent=fullExtent.transform(new OpenLayers.Projection("WGS84"),this.map.getProjectionObject());if(!contentExtent.containsBounds(fullExtent)){var box=new OpenLayers.Marker.Box(contentExtent);box.layer_id=this.layer_id;this.map.boxesLayer.addMarker(box);}}}},zoomToMMLayer:function(layer_id){var layers=this.getLayersBy('layer_id',layer_id);for(var i=0;i<layers.length;i++)
{if(layers[i].contentExtent==null){this.zoomToMaxExtent();}
else{this.zoomToExtent(layers[i].contentExtent);}}},setTrackLayer:function(layer){var i;if(!layer){for(i=this.layers.length-1;i>=0;i--){if(this.layers[i].trackLayer&&this.layers[i].visible){layer=this.layers[i];break;}}}
if(!layer)return;for(i=this.layers.length-1;i>=0;i--){if(this.layers[i].trackLayer&&this.layers[i]!=layer){this.removeTrackEvents(this.layers[i]);}
if(this.layers[i]==layer){this.registerTrackEvents(layer);}}},removeTrackEvents:function(layer){layer.events.un({"loadstart":layer.loadstart});for(var iRow=0,len=layer.grid.length;iRow<len;iRow++){var row=layer.grid[iRow];for(var iCol=0,clen=row.length;iCol<clen;iCol++){tile=row[iCol];tile.unload();tile.events.un({"loadend":layer.onTileLoadEnd,"loadstart":layer.onTileLoadStart,scope:this});}}},registerTrackEvents:function(layer){var iRow;var row;var iCol;layer.date2Layer=function(){this.loadstart=new Date();}
layer.events.register("loadstart",layer,layer.date2Layer);layer.cleantiles=function(){var xyz=new Array();var bounds=this.getTilesBounds();for(var i=this.map.tilesLayer.features.length-1;i>=0;i--){if(!bounds.containsBounds(this.map.tilesLayer.features[i].geometry.getBounds(),true,false)){this.map.tilesLayer.destroyFeatures(this.map.tilesLayer.features[i]);}else{xyz.push(new Array(this.map.tilesLayer.features[i].attributes.x*1,this.map.tilesLayer.features[i].attributes.y*1,this.map.tilesLayer.features[i].attributes.z*1));}}
tileTime(layer.layer_id,xyz);}
layer.events.register("loadend",layer,layer.cleantiles);var urlToXyz=function(url){var xyz=new Array();var urlarray=url.split('/');var z=urlarray[5];var x=urlarray[6];var y=urlarray[7].split('.')[0];xyz.push(x*1,y*1,z*1);return xyz;}
var drawTileFeature=function(tile,loadstart){if(tile.feature){layer.map.tilesLayer.destroyFeatures([tile.feature]);tile.feature=null;}
var xyz=null;if(tile.url){urlToXyz(tile.url);tile.feature=new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Polygon([new OpenLayers.Geometry.LinearRing([new OpenLayers.Geometry.Point(tile.bounds.left,tile.bounds.bottom),new OpenLayers.Geometry.Point(tile.bounds.right,tile.bounds.bottom),new OpenLayers.Geometry.Point(tile.bounds.right,tile.bounds.top),new OpenLayers.Geometry.Point(tile.bounds.left,tile.bounds.top)])]),{'layer_id':layer.layer_id,'x':xyz[0],'y':xyz[1],'z':xyz[2]});if(loadstart){tile.feature.attributes.time='loading...';tile.feature.attributes.timestr=tile.feature.attributes.time;tile.feature.attributes.favColor="#ee9900";}else{if(tile.imgDiv._attempts>OpenLayers.IMAGE_RELOAD_ATTEMPTS){tile.feature.attributes.time='Error';tile.feature.attributes.timestr=tile.feature.attributes.time;tile.feature.attributes.favColor="#990000";}else{tile.feature.attributes.time=layer.map.getTimeStamp(tile.loadstart,new Date());tile.feature.attributes.timestr=tile.feature.attributes.time;tile.feature.attributes.favColor="#009900";}}
layer.map.tilesLayer.addFeatures([tile.feature]);}}
var tileTime=function(layer_id,xyz){new Ajax.Request(CONST.ROOT_DIR+'layer/tiletime',{parameters:{'layer_id':layer_id,'xyz':xyz.toJSON()},method:'post',asynchronous:false,evalScripts:false,onComplete:function(request){if(request.responseJSON){var features=layer.map.tilesLayer.features;for(var i=0,len=features.length;i<len;i++){request.responseJSON.tiletimes.each(function(tiletime){if(((tiletime.layer_id==features[i].attributes.layer_id)&&(tiletime.t_x==features[i].attributes.x)&&(tiletime.t_y==features[i].attributes.y)&&(tiletime.t_z==features[i].attributes.z))){features[i].attributes.timestr=tiletime.time_download+'/'+features[i].attributes.time;layer.map.tilesLayer.drawFeature(features[i]);}})}}}});}
layer.onTileLoadStart=function(){this.tiletime=null;this.loadstart=new Date();drawTileFeature(this,true);};for(iRow=0,len=layer.grid.length;iRow<len;iRow++){row=layer.grid[iRow];for(iCol=0,clen=row.length;iCol<clen;iCol++){tile=row[iCol];tile.loadstart=new Date();tile.events.register("loadstart",tile,layer.onTileLoadStart);}}
layer.onTileLoadEnd=function(){drawTileFeature(this,false);var ntiles=this.layer.grid.length;ntiles=ntiles*this.layer.grid[0].length;if((this.layer.numLoadingTiles!=ntiles)&&(this.layer.numLoadingTiles%10)==0){var xyz=new Array();for(var iRow=0,len=this.layer.grid.length;iRow<len;iRow++){var row=this.layer.grid[iRow];for(var iCol=0,clen=row.length;iCol<clen;iCol++){tile=row[iCol];if(!tile.isLoading&&tile.url!=null){xyz.push(urlToXyz(tile.url));}}}
tileTime(this.layer.layer_id,xyz);}};for(iRow=0,len=layer.grid.length;iRow<len;iRow++){row=layer.grid[iRow];for(iCol=0,clen=row.length;iCol<clen;iCol++){tile=row[iCol];tile.events.register("loadend",tile,layer.onTileLoadEnd);}}},pad:function(n){var padded=''+n;while(padded.length<2){padded='0'+padded;}
return padded;},getTimeStamp:function(start,end){var duration=end-start;var date=new Date(duration);var timeParts=[date.getSeconds(),this.pad(Math.round(date.getMilliseconds()/10))];var timeStamp=timeParts.join(".")+" sec";return timeStamp;},updateLegendPanelOverlays:function()
{},initLegendPanel:function()
{},changeBaseLayer:function(layerId,evt)
{var layer=this.getLayer(layerId);this.setBaseLayer(layer);evt.target.checked=true;},showOverlay:function(layerId,evt)
{var layer=this.getLayer(layerId);if(evt.target.checked)
{layer.display(true);}
else
{layer.display(false);}}});if(typeof(window.Geops)=='undefined'){Geops=new Object();}
Geops.Map=OpenLayers.Class(Geops.BaseMap,{initialize:function(div,options,legend_panel)
{Geops.BaseMap.prototype.initialize.apply(this,[div,options,legend_panel]);},initLegendPanel:function(withoutUserLayers)
{$('legend_base_layers').innerHTML='';$('legend_user_layers').innerHTML='';var baseLayers=new Array();var userLayers=new Array();for(var i=0;i<this.layers.length;i++)
{if(this.layers[i].isBaseLayer){baseLayers.push(this.layers[i]);}else{userLayers.push(this.layers[i]);}}
var radioGroup=new Geops.RadioGroup();var liEl=null;for(i=0;i<baseLayers.length;i++)
{liEl=document.createElement('li');liEl.innerHTML=baseLayers[i].name;liEl.id='legend_base_layer_'+i;$('legend_base_layers').appendChild(liEl);if(this.baseLayer.name==baseLayers[i].name){$(liEl.id).addClassName('selected');}
var fnSwitch=this.setBaseLayer.bind(this,baseLayers[i]);var btn=new Geops.RadioButton('legend_base_layer_'+i,fnSwitch);radioGroup.addButton(btn);}
if(!withoutUserLayers)
{for(i=0;i<userLayers.length;i++)
{liEl=document.createElement('li');liEl.id='legend_item_'+userLayers[i].layer_id;liEl.innerHTML='<input type="checkbox" id="checkbox_legend_user_layer_'+userLayers[i].layer_id+'" />';if(userLayers[i].layer_id)
{liEl.innerHTML+='<a id="legend_show_popup_'+userLayers[i].layer_id+'" href="'+CONST.ROOT_DIR+'wms/'+userLayers[i].layer_id+'" onclick="">'+userLayers[i].name+'</a>';}
else
{liEl.innerHTML+=userLayers[i].name;}
if(userLayers[i].layer_id)
{$('legend_user_layers').appendChild(liEl);var iconsList=document.createElement('ul');iconsList.style.display="none";iconsList.id='legend_icons_'+userLayers[i].layer_id;iconsList=liEl.appendChild(iconsList);$('legend_icons_'+userLayers[i].layer_id).addClassName('icons');var iconsListItem=document.createElement('li');iconsListItem.id='legend_user_layer_zoom_'+userLayers[i].layer_id;iconsListItem.title='zoom to extent';iconsListItem.innerHTML='<a href="#">zoom</a>';iconsList.appendChild(iconsListItem);$('legend_user_layer_zoom_'+userLayers[i].layer_id).addClassName('zoom-layer');var iconsListItem=document.createElement('li');iconsListItem.id='legend_user_layer_remove_'+userLayers[i].layer_id;iconsListItem.title='remove from map';iconsListItem.innerHTML='<a href="#">remove</a>';iconsList.appendChild(iconsListItem);$('legend_user_layer_remove_'+userLayers[i].layer_id).addClassName('remove');$('checkbox_legend_user_layer_'+userLayers[i].layer_id).checked=userLayers[i].getVisibility();var layer=userLayers[i];var cb=$('checkbox_legend_user_layer_'+userLayers[i].layer_id);var fnShowLayer=this.clickVisibilityCheckbox.bindAsEventListener(this,layer,cb);$('checkbox_legend_user_layer_'+userLayers[i].layer_id).observe('click',fnShowLayer);var layer_id=userLayers[i].layer_id;var fnRemove=this.removeLayerAndUpdate.bind(this,layer_id);$('legend_user_layer_remove_'+userLayers[i].layer_id).observe('click',fnRemove);var fnZoom=this.zoomToExtent.bind(this,userLayers[i].contentExtent);$('legend_user_layer_zoom_'+userLayers[i].layer_id).observe('click',fnZoom);var fnShowLegendIcons=this.showLegendIcons.bind(this,userLayers[i].layer_id,true);$('legend_item_'+userLayers[i].layer_id).observe('mouseover',fnShowLegendIcons);var fnHideLegendIcons=this.showLegendIcons.bind(this,userLayers[i].layer_id,false);$('legend_item_'+userLayers[i].layer_id).observe('mouseout',fnHideLegendIcons);}}}},clickVisibilityCheckbox:function(evt,layer,cb)
{layer.setVisibility(cb.checked);},removeLayerAndUpdate:function(layer_id)
{this.removeMMLayer(layer_id);this.initLegendPanel();},showLegendIcons:function(layer_id,show)
{if(show)
$('legend_icons_'+layer_id).show();else
$('legend_icons_'+layer_id).hide();}});Geops.Map.CLASS_NAME="Geops.Map";var GRAPH=new(function(){var posX=0;var posY=0;function pointerX(event){var docElement=document.documentElement,body=document.body||{scrollLeft:0};return event.pageX||(event.clientX+
(docElement.scrollLeft||body.scrollLeft)-
(docElement.clientLeft||0));}
function pointerY(event){var docElement=document.documentElement,body=document.body||{scrollTop:0};return event.pageY||(event.clientY+
(docElement.scrollTop||body.scrollTop)-
(docElement.clientTop||0));}
function getMouseXY(e){posX=pointerX(e);posY=pointerY(e);}
Event.observe(document,'mousemove',getMouseXY);var show_stats=new Element('div',{id:'show_stats'});this.showStats=function(avg,min,max,nt,avail,navail,tick){document.body.appendChild(show_stats);var responseHtml,availHtml;if(nt>0){responseHtml='<b>'+avg+'</b> ('+min+' - '+max+') <span class="sub">n = '+nt+'</span>';}else{responseHtml="no data";}
if(navail>0){availHtml='<b>'+avail+' % </b><span class="sub">n = '+navail+'</span>';}else{availHtml="no data";}
show_stats.innerHTML="<b>Statistics for "+tick+"</b><h4>Response Time</h4> "+responseHtml+" <h4>Availability</h4> "+availHtml;show_stats.setStyle({left:posX+10+"px",top:posY+10+"px"});show_stats.show();};this.hideStats=function(){document.body.removeChild(show_stats);};})();TempVars=new Object();TempVars.statTabs=null;TempVars.currentStatTab=null;if(typeof(window.Geops)=='undefined')
Geops=new Object();Geops.HoverIcons=Class.create({hoverEl:null,iconsEl:null,initialize:function(hoverElId,iconsElId)
{if($(hoverElId))
this.hoverEl=$(hoverElId);if($(iconsElId))
this.iconsEl=$(iconsElId);var fnShowIcons=this.showIcons.bind(this,true);this.hoverEl.observe('mouseover',fnShowIcons)
var fnHideIcons=this.showIcons.bind(this,false);this.hoverEl.observe('mouseout',fnHideIcons)},showIcons:function(show)
{if(show)
{this.iconsEl.show();}
else
{this.iconsEl.hide();}}});if(!window.Geops){window.Geops={};}
Geops.Tags=Class.create({list:null,input:null,oldInputValue:null,closeButton:null,addButton:null,completer:null,proposalList:null,container:null,assumedContainerWidth:null,initialize:function(element,assumedContainerWidth){this.container=element.up('.box-content');var containerWidth=(new Element.Layout(element)).get('width');if(containerWidth===0){containerWidth=assumedContainerWidth;}
this.assumedContainerWidth=containerWidth+'px';this.completer=new Geops.Tags.Completer(this);this.closeButton=new Element('a',{title:'Remove tag','class':'remove'});this.list=element.down('ul');this.list.select('li').each(function(li){this._addRemoveButton(li);}.bind(this));this.input=element.down('input');this._initInput();this.resizeInput();Object.extend(Geops.Tags.prototype,Mixins.Observable);},addTag:function(tag){tag=tag.trim();if(tag!==''&&this.getTags().indexOf(tag)===-1){this.list.appendChild(this.buildTag(tag));this.resizeInput();this.fire('add',tag);}
this.highlightTag(tag);},removeTag:function(tag,userTriggered){var li=this._findTagElement(tag);li.remove();this.resizeInput();this.fire('remove',tag,Boolean(userTriggered));},_findTagElement:function(tag){var element=null;this.list.select('li').each(function(li){if(li.firstChild.nodeValue===tag){element=li;throw $break;}});return element;},highlightTag:function(tag){this.list.select('li').each(function(li){if(li.firstChild.nodeValue===tag){new Effect.Highlight(li);}});},_addRemoveButton:function(li){var closeButton=this.closeButton.cloneNode(true);closeButton.observe('click',function(e){e.stop();li.remove();this.resizeInput();this.fire('remove',li.firstChild.nodeValue,true);}.bind(this));li.appendChild(closeButton);},buildTag:function(tag){var li=new Element('li');li.appendChild(document.createTextNode(tag));this._addRemoveButton(li);return li;},resizeInput:function(){var clone=$(this.container.cloneNode(true));clone.setStyle({width:this.assumedContainerWidth,position:'absolute',top:'-1000px',overflow:'hidden',height:'10px'});document.body.appendChild(clone);var containerLayout=new Element.Layout(clone);var containerWidth=containerLayout.get('width');var inputLayout=new Element.Layout(clone.down('input'));var inputSpace=inputLayout.get('margin-left')+inputLayout.get('padding-left')
+inputLayout.get('padding-right')+inputLayout.get('margin-right');if(clone.down('button')){var buttonLayout=new Element.Layout(clone.down('button'));inputSpace=inputSpace+buttonLayout.get('margin-left')+buttonLayout.get('padding-left')
+buttonLayout.get('border-left')+buttonLayout.get('width')+buttonLayout.get('border-right')
+buttonLayout.get('padding-right')+buttonLayout.get('margin-right');}
if(clone.down('li:last')){var lastTagLayout=new Element.Layout(clone.down('li:last'));var availableWidth=containerWidth-inputSpace-lastTagLayout.get('left')
-lastTagLayout.get('margin-left')-lastTagLayout.get('padding-left')
-lastTagLayout.get('width')-lastTagLayout.get('padding-right')
-lastTagLayout.get('margin-right');}
if(availableWidth<50||clone.down('li:last')===undefined){availableWidth=containerWidth-inputSpace;}
clone.remove();this.input.setStyle({width:availableWidth+'px'});},_checkWordFinish:function(){var value=this.input.getValue();if(value.match(/,$/)){var word=value.split(',')[0];this.addTag(word);this.input.setValue('');}else if(this.proposalList){this.completer.propose(value);}},_initInput:function(){this.oldInputValue=this.input.getValue();this.input.observe('keyup',function(){var inputValue=this.input.getValue();if(this.oldInputValue!==inputValue){this.oldInputValue=inputValue;this._checkWordFinish();}}.bind(this));this.input.observe('blur',function(){setTimeout(function(){this.proposalList.hide();}.bind(this),100);}.bind(this));function addWord(){var value=this.input.getValue();value=value+',';this.input.setValue(value);this._checkWordFinish.apply(this);}
var getSelectedIndex=function(){var terms=this.proposalList.select('dt');for(var i=0;i<terms.length;i++){if(Element.match(terms[i],'.selected')){return i;}}
return null;}.bind(this);this.input.observe('keydown',function(event){var selectedIndex;var dt;if(event.keyCode===Event.KEY_TAB){addWord.apply(this);}else if(event.keyCode===Event.KEY_ESC){this.proposalList.hide();}else if(event.keyCode===Event.KEY_UP){selectedIndex=getSelectedIndex();if(selectedIndex===null){selectedIndex=this.proposalList.select('dt').length-1;}else{this.proposalList.select('.selected').each(function(element){element.removeClassName('selected');});selectedIndex=selectedIndex-1;if(selectedIndex<0){selectedIndex=this.proposalList.select('dt').length-1;}}
dt=this.proposalList.down('dt',selectedIndex);dt.addClassName('selected');if(dt.next()&&dt.next().match('dd')){dt.next().addClassName('selected');}
Element.Methods.scrollToViewport($$('dt.selected')[0]);}else if(event.keyCode===Event.KEY_DOWN){selectedIndex=getSelectedIndex();if(selectedIndex===null){selectedIndex=0;}else{this.proposalList.select('.selected').each(function(element){element.removeClassName('selected');});selectedIndex=selectedIndex+1;if(selectedIndex>this.proposalList.select('dt').length-1){selectedIndex=0;}}
dt=this.proposalList.down('dt',selectedIndex);dt.addClassName('selected');if(dt.next()&&dt.next().match('dd')){dt.next().addClassName('selected');}
Element.Methods.scrollToViewport($$('dt.selected')[0]);}else if(event.keyCode===Event.KEY_RETURN){var selectedEntries=$$('dt.selected');if(selectedEntries.length){this.addTag(selectedEntries[0].firstChild.nodeValue);}else{this.addTag(this.input.getValue());}
this.input.setValue('');this.getProposalList().hide();this.input.focus();}}.bind(this));},setAddButton:function(button){this.addButton=button;this.addButton.observe('click',function(){this.addTag(this.input.getValue());this.input.setValue('');this.getProposalList().hide();this.input.focus();}.bind(this));this.input.insert({after:button});this.resizeInput();},getTags:function(){var words=[];this.list.childElements().each(function(wordElement){words.push(wordElement.firstChild.nodeValue);});return words;},setProposalList:function(list){this.proposalList=$(list);},getProposalList:function(){return this.proposalList;},onProposalsAvailable:function(){this.getProposalList().show();}});Geops.Tags.Completer=Class.create({tags:null,runningRequest:null,initialize:function(tags){this.tags=tags;},propose:function(part){if(part.length<3){return;}
var completer=this;if(this.runningRequest){this.runningRequest.transport.abort();}
this.runningRequest=new Ajax.Request('/user-tag/get-tags-matching-part',{parameters:{part:part},onSuccess:function(response){var proposals=response.responseJSON;if(proposals===null){return;}
var proposalList=completer.tags.getProposalList();proposalList.hide();proposalList.select('*').each(Element.remove);proposals.each(function(proposalData){var proposal=completer.buildProposal(proposalData);proposalList.appendChild(proposal);});if(proposals.length>0){completer.tags.onProposalsAvailable();}},onComplete:function(){completer.runningRequest=null;}});},buildProposal:function(term){var dt=new Element('dt');dt.appendChild(document.createTextNode(term));dt.observe('click',this._addWordOfEntry.bind(this,term));var fragment=document.createDocumentFragment();fragment.appendChild(dt);return fragment;},_addWordOfEntry:function(word){this.tags.input.setValue('');this.tags.addTag(word);this.tags.getProposalList().hide();this.tags.input.focus();}});
