// --------------------------------------------------------------------------------
// poll_CheckVote.js
// Lisa Mulhern 16-Feb-2006
// Contains Javascript relevant to the poll form.
// --------------------------------------------------------------------------------


var fieldPrefix = "tmpl_qp_Poll__ctl0_";


// --- Attach JS to document elements and execute simple statements. ---
ow_f_AppendLoadEvent(
function()
{
	if (document.getElementById(fieldPrefix + "ow_btnVote") != null)
		ow_f_AddEvent(document.getElementById(fieldPrefix + "ow_btnVote"), "click", noVote, false);
}
);


function noVote()
{
	var count = 0;
	if (document.getElementById("qp_frm") != null)
	{
		var inp = document.getElementById("qp_frm").getElementsByTagName("input");
		for (var i = 0; i < inp.length; i++)
			if (inp[i].type == "radio" && inp[i].checked)
				count ++;
	}
	if (count == 0)
	{
		alert("Please select one of the choices to submit your vote.");
		return false;
	}
	return true;
}