﻿$(document).ready(function () {

    // DEFINE GLOBAL .NET CONTROL EXTENSION
    var asp = '#ctl00_ContentPlaceHolder1_';

    $('.retrieve-password').hide();

    // BEGIN TOOLS FOR LOGIN AREA
    $('.forgotten-password').click(function () {
        $('.login-control').fadeOut('slow', function () {
            $('.retrieve-password').fadeIn('slow');
        });
    });

    $('.cmdReset').click(function () {
        var _email = $('.txtEmail').val();

        if (_email.length != 0) {
            $.post('../Services/Admin.ashx', { func: 'cmdReset', 'EmailAddress': _email }, function (response) {
                if (response != null) {
                    if (response.results == "True") {
                        //alert('we are in');
                        $('.fpMessage').html('Please Check Your Email in a Few Moments');
                    }
                    else {
                        $('.fpMessage').html('We were unable to locate your Credentials');
                    }
                }
            }, 'json');
        }

    });

    $('.cmdCancel').click(function () {
        $('.retrieve-password').fadeOut('slow', function () {
            $('.login-control').fadeIn('slow');
        });
    });
});
