//Define Array Mes	
var mes=new makeArray(12);
	mes[0]="Enero"
	mes[1]="Febrero"
	mes[2]="Marzo"
	mes[3]="Abril"
	mes[4]="Mayo"
	mes[5]="Junio"
	mes[6]="Julio"
	mes[7]="Agosto"
	mes[8]="Setiembre"
	mes[9]="Octubre"
	mes[10]="Noviembre"
	mes[11]="Diciembre"

//Define Array Dias	
var dia=new makeArray(7);
	dia[0]="Domingo"
	dia[1]="Lunes"
	dia[2]="Martes"
	dia[3]="Miércoles"
	dia[4]="Jueves"
	dia[5]="Viernes"
	dia[6]="Sábado"

//Carga de Imagenes
var porturl = new Array(11);
 porturl[0] = "fotos/portada0.jpg"
 porturl[1] = "fotos/portada1.jpg"
 porturl[2] = "fotos/portada2.jpg"
 porturl[3] = "fotos/portada3.jpg"
 porturl[4] = "fotos/portada4.jpg"
 porturl[5] = "fotos/portada5.jpg"
 porturl[6] = "fotos/portada6.jpg"
 porturl[7] = "fotos/portada7.jpg"

//Carga de ALT
var altpcont = new Array();
 altpcont[0] = "Jorge Soto 'el camello'"
 altpcont[1] = "Jorge Soto / Pedro 'el viejo' Garay"
 altpcont[2] = "Horacio Raúl 'la pepa' Baldessari"
 altpcont[3] = "Julinho"
 altpcont[4] = "Julinho, Torres, Córdova y Bonnet..."
 altpcont[5] = "Julinho / Javier Ferreira"
 altpcont[6] = "Julio Cesar Balerio"
 altpcont[7] = "Roberto 'chorrillano' Palacios"


var address = "http://www.internetsceleste.com"
var title = "InternetSCeleste homepage - Sporting Cristal"

function addFavorites(){
	if (document.all) {
		window.external.AddFavorite(address, title)
	} else {
		alert("Lo sentimos, esta opción sólo funciona en navegadores IE 4.0 o mayores")
	}
}

function RandomNum(val) 
{
  return (Math.floor(Math.random()*val));
}

function showport() 
// Carga aleatoria de fotos en Portada ISC
{
  num=RandomNum(8);
  document.write("<img src="+porturl[num]+" border=1 alt=\""+altpcont[num]+"\">");
}


function makeArray(n)  
{
    this.length = n;
    for (i=0; i< n; i++) this[i]="";
}

function FechaHoy()
{
	FecHoy = new Date();
	return dia[FecHoy.getDay()] + " " + FecHoy.getDate() + " de " + mes[FecHoy.getMonth()] + " del " + FecHoy.getYear()
}

function makeScroll(n)
{
  if ( n == 1 )  msg1="InternetSCeleste, la expresión del Sentimiento y la paSCión que desde La Florida invade nuestro corazón...";
                 else msg1="Sporting Cristal, eterno campeón !!!                         ";
  var msg2="                                                                                    ";
  var msg=msg1+msg2;
  msg=msg+msg;
  return msg
}

function goScroll()
{
    setTimeout("goScroll()",100);
    msg=msg.substring(1,msg.length)+msg.substring(0,1);
    window.status=msg;
}

function disp(n)
{
   msg=makeScroll(n)
   goScroll()
}

function wiper(n)
{
  stcnt = 16;
  msg=makeScroll(n);
  wmsg = new makeArray(60);
  wmsg[0]=msg;
  blnk = "                                                                                     ";
  for (i = 1; i < 60; i++)  
  {
    b = blnk.substring(0,i);
    for (j = 0; j < 60; j++) wmsg[i]=wmsg[i]+msg.charAt(j)+b;
  }
  goWiper()
}

function goWiper()  
{
  if (stcnt > -1) str = wmsg[stcnt]; 
	     else str = wmsg[0];
  if (stcnt-- < -40) stcnt=36;
  window.status = str;
  timeID= window.setTimeout("goWiper()",100);
}

function ShowPopup(FileURL,vAncho,vAlto,vScroll,vResize,centrado)
{
// vScroll -> 0(NO) / 1(SI)
// vResize -> 0(NO) / 1(SI)

// centrado -> 0(NO) / 1(SI)
	if (centrado == 1)
	{ 
		Arriba=((screen.height/2) - (vAlto/2))-3;
		Izquierda=screen.width/2 - (vAncho/2);
	}
	else
	{
		Arriba=50;
		Izquierda=2;
	}

	features = "width="+vAncho+",height="+vAlto+",scrollbars="+vScroll+",left="+ Izquierda +", top="+ Arriba + ",resizable="+vResize+" location=0";	
	var popup=window.open(FileURL,FileURL.value,features);

	if ( navigator.appName.substring(0,8) == "Netscape" )
	{
		popup.location = FileURL;
	}
}

function ShowIMG(FileURL,Titulo,vAncho,vAlto,vScroll,vResize,centrado)
{
// 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)
// centrado -> 0(NO) / 1(SI)

	if (centrado == 1)
	{ 
		Arriba=((screen.height/2) - (vAlto/2))-14;
		Izquierda=screen.width/2 - (vAncho/2);
	}
	else
	{
		Arriba=50;
		Izquierda=2;
	}

	MasAlto=vAlto+14;
	features = "width="+vAncho+",height="+MasAlto+",scrollbars="+vScroll+",left="+Izquierda+", 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("<tr>");
    pop_new.document.write("<td align=left height=14><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 cabecera2(titulo,subtitulo)
{
	document.write('<table border="0" cellpadding="0" cellspacing="0" width="100%">');
	document.write('<tr>');
	document.write('	<td colspan=4><img src="graficos/clear.gif" width=1 height=1 border=0></td>');
	document.write('</tr>');
	document.write('<tr bgcolor="#666666">');
	document.write('	<td colspan=4><img src="graficos/clear.gif" width=1 height=1 border=0></td>');
	document.write('</tr>');
	document.write('<tr bgcolor="#333333">');
	document.write('	<td colspan=4><img src="graficos/clear.gif" width=1 height=1 border=0></td>');
	document.write('</tr>');
	document.write('<tr bgcolor="#000000">');
	document.write('	<td colspan=4><img src="graficos/clear.gif" width="1" height="6" border=0></td>');
	document.write('</tr>');
	document.write('<tr bgcolor="#000000" valign=middle>');
	document.write('	<td bgcolor="#000000" width=290 valign="middle" align=center>');
	document.write('<a href="index.html"><img src="graficos/newlogo.gif" border="0" alt="Ir a la página principal..."></a>');
	document.write('	</td>');
	document.write('	<td width=15>');
	document.write('	</td>');
	document.write('	<td	valign="middle" align="right">');
	document.write('		<script language=javascript>');
	document.write('			propaganda(0)');
	document.write('		</script>');
	document.write('	</td>');
	document.write('	<td width=2>');
	document.write('	&nbsp;</td>');
	document.write('</tr>');
	document.write('<tr bgcolor="#000000">');
	document.write('	<td colspan=4><img src="graficos/clear.gif" width="1" height="5" border=0></td>');
	document.write('</tr>');
	document.write('<tr bgcolor="#333333">');
	document.write('	<td colspan=4><img src="graficos/clear.gif" width=1 height=1 border=0></td>');
	document.write('</tr>');
	document.write('<tr bgcolor="#666666">');
	document.write('	<td colspan=4><img src="graficos/clear.gif" width=1 height=1 border=0></td>');
	document.write('</tr>');
	document.write('<tr>');
	document.write('	<td colspan=4><img src="graficos/clear.gif" width=1 height=1 border=0></td>');
	document.write('</tr>');	document.write('	<td colspan=4><img src="graficos/clear.gif" width="1" height="1" border=0></td>');
	document.write('</tr>');
	document.write('<tr bgcolor="#000000">');
	document.write('	<td colspan=4><img src="graficos/clear.gif" width="1" height="1" border=0></td>');
	document.write('</tr>');
	document.write('<tr bgcolor="#000000">');
	document.write('	<td align="right" colspan="4"><FONT size="4" face="Times New MS" color="#26C8F7">'+titulo+'&nbsp;</font></td>');
	document.write('</tr>');
	document.write('<tr bgcolor="#000000">');
	document.write('	<td colspan=4><img src="graficos/clear.gif" width="1" height="1" border=0></td>');
	document.write('</tr>');
	if (subtitulo != " ")
	{ 
		document.write('<tr>');
		document.write('<td colspan="4" align="right"><FONT size="4" face="Times New MS" color="white">'+subtitulo+'</font></td></tr>')
		document.write('<tr>');
		document.write('	<td colspan=4><img src="graficos/clear.gif" width="1" height="2" border=0></td>');
		document.write('</tr>');
	}
	document.write('<tr>');
	document.write('	<td colspan=4><img src="graficos/clear.gif" width="1" height="5" border=0></td>');
	document.write('</tr>');
	document.write('</table>');
}


function FechaModif(fecha)
{
	var d = new Date(fecha.substring(4,8),fecha.substring(2,4)-1,fecha.substring(0,2));
	return dia[d.getDay()] + " " + d.getDate() + "/" + mes[d.getMonth()].substring(0,3) + "/" + d.getYear()
}

function ShowIMG2(FileURL,Titulo,vAncho,vAlto,vScroll,vResize,centrado)
{
// 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)
// centrado -> 0(NO) / 1(SI)
	if (centrado == 1)
	{ 
		Arriba=((screen.height/2) - (vAlto/2))-3;
		Izquierda=screen.width/2 - (vAncho/2);
	}
	else
	{
		Arriba=50;
		Izquierda=2;
	}
	features = "width="+vAncho+",height="+vAlto+",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>");
	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>");
}
