function sendAffossa(url,param1,param2,param3,idscritta,idImmagine,idBoxArticle,callback,postData) {
	var req = createXMLHTTPObjectAffossa();
	if (!req) return;
	var method = (postData) ? "POST" : "GET";
	url = url + "?artId=" + param1 + "&usrId=" + param2 + "&act=" + param3;
	//alert(url);
	req.open(method,url,true);
	req.setRequestHeader('User-Agent','XMLHTTP/1.0');
	if (postData)
		req.setRequestHeader('Content-type','application/x-www-form-urlencoded');
	req.onreadystatechange = function () {
		if (req.readyState != 4) return;
		if (req.status != 200 && req.status != 304) {
			alert('HTTP error ' + req.status);
			return;
		}
		callback(req,param1,idImmagine,idscritta,idBoxArticle);
	}
	if (req.readyState == 4) return;
	req.send(postData);
}

var XMLHttpFactoriesAffossa = [
	function () {return new XMLHttpRequest()},
	function () {return new ActiveXObject("Msxml2.XMLHTTP")},
	function () {return new ActiveXObject("Msxml3.XMLHTTP")},
	function () {return new ActiveXObject("Microsoft.XMLHTTP")}
];

function createXMLHTTPObjectAffossa() {
	var xmlhttp = false;
	for (var i=0;i<XMLHttpFactoriesAffossa.length;i++) {
		try {
			xmlhttp = XMLHttpFactoriesAffossa[i]();
		}
		catch (e) {
			continue;
		}
		break;
	}
	return xmlhttp;
}
function handleRequestAffossa(req,id,idImg,idScritta,idBoxArticle) {
	var writeroot = document.getElementById(idScritta + id);
	if(req.responseText==1){
		
			document.getElementById(idBoxArticle + id).className="postAffossa";
		var writeimg = document.getElementById(idImg + id);
		writeimg.src= "images/accetta.gif";
		writeroot.innerHTML = "Accetta Notizia";
		//alert("url(../images/bg_vote_1.png) no-repeat left top;");
		
		
	}else if(req.responseText==2){
	
			document.getElementById(idBoxArticle + id).className="post";			
			var writeimg = document.getElementById(idImg + id);
			writeimg.src= "images/error.gif";
			writeroot.innerHTML = "Secondo Piano";
			
		//alert("url(../images/bg_vote_1.png) no-repeat left top;");
		
	
		
	}
	
	
	
}

