    $(document).ready(function() {
       $('#emailLoading').hide();
        $('#email').blur(function(){
          $('#emailLoading').show();
          $.post("includes/ajax/emailCheck.php", {
            email: $('#email').val()
          }, function(response){
            $('#emailResult').fadeOut();
            setTimeout("finishAjax2('emailResult', '"+escape(response)+"')", 400);
          });
            return false;
        });
    });
	
	$(document).ready(function() {
       $('#usernameLoading').hide();
        $('#usernameRegister').blur(function(){
          $('#usernameLoading').show();
          $.post("includes/ajax/usernameCheck.php", {
            usernameRegister: $('#usernameRegister').val()
          }, function(response){
            $('#usernameResult').fadeOut();
            setTimeout("finishAjax('usernameResult', '"+escape(response)+"')", 400);
          });
            return false;
        });
    });
	
	$(document).ready(function() {
       $('#adrLoading').hide();
        $('#adrField').blur(function(){
          $('#adrLoading').show();
          $.post("includes/ajax/adrCheck.php", {
            number: $('#adrField').val(),
			postal: $('#postField').val()
          }, function(response){
            $('#adrResult').fadeOut();
            setTimeout("finishAjax3('adrResult', '"+escape(response)+"')", 400);
          });
            return false;
        });
    });

    function finishAjax3(id, response) {
      $('#adrLoading').hide();
      $('#'+id).html(unescape(response));
      $('#'+id).fadeIn();
    } //finishAjax

    function finishAjax2(id, response) {
      $('#emailLoading').hide();
      $('#'+id).html(unescape(response));
      $('#'+id).fadeIn();
    } //finishAjax
	
	function finishAjax(id, response) {
      $('#usernameLoading').hide();
      $('#'+id).html(unescape(response));
      $('#'+id).fadeIn();
    } //finishAjax
	
	$(function() {
		$('a[@rel*=lightbox]').lightBox(); // Select all links that contains lightbox in the attribute rel
	});