/** * MojoMotor - by EllisLab * * @package MojoMotor * @author MojoMotor Dev Team * @copyright Copyright (c) 2003 - 2010, EllisLab, Inc. * @license http://mojomotor.com/user_guide/license.html * @link http://mojomotor.com * @since Version 1.0 * @filesource */ /* http://mojomotor.com/user_guide/license.html @link http://mojomotor.com @since Version 1.0 @filesource */ function login_submit_handler(){jQuery(".mojo_login form").submit(function(a){a.preventDefault();if(jQuery("#mojo_email").val().indexOf("@")==-1||jQuery("#mojo_email").val().indexOf(".")==-1||jQuery("#mojo_email").val().length<5||jQuery("#mojo_password").val()==""){jQuery("#mojo_login_error").addClass("error").html(Mojo.Lang.email_password_warning);return false}a=jQuery(".mojo_login form").attr("action");jQuery.ajax({type:"POST",url:a,dataType:"json",data:jQuery(".mojo_login form").serialize(),success:function(b){if(b== null)jQuery("#mojo_login_error").addClass("error").html(Mojo.Lang.login_result_failure);else if(b.login_status==="success"){group_name=b.group_name;jQuery(".mojo_activate_login").remove();jQuery("#mojo_login_error").removeClass("error").html(b.message);jQuery.modal.close()}else jQuery("#mojo_login_error").addClass("error").html(b.message)}})})} var mojoLogin={container:null,open:function(a){a.overlay.fadeIn("fast");a.container.fadeIn("fast");a.data.fadeIn("fast",function(){jQuery("#mojo_email").select()})},close:function(a){a.overlay.fadeOut();a.container.fadeOut();a.data.fadeOut(function(){window.location.reload()})}}; jQuery(document).ready(function(){jQuery("head").append('');jQuery("a.mojo_activate_login").click(function(a){a.preventDefault();jQuery.modal("
\"MojoMotor\"

Login

Please login below. You\'re about to have fun!

Forgotten password?

",{overlayId:"mojo-overlay",containerId:"mojo-container",opacity:35,overlayClose:true,onOpen:mojoLogin.open,onClose:mojoLogin.close});jQuery(".mojo_login_field input").focus(function(){jQuery(this).val()==Mojo.Lang.email&&jQuery(this).val("")});login_submit_handler()})});