var restoreFormHtml = "";

function sendForm( )
{
	var nameInput = $('input#name').val();
	var emailInput = $('input#email').val();

	$.ajax({
		type: "POST",
   		url: "register.php",
   		data: "name=" + nameInput + "&email=" + emailInput,
   		success: function(msg){
     		var formHtml = $('form#form').html();
     		
     		$('form#form').fadeOut('fast', function() {
    			$('form#form').html( msg );
    			$('form#form').removeClass( 'text' );
    			$('form#form').addClass( 'text' );
    			Cufon.refresh();
    			$('form#form').fadeIn('fast');
  			});
  			
  			restoreFormHtml = formHtml;
   		}
 	});
}

function restoreForm( )
{
	$('form#form').fadeOut('fast', function() {
    	$('form#form').html( restoreFormHtml );
    	$('form#form').removeClass( 'text' );
    	$('form#form').addClass( 'form' );
    	Cufon.refresh();
    	$('form#form').fadeIn('fast');
  	});
}
