var RUTA="http://www.renatoochoa.com/";
//var RUTA="d:/websites/renatoochoa/web/";
//var RUTA="h:/websites/renatoochoa/web/";

var fila_sup_izq=0;
var col_sup_izq=0;
var fila_inf_izq=0;
var col_inf_izq=0;
var fila_sup_der=0;
var col_sup_der=0;
var fila_inf_der=0;
var col_inf_der=0;

var btnIdioma = new Array(1,1);
var strIdioma = new Array(1);
var btnIdioma = new Matriz(1);

strIdioma[0] = RUTA+"graficos/btnesp";
strIdioma[1] = RUTA+"graficos/btneng";

btnIdioma[0][0] = new SetImg(strIdioma[0],".gif");
btnIdioma[0][1] = new SetImg(strIdioma[0],"_on.gif");
btnIdioma[1][0] = new SetImg(strIdioma[1],".gif");
btnIdioma[1][1] = new SetImg(strIdioma[1],"_on.gif");

var longmenu=6;

var linkurl = new Array()
linkurl[0]= [".", "."]
linkurl[1]= ["Galeria1997/galeria_1997.html", "Galeria1997/gallery_1997.html"]
linkurl[2]= ["Galeria1998/galeria_1998.html", "Galeria1998/gallery_1998.html"]
linkurl[3]= ["Galeria1999/galeria_1999.html", "Galeria1999/gallery_1999.html"]
linkurl[4]= ["Galeria2000/galeria_2000.html", "Galeria2000/gallery_2000.html"]
linkurl[5]= ["Galeria2007/galeria_2007.html", "Galeria2007/gallery_2007.html"]

function click() 
{
	if (event.button==2)
	  alert('© Copyright 1999-2007 renatoochoa.com') 
} 
document.onmousedown=click

function ShowPopup(FileURL,vAncho,vAlto,vScroll,vResize)
{
// vScroll -> 0(NO) / 1(SI)
// vResize -> 0(NO) / 1(SI)

	Arriba=((screen.height/2) - (vAlto/2))-3;
	Izquierda=screen.width/2 - (vAncho/2);
	
	MasAlto=vAlto+11;
	features = "width="+vAncho+",height="+MasAlto+",scrollbars="+vScroll+",left="+ Izquierda +", top="+ Arriba + ",resizable="+vResize+", location= 0, tittlebar=0, menubar=0, location=no";	
	var popup=window.open(FileURL,'vpopup',features);
	if( navigator.appName.substring(0,8) == "Netscape" )
	{
		popup.location = FileURL;
	}
}

function ShowIMG(FileURL,Titulo,vAncho,vAlto,vScroll,vResize)
{
// FileURL : path y nombre del file
// Titulo  : que se coloca en la ventana y en el ALT del IMG
// vScroll -> 0(NO) / 1(SI)
// vResize -> 0(NO) / 1(SI)

	Arriba=((screen.height/2) - (vAlto/2))-3;
	Izquierda=screen.width/2 - (vAncho/2);
	
	MasAlto=vAlto+11;
	features = "width="+vAncho+",height="+MasAlto+",scrollbars="+vScroll+",left="+ Izquierda +", top="+ Arriba + ",resizable="+vResize+", location= 0";	
	pop_new = window.open("",'vpopup',features);
	pop_new.document.write("<html>");
	pop_new.document.write("<head>");
	pop_new.document.write("<title>"+Titulo+"</title>");
	pop_new.document.write("<meta name=\"Author\" content=\"Carlos Peña Málaga\">")
	pop_new.document.write("<meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1\">");
	pop_new.document.write("</head>");
	pop_new.document.write("<body leftmargin=0 topmargin=0 marginheight=0 marginwidth=0 bgcolor=#000000>");
	pop_new.document.write("<table border=0 bgcolor=#000000 cellpadding=0 cellspacing=0 vspace=0 hspace=0>");
//	pop_new.document.write("<tr>");
//  pop_new.document.write("<td align=left height=2><a href=\'javascript:window.close()\'><img src=\"graficos/cerrar.gif\" border=0></a>")
//  pop_new.document.write("</td></tr>");
  	pop_new.document.write("<tr>");
    pop_new.document.write("<td align=left>");
	pop_new.document.write("<img src='");
	pop_new.document.write(FileURL + "'");
	pop_new.document.write(" alt=\"");
	pop_new.document.write(Titulo);
	pop_new.document.write("\"></td></tr>");
	pop_new.document.write("</table>");
	pop_new.document.write("</body>");
	pop_new.document.write("</html>");
}

function Idioma(nomBtn, idioma, vlr) 
{
	document [nomBtn].src = (idioma == "espanol")? btnIdioma[0][vlr].src : btnIdioma[1][vlr].src;
}

function SetImg(nArch,tArch) 
{
	var botao = new Image();
	botao.src = nArch + tArch;
	return botao;
}

function Matriz(n) 
{
	this.length = n;
	for (i=0; i<=n; i++) 
	{
		this[i] = new Image();
	}
	return this;
}

function AñoActual()
{
	FecHoy = new Date()
	return FecHoy.getYear()
}

// Alterna Imagenes
function Alterna_Img(nombre_imagen, imagen_a_mostrar) 
{
//alert(imagen_a_mostrar);
	document [nombre_imagen].src = [imagen_a_mostrar];
}


function PiePagina_esp()
{
document.write('<br><br><table width="100%" border="0" cellspacing="0" cellpadding="0" border="0">');
document.write('<tr><td align="left" valign="bottom"><a href="#inicio"><img src="'+RUTA+'graficos/go_top.gif" border="0" alt="subir" window.status="."; return true></a></td>');
document.write('<td align="right"><img src="'+RUTA+'graficos/RO_firmaBW_mini.gif" border="0"></td></tr>');
document.write('<tr><td colspan="2"><hr size="1" color="gray"></td></tr>');
document.write('<tr><td align="left">');
document.write('	<font face="Verdana" size="1" color="gray">');
document.write('	&nbsp;© Copyright 1999 -');
document.write('	<script language="Javascript">');
document.write('       document.write(AñoActual())');
document.write('	</script> ');
document.write('  &nbsp;RenatoOchoa.com');
//document.write('&nbsp;&nbsp; | &nbsp;<a class="vl" href="mailto:RENATOOCH@msn.com">e-mail</a>');
document.write('&nbsp;|&nbsp;<a class="vl" href="mailto:webmaster@renatoochoa.com">webmaster@renatoochoa.com</a>');
document.write('<br><br></td>');
document.write('<td align="right" valign="top"><a href="mailto:RENATOOCH@msn.com" '); 
document.write('onmouseover="Alterna_Img(\'email_ROchoa\',\''+RUTA+'graficos/email_on.gif\'); window.status=\'RENATOOCH@msn.com\'; return true" ');
document.write('onmouseout="Alterna_Img(\'email_ROchoa\',\''+RUTA+'graficos/email_off.gif\'); window.status=\'\'; return true"> ');
document.write('<img src="'+RUTA+'graficos/email_off.gif" border="0" alt="RENATOOCH@msn.com" name="email_ROchoa"></a></td> ');
document.write('</tr></table>');
}

function PiePagina()
{
//document.write('<hr size="1" color="gray">');
document.write('<table width="100%" border="0" cellspacing="0" cellpadding="0" border="0"><tr><td align="left">');
document.write('	<font face="Verdana" size="1" color="gray">');
document.write('	© Copyright 1999 -');
document.write('	<script language="Javascript">');
document.write('       document.write(AñoActual())');
document.write('	</script> ');
document.write('  &nbsp;RenatoOchoa.com');
//document.write('&nbsp;&nbsp; | &nbsp;<a class="vl" href="mailto:RENATOOCH@msn.com">e-mail</a>');
document.write('&nbsp;|&nbsp;<a class="vl" href="mailto:webmaster@renatoochoa.com">webmaster@renatoochoa.com</a>');
document.write('<br><br></td>');
document.write('</tr></table>');
}

function RandomNum(val) 
{
  return (Math.floor(Math.random()*val));
}

function ShowIMG2(FileURL,Titulo,vScroll,vResize,vCentrado)
{
// FileURL : path y nombre del file
// Titulo  : que se coloca en la ventana y en el ALT del IMG
// vScroll -> 0(NO) / 1(SI)
// vResize -> 0(NO) / 1(SI)
// vCentrado -> 0(NO) / 1(SI)

var ximagen = new Image();
ximagen.src=FileURL;

if (ximagen.width >= screen.width) xAncho=screen.width-100; else xAncho=ximagen.width;
if (ximagen.height >= screen.height) xAlto=screen.height-100; else xAlto=ximagen.height;   

if (vCentrado == 1)
{ 
	Arriba=((screen.height/2) - (xAlto/2))-3;
	Izquierda=screen.width/2 - (xAncho/2);
}
else
{
	Arriba=50;
	Izquierda=2;
}

//	MasAlto=vAlto+11;
	features = "width="+xAncho+",height="+xAlto+",scrollbars="+vScroll+",left="+ Izquierda +", location=no, top="+ Arriba + "resizable="+vResize;	
	pop_new = window.open("",'vpopup',features);
	pop_new.document.write("<html>");
	pop_new.document.write("<head>");
	pop_new.document.write("<title>"+Titulo+"</title>");
	pop_new.document.write("<meta name=\"Author\" content=\"Carlos Peña Málaga\">")
	pop_new.document.write("<meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1\">");
	pop_new.document.write("</head>");
	pop_new.document.write("<body leftmargin=0 topmargin=0 marginheight=0 marginwidth=0 bgcolor=#000000>");
	pop_new.document.write("<table border=0 bgcolor=#000000 cellpadding=0 cellspacing=0 vspace=0 hspace=0>");
	pop_new.document.write('<SCript language="javaSCript">');
	pop_new.document.write('function click()'); 
	pop_new.document.write('{');
	pop_new.document.write('  if (event.button==2)');
	pop_new.document.write('    alert("© Copyright 1999-2007 RenatoOchoa.com")');
	pop_new.document.write('}');
	pop_new.document.write('document.onmousedown=click');
	pop_new.document.write('</SCript>'); 
  	pop_new.document.write("<tr>");
    pop_new.document.write("<td align=\"center\">");
	pop_new.document.write('<a href="javascript:window.close()">');
	pop_new.document.write('<img src="'+FileURL+'" alt="'+Titulo+'"');
	pop_new.document.write('</td></tr>');
	pop_new.document.write("</table>");
	pop_new.document.write("</body>");
	pop_new.document.write("</html>");
}


function alterna_art(tipo, idioma)
// tipo -> 1: cuatro pinturas || 2: dos pinturas margen derecho
// idioma-> espanol || english
{
    tp=29; 
    mostrados=0; 
    num_generado=-1;
    
	setTimeout("alterna_art("+tipo+", 'espanol')",5000);

	if (tipo == 1)
	{
   	   sup_izq=RandomNum(tp*2);
	   sup_izq=(sup_izq > tp-1)? 0: sup_izq;
	   mostrados=(sup_izq == 0) ? 0 : 1;
	   num_generado=(mostrados == 0)? -1 : sup_izq;
	   document.img_sup_izq.filters.blendTrans.apply()
	   if (sup_izq == 0) 
	   {
	   	  fila_sup_izq=2; col_sup_izq=1;
       	  document.img_sup_izq.src="graficos/clear.gif";
	   }
	   else
	   {
		  col_sup_izq=1;
		  fila_sup_izq=link_art2(sup_izq,'espanol');
		  document.img_sup_izq.src="galerias/galeria_"+sup_izq+".jpg";
		}
       document.img_sup_izq.filters.blendTrans.play()
       inf_izq=num_generado;
	   while (inf_izq == num_generado) inf_izq=RandomNum(tp*2);
	   inf_izq=(inf_izq > tp-1)? 0: inf_izq;
	   document.img_inf_izq.filters.blendTrans.apply()
	   if (inf_izq == 0)
	   	  document.img_inf_izq.src="graficos/clear.gif";
	   else
	   	  document.img_inf_izq.src="galerias/galeria_"+inf_izq+".jpg";
       document.img_inf_izq.filters.blendTrans.play()

	   mostrados = (inf_izq == 0) ? mostrados : mostrados+1;
       if (mostrados == 0)
 	   	  num_generado=0;
	   else
		  if (mostrados == 1 && num_generado == -1)
		  	 num_generado = inf_izq;
	}

    document.img_sup_der.filters.blendTrans.apply()
	document.img_inf_der.filters.blendTrans.apply()	
	if (mostrados < 2)
	{
       sup_der=num_generado;
       while (sup_der == num_generado) sup_der=RandomNum(tp);
	   mostrados = (sup_der == 0) ? mostrados : mostrados+1;
	   num_generado=(mostrados == 0)? -1 : sup_der;

	   if (sup_der == 0) 
	   	  document.img_sup_der.src=""+RUTA+"graficos/clear.gif";
	   else
  	   	  document.img_sup_der.src=""+RUTA+"galerias/galeria_"+sup_der+".jpg";
   	   document.img_sup_der.filters.blendTrans.play()
	   
	   if (mostrados < 2)
	   {
	      inf_der=num_generado;
       	  while (inf_der == num_generado || inf_der == 0 && tipo == 1) inf_der=RandomNum(tp);
	   	  if (inf_der == 0 || mostrados == 2)
	   	  	 document.img_inf_der.src=""+RUTA+"graficos/clear.gif";
	   	  else
	   	  	 document.img_inf_der.src=""+RUTA+"galerias/galeria_"+inf_der+".jpg";
		}
		else
		{
	   	 	document.img_inf_der.src="graficos/clear.gif";
		}
   	   document.img_inf_der.filters.blendTrans.play()
	}
	else
	{
	   document.img_sup_der.src="graficos/clear.gif";
       document.img_inf_der.src="graficos/clear.gif";
       document.img_sup_der.filters.blendTrans.play()
	   document.img_inf_der.filters.blendTrans.play()	
	}
}

function link_art(indice, idioma)
{
rutaidioma = (idioma == "espanol")? RUTA+"espanol/" : RUTA+"english/";
gal_idioma = (idioma == "espanol")? "galeria_" : "gallery_";

if (indice <= 5) return(""+rutaidioma+"Galeria1997/"+gal_idioma+"1997.html");
else 
	 if (indice <= 10) return(""+rutaidioma+"Galeria1998/"+gal_idioma+"1998.html");
	 else 
	 	  if (indice <= 15) return(""+rutaidioma+"Galeria1999/"+gal_idioma+"1999.html");
	 	  else
		  	  if (indice <= 20) return(""+rutaidioma+"Galeria12000/"+gal_idioma+"2000.html");
			  else
			  	  return(""+rutaidioma+"Galeria2007/"+gal_idioma+"2007.html");
}

function link_art2(indice, idioma)
{
rutaidioma = (idioma == "espanol")? RUTA+"espanol/" : RUTA+"english/";
//gal_idioma = (idioma == "espanol")? "galeria_" : "gallery_";
//columna_link=(idioma == "espanol") ? 0 : 1;

if (indice <= 5) return(1);
else 
	 if (indice <= 10) return(2);
	 else 
	 	  if (indice <= 15) return(3);
	 	  else
		  	  if (indice <= 20) return(4);
			  else
			  	  return(5);
}

function muestra_art() 
{
    document.write('<table width="100%" border="0" cellspacing="0" cellpadding="0">');
	document.write('<tr>');
	document.write('<td width="58" align="center">');
    document.write('<table width="53" border="0" cellspacing="0" cellpadding="0" align="center">');
	document.write('<tr height="193"><td align="center">');
//	document.write('<a href="'+linkurl[fila_sup_izq][col_sup_izq]+'">');
	document.write('<img name="img_sup_izq" height="193" width="53" border="0" style="filter:blendTrans(duration=[B]2[/B])">');
//	document.write('</a>');
	document.write('</td></tr>');
    document.write('<tr height="193"><td align="center">');
//	document.write(''+linkurl[fila_inf_izq][col_inf_izq]+'');
    document.write('<img name="img_inf_izq" height="193" width="53" border="0" style="filter:blendTrans(duration=[B]2[/B])">');
	document.write('</td></tr>');
	document.write('</table>');
	document.write('</td>');
	   
	document.write('<td width="660" align="center">');
	document.write('<br><br>');
	document.write('<img src="graficos/ROchoalogo.jpg" Alt="Renato Ochoa" border="0">');
//	document.write('<img src="graficos/RenatoOchoa_frimaBW.jpg" width="630" Alt="Renato Ochoa" border="0">');
	document.write('<br><br><br>');
	document.write('</td>');
	document.write('<td width="58" align="center" valign="top">');
	document.write('<table width="53" border="0" cellspacing="0" cellpadding="0" align="center">');
	document.write('<tr height="193"><td align="center">');
//	document.write(''+linkurl[fila_sup_der][col_sup_der]+'');
	document.write('<img name="img_sup_der" height="193" width="53" border="0" style="filter:blendTrans(duration=[B]2[/B])">');
	document.write('</td></tr>');
    document.write('<tr height="193"><td align="center">');
//	document.write(''+linkurl[fila_inf_der][col_inf_der]+'');
    document.write('<img name="img_inf_der" height="193" width="53" border="0" style="filter:blendTrans(duration=[B]2[/B])">');
	document.write('</td></tr>');
	document.write('</table>');
	document.write('</td>');
    document.write('</tr>');
    document.write('</table>');
	alterna_art(1,'espanol')
}
