
function saca_titulo(titu) 
{
  document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://active.macromedia.com/flash4/cabs/swflash.cab#version=4,0,0,0" id="'+titu+'" width="345" height="56">')
  document.write('<param name="movie" value="'+titu+'.swf">')
  document.write('<param name="quality" value="high">')
  document.write('<embed name="'+titu+'" src='+titu+'.swf" quality="high"  width="345" height="56" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash">')
  document.write('</embed>')
  document.write('</object>')
}

function saca_publi(titu) 
{
if (titu=="chevrolet_medio")
{
  document.write('<img src=publicidad/sorteo1.gif width=250>')

}
else
{
  document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://active.macromedia.com/flash4/cabs/swflash.cab#version=4,0,0,0" id="'+titu+'" width="200" height="200">')
  document.write('<param name="movie" value="publicidad/'+titu+'.swf">')
  document.write('<param name="quality" value="high">')
  document.write('<embed name="publicidad/'+titu+'" src=publicidad/'+titu+'.swf" quality="high"  width="300" height="300" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash">')
  document.write('</embed>')
  document.write('</object>')
}
}
function ValidarFecha(wdia,wmes,wano){


if (isNaN(wdia) || wdia=="" || isNaN(wmes) || wmes=="" || isNaN(wano) || wano=="") {
   return false
 }
var diasMes = new Array(31, 28, 31, 30, 31, 30, 31, 31,
            30, 31, 30, 31);
nmes=parseInt(wmes,10)
nano=parseInt(wano,10)
ndia=parseInt(wdia,10)
ndiasmes=0
if (nmes < 1 || nmes >12) return false;
if (2 == nmes)
     ndiasmes = ((0 == nano % 4) && (0 != (nano % 100))) ||
            (0 == nano % 400) ? 29 : 28;
   else
      ndiasmes = diasMes[nmes-1];

if (ndia > ndiasmes)
     return false;

return true;
}

//SUMAR O RESTAR DIAS A UNA FECHA
var aFinMes = new Array(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);

  function finMes(nMes, nAno){
   if (2 == nMes)
     ndiasmes = ((0 == nAno % 4) && (0 != (nAno % 100))) ||
            (0 == nAno % 400) ? 29 : 28;
   else
      ndiasmes = aFinMes[nMes-1];
   return ndiasmes;
  }

   function padNmb(nStr, nLen, sChr){
    var sRes = String(nStr);
    for (var i = 0; i < nLen - String(nStr).length; i++)
     sRes = sChr + sRes;
    return sRes;
   }

   function makeDateFormat(nDay, nMonth, nYear){
    var sRes;
    sRes = padNmb(nDay, 2, "0") + "/" + padNmb(nMonth, 2, "0") + "/" + padNmb(nYear, 4, "0");
    return sRes;
   }
   
  function incDate(sFec0){
   var nDia = parseInt(sFec0.substr(0, 2), 10);
   var nMes = parseInt(sFec0.substr(3, 2), 10);
   var nAno = parseInt(sFec0.substr(6, 4), 10);
   nDia += 1;
   if (nDia > finMes(nMes, nAno)){
    nDia = 1;
    nMes += 1;
    if (nMes == 13){
     nMes = 1;
     nAno += 1;
    }
   }
   return makeDateFormat(nDia, nMes, nAno);
  }

  function decDate(sFec0){
   var nDia = Number(sFec0.substr(0, 2));
   var nMes = Number(sFec0.substr(3, 2));
   var nAno = Number(sFec0.substr(6, 4));
   nDia -= 1;
   if (nDia == 0){
    nMes -= 1;
    if (nMes == 0){
     nMes = 12;
     nAno -= 1;
    }
    nDia = finMes(nMes, nAno);
   }
   return makeDateFormat(nDia, nMes, nAno);
  }

  function addToDate(sFec0, sInc){
   var nInc = Math.abs(parseInt(sInc));
   var sRes = sFec0;
   if (parseInt(sInc) >= 0)
    for (var i = 0; i < nInc; i++) sRes = incDate(sRes);
   else
    for (var i = 0; i < nInc; i++) sRes = decDate(sRes);
   return sRes;
  }
var 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";

function PonerFecha(){
	var time = new Date()
	var d = time.getDay()

	switch (d) {
	   case 0 :
	      diaSemana = "Domingo"
			break
	   case 1 :
	      diaSemana = "Lunes"
			break
	   case 2 :
	      diaSemana = "Martes"
			break
	   case 3 :
	      diaSemana = "Miércoles"
			break
	   case 4 :
	      diaSemana = "Jueves"
			break
	   case 5 :
	      diaSemana = "Viernes"
			break
	   case 6 :
	      diaSemana = "Sábado"
			break
	}
	
	mm=time.getMonth()
	min1=time.getMinutes()
	min2=min1.toString()
	if (min2.length ==1){
	  min2="0"+min2;
	}	
    if(document.all){
		document.getElementById('Info').innerText = time.getHours() + ":" + min2  +  ", " + diaSemana + " " + time.getDate() + " de " + (meses[mm]) + " de " + time.getFullYear();;
		} else{
		document.getElementById('Info').textContent = time.getHours() + ":" + min2  +  ", " + diaSemana + " " + time.getDate() + " de " + (meses[mm]) + " de " + time.getFullYear();;
		}	
    setTimeout(PonerFecha,1000);
  }

