var xmlHttp
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;
}

function vote(id)
{ 
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }
var url="_ajax/vote.php";
url+="?id="+id;
	xmlHttp.onreadystatechange=function stateChanged(){ 
		if(xmlHttp.readyState==4 || xmlHttp.readyState=="complete"){
			document.getElementById("middle_texts").innerHTML=xmlHttp.responseText;
			voteAllowed();
		}
	}
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}

function voteAllowed()
{ 
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }
var url="_ajax/vote_allowed.php";
	xmlHttp.onreadystatechange=function stateChanged(){ 
		if(xmlHttp.readyState==4 || xmlHttp.readyState=="complete"){
			document.getElementById("error").innerHTML=xmlHttp.responseText;
		}
	}
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}
var int;

function hidemenus(exc)
{
clearInterval(int);
int = null;
document.getElementById("popUP").style.visibility = "hidden";
}

function outobject()
{
int = setInterval("hidemenus(20)",1000);
// ison=0;
}

function onheader(hID)
{
hidemenus(hID);
document.getElementById("popUP").style.visibility = "visible"
}

function onobject()
{
clearInterval(int);
int = null;
}

function changeBg(id){
	document.getElementById(id).src= "_images/menu_" + id +"2.png";
}
function changeBg2(id){
	document.getElementById(id).src= "_images/menu_" + id +".png";
}