


function inloggen(){
		
	$('.container_right').html('<form id="loginForm" action="../ajax/inloggen" method="post">'+
						   '<table width="200" cellpadding="0" cellspacing="2" align="center" style="margin-top:100px;">'+
  '<tr><td colspan="3" align="center"  id="melding2"><strong>INLOGGEN</strong></td></tr>'+
  '<tr><td align="right">Naam:</td><td align="left"><input type="text" name="gebruikersnaam"  id="gebruikersnaam" size="10" /></td>'+
    '<td rowspan="2" valign="middle" align="center"><input type="submit" name="submit" id="submit" value="Go" /></td></tr><tr>'+
    '<td align="right">Wachtwoord:</td><td align="left"><input name="wachtwoord" type="password" id="wachtwoord" size="10" /></td>'+
  '</tr></table></form>');

	$('#loginForm').submit(function() { 
        $(this).ajaxSubmit({target: '#melding2', resetForm: false, success: showResponse}); 
       	return false; 
    }); 
}

function showResponse(){
 		var $melding = $('#melding2').html();
		if ($melding == 1){
			$('#melding2').html('Bezig met inloggen...');
			window.location = "home";
		}
}

$(document).ready(function () {
	jQuery.fn.fadeToggle = function(speed, easing, callback) {
     	return this.animate({opacity: 'toggle'}, speed, easing, callback); 
     };
	

	
	$('.nieuwsbrief').click(function(){
		$("#nieuwsbrief").animate({width:"toggle"}, 700);
	
	});
		
	$('#nieuwsForm').submit(function() { 
        if ($('#adres').val() == "inloggen") {
        	inloggen();
			return false;
        }
        $(this).ajaxSubmit({target: '#melding', resetForm: false}); 
        return false; 
    }); 
	
});
