<!-- FUNCIONA PARA IGUALAR CAPAS-->

function sortNum(a,b) { return b-a}
function fixH2(one,two,three) {
if (document.getElementById(one)) {
var obj=new Array(3);
var option=[one,two,three];
for(var i=0; i<option.length; i++) {
document.getElementById(option[i]).style.height="auto";
obj[i]=document.getElementById(option[i]).offsetHeight;
nh=obj.sort(sortNum);
}
nh1=nh.splice(1,2);
for(var i=0; i<option.length; i++) {
document.getElementById(option[i]).style.height=nh+"px";
}
}
}


<!-- FUNCION DE CALENDARIO -->

function montharray(m0, m1, m2, m3, m4, m5, m6, m7, m8, m9, m10, m11)
{
   this[0] = m0;
   this[1] = m1;
   this[2] = m2;
   this[3] = m3;
   this[4] = m4;
   this[5] = m5;
   this[6] = m6;
   this[7] = m7;
   this[8] = m8;
   this[9] = m9;
   this[10] = m10;
   this[11] = m11;
}

function MakeArray(n) {this.length = n; return this;}
  var Days = new MakeArray(7);
  var Months = new MakeArray(12);
  Days[1]="Domingo"; Days[2]="Lunes"; Days[3]="Martes";   Days[4]="Miércoles";
  Days[5]="Jueves"; Days[6]="Viernes"; Days[7]="Sábado";
  Months[1]="Enero"; Months[2]="Febrero"; Months[3]="Marzo";   Months[4]="Abril"; 
  Months[5]="Mayo"; Months[6]="Junio"; Months[7]="Julio";   Months[8]="Agosto"; 
  Months[9]="Septiembre"; Months[10]="Octubre"; Months[11]="Noviembre"; 
  Months[12]="Diciembre";

  function getNiceDate(theDate) {
  return Days[theDate.getDay()+1] + " " + theDate.getDate() + " " +
  Months[theDate.getMonth()+1] + " " + theDate.getYear(); }


function calendar()
{
   today = new Date();
   var thisDay;
   var monthNames = "JanFebMarAprMayJunJulAugSepOctNovDec";
   var monthNames2 = " 1 2 3 4 5 6 7 8 9101112";
   var monthDays = new montharray(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);
   year = today.getFullYear();
   mes = [today.getMonth()+1];
   if(year<2000)year+=1900;
   thisDay = today.getDate();
   if (((year % 4 == 0) && (year % 100 != 0)) || (year % 400 == 0))
      monthDays[1] = 29;
   nDays = monthDays[today.getMonth()];
   firstDay = today;
   firstDay.setDate(1);
   var lastMod = new Date();
   startDay = firstDay.getDay();
   document.write("<TABLE WIDTH=\"140\" BORDER=\"0\" CELLPADDING=\"1\" class=\"calendario\">");
   document.write("<TR><TH COLSPAN=7>");
   document.write(getNiceDate(lastMod));
   document.write("<TR><TH>Do<TH>Lu<TH>Ma<TH>Mi<TH>Ju<TH>Vi<TH>Sá");
   document.write("<TR>");
   column = 0;
   for (i=0; i<startDay; i++)
   {
      document.write("<TD>");
      document.write("<CENTER>");
      document.write("&nbsp");
      column++;
   }
   for (i=1; i<=nDays; i++)
   {
      document.write("<TD>");
     <!-- if (column == 0) -->
        <!-- document.write("<FONT COLOR=\"#FF0000\">");-->
     <!-- if (column == 6) -->
      <!--   document.write("<FONT COLOR=\"#0000FF\">"); -->
      if (i == thisDay)
         document.write("<FONT COLOR=\"#000000\"><b>");
      document.write("<CENTER>");
	  if(i < thisDay)
      document.write("<a href=\"hemeroteca.php?f="+year+"-"+mes+"-"+i+"\">"+i+"</a>");
	   if(i == thisDay)
      document.write("<a href=\"hemeroteca.php?f="+year+"-"+mes+"-"+i+"\">"+i+"</a>");
	   if(i > thisDay)
      document.write(i);
      document.write("</CENTER>");
      if (i == thisDay)
         document.write("</b>")
      if (column == 7||column == 0||i == thisDay) 
         document.write("</FONT>")
      column++;
      if (column == 7)
      {
         document.write("<TR>");
         column = 0;
      }
   }
   document.write("</TABLE>");
}


function imprimir()
{

		var bName = navigator.appName;
		var bVer = parseFloat(navigator.appVersion);
		
    		var contenido = document.getElementById("cont").innerHTML;
			ventana=window.open("/print.php","ventana","width=560");
    		ventana.document.open();
    		ventana.document.write('<html><head><title>cantabriaimparcial.com<\/title><link rel="stylesheet" type="text/css" href="css/estilos.css"><\/head><body style=\"background-color: #FFFFFF\">');
			
		ventana.document.write('<br><p>&nbsp;&nbsp;&nbsp;<strong>Cantabriaimparcial.com</strong></p>');	
    	ventana.document.write(contenido);
        ventana.document.close();
        ventana.print();
        ventana.focus();
}
