//-----------------------------------------------------------------------
// Navegación sitio Fotos  - versión iPhone
// Fotos EMOL 3.0
// Septiembre 2008
// Desarrollado por Gustavo Vargas Retamal
// Departamento de Desarrollo TI Internet - El Mercurio
//-----------------------------------------------------------------------

function viewDivPage(intDIVmostrar, intDIVocultar)
{
strDIVmostrar='div_contenedorDESTACADOS'+intDIVmostrar;
strDIVocultar='div_contenedorDESTACADOS'+intDIVocultar;
document.getElementById(strDIVocultar).style.display='none';
document.getElementById(strDIVmostrar).style.display='block';
}

//-----------------------------------------------------------------------
function viewFoto(RowIndex)
{
//Marca CERTIFICA
tagCertifica( 13947, arrDATA[RowIndex][0]); 
//Carga la foto
generar_foto(arrDATA[RowIndex][1],arrDATA[RowIndex][2],arrDATA[RowIndex][3],arrDATA[RowIndex][4],arrDATA[RowIndex][5],RowIndex,this);
}
//-----------------------------------------------------------------------
function AvanzaFoto()
{
indiceFOTOPREVIA = indiceFOTOACTUAL;
indiceFOTOACTUAL++;
if (indiceFOTOACTUAL >= MAXFOTOS-1)
	{
	// está en la última foto
	 indiceFOTOACTUAL = MAXFOTOS-1;
	 indiceFOTOPREVIA = MAXFOTOS-2;
	}
viewFoto(indiceFOTOACTUAL);
}
//-----------------------------------------------------------------------
function RetrocedeFoto(IndicePrimeraFoto_dePag)
{
indiceFOTOANTERIOR = indiceFOTOACTUAL;
indiceFOTOACTUAL--;
if (indiceFOTOACTUAL <= 0) 
	{
	 indiceFOTOACTUAL = 0;
	}
viewFoto(indiceFOTOACTUAL);
}
//-----------------------------------------------------------------------

function PegarContenido(){
	if (document.getElementById)
	return document.getElementById("divVIEWER")
	else if (document.all)
	return document.all.trailimagid

}
//-----------------------------------------------------------------------

function generar_foto(imagename,title,description,credito,fecha,RowIndex,inputObj){
	RowPrev = RowIndex-1;
	RowNext = RowIndex+1;
	indiceFOTOACTUAL = RowIndex;
	if (RowPrev<0)
	{
		RowPrev=0;
	}
	// cambiar acá por el maximo de fotos de la galeria
	if (RowNext>MAXFOTOS-1)
	{
		RowNext=MAXFOTOS-1;
	}


newHTML ='<div id="div_IMAGENfull">';
newHTML = newHTML + '<img src="' + imagename + '" border="0" width="100%" useMap="#MapFoto" id="Foto1" name="Foto1">';


newHTML = newHTML + '</div>';
newHTML = newHTML + '<div id="div_contenedor">';
newHTML = newHTML + '<div id="div_Galeria">';
newHTML = newHTML + '<div id="fotos_numeros">';
newHTML = newHTML + '<center><table width="100%" border="0" cellspacing="0" cellpadding="0">';
newHTML = newHTML + '<tr>';
newHTML = newHTML + '<td width="10%">';
newHTML = newHTML + '<a href="javascript:RetrocedeFoto();rsizeImg();"><img src="imagenes/ico_nav_izq_2.gif" alt="" border="0"></a></td>';
newHTML = newHTML + '<td width="80%" align="center">Foto '+(indiceFOTOACTUAL+1)+' de '+MAXFOTOS+'</td>';
newHTML = newHTML + '<td width="10%" align="right"><a href="javascript:AvanzaFoto();rsizeImg();"><img src="imagenes/ico_nav_der_1.gif" alt="" border="0"></a></td>';
newHTML = newHTML + '</tr></table></center>';
newHTML = newHTML + '</div id="fotos_numeros">';
    

newHTML = newHTML + '<h1>' + title + '</h1>';
newHTML = newHTML + '<h2>' + description +'</h2>';
newHTML = newHTML + '<h2>Fotos: '+ credito;
newHTML = newHTML + ' <font color="#666666">|</font> Publicado el '+fecha + '<br/></h2>';
    
newHTML = newHTML + '</div id="div_Galeria">';
newHTML = newHTML + '<h2><a href="javascript:viewFormMail()"><img src="imagenes/ico_enviar_mail2.gif" alt="" border="0"></a></h2>';
newHTML = newHTML + '</div id="Contenedor">';



PegarContenido().innerHTML = newHTML;


}
//-----------------------------------------------------------------------

