
function abrir(url,nombre,scrollbar,width,height){
    window.open(url,nombre,scrollbar,width,height)
}


function centrar(theDiv,h,v,hPx,vPx){
    var obj,fun,dw,dh,lw,lh,x,y,offset;
    if(document.all) {
        offset = 308; //Explorer
    } else {
        offset = 318; //Netscape
    }
    fun = (document.getElementById) ? "document.getElementById" : "MM_findObj";
    obj = (document.getElementById) ? document.getElementById(theDiv) : MM_findObj(theDiv);
    if(obj){if(document.all){
    dw = document.body.clientWidth;dh = document.body.clientHeight;}
    else{dw = innerWidth;dh = innerHeight;}
    if(document.layers){lw = obj.clip.width;lh = obj.clip.height;}else{
    lw = obj.style.width.replace("px","");lh = obj.style.height.replace("px","");}
    dw = dw/2 - lw/2 - offset;
    x = (document.layers) ? ".left" : ".style.left";
    y = (document.layers) ? ".top" : ".style.top";
    eval(fun+"('"+theDiv+"')"+x+"="+dw);
    }
}


function centrar2(theDiv,h,v,hPx,vPx){
    var obj,fun,dw,dh,lw,lh,x,y,offset;
    if(document.all) {
        offset = 280; //Explorer
    } else {
        offset = 288; //Netscape
    }
    fun = (document.getElementById) ? "document.getElementById" : "MM_findObj";
    obj = (document.getElementById) ? document.getElementById(theDiv) : MM_findObj(theDiv);
    if(obj){if(document.all){
    dw = document.body.clientWidth;dh = document.body.clientHeight;}
    else{dw = innerWidth;dh = innerHeight;}
    if(document.layers){lw = obj.clip.width;lh = obj.clip.height;}else{
    lw = obj.style.width.replace("px","");lh = obj.style.height.replace("px","");}
    dw = dw/2 - lw/2 - offset;
    x = (document.layers) ? ".left" : ".style.left";
    y = (document.layers) ? ".top" : ".style.top";
    eval(fun+"('"+theDiv+"')"+x+"="+dw);
    }
}


function centrar3(theDiv,h,v,hPx,vPx){
    var obj,fun,dw,dh,lw,lh,x,y,offset;
    if(document.all) {
        offset = 146; //Explorer
    } else {
        offset = 154; //Netscape
    }
    fun = (document.getElementById) ? "document.getElementById" : "MM_findObj";
    obj = (document.getElementById) ? document.getElementById(theDiv) : MM_findObj(theDiv);
    if(obj){if(document.all){
    dw = document.body.clientWidth;dh = document.body.clientHeight;}
    else{dw = innerWidth;dh = innerHeight;}
    if(document.layers){lw = obj.clip.width;lh = obj.clip.height;}else{
    lw = obj.style.width.replace("px","");lh = obj.style.height.replace("px","");}
    dw = dw/2 - lw/2 - offset;
    x = (document.layers) ? ".left" : ".style.left";
    y = (document.layers) ? ".top" : ".style.top";
    eval(fun+"('"+theDiv+"')"+x+"="+dw);
    }
}


function P7_MultiMove() { //v1.2 PVII
  var a,b,x,xx,y,yy,args=P7_MultiMove.arguments;
    for (i=0; i<(args.length-3); i+=4) if ((a=MM_findObj(args[i]))!=null) {
      b=(document.layers)?a:a.style;x=args[i+1];y=args[i+2];
      if (args[i+3]==1) {
         xx=(parseInt(b.left))?parseInt(b.left):0;
     yy=(parseInt(b.top))?parseInt(b.top):0;
       x+=xx;y+=yy;
      }
      b.left = parseInt(x);b.top = parseInt(y);
    }
}


function fecha()
{
today = new Date()
day = today.getDay()
if ( day == 0 ) {
document.write("Domingo, ");
}
if ( day == 1 ) {
document.write("Lunes, ");
}
if ( day == 2 ) {
document.write("Martes, ");
}
if ( day == 3 ) {
document.write("Miércoles, ");
}
if ( day == 4 ) {
document.write("Jueves, ");
}
if ( day == 5 ) {
document.write("Viernes, ");
}
if ( day == 6 ) {
document.write("Sábado, ");
}

today = new Date()
hours = today.getHours()
minutes = today.getMinutes()
year = parseInt(today.getYear(),10)

zerom = ''
zeroh = ''
if ( minutes < 10 ) { zerom = 0 }
if ( hours < 10 ) { zeroh = 0 }

if ( today.getMonth() == 0 ) { month = "Enero" }
if ( today.getMonth() == 1 ) { month = "Febrero" }
if ( today.getMonth() == 2 ) { month = "Marzo" }
if ( today.getMonth() == 3 ) { month = "Abril" }
if ( today.getMonth() == 4 ) { month = "Mayo" }
if ( today.getMonth() == 5 ) { month = "Junio" }
if ( today.getMonth() == 6 ) { month = "Julio" }
if ( today.getMonth() == 7 ) { month = "Agosto" }
if ( today.getMonth() == 8 ) { month = "Septiembre" }
if ( today.getMonth() == 9 ) { month = "Octubre" }
if ( today.getMonth() == 10 ) { month = "Noviembre" }
if ( today.getMonth() == 11 ) { month = "Diciembre" }
if ( today.getYear() == 99 ) { year = "1999" }
if ( today.getYear() == 0 || today.getYear() == 100 || today.getYear() == 2000) { year = "2000" }

document.write( today.getDate()," de ",month," de ",year );
}


function abrirpopup(nombre,ancho,alto,cerrar) {
dat = 'width=' + ancho + ',height=' + alto + ',left=0,top=0,scrollbars=no,resize=no';
ventana=window.open(nombre,'',dat);
if (cerrar == 1) setTimeout("ventana.close()",20*1000);
}


function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}


function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}


function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}


function MM_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}


function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}


function regenerate(){
window.location.reload()
}


function regenerate2(){
if (document.layers){
setTimeout("window.onresize=regenerate",450)
intializemarquee()
}
}


function intializemarquee(){
document.cmarquee01.document.cmarquee02.document.write(marqueecontents)
document.cmarquee01.document.cmarquee02.document.close()
thelength=document.cmarquee01.document.cmarquee02.document.height
scrollit()
}


function scrollit(){
if (document.cmarquee01.document.cmarquee02.top>=thelength*(-1)){
document.cmarquee01.document.cmarquee02.top-=speed
setTimeout("scrollit()",75)
}
else{
document.cmarquee01.document.cmarquee02.top=marqueeheight
scrollit()
}
}


function desplz_marquee(mensaje,ancho,alto,vel){
// ancho
var marqueewidth=ancho
// alto
var marqueeheight=alto
// velocidad
var speed=vel
// contenido
var marqueecontents=mensaje


// cambio el contenido de marquee
var marqueecontents=mensaje


document.write('<marquee behavior= "scroll" direction="up" scrollAmount='+speed+' width='+marqueewidth+' height='+marqueeheight+' onmouseover="this.stop()" onmouseout="this.start()">'+marqueecontents+'</marquee>')
}


function saltar_pagina( url, post_actual, total_posts )
{
msg = "Por favor, escribe un número entre 1 y" + " " + total_posts;
if ( post_actual < total_posts )   { show_page = post_actual + 1; }
if ( post_actual >= total_posts )  { show_page = post_actual - 1; }
userPage = prompt( msg, show_page );
if ( userPage > 0  )
{
    if ( userPage < 1 )             { userPage = 1;  }
    if ( userPage > total_posts )   { userPage = total_posts; }
    window.location = url + userPage;
}
}


/* dice si cadena es url (http://... ) o no */
function url(cadena)
{
    // DECLARACION DE CONSTANTES
    var http = "http://";              // protocolo HTTP
                                       // DECLARACION DE VARIABLES
    var es_url;                        // cadena es url o no
    if(cadena.length <= 7)             // INICIO
      es_url = false;                  // no cabe "http://*"
    else
      es_url = http.indexOf(cadena.substring(0, 7)) != - 1; // lee "http://*"
    return(es_url);
}


/* salta caracteres alfanumericos y otros a partir de  cadena[i]  y  da  si- */
/* guiente posicion                                                          */
function salta_alfanumerico(cadena, i, otros)
{
    // DECLARACION DE VARIABLES
    var j;                             // indice en cadena
    var car;                           // caracter de cadena
    var alfanum;                       // cadena[j] es alfanumerico u otros
    for(j = i, alfanum = true; (j < cadena.length) && alfanum; j++) // INICIO
      {
        car = cadena.charAt(j);
        alfanum = alfanumerico(car) || (otros.indexOf(car) != -1);
      }
    if(!alfanum)                       // lee "alfanumX"
      j--;
    return(j);
}


/* dice si car es alfanumerico */
function alfanumerico(car)
{
    return(alfabetico(car) || numerico(car));
}


/* dice si car es alfabetico */
function alfabetico(car)
{
    var alfa = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"; // caracteres alfabeticos
    return(alfa.indexOf(car) != - 1);  // INICIO
}


/* dice si car es numerico */
function numerico(car)
{
    var num = "0123456789";            // caracteres numericos
    return(num.indexOf(car) != - 1);   // INICIO
}


/* dice si cadena es texto no vacio o no */
function vacio(cadena)
{
    // DECLARACION DE CONSTANTES
    var blanco = " \n\t" + String.fromCharCode(13); // blancos
                                       // DECLARACION DE VARIABLES
    var i;                             // indice en cadena
    var es_vacio;                      // cadena es vacio o no
    for(i = 0, es_vacio = true; (i < cadena.length) && es_vacio; i++) // INICIO
    es_vacio = blanco.indexOf(cadena.charAt(i)) != - 1;
    return(es_vacio);
}


/* dice si cadena es un email (alfanum@alfanum.alfanum[.alfanum]) o no, don- */
/* de alfanum son caracteres alfanumericos u otros                           */
function email(cadena, otros)
{
    // DECLARACION-INICIALIZACION VARIABLES
    var i, j;                          // indice en cadena
    var es_email = 0 < cadena.length;  // cadena es email o no
    i = salta_alfanumerico(cadena, 0, otros); // INICIO
    if(es_email = 0 < i)               // lee "alfanum*"
      if(es_email = (i < cadena.length))
        if(es_email = cadena.charAt(i) == '@') // lee "alfanum@*"
          {
            i++;
            j = salta_alfanumerico(cadena, i, otros);
            if(es_email = i < j)       // lee "alfanum@alfanum*"
              if(es_email = j < cadena.length)
                if(es_email = cadena.charAt(j) == '\.')
                  {                    // lee "alfanum@alfanum.*"
                    j++;
                    i = salta_alfanumerico(cadena, j, otros);
                    if(es_email = j < i) // lee "alfanum@alfanum.alfanum*"
                      while(es_email && (i < cadena.length))
                        if(es_email = cadena.charAt(i) == '\.')
                          {
                            i++;
                            j = salta_alfanumerico(cadena, i, otros);
                            if(es_email = i < j) // lee "alfanum@alfanum.alfanum[.alfanum]*"
                              i = j;
                          }
                  }
          }
    return(es_email);
}


function ValidaCamposEnlace(form)
{
    if(vacio(form.nombre.value)) {
        alert("Debe introducir el nombre del enlace.");
        form.nombre.focus();
    }
    else if(vacio(form.url.value)) {
        alert("Debe introducir la dirección URL del enlace.");
        form.url.focus();
    }
    else if(!vacio(form.url.value) && !url(form.url.value)) {
        alert("Dirección URL incorrecta.");
        form.url.focus();
    }
    else
      return(true);
    return(false);
}


function ValidaCamposEvento(form)
{
    if(vacio(form.evento.value)) {
      alert("Debe introducir el Título del evento.");
      form.evento.focus();
    }
    else if(vacio(form.descripcion.value) || (form.descripcion.value == 'Introduzca el texto del evento...')) {
      alert("Debe introducir la Descripción del evento.");
      form.descripcion.focus();
    }
    else
      return(true);
    return(false);
}


function ValidaCamposMensaje(form)
{
    if(vacio(form.nombre.value)) {
        alert("Debe introducir su nombre.");
        form.nombre.focus();
    }
    else if(vacio(form.mensaje.value) || (form.mensaje.value == 'Escriba aquí su mensaje')) {
        alert("Debe introducir su mensaje.");
        form.mensaje.focus();
    }
    else if(vacio(form.correo.value)) {
        alert("Debe introducir su dirección Email.");
        form.correo.focus();
    }
    else if(!vacio(form.correo.value) && !email(form.correo.value, "-_")) {
        alert("Dirección Email incorrecta.");
        form.correo.focus();
    }
    else if(vacio(form.codigo.value)) {
        alert("Debe introducir el código que aparece en la imagen.");
        form.codigo.focus();
    }
    else
      return(true);
    return(false);
}


function ValidaCamposSugerencia(form)
{
    var tfno = /(^([0-9]{9,9})|^)$/ // 9 numeros o cadena vacia

    if(vacio(form.nombre.value)) {
        alert("Debe introducir su nombre.");
        form.nombre.focus();
    }
    else if(vacio(form.sugerencia.value) || (form.sugerencia.value == 'Escriba aquí su sugerencia')) {
        alert("Debe introducir su sugerencia.");
        form.sugerencia.focus();
    }
    else if(vacio(form.correo.value) && vacio(form.telefono.value)) {
        alert("Debe introducir su teléfono o su dirección Email.");
        form.telefono.focus();
    }
    else if(!tfno.test(form.telefono.value)) {
        alert("Número de teléfono incorrecto.");
        form.telefono.focus();
    }    
    else if(!vacio(form.correo.value) && !email(form.correo.value, "-_")) {
        alert("Dirección Email incorrecta.");
        form.correo.focus();
    }
    else
      return(true);
    return(false);
}


function ValidaCamposContacto(form)
{
    var tfno = /(^([0-9]{9,9})|^)$/ // 9 numeros o cadena vacia

    if(vacio(form.nombre.value)) {
        alert("Debe introducir su nombre.");
        form.nombre.focus();
    }
    else if(vacio(form.consulta.value) || (form.consulta.value == 'Escriba aquí su consulta')) {
        alert("Debe introducir su consulta.");
        form.consulta.focus();
    }
    else if(vacio(form.correo.value) && vacio(form.telefono.value)) {
        alert("Debe introducir su teléfono o su dirección Email.");
        form.telefono.focus();
    }
    else if(!tfno.test(form.telefono.value)) {
        alert("Número de teléfono incorrecto.");
        form.telefono.focus();
    }
    else if(!vacio(form.correo.value) && !email(form.correo.value, "-_")) {
        alert("Dirección Email incorrecta.");
        form.correo.focus();
    }
    else
      return(true);
    return(false);
}


function ValidaCamposExperto(form)
{
    if(vacio(form.nombre.value)) {
        alert("Debe introducir su nombre.");
        form.nombre.focus();
    }
    else if(vacio(form.consulta.value)) {
        alert("Debe introducir su consulta.");
        form.consulta.focus();
    }
    else if(vacio(form.correo.value)) {
        alert("Debe introducir su dirección Email.");
        form.correo.focus();
    }
    else if(!vacio(form.correo.value) && !email(form.correo.value, "-_")) {
        alert("Dirección Email incorrecta.");
        form.correo.focus();
    }
    else
      return(true);
    return(false);
}


function viewHide(id,total) {
    var targetElement,i;
    var targetElement = document.getElementById(id);

    if (targetElement.style.display == "none") {
        targetElement.style.display = "";
        document.getElementById('tabla_up').style.display = "";
    } else {
        targetElement.style.display = "none";
        document.getElementById('tabla_up').style.display = "none";
    }

    for (i = 1; i <= total; i++)
        if (('tabla' + i) != id) document.getElementById('tabla' + i).style.display = "none";
}


function viewHideSection(sec_name,id,total) {
    var targetElement,i;
    var targetElement = document.getElementById(id);

    if (targetElement.style.display == "none") {
        targetElement.style.display = "";
        document.getElementById('tabla_up').style.display = "";
    } else {
        targetElement.style.display = "none";
        document.getElementById('tabla_up').style.display = "none";
    }

    for (i = 1; i <= total; i++)
        if ((sec_name + i) != id) document.getElementById(sec_name + i).style.display = "none";
}


function ValidaCamposNoticia(form)
{
    if(vacio(form.titulo.value)) {
      alert("Debe introducir el Título de la noticia.");
      form.titulo.focus();
    }
    else if(vacio(form.contenido.value) || (form.contenido.value == 'Introduzca el texto de la noticia...')) {
      alert("Debe introducir el Contenido de la noticia.");
      form.contenido.focus();
    }
    else
      return(true);
    return(false);
}


function ValidaBusqueda(form) {
    if(vacio(form.buscar.value))
      form.buscar.focus();
    else
      return(true);
    return(false);
}


function elimina_noticia(id) {
    if (confirm('¿Está seguro de que desea eliminar esta noticia?'))
        window.open('action_not.php?id=' + id + '&op=2#subir', '_self');
}


function elimina_enlace(id) {
    if (confirm('¿Está seguro de que desea eliminar este enlace?'))
        window.open('action_link.php?id=' + id + '&op=2#subir', '_self');
}


function elimina_evento(id,zona) {
	var path = "";

	if (zona == 6) path = "../admin/";

    if (confirm('¿Está seguro de que desea eliminar este evento?'))
        window.open(path + 'action_cal.php?id=' + id + '&op=3', '_self');
}


// Elimina el mensaje de información del txtarea para poder escribir uno nuevo
function eliminaInfo(name_form, name_txtarea, txtinfo) {
    var txtarea = eval('document.'+name_form+'.'+name_txtarea);

    if ((txtarea.value == txtinfo) && (txtarea.value.length == txtinfo.length)) {
        txtarea.value = '';
    }
}


// Permite introducir únicamente dígitos en un campo de formulario
function validar(e) {
    tecla_codigo = (document.all) ? e.keyCode : e.which;
    if (tecla_codigo < 10) return true;
    patron =/[0-9]/;
    tecla_valor = String.fromCharCode(tecla_codigo);
    return patron.test(tecla_valor);
}


// Funciones para mostrar popups mediante capas
function muestra_imagen_back(archivo,ancho,alto){
  xWidth ('popup',ancho + 2)
  xHeight ('popup',alto + 20 + 22)
  xWidth ('imagen',ancho)
  xHeight ('imagen',alto)

  if (navigator.appName.indexOf("Explorer") != -1) {
      xWidth ('cerrar_sup',ancho)
      xHeight ('cerrar_sup',20)
      xWidth ('cerrar_inf',ancho)
      xHeight ('cerrar_inf',20)
  }

  xInnerHtml('imagen', '<img src="' + archivo + '" width="' + ancho + '" height="' + alto + '" border="0">')

  pos_left = parseInt((xClientWidth()-ancho)/2)
  pos_top = 150;

  xMoveTo('popup',pos_left,pos_top)

  setTimeout("xShow('popup')",2500)
}


// Funciones para mostrar popups mediante capas
function muestra_imagen(archivo,ancho,alto){
  xWidth ('popup',ancho + 2)
  xHeight ('popup',alto + 20 + 22)
  xWidth ('imagen',ancho)
  xHeight ('imagen',alto)

  if (navigator.appName.indexOf("Explorer") != -1) {
      xWidth ('cerrar_sup',ancho)
      xHeight ('cerrar_sup',20)
      xWidth ('cerrar_inf',ancho)
      xHeight ('cerrar_inf',20)
  }

  xInnerHtml('imagen', '<img src="' + archivo + '" width="' + ancho + '" height="' + alto + '" border="0">')

  pos_left = parseInt((xClientWidth()-ancho)/2)
  pos_top = 200;

  xMoveTo('popup',pos_left,pos_top)

  setTimeout("xShow('popup')",2500)
}


function muestra_cartel(archivo,ancho,alto){
  xWidth ('popup',ancho + 2)
  xHeight ('popup',alto + 20 + 22)
  xWidth ('imagen',ancho)
  xHeight ('imagen',alto)

  if (navigator.appName.indexOf("Explorer") != -1) {
      xWidth ('cerrar_sup',ancho)
      xHeight ('cerrar_sup',20)
      xWidth ('cerrar_inf',ancho)
      xHeight ('cerrar_inf',20)
  }

  xInnerHtml('imagen', '<a href="descargas/hemeroteca/panfletos/comunes/2010/panfleto_cm012010.pdf" target="_blank" onClick="javascript:cerrar_popup()"><img src="' + archivo + '" width="' + ancho + '" height="' + alto + '" border="0"></a>')

  pos_left = parseInt((xClientWidth()-ancho)/2)
  pos_top = 150;

  xMoveTo('popup',pos_left,pos_top)

  setTimeout("xShow('popup')",2500)
}


function muestra_proyecto_back(archivo,ancho,alto){
  xWidth ('popup',ancho + 2)
  xHeight ('popup',alto + 20 + 22)
  xWidth ('imagen',ancho)
  xHeight ('imagen',alto)

  if (navigator.appName.indexOf("Explorer") != -1) {
      xWidth ('cerrar_sup',ancho)
      xHeight ('cerrar_sup',20)
      xWidth ('cerrar_inf',ancho)
      xHeight ('cerrar_inf',20)
  }

  xInnerHtml('imagen', '<img src="' + archivo + '" width="' + ancho + '" height="' + alto + '" border="0">')

  pos_left = parseInt((xClientWidth()-ancho)/2)
  pos_top = 150;

  xMoveTo('popup',pos_left,pos_top)

  setTimeout("xShow('popup')",2500)
}


function muestra_proyecto(archivo,ancho,alto){
  xWidth ('popup',ancho + 2)
  xHeight ('popup',alto + 20 + 22)
  xWidth ('imagen',ancho)
  xHeight ('imagen',alto)

  if (navigator.appName.indexOf("Explorer") != -1) {
      xWidth ('cerrar_sup',ancho)
      xHeight ('cerrar_sup',20)
      xWidth ('cerrar_inf',ancho)
      xHeight ('cerrar_inf',20)
  }

  xInnerHtml('imagen', '<a href="descargas/hemeroteca/documentos/2011/proyecto_pms.pdf" target="_blank" onClick="javascript:cerrar_popup()"><img src="' + archivo + '" width="' + ancho + '" height="' + alto + '" border="0"></a>')

  pos_left = parseInt((xClientWidth()/2)+30)
  pos_top = 150;

  xMoveTo('popup',pos_left,pos_top)

  setTimeout("xShow('popup')",2500)
}


// Funciones para mostrar popups mediante capas
// Esta función es una variante de la función: muestra_imagen
// Muestra el pliego de alegaciones de SIP-AN que se divide en dos partes
function muestra_pliego(){
  xWidth ('popup',502)
  xHeight ('popup',338)
  xWidth ('imagen1',500)
  xHeight ('imagen1',260)
  xWidth ('imagen2',500)
  xHeight ('imagen2',36)

  if (navigator.appName.indexOf("Explorer") != -1) {
      xWidth ('cerrar_sup',500)
      xHeight ('cerrar_sup',20)
      xWidth ('cerrar_inf',500)
      xHeight ('cerrar_inf',20)
  }

  xInnerHtml('imagen1', '<img src="imagenes/popup/pliego_sipan01.gif" width="500" height="260" border="0">')
  xInnerHtml('imagen2', '<a href="descargas/hemeroteca/documentos/2010/pliego_alegaciones.doc" target="_blank" onClick="javascript:cerrar_popup()"><img src="imagenes/popup/pliego_sipan02.gif" width="500" height="36" border="0"></a>')

  pos_left = parseInt((xClientWidth()-235)/2)
  pos_top = 150;

  xMoveTo('popup',pos_left,pos_top)

  setTimeout("xShow('popup')",2500)
}


// Funciones para mostrar popups mediante capas
// Esta función es una variante de la función: muestra_imagen
// Muestra la oferta de GENERALI Seguros que se divide en tres partes
function muestra_seguro(){
  xWidth ('popup',502)
  xHeight ('popup',492)
  xWidth ('imagen1',500)
  xHeight ('imagen1',90)
  xWidth ('imagen2',500)
  xHeight ('imagen2',100)
  xWidth ('imagen3',500)
  xHeight ('imagen3',190)
  xWidth ('imagen4',500)
  xHeight ('imagen4',35)
  xWidth ('imagen5',500)
  xHeight ('imagen5',35)

  if (navigator.appName.indexOf("Explorer") != -1) {
      xWidth ('cerrar_sup',500)
      xHeight ('cerrar_sup',20)
      xWidth ('cerrar_inf',500)
      xHeight ('cerrar_inf',20)
  }

  xInnerHtml('imagen1', '<img src="imagenes/popup/generali_seg01.gif" width="500" height="90" border="0">')
  xInnerHtml('imagen2', '<a href="http://www.generali.es" target="_blank"><img src="imagenes/popup/generali_seg02.gif" width="500" height="100" border="0"></a>')
  xInnerHtml('imagen3', '<img src="imagenes/popup/generali_seg03.gif" width="500" height="190" border="0">')
  xInnerHtml('imagen4', '<a href="descargas/hemeroteca/documentos/2011/condiciones_generales.pdf" target="_blank"><img src="imagenes/popup/generali_seg04.gif" width="500" height="35" border="0"></a>')
  xInnerHtml('imagen5', '<a href="descargas/hemeroteca/documentos/2011/solicitud_seguro.pdf" target="_blank"><img src="imagenes/popup/generali_seg05.gif" width="500" height="35" border="0"></a>')

  pos_left = parseInt((xClientWidth()-235)/2)
  pos_top = 150;

  xMoveTo('popup',pos_left,pos_top)

  setTimeout("xShow('popup')",2500)
}


function muestra_utesan(){
  xWidth ('popup',402)
  xHeight ('popup',608)
  xWidth ('imagen',400)
  xHeight ('imagen',566)

  if (navigator.appName.indexOf("Explorer") != -1) {
      xWidth ('cerrar_sup',ancho)
      xHeight ('cerrar_sup',20)
      xWidth ('cerrar_inf',ancho)
      xHeight ('cerrar_inf',20)
  }

  xInnerHtml('imagen', '<a href="http://ijornadasutesan.sip-an.es" target="_blank" onClick="javascript:cerrar_popup()"><img src="imagenes/popup/cartel_utesan.jpg" width="400" height="566" border="0"></a>')

  pos_left = parseInt((xClientWidth()-35)/2)
  pos_top = 150;

  xMoveTo('popup',pos_left,pos_top)

  setTimeout("xShow('popup')",2500)
}


function muestra_curso(archivo,ancho,alto){
  xWidth ('popup',ancho)
  xHeight ('popup',alto)
  xWidth ('imagen',ancho)
  xHeight ('imagen',alto)

  if (navigator.appName.indexOf("Explorer") != -1) {
      xWidth ('cerrar_sup',ancho)
      xHeight ('cerrar_sup',20)
      xWidth ('cerrar_inf',ancho)
      xHeight ('cerrar_inf',20)
  }

  xInnerHtml('imagen', '<a href="descargas/formacion/2012/mediacion_policial.pdf" target="_blank" onClick="javascript:cerrar_popup()"><img src="' + archivo + '" width="' + ancho + '" height="' + alto + '" border="0"></a>')

  pos_left = parseInt((xClientWidth()/2)-290)
  pos_top = 255;

  xMoveTo('popup',pos_left,pos_top)

  setTimeout("xShow('popup')",2500)
}


function muestra_encuesta(archivo,ancho,alto){
  xWidth ('popup',ancho + 2)
  xHeight ('popup',alto + 20 + 22)
  xWidth ('imagen',ancho)
  xHeight ('imagen',alto)

  if (navigator.appName.indexOf("Explorer") != -1) {
      xWidth ('cerrar_sup',ancho)
      xHeight ('cerrar_sup',20)
      xWidth ('cerrar_inf',ancho)
      xHeight ('cerrar_inf',20)
  }

  xInnerHtml('imagen', '<a href="index.php?poll" onClick="javascript:cerrar_popup()"><img src="' + archivo + '" width="' + ancho + '" height="' + alto + '" border="0"></a>')

  pos_left = parseInt((xClientWidth()-ancho)/2)
  pos_top = 200;

  xMoveTo('popup',pos_left,pos_top)

  setTimeout("xShow('popup')",2500)
}


function cerrar_popup(){
   xHide('popup');
}


function cambia_escudo(id) {
	var path = "imagenes/escudos/";
	document.images["visitante"].src = path + id + ".png";
}


