jQuery('#login').live('submit',function(event) {
    $.ajax({
        url: 'include/ajax.php',
        type: 'POST',
        dataType: 'json',
        data: $('#login').serialize(),
        success: function(data) {
            for(var id in data) {				
				if(id == 'log'){					
					window.location.replace("http://www.bemoto.com/");					
					}else{				
                jQuery('#' + id).html(data[id]);}
            }
        }
    });
    return false;
});

jQuery('#register').live('submit',function(event) {
    $.ajax({
        url: 'include/user_reg.php',
        type: 'POST',
        dataType: 'json',
        data: $('#register').serialize(),
        success: function(data) {
            for(var id in data) {				
				if(id == 'log'){					
					window.location.replace("http://www.bemoto.com/");					
					}else{				
                jQuery('#' + id).html(data[id]);}
            }
        }
    });
    return false;
});
