function pcalendario(valor)
{
  loadcode('pcalendario','ajax/calendario.php?fecha_publicacion='+valor);
}


function loadcode(objs,page,valor)
{
 var req = new XMLHttpRequest();

 var obj = document.getElementById(objs);

 if (req) { req.onreadystatechange = function()
 {
 if (req.readyState == 4 && req.status == 200) {
 removecode(objs);
 obj.innerHTML=req.responseText;
 }
 };
 req.open('GET', page);
 req.setRequestHeader('Content-Type','text/html; charset=iso-8859-1');
 
 req.send(null); }

 }


function loadvalue(page,funcion)
{
 var req = new XMLHttpRequest();
 if (req) { req.onreadystatechange = function()
 {
   if (req.readyState == 4 && req.status == 200)
   {
     respuesta=req.responseText;
     eval(funcion);
   }
 };
 req.open('GET', page);
 req.send(null);
  }
}
 
function removecode(objs)
{
  var obj = document.getElementById(objs);
  while (obj.hasChildNodes())
  {
        obj.removeChild(obj.firstChild);
  }
}

function verifica_login(respuesta)
{
   if( respuesta=='OK')
   {
       removecode('login');
       inicio();
       return false;
   } else {
       loadcode('login','modulos/login.php?user='+document.form_login.user.value+'&password='+document.form_login.password.value);
       return false;
   }
}

