$().ready(function() {
	// validate the comment form when it is submitted
	//$("#regForm").validate();

	// validate signup form on keyup and submit
	$("#loginForm").validate({
		rules: {
			email: {
			  required: true,
			    email: true,
			      maxlength: 50
			    },
			password : {
				required: true,
				minlength: 6,
				maxlength: 18
			}

		}
	});
});


function login()
{
  var c = $("#loginForm").validate().form();
  if(c)
    {
      	var strdata = "&email=" + $('#email').val();

      	strdata  += "&password=" + $('#password').val();

	var boolstr = false;
	 $.ajax({
		url:base_url_uuuti+'?c=user&m=logincheck',
		type:"post",
		cache:false,
		dateType:"html",
		data:strdata,
		async:false,
		success:function(msg)
		{
		  if(msg == 'true')
			{
			  $.growlUI('登录成功');
			  location.href=location.href;

			}
		 if(msg=='forbid'){
		  		$.growlUI('你的账号已被冻结');
		  }
		 if(msg == 'false')
			{
			 $.growlUI('用户名或者密码错误，请确认');
			}

		}
	});
    }
}



//弹出登录
function jump_login()
{

      	var strdata = "&email=" + $('#j_email').val();

      	strdata  += "&password=" + $('#j_password').val();

	var boolstr = false;
	 $.ajax({
		url:base_url_uuuti+'?c=user&m=logincheck',
		type:"post",
		cache:false,
		dateType:"html",
		data:strdata,
		async:false,
		success:function(msg)
		{
		  if(msg == 'true')
			{
			  $.growlUI('登录成功');
			  location.href=location.href;

			}
		 if(msg=='forbid'){
		  		$.growlUI('你的账号已被冻结');
		  }
		 if(msg == 'false')
			{
			 $.growlUI('用户名或者密码错误，请确认');
			}

		}
	});

}




