Create a new Google Account

Your Google Account is more than just YouTube.

Talk, chat, share, schedule, store, organize, collaborate, discover, and create. Use Google products from Gmail to Google+ to YouTube, view your search history, all with one username and password, all backed up all the time and easy to find at (you guessed it) Google.com.

Take it all with you.

A Google Account lets you access all your stuff — Gmail, photos, and more — from any device. Search by taking pictures, or by voice. Get free turn-by-turn navigation, upload your pictures automatically, and even buy things with your phone using Google Wallet.

Share a little. Or share a lot.

Share selectively with friends, family (maybe even your boss) on Google+. Start a video call with friends, send a message to a group all at once, or just follow posts from people who fascinate you. Your call.

Work in the future.

Get a jump on the next era of doing, well, everything. Watch as colleagues or partners drop in a photo, update a spreadsheet, or improve a paragraph, in real-time, from 1,000 miles away. Google Docs is free with a Google Account.

try { doKtInit(); } catch (err) {} var gaia_onSubmitValidationHandlers = []; document.getElementById('createaccount').onsubmit = function() { var isValid = true; for (var i = 0; i < gaia_onSubmitValidationHandlers.length; i++) { if (!gaia_onSubmitValidationHandlers[i]()) { isValid = false; } } if (!isValid) { return false; } document.getElementById('submitbutton').disabled = true; gaia_homepageCheckboxOnSubmit(); try { doKtSubmit(); } catch (err) {} try { gaia_phoneNumberOnSubmit(); } catch (err) {} try { document.bg.invoke(function(response) { document.getElementById('bgresponse').value = response; }); } catch (err) {} return true; }; var gaia_homepageCheckboxOnSubmit = function() { }; var goog$global=this,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&&void 0!==b?c[d]=b:c=c[d]?c[d]:c[d]={}},goog$nullFunction=function(){},goog$addSingletonGetter=function(a){a.getInstance=function(){return a.instance_?a.instance_:a.instance_=new a}},goog$typeOf=function(a){var b=typeof a;if("object"==b)if(a){if(a instanceof Array)return"array";if(a instanceof Object)return b;var c= Object.prototype.toString.call(a);if("[object Window]"==c)return"object";if("[object Array]"==c||"number"==typeof a.length&&"undefined"!=typeof a.splice&&"undefined"!=typeof a.propertyIsEnumerable&&!a.propertyIsEnumerable("splice"))return"array";if("[object Function]"==c||"undefined"!=typeof a.call&&"undefined"!=typeof a.propertyIsEnumerable&&!a.propertyIsEnumerable("call"))return"function"}else return"null";else if("function"==b&&"undefined"==typeof a.call)return"object";return b},goog$isDef=function(a){return void 0!== a},goog$isArray=function(a){return"array"==goog$typeOf(a)},goog$isArrayLike=function(a){var b=goog$typeOf(a);return"array"==b||"object"==b&&"number"==typeof a.length},goog$isString=function(a){return"string"==typeof a},goog$isNumber=function(a){return"number"==typeof a},goog$isFunction=function(a){return"function"==goog$typeOf(a)},goog$isObject=function(a){var b=typeof a;return"object"==b&&null!=a||"function"==b},goog$getUid=function(a){return a[goog$UID_PROPERTY_]||(a[goog$UID_PROPERTY_]=++goog$uidCounter_)}, goog$UID_PROPERTY_="closure_uid_"+(1E9*Math.random()>>>0),goog$uidCounter_=0,goog$bindNative_=function(a,b,c){return a.call.apply(a.bind,arguments)},goog$bindJs_=function(a,b,c){if(!a)throw Error();if(2")&&(a=a.replace(goog$string$gtRe_,">"));-1!=a.indexOf('"')&&(a=a.replace(goog$string$quotRe_,"""));return a},goog$string$amperRe_=/&/g,goog$string$ltRe_=//g,goog$string$quotRe_=/\"/g,goog$string$allRe_=/[&<>\"]/, goog$string$regExpEscape=function(a){return String(a).replace(/([-()\[\]{}+?*.$\^|,:#c?Math.max(0,a.length+c):c;if(goog$isString(a))return!goog$isString(b)||1!=b.length?-1:a.indexOf(b,c);for(;c=arguments.length?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;fb?1:aparseFloat(version$$inline_98)){JSCompiler_inline_result$$8=String(docMode$$inline_102);break e}}JSCompiler_inline_result$$8=version$$inline_98} var goog$userAgent$VERSION=JSCompiler_inline_result$$8,goog$userAgent$isVersionOrHigherCache_={},goog$userAgent$isVersionOrHigher=function(a){var b;if(!(b=goog$userAgent$isVersionOrHigherCache_[a])){b=goog$userAgent$isVersionOrHigherCache_;var c=a,d=a,e=0;a=goog$string$trim(String(goog$userAgent$VERSION)).split(".");for(var d=goog$string$trim(String(d)).split("."),f=Math.max(a.length,d.length),g=0;0==e&&gq?1:0)||((0==m[2].length)<(0==r[2].length)?-1:(0==m[2].length)>(0==r[2].length)?1:0)||(m[2]r[2]?1:0)}while(0==e)}a=e;b=b[c]=0<=a}return b},JSCompiler_inline_result$$2;var doc$$inline_104=goog$global.document; if(!doc$$inline_104||!goog$userAgent$IE)JSCompiler_inline_result$$2=void 0;else{var mode$$inline_105=goog$userAgent$getDocumentMode_();JSCompiler_inline_result$$2=mode$$inline_105||("CSS1Compat"==doc$$inline_104.compatMode?parseInt(goog$userAgent$VERSION,10):5)}var goog$userAgent$DOCUMENT_MODE=JSCompiler_inline_result$$2;var goog$dom$defaultDomHelper_,goog$dom$BrowserFeature$CAN_ADD_NAME_OR_TYPE_ATTRIBUTES=!goog$userAgent$IE||goog$userAgent$IE&&9<=goog$userAgent$DOCUMENT_MODE;!goog$userAgent$GECKO&&!goog$userAgent$IE||goog$userAgent$IE&&goog$userAgent$IE&&9<=goog$userAgent$DOCUMENT_MODE||goog$userAgent$GECKO&&goog$userAgent$isVersionOrHigher("1.9.1");var goog$dom$BrowserFeature$CAN_USE_INNER_TEXT=goog$userAgent$IE&&!goog$userAgent$isVersionOrHigher("9");var goog$dom$classes$set=function(a,b){a.className=b},goog$dom$classes$get=function(a){a=a.className;return goog$isString(a)&&a.match(/\S+/g)||[]},goog$dom$classes$add=function(a,b){for(var c=goog$dom$classes$get(a),d=goog$array$slice(arguments,1),e=c.length+d.length,f=c,g=0;ga):!1},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(3==a.nodeType)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$isNodeList=function(a){if(a&&"number"==typeof a.length){if(goog$isObject(a))return"function"==typeof a.item||"string"==typeof a.item;if(goog$isFunction(a))return"function"==typeof a.item}return!1}, goog$dom$DomHelper=function(a){this.document_=a||goog$global.document||document};goog$dom$DomHelper.prototype.getDomHelper=goog$dom$getDomHelper;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.getElementsByTagNameAndClass=function(a,b,c){return goog$dom$getElementsByTagNameAndClass_(this.document_,a,b,c)}; goog$dom$DomHelper.prototype.getElementByClass=function(a,b){var c=b||this.document_,d;d=a;var e=c||document,f=null;e.querySelectorAll&&e.querySelector?d=e.querySelector("."+d):(e=c||document,d=e.querySelectorAll&&e.querySelector?e.querySelectorAll("."+d):e.getElementsByClassName?e.getElementsByClassName(d):goog$dom$getElementsByTagNameAndClass_(document,"*",d,c),d=d[0]);return d=(f=d)||null}; goog$dom$DomHelper.prototype.getViewportSize=function(a){a=(a||this.getWindow()||window).document;a=goog$dom$isCss1CompatMode_(a)?a.documentElement:a.body;return a=new goog$math$Size(a.clientWidth,a.clientHeight)}; goog$dom$DomHelper.prototype.createDom=function(a,b,c){var d;d=this.document_;var e=arguments,f=e[0],g=e[1];if(!goog$dom$BrowserFeature$CAN_ADD_NAME_OR_TYPE_ATTRIBUTES&&g&&(g.name||g.type)){f=["<",f];g.name&&f.push(' name="',goog$string$htmlEscape(g.name),'"');if(g.type){f.push(' type="',goog$string$htmlEscape(g.type),'"');var h={};goog$object$extend(h,g);delete h.type;g=h}f.push(">");f=f.join("")}f=d.createElement(f);g&&(goog$isString(g)?f.className=g:goog$isArray(g)?goog$dom$classes$add.apply(null, [f].concat(g)):goog$dom$setProperties(f,g));2=a.keyCode)a.keyCode=-1}catch(b){}};goog$events$BrowserEvent.prototype.getBrowserEvent=function(){return this.event_};goog$events$BrowserEvent.prototype.disposeInternal=function(){};var goog$events$Listenable$IMPLEMENTED_BY_PROP="closure_listenable_"+(1E6*Math.random()|0),goog$events$Listenable$isImplementedBy=function(a){return!(!a||!a[goog$events$Listenable$IMPLEMENTED_BY_PROP])},goog$events$ListenableKey$counter_=0;var goog$events$Listener=function(a,b,c,d,e,f){this.listener=a;this.proxy=b;this.src=c;this.type=d;this.capture=!!e;this.handler=f;this.key=++goog$events$ListenableKey$counter_;this.removed=this.callOnce=!1};goog$events$Listener.prototype.markAsRemoved=function(){this.removed=!0;this.handler=this.src=this.proxy=this.listener=null};var goog$events$listeners_={},goog$events$listenerTree_={},goog$events$sources_={},goog$events$onString_="on",goog$events$onStringMap_={},goog$events$listen=function(a,b,c,d,e){if(goog$isArray(b)){for(var f=0;fe.keyCode||void 0!=e.returnValue)return!0;e:{var k=e,l=!1;if(0==k.keyCode)try{k.keyCode=-1;break e}catch(n){l=!0}if(l||void 0==k.returnValue)k.returnValue=!0}}k=new goog$events$BrowserEvent;k.init(e,this);e=!0;try{if(g){for(var m=[],r=k.currentTarget;r;r=r.parentNode)m.push(r); f=d[!0];f.remaining_=f.count_;for(var q=m.length-1;!k.propagationStopped_&&0<=q&&f.remaining_;q--)k.currentTarget=m[q],e&=goog$events$fireListeners_(f,m[q],c,!0,k);if(h){f=d[!1];f.remaining_=f.count_;for(q=0;!k.propagationStopped_&&q>>0),goog$events$wrapListener_=function(a){goog$asserts$assert(a,"Listener can not be null.");if(goog$isFunction(a))return a;goog$asserts$assert(a.handleEvent,"An object listener must have handleEvent method.");return a[goog$events$LISTENER_WRAPPER_PROP_]||(a[goog$events$LISTENER_WRAPPER_PROP_]=function(b){return a.handleEvent(b)})}; if(goog$debug$entryPointRegistry$monitorsMayExist_)for(var i$$inline_143=0;i$$inline_143=a.keyCode)return!1;switch(a.keyCode){case 18:case 20:case 93:case 17:case 40:case 35:case 27:case 36:case 45:case 37:case 224:case 91:case 144:case 12:case 34:case 33:case 19:case 255:case 44:case 39:case 145:case 16:case 38:case 224:case 92:return!1;case 0:return!goog$userAgent$GECKO;default:return 166>a.keyCode||183=a||96<=a&&106>=a||65<=a&&90>=a||goog$userAgent$WEBKIT&&0==a)return!0;switch(a){case 32:case 63:case 107:case 109:case 110:case 111:case 186:case 59:case 189:case 187:case 61:case 188:case 190:case 191:case 192:case 222:case 219:case 220:case 221:return!0;default:return!1}},goog$events$KeyCodes$normalizeGeckoKeyCode=function(a){switch(a){case 61:return 187; case 59:return 186;case 224:return 91;case 0:return 224;default:return a}};var goog$events$ActionEventWrapper_=function(){},goog$events$actionEventWrapper=new goog$events$ActionEventWrapper_,goog$events$ActionEventWrapper_$EVENT_TYPES_=["click",goog$userAgent$GECKO?"keypress":"keydown"]; goog$events$ActionEventWrapper_.prototype.listen=function(a,b,c,d,e){var f=function(a){if("click"==a.type&&a.isMouseActionButton())b.call(d,a);else if(13==a.keyCode||3==a.keyCode)a.type="keypress",b.call(d,a)};f.listener_=b;f.scope_=d;e?e.listen(a,goog$events$ActionEventWrapper_$EVENT_TYPES_,f,c):goog$events$listen(a,goog$events$ActionEventWrapper_$EVENT_TYPES_,f,c)}; goog$events$ActionEventWrapper_.prototype.unlisten=function(a,b,c,d,e){for(var f,g=0;f=goog$events$ActionEventWrapper_$EVENT_TYPES_[g];g++){var h;h=a;var k=f,l=!!c;h=goog$events$Listenable$isImplementedBy(h)?h.getListeners(k,l):goog$events$getListeners_(h,k,l)||[];for(l=0;k=h[l];l++)if(k.listener.listener_==b&&k.listener.scope_==d){e?e.unlisten(a,f,k.listener,c,d):goog$events$unlisten(a,f,k.listener,c,d);break}}};var goog$events$EventTarget=function(){this.eventTargetListeners_={};this.actualEventTarget_=this};goog$inherits(goog$events$EventTarget,goog$Disposable);goog$events$EventTarget.prototype[goog$events$Listenable$IMPLEMENTED_BY_PROP]=!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){this.assertInitialized_();var b,c=this.getParentEventTarget();if(c){b=[];for(var d=1;c;c=c.getParentEventTarget())b.push(c),goog$asserts$assert(1E3>++d,"infinite loop")}c=this.actualEventTarget_;d=a.type||a;if(goog$isString(a))a=new goog$events$Event(a,c);else if(a instanceof goog$events$Event)a.target=a.target||c;else{var e=a;a=new goog$events$Event(d,c);goog$object$extend(a,e)}var e=!0,f;if(b)for(var g=b.length-1;!a.propagationStopped_&& 0<=g;g--)f=a.currentTarget=b[g],e=f.fireListeners(d,!0,a)&&e;a.propagationStopped_||(f=a.currentTarget=c,e=f.fireListeners(d,!0,a)&&e,a.propagationStopped_||(e=f.fireListeners(d,!1,a)&&e));if(b)for(g=0;!a.propagationStopped_&&g=this.left&&a.right<=this.right&&a.top>=this.top&&a.bottom<=this.bottom:a.x>=this.left&&a.x<=this.right&&a.y>=this.top&&a.y<=this.bottom;return 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.prototype.ceil=function(){this.top=Math.ceil(this.top);this.right=Math.ceil(this.right);this.bottom=Math.ceil(this.bottom);this.left=Math.ceil(this.left);return this};goog$math$Box.prototype.floor=function(){this.top=Math.floor(this.top);this.right=Math.floor(this.right);this.bottom=Math.floor(this.bottom);this.left=Math.floor(this.left);return this}; goog$math$Box.prototype.round=function(){this.top=Math.round(this.top);this.right=Math.round(this.right);this.bottom=Math.round(this.bottom);this.left=Math.round(this.left);return this};goog$math$Box.prototype.translate=function(a,b){a instanceof goog$math$Coordinate?(this.left+=a.x,this.right+=a.x,this.top+=a.y,this.bottom+=a.y):(this.left+=a,this.right+=a,goog$isNumber(b)&&(this.top+=b,this.bottom+=b));return this}; goog$math$Box.prototype.scale=function(a,b){var c=goog$isNumber(b)?b:a;this.left*=a;this.right*=a;this.top*=c;this.bottom*=c;return this};var 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(){var a=this.left+this.width,b=this.top+this.height;return new goog$math$Box(this.top,a,b,this.left)};goog$math$Rect.prototype.toString=function(){return"("+this.left+", "+this.top+" - "+this.width+"w x "+this.height+"h)"}; 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.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.ceil=function(){this.left=Math.ceil(this.left);this.top=Math.ceil(this.top);this.width=Math.ceil(this.width);this.height=Math.ceil(this.height);return this}; goog$math$Rect.prototype.floor=function(){this.left=Math.floor(this.left);this.top=Math.floor(this.top);this.width=Math.floor(this.width);this.height=Math.floor(this.height);return this};goog$math$Rect.prototype.round=function(){this.left=Math.round(this.left);this.top=Math.round(this.top);this.width=Math.round(this.width);this.height=Math.round(this.height);return this}; goog$math$Rect.prototype.translate=function(a,b){a instanceof goog$math$Coordinate?(this.left+=a.x,this.top+=a.y):(this.left+=a,goog$isNumber(b)&&(this.top+=b));return this};goog$math$Rect.prototype.scale=function(a,b){var c=goog$isNumber(b)?b:a;this.left*=a;this.width*=a;this.top*=c;this.height*=c;return this};var 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){(c=goog$style$getVendorJsStyleName_(a,c))&&(a.style[c]=b)},goog$style$getVendorJsStyleName_=function(a,b){var c=goog$string$toCamelCase(b);if(void 0===a.style[c]){var d=(goog$userAgent$WEBKIT?"Webkit":goog$userAgent$GECKO?"Moz":goog$userAgent$IE?"ms":goog$userAgent$OPERA?"O":null)+goog$string$toTitleCase(b);if(void 0!== a.style[d])return d}return c},goog$style$getComputedStyle=function(a,b){var c=goog$dom$getOwnerDocument(a);return c.defaultView&&c.defaultView.getComputedStyle&&(c=c.defaultView.getComputedStyle(a,null))?c[b]||c.getPropertyValue(b)||"":""},goog$style$getStyle_=function(a,b){return goog$style$getComputedStyle(a,b)||(a.currentStyle?a.currentStyle[b]:null)||a.style&&a.style[b]},goog$style$setPosition=function(a,b,c){var d,e=goog$userAgent$GECKO&&(goog$userAgent$MAC||goog$userAgent$X11)&&goog$userAgent$isVersionOrHigher("1.9"); b instanceof goog$math$Coordinate?(d=b.x,b=b.y):(d=b,b=c);a.style.left=goog$style$getPixelStyleValue_(d,e);a.style.top=goog$style$getPixelStyleValue_(b,e)},goog$style$getBoundingClientRect_=function(a){var b=a.getBoundingClientRect();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&&!(goog$userAgent$IE&&8<=goog$userAgent$DOCUMENT_MODE))return a.offsetParent; var b=goog$dom$getOwnerDocument(a),c=goog$style$getStyle_(a,"position"),d="fixed"==c||"absolute"==c;for(a=a.parentNode;a&&a!=b;a=a.parentNode)if(c=goog$style$getStyle_(a,"position"),d=d&&"static"==c&&a!=b.documentElement&&a!=b.body,!d&&(a.scrollWidth>a.clientWidth||a.scrollHeight>a.clientHeight||"fixed"==c||"absolute"==c||"relative"==c))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.getDocument().body, e=c.getDocument().documentElement,f=c.getDocumentScrollElement();a=goog$style$getOffsetParent(a);)if((!goog$userAgent$IE||0!=a.clientWidth)&&(!goog$userAgent$WEBKIT||0!=a.clientHeight||a!=d)&&a!=d&&a!=e&&"visible"!=goog$style$getStyle_(a,"overflow")){var g=goog$style$getPageOffset(a),h;h=a;if(goog$userAgent$GECKO&&!goog$userAgent$isVersionOrHigher("1.9")){var k=parseFloat(goog$style$getComputedStyle(h,"borderLeftWidth"));if(goog$style$isRightToLeft(h))var l=h.offsetWidth-h.clientWidth-k-parseFloat(goog$style$getComputedStyle(h, "borderRightWidth")),k=k+l;h=new goog$math$Coordinate(k,parseFloat(goog$style$getComputedStyle(h,"borderTopWidth")))}else h=new goog$math$Coordinate(h.clientLeft,h.clientTop);g.x+=h.x;g.y+=h.y;b.top=Math.max(b.top,g.y);b.right=Math.min(b.right,g.x+a.clientWidth);b.bottom=Math.min(b.bottom,g.y+a.clientHeight);b.left=Math.max(b.left,g.x)}d=f.scrollLeft;f=f.scrollTop;b.left=Math.max(b.left,d);b.top=Math.max(b.top,f);c=c.getViewportSize();b.right=Math.min(b.right,d+c.width);b.bottom=Math.min(b.bottom, f+c.height);return 0<=b.top&&0<=b.left&&b.bottom>b.top&&b.right>b.left?b:null},goog$style$getContainerOffsetToScrollInto=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;f=b.scrollLeft;b=b.scrollTop;c?(f+=g-e/2,b+=d-a/2):(f+=Math.min(g,Math.max(g-e,0)),b+=Math.min(d,Math.max(d-a,0)));return new goog$math$Coordinate(f,b)},goog$style$getPageOffset= function(a){var b,c=goog$dom$getOwnerDocument(a),d=goog$style$getStyle_(a,"position");goog$asserts$assertObject(a,"Parameter is required");var e=goog$userAgent$GECKO&&c.getBoxObjectFor&&!a.getBoundingClientRect&&"absolute"==d&&(b=c.getBoxObjectFor(a))&&(0>b.screenX||0>b.screenY),f=new goog$math$Coordinate(0,0),g;b=c?goog$dom$getOwnerDocument(c):document;g=goog$userAgent$IE&&!(goog$userAgent$IE&&9<=goog$userAgent$DOCUMENT_MODE)&&!goog$dom$getDomHelper(b).isCss1CompatMode()?b.body:b.documentElement; 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&&"fixed"==goog$style$getStyle_(b,"position")){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&&"absolute"==d)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||"TR"!=b.tagName)f.y-=b.scrollTop}return f},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$getClientPositionForElement_=function(a){var b;if(a.getBoundingClientRect)b= goog$style$getBoundingClientRect_(a),b=new goog$math$Coordinate(b.left,b.top);else{b=goog$dom$getDomHelper(a).getDocumentScroll();var c=goog$style$getPageOffset(a);b=new goog$math$Coordinate(c.x-b.x,c.y-b.y)}if(goog$userAgent$GECKO&&!goog$userAgent$isVersionOrHigher(12)){var d;goog$userAgent$IE?d="-ms-transform":goog$userAgent$WEBKIT?d="-webkit-transform":goog$userAgent$OPERA?d="-o-transform":goog$userAgent$GECKO&&(d="-moz-transform");var e;d&&(e=goog$style$getStyle_(a,d));e||(e=goog$style$getStyle_(a, "transform"));d=e?(d=e.match(goog$style$MATRIX_TRANSLATION_REGEX_))?new goog$math$Coordinate(parseFloat(d[1]),parseFloat(d[2])):new goog$math$Coordinate(0,0):new goog$math$Coordinate(0,0);return d=new goog$math$Coordinate(b.x+d.x,b.y+d.y)}return b},goog$style$getClientPosition=function(a){goog$asserts$assert(a);if(1==a.nodeType)return goog$style$getClientPositionForElement_(a);var b=goog$isFunction(a.getBrowserEvent),c=a;a.targetTouches?c=a.targetTouches[0]:b&&a.getBrowserEvent().targetTouches&&(c= a.getBrowserEvent().targetTouches[0]);return new goog$math$Coordinate(c.clientX,c.clientY)},goog$style$getPixelStyleValue_=function(a,b){"number"==typeof a&&(a=(b?Math.round(a):a)+"px");return a},goog$style$getSize=function(a){if("none"!=goog$style$getStyle_(a,"display"))return goog$style$getSizeWithDisplay_(a);var b=a.style,c=b.display,d=b.visibility,e=b.position;b.visibility="hidden";b.position="absolute";b.display="inline";a=goog$style$getSizeWithDisplay_(a);b.display=c;b.position=e;b.visibility= d;return a},goog$style$getSizeWithDisplay_=function(a){var b=a.offsetWidth,c=a.offsetHeight,d=goog$userAgent$WEBKIT&&!b&&!c;return(!goog$isDef(b)||d)&&a.getBoundingClientRect?(a=goog$style$getBoundingClientRect_(a),new goog$math$Size(a.right-a.left,a.bottom-a.top)):new goog$math$Size(b,c)},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$setElementShown=function(a,b){a.style.display=b?"":"none"}, 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$setUnselectable=function(a,b,c){c=!c?a.getElementsByTagName("*"):null;if(goog$style$unselectableStyle_){if(b=b?"none":"",a.style[goog$style$unselectableStyle_]=b,c){a=0;for(var d;d=c[a];a++)d.style[goog$style$unselectableStyle_]=b}}else if(goog$userAgent$IE||goog$userAgent$OPERA)if(b=b?"on": "",a.setAttribute("unselectable",b),c)for(a=0;d=c[a];a++)d.setAttribute("unselectable",b)},goog$style$getIePixelValue_=function(a,b,c,d){if(/^\d+px?$/.test(b))return parseInt(b,10);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){var c=a.currentStyle?a.currentStyle[b]:null;return c?goog$style$getIePixelValue_(a,c,"left","pixelLeft"):0},goog$style$ieBorderWidthKeywords_= {thin:2,medium:4,thick:6},goog$style$getIePixelBorder_=function(a,b){if("none"==(a.currentStyle?a.currentStyle[b+"Style"]:null))return 0;var c=a.currentStyle?a.currentStyle[b+"Width"]:null;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)}b=goog$style$getComputedStyle(a,"borderLeftWidth");c=goog$style$getComputedStyle(a,"borderRightWidth");d=goog$style$getComputedStyle(a,"borderTopWidth");a=goog$style$getComputedStyle(a,"borderBottomWidth");return new goog$math$Box(parseFloat(d),parseFloat(c),parseFloat(a),parseFloat(b))},goog$style$MATRIX_TRANSLATION_REGEX_=/matrix\([0-9\.\-]+, [0-9\.\-]+, [0-9\.\-]+, [0-9\.\-]+, ([0-9\.\-]+)p?x?, ([0-9\.\-]+)p?x?\)/;var goog$style$transition$css3TransitionSupported_,goog$style$transition$set=function(a,b){goog$isArray(b)||(b=[b]);goog$asserts$assert(0';a=a.firstChild;goog$asserts$assert(a.nodeType==Node.ELEMENT_NODE);b="transition";c=a.style[goog$string$toCamelCase(b)];a="undefined"!==typeof c?c:a.style[goog$style$getVendorJsStyleName_(a,b)]||"";goog$style$transition$css3TransitionSupported_=""!=a}if(a=goog$style$transition$css3TransitionSupported_)return goog$style$setStyle(this.element_,this.initialStyle_),this.timerId_=goog$Timer$callOnce(this.play_,void 0,this),!0;this.stop_(!1);return!1}; goog$fx$css3$Transition.prototype.play_=function(){goog$style$transition$set(this.element_,this.transitions_);goog$style$setStyle(this.element_,this.finalStyle_);this.timerId_=goog$Timer$callOnce(goog$bind(this.stop_,this,!1),1E3*this.duration_)};goog$fx$css3$Transition.prototype.stop=function(){this.isPlaying()&&this.stop_(!0)}; goog$fx$css3$Transition.prototype.stop_=function(a){goog$style$transition$setPropertyValue_(this.element_,"");goog$Timer$defaultTimerObject.clearTimeout(this.timerId_);goog$style$setStyle(this.element_,this.finalStyle_);goog$now();this.setStateStopped();if(a)this.onStop();else this.onFinish();this.onEnd()};goog$fx$css3$Transition.prototype.disposeInternal=function(){this.stop();goog$fx$css3$Transition.superClass_.disposeInternal.call(this)}; goog$fx$css3$Transition.prototype.pause=function(){goog$asserts$assert(!1,"Css3 transitions does not support pause action.")};var goog$fx$css3$fade=function(a,b,c,d,e){return new goog$fx$css3$Transition(a,b,{opacity:d},{opacity:e},{property:"opacity",duration:b,timing:c,delay:0})},goog$fx$css3$fadeIn=function(a,b){return goog$fx$css3$fade(a,b,"ease-out",0,1)},goog$fx$css3$fadeOut=function(a,b){return goog$fx$css3$fade(a,b,"ease-in",1,0)};var goog$soy$data$SanitizedContentKind$HTML={sanitizedContentKindHtml:!0},goog$soy$data$SanitizedContentKind$JS={sanitizedContentJsStrChars:!0},goog$soy$data$SanitizedContentKind$JS_STR_CHARS={sanitizedContentJsStrChars:!0},goog$soy$data$SanitizedContentKind$URI={sanitizedContentUri:!0},goog$soy$data$SanitizedContentKind$ATTRIBUTES={sanitizedContentHtmlAttribute:!0},goog$soy$data$SanitizedContentKind$CSS={sanitizedContentCss:!0},goog$soy$data$SanitizedContentKind$TEXT={sanitizedContentKindText:!0}, goog$soy$data$SanitizedContentKind={HTML:goog$soy$data$SanitizedContentKind$HTML,JS:goog$soy$data$SanitizedContentKind$JS,JS_STR_CHARS:goog$soy$data$SanitizedContentKind$JS_STR_CHARS,URI:goog$soy$data$SanitizedContentKind$URI,ATTRIBUTES:goog$soy$data$SanitizedContentKind$ATTRIBUTES,CSS:goog$soy$data$SanitizedContentKind$CSS,TEXT:goog$soy$data$SanitizedContentKind$TEXT},goog$soy$data$SanitizedContent=function(){throw Error("Do not instantiate directly");}; goog$soy$data$SanitizedContent.prototype.toString=function(){return this.content};var goog$soy$renderAsElement=function(a,b,c,d){d=d||goog$dom$getDomHelper();d=d.createElement("DIV");d.innerHTML=goog$soy$ensureTemplateOutputHtml_(a(b||goog$soy$defaultTemplateData_,void 0,c));return 1==d.childNodes.length&&(a=d.firstChild,1==a.nodeType)?a:d},goog$soy$ensureTemplateOutputHtml_=function(a){if(!goog$isObject(a))return String(a);if(a instanceof goog$soy$data$SanitizedContent){if(a.contentKind===goog$soy$data$SanitizedContentKind$HTML)return goog$asserts$assertString(a.content);if(a.contentKind=== goog$soy$data$SanitizedContentKind$TEXT)return goog$string$htmlEscape(a.content)}goog$asserts$fail("Soy template output is unsafe for use as HTML: "+a);return"zSoyz"},goog$soy$defaultTemplateData_={};var 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.getInstance();var 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(); var goog$ui$Component$defaultRightToLeft_=null,goog$ui$Component$getStateTransitionEvent=function(a,b){switch(a){case 1:return b?"disable":"enable";case 2:return b?"highlight":"unhighlight";case 4:return b?"activate":"deactivate";case 8:return b?"select":"unselect";case 16:return b?"check":"uncheck";case 32:return b?"focus":"blur";case 64:return b?"open":"close"}throw Error("Invalid component state");};goog$ui$Component.prototype.id_=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.getElementStrict=function(){var a=this.element_;goog$asserts$assert(a,"Can not call getElementStrict before rendering/decorating.");return a}; goog$ui$Component.prototype.setElementInternal=function(a){this.element_=a};goog$ui$Component.prototype.getElementByClass=function(a){return this.element_?this.dom_.getElementByClass(a,this.element_):null};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("Unable to set parent component");if(a&&this.parent_&&this.id_&&this.parent_.getChild(this.id_)&&this.parent_!=a)throw Error("Unable to set parent component");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("Method 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.render_=function(a,b){if(this.inDocument_)throw Error("Component 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("Component already rendered");if(a&&this.canDecorate(a)){this.wasDecorated_=!0;var b=goog$dom$getOwnerDocument(a);if(!this.dom_||this.dom_.getDocument()!=b)this.dom_=goog$dom$getDomHelper(a);this.decorateInternal(a);this.enterDocument()}else throw Error("Invalid element to decorate");};goog$ui$Component.prototype.canDecorate=function(){return!0};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(){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.superClass_.disposeInternal.call(this)};goog$ui$Component.prototype.getModel=function(){return this.model_}; goog$ui$Component.prototype.setModel=function(a){this.model_=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("Component already rendered");if(0>b||b>this.getChildCount())throw Error("Child component index out of bounds");if(!this.childIndex_||!this.children_)this.childIndex_={},this.children_=[];if(a.getParent()==this){var d=a.getId();this.childIndex_[d]=a;goog$array$remove(this.children_,a)}else goog$object$add(this.childIndex_,a.getId(),a);a.setParent(this);goog$array$splice(this.children_,b,0,a); a.inDocument_&&this.inDocument_&&a.getParent()==this?(c=this.getContentElement(),c.insertBefore(a.getElement(),c.childNodes[b]||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.element_.parentNode&&1==a.element_.parentNode.nodeType)&&a.enterDocument()};goog$ui$Component.prototype.getContentElement=function(){return this.element_}; goog$ui$Component.prototype.isRightToLeft=function(){null==this.rightToLeft_&&(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("Component already rendered");this.rightToLeft_=a};goog$ui$Component.prototype.getChildCount=function(){return this.children_?this.children_.length:0}; goog$ui$Component.prototype.getChild=function(a){if(this.childIndex_&&a){var b=this.childIndex_;a=a in b?b[a]:void 0;a=a||null}else a=null;return a};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("Child is not in parent component");return a};var goog$positioning$positionAtAnchor=function(a,b,c,d,e,f,g,h,k){goog$asserts$assert(c);var l=goog$positioning$getOffsetParentPageOffset(c),n,m=a;n=goog$style$getBounds(m);(m=goog$style$getVisibleRectForElement(m))&&n.intersection(new goog$math$Rect(m.left,m.top,m.right-m.left,m.bottom-m.top));var m=n,r=goog$dom$getDomHelper(a),q=goog$dom$getDomHelper(c);if(r.getDocument()!=q.getDocument()){var t=r.getDocument().body,q=q.getWindow(),u=new goog$math$Coordinate(0,0),s=goog$dom$getOwnerDocument(t)? goog$dom$getOwnerDocument(t).parentWindow||goog$dom$getOwnerDocument(t).defaultView:window,v=t;do{var w=s==q?goog$style$getPageOffset(v):goog$style$getClientPositionForElement_(goog$asserts$assert(v));u.x+=w.x;u.y+=w.y}while(s&&s!=q&&(v=s.frameElement)&&(s=s.parent));q=u;q=goog$math$Coordinate$difference(q,goog$style$getPageOffset(t));goog$userAgent$IE&&!r.isCss1CompatMode()&&(q=goog$math$Coordinate$difference(q,r.getDocumentScroll()));m.left+=q.x;m.top+=q.y}a=(b&4&&goog$style$isRightToLeft(a)?b^ 2:b)&-5;b=new goog$math$Coordinate(a&2?n.left+n.width:n.left,a&1?n.top+n.height:n.top);b=goog$math$Coordinate$difference(b,l);e&&(b.x+=(a&2?-1:1)*e.x,b.y+=(a&1?-1:1)*e.y);var p;if(g)if(k)p=k;else if(p=goog$style$getVisibleRectForElement(c))p.top-=l.y,p.right-=l.x,p.bottom-=l.y,p.left-=l.x;e:{e=b;l=d;k=f;f=p;d=g;g=h;e=e.clone();h=0;l=(l&4&&goog$style$isRightToLeft(c)?l^2:l)&-5;p=goog$style$getSize(c);g=g?g.clone():p.clone();if(k||0!=l)l&2?e.x-=g.width+(k?k.right:0):k&&(e.x+=k.left),l&1?e.y-=g.height+ (k?k.bottom:0):k&&(e.y+=k.top);if(d){if(f){h=e;k=g;l=0;if(65==(d&65)&&(h.x=f.right))d&=-2;if(132==(d&132)&&(h.y=f.bottom))d&=-5;h.xf.right&&d&16)&&(k.width=Math.max(k.width-(h.x+k.width-f.right),0),l|=4);h.x+k.width>f.right&&d&1&&(h.x=Math.max(f.right-k.width,f.left),l|=1);d&2&&(l|=(h.xf.right?32:0));h.y=f.top&&(h.y+k.height>f.bottom&&d&32)&&(k.height=Math.max(k.height-(h.y+k.height-f.bottom),0),l|=8);h.y+k.height>f.bottom&&d&4&&(h.y=Math.max(f.bottom-k.height,f.top),l|=2);d&8&&(l|=(h.yf.bottom?128:0));h=l}else h=256;if(h&496)break e}goog$style$setPosition(c,e);p=p==g?!0:!p||!g?!1:p.width==g.width&&p.height==g.height;p||(p=c,f=goog$dom$getOwnerDocument(p),d=goog$dom$getDomHelper(f).isCss1CompatMode(),goog$userAgent$IE&&(!d||!goog$userAgent$isVersionOrHigher("8"))? (f=p.style,d?(k=p,l="padding",goog$userAgent$IE?(d=goog$style$getIePixelDistance_(k,l+"Left"),c=goog$style$getIePixelDistance_(k,l+"Right"),e=goog$style$getIePixelDistance_(k,l+"Top"),k=goog$style$getIePixelDistance_(k,l+"Bottom"),d=new goog$math$Box(e,c,k,d)):(d=goog$style$getComputedStyle(k,l+"Left"),c=goog$style$getComputedStyle(k,l+"Right"),e=goog$style$getComputedStyle(k,l+"Top"),k=goog$style$getComputedStyle(k,l+"Bottom"),d=new goog$math$Box(parseFloat(e),parseFloat(c),parseFloat(k),parseFloat(d))), p=goog$style$getBorderBox(p),f.pixelWidth=g.width-p.left-d.left-d.right-p.right,f.pixelHeight=g.height-p.top-d.top-d.bottom-p.bottom):(f.pixelWidth=g.width,f.pixelHeight=g.height)):(f="border-box",p=p.style,goog$userAgent$GECKO?p.MozBoxSizing=f:goog$userAgent$WEBKIT?p.WebkitBoxSizing=f:p.boxSizing=f,p.width=Math.max(g.width,0)+"px",p.height=Math.max(g.height,0)+"px"))}return h},goog$positioning$getOffsetParentPageOffset=function(a){var b;if(a=a.offsetParent){var c="HTML"==a.tagName||"BODY"==a.tagName; if(!c||"static"!=goog$style$getStyle_(a,"position"))if(b=goog$style$getPageOffset(a),!c){e:{var c=a,d=goog$style$isRightToLeft(c);if(d&&goog$userAgent$GECKO)c=-c.scrollLeft;else{if(d&&(!goog$userAgent$IE||!goog$userAgent$isVersionOrHigher("8")))if(d=goog$style$getStyle_(c,"overflowX"),"visible"!=d){c=c.scrollWidth-c.clientWidth-c.scrollLeft;break e}c=c.scrollLeft}}b=goog$math$Coordinate$difference(b,new goog$math$Coordinate(c,a.scrollTop))}}return b||new goog$math$Coordinate};var goog$positioning$AbstractPosition=function(){};goog$positioning$AbstractPosition.prototype.reposition=function(){};var goog$positioning$AnchoredPosition=function(a,b,c){this.element=a;this.corner=b;this.overflow_=c};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,this.overflow_)};var goog$positioning$AnchoredViewportPosition=function(a,b,c,d){goog$positioning$AnchoredPosition.call(this,a,b);this.lastResortOverflow_=c?5:0;this.overflowConstraint_=d||void 0};goog$inherits(goog$positioning$AnchoredViewportPosition,goog$positioning$AnchoredPosition);goog$positioning$AnchoredViewportPosition.prototype.getLastResortOverflow=function(){return this.lastResortOverflow_};goog$positioning$AnchoredViewportPosition.prototype.setLastResortOverflow=function(a){this.lastResortOverflow_=a}; goog$positioning$AnchoredViewportPosition.prototype.reposition=function(a,b,c,d){var e=goog$positioning$positionAtAnchor(this.element,this.corner,a,b,null,c,10,d,this.overflowConstraint_);if(e&496){var f=this.adjustCorner(e,this.corner);b=this.adjustCorner(e,b);e=goog$positioning$positionAtAnchor(this.element,f,a,b,null,c,10,d,this.overflowConstraint_);e&496&&(f=this.adjustCorner(e,f),b=this.adjustCorner(e,b),goog$positioning$positionAtAnchor(this.element,f,a,b,null,c,this.getLastResortOverflow(), d,this.overflowConstraint_))}};goog$positioning$AnchoredViewportPosition.prototype.adjustCorner=function(a,b){a&48&&(b^=2);a&192&&(b^=1);return b};var goog$ui$PopupBase=function(a,b){goog$events$EventTarget.call(this);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.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.hideOnEscape_=!1;goog$ui$PopupBase.prototype.enableCrossIframeDismissal_=!0;goog$ui$PopupBase.prototype.type_="toggle_display";goog$ui$PopupBase.prototype.getType=function(){return this.type_};goog$ui$PopupBase.prototype.setType=function(a){this.type_=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.setTransition=function(a,b){this.showTransition_=a;this.hideTransition_=b};goog$ui$PopupBase.prototype.getHandler=function(){return this.handler_};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.setVisible=function(a){this.showTransition_&&this.showTransition_.stop();this.hideTransition_&&this.hideTransition_.stop();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,"keydown",this.onDocumentKeyDown_,!0);if(this.autoHide_)if(this.handler_.listen(a,"mousedown",this.onDocumentMouseDown_,!0),goog$userAgent$IE){var b;try{b=a.activeElement}catch(c){}for(;b&&"IFRAME"==b.nodeName;){try{var d, e=b.contentDocument||b.contentWindow.document;d=e}catch(f){break}a=d;b=a.activeElement}this.handler_.listen(a,"mousedown",this.onDocumentMouseDown_,!0);this.handler_.listen(a,"deactivate",this.onDocumentBlur_)}else this.handler_.listen(a,"blur",this.onDocumentBlur_);"toggle_display"==this.type_?this.showPopupElement():"move_offscreen"==this.type_&&this.reposition();this.isVisible_=!0;if(this.showTransition_)goog$events$listenOnce(this.showTransition_,"end",this.onShow_,!1,this),this.showTransition_.play(); else this.onShow_()}};goog$ui$PopupBase.prototype.hide_=function(a){if(!this.isVisible_||!this.onBeforeHide_(a))return!1;this.handler_&&this.handler_.removeAll();this.isVisible_=!1;goog$now();this.hideTransition_?(goog$events$listenOnce(this.hideTransition_,"end",goog$partial(this.continueHidingPopup_,a),!1,this),this.hideTransition_.play()):this.continueHidingPopup_(a);return!0}; goog$ui$PopupBase.prototype.continueHidingPopup_=function(a){"toggle_display"==this.type_?this.shouldHideAsync_?goog$Timer$callOnce(this.hidePopupElement_,0,this):this.hidePopupElement_():"move_offscreen"==this.type_&&this.moveOffscreen_();this.onHide_(a)};goog$ui$PopupBase.prototype.showPopupElement=function(){this.element_.style.visibility="visible";goog$style$setElementShown(this.element_,!0)}; goog$ui$PopupBase.prototype.hidePopupElement_=function(){this.element_.style.visibility="hidden";goog$style$setElementShown(this.element_,!1)};goog$ui$PopupBase.prototype.moveOffscreen_=function(){this.element_.style.top="-10000px"};goog$ui$PopupBase.prototype.onBeforeShow=function(){return this.dispatchEvent("beforeshow")};goog$ui$PopupBase.prototype.onShow_=function(){this.lastShowTime_=goog$now();this.dispatchEvent("show")}; goog$ui$PopupBase.prototype.onBeforeHide_=function(a){return this.dispatchEvent({type:"beforehide",target:a})};goog$ui$PopupBase.prototype.onHide_=function(a){this.dispatchEvent({type:"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){27==a.keyCode&&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,!a||goog$dom$contains(this.element_,a)||"BODY"==a.tagName)return}else if(a.target!=b)return;this.shouldDebounce_()||this.hide_()}}; goog$ui$PopupBase.prototype.shouldDebounce_=function(){return 150>goog$now()-this.lastShowTime_};goog$ui$PopupBase.prototype.disposeInternal=function(){goog$ui$PopupBase.superClass_.disposeInternal.call(this);this.handler_.dispose();goog$dispose(this.showTransition_);goog$dispose(this.hideTransition_);delete this.element_;delete this.handler_};var goog$ui$Popup=function(a,b){this.popupCorner_=4;this.position_=b||void 0;goog$ui$PopupBase.call(this,a)};goog$inherits(goog$ui$Popup,goog$ui$PopupBase);goog$ui$Popup.prototype.setPosition=function(a){this.position_=a||void 0;this.isVisible()&&this.reposition()}; goog$ui$Popup.prototype.reposition=function(){if(this.position_){var a=!this.isVisible()&&"move_offscreen"!=this.getType(),b=this.getElement();a&&(b.style.visibility="hidden",goog$style$setElementShown(b,!0));this.position_.reposition(b,this.popupCorner_,this.margin_);a&&goog$style$setElementShown(b,!1)}};var jfk$ArrowPosition=function(a,b){this.className_=a;this.disableSubpixels_=!!b;this.arrowClassMap_=goog$object$create(0,this.className_+"-arrowright",1,this.className_+"-arrowup",2,this.className_+"-arrowdown",3,this.className_+"-arrowleft")};goog$inherits(jfk$ArrowPosition,goog$positioning$AbstractPosition);jfk$ArrowPosition.prototype.isAutoReposition_=!1;jfk$ArrowPosition.prototype.arrowAlignment_=2;jfk$ArrowPosition.prototype.arrowOffset_=20;jfk$ArrowPosition.prototype.boxPosition_=3; jfk$ArrowPosition.prototype.viewport_=null;jfk$ArrowPosition.prototype.offsetFromAnchor_=-5;jfk$ArrowPosition.prototype.setAnchorElement=function(a){this.anchorElement_=a};jfk$ArrowPosition.prototype.setPosition=function(a,b,c,d){null!=a&&(this.boxPosition_=a);null!=b&&(this.arrowAlignment_=b);goog$isNumber(c)&&(this.arrowOffset_=Math.max(c,15));goog$isNumber(d)&&(this.offsetFromAnchor_=d)};jfk$ArrowPosition.prototype.setElements=function(a,b){this.boxElement_=a;this.arrowElement_=b}; jfk$ArrowPosition.prototype.reposition=function(a,b,c){goog$asserts$assert(this.arrowElement_,"Must call setElements first.");a=this.boxPosition_;b=this.getEffectiveAlignment_(this.boxPosition_,this.arrowAlignment_);var d=this.getEffectiveArrowOffset_();this.reposition_(a,b,d,c)};jfk$ArrowPosition.prototype.getEffectiveArrowOffset_=function(){return 2==this.arrowAlignment_?jfk$ArrowPosition$isLeftOrRight_(this.boxPosition_)?this.boxElement_.offsetHeight/2:this.boxElement_.offsetWidth/2:this.arrowOffset_}; jfk$ArrowPosition.prototype.getEffectiveAlignment_=function(a,b){2==b&&(b=0);return b}; jfk$ArrowPosition.prototype.reposition_=function(a,b,c,d,e){if(this.anchorElement_){var f=jfk$ArrowPosition$getCorner_(a,b),g,h=this.anchorElement_,k=a,l=c;g=f;var n=this.boxElement_,m=this.viewport_,r=goog$style$getSize(h),r=jfk$ArrowPosition$isLeftOrRight_(k)?r.height/2:r.width/2,l=r-l;e:{g=(g&4&&goog$style$isRightToLeft(h)?g^2:g)&-5;if(m)m=m.clone(),n&&(n=goog$positioning$getOffsetParentPageOffset(n),m.left+=n.x,m.right+=n.x,m.top+=n.y,m.bottom+=n.y);else if(m=goog$style$getVisibleRectForElement(h), !m){g=l;break e}n=goog$style$getBounds(h).toBox();jfk$ArrowPosition$isLeftOrRight_(k)?n.topm.bottom&&g&1&&(l-=n.bottom-m.bottom):n.leftm.right&&g&2&&(l-=n.right-m.right);g=l}g=jfk$ArrowPosition$isLeftOrRight_(a)?new goog$math$Coordinate(this.offsetFromAnchor_,g):new goog$math$Coordinate(g,this.offsetFromAnchor_);l=jfk$ArrowPosition$isLeftOrRight_(a)?6:9;m=a^3;jfk$ArrowPosition$isLeftOrRight_(a)&&"rtl"==this.anchorElement_.dir&& (m=a);f=goog$positioning$positionAtAnchor(this.anchorElement_,jfk$ArrowPosition$getCorner_(m,b),this.boxElement_,f,g,d,this.isAutoReposition_?l:0,void 0,this.viewport_);if(!e&&f&496){this.reposition_(a^3,b,c,d,!0);return}this.disableSubpixels_&&!(f&496)&&(d=parseFloat(this.boxElement_.style.left),e=parseFloat(this.boxElement_.style.top),goog$asserts$assert(!isNaN(d)&&!isNaN(e),"Could not parse position."),(!(isFinite(d)&&0==d%1)||!(isFinite(e)&&0==e%1))&&goog$style$setPosition(this.boxElement_,Math.round(d), Math.round(e)))}this.positionArrow_(a,b,c)}; jfk$ArrowPosition.prototype.positionArrow_=function(a,b,c){var d=this.arrowElement_;goog$object$forEach(this.arrowClassMap_,function(a){var b=d;goog$dom$classes$remove(b,a)},this);goog$dom$classes$add(d,this.arrowClassMap_[a]);d.style.top=d.style.left=d.style.right=d.style.bottom="";this.anchorElement_?(c=goog$style$getRelativePosition(this.anchorElement_,this.boxElement_),b=jfk$ArrowPosition$getAnchorPointOffsetFromAnchorTopLeft_(this.anchorElement_,a),jfk$ArrowPosition$isLeftOrRight_(a)?(a=15>this.boxElement_.offsetHeight- 15?15:Math.min(Math.max(c.y+b.y,15),this.boxElement_.offsetHeight-15),d.style.top=a+"px"):(a=15>this.boxElement_.offsetWidth-15?15:Math.min(Math.max(c.x+b.x,15),this.boxElement_.offsetWidth-15),d.style.left=a+"px")):(a=0==b?jfk$ArrowPosition$isLeftOrRight_(a)?"top":"left":jfk$ArrowPosition$isLeftOrRight_(a)?"bottom":"right",d.style[a]=c+"px")}; var jfk$ArrowPosition$getCorner_=function(a,b){switch(a){case 2:return 0==b?1:3;case 1:return 0==b?0:2;case 0:return 0==b?6:7;default:return 0==b?4:5}},jfk$ArrowPosition$getAnchorPointOffsetFromAnchorTopLeft_=function(a,b){var c=0,d=0,e=goog$style$getSize(a);switch(b){case 2:c=e.width/2;break;case 1:c=e.width/2;d=e.height;break;case 0:d=e.height/2;break;case 3:c=e.width,d=e.height/2}return new goog$math$Coordinate(c,d)},jfk$ArrowPosition$isLeftOrRight_=function(a){return 0==a||3==a};Math.pow(1024,-3);Math.pow(1024,-2);Math.pow(1024,2);Math.pow(1024,3);Math.pow(1024,4);Math.pow(1024,5);goog$userAgent$IE&&goog$userAgent$isVersionOrHigher(8);var soydata$SanitizedContentKind=goog$soy$data$SanitizedContentKind,soydata$SanitizedHtml=function(){goog$soy$data$SanitizedContent.call(this)};goog$inherits(soydata$SanitizedHtml,goog$soy$data$SanitizedContent);soydata$SanitizedHtml.prototype.contentKind=soydata$SanitizedContentKind.HTML;var soydata$SanitizedJs=function(){goog$soy$data$SanitizedContent.call(this)};goog$inherits(soydata$SanitizedJs,goog$soy$data$SanitizedContent);soydata$SanitizedJs.prototype.contentKind=soydata$SanitizedContentKind.JS; var soydata$SanitizedJsStrChars=function(){goog$soy$data$SanitizedContent.call(this)};goog$inherits(soydata$SanitizedJsStrChars,goog$soy$data$SanitizedContent);soydata$SanitizedJsStrChars.prototype.contentKind=soydata$SanitizedContentKind.JS_STR_CHARS;var soydata$SanitizedUri=function(){goog$soy$data$SanitizedContent.call(this)};goog$inherits(soydata$SanitizedUri,goog$soy$data$SanitizedContent);soydata$SanitizedUri.prototype.contentKind=soydata$SanitizedContentKind.URI; var soydata$SanitizedHtmlAttribute=function(){goog$soy$data$SanitizedContent.call(this)};goog$inherits(soydata$SanitizedHtmlAttribute,goog$soy$data$SanitizedContent);soydata$SanitizedHtmlAttribute.prototype.contentKind=soydata$SanitizedContentKind.ATTRIBUTES;var soydata$SanitizedCss=function(){goog$soy$data$SanitizedContent.call(this)};goog$inherits(soydata$SanitizedCss,goog$soy$data$SanitizedContent);soydata$SanitizedCss.prototype.contentKind=soydata$SanitizedContentKind.CSS; var soydata$UnsanitizedText=function(a){this.content=String(a)};goog$inherits(soydata$UnsanitizedText,goog$soy$data$SanitizedContent);soydata$UnsanitizedText.prototype.contentKind=soydata$SanitizedContentKind.TEXT;var soydata$$0$0makeSanitizedContentFactory_=function(a){function b(){}b.prototype=a.prototype;return function(a){var d=new b;d.content=String(a);return d}},soydata$VERY_UNSAFE$ordainSanitizedHtml=soydata$$0$0makeSanitizedContentFactory_(soydata$SanitizedHtml);soydata$$0$0makeSanitizedContentFactory_(soydata$SanitizedJs); soydata$$0$0makeSanitizedContentFactory_(soydata$SanitizedJsStrChars);soydata$$0$0makeSanitizedContentFactory_(soydata$SanitizedUri);soydata$$0$0makeSanitizedContentFactory_(soydata$SanitizedHtmlAttribute);soydata$$0$0makeSanitizedContentFactory_(soydata$SanitizedCss);var soydata$$0$0makeSanitizedContentFactoryForInternalBlocks_=function(a){function b(){}b.prototype=a.prototype;return function(a){var d=String(a);if(!d)return"";d=new b;d.content=String(a);return d}};soydata$$0$0makeSanitizedContentFactoryForInternalBlocks_(soydata$UnsanitizedText); soydata$$0$0makeSanitizedContentFactoryForInternalBlocks_(soydata$SanitizedHtml);soydata$$0$0makeSanitizedContentFactoryForInternalBlocks_(soydata$SanitizedJs);soydata$$0$0makeSanitizedContentFactoryForInternalBlocks_(soydata$SanitizedHtmlAttribute);soydata$$0$0makeSanitizedContentFactoryForInternalBlocks_(soydata$SanitizedCss);var jfk$templates$bubble$main=function(a){var b='
';a.showCloseBox&&(a="Close",b+='
');b+='
';return soydata$VERY_UNSAFE$ordainSanitizedHtml(b)}; jfk$templates$bubble$main.soyTemplateName="jfk.templates.bubble.main";var jfk$Bubble=function(a){goog$ui$Component.call(this,a);this.arrowPosition_=new jfk$ArrowPosition(this.className_,!0);this.popup_=new goog$ui$Popup;this.hideYPosition_=0;this.extraCssClasses_=[]};goog$inherits(jfk$Bubble,goog$ui$Component);jfk$Bubble.prototype.className_="jfk-bubble";jfk$Bubble.prototype.showCloseButton_=!0;jfk$Bubble.prototype.disposeOnHide_=!1;jfk$Bubble.prototype.setAnchorElement=function(a){this.arrowPosition_.setAnchorElement(a);this.reposition()}; jfk$Bubble.prototype.setPosition=function(a,b,c,d){goog$asserts$assert(!this.isInDocument(),"Must call setPosition() before rendering");this.arrowPosition_.setPosition(a,b,c,d)};jfk$Bubble.prototype.showCloseButton=function(a){goog$asserts$assert(!this.isInDocument(),"Must call setShowClosebox() before rendering");this.showCloseButton_=a};jfk$Bubble.prototype.addClassName=function(a){goog$asserts$assert(!this.isInDocument(),"Must call addClassName() before rendering");this.extraCssClasses_.push(a)}; jfk$Bubble.prototype.setContent=function(a){goog$asserts$assert(goog$isString(a)||a.nodeType,"Content must be a string or HTML.");this.content_=a;this.setContentInternal_(a)};jfk$Bubble.prototype.setContentInternal_=function(a){var b=this.getContentElement();a&&b&&(goog$isString(a)?b.innerHTML=a:(b.innerHTML="",b.appendChild(a)))};jfk$Bubble.prototype.getContentElement=function(){return this.getElementByClass(this.className_+"-content-id")}; jfk$Bubble.prototype.createDom=function(){this.setElementInternal(goog$soy$renderAsElement(jfk$templates$bubble$main,{showCloseBox:this.showCloseButton_},void 0,this.getDomHelper()));this.setContentInternal_(this.content_);goog$style$setElementShown(this.getElement(),!1);this.popup_.setElement(this.getElement());goog$userAgent$MOBILE||this.popup_.setTransition(goog$fx$css3$fadeIn(this.getElement(),0.218),goog$fx$css3$fadeOut(this.getElement(),0.218));goog$dom$classes$add.apply(null,goog$array$concat(this.getElement(), this.extraCssClasses_))}; jfk$Bubble.prototype.enterDocument=function(){jfk$Bubble.superClass_.enterDocument.call(this);this.getHandler().listen(this.popup_,["beforeshow","show","beforehide","hide"],this.handlePopupEvent_);this.showCloseButton_&&this.getHandler().listenWithWrapper(this.getElementByClass(this.className_+"-closebtn-id"),goog$events$actionEventWrapper,goog$partial(this.setVisible,!1));var a=this.getElement();goog$asserts$assert(a,"getElement() returns null.");var b=this.getElementByClass(this.className_+"-arrow-id"); goog$asserts$assert(b,"No arrow element is found!");this.arrowPosition_.setElements(a,b);this.popup_.setPosition(this.arrowPosition_)};jfk$Bubble.prototype.setVisible=function(a){this.popup_.setVisible(a)};jfk$Bubble.prototype.isVisible=function(){return this.popup_.isVisible()};jfk$Bubble.prototype.reposition=function(){this.isVisible()&&this.popup_.reposition()};jfk$Bubble.prototype.disposeInternal=function(){this.popup_.dispose();delete this.popup_;jfk$Bubble.superClass_.disposeInternal.call(this)}; jfk$Bubble.prototype.handleScroll_=function(){var a=goog$style$getClientPosition(this.getElement());this.hideYPosition_&&a.yb?e+="000":256>b?e+="00":4096>b&&(e+="0");return goog$json$Serializer$charToJsonCharCache_[a]=e+b.toString(16)}),'"')};goog$json$Serializer.prototype.serializeNumber_=function(a,b){b.push(isFinite(a)&&!isNaN(a)?a:"null")}; goog$json$Serializer.prototype.serializeArray=function(a,b){var c=a.length;b.push("[");for(var d="",e=0;eb.charCode&&goog$events$KeyCodes$isCharacterKey(c)?b.charCode:0):goog$userAgent$OPERA?(c=this.keyCode_,d=goog$events$KeyCodes$isCharacterKey(c)?b.keyCode:0):(c=b.keyCode||this.keyCode_,d=b.charCode||0,goog$events$KeyHandler$SAVE_ALT_FOR_KEYPRESS_&& (e=this.altKey_),goog$userAgent$MAC&&(63==d&&224==c)&&(c=191));var f=c,g=b.keyIdentifier;c?63232<=c&&c in goog$events$KeyHandler$safariKey_?f=goog$events$KeyHandler$safariKey_[c]:25==c&&a.shiftKey&&(f=9):g&&g in goog$events$KeyHandler$keyIdentifier_&&(f=goog$events$KeyHandler$keyIdentifier_[g]);a=f==this.lastKey_;this.lastKey_=f;b=new goog$events$KeyEvent(f,d,a,b);b.altKey=e;this.dispatchEvent(b)};goog$events$KeyHandler.prototype.getElement=function(){return this.element_}; goog$events$KeyHandler.prototype.attach=function(a,b){this.keyUpKey_&&this.detach();this.element_=a;this.keyPressKey_=goog$events$listen(this.element_,"keypress",this,b);this.keyDownKey_=goog$events$listen(this.element_,"keydown",this.handleKeyDown_,b,this);this.keyUpKey_=goog$events$listen(this.element_,"keyup",this.handleKeyup_,b,this)}; goog$events$KeyHandler.prototype.detach=function(){this.keyPressKey_&&(goog$events$unlistenByKey(this.keyPressKey_),goog$events$unlistenByKey(this.keyDownKey_),goog$events$unlistenByKey(this.keyUpKey_),this.keyUpKey_=this.keyDownKey_=this.keyPressKey_=null);this.element_=null;this.keyCode_=this.lastKey_=-1};goog$events$KeyHandler.prototype.disposeInternal=function(){goog$events$KeyHandler.superClass_.disposeInternal.call(this);this.detach()}; var goog$events$KeyEvent=function(a,b,c,d){d&&this.init(d,void 0);this.type="key";this.keyCode=a;this.charCode=b;this.repeat=c};goog$inherits(goog$events$KeyEvent,goog$events$BrowserEvent);var goog$a11y$aria$DefaultStateValueMap_,goog$a11y$aria$State={ACTIVEDESCENDANT:"activedescendant",ATOMIC:"atomic",AUTOCOMPLETE:"autocomplete",BUSY:"busy",CHECKED:"checked",CONTROLS:"controls",DESCRIBEDBY:"describedby",DISABLED:"disabled",DROPEFFECT:"dropeffect",EXPANDED:"expanded",FLOWTO:"flowto",GRABBED:"grabbed",HASPOPUP:"haspopup",HIDDEN:"hidden",INVALID:"invalid",LABEL:"label",LABELLEDBY:"labelledby",LEVEL:"level",LIVE:"live",MULTILINE:"multiline",MULTISELECTABLE:"multiselectable",ORIENTATION:"orientation", OWNS:"owns",POSINSET:"posinset",PRESSED:"pressed",READONLY:"readonly",RELEVANT:"relevant",REQUIRED:"required",SELECTED:"selected",SETSIZE:"setsize",SORT:"sort",VALUEMAX:"valuemax",VALUEMIN:"valuemin",VALUENOW:"valuenow",VALUETEXT:"valuetext"};var goog$a11y$aria$Role={ALERT:"alert",ALERTDIALOG:"alertdialog",APPLICATION:"application",ARTICLE:"article",BANNER:"banner",BUTTON:"button",CHECKBOX:"checkbox",COLUMNHEADER:"columnheader",COMBOBOX:"combobox",COMPLEMENTARY:"complementary",CONTENTINFO:"contentinfo",DEFINITION:"definition",DIALOG:"dialog",DIRECTORY:"directory",DOCUMENT:"document",FORM:"form",GRID:"grid",GRIDCELL:"gridcell",GROUP:"group",HEADING:"heading",IMG:"img",LINK:"link",LIST:"list",LISTBOX:"listbox",LISTITEM:"listitem",LOG:"log", MAIN:"main",MARQUEE:"marquee",MATH:"math",MENU:"menu",MENUBAR:"menubar",MENU_ITEM:"menuitem",MENU_ITEM_CHECKBOX:"menuitemcheckbox",MENU_ITEM_RADIO:"menuitemradio",NAVIGATION:"navigation",NOTE:"note",OPTION:"option",PRESENTATION:"presentation",PROGRESSBAR:"progressbar",RADIO:"radio",RADIOGROUP:"radiogroup",REGION:"region",ROW:"row",ROWGROUP:"rowgroup",ROWHEADER:"rowheader",SCROLLBAR:"scrollbar",SEARCH:"search",SEPARATOR:"separator",SLIDER:"slider",SPINBUTTON:"spinbutton",STATUS:"status",TAB:"tab", TAB_LIST:"tablist",TAB_PANEL:"tabpanel",TEXTBOX:"textbox",TIMER:"timer",TOOLBAR:"toolbar",TOOLTIP:"tooltip",TREE:"tree",TREEGRID:"treegrid",TREEITEM:"treeitem"};var goog$a11y$aria$setRole=function(a,b){b?(goog$asserts$assert(goog$object$containsValue(goog$a11y$aria$Role,b),"No such ARIA role "+b),a.setAttribute("role",b)):a.removeAttribute("role")},goog$a11y$aria$setState=function(a,b,c){if(goog$isArrayLike(c)){var d=c;c=d.join(" ")}d=goog$a11y$aria$getAriaAttributeName_(b);""===c||void 0==c?(goog$a11y$aria$DefaultStateValueMap_||(goog$a11y$aria$DefaultStateValueMap_=goog$object$create("atomic",!1,"autocomplete","none","dropeffect","none","haspopup",!1,"live", "off","multiline",!1,"multiselectable",!1,"orientation","vertical","readonly",!1,"relevant","additions text","required",!1,"sort","none","busy",!1,"disabled",!1,"hidden",!1,"invalid","false")),c=goog$a11y$aria$DefaultStateValueMap_,b in c?a.setAttribute(d,c[b]):a.removeAttribute(d)):a.setAttribute(d,c)},goog$a11y$aria$getState=function(a,b){var c=a.getAttribute(goog$a11y$aria$getAriaAttributeName_(b)),d=null==c||void 0==c;return d?"":String(c)},goog$a11y$aria$getAriaAttributeName_=function(a){goog$asserts$assert(a, "ARIA attribute cannot be empty.");goog$asserts$assert(goog$object$containsValue(goog$a11y$aria$State,a),"No such ARIA attribute "+a);return"aria-"+a};var goog$ui$ControlRenderer=function(){},goog$ui$ControlRenderer$ARIA_STATE_MAP_;goog$addSingletonGetter(goog$ui$ControlRenderer);goog$ui$ControlRenderer.prototype.getAriaRole=function(){};goog$ui$ControlRenderer.prototype.createDom=function(a){var b=a.getDomHelper().createDom("div",this.getClassNames(a).join(" "),a.getContent());this.setAriaStates(a,b);return b};goog$ui$ControlRenderer.prototype.getContentElement=function(a){return a}; goog$ui$ControlRenderer.prototype.enableClassName=function(a,b,c){if(a=a.getElement?a.getElement():a)if(goog$userAgent$IE&&!goog$userAgent$isVersionOrHigher("7")){var d=this.getAppliedCombinedClassNames_(goog$dom$classes$get(a),b);d.push(b);c=c?goog$dom$classes$add:goog$dom$classes$remove;goog$partial(c,a).apply(null,d)}else c?goog$dom$classes$add(a,b):goog$dom$classes$remove(a,b)};goog$ui$ControlRenderer.prototype.enableExtraClassName=function(a,b,c){this.enableClassName(a,b,c)}; goog$ui$ControlRenderer.prototype.canDecorate=function(){return!0}; goog$ui$ControlRenderer.prototype.decorate=function(a,b){b.id&&a.setId(b.id);var c=this.getContentElement(b);c&&c.firstChild?a.setContentInternal(c.firstChild.nextSibling?goog$array$clone(c.childNodes):c.firstChild):a.setContentInternal(null);var d=0,e=this.getCssClass(),f=this.getStructuralCssClass(),g=!1,h=!1,c=!1,k=goog$dom$classes$get(b);goog$array$forEach(k,function(a){!g&&a==e?(g=!0,f==e&&(h=!0)):!h&&a==f?h=!0:d|=this.getStateFromClass(a)},this);a.setStateInternal(d);g||(k.push(e),f==e&&(h= !0));h||k.push(f);var l=a.getExtraClassNames();l&&k.push.apply(k,l);if(goog$userAgent$IE&&!goog$userAgent$isVersionOrHigher("7")){var n=this.getAppliedCombinedClassNames_(k);0a?b-1:a},0)};goog$ui$Container.prototype.highlightNext=function(){this.highlightHelper(function(a,b){return(a+1)%b},this.highlightedIndex_)};goog$ui$Container.prototype.highlightPrevious=function(){this.highlightHelper(function(a,b){a--;return 0>a?b-1:a},this.highlightedIndex_)}; goog$ui$Container.prototype.highlightHelper=function(a,b){for(var c=0>b?this.indexOfChild(this.openItem_):b,d=this.getChildCount(),c=a.call(this,c,d),e=0;e<=d;){var f=this.getChildAt(c);if(f&&this.canHighlightItem(f))return this.setHighlightedIndexFromKeyEvent(c),!0;e++;c=a.call(this,c,d)}return!1};goog$ui$Container.prototype.canHighlightItem=function(a){return a.isVisible()&&a.isEnabled()&&a.isSupportedState(2)};goog$ui$Container.prototype.setHighlightedIndexFromKeyEvent=function(a){this.setHighlightedIndex(a)}; goog$ui$Container.prototype.isMouseButtonPressed=function(){return this.mouseButtonPressed_};goog$ui$Container.prototype.setMouseButtonPressed=function(a){this.mouseButtonPressed_=a};var goog$ui$MenuHeaderRenderer=function(){};goog$inherits(goog$ui$MenuHeaderRenderer,goog$ui$ControlRenderer);goog$addSingletonGetter(goog$ui$MenuHeaderRenderer);goog$ui$MenuHeaderRenderer.prototype.getCssClass=function(){return"goog-menuheader"};var goog$ui$MenuHeader=function(a,b,c){goog$ui$Control.call(this,a,c||goog$ui$MenuHeaderRenderer.getInstance(),b);this.setSupportedState(1,!1);this.setSupportedState(2,!1);this.setSupportedState(4,!1);this.setSupportedState(32,!1);this.setStateInternal(1)};goog$inherits(goog$ui$MenuHeader,goog$ui$Control);goog$ui$registry$setDecoratorByClassName("goog-menuheader",function(){return new goog$ui$MenuHeader(null)});var goog$ui$MenuSeparatorRenderer=function(){};goog$inherits(goog$ui$MenuSeparatorRenderer,goog$ui$ControlRenderer);goog$addSingletonGetter(goog$ui$MenuSeparatorRenderer);goog$ui$MenuSeparatorRenderer.prototype.createDom=function(a){return a.getDomHelper().createDom("div",this.getCssClass())}; goog$ui$MenuSeparatorRenderer.prototype.decorate=function(a,b){b.id&&a.setId(b.id);if("HR"==b.tagName){var c=b;b=this.createDom(a);c.parentNode&&c.parentNode.insertBefore(b,c);goog$dom$removeNode(c)}else goog$dom$classes$add(b,this.getCssClass());return b};goog$ui$MenuSeparatorRenderer.prototype.setContent=function(){};goog$ui$MenuSeparatorRenderer.prototype.getCssClass=function(){return"goog-menuseparator"};var goog$ui$Separator=function(a,b){goog$ui$Control.call(this,null,a||goog$ui$MenuSeparatorRenderer.getInstance(),b);this.setSupportedState(1,!1);this.setSupportedState(2,!1);this.setSupportedState(4,!1);this.setSupportedState(32,!1);this.setStateInternal(1)};goog$inherits(goog$ui$Separator,goog$ui$Control); goog$ui$Separator.prototype.enterDocument=function(){goog$ui$Separator.superClass_.enterDocument.call(this);var a=this.getElement();goog$asserts$assert(a,"The DOM element for the separator cannot be null.");goog$a11y$aria$setRole(a,"separator")};goog$ui$registry$setDecoratorByClassName("goog-menuseparator",function(){return new goog$ui$Separator});var goog$ui$MenuRenderer=function(){};goog$inherits(goog$ui$MenuRenderer,goog$ui$ContainerRenderer);goog$addSingletonGetter(goog$ui$MenuRenderer);goog$ui$MenuRenderer.prototype.getAriaRole=function(){return"menu"};goog$ui$MenuRenderer.prototype.canDecorate=function(a){return"UL"==a.tagName||goog$ui$MenuRenderer.superClass_.canDecorate.call(this,a)}; goog$ui$MenuRenderer.prototype.getDecoratorForChild=function(a){return"HR"==a.tagName?new goog$ui$Separator:goog$ui$MenuRenderer.superClass_.getDecoratorForChild.call(this,a)};goog$ui$MenuRenderer.prototype.containsElement=function(a,b){return goog$dom$contains(a.getElement(),b)};goog$ui$MenuRenderer.prototype.getCssClass=function(){return"goog-menu"}; goog$ui$MenuRenderer.prototype.initializeDom=function(a){goog$ui$MenuRenderer.superClass_.initializeDom.call(this,a);a=a.getElement();goog$asserts$assert(a,"The menu DOM element cannot be null.");goog$a11y$aria$setState(a,"haspopup","true")};var goog$ui$MenuSeparator=function(a){goog$ui$Separator.call(this,goog$ui$MenuSeparatorRenderer.getInstance(),a)};goog$inherits(goog$ui$MenuSeparator,goog$ui$Separator);goog$ui$registry$setDecoratorByClassName("goog-menuseparator",function(){return new goog$ui$Separator});var goog$ui$Menu=function(a,b){goog$ui$Container.call(this,"vertical",b||goog$ui$MenuRenderer.getInstance(),a);this.setFocusable(!1)};goog$inherits(goog$ui$Menu,goog$ui$Container);goog$ui$Menu.prototype.allowAutoFocus_=!0;goog$ui$Menu.prototype.allowHighlightDisabled_=!1;goog$ui$Menu.prototype.getCssClass=function(){return this.getRenderer().getCssClass()}; goog$ui$Menu.prototype.containsElement=function(a){if(this.getRenderer().containsElement(this,a))return!0;for(var b=0,c=this.getChildCount();ba?0:a,f=!1;do{++a;a==d&&(a=0,f=!0);var g=this.getChildAt(a).getCaption();if(g&&g.match(b))return a}while(!f||a!=e);return this.getHighlightedIndex()},this.getHighlightedIndex())};goog$ui$Menu.prototype.canHighlightItem=function(a){return(this.allowHighlightDisabled_||a.isEnabled())&&a.isVisible()&&a.isSupportedState(2)}; goog$ui$Menu.prototype.decorateInternal=function(a){this.decorateContent(a);goog$ui$Menu.superClass_.decorateInternal.call(this,a)};goog$ui$Menu.prototype.handleKeyEventInternal=function(a){var b=goog$ui$Menu.superClass_.handleKeyEventInternal.call(this,a);b||this.forEachChild(function(c){!b&&(c.getMnemonic&&c.getMnemonic()==a.keyCode)&&(this.isEnabled()&&this.setHighlighted(c),b=c.handleKeyEvent(a))},this);return b}; goog$ui$Menu.prototype.setHighlightedIndex=function(a){goog$ui$Menu.superClass_.setHighlightedIndex.call(this,a);if(a=this.getChildAt(a)){var b=a.getElement();a=this.getElement();b=goog$style$getContainerOffsetToScrollInto(b,a,void 0);a.scrollLeft=b.x;a.scrollTop=b.y}};goog$ui$Menu.prototype.decorateContent=function(a){var b=this.getRenderer();a=this.getDomHelper().getElementsByTagNameAndClass("div",b.getCssClass()+"-content",a);for(var c=a.length,d=0;dc?0:c,e=this.getMenu(),f=0,g=e.getChildCount();f function updateTosPrivacyLink(countryValue) { var labelElement = document.getElementById('terms-of-service-label'); if(countryValue == "DE") { labelElement.innerHTML = 'I agree to the Google \x3Ca target=\x22_blank\x22 id=\x22TosLink\x22 href=\x22https:\x2F\x2Faccounts.google.com\x2FTOS?loc=\x3C?cs var:GA.Request.inferredCountry ?\x3E\x26hl=\x3C?cs var:GA.Request.locale ?\x3E\x22\x3ETerms of Service\x3C\x2Fa\x3E and have read the \x3Ca target=\x22_blank\x22 id=\x22PrivacyLink\x22 href=\x22https:\x2F\x2Faccounts.google.com\x2FTOS?loc=\x3C?cs var:GA.Request.inferredCountry ?\x3E\x26hl=\x3C?cs var:GA.Request.locale ?\x3E\x26privacy=true\x22\x3EPrivacy Policy\x3C\x2Fa\x3E.'; } else { labelElement.innerHTML = 'I agree to the Google \x3Ca target=\x22_blank\x22 id=\x22TosLink\x22 href=\x22https:\x2F\x2Faccounts.google.com\x2FTOS?loc=\x3C?cs var:GA.Request.inferredCountry ?\x3E\x26hl=\x3C?cs var:GA.Request.locale ?\x3E\x22\x3ETerms of Service\x3C\x2Fa\x3E and \x3Ca target=\x22_blank\x22 id=\x22PrivacyLink\x22 href=\x22https:\x2F\x2Faccounts.google.com\x2FTOS?loc=\x3C?cs var:GA.Request.inferredCountry ?\x3E\x26hl=\x3C?cs var:GA.Request.locale ?\x3E\x26privacy=true\x22\x3EPrivacy Policy\x3C\x2Fa\x3E'; } var tosLinkAnchor = document.getElementById('TosLink'); tosLinkAnchor.href = "https://accounts.google.com/TOS?loc=" + countryValue + "&hl=en"; var privacyLinkAnchor = document.getElementById('PrivacyLink'); privacyLinkAnchor.href = "http://www.google.com/intl/en/privacy/"; privacyLinkAnchor.href = tosLinkAnchor.href + "&privacy=true"; } var birthMonthMenu, genderMenu, countryCodeMenu; function setJfkAccessibleTitle(element, titleId) { var title = document.getElementById(titleId).innerHTML; element.title = title; element.onmouseover = function() { element.title = ''; }; element.onmouseout = function() { element.title = title; }; } function renderJfkDropdown(id, titleId, selectedValue) { var dropdown = new gaia.Dropdown(id, selectedValue); setJfkAccessibleTitle(dropdown.getElement(), titleId); return dropdown; } birthMonthMenu = renderJfkDropdown('BirthMonth', 'BirthdayLabel', ''); genderMenu = renderJfkDropdown('Gender', 'GenderLabel', ''); countryCodeMenu = renderJfkDropdown('CountryCode', 'CountryCodeLabel', 'US'); countryCodeMenu.addEventListener('change', function() { updateTosPrivacyLink(document.getElementById('HiddenCountryCode').value); }); var gaia_renderPhoneInput = function() { var countryCode = ''; if (!countryCode) { countryCode = 'US'; } var recoveryPhone = document.getElementById('RecoveryPhoneNumber'); if (recoveryPhone) { var recoveryPhoneCountry = document.getElementById('RecoveryPhoneCountry'); var callingCode = G_renderPhoneNumberInput( recoveryPhone, countryCode.toLowerCase(), [ {countryCode: 'AF', name: 'Afghanistan (‫افغانستان‬‎)', label: 'Afghanistan (‫افغانستان‬‎)' }, {countryCode: 'AX', name: 'Åland Islands (Åland)', label: 'Åland Islands (Åland)' }, {countryCode: 'AL', name: 'Albania (Shqipëria)', label: 'Albania (Shqipëria)' }, {countryCode: 'DZ', name: 'Algeria (‫الجزائر‬‎)', label: 'Algeria (‫الجزائر‬‎)' }, {countryCode: 'AS', name: 'American Samoa', label: 'American Samoa' }, {countryCode: 'AD', name: 'Andorra', label: 'Andorra' }, {countryCode: 'AO', name: 'Angola', label: 'Angola' }, {countryCode: 'AI', name: 'Anguilla', label: 'Anguilla' }, {countryCode: 'AQ', name: 'Antarctica', label: 'Antarctica' }, {countryCode: 'AG', name: 'Antigua and Barbuda', label: 'Antigua and Barbuda' }, {countryCode: 'AR', name: 'Argentina', label: 'Argentina' }, {countryCode: 'AM', name: 'Armenia (Հայաստան)', label: 'Armenia (Հայաստան)' }, {countryCode: 'AW', name: 'Aruba', label: 'Aruba' }, {countryCode: 'AC', name: 'Ascension Island', label: 'Ascension Island' }, {countryCode: 'AU', name: 'Australia', label: 'Australia' }, {countryCode: 'AT', name: 'Austria (Österreich)', label: 'Austria (Österreich)' }, {countryCode: 'AZ', name: 'Azerbaijan (Azərbaycan)', label: 'Azerbaijan (Azərbaycan)' }, {countryCode: 'BS', name: 'Bahamas', label: 'Bahamas' }, {countryCode: 'BH', name: 'Bahrain (‫البحرين‬‎)', label: 'Bahrain (‫البحرين‬‎)' }, {countryCode: 'BD', name: 'Bangladesh (বাংলাদেশ)', label: 'Bangladesh (বাংলাদেশ)' }, {countryCode: 'BB', name: 'Barbados', label: 'Barbados' }, {countryCode: 'BY', name: 'Belarus (Беларусь)', label: 'Belarus (Беларусь)' }, {countryCode: 'BE', name: 'Belgium (België)', label: 'Belgium (België)' }, {countryCode: 'BZ', name: 'Belize', label: 'Belize' }, {countryCode: 'BJ', name: 'Benin (Bénin)', label: 'Benin (Bénin)' }, {countryCode: 'BM', name: 'Bermuda', label: 'Bermuda' }, {countryCode: 'BT', name: 'Bhutan (འབྲུག)', label: 'Bhutan (འབྲུག)' }, {countryCode: 'BO', name: 'Bolivia', label: 'Bolivia' }, {countryCode: 'BA', name: 'Bosnia and Herzegovina (Босна и Херцеговина)', label: 'Bosnia and Herzegovina (Босна и Херцеговина)' }, {countryCode: 'BW', name: 'Botswana', label: 'Botswana' }, {countryCode: 'BV', name: 'Bouvet Island', label: 'Bouvet Island' }, {countryCode: 'BR', name: 'Brazil (Brasil)', label: 'Brazil (Brasil)' }, {countryCode: 'IO', name: 'British Indian Ocean Territory', label: 'British Indian Ocean Territory' }, {countryCode: 'VG', name: 'British Virgin Islands', label: 'British Virgin Islands' }, {countryCode: 'BN', name: 'Brunei', label: 'Brunei' }, {countryCode: 'BG', name: 'Bulgaria (България)', label: 'Bulgaria (България)' }, {countryCode: 'BF', name: 'Burkina Faso', label: 'Burkina Faso' }, {countryCode: 'BI', name: 'Burundi (Uburundi)', label: 'Burundi (Uburundi)' }, {countryCode: 'KH', name: 'Cambodia (កម្ពុជា)', label: 'Cambodia (កម្ពុជា)' }, {countryCode: 'CM', name: 'Cameroon (Cameroun)', label: 'Cameroon (Cameroun)' }, {countryCode: 'CA', name: 'Canada', label: 'Canada' }, {countryCode: 'IC', name: 'Canary Islands (Islas Canarias)', label: 'Canary Islands (Islas Canarias)' }, {countryCode: 'CV', name: 'Cape Verde (Kabu Verdi)', label: 'Cape Verde (Kabu Verdi)' }, {countryCode: 'BQ', name: 'Caribbean Netherlands', label: 'Caribbean Netherlands' }, {countryCode: 'KY', name: 'Cayman Islands', label: 'Cayman Islands' }, {countryCode: 'CF', name: 'Central African Republic (République centrafricaine)', label: 'Central African Republic (République centrafricaine)' }, {countryCode: 'EA', name: 'Ceuta and Melilla (Ceuta y Melilla)', label: 'Ceuta and Melilla (Ceuta y Melilla)' }, {countryCode: 'TD', name: 'Chad (Tchad)', label: 'Chad (Tchad)' }, {countryCode: 'CL', name: 'Chile', label: 'Chile' }, {countryCode: 'CN', name: 'China (中国)', label: 'China (中国)' }, {countryCode: 'CX', name: 'Christmas Island', label: 'Christmas Island' }, {countryCode: 'CP', name: 'Clipperton Island (Île Clipperton)', label: 'Clipperton Island (Île Clipperton)' }, {countryCode: 'CC', name: 'Cocos [Keeling] Islands', label: 'Cocos [Keeling] Islands' }, {countryCode: 'CO', name: 'Colombia', label: 'Colombia' }, {countryCode: 'KM', name: 'Comoros (‫جزر القمر‬‎)', label: 'Comoros (‫جزر القمر‬‎)' }, {countryCode: 'CD', name: 'Congo [DRC] (Jamhuri ya Kidemokrasia ya Kongo)', label: 'Congo [DRC] (Jamhuri ya Kidemokrasia ya Kongo)' }, {countryCode: 'CG', name: 'Congo [Republic] (Congo-Brazzaville)', label: 'Congo [Republic] (Congo-Brazzaville)' }, {countryCode: 'CK', name: 'Cook Islands', label: 'Cook Islands' }, {countryCode: 'CR', name: 'Costa Rica', label: 'Costa Rica' }, {countryCode: 'CI', name: 'Côte d’Ivoire', label: 'Côte d’Ivoire' }, {countryCode: 'HR', name: 'Croatia (Hrvatska)', label: 'Croatia (Hrvatska)' }, {countryCode: 'CU', name: 'Cuba', label: 'Cuba' }, {countryCode: 'CW', name: 'Curaçao', label: 'Curaçao' }, {countryCode: 'CY', name: 'Cyprus (Κύπρος)', label: 'Cyprus (Κύπρος)' }, {countryCode: 'CZ', name: 'Czech Republic (Česká republika)', label: 'Czech Republic (Česká republika)' }, {countryCode: 'DK', name: 'Denmark (Danmark)', label: 'Denmark (Danmark)' }, {countryCode: 'DG', name: 'Diego Garcia', label: 'Diego Garcia' }, {countryCode: 'DJ', name: 'Djibouti', label: 'Djibouti' }, {countryCode: 'DM', name: 'Dominica', label: 'Dominica' }, {countryCode: 'DO', name: 'Dominican Republic (República Dominicana)', label: 'Dominican Republic (República Dominicana)' }, {countryCode: 'EC', name: 'Ecuador', label: 'Ecuador' }, {countryCode: 'EG', name: 'Egypt (‫مصر‬‎)', label: 'Egypt (‫مصر‬‎)' }, {countryCode: 'SV', name: 'El Salvador', label: 'El Salvador' }, {countryCode: 'GQ', name: 'Equatorial Guinea (Guinea Ecuatorial)', label: 'Equatorial Guinea (Guinea Ecuatorial)' }, {countryCode: 'ER', name: 'Eritrea', label: 'Eritrea' }, {countryCode: 'EE', name: 'Estonia (Eesti)', label: 'Estonia (Eesti)' }, {countryCode: 'ET', name: 'Ethiopia', label: 'Ethiopia' }, {countryCode: 'FK', name: 'Falkland Islands [Islas Malvinas]', label: 'Falkland Islands [Islas Malvinas]' }, {countryCode: 'FO', name: 'Faroe Islands (Føroyar)', label: 'Faroe Islands (Føroyar)' }, {countryCode: 'FJ', name: 'Fiji', label: 'Fiji' }, {countryCode: 'FI', name: 'Finland (Suomi)', label: 'Finland (Suomi)' }, {countryCode: 'FR', name: 'France', label: 'France' }, {countryCode: 'GF', name: 'French Guiana (Guyane française)', label: 'French Guiana (Guyane française)' }, {countryCode: 'PF', name: 'French Polynesia (Polynésie française)', label: 'French Polynesia (Polynésie française)' }, {countryCode: 'TF', name: 'French Southern Territories (Terres australes françaises)', label: 'French Southern Territories (Terres australes françaises)' }, {countryCode: 'GA', name: 'Gabon', label: 'Gabon' }, {countryCode: 'GM', name: 'Gambia', label: 'Gambia' }, {countryCode: 'GE', name: 'Georgia (საქართველო)', label: 'Georgia (საქართველო)' }, {countryCode: 'DE', name: 'Germany (Deutschland)', label: 'Germany (Deutschland)' }, {countryCode: 'GH', name: 'Ghana (Gaana)', label: 'Ghana (Gaana)' }, {countryCode: 'GI', name: 'Gibraltar', label: 'Gibraltar' }, {countryCode: 'GR', name: 'Greece (Ελλάδα)', label: 'Greece (Ελλάδα)' }, {countryCode: 'GL', name: 'Greenland (Kalaallit Nunaat)', label: 'Greenland (Kalaallit Nunaat)' }, {countryCode: 'GD', name: 'Grenada', label: 'Grenada' }, {countryCode: 'GP', name: 'Guadeloupe', label: 'Guadeloupe' }, {countryCode: 'GU', name: 'Guam', label: 'Guam' }, {countryCode: 'GT', name: 'Guatemala', label: 'Guatemala' }, {countryCode: 'GG', name: 'Guernsey', label: 'Guernsey' }, {countryCode: 'GN', name: 'Guinea (Guinée)', label: 'Guinea (Guinée)' }, {countryCode: 'GW', name: 'Guinea-Bissau (Guiné Bissau)', label: 'Guinea-Bissau (Guiné Bissau)' }, {countryCode: 'GY', name: 'Guyana', label: 'Guyana' }, {countryCode: 'HT', name: 'Haiti', label: 'Haiti' }, {countryCode: 'HM', name: 'Heard Island and McDonald Islands', label: 'Heard Island and McDonald Islands' }, {countryCode: 'HN', name: 'Honduras', label: 'Honduras' }, {countryCode: 'HK', name: 'Hong Kong (香港)', label: 'Hong Kong (香港)' }, {countryCode: 'HU', name: 'Hungary (Magyarország)', label: 'Hungary (Magyarország)' }, {countryCode: 'IS', name: 'Iceland (Ísland)', label: 'Iceland (Ísland)' }, {countryCode: 'IN', name: 'India (भारत)', label: 'India (भारत)' }, {countryCode: 'ID', name: 'Indonesia', label: 'Indonesia' }, {countryCode: 'IR', name: 'Iran (‫ایران‬‎)', label: 'Iran (‫ایران‬‎)' }, {countryCode: 'IQ', name: 'Iraq (‫العراق‬‎)', label: 'Iraq (‫العراق‬‎)' }, {countryCode: 'IE', name: 'Ireland', label: 'Ireland' }, {countryCode: 'IM', name: 'Isle of Man', label: 'Isle of Man' }, {countryCode: 'IL', name: 'Israel (‫ישראל‬‎)', label: 'Israel (‫ישראל‬‎)' }, {countryCode: 'IT', name: 'Italy (Italia)', label: 'Italy (Italia)' }, {countryCode: 'JM', name: 'Jamaica', label: 'Jamaica' }, {countryCode: 'JP', name: 'Japan (日本)', label: 'Japan (日本)' }, {countryCode: 'JE', name: 'Jersey', label: 'Jersey' }, {countryCode: 'JO', name: 'Jordan (‫الأردن‬‎)', label: 'Jordan (‫الأردن‬‎)' }, {countryCode: 'KZ', name: 'Kazakhstan (Казахстан)', label: 'Kazakhstan (Казахстан)' }, {countryCode: 'KE', name: 'Kenya', label: 'Kenya' }, {countryCode: 'KI', name: 'Kiribati', label: 'Kiribati' }, {countryCode: 'XK', name: 'Kosovo (Косово)', label: 'Kosovo (Косово)' }, {countryCode: 'KW', name: 'Kuwait (‫الكويت‬‎)', label: 'Kuwait (‫الكويت‬‎)' }, {countryCode: 'KG', name: 'Kyrgyzstan', label: 'Kyrgyzstan' }, {countryCode: 'LA', name: 'Laos (ສ.ປ.ປ ລາວ)', label: 'Laos (ສ.ປ.ປ ລາວ)' }, {countryCode: 'LV', name: 'Latvia (Latvija)', label: 'Latvia (Latvija)' }, {countryCode: 'LB', name: 'Lebanon (‫لبنان‬‎)', label: 'Lebanon (‫لبنان‬‎)' }, {countryCode: 'LS', name: 'Lesotho', label: 'Lesotho' }, {countryCode: 'LR', name: 'Liberia', label: 'Liberia' }, {countryCode: 'LY', name: 'Libya (‫ليبيا‬‎)', label: 'Libya (‫ليبيا‬‎)' }, {countryCode: 'LI', name: 'Liechtenstein', label: 'Liechtenstein' }, {countryCode: 'LT', name: 'Lithuania (Lietuva)', label: 'Lithuania (Lietuva)' }, {countryCode: 'LU', name: 'Luxembourg', label: 'Luxembourg' }, {countryCode: 'MO', name: 'Macau (澳門)', label: 'Macau (澳門)' }, {countryCode: 'MK', name: 'Macedonia [FYROM] (Македонија)', label: 'Macedonia [FYROM] (Македонија)' }, {countryCode: 'MG', name: 'Madagascar (Madagasikara)', label: 'Madagascar (Madagasikara)' }, {countryCode: 'MW', name: 'Malawi', label: 'Malawi' }, {countryCode: 'MY', name: 'Malaysia', label: 'Malaysia' }, {countryCode: 'MV', name: 'Maldives', label: 'Maldives' }, {countryCode: 'ML', name: 'Mali', label: 'Mali' }, {countryCode: 'MT', name: 'Malta', label: 'Malta' }, {countryCode: 'MH', name: 'Marshall Islands', label: 'Marshall Islands' }, {countryCode: 'MQ', name: 'Martinique', label: 'Martinique' }, {countryCode: 'MR', name: 'Mauritania (‫موريتانيا‬‎)', label: 'Mauritania (‫موريتانيا‬‎)' }, {countryCode: 'MU', name: 'Mauritius (Moris)', label: 'Mauritius (Moris)' }, {countryCode: 'YT', name: 'Mayotte', label: 'Mayotte' }, {countryCode: 'MX', name: 'Mexico (México)', label: 'Mexico (México)' }, {countryCode: 'FM', name: 'Micronesia', label: 'Micronesia' }, {countryCode: 'MD', name: 'Moldova (Republica Moldova)', label: 'Moldova (Republica Moldova)' }, {countryCode: 'MC', name: 'Monaco', label: 'Monaco' }, {countryCode: 'MN', name: 'Mongolia (Монгол)', label: 'Mongolia (Монгол)' }, {countryCode: 'ME', name: 'Montenegro (Crna Gora)', label: 'Montenegro (Crna Gora)' }, {countryCode: 'MS', name: 'Montserrat', label: 'Montserrat' }, {countryCode: 'MA', name: 'Morocco (‫المغرب‬‎)', label: 'Morocco (‫المغرب‬‎)' }, {countryCode: 'MZ', name: 'Mozambique (Moçambique)', label: 'Mozambique (Moçambique)' }, {countryCode: 'MM', name: 'Myanmar [Burma] (မြန်မာ)', label: 'Myanmar [Burma] (မြန်မာ)' }, {countryCode: 'NA', name: 'Namibia', label: 'Namibia' }, {countryCode: 'NR', name: 'Nauru', label: 'Nauru' }, {countryCode: 'NP', name: 'Nepal (नेपाल)', label: 'Nepal (नेपाल)' }, {countryCode: 'NL', name: 'Netherlands (Nederland)', label: 'Netherlands (Nederland)' }, {countryCode: 'NC', name: 'New Caledonia (Nouvelle-Calédonie)', label: 'New Caledonia (Nouvelle-Calédonie)' }, {countryCode: 'NZ', name: 'New Zealand', label: 'New Zealand' }, {countryCode: 'NI', name: 'Nicaragua', label: 'Nicaragua' }, {countryCode: 'NE', name: 'Niger (Nijar)', label: 'Niger (Nijar)' }, {countryCode: 'NG', name: 'Nigeria', label: 'Nigeria' }, {countryCode: 'NU', name: 'Niue', label: 'Niue' }, {countryCode: 'NF', name: 'Norfolk Island', label: 'Norfolk Island' }, {countryCode: 'MP', name: 'Northern Mariana Islands', label: 'Northern Mariana Islands' }, {countryCode: 'KP', name: 'North Korea (조선 민주주의 인민 공화국)', label: 'North Korea (조선 민주주의 인민 공화국)' }, {countryCode: 'NO', name: 'Norway (Norge)', label: 'Norway (Norge)' }, {countryCode: 'OM', name: 'Oman (‫عُمان‬‎)', label: 'Oman (‫عُمان‬‎)' }, {countryCode: 'PK', name: 'Pakistan (‫پاکستان‬‎)', label: 'Pakistan (‫پاکستان‬‎)' }, {countryCode: 'PW', name: 'Palau', label: 'Palau' }, {countryCode: 'PS', name: 'Palestine (‫فلسطين‬‎)', label: 'Palestine (‫فلسطين‬‎)' }, {countryCode: 'PA', name: 'Panama (Panamá)', label: 'Panama (Panamá)' }, {countryCode: 'PG', name: 'Papua New Guinea', label: 'Papua New Guinea' }, {countryCode: 'PY', name: 'Paraguay', label: 'Paraguay' }, {countryCode: 'PE', name: 'Peru (Perú)', label: 'Peru (Perú)' }, {countryCode: 'PH', name: 'Philippines', label: 'Philippines' }, {countryCode: 'PN', name: 'Pitcairn Islands', label: 'Pitcairn Islands' }, {countryCode: 'PL', name: 'Poland (Polska)', label: 'Poland (Polska)' }, {countryCode: 'PT', name: 'Portugal', label: 'Portugal' }, {countryCode: 'PR', name: 'Puerto Rico', label: 'Puerto Rico' }, {countryCode: 'QA', name: 'Qatar (‫قطر‬‎)', label: 'Qatar (‫قطر‬‎)' }, {countryCode: 'RE', name: 'Réunion', label: 'Réunion' }, {countryCode: 'RO', name: 'Romania (România)', label: 'Romania (România)' }, {countryCode: 'RU', name: 'Russia (Россия)', label: 'Russia (Россия)' }, {countryCode: 'RW', name: 'Rwanda', label: 'Rwanda' }, {countryCode: 'BL', name: 'Saint Barthélemy (Saint-Barthélémy)', label: 'Saint Barthélemy (Saint-Barthélémy)' }, {countryCode: 'SH', name: 'Saint Helena', label: 'Saint Helena' }, {countryCode: 'KN', name: 'Saint Kitts and Nevis', label: 'Saint Kitts and Nevis' }, {countryCode: 'LC', name: 'Saint Lucia', label: 'Saint Lucia' }, {countryCode: 'MF', name: 'Saint Martin (Saint-Martin [partie française])', label: 'Saint Martin (Saint-Martin [partie française])' }, {countryCode: 'PM', name: 'Saint Pierre and Miquelon (Saint-Pierre-et-Miquelon)', label: 'Saint Pierre and Miquelon (Saint-Pierre-et-Miquelon)' }, {countryCode: 'VC', name: 'Saint Vincent and the Grenadines', label: 'Saint Vincent and the Grenadines' }, {countryCode: 'WS', name: 'Samoa', label: 'Samoa' }, {countryCode: 'SM', name: 'San Marino', label: 'San Marino' }, {countryCode: 'ST', name: 'São Tomé and Príncipe (São Tomé e Príncipe)', label: 'São Tomé and Príncipe (São Tomé e Príncipe)' }, {countryCode: 'SA', name: 'Saudi Arabia (‫المملكة العربية السعودية‬‎)', label: 'Saudi Arabia (‫المملكة العربية السعودية‬‎)' }, {countryCode: 'SN', name: 'Senegal (Sénégal)', label: 'Senegal (Sénégal)' }, {countryCode: 'RS', name: 'Serbia (Србија)', label: 'Serbia (Србија)' }, {countryCode: 'SC', name: 'Seychelles', label: 'Seychelles' }, {countryCode: 'SL', name: 'Sierra Leone', label: 'Sierra Leone' }, {countryCode: 'SG', name: 'Singapore', label: 'Singapore' }, {countryCode: 'SX', name: 'Sint Maarten', label: 'Sint Maarten' }, {countryCode: 'SK', name: 'Slovakia (Slovensko)', label: 'Slovakia (Slovensko)' }, {countryCode: 'SI', name: 'Slovenia (Slovenija)', label: 'Slovenia (Slovenija)' }, {countryCode: 'SB', name: 'Solomon Islands', label: 'Solomon Islands' }, {countryCode: 'SO', name: 'Somalia (Soomaaliya)', label: 'Somalia (Soomaaliya)' }, {countryCode: 'ZA', name: 'South Africa', label: 'South Africa' }, {countryCode: 'GS', name: 'South Georgia and the South Sandwich Islands', label: 'South Georgia and the South Sandwich Islands' }, {countryCode: 'KR', name: 'South Korea (대한민국)', label: 'South Korea (대한민국)' }, {countryCode: 'SS', name: 'South Sudan (‫جنوب السودان‬‎)', label: 'South Sudan (‫جنوب السودان‬‎)' }, {countryCode: 'ES', name: 'Spain (España)', label: 'Spain (España)' }, {countryCode: 'LK', name: 'Sri Lanka (ශ්‍රී ලංකාව)', label: 'Sri Lanka (ශ්‍රී ලංකාව)' }, {countryCode: 'SD', name: 'Sudan (‫السودان‬‎)', label: 'Sudan (‫السودان‬‎)' }, {countryCode: 'SR', name: 'Suriname', label: 'Suriname' }, {countryCode: 'SJ', name: 'Svalbard and Jan Mayen (Svalbard og Jan Mayen)', label: 'Svalbard and Jan Mayen (Svalbard og Jan Mayen)' }, {countryCode: 'SZ', name: 'Swaziland', label: 'Swaziland' }, {countryCode: 'SE', name: 'Sweden (Sverige)', label: 'Sweden (Sverige)' }, {countryCode: 'CH', name: 'Switzerland (Schweiz)', label: 'Switzerland (Schweiz)' }, {countryCode: 'SY', name: 'Syria (‫سوريا‬‎)', label: 'Syria (‫سوريا‬‎)' }, {countryCode: 'TW', name: 'Taiwan (台灣)', label: 'Taiwan (台灣)' }, {countryCode: 'TJ', name: 'Tajikistan', label: 'Tajikistan' }, {countryCode: 'TZ', name: 'Tanzania', label: 'Tanzania' }, {countryCode: 'TH', name: 'Thailand (ไทย)', label: 'Thailand (ไทย)' }, {countryCode: 'TL', name: 'Timor-Leste', label: 'Timor-Leste' }, {countryCode: 'TG', name: 'Togo', label: 'Togo' }, {countryCode: 'TK', name: 'Tokelau', label: 'Tokelau' }, {countryCode: 'TO', name: 'Tonga', label: 'Tonga' }, {countryCode: 'TT', name: 'Trinidad and Tobago', label: 'Trinidad and Tobago' }, {countryCode: 'TA', name: 'Tristan da Cunha', label: 'Tristan da Cunha' }, {countryCode: 'TN', name: 'Tunisia (‫تونس‬‎)', label: 'Tunisia (‫تونس‬‎)' }, {countryCode: 'TR', name: 'Turkey (Türkiye)', label: 'Turkey (Türkiye)' }, {countryCode: 'TM', name: 'Turkmenistan', label: 'Turkmenistan' }, {countryCode: 'TC', name: 'Turks and Caicos Islands', label: 'Turks and Caicos Islands' }, {countryCode: 'TV', name: 'Tuvalu', label: 'Tuvalu' }, {countryCode: 'UM', name: 'U.S. Outlying Islands', label: 'U.S. Outlying Islands' }, {countryCode: 'VI', name: 'U.S. Virgin Islands', label: 'U.S. Virgin Islands' }, {countryCode: 'UG', name: 'Uganda', label: 'Uganda' }, {countryCode: 'UA', name: 'Ukraine (Україна)', label: 'Ukraine (Україна)' }, {countryCode: 'AE', name: 'United Arab Emirates (‫الإمارات العربية المتحدة‬‎)', label: 'United Arab Emirates (‫الإمارات العربية المتحدة‬‎)' }, {countryCode: 'GB', name: 'United Kingdom', label: 'United Kingdom' }, {countryCode: 'US', name: 'United States', label: 'United States' }, {countryCode: 'UY', name: 'Uruguay', label: 'Uruguay' }, {countryCode: 'UZ', name: 'Uzbekistan (Ўзбекистон)', label: 'Uzbekistan (Ўзбекистон)' }, {countryCode: 'VU', name: 'Vanuatu', label: 'Vanuatu' }, {countryCode: 'VA', name: 'Vatican City (Città del Vaticano)', label: 'Vatican City (Città del Vaticano)' }, {countryCode: 'VE', name: 'Venezuela', label: 'Venezuela' }, {countryCode: 'VN', name: 'Vietnam (Việt Nam)', label: 'Vietnam (Việt Nam)' }, {countryCode: 'WF', name: 'Wallis and Futuna', label: 'Wallis and Futuna' }, {countryCode: 'EH', name: 'Western Sahara (‫الصحراء الغربية‬‎)', label: 'Western Sahara (‫الصحراء الغربية‬‎)' }, {countryCode: 'YE', name: 'Yemen (‫اليمن‬‎)', label: 'Yemen (‫اليمن‬‎)' }, {countryCode: 'ZM', name: 'Zambia', label: 'Zambia' }, {countryCode: 'ZW', name: 'Zimbabwe', label: 'Zimbabwe' } ]); if (!recoveryPhone.value && callingCode != 1) { recoveryPhone.value = '+' + callingCode; } var countryCodeDropDownElement = G_numberInputWidget.getElement() .getElementsByTagName('th')[0] .getElementsByTagName('div')[0]; setJfkAccessibleTitle(countryCodeDropDownElement, 'RecoveryPhoneNumberLabel'); recoveryPhoneCountry.value = G_getPhoneCountryCode().toUpperCase(); gaia_attachEvent(recoveryPhone, 'blur', function() { recoveryPhoneCountry.value = G_getPhoneCountryCode().toUpperCase(); }); } }; gaia_renderPhoneInput(); var gaia_getNonDefaultPhoneInputValue = function() { var defaultValue = '+' + G_getPhoneCallingCode(); // Trim leading and trailing whitespace. var value = inputHolders.recoveryPhone.value().replace(/^\s+|\s+$/g, ''); if (defaultValue == value) { return ''; } else { return value; } }; var gaia_phoneNumberOnSubmit = function() { inputHolders.recoveryPhone.inputForValue.value = gaia_getNonDefaultPhoneInputValue(); }; var gaiaBubble = new gaia.Bubble(); gaiaBubble.disableJfk = false; gaiaBubble.position = jfk.PopupPosition.LEFT; var newInputHolder = function(id, jfkInput) { if (document.getElementById(id)) { return new InputHolder(id, jfkInput); } }; var InputHolder = function(id, jfkInput) { var input = document.getElementById(id); this.inputForId = input; if (jfkInput) { this.inputForValue = document.getElementById('Hidden' + id); this.inputForEvents = jfkInput.getElement(); } else { this.inputForValue = input; this.inputForEvents = input; } this.prevalidationHandlers = []; this.error = document.getElementById('errormsg_0_' + id); var inputHolder = this; this.attachRemoveErrorHandler(function() { inputHolder.clearErrorMessage(); }); } InputHolder.prototype.id = function() { return this.inputForId.id; }; InputHolder.prototype.value = function() { return this.inputForValue.value; }; InputHolder.prototype.attachEvent = function(event, handler) { gaia_attachEvent(this.inputForEvents, event, handler, false); }; InputHolder.prototype.attachPrevalidationHandler = function(handler) { this.prevalidationHandlers.push(handler); }; InputHolder.prototype.attachValidationHandler = function(handler) { this.attachEvent('blur', handler); }; InputHolder.prototype.attachRemoveErrorHandler = function(handler) { this.attachEvent('focus', handler); this.attachEvent('keydown', handler); this.attachEvent('click', handler); }; InputHolder.prototype.attachRemoveDuplicateErrorsHandler = function(handler) { this.removeDuplicateErrorsHandler = handler; }; InputHolder.prototype.setInfoMessage = function(messageId, anchorId) { var message = document.getElementById(messageId); if (gaiaBubble.disableJfk) { this.attachEvent('focus', function() { message.style.display = 'block'; }); this.attachEvent('keyup', function() { message.style.display = 'block'; }); } else { var anchorNode = this.inputForEvents.parentNode; if (anchorId) { anchorNode = document.getElementById(anchorId); } while (anchorNode) { var anchorNodeStyle = anchorNode.currentStyle || window.getComputedStyle(anchorNode, ''); if (anchorNodeStyle && (anchorNodeStyle.display == 'block' || anchorNodeStyle.display == 'inline-block')) { break; } anchorNode = anchorNode.parentNode; } if (!anchorNode) { anchorNode = this.inputForEvents.parentNode; } gaiaBubble.init(this.inputForEvents, message, anchorNode, gaiaBubble.position); message.parentNode.removeChild(message); } }; InputHolder.prototype.setPlaceHolder = function(placeHolderId) { var placeHolder = document.getElementById(placeHolderId); var inputForValue = this.inputForValue; if (!inputForValue.value) { placeHolder.style.display = 'block'; } this.attachEvent('keydown', function() { placeHolder.style.display = 'none'; }); // Clear hint text when user pastes a value using right-click menu. this.attachEvent('input', function() { if (!inputForValue.value) { placeHolder.style.display = 'block'; } else { placeHolder.style.display = 'none'; } }); this.attachEvent('blur', function() { if (!inputForValue.value) { placeHolder.style.display = 'block'; } }); }; InputHolder.prototype.setHandler = function(handler) { gaia_attachEvent(this.inputForEvents, 'blur', handler, false); }; InputHolder.prototype.hasErrorMessage = function() { if (gaia_hasInnerTextProperty) { return this.error.innerText.replace(/\s*/, '').length > 0; } else { return this.error.textContent.replace(/\s*/, '').length > 0; } }; InputHolder.prototype.getErrorMessage = function() { return this.error.innerHTML; }; InputHolder.prototype.setError = function(error) { if (typeof(error) == 'string') { this.setErrorMessage(error); } else if (error.nodeType) { this.setErrorMessage(error.innerHTML); } else if (error[this.id()]) { this.setErrorMessage(error[this.id()]); } }; InputHolder.prototype.setErrorMessage = function(message) { this.inputForId.className = this.inputForId.className + ' form-error'; this.inputForId.setAttribute('aria-invalid', 'true'); this.error.style.display = ''; this.error.innerHTML = message; if (this.removeDuplicateErrorsHandler) { this.removeDuplicateErrorsHandler(this); } // Update info bubble position in case the anchor element has shifted due to // display of an error message. gaiaBubble.reposition(); }; InputHolder.prototype.clearErrorMessage = function() { this.error.innerHTML = ''; var input = this.inputForId; if (input.className) { var indexOfFormError = input.className.indexOf('form-error'); if (indexOfFormError >= 0) { input.className = input.className.substring(0, indexOfFormError); } } if (input.getAttribute('aria-invalid')) { input.setAttribute('aria-invalid', 'false'); } }; InputHolder.prototype.isNullOrEmpty = function() { return (this.inputForValue.value == null || this.inputForValue.value == ""); }; InputHolder.prototype.prefill = function() { try { if (this.isNullOrEmpty() && location.hash) { var params = decodeURIComponent(location.hash.substring(1)).split('&'); for (var i = 0; i < params.length; i++) { var param = params[i].split('='); if (this.id() == param[0] && param[1]) { this.inputForValue.value = param[1]; return; } } } } catch (e) {} }; var gaia_initPasswordStrengthMeter = function(inputHolders, ratingMessages) { inputHolders.passwd.previousValue = ''; inputHolders.passwd.attachEvent('keyup', inputHandler); inputHolders.passwd.attachEvent('focus', inputHandler); inputHolders.passwd.setInfoMessage('password-infomessage'); function inputHandler() { if (inputHolders.passwd.value().length < 8) { updatePasswordBar(0); } else if (inputHolders.passwd.value() != inputHolders.passwd.previousValue) { var request = new gaia.ajax.XmlHttpFormRequest(); request.parameters['Passwd'] = inputHolders.passwd.value(); if (inputHolders.gmailAddress) { request.parameters['Email'] = inputHolders.gmailAddress.value(); } if (inputHolders.firstName && inputHolders.lastName) { request.parameters['FirstName'] = inputHolders.firstName.value(); request.parameters['LastName'] = inputHolders.lastName.value(); } request.oncomplete = function(response){ updatePasswordBar(response.text); }; request.send('RatePassword'); inputHolders.passwd.previousValue = inputHolders.passwd.value(); } } function updatePasswordBar(rating) { var ratingClasses = new Array(6); ratingClasses[0] = 'short'; ratingClasses[1] = 'weak'; ratingClasses[2] = 'fair'; ratingClasses[3] = 'good'; ratingClasses[4] = 'strong'; ratingClasses[5] = 'notRated'; var bar = document.getElementById('strength-bar'); if (bar) { var message = document.getElementById('passwdRating'); var barLength = document.getElementById('passwdBar').clientWidth; bar.className = ratingClasses[rating]; if (rating >= 0 && rating <= 4) { bar.style.width = (barLength * (parseInt(rating) + 1.0) / 5.0) + 'px'; message.innerHTML = ratingMessages[rating]; } else { bar.style.width = 0; rating = 5; } } } }; function registerValidationHandler(inputs, validateInputFunction, getValuesAsJsonFunction, handleValidationResponseFunction) { function handleValidationResponse(errors, data) { for (var i = 0; i < inputs.length; i++) { inputs[i].setError(errors); } } function validate(input) { return function() { for (var i = 0; i < input.prevalidationHandlers.length; i++) { input.prevalidationHandlers[i](); } if (!validateInputFunction(input)) { return; } for (var i = 0; i < inputs.length; i++) { if (inputs[i].isNullOrEmpty()) { return; } } if (getValuesAsJsonFunction) { var valuesAsJson = getValuesAsJsonFunction(); if (valuesAsJson) { var validator = new gaia.InputValidator('SignUp'); validator.locale = 'en'; validator.service = 'youtube'; if (handleValidationResponseFunction) { validator.errorHandler = handleValidationResponseFunction; } else { validator.errorHandler = function(errors, data) { handleValidationResponse(errors, data); }; } validator.validate(valuesAsJson); } } }; } for (var i = 0; i < inputs.length; i++) { var input = inputs[i]; input.attachValidationHandler(validate(input)); } } function getFirstInputWithError(inputs) { for (var i = 0; i < inputs.length; i++) { if (inputs[i].hasErrorMessage()) { return inputs[i]; } } } function removeDuplicateErrorMessages(input, inputs) { if (input && input.hasErrorMessage()) { var thisErrorMessage = input.getErrorMessage(); for (var i = 0; i < inputs.length; i++) { if (inputs[i].id() != input.id()) { if (thisErrorMessage == inputs[i].getErrorMessage()) { inputs[i].error.style.display = 'none'; } } } } } function registerRemoveDuplicateErrorMessagesHandler(inputs) { for (var i = 0; i < inputs.length; i++) { inputs[i].attachRemoveDuplicateErrorsHandler(function(input) { removeDuplicateErrorMessages(input, inputs); }); } } gaiaBubble.position = jfk.PopupPosition.LEFT; var inputHolders = new function() { this.firstName = newInputHolder('FirstName'); this.lastName = newInputHolder('LastName'); this.emailAddress = newInputHolder('EmailAddress'); this.gmailAddress = newInputHolder('GmailAddress'); this.passwd = newInputHolder('Passwd'); this.passwdAgain = newInputHolder('PasswdAgain'); this.birthMonth = newInputHolder('BirthMonth', birthMonthMenu); this.birthDay = newInputHolder('BirthDay'); this.birthYear = newInputHolder('BirthYear'); this.gender = newInputHolder('Gender', genderMenu); this.recoveryPhone = newInputHolder('RecoveryPhoneNumber'); this.recoveryEmail = newInputHolder('RecoveryEmailAddress'); this.countryCode = newInputHolder('CountryCode', countryCodeMenu); this.termsOfService = newInputHolder('TermsOfService'); }; var nameFormats = { 'firstname' : inputHolders.firstName, 'lastname' : inputHolders.lastName}; var nameInputs = [ nameFormats['firstname'], nameFormats['lastname']]; inputHolders.firstName.prefill(); inputHolders.lastName.prefill(); inputHolders.firstName.setPlaceHolder('firstname-placeholder'); inputHolders.lastName.setPlaceHolder('lastname-placeholder'); nameInputs[0].setInfoMessage('name-infomessage'); if (inputHolders.gmailAddress) { inputHolders.gmailAddress.prefill(); inputHolders.gmailAddress.setInfoMessage('gmail-address-infomessage'); } if (inputHolders.emailAddress) { inputHolders.emailAddress.prefill(); inputHolders.emailAddress.setInfoMessage('email-address-infomessage'); } gaia_initPasswordStrengthMeter(inputHolders, [ "Too short", "Weak", "Fair", "Good", "Strong", "Not rated" ]); inputHolders.passwdAgain.attachEvent('focus', function() { gaiaBubble.hideInfoBubble(); }); var birthDateFormats = { 'day' : inputHolders.birthDay, 'month' : inputHolders.birthMonth, 'year' : inputHolders.birthYear}; var birthDateInputs = [ birthDateFormats['month'], birthDateFormats['day'], birthDateFormats['year']]; inputHolders.birthDay.setPlaceHolder('birthday-placeholder'); inputHolders.birthYear.setPlaceHolder('birthyear-placeholder'); birthDateInputs[0].setInfoMessage('birthday-infomessage'); if (inputHolders.recoveryPhone) { inputHolders.recoveryPhone.setInfoMessage('phone-infomessage'); } if (inputHolders.recoveryEmail) { inputHolders.recoveryEmail.prefill(); inputHolders.recoveryEmail.setInfoMessage('recovery-email-infomessage'); } inputHolders.countryCode.setInfoMessage('country-code-infomessage'); var gaia_initValidation = function() { var inputEmptyErrorMessage = 'You can\x27t leave this empty.'; function defaultValidateInputFunction() { return function(input) { if (input.isNullOrEmpty()) { input.setErrorMessage(inputEmptyErrorMessage); return false; } return true; }; } function defaultGetValuesAsJsonFunction(name, inputHolders) { return function() { var json = {}; json['Input'] = name; for (var i = 0; i < inputHolders.length; i++) { json[inputHolders[i].id()] = inputHolders[i].value(); } return json; }; } registerValidationHandler( nameInputs, defaultValidateInputFunction()); registerRemoveDuplicateErrorMessagesHandler(nameInputs); removeDuplicateErrorMessages(getFirstInputWithError(nameInputs), nameInputs) registerValidationHandler( [inputHolders.passwd], defaultValidateInputFunction(), function() { var json = {}; json['Input'] = 'Passwd'; json[inputHolders.passwd.id()] = inputHolders.passwd.value(); json[inputHolders.passwdAgain.id()] = inputHolders.passwd.value(); json[inputHolders.firstName.id()] = inputHolders.firstName.value(); json[inputHolders.lastName.id()] = inputHolders.lastName.value(); if (inputHolders.gmailAddress) { json[inputHolders.gmailAddress.id()] = inputHolders.gmailAddress.value(); } if (inputHolders.emailAddress) { json[inputHolders.emailAddress.id()] = inputHolders.emailAddress.value(); } return json; }); registerValidationHandler( [inputHolders.passwdAgain], function(input) { if (inputHolders.passwd.isNullOrEmpty() && inputHolders.passwdAgain.isNullOrEmpty()) { inputHolders.passwdAgain.setErrorMessage(inputEmptyErrorMessage); return false; } if (inputHolders.passwd.value() != inputHolders.passwdAgain.value()) { inputHolders.passwdAgain.setErrorMessage('These passwords don\x27t match. Try again?'); return false; } return true; }); inputHolders.passwd.attachEvent('keydown', function(event) { event = event || window.event; var keycode = event.charCode || event.keyCode; if (keycode != 9) { inputHolders.passwdAgain.clearErrorMessage(); inputHolders.passwdAgain.inputForValue.value = ''; } }); registerValidationHandler( birthDateInputs, defaultValidateInputFunction(), defaultGetValuesAsJsonFunction('Birthday', birthDateInputs)); registerRemoveDuplicateErrorMessagesHandler(birthDateInputs); removeDuplicateErrorMessages(getFirstInputWithError(birthDateInputs), birthDateInputs); if (inputHolders.gender) { registerValidationHandler( [inputHolders.gender], defaultValidateInputFunction()); } if (inputHolders.recoveryPhone) { registerValidationHandler( [inputHolders.recoveryPhone], function(input) { return gaia_getNonDefaultPhoneInputValue() ? true : false; }, function() { var countryInput = document.getElementById('RecoveryPhoneCountry'); return { 'Input' : 'RecoveryPhoneNumber', 'RecoveryPhoneNumber' : gaia_getNonDefaultPhoneInputValue(), 'RecoveryPhoneCountry' : countryInput.value } }); } if (inputHolders.recoveryEmail) { registerValidationHandler( [inputHolders.recoveryEmail], function(input) { return !input.isNullOrEmpty(); }, defaultGetValuesAsJsonFunction('RecoveryEmailAddress', [inputHolders.recoveryEmail, inputHolders.gmailAddress])); } if (inputHolders.emailAddress) { registerValidationHandler( [inputHolders.emailAddress], defaultValidateInputFunction(), defaultGetValuesAsJsonFunction('EmailAddress', [inputHolders.emailAddress]), function(errors, data) { if (errors[inputHolders.emailAddress.id()]) { var error = errors[inputHolders.emailAddress.id()]; if (error == 'A user with the email address you specified already exists') { error = promoteUserToLoginErrorMessage( document.getElementById('EmailAddressExistsError'), inputHolders.emailAddress.value()); } inputHolders.emailAddress.setError(error); } }); } if (inputHolders.gmailAddress) { var gmailAddressErrormsgAndSuggestionsDiv = document.getElementById('username-errormsg-and-suggestions'); var gmailAddressSuggestionsDiv = document.getElementById('username-suggestions'); registerValidationHandler( [inputHolders.gmailAddress], defaultValidateInputFunction(), defaultGetValuesAsJsonFunction('GmailAddress', [inputHolders.gmailAddress, inputHolders.firstName, inputHolders.lastName]), function(errors, data) { var error = errors[inputHolders.gmailAddress.id()]; if (error == 'You entered an email address that is already associated with an account.' ) { errors = promoteUserToLoginErrorMessage( document.getElementById('EmailAddressExistsError'), inputHolders.gmailAddress.value()); } inputHolders.gmailAddress.setError(errors); gmailAddressErrormsgAndSuggestionsDiv.style.display = ''; gmailAddressErrormsgAndSuggestionsDiv.setAttribute('role', 'alert'); var suggestions = data; if (typeof(suggestions) == 'string') { suggestions = eval('(' + suggestions + ')'); } if (suggestions.length > 0) { gmailAddressSuggestionsDiv.style.display = 'block'; gmailAddressSuggestionsDiv.innerHTML = 'Available: '; for (var i = 0; i < Math.min(suggestions.length, 3); i++) { var anchor = document.createElement('a'); anchor.innerHTML = suggestions[i]; anchor.href = ''; anchor.onclick = selectUsernameSuggestionFunction(suggestions[i]); gmailAddressSuggestionsDiv.appendChild(anchor); } } }); function promoteUserToLoginErrorMessage(error, emailAddress) { var anchors = error.getElementsByTagName('a'); for (var i = 0; i < anchors.length; i++) { if (anchors[i].href.indexOf('/ServiceLogin') > 0) { anchors[i].href = gaia.uri.setFragmentParam( anchors[i].href, 'Email', emailAddress); } else { anchors[i].href = gaia.uri.setParam( anchors[i].href, 'Email', emailAddress); } } return error; } function selectUsernameSuggestionFunction(username) { return function() { inputHolders.gmailAddress.inputForValue.focus(); inputHolders.gmailAddress.inputForValue.value = username; gmailAddressErrormsgAndSuggestionsDiv.style.display = 'none'; return false; }; } inputHolders.gmailAddress.attachRemoveErrorHandler(function() { gmailAddressSuggestionsDiv.style.display = 'none'; }); inputHolders.gmailAddress.attachPrevalidationHandler(function() { var username = inputHolders.gmailAddress.inputForValue.value; if (username && username.indexOf('@gmail.com') > 0) { inputHolders.gmailAddress.inputForValue.value = username.substring(0, username.indexOf('@gmail.com')); } }); var gmailAddressSuggestions = gmailAddressSuggestionsDiv.getElementsByTagName('a'); if (gmailAddressSuggestions) { for (var i = 0; i < gmailAddressSuggestions.length; i++) { gmailAddressSuggestions[i].onclick = selectUsernameSuggestionFunction(gmailAddressSuggestions[i].innerHTML); } } } var validateTermsOfService = function() { if (inputHolders.termsOfService.inputForId.checked) { inputHolders.termsOfService.clearErrorMessage(); return true; } else { inputHolders.termsOfService.setErrorMessage( 'In order to use our services, you must agree to Google\x27s Terms of Service.'); return false; } }; registerValidationHandler( [inputHolders.termsOfService], validateTermsOfService); inputHolders.termsOfService.attachEvent('click', validateTermsOfService); gaia_onSubmitValidationHandlers.push(validateTermsOfService); }; gaia_initValidation(); document.getElementsByTagName('body')[0].appendChild(function() { var styleTag = document.createElement('style'); styleTag.type = 'text/css'; styleTag.cssText = '.recaptcha_is_building_widget {display: none;}'; return styleTag; }()); var RecaptchaOptions = { lang: 'en', theme: 'custom', custom_theme_widget: 'recaptcha_widget', callback: function() { try { var toAudio = document.getElementById('recaptcha_switch_audio_btn'); if (toAudio) { toAudio.href = 'javascript:Recaptcha.switch_type(\'audio\');'; toAudio.removeAttribute('target'); } var toImage = document.getElementById('recaptcha_switch_img_btn'); if (toImage) { toImage.href = 'javascript:Recaptcha.switch_type(\'image\');'; } var help = document.getElementById('recaptcha_whatsthis_btn'); if (help) { help.href = 'javascript:Recaptcha.showhelp()'; help.removeAttribute('target'); } Recaptcha._css_toggle('recaptcha_is_building_widget', '', 0); } catch (err) {} } }; var RecaptchaState = {site:'6LeHF8USAAAAAOa_HdcHcf3ZR_-kUoehaUFfOcZW',challenge:'03AHJ_VuswOFE23_YhiqD7xtkCDIMIIMPmEQLWbF7I53_BJrWgOEZlP14Oj4SbKEWJlsej7pV_LFOT9nUgoNyCZoD-26mT8MwiG-QsU7sZOMLhRZFYoFsGmFLM_rO8EenjyU_OyO7Z6KUUGjEBuD9K0ERfatlNQEuVPcOtjUVmMNbGMN4HS2zYLNg',is_incorrect:false,programming_error:'',error_message:'error_message_value',server:'https://www.google.com/recaptcha/api/',timeout:1800}; var gaia_initCaptchaErrorRemoval = function() { var recaptcha = document.getElementById('recaptcha_response_field'); var gaia_removeCaptchaErrorMessage = function() { var recaptchaErrorMessage = document.getElementById('errormsg_0_signupcaptcha'); if (recaptchaErrorMessage) { while (recaptchaErrorMessage.childNodes.length > 0) { recaptchaErrorMessage.removeChild(recaptchaErrorMessage.firstChild); } } recaptcha.className = recaptcha.className.substring(0, recaptcha.className.indexOf('form-error')); }; gaia_attachEvent(recaptcha, 'focus', function(){ gaia_removeCaptchaErrorMessage() }); gaia_attachEvent(recaptcha, 'keydown', function(){ gaia_removeCaptchaErrorMessage() }); gaia_attachEvent(recaptcha, 'click', function(){ gaia_removeCaptchaErrorMessage() }); }; gaia_initCaptchaErrorRemoval(); var gaia_initSkipCaptcha = function() { var skipCaptchaChk = document.getElementById('SkipCaptcha'); var captchaElement = document.getElementById('signup-captcha'); var updateCaptchaVisibility = function() { if (skipCaptchaChk.checked) { captchaElement.style.display = 'none'; } else { captchaElement.style.display = ''; } }; skipCaptchaChk.onclick = function() { updateCaptchaVisibility(); }; updateCaptchaVisibility(); }; gaia_initSkipCaptcha(); var _gaq = _gaq || []; _gaq.push(['_setAccount', 'UA-992684-1']); _gaq.push(['_setDomainName', 'accounts.google.com']); _gaq.push(['_setAllowLinker', true]); _gaq.push(['_addIgnoredRef', 'mail.google.com']); _gaq.push(['_setAllowAnchor', true]); _gaq.push(['_trackPageview', '/SignUp']); (function() { var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(ga); })();