function seeEmail(nom,how) {

	nom = 'email'+nom;
	
	if (how == 'out') {
		new Fx.Style(nom, 'border-width').start(1,20, {duration: '500'});
		new Fx.Style(nom, 'margin-top').start(0,-20, {duration: '500'});
		new Fx.Style(nom, 'left').start(210,190, {duration: '500'});
		new Fx.Style(nom, 'opacity').start(.95,0, {duration: '1000'}).chain(
			function () {
				$(nom).style.display = 'none';
				new Fx.Style(nom, 'margin-top').set(0);
				new Fx.Style(nom, 'left').set(210);
			}
		);
	} else {
		$(nom).style.display = 'block';
		new Fx.Style(nom, 'border-width').set(1);
		new Fx.Style(nom, 'opacity').start(0,.95, {duration: '700'});
	}
}

function sendEmail(nom) {
	
	if ($('emailOut'+nom).getValue() != '' && $('messageOut'+nom).getValue() != '') {
		$('blanks'+nom).style.display = 'none';
		$('loader'+nom).style.display = 'block';
		
		var url = '/send_message/';
		new Ajax(
		   url,
		   {
			 method: "post",
			 data: $('emailForm'+nom)
		   }
		).request().chain(function() {
			$('loader'+nom).style.display = 'none';
			$('email'+nom).innerHTML = '<div style="font-weight:bold;text-align:center;padding:40px;" class="size18">SENT!</div>';
			
			(function () {
				seeEmail(nom,'out');
			}).delay(900);
		});
	} else {
		$('blanks'+nom).style.display = 'block';
	}
	
}