/**
 * 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('<link type="text/css" rel="stylesheet" href="'+Mojo.URL.css_path+'/modal_login" />');jQuery("a.mojo_activate_login").click(function(a){a.preventDefault();jQuery.modal("<div id=\"mojo-modal-content\" class=\"mojo_login\"><div id=\"mojo-modal-title\"><img src=\"http://www.isranetwork.com/index.php/assets/img/mojomotor_logo.jpg\" width=\"156\" height=\"53\" alt=\"MojoMotor\" /></div><div id=\"mojo-modal-data\"><h2>Login</h2><form action=\"http://www.isranetwork.com/index.php/login/process_ajax\" method=\"post\" accept-charset=\"utf-8\"><div class=\"hidden\"><input type=\"hidden\" name=\"ci_csrf_token\" value=\"6650bbbb0a48b9a6fad0075d35909ed7\" /></div><p id=\"mojo_login_error\">Please login below. You\'re about to have fun!</p><p class=\"mojo_login_field\"><label for=\"email\">Email:</label> <input type=\"text\" name=\"email\" value=\"Email\" id=\"mojo_email\" /></p><p class=\"mojo_login_field\"><label for=\"password\">Password:</label> <input type=\"password\" name=\"password\" value=\"Password\" id=\"mojo_password\" /></p><p class=\"mojo_submit_holder\"><input type=\"checkbox\" name=\"remember_me\" value=\"yes\" id=\"remember_me\"  /> <label for=\"remember_me\" class=\"mojo_remember_me\">Remember my login info</label><button name=\"login\" type=\"submit\" value=\"login\" id=\"mojo_submit\" class=\"button\" >Login</button></p><p><small><a href=\"http://www.isranetwork.com/index.php/login/forgotten_password\">Forgotten password?</a></small></p></form></div></div>",{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()})});

