
var fichNoticias ="scripts/noticias.js"

//Devuelve la fecha del sistema
// Ejemplo: Lunes, 15 de noviembre de 2004
function getFecha()
{
	dows = new Array("Domingo","Lunes","Martes","Miércoles","Jueves","Viernes","Sábado");
	months = new Array("Enero","Febrero","Marzo","Abril","Mayo","Junio","Julio","Agosto","Septiembre","Octubre","Noviembre","Diciembre");
	now = new Date();

	dow = now.getDay();
	d = now.getDate();
	m = now.getMonth();
	h = now.getTime();
	y = now.getFullYear();

	document.write(dows[dow]+", "+d+" de "+months[m]+" de "+y);
}

//función asociada a la pulsación (mouseover) de uno de los botones del menú superior
function pulsaBoton(id)
{
	var img_over = "url(/images/cabecero/fonboton_over.gif)";
	document.getElementById(id).style.backgroundImage = img_over;
	document.getElementById("desplegable").style.zIndex="1";
	//descomentar esta línea si se quiere ocultar el localizador.
	//document.getElementById("localizador").style.visibility="hidden";
}
//función asociada al onmouseouts de uno de los botones del menú superior
function sueltaBoton(id)
{
	var img_on = "url(/images/cabecero/fonboton_on.gif)";

	document.getElementById(id).style.backgroundImage = img_on;
}

//función asociada a la pulsación (mouseover) de uno de las entradas del menú de enlaces de interés
function pulsaMenuEnla(id)
{
	document.getElementById(id).style.backgroundImage = "url(../../images/cabecero/fonboton_over.gif)";
}
//función asociada al onmouseouts de las entradas del menú de enlaces de interés
function SueltaMenuEnla(id)
{
	document.getElementById(id).style.backgroundImage = "url(../../images/pixelgris.gif)";
}

/* muestra el mensaje de error recibido*/
function ventana(mensa)
{
	alert(mensa);
 /* var msgWindow
  msgWindow=window.open("",'',"toolbar=no,scrollbars=no, location=no,height=150,width=275");  
  msgWindow.document.write("<HTML><HEAD>");
  msgWindow.document.write("<TITLE>Advertencia</TITLE></HEAD>");
  msgWindow.document.write("<BODY BGCOLOR=#fffad2>"); 
  msgWindow.document.write("<TABLE BORDER=0 WIDTH=250><TR>");
  msgWindow.document.write("<TD width=50>");
  msgWindow.document.write("<IMG SRC='../../images/icoadver.gif'></TD>"); 
  msgWindow.document.write("<TD width=200><P>");
  msgWindow.document.write("<FONT FACE='Arial' SIZE=1>");
  msgWindow.document.write("<B>" + mensa + "</B>");
  msgWindow.document.write("</FONT></P></TD></TR>");
  msgWindow.document.write("<TR><TD>&nbsp;</TD>");
  msgWindow.document.write("<TD>&nbsp;</TD></TR>");
  msgWindow.document.write("<TR><TD>&nbsp;</TD>");
  msgWindow.document.write("<TD VALIGN='TOP' ALIGN='CENTER'>");
  msgWindow.document.write("<FORM><P>");
  msgWindow.document.write("<INPUT TYPE=button VALUE=Aceptar           onclick='window.close();'>");
  msgWindow.document.write("</FROM></TD></TR></TABLE>");
  msgWindow.document.write("</BODY></HTML>");*/
 }


//funciones utilizadas en servicio de prevención para mostrar y ocultar iframe.
function oculta()
{
	document.all["cur_oficina"].style.display="none";
	document.all["oficina"].src="";
	document.all["catalogo_cursos"].style.display="none";							
	document.all["catalogo"].src="";
}
			
function muestra_cursos()
{
	if(document.all["cur_oficina"].style.display=="block")
	{
		document.all["cur_oficina"].style.display="none";
		document.all["oficina"].src="";
	}
	else
	{
		document.all["cur_oficina"].style.display="block";
		document.all["oficina"].src="http://195.235.104.240/Aplicaciones/Web/catcurso.nsf/InternetSPAOficinas?OpenView&CollapseView";		
	}
}
					
function muestra_catalogo()
{
	if(document.all["catalogo_cursos"].style.display=="block")
	{
		document.all["catalogo_cursos"].style.display="none";
	}
	else
	{
		document.all["catalogo_cursos"].style.display="block";
		document.all["catalogo"].src="http://195.235.104.240/Aplicaciones/Web/catcurso.nsf/InternetSPACursos?OpenView&CollapseView";				
	}
}

//función encargada de abrir una ventana popup
function abreVentana(uFile,uX,uY,uWidth,uHeight) 
{
	var instacia;
	instancia=window.open(uFile,"PopUp","status=yes,alwaysRaised,toolbar=no,menubar=no,scrollbars=yes,resizable=yes,width=" + uWidth + ",height=" + uHeight + ",top=" + uY + ",left=" + uX );
}

//función encargada de pintar el enlace para ver el plano de situación de una dirección de centro.
//texto que aparece en el literal del enlace.
var literal="Ver mapa";

function carga_plano(indice, comunidad)
{
	document.write('<a href=javascript:abreVentana("'+comunidad[indice]+'",140,191,640,380)>'+literal+'</a>')
}

//sobrecarga de la anterior función para que reciba el texto del enlace.
function carga_plano_texto(indice, comunidad, texto)
{
	document.write("<a href=javascript:abreVentana('"+comunidad[indice]+"',140,191,640,380)>"+texto+"</a>")
}

//cambia la ruta de la imagen asociada a id_imagen
function cambia_imagen(id_imagen, ruta_imagen)
{
	document.getElementById(id_imagen).src = ruta_imagen;
}

//cambia el tamaño de las zonas principales de la página
function cambia_tamano()
{
	document.getElementById("cabecero_1").width="620";
	document.getElementById("cabecero_2").width="620";
	document.getElementById("cabecero_3").width="620";
	document.getElementById("cabecero_4").width="620";			
	document.getElementById("botonera_1").width="620";
	document.getElementById("botonera_2").width="620";					
	document.getElementById("botonera_3").width="620";		
	document.getElementById("desplegable_1").width="620";		
	document.getElementById("desplegable").style.width="617";	
}

//Función de validación de un mail.
function emailCheck (emailStr, campo) 
{

	if(emailStr != "")
	{
		/* Verificar si el email tiene el formato user@dominio. */
		var emailPat=/^(.+)@(.+)$/
	
		/* Verificar la existencia de caracteres. ( ) < > @ , ; : \ " . [ ] */
		var specialChars="\\(\\)<>@,;:\\\\\\\"\\.\\[\\]"
	
		/* Verifica los caracteres que son válidos en una dirección de email */
		var validChars="\[^\\s" + specialChars + "\]"
	
		var quotedUser="(\"[^\"]*\")"
	
		/* Verifica si la dirección de email está representada con una dirección IP Válida */
		var ipDomainPat=/^\[(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})\]$/
	
		/* Verificar caracteres inválidos */
		var atom=validChars + '+'
		var word="(" + atom + "|" + quotedUser + ")"
		var userPat=new RegExp("^" + word + "(\\." + word + ")*$")
		var domainPat=new RegExp("^" + atom + "(\\." + atom +")*$")
	
		var matchArray=emailStr.match(emailPat)
		if (matchArray==null) 
		{
			alert("Dirección E-mail incorrecta. (Compruebe @ y .'s).")
			document.getElementById(campo.id).focus();
			campo.value=""
			return false
		}
		var user=matchArray[1]
		var domain=matchArray[2]
	
		// Si el user "user" es valido 
		if (user.match(userPat)==null) 
		{
		// Si no
			alert("Dirección E-mail incorrecta. (El nombre de usuario no es válido).")
			campo.value=""
			return false
		}
	
		/* Si la dirección IP es válida */
		var IPArray=domain.match(ipDomainPat)
		if (IPArray!=null) 
		{
			for (var i=1;i<=4;i++) 
			{
				if (IPArray[i]>255) 
				{
					alert("Dirección E-mail incorrecta. (El dominio no es válido).")
					campo.value=""
					return false
				}
			}
			return true
		}
	
		var domainArray=domain.match(domainPat)
		if (domainArray==null) 
		{
			alert("Dirección E-mail incorrecta.")
			campo.value=""
			return false
		}
	
		var atomPat=new RegExp(atom,"g")
		var domArr=domain.match(atomPat)
		var len=domArr.length
		if (domArr[domArr.length-1].length<2 || domArr[domArr.length-1].length>3) 
		{
			alert("La dicrección debe tener 3 letras si es .'com' o 2 si en de algún país.")
			campo.value=""
			return false
		}
	
		if (len<2) 
		{
			var errStr="Dirección E-mail incorrecta"
			campo.value=""		
			alert(errStr)
			return false
		}
	
		// La dirección de email ingresada es Válida
		return true;
	}
	return false;
}

//hace que un campo de texto sólo acepte valores numéricos.
var nav4 = window.Event ? true : false;
function SoloNum(evt)
{
	// Backspace = 8, Enter = 13, '0' = 48, '9' = 57
	var key = nav4 ? evt.which : evt.keyCode;
	return (key <= 13 || (key >= 48 && key <= 57));
}

//pasa el valor de búsqueda a la página buspeq.htm que se carga dentro del iframe del buscador.htm
function llama_buscar(valor)
{
	if(valor != "")
	{
//		CreaCookie("buscador", valor);	
		var expdate = new Date();
		var busqueda;
	
		busqueda = valor;
		
		expdate.setTime(expdate.getTime() + (24 * 60 * 60 * 1000 * 365)); 
	
/*		if(!(busqueda = GetCookieBus("buscasoci"))) 
		{
			busqueda = "";
			alert("no la encuentra");
		}*/

		SetCookieBus("buscasoci", busqueda, expdate, "/", null, false);
		
		window.location.href = "/pages/buscar/buscador.htm?"+ valor;
	}
	else
	{
		alert("Introduzca un valor de búsqueda");
		parent.menlate.BuscarPalabrasSiguientes.focus();
	}
}

//función asociada el evento onclick del campo de búsqueda del menú lateral
function EsIntro(evt, valor)
{
	var key = nav4 ? evt.which : evt.keyCode;

	if(key == 13)
	{
		if(valor != "")
		{
			llama_buscar(valor);
		}
		else
		{
			alert("Introduzca un valor de búsqueda")
		}
	}
}

//función para detectar el navegador
function esIE30()
{
	var browserType=navigator.userAgent;

	if (browserType.indexOf("MSIE")==-1)
		return false;
	else
		return true;
}





//comprueba si existe la cookie para el tipo de SociedadPrevencion. Si existe y es alguna
//de las válidas, redirige a la página home correcta.
function tipoHome(tipo)
{
	var tipoSociedad = tipo;


	if (tipoSociedad == 1)
	{
	    var tipoSociPreve = getCookie("SociedadPrevencion");
	}    
	if(tipoSociPreve=="Soci")
	{
	   now(2);
	}
	else
	{
	 creaCookie("Soci");
	}
	
}

function now(j)
{
	var doc_HTML = " <object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000'  codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0' width='446' height='225'> "+
	  	  		   "    <param name=movie value='../../flash/intro.swf?buscar="+ j +"'>"+
	   			   "	<param name=quality value=high>"+
        		   "	<embed src='../../flash/intro.swf?buscar="+ j +"' quality=high pluginspage='http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash' type='application/x-shockwave-flash' width='446' height='225'>"+
        		   "</embed> "+
			       "</object>";

		window.document.getElementById("layer_flash").innerHTML = doc_HTML;	
}  

function creaCookie(valor)
{
	var tiempo =  new Date();
	//para que tenga una duración de un día desde la primera vez que se accedio 
	tiempo.setDate(eval(tiempo.getDate()+1)) 

	document.cookie="SociedadPrevencion=" + "SociInter;" + "expires=" + tiempo.toGMTString();
} 

function CreaCookie(nombre, valor)
{
	var tiempo =  new Date();
	//para que tenga una duración de un día desde la primera vez que se accedio 
	tiempo.setDate(eval(tiempo.getDate()+1)) 

	document.cookie= nombre + "=" + valor + ";" + "expires=" + tiempo.toGMTString();
} 


function getCookie(Name) 
{
   var search = Name + "="
   if (document.cookie.length > 0) 
   {
     // si hay cookies
     offset = document.cookie.indexOf(search)
	 
     if (offset != -1) 
     { 
        // si existe cookie
        offset += search.length 
             
        // set index of beginning of value    
        end = document.cookie.indexOf(";", offset) 
 
        // set index of end of cookie value  
        if (end == -1) 
			end = document.cookie.length 

        return unescape(document.cookie.substring(offset, end)) 
     }  
   }
}
/*------------------*/
//manejo de cookies para el buscador
function getCookieVal (offset) 
{
	var endstr = document.cookie.indexOf (";", offset);

	if (endstr == -1)
		endstr = document.cookie.length;

	return unescape(document.cookie.substring(offset, endstr));
}


function GetCookieBus (name) 
{
	var arg = name + "=";
	var alen = arg.length;
	var clen = document.cookie.length;
	var i = 0;

	while (i < clen) 
	{
		var j = i + alen;
		
		if (document.cookie.substring(i, j) == arg)
			return getCookieVal (j);

		i = document.cookie.indexOf(" ", i) + 1;

		if (i == 0) 
			break; 
	}
	return null;
}

function SetCookieBus (name, value) 

{
	var argv = SetCookieBus.arguments;
	var argc = SetCookieBus.arguments.length;
	var expires = (2 < argc) ? argv[2] : null;
	var path = (3 < argc) ? argv[3] : null;
	var domain = (4 < argc) ? argv[4] : null;
	var secure = (5 < argc) ? argv[5] : false;
	
	document.cookie = name + "=" + escape (value) +
	((expires == null) ? "" : ("; expires=" + expires.toGMTString())) +
	((path == null) ? "" : ("; path=" + path)) +
	((domain == null) ? "" : ("; domain=" + domain)) +
	((secure == true) ? "; secure" : "");

}

function ReseteaCookiBus()
{
	var expdate = new Date();
	
	expdate.setTime(expdate.getTime() + (24 * 60 * 60 * 1000 * 365)); 

	SetCookieBus("buscasoci", "", expdate , "/", null, false);
}


/*--------------*/


//campoid: nombre del campo a validar
//caract_extra: caracteres extras que se admiten como validos
//nulo: 1 el campo no puede estar vacio, 0 se admite valor nulo
//tipo: tipo de campo 'num','alfa' o 'alfanum'
function ValidaCampo(campoid, caract_extra, nulo, tipo) 
{
  var campo = document.getElementById(campoid).value;
  
  if (nulo == 1 && campo == "") 
  {
   // alert("Este campo es obligatorio")
    return false
  }
  var ubicacion
  var enter = "\n"
  
  switch(tipo)
  {
  	case 'num':
	  	var caracteres = "1234567890" + String.fromCharCode(13) + enter + caract_extra
		break;
	case 'alfa':
		var caracteres = "'`´abcdefghijklmnopqrstuvwxyzñç ABCDEFGHIJKLMNOPQRSTUVWXYZÑáéíóúÁÉÍÓÚÇâêîôûÂÊÎÔÛàèìòùÀÈÌÒÙäëïöüÄËÏÖÜ&" + String.fromCharCode(13) + enter + caract_extra  
		break;
	case 'alfanum':
		var caracteres = "'`´abcdefghijklmnopqrstuvwxyzñ1ç234567890 ABCDEFGHIJKLMNOPQRSTUVWXYZÑáéíóúÁÉÍÓÚÇâêîôûÂÊÎÔÛàèìòùÀÈÌÒÙäëïöüÄËÏÖÜ&" + String.fromCharCode(13) + enter + caract_extra  
		break;
  }

  var contador = 0
  for (var i=0; i < campo.length; i++) 
  {
    ubicacion = campo.substring(i, i + 1)
    if (caracteres.indexOf(ubicacion) != -1) 
	{
      contador++
    }
	 else 
	 {
      alert("No se acepta el caracter '" + ubicacion + "'.")
		document.getElementById(campoid).value = "";
	  	document.getElementById(campoid).focus();
      return false
    }
  }

  return true
}

var hbiselcentros = 115;

var lateral_centros = '<TABLE WIDTH=145 BORDER=0 CELLSPACING=0 CELLPADDING=0>'+
	            '<TR>'+
	            '	<TD VALIGN="TOP"><IMG SRC="../../images/info/bisel_3.gif" BORDER=0 WIDTH="145" ALT=""></TD>'+
	            '</TR>'+
	            '<TR>'+
	            '    <TD VALIGN="TOP" WIDTH=145><A HREF="../info/centros.htm" title="Volver a la Red de Centros"><IMG SRC="../../images/info/redcentros.gif" BORDER=0 ALT=""></A></TD>'+
	            '</TR>'+
	         	'<TR>'+
	            '    <TD HEIGHT=10 WIDTH=145 BACKGROUND="../../images/tra_gris.gif" CLASS="txt"><IMG SRC="../../images/pixeltrans.gif" BORDER=0 ALT=""></TD>'+
	            '</TR>'+
	            '<TR>'+
	            '    <TD BACKGROUND="../../images/tra_gris.gif" CLASS="txt" WIDTH=145 VALIGN="TOP" ALIGN="CENTER"><DIV ALIGN="CENTER">>&nbsp;<A HREF="../info/centros.htm">Volver a la Red de Centros</A></DIV></TD>'+
	            '</TR> '+
	            '<TR>'+
	            '    <TD HEIGHT=20 CLASS="txt" WIDTH=145 VALIGN="TOP" ALIGN="CENTER" BACKGROUND="../../images/tra_gris.gif"><IMG SRC="../../images/tra_gris.gif" BORDER=0 ALT=""></TD>'+
	            '</TR>'+
	            '<TR>'+
	            '    <TD BACKGROUND="../../images/tra_gris.gif" CLASS="txt" WIDTH=145 VALIGN="TOP" ALIGN="CENTER"><DIV ALIGN="CENTER">>&nbsp;<A HREF="../info/locaofi.htm">Localizador de<br>Centros</A></DIV></TD>'+
	            '</TR> '+
	            '<TR>'+
	            '    <TD HEIGHT=30 CLASS="txt" WIDTH=145 VALIGN="TOP" ALIGN="CENTER" BACKGROUND="../../images/tra_gris.gif"><IMG SRC="../../images/tra_gris.gif" BORDER=0 ALT=""></TD>'+
	            '</TR>'+
	            '<TR>'+
	            '    <TD BACKGROUND="../../images/tra_gris.gif" CLASS="txt" WIDTH=145 VALIGN="TOP" ALIGN="CENTER"><DIV ALIGN="CENTER">>&nbsp;<A HREF="../../zip/pdifremapsociedad.zip">PDI de la Red<BR>de Centros</A></DIV></TD>'+
	            '</TR> '+
	            '<TR>'+
	            '    <TD HEIGHT=30 CLASS="txt" WIDTH=145 VALIGN="TOP" ALIGN="CENTER" BACKGROUND="../../images/tra_gris.gif"><IMG SRC="../../images/tra_gris.gif" BORDER=0 ALT=""></TD>'+
	            '</TR>'+
	            '<TR>'+
	            '    <TD HEIGHT=100% WIDTH=145 BACKGROUND="../../images/tra_gris.gif">&nbsp;<BR></TD>'+
	            '</TR>'+         
	    	'</TABLE>';    
			
var lateral_centros_corto = '<TABLE WIDTH=145 BORDER=0 CELLSPACING=0 CELLPADDING=0>'+
	            '<TR>'+
	            '	<TD VALIGN="TOP"><IMG SRC="../../images/info/bisel_3.gif" BORDER=0 WIDTH="145" ALT=""></TD>'+
	            '</TR>'+
	            '<TR>'+
	            '    <TD VALIGN="TOP" WIDTH=145><A HREF="../info/centros.htm" title="Volver a la Red de Centros"><IMG SRC="../../images/info/redcentros.gif" BORDER=0 ALT=""></A></TD>'+
	            '</TR>'+
	         	'<TR>'+
	            '    <TD HEIGHT=10 WIDTH=145 BACKGROUND="../../images/tra_gris.gif" CLASS="txt"><IMG SRC="../../images/pixeltrans.gif" BORDER=0 ALT=""></TD>'+
	            '</TR>'+
	            '<TR>'+
	            '    <TD BACKGROUND="../../images/tra_gris.gif" CLASS="txt" WIDTH=145 VALIGN="TOP" ALIGN="CENTER"><DIV ALIGN="CENTER">>&nbsp;<A HREF="../info/centros.htm">Volver a Red de Centros</A></DIV></TD>'+
	            '</TR>'+
	            '<TR>'+
	            '    <TD HEIGHT=20 CLASS="txt" WIDTH=145 VALIGN="TOP" ALIGN="CENTER" BACKGROUND="../../images/tra_gris.gif"><IMG SRC="../../images/tra_gris.gif" BORDER=0 ALT=""></TD>'+
	            '</TR>'+
	            '<TR>'+
	            '    <TD BACKGROUND="../../images/tra_gris.gif" CLASS="txt" WIDTH=145 VALIGN="TOP" ALIGN="CENTER"><DIV ALIGN="CENTER">>&nbsp;<A HREF="../info/locaofi.htm">Localizador de<br>Centros</A></DIV></TD>'+
	            '</TR> '+
	            '<TR>'+
	            '    <TD HEIGHT=20 CLASS="txt" WIDTH=145 VALIGN="TOP" ALIGN="CENTER" BACKGROUND="../../images/tra_gris.gif"><IMG SRC="../../images/tra_gris.gif" BORDER=0 ALT=""></TD>'+
	            '</TR>'+

	            '<TR>'+
	            '    <TD BACKGROUND="../../images/tra_gris.gif" CLASS="txt" WIDTH=145 VALIGN="TOP" ALIGN="CENTER"><DIV ALIGN="CENTER">>&nbsp;<A HREF="../../zip/pdifremapsociedad.zip">PDI de la Red<BR>de Centros</A></DIV></TD>'+
	            '</TR> '+
				'<TR>'+
				'	<TD HEIGHT='+ hbiselcentros +' CLASS="txt" WIDTH="145" VALIGN="TOP" ALIGN="CENTER" BACKGROUND="../../images/tra_gris.gif"><IMG SRC="../../images/tra_gris.gif" BORDER=0 ALT=""></TD>'+	    	
				'</TR>'+
				'</TABLE>';                                                                

var lateral_centros_estre = '<TABLE WIDTH=99 BORDER=0 CELLSPACING=0 CELLPADDING=0 ALIGN="RIGHT">'+
	            '<TR>'+
	            '	<TD COLSPAN="2" VALIGN="TOP"><IMG SRC="../../images/info/bisel_4.gif" BORDER=0 ALT=""></TD>'+
	            '</TR>'+
	            '<TR>'+
	            '    <TD COLSPAN="2" VALIGN="TOP"><A HREF="../info/centros.htm" title="Volver a la Red de Centros"><IMG SRC="../../images/info/redcentros1.gif" BORDER=0 ALT=""></A></TD>'+
	            '</TR>'+
	         	'<TR>'+
	            '    <TD COLSPAN="2" HEIGHT=10 WIDTH=99 BACKGROUND="../../images/tra_gris.gif" CLASS="txt"><IMG SRC="../../images/pixeltrans.gif" BORDER=0 ALT=""></TD>'+
	            '</TR>'+
	            '<TR>'+
	            '    <TD BACKGROUND="../../images/tra_gris.gif" CLASS="txt"><IMG SRC="../../images/pixeltrans.gif" WIDTH="6" BORDER=0 ALT=""></TD>'+
	            '    <TD BACKGROUND="../../images/tra_gris.gif" CLASS="txt" WIDTH=93 VALIGN="TOP" ALIGN="LEFT"><DIV ALIGN="LEFT">>&nbsp;<A HREF="../info/centros.htm">Volver a Red<BR>de Centros</A></DIV></TD>'+
	            '</TR>'+
	            '<TR>'+
	            '    <TD COLSPAN="2" HEIGHT=20 CLASS="txt" WIDTH=99 VALIGN="TOP" ALIGN="CENTER" BACKGROUND="../../images/tra_gris.gif"><IMG SRC="../../images/tra_gris.gif" BORDER=0 ALT=""></TD>'+
	            '</TR>'+
	            '<TR>'+
	            '    <TD BACKGROUND="../../images/tra_gris.gif" CLASS="txt"><IMG SRC="../../images/pixeltrans.gif" WIDTH="6" BORDER=0 ALT=""></TD>'+
	            '    <TD BACKGROUND="../../images/tra_gris.gif" CLASS="txt" WIDTH=93 VALIGN="TOP" ALIGN="LEFT"><DIV ALIGN="LEFT">>&nbsp;<A HREF="../info/locaofi.htm">Localizador<br>de Centros</A></DIV></TD>'+
	            '</TR> '+
	            '<TR>'+
	            '    <TD COLSPAN="2" HEIGHT=20 CLASS="txt" WIDTH=99 VALIGN="TOP" ALIGN="CENTER" BACKGROUND="../../images/tra_gris.gif"><IMG SRC="../../images/tra_gris.gif" BORDER=0 ALT=""></TD>'+
	            '</TR>'+

	            '<TR>'+
	            '    <TD BACKGROUND="../../images/tra_gris.gif" CLASS="txt"><IMG SRC="../../images/pixeltrans.gif" WIDTH="6" BORDER=0 ALT=""></TD>'+
	            '    <TD BACKGROUND="../../images/tra_gris.gif" CLASS="txt" WIDTH=93 VALIGN="TOP" ALIGN="LEFT"><DIV ALIGN="LEFT">>&nbsp;<A HREF="../../zip/pdifremapsociedad.zip">PDI de la Red<BR>de Centros</A></DIV></TD>'+
	            '</TR> '+
	            '<TR>'+
	            '    <TD COLSPAN="2" HEIGHT=10 CLASS="txt" WIDTH=99 VALIGN="TOP" ALIGN="CENTER" BACKGROUND="../../images/tra_gris.gif"><IMG SRC="../../images/tra_gris.gif" BORDER=0 ALT=""></TD>'+
	            '</TR>'+
	            '<TR>'+
	            '    <TD COLSPAN="2" CLASS="txt" HEIGHT="23" VALIGN="TOP" ALIGN="CENTER" BACKGROUND="../../images/tra_gris.gif"><IMG SRC="../../images/info/leyenda.gif" BORDER=0 ALT=""></TD>'+
	            '</TR> '+
				
				'</TABLE>';
							                                                           
var centros_supe = '<TABLE WIDTH="605" BORDER="0" CELLSPACING="0" CELLPADDING="0">'+
                        '<TR>'+
                              '<TD COLSPAN="4">'+
                              '<IMG SRC="../../images/tra_gris.gif" BORDER=0 ALT="">'+
                              '</TD>'+
                        '</TR>'+
                        '<TR>'+
                              '<TD CLASS="txt" WIDTH="25%">'+
                              '<A HREF="../info/centros.htm" title="Volver a la Red de Centros"><IMG SRC="../../images/info/redcentros.gif" BORDER=0 ALT=""></A>'+
                              '</TD>'+
                              
                              '<TD CLASS="txt" WIDTH="25%">'+
                              '<DIV ALIGN="CENTER">>&nbsp;<A HREF="../info/centros.htm">Volver a Red<BR>de Centros</A></DIV>'+
                              '</TD>'+
                              
                              '<TD CLASS="txt" WIDTH="25%">'+
                              '<DIV ALIGN="CENTER">>&nbsp;<A HREF="../info/locaofi.htm">Localizador<br>de Centros</A></DIV>'+
                              '</TD>'+
                              
                              '<TD CLASS="txt" WIDTH="25%">'+
                              '<DIV ALIGN="CENTER">>&nbsp;<A HREF="../../zip/pdifremapsociedad.zip">PDI de la Red<BR>de Centros</A></DIV>'+
                              '</TD>'+
                        '</TR>'+
                        '<TR>'+
                              '<TD COLSPAN="4">'+
                              '<IMG SRC="../../images/tra_gris.gif" BORDER=0 ALT="">'+
                              '</TD>'+
                        '</TR>'+
                  '</TABLE>';
																	   
//Validación de fechas
function fechas(campo)
{ 
   caja = campo.value;
   
   if (caja)
   {  
      borrar = caja;
      if ((caja.substr(2,1) == "/") && (caja.substr(5,1) == "/"))
      {      
         for (i=0; i<10; i++)
	     {	
            if (((caja.substr(i,1)<"0") || (caja.substr(i,1)>"9")) && (i != 2) && (i != 5))
			{
               borrar = "";
               break;  
			}  
         }
	     if (borrar)
	     { 
	        a = caja.substr(6,4);
		    m = caja.substr(3,2);
		    d = caja.substr(0,2);
		    if((a < 1900) || (a > 2050) || (m < 1) || (m > 12) || (d < 1) || (d > 31))
		       borrar = "";
		    else
		    {
		       if((a%4 != 0) && (m == 2) && (d > 28))	   
		          borrar = ""; // Año no viciesto y es febrero y el dia es mayor a 28
			   else	
			   {
		          if ((((m == 4) || (m == 6) || (m == 9) || (m==11)) && (d>30)) || ((m==2) && (d>29)))
			         borrar = "";	      				  	 
			   }  // else
		    } // fin else
         } // if (error)
      } // if ((caja.substr(2,1) == \"/\") && (caja.substr(5,1) == \"/\"))			    			
	  else
	     borrar = "";
	  if (borrar == "")
	  {
        str = "Formato de fecha no permitido,";
        str = str +" el correcto debe ser dd/mm/aa, ";
        str = str +"donde dd corresponden al dia, ";
        str = str +"mm al mes y aa al año (las dos ";
        str = str +"últimas cifras del año), ";
        str = str +"sólo se admiten valores numéricos.";                 
		campo.value="";
        alert(str);
		}
   }
} 

