function grabarGalleta(nombre, valor, caducidad)
{
  document.cookie = nombre + "=" + escape(valor)
    + ((caducidad == null || caducidad == "") ? "" : ("; expires=" + caducidad.toGMTString()))
}
function leerGalleta(nombre)
{
  var buscamos = nombre + "=";
  if (document.cookie.length > 0)
  {
    i = document.cookie.indexOf(buscamos);
    if (i != -1)
    {
      i += buscamos.length;
      j = document.cookie.indexOf(";", i);
      if (j == -1)
        j = document.cookie.length;
      return unescape(document.cookie.substring(i,j));
    }
  }
}
function caduc(meses)
{
    hoy=new Date();
    any=hoy.getYear();
    mes=hoy.getMonth();
    mes+=meses;
    if (mes>11)
    {
      mes=0;
      any++;
    }
    dia=hoy.getDate();
    caducidad=new Date(any,mes,dia);
    return caducidad;
}

