

var loginForm = function () {
            
            jQuery('#plError').hide();
            jQuery('#plForgotError').hide();
            
            jQuery("#plLoginFrm").validate({
                "debug": false,
                "realTime": false,
                "rules": { plUsername: "required", plPassword: "required" }
                ,"errorLabelContainer": jQuery('#plError') 
                ,"submitHandler": function() { jQuery.ajax({ type: "POST", url: 'ajax/login.php', data: { plUsername: formatInputValue( '#plUsername', false ), plPassword: formatInputValue( '#plPassword', false )}, success: function (data) {
                    if( data == "OK" ) {
                        location.reload();
                    } else {
                        jQuery('#plError').html( data );
                        jQuery('#plError').show();
                    }
                } } ); },
                "messages": { plUsername: "* Please enter your username<br />", plPassword: "* Please enter your password<br />" } }); 
                
                
                
            jQuery("#plForgotFrm").validate({
                "debug": false,
                "realTime": false,
                "rules": { plEmail: {required: true, email: true} }
                ,"errorLabelContainer": jQuery('#plForgotError') 
                ,"submitHandler": function() { jQuery.ajax({ type: "POST", url: 'ajax/forgot.php', data: { plEmail: formatInputValue( '#plEmail', false )}, success: function (data) {
                    if( data == "OK" ) {
                        jQuery('.frmForgotBig').slideUp( "fast",function(){
                            jQuery('#forgotMsgOk').slideDown( "fast" );    
                        });                        
                    } else {
                        jQuery('#plForgotError').html( data );
                        jQuery('#plForgotError').show();
                    }
                } } ); },
                "messages": { plEmail: { required:"* Please enter your email<br />", email:"* Please enter a valid email address<br />" }} });                 
                
        }
        
        
function showFrmForgot()
{
    $('#plLoginFrm').slideUp('fast', function() {
        $('#plForgotFrm').slideDown('fast');    
    });
}        
