function cast_vote(poll_id, poll_val)
{
	// ajax code for more news
	
/*	poll_val="NS";

	len= document.home.poll_vote.length;

	for (var i=0; i < len; i++)
	{
	   if (document.forms[0].poll_vote[i].checked)
		  {
				poll_val = document.forms[0].poll_vote[i].value;
		  }
    }

	if(poll_val == "NS")
	{
		alert("Please cast your vote");
	}
	else
	{ */
		try {
			xhr = new XMLHttpRequest();
		} 
		catch(e) {
			xhr = new ActiveXObject("Microsoft.XMLHTTP");
		}	
			
		xhr.onreadystatechange  = function(){
			if(xhr.readyState  == 4){
				if(xhr.status  == 200)
				{

					document.getElementById('poll_span').innerHTML = "Thanks for expressing your opinion. <BR> Your vote counts.";

				}
			}
		}

		xhr.open("GET", "castVote.php?&pollid="+poll_id+"&poll_value="+poll_val,true); 
		xhr.send(null);
	//}
	
}

