function getHTTPObject() {
	if (window.XMLHttpRequest)
	{
		  var xmlHttp = new XMLHttpRequest();
	} else {
		if (window.ActiveXObject)
		{
		  var xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
		}
	}
	return xmlHttp;
}
function szavaz_HetiKerdes(pollid) {    
	for (i=0;i<document.kerdes.valasz.length;i++){
		if (document.kerdes.valasz[i].checked==true)
			melyik=document.kerdes.valasz[i].value;
	}    	
	var url = "szavaz_heti_kerdes.php?pollid="+pollid+"&id="+melyik;
	document.kerdes.disabled=true;	
	document.getElementById("HKGomb").innerHTML="&nbsp;&nbsp;<img src='images/load.gif'>";
	loadHttp = getHTTPObject();
	loadHttp.open("GET", url, true);
	loadHttp.onreadystatechange = function()
	{
		if (loadHttp.readyState == 4)
		{
			if (loadHttp.responseText.indexOf('invalid') == -1)
			{   			    
			        document.kerdes.disabled=false;
			        document.getElementById("hetikerdesDIV").innerHTML=loadHttp.responseText;
					document.getElementById("HKGomb").innerHTML="Köszönjük";
			} 
		} 
	};
	loadHttp.send(null);
}
function KepKi(kep,nagykep,w) {
  document.getElementById('NagyKep').src=kep;	  
  document.getElementById('NagyKep').style.width=w+'px';  
  document.getElementById('NagyKepA').setAttribute('href',nagykep); 
}

function UrlapElkuld(mit) {
	  document.HirlevelForm.action="hirlevel.php?"+mit;
	  document.HirlevelForm.submit();
}
function nyomtat(mit,id) {
	window.open( "nyomtat.php?mit="+mit+"&id="+id, "Nyomtatas", "status = 1, height = 750, width = 670, resizable = 1, scrollbars=yes" )
}
function elkuld(id) {
	window.open( "elkuld.php?id="+id, "Elkuld", "status = 1, height = 580, width = 700, resizable = 1, scrollbars=yes" )
}
