$(document).ready(function() { if (location.href.split("?next=")[1] != undefined) { next = location.href.split("?next=")[1].substr(3); } else { next = ""; } $('.social-login a').each(function () { $(this).attr('href', $(this).attr('href') + "&next=%2F" + next); }); $('.register-box input[name]').keyup(function () { verifyField.call($(this), false); }); $('.register-box input[name]').blur(function () { verifyField.call($(this), true); }); $('.register-box select[name]').change(function () { verifyField.call($(this), true); }); $('.register-box input[name], #register-box select[name]').focus(function () { $(this).next().show(); }); $('#register_pass').focus(function () { $('.password_strength_section').slideDown(); }); $('#register_pass').blur(function () { $('.password_strength_section').slideUp(); }); date_of_birth = $('#register_birth').DateChoose({ startDate: 1905, insertAfter: $('#register_birth'), onSelect: checkBirthField }); $('#verification-image').click(function () { if ($('#verify_enlarge').css('display') == "block" && $('#verification-image').css('min-width') != "80%") { $('#verification-image').animate({ 'min-width': '80%' }).css('z-index', '9000000'); $('body').prepend('
'); $('#popup-back').click(function () { $('#verification-image').animate({ 'min-width': '0%' }).css('z-index', 'initial'); $('#popup-back').remove(); }); } }); $('.register-box-group input').on('input', function () { if (this.value == "") { $(this).parent().removeClass('active'); } else { $(this).parent().addClass('active'); } }); $('.register-box-group select').on('change', function () { if (this.value == "") { $(this).parents('.register-box-group').removeClass('active'); } else { $(this).parents('.register-box-group').addClass('active'); } }); }); function verifyField(messages) { $(this).parents('.register-box-group').find('.register-notification').remove(); isOk = passesTest($(this).attr('id'), messages); if (isOk == true) { $(this).parents('.register-box-group').find('i.complete').removeClass('fa-circle-o').addClass('fa-circle'); } else if (isOk == false) { $(this).parents('.register-box-group').find('i.complete').removeClass('fa-circle').addClass('fa-circle-o'); } } function passesTest(id, messages) { var obj = $('#'+id); switch (id) { case "register_email": if ($(obj).val() == "") { return false; } email = /^\s*[\w\-\+_]+(\.[\w\-\+_]+)*\@[\w\-\+_]+\.[\w\-\+_]+(\.[\w\-\+_]+)*\s*$/; if ( !email.test($(obj).val()) ) { if (messages) { $(obj).parents('.register-box-group').append('