var divid = "slide-out-text-form";
var url = "/create_feedback.php";


function setFeedback(operation,elementid){

var xmlHttpFeedback;
try{
	xmlHttpFeedback=new XMLHttpRequest(); 
}
catch (e){
	try{
		xmlHttpFeedback=new ActiveXObject("Msxml2.XMLHTTP"); 
	}
	catch (e){
		try{
			xmlHttpFeedback=new ActiveXObject("Microsoft.XMLHTTP");
		}
		catch (e){
			alert("Your browser does not support AJAX.");
			return false;
		}
	}
}

fetch_unix_timestamp = function()
{
	return parseInt(new Date().getTime().toString().substring(0, 10))
}

var timestamp = fetch_unix_timestamp();
var nocacheurl = url+"?t="+timestamp;

xmlHttpFeedback.onreadystatechange=function(){
	if(xmlHttpFeedback.readyState!=4){
		document.getElementById(divid).innerHTML='<img src="/images/loading2.gif" alt="Processing..." /> Processing...';
	}
	if(xmlHttpFeedback.readyState==4){
		document.getElementById(divid).innerHTML=xmlHttpFeedback.responseText;
		document.getElementById("comment_textarea").focus();
	}
}

var comment_textarea = document.getElementById("comment_textarea").value;
var user_ip = document.getElementById("user_ip").value;
var pid = document.getElementById("pid").value;

xmlHttpFeedback.open("post",nocacheurl+"&operation="+operation+"&feedback="+comment_textarea+"&user_ip="+user_ip+"&pid="+pid,true);
xmlHttpFeedback.send(null);
}