var _isClearInputValue = true; $(function() { $("input.register_input").attr("isValid", "false"); if (_isClearInputValue == true) { $("input.register_input").val("") } $("input.register_input").hover(function() { $("div.form_note", $(this).parent()).css("visibility", "visible") }, function() { $("div.form_note", $(this).parent()).css("visibility", "hidden") }); $("input.register_input").focus(function() { $("div.form_note", $(this).parent()).css("visibility", "visible") }); $("input.register_input").blur(function() { $("div.form_note", $(this).parent()).css("visibility", "hidden") }); $("#" + _userNameCID).blur(function() { var A = $(this).val().trim(); if (A != "" && A.length >= 4) { checkUserName($(this)) } else { if ((A.length > 0) && (A.length < 4)) { restoreMessage($(this), (A.length > 0) && (A.length < 4)) } } }); $("#" + _userEmailCID).blur(function() { var A = $(this).val().trim(); if (A != "" && A.isEmail() == true) { checkUserEmail($(this)) } else { restoreMessage($(this), A.length <= 0) } }); $("#" + _emailVerifyCID).blur(function() { var A = $("#" + _userEmailCID).val().trim(); var B = $(this).val().trim(); if (A != B || A.isEmail() != true) { restoreMessage($(this), false) } else { liveMessage($(this), true) } }); $("#" + _passwordCID).blur(function() { var A = $(this).val().trim(); if (A.length < 6) { restoreMessage($(this), true) } else { liveMessage($(this), true) } }); $("#" + _passwordVerifyCID).blur(function() { var A = $("#" + _passwordCID).val().trim(); var B = $(this).val().trim(); if ((B.length >= 6) && (B == A)) { liveMessage($(this), true) } else { if (B != A) { restoreMessage($(this), false) } else { restoreMessage($(this), true) } } }) }); function checkRegisterInfo() { var C = 0; $("input.register_input").each(function(D) { if ($(this).attr("isValid") == "false") { $(this).addClass("invailable"); C++ } }); if ($("#register-terms").attr("checked") == false) { $("#noteServices").css("visibility", "visible"); C++ } else { $("#noteServices").css("visibility", "hidden") } var A = $("input[name='" + _captchaCName + "']"); var B = $("label[for='" + _captchaCName + "']"); if (A.val().trim().length <= 0) { B.show(); B.css("color", "#ff0000"); C++ } else { B.hide(); $("#" + _captchaCID).hide() } return C <= 0 } function checkUserName(A) { PageMethods.CheckUser(A.val().trim(), function(B, D, C) { liveMessage(D, B) }, function(C, D, B) { alert(C.get_message()) }, A) } function checkUserEmail(A) { PageMethods.CheckUserEmail(A.val().trim(), function(B, D, C) { liveMessage(D, B) }, function(C, D, B) { alert(C.get_message()) }, A) } function liveMessage(C, B) { var A = C.next(); if (B == true) { A.html(String.format(C.attr("availableMessage"), C.val())); A.removeClass("form_note"); A.addClass("form_note_right"); A.css("visibility", "visible"); C.removeClass("invailable"); C.addClass("available"); C.attr("isValid", "true") } else { A.html(String.format(C.attr("invailableMessage"), C.val())); A.removeClass("form_note_right"); A.addClass("form_note"); A.css("visibility", "visible"); C.attr("isValid", "false"); C.removeClass("available"); C.addClass("invailable") } } function restoreMessage(C, B) { var A = C.next(); if (B == true) { A.html(C.attr("noteMessage")) } else { A.html(C.attr("alertMessage")) } A.removeClass("form_note_right"); A.addClass("form_note"); A.css("visibility", "visible"); C.attr("isValid", "false"); C.removeClass("available"); C.addClass("invailable") } function invalidCaptcha() { var A = $("#" + _captchaCID); A.show(); A.css("color", "#ff0000") };