function attachSignin(n){auth2.attachClickHandler(n,{},function(n){googleId=n.getBasicProfile().getId();googleToken=n.getAuthResponse().id_token;googleEmail=n.getBasicProfile().getEmail();TLBGoogleLogin()},function(){})}function TLBGoogleLogin(){$.ajax({type:"GET",url:AuthServicesUrl,data:"Field=LoginGoogle&id="+googleId+"&token="+googleToken+"&location="+escape(window.location.toString())+"&version=2&email="+googleEmail,async:!0,cache:!1,crossDomain:!0,dataType:"jsonp",success:function(htmlResponse){let param=eval(htmlResponse);switch(param.State){case 0:window.location.reload();break;case 2:window.location.href="/login";break;case 7:$.ajax({type:"GET",url:RegServicesUrl,data:"Field=saveUserGoogleSession&id="+googleId+"&token="+googleToken+"&email="+googleEmail+"&userName="+param.realUserName,async:!0,cache:!1,crossDomain:!0,dataType:"jsonp",success:function(htmlResponse){let param=eval(htmlResponse);switch(param.Code){case"1":window.location.href="/registro?GoogleAct=1";break;default:doError(lang.ERROR_SOLICITUD)}},error:function(){doError(lang.ERROR_SOLICITUD)}});break;case 3:window.location.href="/login"}}})}let googleUser={},googleToken,googleId,googleEmail;const GoogleInitTBL=function(){gapi.load("auth2",function(){auth2=gapi.auth2.init({client_id:Ax5ClientIdTBL,cookiepolicy:"single_host_origin"});attachSignin(document.getElementById("btnGoogleTBLLogin"))})}