/* Cached on Sat, 27 Apr 2024 06:39:56 */ $(function() { $('.loginTabButton').click(function() { if ($(this).parent().attr('id') == 'mainButtons') $(this).parent().slideUp(150); else $(this).parents('.loginTab').slideUp(150); $('.loginBlock').addClass('active'); $('#loginTab_' + this.attributes.loginTab.value).slideDown(150,function() { $(this).find('.textField:first').focus(); }); }) $('.loginTabClose').click(function() { $('#loginBlockBorder') .stop(true,true) .fadeOut(300) $(this).parents('.loginTab').slideUp(250,function() { $('#mainButtons').fadeIn(150); $('.loginBlock').removeClass('active'); }) }) $('.loginBlock').hover( function() { if (!$(this).hasClass('active')) { $('#loginBlockBorder') .stop(true,true) .fadeTo(300,0.4) } }, function() { if (!$(this).hasClass('active')) { $('#loginBlockBorder') .stop(true,true) .fadeOut(300) } } ) $('.afterRemSuc span').click(function() { $(this).parent().prev().html('').parent().hide().prev().show().find('.textField').val(''); }) $('.regToLogin span').click(function() { $(this).parents('form').find('.emailExist').slideUp(150,function() {$(this).remove()}); $(this).parents('form').find('.regToLogin,#regFp').hide(); var email = $(this).parents('form').find('.textField:first').val(); var pass = $(this).parents('form').find('.textField:last').val(); $(this).parents('form').find('.textField').val(''); $('#loginTab_login .textField:first').val(email); $('#loginTab_login .textField:last').val(pass); $('#loginTab_login form').submit(); }) $('#regFp').click(function() { $(this).parents('form').find('.emailExist').slideUp(150,function() {$(this).remove()}); $(this).parents('form').find('.regToLogin,#regFp').hide(); var email = $(this).parents('form').find('.textField:first').val(); $(this).parents('form').find('.textField').val(''); $('#loginTab_forgot .textField').val(email); $('#loginTab_forgot form').submit(); }) $('.loginTab form').submit(function() { $(this).find('.emailExist').slideUp(150,function() {$(this).remove()}); $(this).find('.regToLogin,#regFp').hide(); if ($(this).find('.textField[value=]').length > 0) { var message = new msg({ msgId: ($(this).find('.textField').length == 2)? 9 : 17, timeout: 5, classes: 'message_smallFW', showAfter: $('.loginTab:visible .textField:last').parent() }); message.show(); return false; } var check = /^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/; if (!check.test($(this).find('.textField:first')[0].value.replace(/\s/g, ''))) { var message = new msg({ msgId: 17, timeout: 5, classes: 'message_smallFW', showAfter: $('.loginTab:visible .textField:first').parent() }); message.show(); return false; } $('#loginLocker').show(); return true; }) $(document).click(function(e){ if ($(e.target).closest("#loginBlock").length) return; if ($('#loginBlock').hasClass('active')) { $('#loginBlockBorder') .stop(true,true) .fadeOut(300) $('.loginTab:visible').slideUp(250,function() { $('#mainButtons').fadeIn(150); $('.loginBlock').removeClass('active'); }) } $('#login').slideUp(250);$('#login_bar_border').fadeOut(300);$('#log_reg_b').fadeIn(150); e.stopPropagation(); }); $('#loginTab_login [name=password]').focus(function() { $('.message_smallFW').slideUp(200, function() {$(this).remove()}); }) }) function afterLogin(result) { $('#loginLocker').hide(); var result = JSON.parse(result); if (result.suc) { window.location = window.router.cp; return; } else { $('.message_smallFW').remove(); var message = new msg({ msgId: result.msgId, timeout: 5, classes: 'message_smallFW', showAfter: $('.loginTab:visible .textField:last').parent() }); message.show(); } } function afterReg(result) { $('#loginLocker').hide(); var result = JSON.parse(result); if (result.suc) { window.location = window.router.cp; return; } else { var message = new msg({ msgId: result.msgId, timeout: 500, classes: ['message_smallFW','emailExist'], showAfter: $('.loginTab:visible .textField:first').parent() }); $('.loginTab:visible').find('.regToLogin,#regFp').show() message.show(); } } function afterRem(result) { $('#loginLocker').hide(); var result = JSON.parse(result); if (result.suc) { $('.loginTab .suc') .show() .prev().hide() .next().find('p') .html(result.msg); return; } else { var message = new msg({ msgId: result.msgId, timeout: 5, classes: ['message_smallFW'], showAfter: $('.loginTab:visible .textField:first').parent() }); message.show(); } }