var ajaxindex = "ajmain.php?action=";
var ajaxxmlhttpindex;
var action;
var from;
	
function getnew(action,from,id) {
	if (window.XMLHttpRequest) {
		ajaxxmlhttpindex = new XMLHttpRequest();
	}else if (window.ActiveXObject) {
		ajaxxmlhttpindex = new ActiveXObject("Microsoft.XMLHTTP");
	}
	ajaxxmlhttpindex.onreadystatechange = handleHttpResponseIndex;
	ajaxxmlhttpindex.open("GET", ajaxindex + escape(action) + "&from=" + escape(from) + "&id=" + escape(id), true);
	ajaxxmlhttpindex.send();
		
		function handleHttpResponseIndex() {
				
			if (ajaxxmlhttpindex.readyState == 4) {
				try {
					document.getElementById(id).innerHTML = ajaxxmlhttpindex.responseText;
				} catch(err) {}
			}
			
		}
}

function poll(why,id){
	this.document.getElementById("poll").style.display = 'none';
	this.document.getElementById("comment").style.display = 'block';
	this.document.getElementById("why").innerHTML = why;
	document.getElementById('textar').focus();
	getnew("poll",from,id);
}

function thanks(id){
	this.document.getElementById("comment").style.display = 'none';
	this.document.getElementById("thanks").style.display = 'block';
	var comment = this.document.getElementById("textar").value;
	getnew("thanks",comment,id);
}


