// JavaScript Document
//////////////////////
// para recoger los datos recibidos 22/06/05
//function RecogeDato()
//{
  var fecha,hora,dato,est;
   var estado;
   imagen1=new Image()   // 19/07/05
   cadVariables = location.search.substring(1,location.search.length);
   arrVariables = cadVariables.split("&");
   for (i=0; i<arrVariables.length; i++)
   {  arrVariableActual = arrVariables[i].split("=");
      if (i==0) fecha=arrVariableActual[1];
      if (i==1) hora=arrVariableActual[1];
      if (i==2) dato=arrVariableActual[1];
      if (i==3) est=arrVariableActual[1];
      {  if (est=="1")
		 {  estado="ACTIVADA";
//		    imagen1.src="../../Pics/General/ledOn.gif";
		    imagen1.src="../../Pics/home2.gif";
		 }
  	  if (est=="2")
	 	 {  estado="DESACTIVADA";
   			imagen1.src="../../Pics/General/ledOff.jpg";
		 } 
      }
   }
//////////////////////////////////////////////7/

   var hour, day, month, year;
   var today;
   var dia, mes, anio, mes2;
   today = new Date();
   hour = today.getHours();
   day = today.getDate();
   month = today.getMonth();
   year = today.getYear();
   dia = day ;
   mes = month + 1 ;
   mes2 = month + 1 ;
   anio = (year - 2000) ;
   if (hour == 0)
   {  if (day == 1)
         {  if (mes2 == 1) { dia = "31" ; mes = "12" ; anio = anio - 1 ;  }
            if (mes2 == 2) { dia = "30" ; mes = "01" ;  }
            if (mes2 == 3) { dia = "28" ; mes = "02" ;  }
            if (mes2 == 4) { dia = "31" ; mes = "03" ;  }
            if (mes2 == 5) { dia = "30" ; mes = "04" ;  }
            if (mes2 == 6) { dia = "31" ; mes = "05" ;  }
            if (mes2 == 7) { dia = "30" ; mes = "06" ;  }
            if (mes2 == 8) { dia = "31" ; mes = "07" ;  }
            if (mes2 == 9) { dia = "31" ; mes = "08" ;  }
            if (mes2 == 10) { dia = "30" ; mes = "09" ; }
            if (mes2 == 11) { dia = "31" ; mes = "10" ; }
            if (mes2 == 12) { dia = "30" ; mes = "11" ; }
         }
   }
   else
   {  if (dia < 10) {dia = "0" + dia}
      if (mes < 10) {mes = "0" + mes}
   }
   if (anio < 10) {anio = "0" + anio}
   fecha = (dia) + "/" + (mes) + "/" + (anio);


if ((day >= 1 && day <= 5) || (day >= 10 && day <= 15) || (day >= 20 && day <= 25))
{
if (hour == 0) { hora="00:20:35";dato="0,15";est="1"; }
if (hour == 1) { hora="01:20:35";dato="0,15";est="1"; }
if (hour == 2) { hora="02:20:35";dato="0,15";est="1"; }
if (hour == 3) { hora="03:20:35";dato="0,15";est="1"; }
if (hour == 4) { hora="04:20:35";dato="0,15";est="1"; }
if (hour == 5) { hora="05:20:35";dato="0,15";est="1"; }
if (hour == 6) { hora="06:20:35";dato="0,15";est="1"; }
if (hour == 7) { hora="07:20:35";dato="0,15";est="1"; }
if (hour == 8) { hora="08:20:35";dato="0,15";est="1"; }
if (hour == 9) { hora="09:20:35";dato="0,15";est="1"; }
if (hour == 10) { hora="10:20:35";dato="0,15";est="1"; }
if (hour == 11) { hora="11:20:35";dato="0,15";est="1"; }
if (hour == 12) { hora="12:20:35";dato="0,15";est="1"; }
if (hour == 13) { hora="13:20:35";dato="0,15";est="1"; }
if (hour == 14) { hora="14:20:35";dato="0,15";est="1"; }
if (hour == 15) { hora="15:20:35";dato="0,15";est="1"; }
if (hour == 16) { hora="16:20:35";dato="0,15";est="1"; }
if (hour == 17) { hora="17:20:35";dato="0,15";est="1"; }
if (hour == 18) { hora="18:20:35";dato="0,15";est="1"; }
if (hour == 19) { hora="19:20:35";dato="0,15";est="1"; }
if (hour == 20) { hora="20:20:35";dato="0,15";est="1"; }
if (hour == 21) { hora="21:20:35";dato="0,15";est="1"; }
if (hour == 22) { hora="22:20:35";dato="0,15";est="1"; }
if (hour == 23) { hora="22:20:35";dato="0,15";est="1"; }
if (hour == 9) { hora="18:20:35";dato="0,15";est="1"; }
}
else
{
if (hour == 9) { hora="18:20:35";dato="0,16";est="1"; }
if (hour == 10) { hora="18:20:35";dato="0,16";est="1"; }
}


//}

/////////////////////////////////////////////////
//var pagina;
//pagina="Espanol/marcos-esp/espanol.htm?fecha=" + (fecha) + "&" +"hora="+ (hora) + "&" +"dato="+ (dato);
