<!-- ajax -->

var http = false;

if(navigator.appName == "Microsoft Internet Explorer")
{
http = new ActiveXObject("Microsoft.XMLHTTP");
}
else
{
http = new XMLHttpRequest();
}

//formis dacvis suratis ajaxi
function refresh_code(mnishvneli,lang)
{
http.abort();
http.open("GET", "ajax/kodi.php?p="+mnishvneli+"&lang="+lang, true);
http.onreadystatechange=function()
{

if(http.readyState == 4)
{
document.getElementById('code').innerHTML = http.responseText;
}
}
http.send(null);
}



//aq vigebt im radios values romelic monishnulia
function check_value()
{
	for (i=0;i<document.votes.answer.length; i++)
	{
		if (document.votes.answer[i].checked==true)
		{
		return(document.votes.answer[i].value);
		}
	}
}




// gamokitxvis ajaxi
function votee(lang)
{
//vigebt kitxvis id-s
question_id = document.votes.question_id.value;


//vigebt pasuxis id-s
answer_id = check_value();

http.abort();
http.open("GET", "ajax/vote.php?answer_id="+answer_id+"&question_id="+question_id+"&lang="+lang, true);
http.onreadystatechange=function()
{

if(http.readyState == 4)
{
document.getElementById('vote').innerHTML = http.responseText;
}
}
http.send(null);
}



//shedegebis chvenebis ajaxi
function show_result(lang)
{
//vigebt kitxvis id-s
question_id = document.votes.question_id.value;


http.abort();
http.open("GET", "ajax/vote.php?action=show_result&question_id="+question_id+"&lang="+lang, true);
http.onreadystatechange=function()
{

if(http.readyState == 4)
{
document.getElementById('vote').innerHTML = http.responseText;
}
}
http.send(null);
}

<!-- ajax -->








