// AJAX functions

var xHRObject = false;


 var xHRObject;
  try
    {
    xHRObject=new XMLHttpRequest();
    }
  catch (e)
    {
    try
      {
      xHRObject=new ActiveXObject("Msxml2.XMLHTTP");
      }
    catch (e)
      {
      try
        {
        xHRObject=new ActiveXObject("Microsoft.XMLHTTP");
        }
      catch (e)
        {
        alert("A böngészõd nem képes az AJAX technológia használatára!!");
//        return false;
        }
      }
    }

function loadPage(id)
{
  params = escape(id) + ".php";
  parent.foodframe.location = params;
}

function enSel(id,args)
{
  document.getElementById("ing"+id).disabled = false;
  params = escape(id) + ".php?" + args;
  parent.foodframe.location = params;
}


function loadPageState(id,args)
{
  params = escape(id) + ".php?" + args;
  parent.foodframe.location = params;
}

function getList(id)
{
  if (id=="12") {
    loadPage('custom');
  }
  if (id=="999") {
    loadPage('magnet0');
  }  
   else {
    parent.foodframe.location = "foodlist.php#" + escape(id);
  }
}

function getPage(id,blogger,page,month)
{
  params = escape(id) + ".php?blogger=" + escape(blogger) + "&page="+ escape(page) + "&m="+ escape(month);
  xHRObject.open("POST", params, true);
  xHRObject.onreadystatechange = getData;
//  xHRObject.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=ISO-8859-2");
  xHRObject.send(null);
}


function getData()
{
  if (xHRObject.readyState == 4 && xHRObject.status == 200)
  {
    var serverText = xHRObject.responseText;
    d = document.getElementById("content");
    d.innerHTML = serverText;
  }
}

function setPress(month,id)
{
    d = document.getElementById("presscard");
    d.style.backgroundImage="url(images/presscard/press" + month + "_" + id + ".png)";
    d.innerHTML = serverText;

}

