function showHome(rows){
	var ilength = lastInterviews.length;var elength = lastEvents.length;
	if((ilength==0)&&(elength==0)){return;}
	if(ilength>elength){var max=ilength;}else{var max=elength;}
	if(rows>max){rows=max;}	
	var html="<table width=494 cellspacing=0 cellpadding=0 border=0 style=\"table-layout:fixed;\">";
	html+="<col width=245><col width=4><col width=245>";
	html+="<tr valign=top align=left>";
	html+="<td>"+showTitleC("ÚLTIMAS NOTICIAS",200,0)+"</td>";
	html+="<td></td>";
	html+="<td>"+showTitleC("PRÓXIMOS EVENTOS",200,0)+"</td>";
	html+="</tr>";		
	var ci=0;ce=0;
	for(var i=0;i<rows;i++){
		html+="<tr valign=top align=left>";
		html+="<td>";if(ci<lastInterviews.length){html+=showBoxEnt(lastInterviews[i]);}
		html+="<td></td><td>";if(ce<lastEvents.length){html+=showBoxEve(lastEvents[i]);}
		html+="</td></tr>";
		ce++;ci++;
	}
	html+="<tr valign=top align=left>";
	html+="<td><a href=\"/noticias.asp\"><img src=\"/images/layout/caja/buscarmas_verde.gif\" border=0 title=\"buscar más\"></td><td></td>";
	html+="<td><a href=\"/events.asp\"><img src=\"/images/layout/caja/buscarmas_azul.gif\" border=0 title=\"buscar más\"></td>";
	html+="</tr>";
	html+="<tr height=10><td colspan=3><img src=\"/images/layout/clearpixel.gif\" border=0></td></tr>";
	html+="</table>";
	document.write(html);
}
function showBoxEnt(arr){
	var html="<div class=boxHome>";
	html+="<table width=245 cellpadding=0 cellspacing=0 border=0 style=\"table-layout:fixed;\">"
	html+="<col width=72><col width=173>";	
	html+="<td>";
	if(arr[4]==""){html+="<div class=ladoIzquierdo style=\"background-image:url(/store/entrevistas/"+arr[0]+"/70x67_"+arr[4]+");\">";}else{html+="<div class=ladoIzquierdo style=\"background-image:url(/store/entrevistas/"+arr[0]+"/70x67_"+arr[4]+");\">";}
	html+="<img src=\"/images/layout/caja/1_01.gif\" border=0></div>";	
	html+="</td><td>";
	html+="<div class=ladoDerechogreen onclick=\"gotoEnt('"+arr[0]+"');\" title=\"pulsa aquí para ver el detalle...\">";
	if(arr[3].length>50){arr[3]=arr[3].toString().slice(0,50)+"...";}
	html+="<div class=titulo><b>"+arr[2]+"</b><br>"+arr[3]+"</div>";
	html+="<div class=fecha>"+arr[1]+"</div>";
	html+="</div>";
	html+="</td></tr></table>";
	html+="</div>";
	return html;	
}	
function showBoxEve(arr){
	var html="<div class=boxHome>";
	html+="<table width=245 cellpadding=0 cellspacing=0 border=0 style=\"table-layout:fixed;\">"
	html+="<col width=72><col width=173>";	
	html+="<td>";	
	if(arr[4]==""){html+="<div class=ladoIzquierdo style=\"background-image:url(/store/eventos/"+arr[0]+"/70x67_"+arr[4]+");\">";}else{html+="<div class=ladoIzquierdo style=\"background-image:url(/store/eventos/"+arr[0]+"/70x67_"+arr[4]+");\">";}
	html+="<img src=\"/images/layout/caja/2_01.gif\" border=0></div>";	
	html+="</td><td>";	
	html+="<div class=ladoDerechoblue onclick=\"gotoEve('"+arr[0]+"');\" title=\"pulsa aquí para ver el detalle...\">";
	html+="<div class=titulo><b>"+arr[2]+"</b><br>"+arr[3]+"</div>";
	html+="<div class=fecha>"+arr[1]+"</div>";
	html+="</div>";
	html+="</td></tr></table>";
	html+="</div>";
	return html;	
}		
function showGalerias(rows){
	var cols=3;
	if(lastGaleries.length < 1){return;}
	var cgallery=0;
	var html=showTitleH("ÚLTIMAS GALERÍAS",200,"photos.asp","Pulsa aquí para ver todas las galerías...",0);
	html+="<div id=galeriasLista>";
	html+="<table width=494 cellpadding=0 cellspacing=0 border=0 class=\"galeriasT\">";
	html+="<col with=11><col width=148><col width=14><col width=148><col width=14><col width=148><col width=11>";		
	for(var i=0;i<rows;i++){
		html+="<tr valign=top align=left><td></td>"
		for(var x=1;x<=cols;x++){
			html+=getGalDiv(cgallery,lastGaleries,148,117);
			cgallery++;
		}
		html+="</tr>"
	}
	html+="</table>"
	html+="</div>";	
	document.write(html);html=null;	
}	
function getGalDiv(index,arr,w,h){
	if(w==null){w=148;}if(h==null){h=120;}
	var html="<td>";
	if(index<arr.length){
		html+="<div class=galeriaB>";
			html+="<div class=container title=\"pulsa aquí para ver estas fotos...\" onclick=\"gotoGallery('"+arr[index][0]+"');\" onmouseover=\"togleButtons(this);\" onmouseout=\"togleButtons(this);\">";
				html+="<div class=foto style=\"background-image: url('/store/galerias/"+arr[index][0]+"/"+arr[index][5].toString().replace("/","/160x120_")+"');\"></div>";
				/*
				html+="<div class=fecha><nobr>"+getFechaH(arr[index][1],0)+"</nobr></div>";
				if(arr[index][3]!=""){
					html+="<div class=titulo>"+arr[index][3]+"</div>";
				}else{
					html+="<div class=titulo>"+arr[index][2]+"</div>";
				}
				*/
				if(arr[index][3]!=""){
					html+="<div class=fecha>"+arr[index][3]+"</div>";
				}else{
					html+="<div class=fecha>"+arr[index][2]+"</div>";
				}
				html+="<div class=titulo><nobr>"+getFechaH(arr[index][1])+"</nobr></div>";				
				html+="<div class=nrofotos>"
					if(arr[index][4]=="1"){html+="1 Fotografía";}else{html+=arr[index][4]+" Fotografías";}
				html+="</div>";
			html+="</div>";
		html+="</div>";		
	}else{
		html+="<img src=\"/images/layout/clearpixel.gif\" width="+w+" height=0>";
	}
	html+="</td><td></td>";
	return html;		
}
function showVideos(rows){
	var cols=3;
	if(lastVideos.length < 1){return;}
	var cvideo=0;
	var html=showTitleH("ÚLTIMOS VÍDEOS",200,"videos.asp","Pulsa aquí para ver todos los vídeos...",0);
	html+="<div id=videosLista>";
	html+="<table width=494 cellpadding=0 cellspacing=0 border=0 class=\"videoT\">";
	html+="<col with=11><col width=148><col width=14><col width=148><col width=14><col width=148><col width=11>";		
	for(var i=0;i<rows;i++){
		html+="<tr valign=top align=left><td></td>"
		for(var x=1;x<=cols;x++){
			html+=getVideoDiv(cvideo,lastVideos,148,117);
			cvideo++;
		}
		html+="</tr>"
	}
	html+="</table>"
	html+="</div>";	
	document.write(html);html=null;	
}	
function showVideosP(rows){
	var cols=3;
	if(promVideos.length < 1){return;}
	var cvideo=0;
	var html=showTitleH("VÍDEOS PROMOCIONALES",200,"","",0);
	//var html=showTitleH("VÍDEOS PROMOCIONALES",200,"videos.asp","Pulsa aquí para ver todos los vídeos...",0);
	html+="<div id=videosLista1>";
	html+="<table width=494 cellpadding=0 cellspacing=0 border=0 class=\"videoT\">";
	html+="<col with=11><col width=148><col width=14><col width=148><col width=14><col width=148><col width=11>";		
	for(var i=0;i<rows;i++){
		html+="<tr valign=top align=left><td></td>"
		for(var x=1;x<=cols;x++){
			html+=getVideoDiv(cvideo,promVideos,148,117);
			cvideo++;
		}
		html+="</tr>"
	}
	html+="</table>"
	html+="</div>";	
	document.write(html);html=null;	
}	
function getVideoDiv(index,arr,w,h){
	if(w==null){w=148;}if(h==null){h=120;}
	var html="<td>";
	if(index<arr.length){
		html+="<div class=videoB>";
			html+="<div class=container title=\"pulsa aquí para ver este vídeo...\" onclick=\"gotoVideo('"+arr[index][0]+"');\" onmouseover=\"togleButtons(this);\" onmouseout=\"togleButtons(this);\">";
				html+="<div class=foto style=\"background-image: url('/store/videos/"+arr[index][0]+"/135x50_"+arr[index][4]+"');\"></div>";
				/*
				html+="<div class=fecha><nobr>"+getFechaH(arr[index][1],0)+"</nobr></div>";
				if(arr[index][3]!=""){
					html+="<div class=titulo>"+arr[index][3]+"</div>";
				}else{
					html+="<div class=titulo>"+arr[index][2]+"</div>";
				}
				*/
				if(arr[index][3]!=""){
					html+="<div class=fecha>"+arr[index][3]+"</div>";
				}else{
					html+="<div class=fecha>"+arr[index][2]+"</div>";
				}
				html+="<div class=titulo><nobr>"+getFechaH(arr[index][1])+"</nobr></div>";					
			html+="</div>";
		html+="</div>";		
	}else{
		html+="<img src=\"/images/layout/clearpixel.gif\" width="+w+" height=0>";
	}
	html+="</td><td></td>";
	return html;		
}	
function showTitleH(title,largo,link,alt,ret){
	if(alt==null){alt="";};if(link=="null"){link="";}
	var html="<div class=barraTitulos>";
	html+="<table width=494 cellpadding=0 cellspacing=0 border=0 style=\"table-layout:fixed;\">"
	html+="<col width=419><col width=65><col width=10>";
	html+"<tr height=21>";
	html+="<td align=left><div class=subBarra style=\"width:"+largo+"px;background-position:"+(parseInt(largo)-8)+"px -5px;\">"+title+"</div></td>";
	html+="<td align=right valign=middle>";
	if(link!=""){	
		html+="<div style=\"margin-top:3px;\" class=verMas onmouseover=\"overCss(this,1,13);\" onmouseout=\"overCss(this,0,0);\" "
		html+="onclick=\"document.location.href='/"+link+"';\" title=\""+alt+"\"><img src=\"/images/layout/clearpixel.gif\" alt=\""+alt+"\" height=13 width=65 border=0></div>";
	}	
	html+="</td>";
	html+="</tr><td></td></table></div>";
	if(ret==null){document.write(html);}else{return html;}
}
function gotoVideo(id){document.location.href="/videos.asp?id="+id;}
function gotoEnt(id){document.location.href="/noticias.asp?pag=detail&id="+id;}
function gotoEve(id){document.location.href="/events.asp?pag=detail&id="+id;}