function show_table( table_id ) {
  if ( document.getElementById ) {
	var my_tbl = document.getElementById(table_id);
	my_tbl.style.display = 'block';
  }
}

function hide_table( table_id ) {
  if ( document.getElementById ) {
	var my_tbl = document.getElementById(table_id);
	my_tbl.style.display = 'none';
  }
}

function hideLeagues(){
	hide_table("navE");
	hide_table("navW");
	show_table("navB");	
}

function show_East(){
	hide_table("navB");
	hide_table("navW");
	show_table("navE");
}

function show_West(){
	hide_table("navB");
	hide_table("navE");
	show_table("navW");
}

function getCheckedValue(radioObj) {
	if(!radioObj)
		return "";
	var radioLength = radioObj.length;
	if(radioLength == undefined)
		if(radioObj.checked)
			return radioObj.value;
		else
			return "";
	for(var i = 0; i < radioLength; i++) {
		if(radioObj[i].checked) {
			return radioObj[i].value;
		}
	}
	return "";
}

function submitPoll(form, pollID) {
	answer = getCheckedValue(form.answer);	
	if(answer)
		loadFragmentInToElement('http://www.mid-statesfootball.org/otf.php?action=pollVote&pollID='+pollID+'&answer='+answer, 'pollID_'+pollID);
	
	return false;
}

function viewPollResults(pollID) {
	loadFragmentInToElement('http://www.mid-statesfootball.org/otf.php?action=pollVote&pollID='+pollID, 'pollID_'+pollID);
	
	return false;
}

