// Formulário de Recomendar (slide)
var ValidatorPartilhar;
window.addEvent( 'domready', function() {
	if( $('formPartilhar') == null ) return;
	ValidatorPartilhar = new FormValidator( 'formPartilhar' );
	formSlide = new Fx.Slide('formPartilhar');
	formSlide.hide();
	slideStatus = 0;
	$('shareSlide').addEvent( 'click', function(e) {
		if( slideStatus == 0 ) {
			e = new Event(e);
			formSlide.slideIn();
			e.stop();
			slideStatus = 1;
		} else {
			e = new Event(e);
			formSlide.slideOut();
			e.stop();
			slideStatus = 0;
		}
	});
	
} );

// validador comentários
var ValidatorComentarios;
window.addEvent( 'domready', function() {
	if( $('comentarioForm') != null ) ValidatorComentarios = new FormValidator( 'comentarioForm' );
});

// Request recomendar
function recomendar() {
	new Request({
		url: 'ajax/partilhar.php',
		method: 'post',
		onRequest: function() {
			$('recomendMsg').set( 'text', 'A enviar...' );
		},
		onSuccess: function( response ) {
			$('recomendMsg').set( 'text', response );
		}
	}).send( 'tipo='+$('tipo').value+'&id='+$('id').value+'&nome='+$('nome').value+'&email='+$('email').value );
}