function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}
function navegador() {
var browsName = navigator.appName;
if (browsName == "Netscape") {
	if((parseInt(navigator.appVersion)>4)) alert ("\nPara establecer Cervantesvirtual.com como página de inicio:\n\n Arrastre la dirección Cervantesvirtual.com del navegador\nhasta el botón de Home situado debajo\n");
	else alert ("\nPara establecer Cervantesvirtual.com como página de inicio:\n\n Abra el menú Edit y seleccione la pestaña Preferences\n En la casilla location introduzca la siguiente dirección\n http://www.cervantesvirtual.com y pulse OK");
} else if (browsName == "Opera") alert ("\nPara establecer Cervantesvirtual.com como página de inicio:\n\n Abra el menú Navegación y seleccione la pestaña Configurar página principal...\n En la casilla de abajo introduzca la siguiente dirección\n http://www.cervantesvirtual.com y pulse OK");
}

function imprSelec(cod)
{
  var url ="ampliar_prensa.jsp?codigo="+cod;
  var ventimp = window.open(url, 'popimpr');
  ventimp.print( );
} 

function imprSelec2(nombre)
{
  var ficha = document.getElementById(nombre);
  var ventimp = window.open(' ', 'popimpr');
  ventimp.document.write("<!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML 4.01 Transitional//EN'><html lang='es'><head><title>Taller digital Universidad de Alicante - Versión para imprimir</title><meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'><link href='estilos.css' rel='stylesheet' type='text/css'></head><body id='imprimir'>");
  ventimp.document.write(ficha.innerHTML);
  ventimp.document.write("</body></html>");
  ventimp.document.close();
  ventimp.print( );
  ventimp.close();
} 

/* Comprobar campos del formulario */

function esNumerico(strString)
{
   var strValidChars = "0123456789.-";
   var strChar;
   var blnResult = true;

   if (strString.length == 0) return true;

   //  test strString consists of valid characters listed above
   for (i = 0; i < strString.length && blnResult == true; i++)
      {
      strChar = strString.charAt(i);
      if (strValidChars.indexOf(strChar) == -1)
         {
         blnResult = false;
         }
      }
   return blnResult;
}
function esEmail(campo){var strMail = campo;var patMail = /^(.+)@(.+)$/;var patUser = /^[a-zA-Z\d_-]+(\.[a-zA-Z\d_-]+)*$/;var patDomainIP = /^(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})$/;var patDomain = /^[a-zA-Z\d_-]+(\.[a-zA-Z\d_-]+)+$/;var matchArray = strMail.match(patMail);if(matchArray == null) {  return false; }  var user = new String(matchArray[1]);  var domain = new String(matchArray[2]);  if(user.match(patUser) == null)  {   return false;  }  var IPArray = domain.match(patDomainIP);  if(IPArray != null)  {   for (var i=1;i<=4;i++)   {    	if(IPArray[i]>255)    {     		return false;    	}  }   return true;  }  var domainArray = domain.match(patDomain);    if(domainArray == null)  {     return false;  }    if(domainArray[domainArray.length - 1].length < 3 || domainArray[domainArray.length - 1].length > 4)  {      return false;  }  return true;}


/* Para el formulario Eviar dirección a un amigo */
function ValidarEnviar(){ 
 var f = window.document.enviarnoticia;
 if (!(f.nombre.value))
{ 
 alert('El campo "Nombre" debe tener algún valor.'); f.nombre.select();f.nombre.focus();return false;
}
 if (!(f.email.value))
{ 
 alert('El campo "Tu e-mail" debe tener algún valor.'); f.email.select();f.email.focus();return false;
}
 if (!esEmail(f.email.value))
{ 
 alert('El campo "Tu e-mail" debe ser un email válido.'); f.email.select();f.email.focus();return false;
}
  if (!(f.email2.value))
{ 
 alert('El campo "E-mail de tu amigo" debe tener algún valor.'); f.email.select();f.email.focus();return false;
}
 if (!esEmail(f.email2.value))
{ 
 alert('El campo "E-mail de tu amigo" debe ser un email válido.'); f.email.select();f.email.focus();return false;
}

return true;
}

/* Para el formulario Contacte con nosotros */
function ValidarContacte(){ 
	var f = window.document.contacte;
	if (!(f.persona.value))
	{ 
		alert('El campo "Persona de contacto" debe tener algún valor.');f.persona.select();f.persona.focus();return false;
	}	
	if (!(f.telefono.value || f.email.value))
	{
		alert('Debe dejarnos o un teléfono o una dirección de correo para poder ponernos en contacto.');f.telefono.select();f.telefono.focus();return false;	
	}
	if (!esNumerico(f.telefono.value))
	{ 
		alert('El campo "Teléfono" no es correcto.'); f.telefono.select();f.telefono.focus();return false;
	}	
	if ((f.email.value)) {
		if (!esEmail(f.email.value))
		{ 
			alert('El campo "E-mail" debe ser un email válido.'); f.email.select();f.email.focus();return false;
		}
	}
	return true;
}

/* Para el formulario de suscripción */
function ValidarSuscripcion(){ 
	var f = window.document.suscripcion;
	if (!(f.persona.value))
	{ 
		alert('El campo "Persona de contacto" debe tener algún valor.');f.persona.select();f.persona.focus();return false;
	}	
	if (!(f.telefono.value || f.email.value))
	{
		alert('Debe dejarnos o un teléfono o una dirección de correo para poder ponernos en contacto.');f.telefono.select();f.telefono.focus();return false;	
	}
	if (!esNumerico(f.telefono.value))
	{ 
		alert('El campo "Teléfono" no es correcto.'); f.telefono.select();f.telefono.focus();return false;
	}	
	if ((f.email.value)) {
		if (!esEmail(f.email.value))
		{ 
			alert('El campo "E-mail" debe ser un email válido.'); f.email.select();f.email.focus();return false;
		}
	}
	return true;
}


  var zwin=""; var nav=navigator.appName.indexOf("Netscape"); var vers=parseInt(navigator.appVersion);
  
  function vervideo(pdir,parchivo,pvideo,ptitulo,pv,pw,ph) {
    if ( (nav != -1 && vers >= 3) || (vers >= 4) ) {
      if (zwin == "" || zwin.closed == 1) {
        var zw=pw;
        var zh=ph;
		var c='WIDTH='+ zw + ',HEIGHT='+ zh +',left=200,top=100,toolbar=no,scrollbars=yes,resizable=yes';
        zwin=window.open("vervideo.jsp?dir="+pdir+"&archivo="+parchivo+"&video="+pvideo+"&titulo="+ptitulo+"&v="+pv,"zi",c);
        zwin.document.close();
      }
    }
  }

 function ocultamenu(capa){
  var menu = document.getElementById(capa);
  menu.style.display = "none";
}
function despliega(capa){
  var menu = document.getElementById(capa);
    if(menu.style.display == "none"){
      menu.style.display = "block";
    }
    else{
      menu.style.display = "none";
    }
}



