function AuthenticationBridge(){}AuthenticationBridge.prototype.bridgeIFrameId="rpxIframe";AuthenticationBridge.prototype.tokenUrl=ypgSSOTokenUrl;AuthenticationBridge.prototype.bridgeUrl_FB=ypgRPXDomainUrl+"?openid_identifier="+encodeURIComponent(ypgOpenidIdentifierUrl)+"&token_url=@tokenUrl@&opx_blob=facebook&language_preference="+ypgLang;AuthenticationBridge.prototype.bridgeUrl=ypgRPXDomainUrl+"?openid_identifier="+encodeURIComponent(ypgOpenidIdentifierUrl)+"&token_url=@tokenUrl@&opx_blob=login&language_preference="+ypgLang;AuthenticationBridge.prototype.bridgeUrlRegister=ypgRPXDomainUrl+"?openid_identifier="+encodeURIComponent(ypgOpenidIdentifierUrl)+"&token_url=@tokenUrl@&opx_blob=register&language_preference="+ypgLang;AuthenticationBridge.prototype.bridgeUrlReview=ypgRPXDomainUrl+"?openid_identifier="+encodeURIComponent(ypgOpenidIdentifierUrl)+"&token_url=@tokenUrl@&opx_blob=login_review&language_preference="+ypgLang;AuthenticationBridge.prototype.dialogURL="";AuthenticationBridge.prototype.startAuthentication=function(isFacebook,endpoint){isFacebook=(isFacebook==undefined?false:isFacebook);endpoint=(endpoint==undefined?"":endpoint);var finalEndpointParam="?finalEndpoint="+encodeURIComponent(endpoint);var finalTokenUrl=encodeURIComponent(this.tokenUrl+finalEndpointParam);if(isFacebook){var options="width=475,height=500,status=0,menubar=0,toolbar=0,resizable=0,location=1";top.childWindow=window.open(ypgFBPopupUrl,"rpx_yp_popup",options);top.childWindow.opener=self;top.childWindow.focus();this.dialogURL=this.bridgeUrl_FB.replace("@tokenUrl@",finalTokenUrl)}else{this.dialogURL=this.bridgeUrl.replace("@tokenUrl@",finalTokenUrl)}};AuthenticationBridge.prototype.startRegistration=function(endpoint){endpoint=(endpoint==undefined?"":endpoint);var finalEndpointParam="?finalEndpoint="+encodeURIComponent(endpoint);var finalTokenUrl=encodeURIComponent(this.tokenUrl+finalEndpointParam);this.dialogURL=this.bridgeUrlRegister.replace("@tokenUrl@",finalTokenUrl)};AuthenticationBridge.prototype.startAuthenticationForReview=function(endpoint){endpoint=(endpoint==undefined?"":endpoint);var finalEndpointParam="?finalEndpoint="+encodeURIComponent(endpoint);var finalTokenUrl=encodeURIComponent(this.tokenUrl+finalEndpointParam);this.dialogURL=this.bridgeUrlReview.replace("@tokenUrl@",finalTokenUrl)};AuthenticationBridge.prototype.showIframeDialog=function(){var argv=AuthenticationBridge.prototype.showIframeDialog.arguments;var argc=AuthenticationBridge.prototype.showIframeDialog.arguments.length;var approachType=(argc>0)?argv[0]:null;if(approachType=="create"){var iframe=document.createElement("iframe");iframe.src=this.dialogURL;iframe.name=this.bridgeIFrameId;iframe.id=this.bridgeIFrameId;iframe.style.width="670px";iframe.style.height="600px";iframe.style.border="0";iframe.setAttribute("scrolling","no");iframe.setAttribute("frameborder","0");iframe.setAttribute("cellpadding","0");if(iframe.attachEvent){iframe.attachEvent("onload",function(){})}else{iframe.onload=function(){}}document.getElementById("ypgOverlay").style.display="block";document.getElementById("boxLogIn").appendChild(iframe);iframeWindow=iframe.contentWindow||iframe.contentDocument.parentWindow;setTimeout('$YP("#boxLogIn").fadeIn(500);',1000)}else{document.getElementById(this.bridgeIFrameId).src=this.dialogURL;document.getElementById("ypgOverlay").style.display="block";setTimeout('$YP("#boxLogIn").fadeIn(500);',1000)}};AuthenticationBridge.prototype.startTest=function(endpoint){endpoint=(endpoint==undefined?"":endpoint);this.dialogURL=endpoint};var authBridge=new AuthenticationBridge();
