function validate()
{
	surveyVal = false
	answer = document.frmPoll.pollOption;
	var nLen = answer.length
	for (var i = 0; i < nLen; i++)
	{
		if(answer[i].checked == true)
		{
			surveyVal = true
			surveytext = answer[i].value;
		}
	}
	if ( surveyVal == false)
	{
		alert("Please choose your answer");
		surveytext = "";
	}

	if(surveytext != '')
	{
		submitForm(surveytext);
	}
	else
	{
		return false;
	}
}

function submitForm(Ans)
{
	var postData = encodeURIComponent('o') + '=' + encodeURIComponent(Ans);
	postData += '&' +encodeURIComponent('q') + '=' + encodeURIComponent(document.frmPoll.q.value);
	postData += '&' +encodeURIComponent('s') + '=' + encodeURIComponent(document.frmPoll.s.value);
	var returnVal = doAsyncPost('/poll_result.php', postData);
	document.getElementById('poll-dtls').innerHTML = returnVal;
	return true;
}
