// JavaScript Document

var mydate=new Date() 
var year=mydate.getYear() 
var dayarray=new Array("Domingo","Lunes","Martes","Miercoles","Jueves","Viernes","Sabado")
var montharray=new Array("Enero","Febrero","Marzo","Abril","Mayo","Junio","Julio","Agosto","Septiembre","Octubre","Noviembre","Diciembre")

var doAlerts=false;
var arVersion = navigator.appVersion.split("MSIE")
var version = 1*parseFloat(arVersion[1])

function changeSheets(whichSheet){
  whichSheet=whichSheet-1;
  if(document.styleSheets){
    var c = document.styleSheets.length;
    if (doAlerts) alert('Cambiando al estilo '+(whichSheet+1));
    for(var i=0;i<c;i++){
      if(i!=whichSheet){
        document.styleSheets[i].disabled=true;
      }else{
        document.styleSheets[i].disabled=false;
      }
    }
  }
}


function  escribirFecha () {
	if (year < 1000) year+=1900 
	var day=mydate.getDay() 
	var month=mydate.getMonth() 
	var daym=mydate.getDate() 
	if (daym<10) daym="0"+daym 
	document.write(dayarray[day]+" "+daym+" de "+montharray[month]+" de "+year) 
}

function correctPNG() // correctly handle PNG transparency in Win IE 5.5 & 6.
{
   if ((version >= 5.5) && (document.body.filters)) 
   {
      for(var i=0; i<document.images.length; i++)
      {
         var img = document.images[i]
         var imgName = img.src.toUpperCase()
         if (imgName.substring(imgName.length-3, imgName.length) == "PNG")
         {
			var imgID = (img.id) ? "id='" + img.id + "' " : ""
            var imgClass = (img.className) ? "class='" + img.className + "' " : ""
            var imgTitle = (img.title) ? "title='" + img.title + "' " : "title='" + img.alt + "' "
            var imgStyle = "display:inline-block;" + img.style.cssText 
            if (img.align == "left") imgStyle = "float:left;" + imgStyle
            if (img.align == "right") imgStyle = "float:right;" + imgStyle
            if (img.parentElement.href) imgStyle = "cursor:hand;" + imgStyle
            var strNewHTML = "<span " + imgID + imgClass + imgTitle
            + " style=\"" + "width:" + img.width + "px; height:" + img.height + "px;" + imgStyle + ";"
            + "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader"
            + "(src=\'" + img.src + "\', sizingMethod='scale');\"></span>" 
            img.outerHTML = strNewHTML
            i = i-1
         }
      }
   }    
}


function activeFlash()
{
	_miO=document.getElementsByTagName("object"); 
	for(var x=0;x<_miO.length;x++)
	{
//		alert (_miO[x].movie);
		if (_miO[x].movie!='imageview.swf')_miO[x].outerHTML=_miO[x].outerHTML;

//		AC_FL_RunContent( 'codebase','http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0','width',_miO[x].width,'height',_miO[x].height,'src',_miO[x].movie,'quality','high','pluginspage','http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash','movie',_miO[x].movie );
	}
}


function initpage()
{
	correctPNG();
	if (version >= 5.5) activeFlash();
}