var AuthBrowserHistory=Class.create();AuthBrowserHistory.prototype={initialize:function(){Object.extend(this,new BrowserHistory());Object.extend(this,new AuthBrowserHistoryMethods())}};var AuthBrowserHistoryMethods=Class.create();AuthBrowserHistoryMethods.prototype={initialize:function(){},_handleHistoryChange:function(A){gController.showView(new ViewInfoDTO(A,true))},getCurrentView:function(){var A=dhtmlHistory.getCurrentLocation();if(A==""||A==null){A=AuthView.VIEW_NAME}var B=A;if(A.indexOf(VerifyEmailView.VIEW_NAME)==0){return VerifyEmailView.VIEW_NAME}if(A.indexOf(ResetPwdView.VIEW_NAME)==0){return ResetPwdView.VIEW_NAME}switch(B){case AuthView.VIEW_NAME:return AuthView.VIEW_NAME;case RegisterView.VIEW_NAME:return RegisterView.VIEW_NAME;case ForgotPwdView.VIEW_NAME:return ForgotPwdView.VIEW_NAME;case EmailConfirmationView.VIEW_NAME:return EmailConfirmationView.VIEW_NAME;case VerifyEmailView.VIEW_NAME:return VerifyEmailView.VIEW_NAME;case ResetPwdView.VIEW_NAME:return ResetPwdView.VIEW_NAME}return AuthView.VIEW_NAME}};var Model=Class.create();Model.prototype={initialize:function(){this.loginInfo=null;this.currentViewInfo=new ViewInfoDTO("");this.userEmailDTO=null;this._sessionid="";this._message="";this._status="";this._msgcode="";this._sessionid="";this._eventHandlerMap=$H()},getUserId:function(){if(this.loginInfo!=null){return this.loginInfo.userid}if(this.userEmailDTO){return this.userEmailDTO.userid}return""},getLoginInfo:function(){return this.loginInfo},getSessionId:function(){return this._sessionid},getMessage:function(){return this._message},getStatus:function(){return this._status},getCurrentViewInfo:function(){return this.currentViewInfo},getUserEmail:function(){return this.userEmailDTO},setModelMessage:function(A){this._message=A.message;this._status=A.status;this._msgcode=A.msgcode;this.dispatchEvent(Model.EVENT_MESSAGE_UPDATE,{})},setCurrentViewInfo:function(A){this.currentViewInfo=A;this.dispatchEvent(Model.EVENT_VIEW_CHANGE,{})},setLoginInfo:function(A){this.loginInfo=A},setUserEmail:function(A){this.userEmailDTO=A},addEventListener:function(B,A){var C=this._eventHandlerMap[B];if(C==null||typeof C=="undefined"){C=$A()}C.push(A);this._eventHandlerMap[B]=C},dispatchEvent:function(C){var D=this._eventHandlerMap[C];if(D==null||typeof D=="undefined"){return }for(var A=0;A<D.length;A++){var B=D[A];B()}}};Model.EVENT_MESSAGE_UPDATE="messageUpdate";Model.EVENT_VIEW_CHANGE="currentViewChange";var AuthService=Class.create();AuthService.prototype={initialize:function(A,B){Object.extend(this,new Service());this._loginDTO=A;this._options=B},execute:function(){var A="<login-request user-name='"+this._loginDTO.userid+"' password='"+this._loginDTO.password+"' keepmesignedin='"+this._loginDTO.keepmesignedin+"' />";this.request(ghttp+gWebServiceURL+"authenticate","post",A,this._onSuccess.bind(this),this._onFailure.bind(this))},_onSuccess:function(A){if(this._options.onSuccess){var B=new MessageDTO(A._status,A._message,A._msgcode);if(A._status=="0"){this._options.onSuccess(B)}else{this._options.onFailure(B)}}}};var EmailConfirmationService=Class.create();EmailConfirmationService.prototype={initialize:function(A,B){Object.extend(this,new Service());this._userPwdDTO=A;this._options=B},execute:function(){var A="";this.request(ghttp+gWebServiceURL+"nosession?action=verify-email&user-name="+this._userPwdDTO.userid+"&email="+this._userPwdDTO.email,"get",A,this._onSuccess.bind(this),this._onFailure.bind(this))},_onSuccess:function(A){if(this._options.onSuccess){var B=new MessageDTO(A._status,A._message,A._msgcode);if(A._status=="0"){this._options.onSuccess(B)}else{this._options.onFailure(B)}}}};var ForgotPwdService=Class.create();ForgotPwdService.prototype={initialize:function(A,B){Object.extend(this,new Service());this._userPwdDTO=A;this._options=B},execute:function(){var A="";this.request(ghttp+gWebServiceURL+"nosession?action=checkpassword&email="+this._userPwdDTO.email,"get",A,this._onSuccess.bind(this),this._onFailure.bind(this))},_onSuccess:function(A){if(this._options.onSuccess){var B=new MessageDTO(A._status,A._message,A._msgcode);if(A._status=="0"){this._options.onSuccess(B)}else{this._options.onFailure(B)}}}};var LogoutService=Class.create();LogoutService.prototype={initialize:function(A){Object.extend(this,new Service());this._options=A},execute:function(){var A="";this.request(ghttp+gWebServiceURL+"logout","post",A,this._onSuccess.bind(this),this._onFailure.bind(this))},_onSuccess:function(A){if(this._options.onSuccess){var B=new MessageDTO(A._status,A._message,A._msgcode);if(A._status=="0"){this._options.onSuccess(B)}else{this._options.onFailure(B)}}}};var RegisterService=Class.create();RegisterService.prototype={initialize:function(B,A){Object.extend(this,new Service());this._accountDTO=B;this._options=A},execute:function(){var A="<user user-name='"+this._accountDTO.userid+"' password='"+this._accountDTO.password+"' main-email-address='"+this._accountDTO.email+"' first-name='"+this._accountDTO.firstname+"' last-name='"+this._accountDTO.lastname+"' country-code='"+this._accountDTO.country+"' postal-code='"+this._accountDTO.postalcode+"' gender='"+this._accountDTO.gender+"' year-of-birth='"+this._accountDTO.yob+"' recaptcha-challenge='"+this._accountDTO.recaptchaChallenge+"' recaptcha-response='"+this._accountDTO.recaptchaResponse+"' referred_by_type='"+this._accountDTO.referred_by_type+"' referred_by_details='"+this._accountDTO.referred_by_details+"' />";this.request(ghttp+gWebServiceURL+"nosession?action=createuser","post",A,this._onSuccess.bind(this),this._onFailure.bind(this))},_onSuccess:function(A){if(this._options.onSuccess){var B=new MessageDTO(A._status,A._message,A._msgcode);if(A._status=="0"){this._options.onSuccess(B)}else{this._options.onFailure(B)}}}};var ResetPwdService=Class.create();ResetPwdService.prototype={initialize:function(A,B){Object.extend(this,new Service());this._userPwdDTO=A;this._options=B},execute:function(){var A="<resetpassword  user-name='"+this._userPwdDTO.userId+"' password='' new-password='"+this._userPwdDTO.password+"' session-token='"+this._userPwdDTO.token+"' />";this.request(ghttp+gWebServiceURL+"nosession?action=resetpassword&token="+this._userPwdDTO.token,"post",A,this._onSuccess.bind(this),this._onFailure.bind(this))},_onSuccess:function(A){if(this._options.onSuccess){var B=new MessageDTO(A._status,A._message,A._msgcode);if(A._status=="0"){this._options.onSuccess(B)}else{this._options.onFailure(B)}}}};var ServiceLocator=Class.create();ServiceLocator.prototype={initialize:function(){},auth:function(A,B){new AuthService(A,B).execute()},logout:function(A,B){new LogoutService(A,B).execute()},register:function(B,A){new RegisterService(B,A).execute()},emailConfirmation:function(A,B){new EmailConfirmationService(A,B).execute()},verifyEmail:function(A,B){new VerifyEmailService(A,B).execute()},forgotPwd:function(A,B){new ForgotPwdService(A,B).execute()},resetPwd:function(A,B){new ResetPwdService(A,B).execute()},gettokendetails:function(B,A){new TokenService(B,A).execute()}};var TokenService=Class.create();TokenService.prototype={initialize:function(B,A){Object.extend(this,new Service());this._tokenDTO=B;this._options=A},execute:function(){var A="";this.request(ghttp+gWebServiceURL+"nosession?action=getTokenDetails&token="+this._tokenDTO.token,"get",A,this._onSuccess.bind(this),this._onFailure.bind(this))},_onSuccess:function(A){if(this._options.onSuccess){var E=new MessageDTO(A._status,A._message,A._msgcode);if(A._status=="0"){var D=A._dtoObject;var B=D.getElementsByTagName("token-details");var C=new UserEmailDTO();C.userid=B.item(0).attributes.getNamedItem("user-name").value;C.email=B.item(0).attributes.getNamedItem("token-details").value;C.token=B.item(0).attributes.getNamedItem("session-token").value;C.expires=B.item(0).attributes.getNamedItem("expires-when").value;this._options.onSuccess(E,C)}else{this._options.onFailure(E)}}}};var VerifyEmailService=Class.create();VerifyEmailService.prototype={initialize:function(B,A){Object.extend(this,new Service());this._tokenDTO=B;this._options=A},execute:function(){var A="";this.request(ghttp+gWebServiceURL+"nosession?action=activateUserEmail&token="+this._tokenDTO.token,"get",A,this._onSuccess.bind(this),this._onFailure.bind(this))},_onSuccess:function(A){if(this._options.onSuccess){var B=new MessageDTO(A._status,A._message,A._msgcode);if(A._status=="0"){this._options.onSuccess(B)}else{this._options.onFailure(B)}}}};var Controller=Class.create();Controller.prototype={initialize:function(){},initApp:function(){new InitAppCommand().execute()},showView:function(A){new ShowViewCommand(A).execute()},auth:function(A){new AuthCommand(A).execute()},logout:function(A){new LogoutCommand(A).execute()},register:function(A){new RegisterCommand(A).execute()},emailConfirmation:function(A){new EmailConfirmationCommand(A).execute()},verifyemail:function(A){new VerifyEmailCommand(A).execute()},forgotpwd:function(A){new ForgotPwdCommand(A).execute()},resetpwd:function(A){new ResetPwdCommand(A).execute()},gettokendetails:function(A){new TokenCommand(A).execute()}};var AuthCommand=Class.create();AuthCommand.prototype={initialize:function(A){this._loginDTO=A},execute:function(){gModel.setLoginInfo(this._loginDTO);gServiceLocator.auth(this._loginDTO,{onSuccess:this._onServiceSuccess.bind(this),onFailure:this._onServiceFailure.bind(this)})},_onServiceSuccess:function(A){if(A.status=="0"){window.open("main.html#circles","_self");return }gModel.setModelMessage(A)},_onServiceFailure:function(A){if(A.msgcode=="ERR_USER_NOT_ACTIVATED"){gController.showView(new ViewInfoDTO(EmailConfirmationView.VIEW_NAME));return }gModel.setModelMessage(A)}};var EmailConfirmationCommand=Class.create();EmailConfirmationCommand.prototype={initialize:function(A){this._userPwdDTO=A},execute:function(){gServiceLocator.emailConfirmation(this._userPwdDTO,{onSuccess:this._onServiceSuccess.bind(this),onFailure:this._onServiceFailure.bind(this)})},_onServiceSuccess:function(A){gModel.setModelMessage(A)},_onServiceFailure:function(A){gModel.setModelMessage(A)}};var ForgotPwdCommand=Class.create();ForgotPwdCommand.prototype={initialize:function(A){this._userPwdDTO=A},execute:function(){gServiceLocator.forgotPwd(this._userPwdDTO,{onSuccess:this._onServiceSuccess.bind(this),onFailure:this._onServiceFailure.bind(this)})},_onServiceSuccess:function(A){gModel.setModelMessage(A)},_onServiceFailure:function(A){gModel.setModelMessage(A)}};var GoBackCommand=Class.create();GoBackCommand.prototype={initialize:function(A){this._viewName==null;if(A!=null&&typeof (A)!="undefined"){this._viewName=A.viewName}},execute:function(){var A=gViewManager.back(this._viewName);gModel.setCurrentViewInfo(new ViewInfoDTO(A));gBrowserHistory.addHistory(A,{})}};var InitAppCommand=Class.create();InitAppCommand.prototype={initialize:function(){},execute:function(){this._setReferralCookie();gBrowserHistory=new AuthBrowserHistory();gViewManager=new ViewManager();gBrowserHistory.startListening();var A=new Footer("icFooter","_self");A.show()},_setReferralCookie:function(){var B=window.location.search.toQueryParams();if(B.referred_by_type!=null&&typeof (B.referred_by_type)!="undefined"){var C=B.referred_by_type;var A="";if(B.referred_by_details!=null&&typeof (B.referred_by_details)!="undefined"){A=B.referred_by_details}var E=new Cookies();var D=C+"/"+A;E.create("referral",D,7)}else{if(document.referrer!=null&&typeof (document.referrer)!="undefined"&&document.referrer!=""){var E=new Cookies();var D="WEB/"+document.referrer;E.create("referral",D,7)}}}};var LogoutCommand=Class.create();LogoutCommand.prototype={initialize:function(){},execute:function(){gServiceLocator.logout({onSuccess:this._onServiceSuccess.bind(this),onFailure:this._onServiceFailure.bind(this)})},_onServiceSuccess:function(A){window.open("auth.html","_self")},_onServiceFailure:function(A){window.open("auth.html","_self")}};var RegisterCommand=Class.create();RegisterCommand.prototype={initialize:function(A){this._accountDTO=A},execute:function(){var C=new Cookies();var B=C["referral"];if(B!=null&&typeof (B)!="undefined"&&B!=""){var A=B.indexOf("/");this._accountDTO.referred_by_type=B.substring(0,A);this._accountDTO.referred_by_details=B.substring(A+1)}gServiceLocator.register(this._accountDTO,{onSuccess:this._onServiceSuccess.bind(this),onFailure:this._onServiceFailure.bind(this)})},_onServiceSuccess:function(A){gModel.setModelMessage(A)},_onServiceFailure:function(A){gModel.setModelMessage(A)}};var ResetPwdCommand=Class.create();ResetPwdCommand.prototype={initialize:function(A){this._userPwdDTO=A},execute:function(){gServiceLocator.resetPwd(this._userPwdDTO,{onSuccess:this._onServiceSuccess.bind(this),onFailure:this._onServiceFailure.bind(this)})},_onServiceSuccess:function(A){gModel.setModelMessage(A)},_onServiceFailure:function(A){gModel.setModelMessage(A)}};var ShowViewCommand=Class.create();ShowViewCommand.prototype={initialize:function(A){this._viewInfo=A;if(this._viewInfo.viewName==null||this._viewInfo.viewName==""){this._viewInfo.viewName=AuthView.VIEW_NAME}},execute:function(){if(gModel.currentViewInfo.viewName==this._viewInfo.viewName){return }gModel.setCurrentViewInfo(this._viewInfo);if(!this._viewInfo.fromHistory){gBrowserHistory.addHistory(this._viewInfo.viewName,{})}if(typeof (urchinTracker)!="undefined"){urchinTracker("/auth/"+this._viewInfo.viewName)}}};var TokenCommand=Class.create();TokenCommand.prototype={initialize:function(A){this._tokenDTO=A},execute:function(){gServiceLocator.gettokendetails(this._tokenDTO,{onSuccess:this._onServiceSuccess.bind(this),onFailure:this._onServiceFailure.bind(this)})},_onServiceSuccess:function(B,A){gModel.setUserEmail(A);gModel.setModelMessage(B)},_onServiceFailure:function(A){gModel.setModelMessage(A)}};var VerifyEmailCommand=Class.create();VerifyEmailCommand.prototype={initialize:function(A){this._tokenDTO=A},execute:function(){gServiceLocator.verifyEmail(this._tokenDTO,{onSuccess:this._onServiceSuccess.bind(this),onFailure:this._onServiceFailure.bind(this)})},_onServiceSuccess:function(A){gModel.setModelMessage(A)},_onServiceFailure:function(A){gModel.setModelMessage(A)}};var ViewBase=Class.create();ViewBase.prototype={initialize:function(){},show:function(A){this._animateShow(A)},hide:function(A){this._animateHide(A)},_animateShow:function(A){this._viewElement=A;this._viewElement.show();this._afterShowFinish()},_afterShowFinish:function(){this._viewElement.show()},_animateHide:function(A){this._viewElement=A;this._viewElement.hide();this._afterHideFinish()},_afterHideFinish:function(){this._viewElement.hide()},_roundCorners:function(){var B=new curvyCorners({tl:{radius:8},tr:{radius:8},bl:{radius:8},br:{radius:8},antiAlias:true,autoPad:false},$$(".round-corners"));B.applyCornersToAll();var C=new curvyCorners({tl:{radius:4},tr:{radius:4},bl:{radius:0},br:{radius:0},antiAlias:true,autoPad:false},$$(".round-corners-top"));C.applyCornersToAll();var A=new curvyCorners({tl:{radius:0},tr:{radius:0},bl:{radius:4},br:{radius:4},antiAlias:true,autoPad:false},$$(".round-corners-bottom"));A.applyCornersToAll()}};var AuthView=Class.create();AuthView.prototype={initialize:function(){Object.extend(this,new ViewBase());Object.extend(this,new AuthViewMethods());this._keepme=false;this._myCookies=new Cookies();this._userid="";var A=this._myCookies["myinnercircle"];if(A!=""&&typeof A!="undefined"&&A!=null){this._userid=A.substring(0,A.indexOf("/"));this._keepme=A.substring(A.lastIndexOf("/")+1,A.length)}if(this._keepme!=""&&this._keepme=="true"){this._keepme=true}else{this._keepme=false}gModel.addEventListener(Model.EVENT_MESSAGE_UPDATE,this._handleAuthModelUpdate.bind(this))}};var AuthViewMethods=Class.create();AuthViewMethods.prototype={initialize:function(){},show:function(A){this._mainViewElement=A;this._mainViewElement.update(new Template(gDictionary.MSG_MAIN_CONTENT).evaluate({LOGIN_DIV_ID:AuthView.HTML_LOGIN_DIV_ID,SIGNUP_DIV_ID:AuthView.HTML_SIGNUP_DIV_ID}));if(this._keepme){this._showAlreadySignedIn();this._showSignUp()}else{this._showSignIn();this._showSignUp();Event.observe("AV_fldUserId","focus",this._clearMessage);Event.observe("AV_fldPassword","focus",this._clearMessage);this._formValidation=new Validation("frmLogin",{useTitles:true,immediate:false,stopOnFirst:true,onFormValidate:this._onSignInFormSubmit.bind(this),msgElm:"AV_icMessage"})}this._animateShow(this._mainViewElement)},_afterShowFinish:function(){var A=$("AV_fldUserId");if(A!=null&&typeof (A)!="undefined"){A.activate()}},hide:function(A){this._animateHide(A);if(this._formValidation!=null&&typeof (this._formValidation)!="undefined"){this._formValidation.clearEvents();Event.stopObserving("AV_fldUserId","focus",this._clearMessage);Event.stopObserving("AV_fldPassword","focus",this._clearMessage)}},_showSignIn:function(){$(AuthView.HTML_LOGIN_DIV_ID).update(AuthView.SIGN_IN_TEMPLATE.evaluate({LBL_USER_ID:gDictionary.LBL_USER_ID,LBL_PASSWORD:gDictionary.LBL_PASSWORD,LBL_SIGN_IN:gDictionary.LBL_SIGN_IN,LBL_KEEP_ME:gDictionary.LBL_KEEP_ME,ERR_USER_ID_REQUIRED:gDictionary.ERR_USER_ID_REQUIRED,ERR_PASSWORD_REQUIRED:gDictionary.ERR_PASSWORD_REQUIRED,MSG_FORGOT_PWD:gDictionary.MSG_FORGOT_PWD}))},_showSignUp:function(){new Insertion.Bottom($(AuthView.HTML_SIGNUP_DIV_ID),new Template(gDictionary.MSG_SIGNUP_CONTENT).evaluate({LBL_CREATE_ACCOUNT_LINK:gDictionary.LBL_CREATE_ACCOUNT_LINK}))},_showAlreadySignedIn:function(){var B=new Template(gDictionary.MSG_WELCOME_BACK);var D=B.evaluate({userid:this._userid});var A=new Template(gDictionary.MSG_IF_YOU_ARE_NOT);var C=A.evaluate({userid:this._userid});var E=new Template("<br /><h2>"+D+'</h2><a href="main.html">#{MSG_GOTO_INNERCIRCLES}</a><br/><br/>'+C+' <a href="javascript:gController.logout();">#{MSG_LOG_IN_AS_DIFFERENT_USER}</a>');$(AuthView.HTML_LOGIN_DIV_ID).update(E.evaluate({MSG_GOTO_INNERCIRCLES:gDictionary.MSG_GOTO_INNERCIRCLES,MSG_LOG_IN_AS_DIFFERENT_USER:gDictionary.MSG_LOG_IN_AS_DIFFERENT_USER}))},_handleAuthModelUpdate:function(){if(gModel.currentViewInfo.viewName!=AuthView.VIEW_NAME){return }var A=gModel.getMessage();$("AV_icMessage").update(A);new Effect.Appear("AV_icMessage")},_onSignInFormSubmit:function(A,C){if(A){this._userid=$F("AV_fldUserId");var B=new LoginDTO($F("AV_fldUserId"),$F("AV_fldPassword"),$("cbKeepMeSignedIn").checked);gController.auth(B)}},_clearMessage:function(){new Effect.Fade("AV_icMessage")}};AuthView.VIEW_NAME="login";AuthView.HTML_LOGIN_DIV_ID="icLoginId";AuthView.HTML_SIGNUP_DIV_ID="icSignupId";AuthView.MAIN_TEMPLATE=new Template("<div>#{MAIN_CONTENT}</div>");AuthView.SIGN_IN_TEMPLATE=new Template('<div class="login-box"><form id="frmLogin" action="javascript:void(0);"><div id="AV_icMessage" class="message" style="display:none;"></div><table class="ictable"><tr><td class="field-label">#{LBL_USER_ID}</td><td><input type="text" name="AV_fldUserId"  id="AV_fldUserId" class="required validate-alphanum" style="width:150px;" title="#{ERR_USER_ID_REQUIRED}" /></td></tr><tr><td class="field-label">#{LBL_PASSWORD}</td><td><input type="password" name="AV_fldPassword" id="AV_fldPassword" class="required" style="width:150px;" title="#{ERR_PASSWORD_REQUIRED}" /></td></tr><tr><td></td><td class="frm-text" nowrap="nowrap"><input type="checkbox" name="cbKeepMeSignedIn" id="cbKeepMeSignedIn" value="true" />#{LBL_KEEP_ME}</td></tr><tr><td></td><td><input type="submit" class="primary-button" name="signIn" value="#{LBL_SIGN_IN}" /> <a href="javascript:gController.showView(new ViewInfoDTO(ForgotPwdView.VIEW_NAME));">#{MSG_FORGOT_PWD}</a></td></tr></table></form></div>');var EmailConfirmationView=Class.create();EmailConfirmationView.prototype={initialize:function(){Object.extend(this,new ViewBase());Object.extend(this,new EmailConfirmationViewMethods());gModel.addEventListener(Model.EVENT_MESSAGE_UPDATE,this._handleModelUpdate.bind(this))}};var EmailConfirmationViewMethods=Class.create();EmailConfirmationViewMethods.prototype={initialize:function(){},show:function(A){this._mainViewElement=A;this._mainViewElement.update(gTemplate.HTML_AUTH_DIV);this._showEmailForm();this._animateShow(A);this._formValidation=new Validation(gTemplate.MAIN_FORM_ID,{useTitles:true,immediate:false,onFormValidate:this._onForgotPwdFormSubmit.bind(this),msgElm:"ECV_icMessage"})},hide:function(A){this._formValidation.clearEvents();this._animateHide(A)},_showEmailForm:function(){var A=new Template('<form id="icForm" action="javascript:void(0);">	<table class="ictable">	<tr>		<td nowrap><h2>#{LBL_EMAIL_NOT_CONFIRMED}</h2></td>		<td><div id="ECV_icMessage" class="message" style="display: none;"></div></td>	</tr>	<tr>		<td colspan="2"><hr></td>	</tr>	<tr>		<td colspan="2" class="frm-text">#{MSG_EMAIL_NOT_CONFIRMED}</td>	</tr>	<tr>		<td class="field-labelindent">#{LBL_EMAIL}</td>		<td><input type="text" name="fldEmail" id="fldEmail" size="20" class="required validate-email" title="#{ERR_EMAIL_REQUIRED}" /></td>	</tr>	<tr>		<td>		</td>		<td><input type="submit" class="icbutton" name="submit" value="#{LBL_SEND_CONFIRMATION_EMAIL}"/>		</td>	</tr>	</table></form>');$(gTemplate.HTML_AUTH_DIV_ID).update(A.evaluate({LBL_EMAIL_NOT_CONFIRMED:gDictionary.LBL_EMAIL_NOT_CONFIRMED,MSG_EMAIL_NOT_CONFIRMED:gDictionary.MSG_EMAIL_NOT_CONFIRMED,LBL_EMAIL:gDictionary.LBL_EMAIL,ERR_EMAIL_REQUIRED:gDictionary.ERR_EMAIL_REQUIRED,LBL_SEND_CONFIRMATION_EMAIL:gDictionary.LBL_SEND_CONFIRMATION_EMAIL}))},_onForgotPwdFormSubmit:function(A,C){if(A){var B=new UserEmailDTO(gModel.getUserId(),$F("fldEmail"));gController.emailConfirmation(B)}},_handleModelUpdate:function(){if(gModel.currentViewInfo.viewName!=EmailConfirmationView.VIEW_NAME){return }$("ECV_icMessage").update(gModel.getMessage());new Effect.Appear("ECV_icMessage");if(gModel.getStatus()=="0"){this._showEmailFormSuccess($F("fldEmail"));if(urchinTracker){urchinTracker("/auth/emailconfirmationSent")}}},_showEmailFormSuccess:function(A){var B=new Template(gDictionary.MSG_CONFIRM_EMAIL);var D=B.evaluate({email:A});var C=new Template('	<table class="ictable">	<tr>		<td nowrap><h2>#{LBL_CONFIRM_EMAIL}</h2></td>		<td></td>	</tr>	<tr>		<td colspan="2"><hr></td>	</tr>	<tr>		<td colspan="2" class="frm-text">'+D+"</td>	</tr>	</table>");$(gTemplate.HTML_AUTH_DIV_ID).update(C.evaluate({LBL_CONFIRM_EMAIL:gDictionary.LBL_CONFIRM_EMAIL}))}};EmailConfirmationView.VIEW_NAME="emailconfirmation";var ForgotPwdView=Class.create();ForgotPwdView.prototype={initialize:function(){Object.extend(this,new ViewBase());Object.extend(this,new ForgotPwdViewMethods());gModel.addEventListener(Model.EVENT_MESSAGE_UPDATE,this._handleForgotPwdModelUpdate.bind(this))}};var ForgotPwdViewMethods=Class.create();ForgotPwdViewMethods.prototype={initialize:function(){},show:function(A){this._mainViewElement=A;this._mainViewElement.update(gTemplate.HTML_AUTH_DIV);this._showForgotPwdForm();this._animateShow(A);this._formValidation=new Validation(gTemplate.MAIN_FORM_ID,{useTitles:true,immediate:false,onFormValidate:this._onForgotPwdFormSubmit.bind(this),msgElm:"FPV_icMessage"})},hide:function(A){this._formValidation.clearEvents();this._animateHide(A)},_showForgotPwdForm:function(){var A=new Template('<form id="icForm" action="javascript:void(0);">	<table class="ictable">	<tr>		<td nowrap><h2>#{LBL_RESET_PASSWORD}</h2></td>		<td><div id="FPV_icMessage" class="message" style="display: none;"></div></td>	</tr>	<tr>		<td colspan="2"><hr></td>	</tr>	<tr>		<td colspan="2" class="frm-text">#{MSG_FORGOT_PASSWORD}</td>	</tr>	<tr>		<td class="field-labelindent">#{LBL_EMAIL}</td>		<td><input type="text" name="fldEmail" id="fldEmail" size="40" class="required validate-email" title="#{ERR_EMAIL_REQUIRED}" /></td>	</tr>	<tr>		<td>		</td>		<td><input type="submit" class="primary-button" name="submit" value="#{LBL_REQUEST_PASSWORD_RESET}"/>		</td>	</tr>	</table></form>');$(gTemplate.HTML_AUTH_DIV_ID).update(A.evaluate({LBL_RESET_PASSWORD:gDictionary.LBL_RESET_PASSWORD,MSG_FORGOT_PASSWORD:gDictionary.MSG_FORGOT_PASSWORD,LBL_EMAIL:gDictionary.LBL_EMAIL,ERR_EMAIL_REQUIRED:gDictionary.ERR_EMAIL_REQUIRED,LBL_REQUEST_PASSWORD_RESET:gDictionary.LBL_REQUEST_PASSWORD_RESET}))},_onForgotPwdFormSubmit:function(A,B){if(A){var C=new UserPwdDTO($F("fldEmail"));gController.forgotpwd(C)}},_handleForgotPwdModelUpdate:function(){if(gModel.currentViewInfo.viewName!=ForgotPwdView.VIEW_NAME){return }$("FPV_icMessage").update(gModel.getMessage());new Effect.Appear("FPV_icMessage");if(gModel.getStatus()=="0"){this._showForgotPwdFormSuccess($F("fldEmail"));if(urchinTracker){urchinTracker("/auth/forgotpwdSuccess")}}},_showForgotPwdFormSuccess:function(A){var B=new Template(gDictionary.MSG_REQUEST_PASSWORD_EMAIL);var D=B.evaluate({email:A});var C=new Template('	<table class="ictable">	<tr>		<td nowrap><h2>#{LBL_REQUEST_PASSWORD_RESET_CONFIRMED}</h2></td>		<td></td>	</tr>	<tr>		<td colspan="2"><hr></td>	</tr>	<tr>		<td colspan="2" class="frm-text">'+D+"</td>	</tr>	</table>");$(gTemplate.HTML_AUTH_DIV_ID).update(C.evaluate({LBL_REQUEST_PASSWORD_RESET_CONFIRMED:gDictionary.LBL_REQUEST_PASSWORD_RESET_CONFIRMED}))}};ForgotPwdView.VIEW_NAME="forgotpwd";function showTermsOfService(){new Popup({url:"termsofservice.html"})}var RegisterView=Class.create();RegisterView.prototype={initialize:function(){Object.extend(this,new ViewBase());Object.extend(this,new RegisterViewMethods());gModel.addEventListener(Model.EVENT_MESSAGE_UPDATE,this._handleRegisterModelUpdate.bind(this))}};var RegisterViewMethods=Class.create();RegisterViewMethods.prototype={initialize:function(){},show:function(A){this._mainViewElement=A;this._mainViewElement.update(gTemplate.HTML_AUTH_DIV);this._showRegisterForm();this._animateShow(A);Event.observe("RV_fldFirstName","blur",this._checkFirstName.bindAsEventListener(this));Event.observe("RV_fldLastName","blur",this._checkLastName.bindAsEventListener(this));Event.observe("RV_fldFirstName","focus",this._removeFirstNameText.bindAsEventListener(this));Event.observe("RV_fldLastName","focus",this._removeLastNameText.bindAsEventListener(this));Event.observe("cbTermsOfService","click",this._activateSubmitBtn.bindAsEventListener(this));Event.observe("RV_fldUserId","keyup",this._checkUserId.bindAsEventListener(this))},hide:function(A){this._formValidation.clearEvents();this._animateHide(A)},_showRegisterForm:function(){var A=new Template('<form id="icForm" action="javascript:void(0);">	<div id="RV_icMessage" class="message" ></div>	<table class="ictable">	<tr>		<td nowrap><h2>#{LBL_CREATE_ACCOUNT}</h2></td>		<td width="75%"></td>	</tr>	<tr>		<td colspan="2"><hr></td>	</tr>	<tr>		<td colspan="2" class="frm-text">#{MSG_TELL_US_ABOUT_YOURSELF}</td>	</tr>	<tr>		<td class="field-labelindent">#{LBL_YOUR_NAME}</td>		<td><input type="text" name="RV_fldFirstName"  id="RV_fldFirstName" size="10" value="'+gDictionary.MSG_FIRST_NAME+'" class="required field-gray" />			<input type="text" name="RV_fldLastName"  id="RV_fldLastName" size="10" value="'+gDictionary.MSG_LAST_NAME+'" class="required field-gray" /></td>	</tr>	<tr>		<td class="field-labelindent">#{LBL_EMAIL}</td>		<td><input type="text" name="fldEmail" id="fldEmail" size="20" class="required validate-email" title="#{ERR_EMAIL_REQUIRED}" /></td>	</tr>	<tr>		<td class="field-labelindent">#{LBL_GENDER}</td>		<td><select id="fldGender" name="fldGender" class="required validate-selection" title="#{ERR_GENDER_REQUIRED}">					<option>#{LBL_CHOOSE_ONE}</option>					<option value="F">#{LBL_FEMALE}</option>					<option value="M">#{LBL_MALE}</option> 			   </select></td>	</tr>	<tr>		<td class="field-labelindent">#{LBL_YEAR_OF_BIRTH}</td>		<td><select id="fldYOB" name="fldYOB" class="required validate-birthyear" title="#{ERR_INVALID_YOB}">					<option>#{LBL_CHOOSE_ONE}</option> 			   </select></td>	</tr>	<tr>		<td class="field-labelindent">#{LBL_COUNTRY}</td>		<td>		<select id="fldCountry" name="fldCountry"/>		</td>	</tr>	<tr>		<td class="field-labelindent">#{LBL_POSTAL_CODE}</td>		<td><input type="text" name="fldPostalCode" id="fldPostalCode" size="10" class="validate-postalcode validate-us-postalcode" title="#{ERR_POSTAL_CODE}" /></td>	</tr>	<tr>		<td colspan="2"><hr></td>	</tr>	<tr>		<td colspan="2" class="frm-text">#{MSG_CHOOSE_ID_PASSWORD}</td>	</tr>	<tr>		<td class="field-labelindent">#{LBL_USER_ID}</td>		<td><table cellpadding="0" cellspacing="0"><tr><td><input type="text" name="RV_fldUserId"  id="RV_fldUserId" size="20" class="required validate-userid" title="#{ERR_USER_ID_REQUIRED}" /></td>				<td><div id="userIdMsg" style="margin-left:10px;"></div></td></tr></table></td>	</tr>	<tr>		<td class="field-labelindent">#{LBL_PASSWORD}</td>		<td><input type="password" name="RV_fldPassword" id="RV_fldPassword" size="20" class="required validate-password" title="#{ERR_PASSWORD_FORMAT}" /></td>	</tr>	<tr>		<td class="field-labelindent">#{LBL_RETYPE_PASSWORD}</td>		<td><input type="password" name="fldRetypePassword" id="fldRetypePassword" size="20" class="required validate-password-confirm" title="#{ERR_RETYPE_PASSWORD}" /></td>	</tr>	<tr>		<td colspan="2"><hr></td>	</tr>	<tr>		<td colspan="2" class="frm-text">#{MSG_CONFIRM_HUMAN}</td>	</tr>	<tr>		<td>#{MSG_CONFIRM_HUMAN_OPS}</td>		<td>           <div id="RV_recaptcha" />       </td>	</tr>	<tr>		<td colspan="2"><hr></td>	</tr>	<tr>		<td></td>		<td class="frm-text" nowrap="nowrap"><input type="checkbox" name="cbTermsOfService" id="cbTermsOfService" class="required"  title="#{ERR_TERMS_OF_SERVICE}"/>#{MSG_ACCEPT_TERMS_OF_USE}</td>	</tr>	<tr>		<td></td>		<td><input type="submit" class="primary-button-disabled" id="RV_btnSubmit" name="submit" value="#{LBL_CREATE_ACCOUNT}"/></td>	</tr>	</table></form>');$(gTemplate.HTML_AUTH_DIV_ID).update(A.evaluate({LBL_CREATE_ACCOUNT:gDictionary.LBL_CREATE_ACCOUNT,MSG_TELL_US_ABOUT_YOURSELF:gDictionary.MSG_TELL_US_ABOUT_YOURSELF,LBL_YOUR_NAME:gDictionary.LBL_YOUR_NAME,LBL_FIRST_NAME:gDictionary.LBL_FIRST_NAME,LBL_LAST_NAME:gDictionary.LBL_LAST_NAME,LBL_EMAIL:gDictionary.LBL_EMAIL,ERR_EMAIL_REQUIRED:gDictionary.ERR_EMAIL_REQUIRED,LBL_GENDER:gDictionary.LBL_GENDER,LBL_CHOOSE_ONE:gDictionary.LBL_CHOOSE_ONE,LBL_FEMALE:gDictionary.LBL_FEMALE,LBL_MALE:gDictionary.LBL_MALE,ERR_GENDER_REQUIRED:gDictionary.ERR_GENDER_REQUIRED,LBL_YEAR_OF_BIRTH:gDictionary.LBL_YEAR_OF_BIRTH,ERR_INVALID_YOB:gDictionary.ERR_INVALID_YOB,LBL_COUNTRY:gDictionary.LBL_COUNTRY,ERR_COUNTRY_REQUIRED:gDictionary.ERR_COUNTRY_REQUIRED,LBL_POSTAL_CODE:gDictionary.LBL_POSTAL_CODE,ERR_POSTAL_CODE:gDictionary.ERR_POSTAL_CODE,ERR_US_POSTAL_CODE:gDictionary.ERR_US_POSTAL_CODE,MSG_CHOOSE_ID_PASSWORD:gDictionary.MSG_CHOOSE_ID_PASSWORD,LBL_USER_ID:gDictionary.LBL_USER_ID,LBL_PASSWORD:gDictionary.LBL_PASSWORD,LBL_RETYPE_PASSWORD:gDictionary.LBL_RETYPE_PASSWORD,ERR_USER_ID_REQUIRED:gDictionary.ERR_USER_ID_REQUIRED,ERR_PASSWORD_FORMAT:gDictionary.ERR_PASSWORD_FORMAT,ERR_RETYPE_PASSWORD:gDictionary.ERR_RETYPE_PASSWORD,MSG_CONFIRM_HUMAN:gDictionary.MSG_CONFIRM_HUMAN,MSG_CONFIRM_HUMAN_OPS:gDictionary.MSG_CONFIRM_HUMAN_OPS,MSG_ACCEPT_TERMS_OF_USE:new Template(gDictionary.MSG_ACCEPT_TERMS_OF_USE).evaluate({TARGET:"_blank"}),ERR_TERMS_OF_SERVICE:gDictionary.ERR_TERMS_OF_SERVICE}));$("icForm").submit.disabled=true;this._showCountries();this._showBirthYears();this._formValidation=new Validation(gTemplate.MAIN_FORM_ID,{useTitles:true,immediate:true,stopOnFirst:true,onFormValidate:this._onRegisterFormSubmit.bind(this),msgElm:"RV_icMessage"});Validation.addAllThese([["validate-birthyear","",{minlength:4,min:1900,max:new DateTime().year-13,include:["validate-number"]}],["validate-userid","",{minlength:3,include:["validate-alphanum"]}],["validate-password",gDictionary.ERR_PASSWORD_FORMAT,{minLength:7,notOneOf:["password","PASSWORD","1234567","0123456"],notEqualToField:"RV_fldUserId"}],["validate-password-confirm",gDictionary.ERR_RETYPE_PASSWORD,{equalToField:"RV_fldPassword"}],["validate-postalcode",gDictionary.ERR_POSTAL_CODE,{requiredWhenCountryFldOneOf:["fldCountry","US","CA"]}],["validate-us-postalcode",gDictionary.ERR_US_POSTAL_CODE,{min5WhenCountryUS:"fldCountry"}]]);Recaptcha.create("6LeJcQAAAAAAAEg9o5EQa52MnAoWvOs4UNd9275j","RV_recaptcha",{theme:"white"})},_onRegisterFormSubmit:function(A,B){if(A){this._removeFirstNameText();this._removeLastNameText();var C=new AccountDTO($F("RV_fldFirstName"),$F("RV_fldLastName"),$F("fldEmail"),$F("fldGender"),$F("fldYOB"),$F("fldCountry"),$F("fldPostalCode"),$F("RV_fldUserId"),$F("RV_fldPassword"),$F("recaptcha_challenge_field"),$F("recaptcha_response_field"));gController.register(C)}},_clearMessage:function(){new Effect.Fade("RV_icMessage")},_removeFirstNameText:function(){var A=$("RV_fldFirstName");if(A.value.trim()==gDictionary.MSG_FIRST_NAME){A.value="";A.removeClassName("field-gray")}},_removeLastNameText:function(){var A=$("RV_fldLastName");if(A.value.trim()==gDictionary.MSG_LAST_NAME){A.value="";A.removeClassName("field-gray")}},_checkFirstName:function(){var A=$("RV_fldFirstName");if(A.value.trim()==""){A.addClassName("field-gray");A.value=gDictionary.MSG_FIRST_NAME}},_checkLastName:function(){var A=$("RV_fldLastName");if(A.value.trim()==""){A.addClassName("field-gray");A.value=gDictionary.MSG_LAST_NAME}},_activateSubmitBtn:function(){var A=$("RV_btnSubmit");if($("cbTermsOfService").checked){A.disabled=false;A.removeClassName("primary-button-disabled");A.addClassName("primary-button")}else{A.disabled=true;A.removeClassName("primary-button");A.addClassName("primary-button-disabled")}},_showCountries:function(){var A="xml/countries.xml";var C=new Ajax.Request(A,{method:"get",onSuccess:B});function B(G){var H,D="";var F=G.responseXML;var I=F.getElementsByTagName("country");for(var E=0;E<I.length;E++){H=I.item(E).firstChild.nodeValue;D=I.item(E).attributes.getNamedItem("code").value;$("fldCountry").options[E]=new Option(H,D);if(H=="United States"){$("fldCountry").options[E].selected=true}}}},_showBirthYears:function(){var D=new DateTime();var C=D.year-13;$("fldYOB").options[0]=new Option(gDictionary.LBL_CHOOSE_ONE,0);for(var A=1,B=C;B>1900;A++,B--){$("fldYOB").options[A]=new Option(B,B)}},_checkUserId:function(){var E=$("userIdMsg");var C=$("userIdEx1");var A=$("userIdEx2");var D=$("RV_fldUserId").value;if(D.length>2){var F=Validation.validate("RV_fldUserId",{useTitles:true,msgElm:"RV_icMessage"});if(!F){E.update(gDictionary.ERR_USERID_FORMAT);C.update(gDictionary.MSG_DEFAULT_USERID);A.update(gDictionary.MSG_DEFAULT_USERID);return }var B=ghttp+gWebServiceURL+"nosession?action=checkuser&user-name="+D;new Ajax.Request(B,{method:"get",asynchronous:true,onSuccess:function(N){var K=new ServiceResponse(N);K.getResponse();if(K._status=="0"){var I=K._dtoObject.getElementsByTagName("check-user");var H=I.item(0).attributes.getNamedItem("exists").value;if(H=="0"){var G=new Template(gDictionary.MSG_USERID_AVAILABLE);var M=G.evaluate({userid:D});E.update(M).setStyle({color:"#228B22"})}else{var L=new Template(gDictionary.ERR_USERID_TAKEN);var J=L.evaluate({userid:D});E.update(J).setStyle({color:"#FF3300"})}C.update(D);A.update(D)}}})}else{E.update("");C.update(gDictionary.MSG_DEFAULT_USERID);A.update(gDictionary.MSG_DEFAULT_USERID)}},_handleRegisterModelUpdate:function(){if(gModel.currentViewInfo.viewName!=RegisterView.VIEW_NAME){return }$("RV_icMessage").update(gModel.getMessage());new Effect.Appear("RV_icMessage");if(gModel.getStatus()=="0"){this._showRegisterFormSuccess();if(urchinTracker){urchinTracker("/auth/signupSuccess")}}},_showRegisterFormSuccess:function(){var A=new Template('	<table class="ictable">	<tr>		<td nowrap><h2>#{LBL_REGISTRATION_SUCCESS_TITLE}</h2></td>		<td></td>	</tr>	<tr>		<td colspan="2"><hr></td>	</tr>	<tr>		<td colspan="2" class="frm-text">#{MSG_VERIFY_EMAIL}</td>	</tr>	</table>');$(gTemplate.HTML_AUTH_DIV_ID).update(A.evaluate({LBL_REGISTRATION_SUCCESS_TITLE:gDictionary.LBL_REGISTRATION_SUCCESS_TITLE,MSG_VERIFY_EMAIL:gDictionary.MSG_VERIFY_EMAIL}))}};RegisterView.VIEW_NAME="signup";var ResetPwdView=Class.create();ResetPwdView.prototype={initialize:function(){Object.extend(this,new ViewBase());Object.extend(this,new ResetPwdViewMethods());var B=new QueryString();var C=document.location.href;var A=C.substring(C.indexOf("?")+1,C.length);B.execute(A);this._token=B.get("token");this._token=this._token.substring(0,this._token.indexOf("#"));gModel.addEventListener(Model.EVENT_MESSAGE_UPDATE,this._handleResetPwdModelUpdate.bind(this))}};var ResetPwdViewMethods=Class.create();ResetPwdViewMethods.prototype={initialize:function(){},show:function(A){this._mainViewElement=A;this._mainViewElement.update(gTemplate.HTML_AUTH_DIV);this._showResetPwdForm();this._animateShow(A)},hide:function(A){this._formValidation.clearEvents();this._animateHide(A)},_showResetPwdForm:function(){var A=new Template('<form id="icForm" action="javascript:void(0);">	<table class="ictable">	<tr>		<td nowrap><h2>#{LBL_CHOOSE_NEW_PASSWORD}</h2></td>		<td><div id="RPV_icMessage" class="message" style="display: none;"></div></td>	</tr>	<tr>		<td colspan="2"><hr></td>	</tr>	<tr>		<td colspan="2" class="frm-text">#{MSG_CHOOSE_NEW_PASSWORD}</td>	</tr>	<tr>		<td class="field-labelindent">#{LBL_NEW_PASSWORD}</td>		<td><input type="password" name="RPV_fldPassword" id="RPV_fldPassword" size="20" class="required validate-password" title="#{ERR_PASSWORD_FORMAT}" /></td>	</tr>	<tr>		<td class="field-labelindent">#{LBL_RETYPE_NEW_PASSWORD}</td>		<td><input type="password" name="RPV_fldRetypePassword" id="RPV_fldRetypePassword" size="20" class="required validate-password-confirm" title="#{ERR_RETYPE_PASSWORD}" /></td>	</tr>	<tr>		<td>		</td>		<td><input type="submit" class="primary-button" name="submit" value="#{LBL_SET_PASSWORD}"/>		</td>	</tr>	</table></form>');$(gTemplate.HTML_AUTH_DIV_ID).update(A.evaluate({LBL_CHOOSE_NEW_PASSWORD:gDictionary.LBL_CHOOSE_NEW_PASSWORD,MSG_CHOOSE_NEW_PASSWORD:gDictionary.MSG_CHOOSE_NEW_PASSWORD,LBL_NEW_PASSWORD:gDictionary.LBL_NEW_PASSWORD,LBL_RETYPE_NEW_PASSWORD:gDictionary.LBL_RETYPE_NEW_PASSWORD,ERR_PASSWORD_FORMAT:gDictionary.ERR_PASSWORD_FORMAT,ERR_RETYPE_PASSWORD:gDictionary.ERR_RETYPE_PASSWORD,LBL_SET_PASSWORD:gDictionary.LBL_SET_PASSWORD}));this._formValidation=new Validation(gTemplate.MAIN_FORM_ID,{useTitles:true,immediate:false,onFormValidate:this._onResetPwdFormSubmit.bind(this),msgElm:"RPV_icMessage"});Validation.addAllThese([["validate-password",gDictionary.ERR_PASSWORD_FORMAT,{minLength:7,notOneOf:["password","PASSWORD","1234567","0123456"]}],["validate-password-confirm",gDictionary.ERR_RETYPE_PASSWORD,{equalToField:"RPV_fldPassword"}]])},_onResetPwdFormSubmit:function(A,B){if(A){var C=new UserPwdDTO("",$F("RPV_fldPassword"),"",this._token);gController.resetpwd(C)}},_handleResetPwdModelUpdate:function(){if(gModel.currentViewInfo.viewName!=ResetPwdView.VIEW_NAME){return }$("RPV_icMessage").update(gModel.getMessage());new Effect.Appear("RPV_icMessage");if(gModel.getStatus()=="0"){this._showResetPwdFormSuccess();if(urchinTracker){urchinTracker("/auth/resetpwdSuccess")}}},_showResetPwdFormSuccess:function(){var A=new Template('	<table class="ictable">	<tr>		<td nowrap><h2>#{LBL_PASSWORD_RESET_CONFIRMED}</h2></td>		<td></td>	</tr>	<tr>		<td colspan="2"><hr></td>	</tr>	<tr>		<td colspan="2" class="frm-text">#{MSG_PASSWORD_SET}</td>	</tr>	<tr>		<td colspan="2" class="frm-text">#{MSG_GO_HOME_TO_SIGN_IN}</a></td>	</tr>	</table>');$(gTemplate.HTML_AUTH_DIV_ID).update(A.evaluate({LBL_PASSWORD_RESET_CONFIRMED:gDictionary.LBL_PASSWORD_RESET_CONFIRMED,MSG_PASSWORD_SET:gDictionary.MSG_PASSWORD_SET,MSG_GO_HOME_TO_SIGN_IN:gDictionary.MSG_GO_HOME_TO_SIGN_IN}))},_onResetFormSuccessSubmit:function(){gController.initApp()}};ResetPwdView.VIEW_NAME="resetpwd";var VerifyEmailView=Class.create();VerifyEmailView.prototype={initialize:function(){Object.extend(this,new ViewBase());Object.extend(this,new VerifyEmailViewMethods());var B=new QueryString();var C=document.location.href;var A=C.substring(C.indexOf("?")+1,C.length);B.execute(A);this._calledService=false;this._calledTokenService=false;this._token=B.get("token");this._token=this._token.substring(0,this._token.indexOf("#"));this._email="";this._userid="";gModel.addEventListener(Model.EVENT_MESSAGE_UPDATE,this._handleVerifyEmailModelUpdate.bind(this))}};var VerifyEmailViewMethods=Class.create();VerifyEmailViewMethods.prototype={initialize:function(){},show:function(A){this._mainViewElement=A;this._mainViewElement.update(gTemplate.HTML_AUTH_DIV);this._callVerifyEmailService();this._showMessage();this._animateShow(A)},_callVerifyEmailService:function(){if(!this._calledService){var A=new TokenDTO(this._token);gController.verifyemail(A)}this._calledService=true},_showMessage:function(){if(gModel.getStatus()=="0"){var A=new Template('	<table class="ictable">	<tr>		<td nowrap><h2>#{LBL_EMAIL_ADDRESS_CONFIRMED}</h2></td>	</tr>	<tr>		<td><hr></td>	</tr>	<tr>		<td class="frm-text">#{MSG_EMAIL_ADDRESS_CONFIRMED}</td>	</tr>	</table>');$(gTemplate.HTML_AUTH_DIV_ID).update(A.evaluate({LBL_EMAIL_ADDRESS_CONFIRMED:gDictionary.LBL_EMAIL_ADDRESS_CONFIRMED,MSG_EMAIL_ADDRESS_CONFIRMED:gDictionary.MSG_EMAIL_ADDRESS_CONFIRMED}))}else{var A=new Template('	<table class="ictable">	<tr>		<td nowrap><h2>#{LBL_VERIFY_EMAIL}</h2></td>	</tr>	<tr>		<td><hr></td>	</tr>	<tr>		<td><div id="VEV_icMessage" class="message" style="display: none;"></div></td>	</tr>	</table>');$(gTemplate.HTML_AUTH_DIV_ID).update(A.evaluate({LBL_VERIFY_EMAIL:gDictionary.LBL_VERIFY_EMAIL}));$("VEV_icMessage").update(gModel.getMessage());new Effect.Appear("VEV_icMessage")}},_handleVerifyEmailModelUpdate:function(){if(gModel.currentViewInfo.viewName!=VerifyEmailView.VIEW_NAME){return }this._showMessage()}};VerifyEmailView.VIEW_NAME="verifyemail";var ViewManager=Class.create();Object.extend(ViewManager.prototype,ViewManagerBase.prototype);Object.extend(ViewManager.prototype,{initialize:function(){this._activeDivElement=$("icMainView1");this._inactiveDivElement=$("icMainView2");this._inactiveDivElement.hide(this._activeDivElement);this._currentView="";this._viewMap=$H();this._viewHistory=$A();gModel.addEventListener(Model.EVENT_VIEW_CHANGE,this._handleViewChange.bind(this));gController.showView(new ViewInfoDTO(gBrowserHistory.getCurrentView()))},_createView:function(A){switch(A){case AuthView.VIEW_NAME:return new AuthView();case RegisterView.VIEW_NAME:return new RegisterView();case ForgotPwdView.VIEW_NAME:return new ForgotPwdView();case EmailConfirmationView.VIEW_NAME:return new EmailConfirmationView();case VerifyEmailView.VIEW_NAME:return new VerifyEmailView();case ResetPwdView.VIEW_NAME:return new ResetPwdView()}},_handleViewChange:function(){if(this._currentView!=null&&this._currentView==gModel.currentViewInfo.viewName){return }var A=this._viewMap[this._currentView];if(A!=null){A.hide(this._activeDivElement)}else{this._activeDivElement.hide()}this._currentView=gModel.currentViewInfo.viewName;this._viewHistory.push(this._currentView);var B=this._activeDivElement;this._activeDivElement=this._inactiveDivElement;this._inactiveDivElement=B;var C=this._viewMap[this._currentView];if(C==null){C=this._createView(this._currentView);if(C==null){gController.showView(new ViewInfoDTO(AuthView.VIEW_NAME));return }this._viewMap[this._currentView]=C}C.show(this._activeDivElement);C._roundCorners()}});var AccountDTO=Class.create();AccountDTO.prototype={initialize:function(F,G,H,J,D,A,I,E,K,B,C){this.firstname=F;this.lastname=G;this.email=H;this.gender=J;this.yob=D;this.country=A;this.postalcode=I;this.userid=E;this.password=K;this.recaptchaChallenge=B;this.recaptchaResponse=C;this.referred_by_type="WEB";this.referred_by_details=""}};var LoginDTO=Class.create();LoginDTO.prototype={initialize:function(A,B,D,C){this.userid=A;this.password=B;this.keepmesignedin=D;this.sessionid=C}};var MessageDTO=Class.create();MessageDTO.prototype={initialize:function(A,C,B){this.status=A;this.message=C;this.msgcode=B}};var TokenDTO=Class.create();TokenDTO.prototype={initialize:function(A){this.token=A}};var UserEmailDTO=Class.create();UserEmailDTO.prototype={initialize:function(B,C,D,A){this.userid=B;this.email=C;this.token=D;this.expires=A}};var UserPwdDTO=Class.create();UserPwdDTO.prototype={initialize:function(C,B,A,D){this.email=C;this.password=B;this.userid=A;this.token=D}};var ViewInfoDTO=Class.create();ViewInfoDTO.prototype={initialize:function(B,A){this.viewName=B;(typeof (A)!="undefined"&&A!=null)?this.fromHistory=A:false}}