/*************************************************/
/************ Telémaco Sistemas S.L **************/

/******* Funciones envio formulario correo *********/
function isEmail(str)
{
  var supported = 0;
  if (window.RegExp)
  {
  var tempStr = "a";
  var tempReg = new RegExp(tempStr);
  if (tempReg.test(tempStr))
   	supported = 1;
  }
  if (!supported)
	return (str.indexOf(".") > 2) && (str.indexOf("@") > 0);
		
  var r1 = new RegExp("(@.*@)|(\\.\\.)|(@\\.)|(^\\.)");
  var r2 = new RegExp("^.+\\@(\\[?)[a-zA-Z0-9\\-\\.]+\\.([a-zA-Z]{2,4}|[0-9]{1,3})(\\]?)$");
		
  return (!r1.test(str) && r2.test(str));
}
		
function chequeo()
{

  vari = isEmail(document.envio.MAILFROM.value);
  nombre = document.envio.NOMBRE.value;  
  telefono =  document.envio.TELEFONO.value;
  if (!vari)
	alert('Su correo electrónico no parece válido.\nIntrodúzcalo en el campo indicado.');
  else if(!nombre)
    alert('Introduzca su nombre.');
  else if(!telefono)
    alert('Introduzca su teléfono.');
    
    
  else if(!document.envio.acepta.checked)
	alert('Tiene que aceptar la política de privacidad');    
  else
	document.envio.submit();
}

/*********** Ventana popup *************/
function js_Ventana(www,ancho,alto,titulo,target)
{
	var destino=www+'#'+target;
	var ventana=window.open(destino,titulo,'status=no,scrollbars=no,location=0,0, resizable=no,width='+ancho+',height='+alto);
	ventana.opener.top.name="opener";
	ventana.focus();
}
function paginar()
{
  document.fpaginacion.INDICE.value = document.fpaginacion.selectpag.value;
  document.fpaginacion.submit();
}



var id_imagen=1;

function mostrar_imagen(id){
  document.getElementById("img"+id_imagen).style.display = "none";
  id_imagen = id;
  document.getElementById("img"+id).style.display = ""; 
  document.getElementById("img"+id).style.visibility = "visible"; 
  document.getElementById("img"+id).style.position = "relative";
  id_mostrar_estacion=id;  
}
