function poll(pollId) {
	var graphDiv = 'graph' + pollId;
	var updateDiv = 'pollMsg' + pollId;
	
	var form = 'pollForm' + pollId;
	
	//dcsMultiTrack('DCS.dcsuri','/poll/'+pollId, 'WT.ti', pollId, 'WT.cg_n', 'Resources', 'WT.cg_s', 'Poll'); // Webtrends tracking code
	
	/* Get the vote value */
	var form_element = document.getElementById(form);
	var form_options = form_element.getElementsByTagName('input');
	for (i=0; i < form_options.length; i++) {
		if (form_options[i].checked) voteValue = form_options[i].value;
	}
	
	if (typeof(voteValue) != "undefined") {
		new Ajax.Request('/scripts/ajax/poll_castvote.php', {
			method:'post',
			parameters: {vote: voteValue, pollId: pollId},
			onSuccess: function(transport){
				Cookie.set(pollId, 'voted', 13*2419200); // set cookie so user cant vote again for 28 days * 13 = 1 year
				new Ajax.Updater(graphDiv, '/scripts/ajax/poll_graph.php', { method: 'get', parameters: 'pollId=' + pollId }); //display the graph
			}
		});
	}
	else {
		document.getElementById('error_msg').style.display = 'block';
	}

	return false;
}

function viewResults(pollId) {
	var graphDiv = 'graph' + pollId;
	new Ajax.Updater(graphDiv, '/scripts/ajax/poll_graph.php', { method: 'get', parameters: 'pollId=' + pollId });
}