function ajaxinit()
{
	var xmlHttp;
	try
	{
		// Firefox, Opera 8.0+, Safari
		xmlHttp=new XMLHttpRequest();
	}
	catch (e)
	{
		// Internet Explorer
		try
		{
			xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
		}
		catch (e)
		{
			try
			{
				xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
			}
			catch (e)
			{
				return false;
			}
		}
	}
	
	return xmlHttp;
  }

function buildpost(theFormName) {
    theForm = document.forms[theFormName];
    var qs = ''
    for (e=0;e<theForm.elements.length;e++) {
        if (theForm.elements[e].name!='') {
            var name = theForm.elements[e].name;
            qs+=(qs=='')?'':'&'
            qs+= name+'='+escape(theForm.elements[e].value);
        }
    }
    return qs;
}
 	 
function sendHTML(link)
{
  data=null;
  data=buildpost('online');
	var xmlHttp = ajaxinit(); if (!xmlHttp) {alert("Your browser does not support AJAX!");return;};
  xmlHttp.open("POST", '/content/online.php', false);
	xmlHttp.setRequestHeader( "Content-Type", "application/x-www-form-urlencoded");
	xmlHttp.send(data);	
    if (xmlHttp.status != 200)
	{
		alert('Nem sikerült lekérni az adatokat! '+link);
		return null;
	}	
	s=xmlHttp.responseText;
  document.getElementById('cnt').innerHTML=s;
}


function getHTML(link)
{
  data=null;
	var xmlHttp = ajaxinit(); if (!xmlHttp) {alert("Your browser does not support AJAX!");return;};
  xmlHttp.open("POST", '/content/'+link, false);
	xmlHttp.setRequestHeader( "Content-Type", "application/x-www-form-urlencoded");
	xmlHttp.send(data);
    if (xmlHttp.status != 200)
	{
		alert('Nem sikerült lekérni az adatokat! '+link);
		return null;
	}
	return xmlHttp.responseText;
}

function setit(s)
{
  document.getElementById('cnt').innerHTML=s;
}

function setHTML(x)
{
  setit(getHTML(x));
}