function abrirVentana(url,w,h){
	vetanita=window.open(url,'ventanita','toolbar=no,resizable=no,status=no,scrollbars=no,location=no,menubar=no,width='+w+',height='+h);
}

function abrirVentanaScroll(url,w,h){
	vetanita=window.open(url,'ventanita','toolbar=no,resizable=no,status=no,scrollbars=yes,location=no,menubar=no,width='+w+',height='+h);
}

function escribirBarraIconos(){

	txt =  "";
	txt += "<table cellpadding=\"0\" cellspacing=\"0\" border=\"0\" align=\"center\">\n";
	txt += "<tr>\n";
	txt += "	<td bgcolor=\"#003366\">\n";

	txt += "	<table cellpadding=\"0\" cellspacing=\"1\" border=\"0\">\n";
	txt += "	<tr>\n";
	txt += "		<td bgcolor=\"DB9000\" valign=\"top\"><!-- inicio de barra de titulo \n";
	txt += "			--><img src=\"img/empty.gif\" width=\"1\" height=\"3\" border=\"0\"><br><!--\n";
	txt += "			-->&nbsp; <a href=\"/c_main.php\"><span class=\"blanco11Bold\">:: e-Contento ::</span></a><br><!--\n";
	txt += "			--><img src=\"img/empty.gif\" width=\"1\" height=\"3\" border=\"0\"><br><!--\n";
	txt += "				fin de barra de titulo --></td>\n";
	txt += "	</tr>\n";
	txt += "	<tr>\n";
	txt += "		<td>\n";

	txt += "<table cellpadding=\"0\" cellspacing=\"0\" border=\"0\" width=\"750\">\n";
	txt += "<tr>\n";
	txt += "	<td bgcolor=\"#CCCCCC\" width=\"50\" valign=\"top\">\n";
	
	txt += "	<table cellpadding=\"0\" cellspacing=\"1\" border=\"0\" width=\"50\" height=\"100%\">\n";
	txt += "	<tr>\n";
	txt += "		<td bgcolor=\"#CCCCCC\" align=\"center\" valign=\"top\" height=\"100%\"><br>\n";
	txt += "			<a href=\"c_main.php\" onMouseOver=\"cambiar('ico_home','ico_home_on')\" onMouseOut=\"cambiar('ico_home','ico_home_off')\"><img src=\"img/ico_home_off.gif\" name=\"ico_home\" width=\"32\" height=\"32\" border=\"0\" alt=\"Inicio / Home\"><br>Inicio</a><br><br>\n";
	txt += "			<hr width=\"80%\"><br>\n";
	txt += "			<a href=\"http://e-contento.com/files/rss.xml\" onMouseOver=\"cambiar('ico_rss','ico_rss_on')\" onMouseOut=\"cambiar('ico_rss','ico_rss_off')\" title=\"RSS 2.0, Feed, Sindicaci&#243;n de contenidos\"><img src=\"img/ico_rss_off.gif\" width=\"32\" height=\"32\" name=\"ico_rss\" alt=\"Feed. RSS. Sindicaci&#243;n de contenidos\" border=\"0\"><br>RSS</a><br><br>\n";
	//txt += "			<hr width=\"80%\"><br>\n";
	txt += "			<a href=\"http://directorio.e-contento.com\" target=\"_blank\" onMouseOver=\"cambiar('ico_favoritos','ico_favoritos_on')\" onMouseOut=\"cambiar('ico_favoritos','ico_favoritos_off')\"><img src=\"img/ico_favoritos_off.gif\" name=\"ico_favoritos\" width=\"32\" height=\"32\" border=\"0\" alt=\"Mis Favoritos - Bookmarks\"><br></a><br><br>\n";
	txt += "		</td>\n";
	txt += "	</tr>\n";
	txt += "	</table>\n";

	txt += "	</td>\n";
	txt += "	<td bgcolor=\"#003366\"><img src=\"img/empty.gif\" width=\"1\" height=\"1\" border=\"0\"></td>\n";
	txt += "	<td bgcolor=\"#FFFFFF\" width=\"750\" valign=\"top\">\n";
	document.write(txt);
}



// calendario
Meses = new Array;
	Meses[0]  = "Enero";
	Meses[1]  = "Febrero";
	Meses[2]  = "Marzo";
	Meses[3]  = "Abril";
	Meses[4]  = "Mayo";
	Meses[5]  = "Junio";
	Meses[6]  = "Julio";
	Meses[7]  = "Agosto";
	Meses[8]  = "Septiembre";
	Meses[9]  = "Octubre";
	Meses[10] = "Noviembre";
	Meses[11] = "Diciembre";

DiasSemana = new Array ("L","M","X","J","V","S","D");
DiasMes = new Array(31,28,31,30,31,30,31,31,30,31,30,31);
	

function escribirCalendario(fecha){
	dia = fecha.getDate();
	diaSemana = fecha.getDay();
	mes = fecha.getMonth();
	anno = fecha.getYear();
	
	if (anno%4 == 0) {DiasMes[1] = 29}
	
	stTexto = "";
	stTexto += "<table cellpadding=\"0\" cellspacing=\"0\" border=\"0\">\n";
	stTexto += "<tr>\n";
	stTexto += "	<td bgcolor=\"#FFFFFF\">\n";
	stTexto += "		<table cellpadding=\"0\" cellspacing=\"1\" border=\"0\" width=\"140\">\n";
	stTexto += "		<tr>\n";
	stTexto += "			<td colspan=\"7\" class=\"cajaAzul\">&nbsp;" + Meses[mes].toUpperCase() + "&nbsp;</td>\n";
	stTexto += "		</tr>\n";
	stTexto += "		<tr>\n";
	document.write(stTexto);
	for(i=0;i<7;i++){
		document.write ("<td class=\"cajaNaranja\" align=\"center\"><b>" + DiasSemana[i] + "</b></td>");
	}

	stTexto  = "";			
	stTexto += "		</tr>\n";
	document.write(stTexto);
	
	aux = (dia - diaSemana + 1)%7	
	
	if (aux > 1) {
		aux = aux - 7;				
	}

	nS = Math.ceil((DiasMes[mes] - aux + 1)/7);

	for (var numSemana = 0; numSemana < nS; numSemana++){
		document.write("<tr>");
		for (i=0; i<7 ; i++){
			iAux = aux + i + numSemana*7;
			if (iAux < 1){
				document.write("<td align=\"center\" class=\"cajaNaranjaClaro\">&nbsp;</td>");
			}else if (iAux < DiasMes[mes] + 1 ){
				if (iAux == dia){
					document.write("<td align=\"center\" class=\"cajaNaranjaClaro\"><b>" + iAux + "</b></td>");				
				}else{
					document.write("<td align=\"center\" class=\"cajaNaranjaClaro\">" + iAux + "</td>");
				}
			}else{
				document.write("<td align=\"center\" class=\"cajaNaranjaClaro\">&nbsp;</td>");
			}
		}
		
		document.write("</tr>");
	}
	
	stTexto  = "";			
	stTexto += "		</tr>\n";
	stTexto += "		</table>\n";
	stTexto += "	</td>\n";
	stTexto += "</tr>\n";
	stTexto += "</table>\n";
	document.write(stTexto);
}