//system Messgae msg_item._cate1 = "Member"; msg_item._cate2 = "Register"; msg_item._complage_function = "msg_obj_complete"; msg_item._systemMessageCall(document.location.href); function check_status(){ //if( $rj("#checkfirstname").val() =="0"){ //if( $rj("#checklastname").val() =="0"){ if( $rj("#checkid").val() == "0") { if( $rj("#checknickname").val() == "0"){ if( $rj("#checkpassword").val() == "0"){ if ( $rj("#checkrepassword").val() == "0"){ if( $rj("#checkbirthday").val() == "0") { if ( $rj("#checkemail").val() == "0") { if ( $rj("#agree").val() == "0" ){ return true; }else{ return false;} }else{ $rj("#email").focus();return false;} }else{ $rj("#birthday").focus();return false;} }else{ $rj("#userpw2").focus();return false;} }else{ $rj("#userpw1").focus();return false;} }else{ $rj("#nickname").focus();return false;} }else{ $rj("#userid").focus();return false;} //}else{ $rj("#lastname").focus();return false;} //}else{ $rj("#firstname").focus();return false;} } function div_action(obj_id, c1, c2, c3, obj_name, obj_value){ $rj("#"+obj_id).removeClass(c1); $rj("#"+obj_id).removeClass(c2); $rj("#"+obj_id).addClass(c3); if (obj_name != "" || obj_value != ""){ $rj("#"+obj_name).val(obj_value); } } $rj(document).ready(function() { try{ //var _firstname = $rj("#firstname"); //var _lastname = $rj("#lastname"); var _birthday = $rj("#birthday"); var _userid = $rj("#userid"); var _nickname = $rj("#nickname"); var _userpw1 = $rj("#userpw1"); var _userpw2 = $rj("#userpw2"); var _email = $rj("#email"); var _agree = $rj("#agree"); var _submit = $rj("#submit"); var _id_help = $rj("#idhelp"); var _frm = $rj("#frm"); var _opener = $rj("#opener"); var _returnval; var _val = null; var _returnurl = "/Return_page.html"; if (document.location.href.toUpperCase().indexOf("LOGIN_POPUP.HTML") > 0){ _returnurl = "/Return_Popup_page.html"; } _birthday.live({ focus : function(){if(_birthday.val() =="" || _birthday.val()==f_obj_msg("Register", 102, "Birthday - MM/DD/YYYY - EX) Jan. 7th 1990 = 01/07/1990")){_birthday.val("");}}, blur : function(){ if(_birthday.val() == "" ){ _birthday.val(f_obj_msg("Register", 102, "Birthday - MM/DD/YYYY - EX) Jan. 7th 1990 = 01/07/1990"));// div_action("birthday", "correct", "focus", "wrong", "checkbirthday", "1"); document.getElementById("errorbirthday").innerHTML = ""; }else{ $rj.getJSON("check_memberinfo.asp", {"birthday" : _birthday.val() }) .success(function(data){ if (data.result.returncode == 0){ div_action("birthday", "wrong", "outfocus", "correct", "checkbirthday", "0"); document.getElementById("errorbirthday").innerHTML = ""; }else if(data.result.returncode == -1){ debug.__debug("Ajax_success : " + data.result.returnmsg); _birthday.val(f_obj_msg("Register", 102, "Birthday - MM/DD/YYYY - EX) Jan. 7th 1990 = 01/07/1990")); div_action("birthday", "correct", "focus", "wrong", "checkbirthday", "2"); document.getElementById("errorbirthday").innerHTML = f_obj_msg("Register", 7, " Invalid Birthday. ");; }else{ debug.__debug("Ajax_success : " + data.result.returnmsg); div_action("birthday", "correct", "focus", "wrong", "checkbirthday", "2"); document.getElementById("errorbirthday").innerHTML = f_obj_msg("Register", 20, data.result.returnmsg);; } }) .error(function(xhr, ajaxOptions, thrownError){ debug.__debug("Ajax_error : " + xhr.status.toString()); debug.__debug("Ajax_error : " + thrownError); }); } } }); _userid.live({ focus : function(){ if(_userid.val() == "" || _userid.val() == f_obj_msg("Register", 103, "Portal ID")){_userid.val("");}; }, blur : function(){ if(_userid.val() == "" ){ _userid.val(f_obj_msg("Register", 103, "Portal ID")); // div_action("userid", "correct", "focus", "wrong", "checkid", "1"); document.getElementById("errorid").innerHTML = ""; }else{ $rj.getJSON("check_memberinfo.asp", {"userid" : _userid.val() }) .success(function(data){ if (data.result.returncode == 0){ div_action("userid", "wrong", "outfocus", "correct", "checkid", "0"); document.getElementById("errorid").innerHTML = ""; }else{ debug.__debug("Ajax_success : " + data.result.returnmsg); div_action("userid", "correct", "focus", "wrong", "checkid", "2"); if(data.result.returncode == -1){ document.getElementById("errorid").innerHTML = f_obj_msg("Register", 1, " Invalid ID. "); }else{ document.getElementById("errorid").innerHTML = f_obj_msg("Register", 2, " This ID is already taken."); } } }) .error(function(xhr, ajaxOptions, thrownError){ debug.__debug("Ajax_error : " + xhr.status.toString()); debug.__debug("Ajax_error : " + thrownError); }); } } }); _nickname.live({ focus : function(){if(_nickname.val() =="" || _nickname.val()==f_obj_msg("Register", 104, "Forum Nickname")){_nickname.val("");}}, blur : function(){ if(_nickname.val() == "" ){ _nickname.val(f_obj_msg("Register", 104, "Forum Nickname")); // div_action("nickname", "correct", "focus", "wrong", "checknickname", "1"); document.getElementById("errornickname").innerHTML = ""; }else{ $rj.getJSON("check_memberinfo.asp", {"nickname" : _nickname.val() }) .success(function(data){ if (data.result.returncode == 0){ div_action("nickname", "wrong", "outfocus", "correct", "checknickname", "0"); document.getElementById("errornickname").innerHTML = ""; }else{ debug.__debug("Ajax_success : " + data.result.returnmsg); div_action("nickname", "correct", "focus", "wrong", "checknickname", "2"); if(data.result.returncode == -1){ document.getElementById("errornickname").innerHTML = f_obj_msg("Register", 3, " Invalid Nickname. "); }else{ document.getElementById("errornickname").innerHTML = f_obj_msg("Register", 4, " This Nickname is already taken. "); } } }) .error(function(xhr, ajaxOptions, thrownError){ debug.__debug("Ajax_error : " + xhr.status.toString()); debug.__debug("Ajax_error : " + thrownError); }); } } }); _userpw1.live({ focus : function(){ _userpw1.val() == ""; _userpw1.removeClass("pass1"); }, blur : function(){ if(_userpw1.val() == "" ){ div_action("userpw1", "correct", "focus", "pass1", "checkpassword", "1"); //_userpw1.addClass("pass1"); }else{ $rj.getJSON("check_memberinfo.asp", {"password" : _userpw1.val() }) .success(function(data){ if (data.result.returncode == 0){ div_action("userpw1", "wrong", "outfocus", "correct", "checkpassword", "0"); }else{ debug.__debug("Ajax_success : " + data.result.returnmsg); div_action("userpw1", "correct", "focus", "wrong", "checkpassword", "2"); } }) .error(function(xhr, ajaxOptions, thrownError){ debug.__debug("Ajax_error : " + xhr.status.toString()); debug.__debug("Ajax_error : " + thrownError); }); } } }); _userpw2.live({ // click : function(){_userpw2.val("");}, focus : function(){ _userpw2.val(""); _userpw2.removeClass("pass2"); }, blur : function(){ if(_userpw2.val() == "" ){ div_action("userpw2", "correct", "focus", "pass2", "checkrepassword", "1"); //_userpw2.addClass("pass2"); }else if(_userpw1.val() == _userpw2.val()){ div_action("userpw2", "wrong", "outfocus", "correct", "checkrepassword", "0"); }else{ div_action("userpw2", "correct", "focus", "wrong", "checkrepassword", "2"); } } }); _email.live({ focus : function(){if(_email.val() == "" || _email.val() == f_obj_msg("Register", 105, "Email")){_email.val("");}}, blur : function(){ if(_email.val() == "" ){ _email.val(f_obj_msg("Register", 105, "Email")); //div_action("email", "correct", "focus", "wrong", "checkemail", "1"); document.getElementById("erroremail").innerHTML = ""; }else{ $rj.getJSON("check_memberinfo.asp", {"email" : _email.val() }) .success(function(data){ if (data.result.returncode == 0){ div_action("email", "wrong", "outfocus", "correct", "checkemail", "0"); document.getElementById("erroremail").innerHTML = ""; }else{ debug.__debug("Ajax_success : " + data.result.returnmsg); div_action("email", "correct", "focus", "wrong", "checkemail", "2"); if(data.result.returncode == -1){ document.getElementById("erroremail").innerHTML = f_obj_msg("Register", 5, " Check your Email Address. "); }else{ document.getElementById("erroremail").innerHTML = f_obj_msg("Register", 6, " Email Address is Already in Use "); } } }) .error(function(xhr, ajaxOptions, thrownError){ debug.__debug("Ajax_error : " + xhr.status.toString()); debug.__debug("Ajax_error : " + thrownError); }); } } }); _agree.click(function(){ if(_agree.val() == 1){ _agree.val("0");debug.__debug("checked" + $rj("#agree").val()); }else{ _agree.val("1");debug.__debug("unchecked" + $rj("#agree").val()); } }); _submit.click(function(e){ if(check_status()){ document.registerform.submit(); }else{ debug.__debug("check_status false" + $rj("#checkbirthday").val() + $rj("#checkid").val() + $rj("#checknickname").val() + $rj("#checkpassword").val() + $rj("#checkrepassword").val() + $rj("#checkemail").val() + $rj("#agree").val() ) } }); $rj("#idhelp").bubbletip($rj("#tip_id")); $rj("#nicknamehelp").bubbletip($rj("#tip_nickname")); $rj("#nameshelp").bubbletip($rj("#tip_names")); $rj("#birthdayhelp").bubbletip($rj("#tip_birthday")); }catch (e){debug.__debug("Error : $rj(document).ready(function() { ["+ e +"]");} });