if (typeof(psb)=="undefined") psb = "";
if (typeof(pri)=="undefined") pri = "";
if (typeof(show_results)=="undefined") show_results = "";
function submit_poll(pollId, answer){
	// submit to the power of the poll
	sendwith = 'pollId=' + pollId + '&answer=' + urlencode(answer);
	var poll_sub = YAHOO.util.Connect.asyncRequest('post', submit_poll_script, {success:pollSubmitted, failure:pollSubmitted}, sendwith);
}
function pollSubmitted(o) { 
	request_poll_results();
}
function request_poll_results(){
	for(i=0; i<polls.length; i++){
		sendwith = 'pollId=' + polls[i] + '&psb=' + psb+'&pri='+pri + '&show_results=' + show_results;
		if (document.location.href.indexOf("benisgreat")>0)
			alert(sendwith);
		YAHOO.util.Connect.asyncRequest('post', request_poll_script, {success:pollRequest, failure:pollRequest, argument:polls[i]}, sendwith);
	}
}
function pollRequest(o){
	if (document.location.href.indexOf("benisgreat")>0)
		alert('here');
	document.getElementById("poll_results_"+o.argument).innerHTML = o.responseText;
	window.clearInterval(int_poll);
}
int_poll = window.setInterval(request_poll_results, 5000);
request_poll_results();
