// ****************************************************************************************************
//
//   Site con distribuidor de módulos
//
//   Autor: David G.Bonacho
//	 © 2003 ; Antena 3 Televisión
//
// ****************************************************************************************************

// Para fichero externo editable con notepad o app. de servidor:
/*
confiN = "configuración módulo, módulo1,módulo2,módulo3,módulo4,contador";
configuración módulo:
	1 / unico; 
	2 / dos medios;
	3 / dos cuartos un medio;
	4 / un medio dos cuartos;
	5 / cuatro cuartos;
*/
Apps='http://www.antena3.com/';
ServidorAPPSEncuesta='http://www.antena3.com/GestorEncuestas/GestorPeticionesWeb';
ServidorAPPSForo='http://www.antena3.com/GestorForos/gestoForo';
//Apps='http://10.1.1.51:7778/';
//ServidorAPPSEncuesta='http://10.1.1.51:7778/GestorEncuestas/GestorPeticionesWeb';
//ServidorAPPSForo='http://10.1.1.51:7778/GestorForos/gestoForo';
raiz= "/contenidos/unpasoadelante/web";
repositorio= "/contenidos/repositorio";
dir_Fotos= "/fotos/";
dir_Video= "/videos/";

confi1 = "4,2,3,6,0,0";
confi2 = "2,5,4,0,0,0";
confi3 = "1,1,0,0,0,0";
//confi4 = "3,6,3,2,0,0";
confi4 = "7,2,0,0,0,0";
confi5 = "2,5,4,0,0,0";


NumHuecos = 5;
var eshome=0;
// Fin fichero externo editable con notepad o app. de servidor:


function abrefoto(cual) {
  nuevaventana=window.open('../comun/verfoto0.html?'+cual,'album','width=500,height=398');
  setTimeout("if (nuevaventana) nuevaventana.focus();",500)
}

function votar(id_RepuestasEncuestas)
{
  salida = '/unpasoadelante/html/encuesta/encuesta.html?id_RepuestasEncuestas='+id_RepuestasEncuestas;
  window.open(salida,'ENCUESTA','width=361,height=310,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,top=yes');
	
  //miVentana=	window.open(ServidorAPPSEncuesta+'?QuePagina=votar&id_RepuestasEncuestas='+id_RepuestasEncuestas,"ResultadosVotacion","width=1,height=1,top=1000,left=-500");
	//alert('!! Gracias por Votar !!');
	//miVentana.close();
}

function vervideo(alta,baja){
	//laurl = '../comun/video2.htm?alta='+alta+'&baja='+baja;
	//window.open(laurl,'LOSVIDEOS','width=260,height=260');
	//var posicion = 'http://wms.antena3tv.com/videos/unpasoadelante/repositorio/videos/';
  //var posicion = 'mms://a953.v59721.c5972.g.vm.akamaistream.net/7/953/5974/3c99fd9f/wms.antena3tv.com:81/unpasoadelante/repositorio/videos/';
	//var url='http://www.antena3tv.com/a3tv/videovisor/index.htm?urltovideo_MODEM='+posicion+baja+'&urltovideo_ADSL='+posicion+alta +'&pelexo=skinUPA.gif' ;
  var url='/unpasoadelante/html/videos/visor.htm?alta='+alta+'&baja='+baja;
	//window.open(url,'VENTANADEVIDEOS','width=463,height=317');
  window.open(url,'Antena3','width=468,height=425');
}

function enviar(alta,baja){
	laurl = '../comun/amigo.htm?alta='+alta+'&baja='+baja;
	window.open(laurl,'enviar','width=260,height=260');
}

function cambia(i,tipo){

if(tipo==1)
	document.location.href='../videos/momentos.htm?id='+i;
else
	document.location.href='../capitulos/index.htm?id='+i;
}
//////////////// fin de lo añadido en la implantacion
window.onload=cargaflash;

function cargaflash(){
	//flashmenu.innerHTML=embedFlash('/unpasoadelante/html/comun/menu.swf','menuswf',134,500,'','','');
	flashmenu.innerHTML=embedFlash('/unpasoadelante/html/comun/menu.swf','menuswf',134,550,'','','');
}

function pon_espotting(){
  if ( usar_espotting=="si"){
      document.write("<scr"+"ipt language='Javascript' src='http://buscador.antena3.com.es/js/UPA_espotting.js'></scr"+"ipt>");    
  }
}

var conf = new Array(); //define qué configuración de módulos y qué modulos deben ir en cada hueco
for(i=1;i<=NumHuecos;i++){
	eval("conf[i] = new Array("+eval("confi"+i)+")");
}
function unMedio(zona){
	//mover puntero
	conf[zona][5]++;
	pT = conf[zona][5];
	numMod = conf[zona][pT];
	//alert(zona + 'numMod' + numMod);
	var htm= '<table width="100%" border="0" cellspacing="0" cellpadding="0">\n';
    htm+= '        <tr>\n';
	if (zona==1)
	{
		htm+= '          <td><img src="/contenidos/unpasoadelante/web/contenidos/portada/'+cabecera_por[2]+'" width="153" height="14"></td>\n';
	} else 	if (zona==2)
    {
		if (numMod==5)
		{
			// adelanto2	
			htm+= '          <td><img src="/contenidos/unpasoadelante/web/contenidos/portada/'+cabecera_por[3]+'" width="153" height="14"></td>\n';
		} else if (numMod==4)
		{
			// adelanto3	
			htm+= '          <td><img src="/contenidos/unpasoadelante/web/contenidos/portada/'+cabecera_por[6]+'" width="153" height="14"></td>\n';
		}
	} else  if (zona==4)
	{
			// adelanto4	
			htm+= '          <td><img src="/contenidos/unpasoadelante/web/contenidos/portada/'+cabecera_por[11]+'" width="153" height="14"></td>\n';
	}	else  if (zona==5)
	{
		if (numMod==5)
		{
			// adelanto5	
			htm+= '          <td><img src="/contenidos/unpasoadelante/web/contenidos/portada/'+cabecera_por[12]+'" width="153" height="14"></td>\n';
		} else if (numMod==4)
		{
			// adelanto6	
			htm+= '          <td><img src="/contenidos/unpasoadelante/web/contenidos/portada/'+cabecera_por[16]+'" width="153" height="14"></td>\n';
		}
	} else
	{
		
			htm+= '          <td><img src="../../img/comun/adelantos.gif" width="153" height="14"></td>\n';
	}
    htm+= '        </tr>\n';
    htm+= '        <tr>\n';
    htm+= '          <td><table width="153" border="0" cellspacing="0" cellpadding="0">\n';
    htm+= '              <tr>\n';
    htm+= '                <td width="1" bgcolor="#6D6D6D"><img src="../../img/comun/spacer.gif" width="1" height="252" border="0" alt=""></td>\n';

	if (zona==10)
	{
		htm+= '                <td valign="top">'+eval("modulo3()")+'</td>\n';
	}
	else if (zona==0)
	{
		htm+= '                <td valign="top">'+eval("modulo"+numMod+"()")+'</td>\n';		
	} else
	{
		htm+= '                <td valign="top">'+eval("modulo"+numMod+"("+zona+")")+'</td>\n';
		//alert(zona + 'XXnumMod' + numMod);
	}
    htm+= '                <td width="1" bgcolor="#6D6D6D"><img src="../../img/comun/spacer.gif" width="1" height="252" border="0" alt=""></td>\n';
    htm+= '              </tr>\n';
    htm+= '              <tr> \n';
    htm+= '                <td width="1" bgcolor="#6D6D6D"><img src="../../img/comun/spacer.gif" width="1" height="1" border="0" alt=""></td>\n';
    htm+= '                <td bgcolor="#6D6D6D"><img src="../../img/comun/spacer.gif" width="151" height="1" border="0" alt=""></td>\n';
    htm+= '                <td width="1" bgcolor="#6D6D6D"><img src="../../img/comun/spacer.gif" width="1" height="1" border="0" alt=""></td>\n';
    htm+= '              </tr>\n';
    htm+= '            </table></td>\n';
    htm+= '        </tr>\n';
    htm+= ' </table>';
	return(htm);
}

function unCuarto(zona,directo){
	var htm = '';
    if(!directo){
	//mover puntero
	conf[zona][5]++;
	pT = conf[zona][5];
	numMod = conf[zona][pT];
  }else{
	numMod = directo;
  }
	//alert('unCuarto'+zona + 'numMod' + numMod);
	//especial para el mdoulo 6:
	if (numMod==6 || numMod==7){
		htm =eval("modulo"+numMod+"("+zona+")");
	}
	else
	{
			htm= '<table width="100%" border="0" cellspacing="0" cellpadding="0">\n';
			htm+= '              <tr> \n';
			htm+= '                <td><img src="../../img/comun/encabezado_tonos.jpg" width="153" height="14"></td>\n';
			htm+= '              </tr>\n';
			htm+= '              <tr> \n';
			htm+= '                <td><table width="153" border="0" cellspacing="0" cellpadding="0">\n';
			htm+= '                    <tr> \n';
			htm+= '                      <td width="1" bgcolor="#6D6D6D"><img src="../../img/comun/spacer.gif" width="1" height="118" border="0" alt=""></td>\n';
			htm+= '                      <td>'+eval("modulo"+numMod+"("+zona+")")+'</td>\n';		
			htm+= '                      <td width="1" bgcolor="#6D6D6D"><img src="../../img/comun/spacer.gif" width="1" height="118" border="0" alt=""></td>\n';
			htm+= '                    </tr>\n';
			htm+= '                    <tr> \n';
			htm+= '                      <td width="1" bgcolor="#6D6D6D"><img src="../../img/comun/spacer.gif" width="1" height="1" border="0" alt=""></td>\n';
			htm+= '                      <td bgcolor="#6D6D6D"><img src="../../img/comun/spacer.gif" width="151" height="1" border="0" alt=""></td>\n';
			htm+= '                      <td width="1" bgcolor="#6D6D6D"><img src="../../img/comun/spacer.gif" width="1" height="1" border="0" alt=""></td>\n';
			htm+= '                    </tr>\n';
			htm+= '                  </table></td>\n';
			htm+= '              </tr>\n';
			htm+= '            </table>\n';
	}
	return(htm);
}

function dosUncuarto(zona){
var htm = '<table width="100%" border="0" cellspacing="0" cellpadding="0">\n';
    htm+= '        <tr> \n';
	
    htm+= '          <td>'+unCuarto(zona)+'</td>\n';
    htm+= '        </tr>\n';
    htm+= '        <tr> \n';
    htm+= '          <td><img src="../../img/comun/spacer.gif" width="1" height="1"></td>\n';
    htm+= '        </tr>\n';
    htm+= '        <tr>\n';
    htm+= '          <td>'+unCuarto(zona)+'</td>\n';
    htm+= '        </tr>\n';
    htm+= '      </table>';
	return(htm);
}

function wrModulo(zona){
	
/*
	la entrada zona servirá para extraer el contenido
	confi1 = "4,2,3,6,0,0";
	confi2 = "2,5,4,0,0,0";
	confi3 = "1,1,0,0,0,0";
	confi4 = "3,6,3,2,0,0";
	confi5 = "2,5,4,0,0,0";
*/
var htm = '';

if(zona<=NumHuecos){

	if(conf[zona][0]!=1){
		
		htm+= '<table width="100%" border="0" cellspacing="0" cellpadding="0" valign="top">\n';
		htm+= '  <tr valign="top"><td width="1" valign="top">';
	
		if(conf[zona][0]==2||conf[zona][0]==4){
			htm+=unMedio(zona);
		}
		if(conf[zona][0]==3||conf[zona][0]==5){
			htm+=dosUncuarto(zona);
		}
		//aqui nuevo
		if(conf[zona][0]==7){
			htm+=modulo7();
		}
		//hasta nuevo
		
		//separador
		htm+= '</td><td width="1"><img src="../../img/comun/spacer.gif" width="3" height="1"></td><td valign="top">';
	
		if(conf[zona][0]==2||conf[zona][0]==3){
			htm+=unMedio(zona);
		}
		if(conf[zona][0]==4||conf[zona][0]==5){
			htm+=dosUncuarto(zona);
		}
		//aqui nuevo
		if(conf[zona][0]==7){
				htm+=unMedio(zona);
		}
		//hasta nuevo
		
	
		htm+= '</td></tr>';
		htm+= '</table>\n';
	}else 
		htm+=modulo1(zona);   
	

}
else if(zona==8)
	{
		htm+=modulo7(zona); 
	}
		//alert(zona+htm);
		document.write(htm);	
}

function DGBload(id,esArray){/* © David G.Bonacho 2003 Carga de variables y arrays en flash */
  var jK=window.document[id],x=DGBload.arguments;
  for(i=1;i<=x.length-2;i++){var dT=eval(x[i]);
  if(dT.toString().substr(0,1)==','){
   for(y=1;y<=dT.length-1;y++){jK.SetVariable(x[i]+'TOT', dT.length-1);jK.SetVariable(x[i]+y, dT[y])};
  }else{jK.SetVariable(x[i],dT);}}
}

function embedFlash(url,laid,ancho,alto,t,c,menu){/* David G.Bonacho © Antena 3 Televisión 2003*/ 
var html = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"',bckgrtype='';
if(!c){c='#ffffff';}/*background*/
if(menu==1){menu=false}else{menu=true}
html+=' codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0"';
html+=' width='+ancho+' height='+alto+' id='+laid+'>';
html+='    <param name=movie value="'+url+'">';
html+='    <param name=loop value=false>';
html+='    <param name=wmode value=opaque>'; //Para la promo de ESDLA
html+='    <param name=menu value='+menu+'>';
html+='    <param name=quality value=high>';
html+='    <param name=bgcolor value='+c+'>';
if(t){/*transparent mode is selected*/
html+='    <param name=wmode value=transparent>\n';
bckgrtype = 'wmode=transparent';
}
html+='    <embed src="'+url+'" loop=false menu=false '+bckgrtype+'quality=high bgcolor='+c+' width='+ancho+' height='+alto+' type="application/x-shockwave-flash"';
html+=' pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" id='+laid+'>';
html+='    </embed> ';
html+='  </object>';
return(html);
}

function piecopy(){
var htm='<table width="100%" border="0" cellspacing="0" cellpadding="0"><tr><td width="1"><img src="../../img/comun/spacer.gif" width="8" height="200"></td></tr><tr><td width="1"><a href="http://www.antena3tv.com" target="_blank"><img src="../../img/comun/logoa3.gif" width="38" height="44" border="0"></a></td>';
htm+='<td><a href="#" onclick="abreCopyright()" class="pielista">Copyright &copy; Antena 3 Televisi&oacute;n, 2003. <br>Reservados todos los derechos</a></td>';
htm+='<td><a href="#" onclick="abreLssi()" class="pielista">Avertencia legal</a></td>';
htm+='<td><a href="http://www.globomedia.es" target="_blank"><img src="../../img/comun/logo-globo.gif" width="82" height="20" border="0"></a></td></tr></table>';
document.write(htm);
}

function abreCopyright(){
 window.open('../copyright.html','copyright','toolbar=no,resizable=no,menubar=no,width=320,height=150');
}

function abreLssi(){
 window.open('http://www.antena3tv.com/legal/lssi.html','lssi','toolbar=no,scrollbars=yes,resizable=no,menubar=no,width=320,height=400');
}

function promosDer(seccion){
//parsear seccion
//switch(seccion){ 
//case 1: //... etc
document.write(unCuarto(0,6)+unCuarto(0,3));
}

function listcap(tipo){

var titulo='';
var htm = '<form name="form1" method="post" action="">\n';
	if(tipo==1)
		htm+= '<select name="select" size="1" class="lista" onChange="javascript:cambia(this.value,1)" >\n';
	else
	    htm+= '<select name="select" size="1" class="lista" onChange="javascript:cambia(this.value)" >\n';
    htm+= '<option>[Elige cap&iacute;tulo]</option>\n';
for(i=0;i<titulo_capitulo.length;i++){

	if(titulo_capitulo[i].length>19)
		titulo=titulo_capitulo[i].substring(0,16)+'..';
	else
		titulo=titulo_capitulo[i];
    htm+= '<option value="'+id_capitulo[i]+'" >'+titulo+'</option>\n';

}
    htm+= '</select></form>\n';
	return(htm);
}

function submenu(seccion,sinfondo){
var quetarget = '_self';
var htm = '<table width="100%" border="0" cellspacing="0" cellpadding="0">\n';
    htm+= '  <tr> \n';
if(sinfondo!=1){
    htm+= '    <td width="1"><img src="../../img/comun/menu2nivel.gif" width="8" height="132"></td>\n';
}else{
    htm+= '    <td width="1"><img src="../../img/comun/spacer.gif" width="8" height="132"></td>\n';
}
    htm+= '    <td valign="top"><table width="100" border="0" cellspacing="0" cellpadding="0">\n';
aR = submenus[seccion];
for(i=1;i<=aR.length-1;i++){	
	quetarget = '_self';
	linka = aR[i];

	if(linka.indexOf("http://")>=0){
		quetarget = '_blank';
	}
	if ((!((seccion==2) && (i==3))) && (!((seccion==1) && (i==2))) && (!((seccion==4) && (i==5))) && (!((seccion==5) && (i==1))) && (!((seccion==5) && (i==5))) ){  //03.05.04 para ocultar algunas entradas del menú
	    htm+= '        <tr> \n';
		htm+= '          <td><a href="'+linka+'" class="submenu" target="'+quetarget+'"><img src="../../img/submenus/seccion'+seccion+'/elem'+i+'.gif" width="121" height="15" border="0"></a></td>\n';
	    htm+= '        </tr>\n';
	    htm+= '        <tr> \n';
	    htm+= '          <td><img src="../../img/comun/spacer.gif" width="1" height="1"></td>\n';
	    htm+= '        </tr>\n';
	}//03.05.04 para ocultar VideAvance
}
    htm+= '<tr><td><img src="../../img/comun/spacer.gif" width="1" height="3"></td></tr>\n';
/*if(seccion==1){
    htm+= '<tr><td align="center">'+listcap()+'</td></tr>';
}*/
if(seccion==1){
    htm+= '<tr><td align="center">'+listcap()+'</td></tr>';
}
if (sinfondo==19)
{
	htm+= '<tr><td align="center">'+listcap(1)+'</td></tr>';
}
    htm+= '      </table></td>\n';
    htm+= '  </tr>\n';
    htm+= '</table>\n';
	document.write(htm)
}

function parseAte(campo){ // © 2001 Antena 3 Interactiva - by DGB
 var texto = location.search;
 var result = false;
 if(texto.indexOf(campo)>=0){
  var txtRst = texto.substring(texto.indexOf(campo),texto.length);
  var txtCmp = txtRst.substring(0,txtRst.indexOf('&'));
  if (txtCmp=='') txtCmp = txtRst.substring(0,txtRst.length);
  result = txtCmp.substring((txtCmp.indexOf('=')+1),txtCmp.length);
 }
 return(unescape(result));
}



document.write('<scr'+'ipt src="/contenidos/unpasoadelante/web/contenidos/camerino/curriculum/nombres.js"></scr'+'ipt>');
document.write('<scr'+'ipt src="../../util/modulos3.js"></scr'+'ipt>');
document.write('<scr'+'ipt src="/contenidos/unpasoadelante/web/contenidos/menu/menu.js"></scr'+'ipt>');

    var promoImgItem=new Array();
    var promoImgUrl=new Array();
    var promoImgX=new Array();
    var promoImgY=new Array();
    var promoImgActivo=new Array();
	for (i=0;i<5;i++){
		promoImgItem[i]="-";
		promoImgUrl[i]="-";
		promoImgX[i]="-";
		promoImgY[i]="-";
		promoImgActivo[i]="false";
	}
    var promoTxtItem=new Array();
    var promoTxtUrl=new Array();
    var promoTxtX=new Array();
    var promoTxtY=new Array();
    var promoTxtActivo=new Array();
	for (i=0;i<8;i++){
		promoTxtItem[i]="-";
		promoTxtUrl[i]="-";
		promoTxtX[i]="-";
		promoTxtY[i]="-";
		promoTxtActivo[i]="false";
	}
	
function abreRankig()
{
	window.open("../videos/ranking.html","Ranking","width=650,height=357");
}
	
function abrePromo(enla,xp,yp){
	if ((xp=="-") || (yp=="-") || (xp=="")  || (yp=="") || (xp=="undefined")  || (yp=="undefined")){
		salida='toolbar=yes,resizable=yes,menubar=yes';
	}else{
		 salida='toolbar=no,resizable=no,menubar=no,width='+xp+',height='+yp;
	}
	window.open(enla,'PROMO',salida);
}
document.write('<scr'+'ipt src="/contenidos/unpasoadelante/web/contenidos/promos/contenido_promos.js"></scr'+'ipt>');


// ****************************************************************************************************
//
//   Site con distribuidor de módulos
//
//   Autor: David G.Bonacho
//	 © 2003 ; Antena 3 Televisión
//
// ****************************************************************************************************

function dimeldia(){
// devuelve string dia actual
var tomadia = '';
 switch(FechaServer){
  case 1:
    tomadia = 'Domingo';
    break;
  case 2:
    tomadia = 'Lunes';
    break;
  case 3:
    tomadia = 'Martes';
    break;
  case 4:
    tomadia = 'Miercoles';
    break;
  case 5:
    tomadia = 'Jueves';
    break;
  case 6:
    tomadia = 'Viernes';
    break;
  case 7:
    tomadia = 'Sabado';
    break;
 }
 return(tomadia);
}
function fechacompleta(){
//devuelve fecha completa en castellano
dia = fecha.substring(8,11);
mes = fecha.substring(5,8);
ano = fecha.substring(24,33);
	switch(mes){
	case 'Jan':
		mesactual = 'enero';
		break;	
	case 'Feb':
		mesactual = 'febrero';
		break;	
	case 'Mar':
		mesactual = 'marzo';
		break;	
	case 'Apr':
		mesactual = 'abril';
		break;	
	case 'May':
		mesactual = 'mayo';
		break;	
	case 'Jun':
		mesactual = 'junio';
		break;	
	case 'Jul':
		mesactual = 'julio';
		break;	
	case 'Aug':
		mesactual = 'agosto';
		break;	
	case 'Sep':
		mesactual = 'septiembre';
		break;	
	case 'Oct':
		mesactual = 'octubre';
		break;	
	case 'Nov':
		mesactual = 'noviembre';
		break;	
	case 'Dec':
		mesactual = 'diciembre';
		break;	
	}
	result = dimeldia() + ', ' + dia + ' de ' + mesactual + ' de ' + ano;
	return(result);
}
//--
function pintaCamerinos()
{
	var htm='';
	
		htm+='				 <tr> ';
		htm+='                            <td><table width="30" border="0" cellspacing="0" cellpadding="1">';
		htm+='                                <tr> ';
		htm+='                                  <td bgcolor="#666666"><a href="'+enl_pcam[1]+'"><img src="/contenidos/unpasoadelante/web/contenidos/portada/'+img_pcam[1]+'" width="43" height="43" border="0"></a></td>';
		htm+='                                </tr>';
		htm+='                              </table></td>';
		htm+='                             <td><table width="30" border="0" cellspacing="0" cellpadding="1">';
		htm+='                                 <tr> ';
		htm+='                                  <td bgcolor="#666666"><a href="'+enl_pcam[2]+'"><img src="/contenidos/unpasoadelante/web/contenidos/portada/'+img_pcam[2]+'" width="43" height="43" border="0"></a></td>';
		htm+='                                 </tr>';
		htm+='                               </table></td>';
		htm+='                             <td><table width="30" border="0" cellspacing="0" cellpadding="1">';
		htm+='                                 <tr> ';
		htm+='                                  <td bgcolor="#666666"><a href="'+enl_pcam[3]+'"><img src="/contenidos/unpasoadelante/web/contenidos/portada/'+img_pcam[3]+'" width="43" height="43" border="0"></a></td>';
		htm+='                                 </tr>';
		htm+='                               </table>';
		htm+=' 							  </td>';
		htm+='                           </tr>';
		htm+='				 <tr> ';
		htm+='                            <td><table width="30" border="0" cellspacing="0" cellpadding="1">';
		htm+='                                <tr> ';
		htm+='                                  <td bgcolor="#666666"><a href="'+enl_pcam[4]+'"><img src="/contenidos/unpasoadelante/web/contenidos/portada/'+img_pcam[4]+'" width="43" height="43" border="0"></a></td>';
		htm+='                                </tr>';
		htm+='                              </table></td>';
		htm+='                             <td><table width="30" border="0" cellspacing="0" cellpadding="1">';
		htm+='                                 <tr> ';
		htm+='                                  <td bgcolor="#666666"><a href="'+enl_pcam[5]+'"><img src="/contenidos/unpasoadelante/web/contenidos/portada/'+img_pcam[5]+'" width="43" height="43" border="0"></a></td>';
		htm+='                                 </tr>';
		htm+='                               </table></td>';
		htm+='                             <td><table width="30" border="0" cellspacing="0" cellpadding="1">';
		htm+='                                 <tr> ';
		htm+='                                  <td bgcolor="#666666"><a href="'+enl_pcam[6]+'"><img src="/contenidos/unpasoadelante/web/contenidos/portada/'+img_pcam[6]+'" width="43" height="43" border="0"></a></td>';
		htm+='                                 </tr>';
		htm+='                               </table>';
		htm+=' 							  </td>';
		htm+='                           </tr>';
				htm+='				 <tr> ';
		htm+='                            <td><table width="30" border="0" cellspacing="0" cellpadding="1">';
		htm+='                                <tr> ';
		htm+='                                  <td bgcolor="#666666"><a href="'+enl_pcam[7]+'"><img src="/contenidos/unpasoadelante/web/contenidos/portada/'+img_pcam[7]+'" width="43" height="43" border="0"></a></td>';
		htm+='                                </tr>';
		htm+='                              </table></td>';
		htm+='                             <td><table width="30" border="0" cellspacing="0" cellpadding="1">';
		htm+='                                 <tr> ';
		htm+='                                  <td bgcolor="#666666"><a href="'+enl_pcam[8]+'"><img src="/contenidos/unpasoadelante/web/contenidos/portada/'+img_pcam[8]+'" width="43" height="43" border="0"></a></td>';
		htm+='                                 </tr>';
		htm+='                               </table></td>';
		htm+='                             <td><table width="30" border="0" cellspacing="0" cellpadding="1">';
		htm+='                                 <tr> ';
		htm+='                                  <td bgcolor="#666666"><a href="'+enl_pcam[9]+'"><img src="/contenidos/unpasoadelante/web/contenidos/portada/'+img_pcam[9]+'" width="43" height="43" border="0"></a></td>';
		htm+='                                 </tr>';
		htm+='                               </table>';
		htm+=' 							  </td>';
		htm+='                           </tr>';
	return (htm);
}

function irPerso(ir)
{
	location.href=ir;
}
function abrePromo(enla,xp,yp){
	if ((xp=="-") || (yp=="-") || (xp=="")  || (yp=="") || (xp=="undefined")  || (yp=="undefined")){
		salida='toolbar=yes,resizable=yes,menubar=yes';
	}else{
		 salida='toolbar=yes,scrollbars=yes,resizable=yes,menubar=yes,width='+xp+',height='+yp;
	}
	window.open(enla,'UPA',salida);
}

// paginación de listados (orden ascendente o descendente)
function DGBEnBloques(NomHtm,totalitems,amplitud,clase,orden){ // © 2001  - DGB - Antena 3 interactiva
 var htm = '',limite,AvPag,RePag,Clis,Flis;/*DGB*/
 limite = Math.ceil(parseInt(totalitems) / parseInt(amplitud));
 if(orden==1){seni='siguiente'; send='anterior';}else{seni='anterior'; send='siguiente'};
 //RePag: muestra avpag si no supera totalitems
 var int_totalitems=parseInt(totalitems);
 var int_hasta=parseInt(hasta);
 var int_amplitud=parseInt(amplitud);
 var int_desde=parseInt(desde);
 lim = int_totalitems-(int_hasta+int_amplitud);/*DGB*/  
 RePag= (lim>=0||int_totalitems>int_hasta&&int_totalitems<=(int_hasta+int_amplitud))? '&nbsp;&nbsp;<a href="'+NomHtm+'?desde='+(int_hasta+1)+'&hasta='+(int_hasta+int_amplitud)+'" class="'+clase+'"><img src="../../img/'+send+'.gif" width="126" height="15" border="0"></a>&nbsp;&nbsp;':'';
 //AvPag lo muestra si hay páginas anteriores
 AvPag='';
 if(int_desde>1){
  AvPag= '&nbsp;&nbsp;<a href="'+NomHtm+'?desde='+(int_desde-int_amplitud)+'&hasta='+(int_desde-1)+'" class="'+clase+'"><img src="../../img/'+seni+'.gif" width="126" height="15" border="0"></a>&nbsp;&nbsp;:';
 }
 htm+='<br><b>Ver otras páginas: </b><br>';

if(orden!=1){
 htm+=AvPag;/*DGB*/
 for(i=1;i<=limite;i++){
  if(i==1){
	C_desde=1;
	C_hasta=amplitud;
  }else{
	C_desde=(amplitud*(i-1)+1);
	C_hasta=C_desde+amplitud-1;
  }
  htm+='<a href="'+NomHtm+'?desde='+C_desde+'&hasta='+C_hasta+'" class="'+clase+'">'+i+'</a>|';
 }
 htm+=RePag;
}else{
 htm+=RePag;
 var cont = 0;
 for(i=limite;i>=1;i--){
 cont++;
  if(i==1){
	C_desde=1;
	C_hasta=amplitud;
  }else{
	C_desde=(amplitud*(i-1)+1);
	C_hasta=C_desde+amplitud-1;
  }/*DGB*/
  htm+='<a href="'+NomHtm+'?desde='+C_desde+'&hasta='+C_hasta+'" class="'+clase+'">'+cont+'</a>|';
 }
 htm+=AvPag;
}
 document.write(htm);
}