/*
Credits: Bit Repository
URL: http://www.bitrepository.com/web-programming/ajax/login-form.html
*/


	window.addEvent('domready', function() {

	$('passwordform').addEvent('submit', function(e) {
		// Prevents the default submit event from loading a new page.
		e.stop();

		// Show the spinning indicator when pressing the submit button...
	    $('ajax_loading2').setStyle('display','block');
		//$('ajax_loading2').setStyles({opacity:2,display:'block'});
		

		// Hide the submit button while processing...
		//$('submit2').set('value','Processing...');
	

		// Set the options of the form's Request handler.
		// ("this" refers to the $('login') element).
		this.set('send', { onComplete: function(response) {
			$('ajax_loading2').setStyle('display','none');
			

	if(response == 'OK')
			{
              $('pass_response').set('html', "<div id='error_notification' style='color:#006600; font-style:italic; font-weight:bold;'>You should get your account password shortly.</div>");
	         // $('formbox').set('value','');
			 // $('formbox').setStyle('display','none');
			  $('formbox').fade('out'); 
			 
			  
			  
			}
			
	
			else
			{
			  $('pass_response').set('html', response);
			  // Show the login button
			  $('submit').setStyle('display','block');
	
			}
		}});

		// Send the form.
		this.send();
	});
});

