// JavaScript Document
function votte()
{
	for(var i=0; i<=4; i++)
	{
		if(document.getElementById('p' + i) != null && document.getElementById('p' + i).checked)
		{
			var sendto = '/ajax/vote.php?vote=' + document.getElementById('p' + i).value;
			break;
		}
	}
	
	if (sendto !== undefined)
	{
		var xmlhttp = callServer();
		if (xmlhttp)
		{
			xmlhttp.open('GET', sendto, false);
			xmlHttp.send();
			
			resullt();
		}
	}
}

function resullt()
{
	if (document.getElementById('pid').value !== undefined)
	{
		var sendto = '/ajax/result.php?pid=' + document.getElementById('pid').value;
		
		var xmlhttp = callServer();
		if (xmlhttp)
		{
			xmlhttp.open('GET', sendto, false);
			xmlHttp.send();
			
			document.getElementById('pool').innerHTML = xmlhttp.responseText;
		}
	}
}

