/* Comprueba que los datos del formulario sean correctos */
/* extraido de emezeta.com */

function compruebacom ( form ) {
	if (( form.nombree.value == '' )||( form.nombree.value == 'Escribe aqui...' )) {
		alert('Debes escribir un nombre');
		return false;
	}
	if ( form.email.value == 'Escribe aqui...' ) {
		form.email.value = "";
		return false;
	}
	if ( form.email.value != '' ) {
		if (( form.email.value.indexOf("@") == -1 )||( form.email.value.indexOf(".") == -1 )) {
			alert('Email incorrecto');
			return false;
		}
	}
	if (( form.web.value != 'http://' )&&( form.web.value != '' )) {
		if ( form.web.value.indexOf("http://") != 0 ) {
			alert('Página web incorrecta, ¿Quizá te olvidas el http://? ;-)');
			return false;
		}
	}
	if (( form.comentario.value == '' )||( form.comentario.value == 'Escribe aqui...' )) {
		alert('¿No se te olvida lo más importante?');
		return false;
	}
	if ( form.comentario.value.indexOf('Escribe aqui...') == 0 ) {
		alert('El comentario tiene un «Escribe aqui...», debes quitarlo antes de comentar...');
		return false;
	}
	if ( form.comentario.value.length > 1950 ) {
		alert('Te pasas... ¿No crees que deberías reducir un poco tu comentario? ;P');
		return false;
	}
	return true;
}

function conmutar ( objeto ) {
	if ( objeto.style.display == "none" ) { objeto.style.display = "block"; }
	else { objeto.style.display = "none"; }
	return;
}

function vaciar ( objeto ) {
	if ( objeto.value == "Escribe aqui..." ) { objeto.value = ""; }
}

