if (document.images) {
	var activado = new Array();
	var desactivado = new Array();	
	for (i=1;i<=7;i++){
		desactivado['menu_0'+i] = new Image();
		desactivado['menu_0'+i].src = 'imagenes/menu/menu_0'+i+'.jpg';
		activado['menu_0'+i] = new Image();
		activado['menu_0'+i].src = 'imagenes/menu/menu_0'+i+'_on.jpg';
	}
	for (i=1;i<=7;i++){
		desactivado['footer_0'+i] = new Image();
		desactivado['footer_0'+i].src = 'imagenes/footer_0'+i+'.jpg';
		activado['footer_0'+i] = new Image();
		activado['footer_0'+i].src = 'imagenes/footer_0'+i+'_on.jpg';
	}
}

function act(nombreImagen) {
	//alert(activado[nombreImagen].src);
	if (document.images){
		document[nombreImagen].src=activado[nombreImagen].src;
	}
}

function desact(nombreImagen) {
	if (document.images){
		document[nombreImagen].src=desactivado[nombreImagen].src;
	}
}

function mail(texto){
	var mailres = true;            
	var cadena = "abcdefghijklmnñopqrstuvwxyzABCDEFGHIJKLMNÑOPQRSTUVWXYZ1234567890@._-";
	var arroba = texto.indexOf("@",0);
	var punto = texto.lastIndexOf(".");
	if ((texto.lastIndexOf("@")) != arroba){
		arroba = -1;
	}
	var contador=0;
	while (contador<texto.length){
		if (cadena.indexOf(texto.substr(contador, 1),0) == -1){
			mailres = false;
		} else contador++;
	}
	
	if ((arroba > 1) && (arroba + 1 < punto) && (punto + 1 < (texto.length)) && (mailres == true) && (texto.indexOf("..",0) == -1)){
		mailres = true;
	} else mailres = false;
	return mailres;
} 

function enviar_formulario(){
	if ((document.getElementById('nombre').value != "") && (mail(document.getElementById('email').value)) && (document.getElementById('comentarios').value != "") && (document.getElementById('empresa').value != "")) {
		document.getElementById("obligatorio").style.color='#333';
		document.getElementById("formulario").action='#';
		document.getElementById("formulario").submit();
		document.getElementById("formulario").action='';
	} else document.getElementById("obligatorio").style.color='#f00';
}

function enviar_formulario_newsletter(){
	if (mail(document.getElementById('email').value)) {
		document.getElementById("obligatorio").style.color='#333';
		document.getElementById("formulario").action='#';
		document.getElementById("formulario").submit();
		document.getElementById("formulario").action='';
	} else document.getElementById("obligatorio").style.color='#f00';
}