function ajax(page) {
	var url = 'action/'+page+'.php';
	$('#body').empty();
	$('#text').hide();
	$.get(url, function(data){
		$('#body').append(data);
		$('#wrap').fadeIn();
	});
	
}

function mail() {
	nome = $('#name').val();
	societa = $('#societa').val();
	email = $('#mail').val();
	messaggio = $('#messaggio').val();
	
	$.getJSON('action/mail.php', {
		'nome':nome,
		'societa':societa,
		'email':email,
		'messaggio':messaggio
	},function(data){
		$('#notice').hide().empty().attr('class',data.css).html(data.html).fadeIn();
		if(data.css=='ok'){
			$('#form input[type=text]').each(function(){
				$(this).val('');
			});
			$('#form textarea').val('');
		}
	});
	setTimeout(function(){ $('#notice').fadeOut();}, 7000);
}
