var xmlHttp

function showHint(url,tab)
{

xmlHttp=GetXmlHttpObject()
function stateChanged() 
{ 
if (xmlHttp.readyState==4)
{ 
document.getElementById(tab).style.display="";
document.getElementById(tab).innerHTML=xmlHttp.responseText;
}
}

if (xmlHttp==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  } 

xmlHttp.onreadystatechange=stateChanged;
xmlHttp.open("GET",url,true);
xmlHttp.send(null);

} 

function showHint2(url,tab) // vote
{

xmlHttp=GetXmlHttpObject()
function stateChanged() 
{ 
if (xmlHttp.readyState==4)
{ 
document.getElementById(tab).style.display="";
if (xmlHttp.responseText.indexOf('problem27zzz')>0)
	{ alert('Mar szavaztal erre a kerdesre'); }
else
	{ document.getElementById(tab).innerHTML=xmlHttp.responseText; }
}
}

if (xmlHttp==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  } 

xmlHttp.onreadystatechange=stateChanged;
xmlHttp.open("GET",url,true);
xmlHttp.send(null);

} 

function showHint3(url,tab) // a username 
{
xmlHttp=GetXmlHttpObject()
function stateChanged() 
{	
if (xmlHttp.readyState==4)
{ 
document.getElementById(tab).style.display="";
if (xmlHttp.responseText.indexOf('foglalt')>0)
	{ 
		document.getElementById(tab).className='input_ocupat'; 
	  	document.getElementById(tab).innerHTML=xmlHttp.responseText;	
		ok=false;
	}
else
	{ 
		document.getElementById(tab).className='input_ok'; 
		document.getElementById(tab).innerHTML='';
	}
}
}

if (xmlHttp==null)
  {
  alert ("Your browser does not support AJAX!");
  } 

xmlHttp.onreadystatechange=stateChanged;
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
}


function runphp(url) // addremovefrien action
{
xmlHttp=GetXmlHttpObject()
function stateChanged() 
{}

if (xmlHttp==null)
  {
  alert ("Your browser does not support AJAX!");
  } 

xmlHttp.onreadystatechange=stateChanged;
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
}



function GetXmlHttpObject()
{
var xmlHttp=null;
try
  {
  // Firefox, Opera 8.0+, Safari
  xmlHttp=new XMLHttpRequest();
  }
catch (e)
  {
  // Internet Explorer
  try
    {
    xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
    }
  catch (e)
    {
    xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
    }
  }
return xmlHttp;
}

