var f=this;Math.random();var g=function(a,b){var c=a.split("."),d=f;c[0]in d||!d.execScript||d.execScript("var "+c[0]);for(var e;c.length&&(e=c.shift());)c.length||void 0===b?d=d[e]?d[e]:d[e]={}:d[e]=b};Math.random();var h,k,l,n,p,q=function(){return f.navigator?f.navigator.userAgent:null};p=n=l=k=h=!1;var r;if(r=q()){var t=f.navigator;h=0==r.lastIndexOf("Opera",0);k=!h&&(-1!=r.indexOf("MSIE")||-1!=r.indexOf("Trident"));n=(l=!h&&-1!=r.indexOf("WebKit"))&&-1!=r.indexOf("Mobile");p=!h&&!l&&!k&&"Gecko"==t.product}var u=k,v=p,w=l,x=n;var y;if(h&&f.opera){var z=f.opera.version;"function"==typeof z&&z()}else v?y=/rv\:([^\);]+)(\)|;)/:u?y=/\b(?:MSIE|rv)[: ]([^\);]+)(\)|;)/:w&&(y=/WebKit\/(\S+)/),y&&y.exec(q());var A;A=!1;var B=q();B&&(-1!=B.indexOf("Firefox")||-1!=B.indexOf("Camino")||-1!=B.indexOf("iPhone")||-1!=B.indexOf("iPod")||-1!=B.indexOf("iPad")||-1!=B.indexOf("Chrome")||-1!=B.indexOf("Android")||-1!=B.indexOf("Safari")&&(A=!0));var C=A;var E=function(a){var b=window;if(x&&C&&b){b.focus();var c=0,d=null,d=b.setInterval(function(){a.closed||5==c?b.clearInterval(d):(a.close(),c++)},150)}else a.close()};var F,G=function(a){a=a||[];for(var b=[],c=0,d=a.length;c<d;++c){var e=String(a[c]||"");e&&b.push(e)}if(!b.length)return null;F?F.reset.call(F):F=shindig.sha1();F.update.call(F,b.join(" "));return F.digestString.call(F).toLowerCase()},I=function(a,b,c){this.i=String(a||"");this.e=String(b||"");this.a=String(c||"");this.d={};this.g=this.k=this.f=this.h="";this.c=null};
I.prototype.evaluate=function(){var a={},b="";try{b=String(document.cookie||"")}catch(c){}for(var b=b.split("; ").join(";").split(";"),d=0,e=b.length;d<e;++d){var m=b[d],D=m.indexOf("=");-1!=D?a[m.substr(0,D)]=m.substr(D+1):a[m]=null}this.d=a;if(this.d.SID)if(this.e=this.e.split(".")[0].split("@")[0],a="",a=0==this.i.indexOf("https://")?"SAPISID":"APISID",this.f=String(this.d[a]||""))if(a="",a=0==gadgets.rpc.getOrigin(String(window.location.href)).indexOf("https://")?"SAPISID":"APISID",this.h=String(this.d[a]||
"")){b=String(this.d.LSOLH||"").split(":");d=b.length;if(1==d||4==d)this.k=b[0];if(3==d||4==d)a=String(b[d-3]||""),b=String(b[d-1]||""),(d=G([a,this.h]).substr(0,4))&&d==b&&(this.g=a);this.a&&(a=this.a.indexOf("."),-1!=a&&(a=this.a.substr(0,a)||"",this.a=a+"."+G([this.f,this.i,this.e,this.k,this.g,a]).substr(0,4)));a=G([this.f,this.i,this.e,this.a]);this.a&&(a=a+"."+this.a);this.c=a}else this.c="";else this.c=""};
var J=function(a,b,c){a=new I(a,b,c);a.evaluate();return a},L=function(a,b,c){c=c||K(this);var d=null;if(a){a=String(a);var e=a.indexOf(".");-1!=e&&(d=a.substr(e+1))}b=J(c,b,d);return a==b.c},M=function(a,b,c){c=c||K(this);c=J(c);if(String(a)!=c.c)throw Error("Unauthorized request");b=String(b);a=parseInt(b,10);String(a)==b&&0<=a?(b=c.g)?(b=b.split("|"),a=b.length<=a?null:b[a]||null):a=null:a=null;return a},K=function(a){a=String(a.origin||"");if(!a)throw Error("RPC has no origin.");return a};
g("checkSessionState",L);g("getVersionInfo",M);var N,O,P,Q,R,S,T=window,U=(window.location.href||T.location.href).match(/.*(\?|#|&)usegapi=([^&#]+)/)||[];
"1"===decodeURIComponent(U[U.length-1]||"")?(P=function(a,b,c,d,e,m){N.send(b,e,d,m||gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER)},Q=function(a,b){N.register(a,b,gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER)},R=function(a){var b=gapi.iframes.makeWhiteListIframesFilter([a.substr(0,a.indexOf("?"))]);P("..","oauth2callback",gadgets.rpc.getAuthToken(".."),void 0,a,b)},O=function(){V()},S=function(){P("..","oauth2relayReady",gadgets.rpc.getAuthToken(".."));Q("check_session_state",W);Q("get_versioninfo",X)}):
(P=function(a,b,c,d,e){gadgets.rpc.call(a,b+":"+c,d,e)},Q=function(a,b){gadgets.rpc.register(a,b)},R=function(a){gadgets.rpc.getTargetOrigin("..")==gadgets.rpc.getOrigin(a)&&P("..","oauth2callback",gadgets.rpc.getAuthToken(".."),void 0,a)},O=function(){S()},S=function(){P("..","oauth2relayReady",gadgets.rpc.getAuthToken(".."));Q("check_session_state",L);Q("get_versioninfo",M)});
var V=function(){var a=S;window.gapi.load("gapi.iframes",function(){N=gapi.iframes.getContext().getParentIframe();a()})},Y=function(a){window.setTimeout(function(){R(a)},1)},W=function(a){var b,c;a&&(b=a.session_state,c=a.client_id);return L(b,c,N.getOrigin())},X=function(a){return M(a.xapisidHash,a.sessionIndex,N.getOrigin())};g("oauth2callback",Y);
g("oauth2verify",function(a,b){var c=window.open("javascript:void(0);",a),d;if(c&&!c.closed&&(d=c.oauth2callbackUrl))return window.b=window.b||{},window.j=window.j||window.setTimeout,window.setTimeout=function(a,b){try{var d=a,H=!1,s;a=function(){if(!H){H=!0;try{window.b[String(s)]=void 0,delete window.b[String(s)]}catch(a){}return d.call(this)}};var Z=c.setTimeout(a,b);s=window.j(a,b);window.b[String(s)]=Z;return s}catch($){}return window.j(a,b)},window.l=window.l||window.clearTimeout,window.clearTimeout=
function(a){try{var b=window.b[String(a)];b&&c.clearTimeout(b)}catch(d){}try{window.b[String(a)]=void 0,delete window.b[String(a)]}catch(H){}window.l(a)},Y(String(d)),"keep_open"!=b&&E(c),!0;c&&!c.closed&&E(c);return!1});window.addEventListener?window.addEventListener("load",O,!1):window.attachEvent("onload",O);
