// Tamaño de fuente
ACTUAL_SIZE = 10;
function bigger(){
	ACTUAL_SIZE++;
	newSize = ACTUAL_SIZE + "pt";
	document.getElementById('principal_cont').style.fontSize = newSize;
}
function smaller(){
	ACTUAL_SIZE = ACTUAL_SIZE - 1;
	newSize = ACTUAL_SIZE + "pt";
	document.getElementById('principal_cont').style.fontSize = newSize;
}

// Abrir foto
function foto(url,width,height){
	url = "imagenes/"+url; //Compongo la ruta de las imagenes
	width = width + 20; //Agrego los margenes laterales
	height = height + 20; //Agrego los margenes 
	features = "toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=1,width=" + width +",height="+ height; //Compongo la función que abre la ventana
	window.open(url,'foto',features); //Ejecuto la funcion
}

//Validación del formulario de contacto
function validar() {

	//Valido el nombre
	if (document.contacto.nombre.value.length==0){ 
	alert("Por favor, escriba su nombre") ;
	document.contacto.nombre.focus(); 
	return false; 
	}

	//Valido el mail
	if (document.contacto.email.value.length==0){
	alert("Por favor, escriba su dirección de e-mail para que podamos contactarnos con Ud.");
	document.contacto.email.focus();
	return false;
	} else {
	var s = document.contacto.email.value;
	var filter=/^[A-Za-z][A-Za-z0-9_]*@[A-Za-z0-9_]+\.[A-Za-z0-9_.]+[A-za-z]$/;
	if(!filter.test(s) && s != ""){
    alert("Debe introducir una direccion de e-mail válida");
    document.contacto.email.focus();
    document.contacto.email.select();
    return false;
	}  
	}

	//Valido el mensaje
	if (document.contacto.mensaje.value.length==0){
	alert("Por favor, escriba un mensaje.");
	document.contacto.mensaje.focus();
	return false;
	}
}

