mayn.Portlet.account = mayn.Portlet.extend({ __version : "1.0.0.0", __id : "Account", __obj : "", __message : "", showPortlet : function(a_rf) { if(a_rf == undefined){a_rf = '';}this._DoPost('showPortlet', {rf : a_rf} , this.tpl_compile_$showPortlet); }, tpl_compile_$showPortlet : function(a_data) { $("#contents_container").html(a_data); }, doSignup : function(a_lang, a_account, a_email, a_year, a_month, a_day, a_policy, a_rf) { this._DoPost( 'doSignup', { lang : a_lang, account : a_account, email : a_email, year : a_year, month : a_month, day : a_day, policy : a_policy, rf : a_rf }, this.tpl_compile_$doSignup); }, tpl_compile_$doSignup : function(a_data) { a_data = a_data.split('[+]'); if(a_data[0] == "success"){ objAccount.signupComplate(a_data[1]); setTimeout("modalClose();", 500); }else if(a_data[0] == "banip"){ __message = "IP Banned."; setTimeout("CompleateLoading('"+__message+"')", 500); }else if(a_data[0] == 'char'){ __message = "Account or Password is Character is not used."; setTimeout("CompleateLoading('"+__message+"')", 500); }else if(a_data[0] == "accout_already"){ __message = "Account ID already exists in database. Please input another account ID."; setTimeout("CompleateLoading('"+__message+"')", 500); }else if(a_data[0] == "email_already"){ __message = "Email address already exists in database. Please input another email address."; setTimeout("CompleateLoading('"+__message+"')", 500); }else if(a_data[0] == "rf"){ __message = "Referrer does not exist."; setTimeout("CompleateLoading('"+__message+"')", 500); }else{ __message = "Account creation failed."; setTimeout("CompleateLoading('"+__message+"')", 500); } }, rfExists : function(a_obj, a_rf){ __obj = a_obj; this._DoPost('rfExists', { rf : a_rf }, this.tpl_compile_$rfExists); }, tpl_compile_$rfExists : function(a_data){ if(a_data == "success"){ __obj.prev().attr("class", "chk_ok"); }else{ __obj.show().prev().hide(); $("#input_refer_ERR").show(); $("#input_refer_ERR [class='msg']").html("Please input correct referrer name."); } }, signupComplate : function(a_email) { this._DoPost( 'signupComplate', { email : a_email }, this.tpl_compile_$signupComplate); }, tpl_compile_$signupComplate : function(a_data){ $("#contents_container").html(a_data); }, accountExists : function(a_obj, a_memid) { __obj = a_obj; this._DoPost('accountExists', {memid : a_memid}, this.tpl_compile_$accountExists); }, tpl_compile_$accountExists : function(a_data){ if(a_data == "success"){ __obj.prev().attr("class", "chk_ok"); }else if(a_data == "char"){ __obj.show().prev().hide(); $("#input_account_ERR").show(); $("#input_account_ERR [class='msg']").html("Account or Password is Character is not used."); }else{ __obj.show().prev().hide(); $("#input_account_ERR").show(); $("#input_account_ERR [class='msg']").html("Please input another ID."); } }, emailExists : function(a_obj, a_email) { __obj = a_obj; this._DoPost('emailExists', {email : a_email}, this.tpl_compile_$emailExists); }, tpl_compile_$emailExists : function(a_data){ if(a_data == "success"){ __obj.prev().attr("class", "chk_ok"); }else{ __obj.show().prev().hide(); $("#input_email_ERR").show(); $("#input_email_ERR [class='msg']").html("Please input another Email."); } }, undermember : function(a_obj, a_bday) { __obj = a_obj; this._DoPost('undermember', {bday : a_bday}, this.tpl_compile_$undermember); }, tpl_compile_$undermember : function(a_data){ if(a_data == "success"){ __obj.hide().prev().attr("class", "chk_ok").show(); }else{ $.nyroModalManual({ modal : false, content: Alert_Panel.replace(/{message}/gi, "Your age group is not permitted to register.
Please have your Parent or Legal Guardian register the account.") }); return false; } }, findID : function(a_email, a_bday) { this._DoPost('findID', { email : a_email, bday : a_bday }, this.tpl_compile_$findID); }, tpl_compile_$findID : function(a_data){ if(a_data == "success"){ __message = "We have sent your account information to your email address! "; setTimeout("CompleateLoading('"+__message+"')", 500); }else{ __message = "Your Email or Birth Date is incorrect."; setTimeout("CompleateLoading('"+__message+"')", 500); } }, findPW : function(a_acc, a_bday) { this._DoPost('findPW', { acc : a_acc, bday : a_bday }, this.tpl_compile_$findPW); }, tpl_compile_$findPW : function(a_data){ arrData = a_data.split('::'); if(arrData[0] == "success"){ __message = "We have sent your password to your email address! (" + arrData[1] + ")"; setTimeout("CompleateLoading('"+__message+"');", 500); }else{ __message = "Your Account ID or Birth Date is incorrect."; setTimeout("CompleateLoading('"+__message+"');", 500); } }, resendAct : function(a_acc, a_email) { this._DoPost('resendAct', { acc : a_acc, email : a_email }, this.tpl_compile_$resendAct); }, tpl_compile_$resendAct : function(a_data){ if(a_data == "success"){ __message = "We have sent you a confirmation email."; setTimeout("CompleateLoading('"+__message+"')", 500); }else{ __message = "Your Account ID or Email is incorrect."; setTimeout("CompleateLoading('"+__message+"')", 500); } }, regist : function() { this._DoGet('regist', '', this.tpl_compile_$regist); }, tpl_compile_$regist : function(a_data) { $("#contents_container").html(a_data); }, nickExists : function(a_obj, a_nick) { __obj = a_obj; this._DoPost('nickExists', {nick : a_nick}, this.tpl_compile_$nickExists); }, tpl_compile_$nickExists : function(a_data) { if(a_data == "success"){ __obj.prev().attr("class", "chk_ok"); }else if(a_data == "char"){ __obj.show().prev().hide(); $("#input_nickname_ERR").show(); $("#input_nickname_ERR [class='msg']").html("Account or Password is Character is not used."); }else{ __obj.show().prev().hide(); $("#input_nickname_ERR").show(); $("#input_nickname_ERR [class='msg']").html("Please input another Nickname."); } }, doRegistsave : function(a_nick, a_pwd, a_gender, a_first, a_last, a_couuntry, a_state, a_security, a_answer, a_captcha){ this._DoPost('doRegistsave', { nick : a_nick, pwd : a_pwd, gender : a_gender, first : a_first, last : a_last, country : a_couuntry, state : a_state, security : a_security, answer : a_answer, captcha : a_captcha }, this.tpl_compile_$doRegistsave); }, tpl_compile_$doRegistsave : function(a_data){ if(a_data == "success"){ objAccount.registComplate(); setTimeout("modalClose();", 500); }else if(a_data == "param"){ __message = "Invalid parameter"; setTimeout("CompleateLoading('"+__message+"')", 500); }else if(a_data == "captcha"){ __message = "Wrong CAPTCHA"; setTimeout("CompleateLoading('"+__message+"')", 500); }else if(a_data == "char"){ __message = "Account or Password is Character is not used."; setTimeout("CompleateLoading('"+__message+"')", 500); }else if(a_data == "nick_acc"){ __message = "Account ID and forum nickname must be different."; setTimeout("CompleateLoading('"+__message+"')", 500); }else if(a_data == "nick_first"){ __message = "Forum nickname and your last name must be different."; setTimeout("CompleateLoading('"+__message+"')", 500); }else if(a_data == "nick_last"){ __message = "Forum nickname and your first name must be different."; setTimeout("CompleateLoading('"+__message+"')", 500); }else{ __message = "An error has occurred. Please try again later."; setTimeout("CompleateLoading('"+__message+"')", 500); } }, registComplate : function() { this._DoGet('registComplate', '', this.tpl_compile_$registComplate); }, tpl_compile_$registComplate : function(a_data){ $("#contents_container").html(a_data); }, myinfo : function() { this._DoGet('myinfo', '', this.tpl_compile_$myinfo); }, tpl_compile_$myinfo : function(a_data){ $("#contents_container").html(a_data); }, doMyinfoEdit : function(a_acc, a_nick, a_gender, a_first, a_last, a_couuntry, a_state, a_lang){ this._DoPost('doMyinfoEdit', { acc : a_acc, nick : a_nick, gender : a_gender, first : a_first, last : a_last, country : a_couuntry, state : a_state, lang : a_lang }, this.tpl_compile_$doMyinfoEdit); }, tpl_compile_$doMyinfoEdit : function(a_data){ if(a_data == "success"){ __message = "Changes saved."; setTimeout("CompleateLoading('"+__message+"')", 500); }else if(a_data == "param"){ __message = "Invalid parameter"; setTimeout("CompleateLoading('"+__message+"')", 500); }else if(a_data == "nick_first"){ __message = "Forum nickname and your last name must be different."; setTimeout("CompleateLoading('"+__message+"')", 500); }else if(a_data == "nick_last"){ __message = "Forum nickname and your first name must be different."; setTimeout("CompleateLoading('"+__message+"')", 500); }else{ __message = "An error has occurred. Please try again later."; setTimeout("CompleateLoading('"+__message+"')", 500); } }, setting : function() { this._DoGet('setting', '', this.tpl_compile_$setting); }, tpl_compile_$setting : function(a_data){ $("#contents_container").html(a_data); }, dopwdEdit : function(a_cPwd, a_nPwd, a_cfPwd, a_answer) { this._DoPost( 'dopwdEdit', { oldP : a_cPwd, newP : a_nPwd, cfP : a_cfPwd, ans : a_answer }, this.tpl_compile_$dopwdEdit); }, tpl_compile_$dopwdEdit : function(a_data){ if(a_data == "success"){ __message = "New password saved."; setTimeout("CompleateLoading('"+__message+"');UrlMoveUse('/account/myinfo');", 500); }else if(a_data == "other"){ __message = "Please enter your new password."; setTimeout("CompleateLoading('"+__message+"')", 500); }else if(a_data == "char"){ __message = "Account or Password is Character is not used."; setTimeout("CompleateLoading('"+__message+"')", 500); }else if(a_data == "answer"){ __message = "Wrong secret answer."; setTimeout("CompleateLoading('"+__message+"')", 500); }else if(a_data == "pwd"){ __message = "Wrong password."; setTimeout("CompleateLoading('"+__message+"')", 500); }else{ __message = "An error has occurred. Please try again later."; setTimeout("CompleateLoading('"+__message+"')", 500); } }, doEmailChange : function(a_nEmail, a_cfEmail, a_answer){ this._DoPost( 'doEmailChange', { nem : a_nEmail, cfem : a_cfEmail, ans : a_answer }, this.tpl_compile_$doEmailChange); }, tpl_compile_$doEmailChange : function(a_data){ a_data = a_data.split('[+]'); if(a_data[0] == "success"){ objAccount.emailChangeSend(a_data[1]); setTimeout("modalClose();", 500); }else if(a_data[0] == "pwd"){ __message = "Wrong password."; setTimeout("CompleateLoading('"+__message+"')", 500); }else if(a_data[0] == "already"){ __message = "Email address already exists in database."; setTimeout("CompleateLoading('"+__message+"')", 500); }else if(a_data[0] == "other"){ __message = "Please input another Email."; setTimeout("CompleateLoading('"+__message+"')", 500); }else if(a_data[0] == "answer"){ __message = "Wrong secret answer."; setTimeout("CompleateLoading('"+__message+"')", 500); }else{ __message = "An error has occured. Please try again later."; setTimeout("CompleateLoading('"+__message+"')", 500); } }, emailChangeSend : function(a_email){ this._DoPost( 'emailChangeSend', { email : a_email }, this.tpl_compile_$emailChangeSend); }, tpl_compile_$emailChangeSend : function(a_data){ $("#id_sendmail_area").html(a_data); }, agree : function() { this._DoGet('agree', '', this.tpl_compile_$agree); }, tpl_compile_$agree : function(a_data) { $("#contents_container").html(a_data); }, doAgree : function(f_agree, s_agree, t_agree){ this._DoPost('doAgree', { fa : f_agree, sa : s_agree, ta : t_agree }, this.tpl_compile_$doAgree); }, tpl_compile_$doAgree : function(a_data){ if(a_data == "success"){ __message = "Changes saved."; setTimeout("CompleateLoading('"+__message+"');UrlMoveUse('/account/myinfo');", 500); }else if(a_data == "already"){ __message = "You have already agreed to our policy."; setTimeout("CompleateLoading('"+__message+"');", 500); }else{ __message = "Error."; setTimeout("CompleateLoading('"+__message+"');", 500); } } });