
function popUp(URL,ancho,alto)
	{day = new Date();   id = day.getTime();
	izq=(screen.width-ancho) / 2;  arr=(screen.height-alto) / 2;
	eval("page" + id + " = window.open(URL,'" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width="+ancho+",height="+alto	+",left="+izq+",top="+arr+"');");
	}

var numero_foto=new Array();
function cambiarfoto(accion,aux_fot,aux_min,aux_des,anim,aux_alt,id)
  {if (numero_foto[id]==null)
	{numero_foto[id]=0;}
    var fotos=aux_fot.split(",");
    var miniaturas=aux_min.split(",");
    var altos=aux_alt.split(",");
    var descripciones=aux_des.split("##");
    var total=fotos.length;
    if (accion=='siguiente' && numero_foto[id]!=(total-1))
	{numero_foto[id]=numero_foto[id]+1;}
    else if (accion=='siguiente' && numero_foto[id]==(total-1))
        {numero_foto[id]=0;}
    if (accion=='anterior' && numero_foto[id]!=0)
	{numero_foto[id]=numero_foto[id]-1;}
    else if (accion=='anterior' && numero_foto[id]==0)
	{numero_foto[id]=total-1;}
    document.getElementById('fotoactual'+String(id)).innerHTML=String(numero_foto[id]+1)+" de "+String(total);
    document.getElementById('foto'+String(id)).src= "images/noticias/"+miniaturas[numero_foto[id]];
    document.getElementById('foto'+String(id)).width= anim;
    document.getElementById('foto'+String(id)).height= altos[numero_foto[id]];
    document.getElementById('descripcion'+String(id)).innerHTML="(AP Noticias) "+descripciones[numero_foto[id]];
    document.getElementById('direccion'+String(id)).href= "images/noticias/"+fotos[numero_foto[id]];
    document.getElementById('direccion'+String(id)).rel= "lightbox[grupo"+String(id)+"]";
    document.getElementById('direccion'+String(id)).title = "(AP Noticias) "+descripciones[numero_foto[id]];
    var y=1;
    for (x=0; x<total; x++)
        {if (x !== numero_foto[id])
            {document.getElementById('grupo'+String(id)+'-'+String(y)).href= "images/noticias/" + fotos[x];
             document.getElementById('grupo'+String(id)+'-'+String(y)).title = "(AP Noticias) "+ descripciones[x];
             y=y+1;}
        }
  }

