// JavaScript Document
var http = false;
if(navigator.appName == "Microsoft Internet Explorer")
{
http = new ActiveXObject("Microsoft.XMLHTTP");
}
else
{
http = new XMLHttpRequest();
}
/* validavia binis damtavrda оржкჟჰჯკолЖ */
function main_cat(id,obieqt,sel,leng)
{
http.abort();
http.open("GET", "ajax/sub_cat.php?main_cat="+id+"&sel_name="+sel+"&sub_sel_obi="+obieqt+"&leng="+leng, true);
http.onreadystatechange=function()
{
if(http.readyState == 4)
{
document.getElementById(obieqt).innerHTML = http.responseText;
}
}
http.send(null);
}

function sub_main_cat(id,obieqt,sel,leng)
{
	if(obieqt=="sub_subcat_2"){document.addnews.sub_id.value='0';}
	if(obieqt=="sub_subcat"){document.search_forma.sub_id.value='0';}
http.abort();
http.open("GET", "ajax/sub.php?cat="+id+"&sel_name="+sel+"&leng="+leng, true);
http.onreadystatechange=function()
{
if(http.readyState == 4)
{
document.getElementById(obieqt).innerHTML = http.responseText;
}
}
http.send(null);
}


function sub_sub(form,val){
	form.sub_id.value=val;
	}
/// kodis shecvla daicko 
function cod_shecvla(id,obieqt,formm)
{
http.abort();
http.open("GET", "ajax/codis.php?shecvla="+id+"&obeiqt="+obieqt+"&formaa="+formm, true);
http.onreadystatechange=function()
{
if(http.readyState == 4)
{
document.getElementById(obieqt).innerHTML = http.responseText;
}
}
http.send(null);
}
// kodis shecvla morcha 






















//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 -->