function Insert_rating_no(newsid,tempurl,rating)
{
		url=tempurl+'ajax/intermediate_rating.php';
		what = "SetRating(req.responseText)";
		DoCallback_rating("newsid="+newsid+"&rating="+rating);
}
function SetRating(State1)
{
	if(State1!='')
	{
		var arrStates = State1.split('@');
		document.getElementById('ratingDisplay').innerHTML = arrStates[1];
		//document.getElementById('ratingArticle').innerHTML = arrStates[2];
		
	}
}

function Insert_rating_yes(newsid,tempurl,rating)
{
		url=tempurl+'ajax/intermediate_rating.php';
		what = "SetRating(req.responseText)";
		DoCallback_rating("newsid="+newsid+"&rating="+rating);
}

 function DoCallback_rating(data)
 {	
	if (window.XMLHttpRequest) {
		
		url=url+'?'+data;
		req = new XMLHttpRequest();
		req.onreadystatechange = _rating;
		req.open('POST', url, true);
		
		req.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
		req.send(data);
	
	} else if (window.ActiveXObject) {		
		req = new ActiveXObject('Microsoft.XMLHTTP')
		if (req) {
			
			url=url+'?'+data;
			req.onreadystatechange = _rating;
			req.open('POST', url, true);
			req.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
			req.send(data);
		}
	}
}

function _rating() 
{
	if (req.readyState == 4) {
		
		if (req.status == 200) {
			eval(what);
			//document.getElementById('ratingDisplay').innerHTML ='asaasdsd';
			
		} else {
			alert('We Are Facing internet Connection Related Problem. We Will Be Right Back:\n' +
				req.responseText);
		}
	}
}


