/*
 * Event Calendar 3.0
 * © 2009 365 Media Services, LLC.
 * 
 * Registration Javascript
 *  Views:  calendars/index.ctp
 *          users/register.ctp
 *  Brief:  This script handles all the logic of the end-user display for the registration
 *          page; including the JSON methods.
 *
 * vim:filetype=php: 
 * vim:sts=4:sw=4:et:
 */

"use strict";
  
$(document).ready(function() {
    $('#UserLoginForm').ajaxForm({
        dataType: 'json',
		success: function(data) {
			if (data.status == false) {
				$("#login-fail").show();
				$("#login-fail").html('<p>' + data.reason + '</p>').fadeIn('fast').fadeOut('fast').fadeIn('fast').fadeOut('fast').fadeIn('fast');
				return false;
			}
            else {
                window.location = data.redirect;
            }
		}
	});
});

