function openWindow(url, name, w, h, features) {
      popupWin = window.open(url, name,'width=' + w + ',height=' + h + "," + 'status=yes,scrollbars=yes,resizable=yes');
}

function validatePoll() {

	errorStr = "";
	answerValid = false;

	// Ensure a button was checked
	for(i=0; i<document.poll.answer.length; i++) {
		if (document.poll.answer[i].checked) {
			answerValid = true;
			break;
		}
	}

	if(!answerValid) { errorStr += "You must select an answer.\n"; }

	if(errorStr.length > 0) {
		alert(errorStr);
		return;
	}
	pollSubPop('poll', 'width=592, height=390, scrollbars');
	document.poll.submit();
}


// This will open a new window, submit the poll form, and send the results to the popup window
function pollSubPop(name, features) {

	popupWin = window.open('/tools/poll/poll_results.asp', name, features);

	var agt = navigator.userAgent.toLowerCase();
	var is_major = parseInt(navigator.appVersion);
	var is_ie     = ((agt.indexOf("msie") != -1) && (agt.indexOf("opera") == -1));
	var is_ie3    = (is_ie && (is_major < 4));
	var is_ie4    = (is_ie && (is_major == 4) && (agt.indexOf("msie 4")!=-1) );
	var is_aol   = (agt.indexOf("aol") != -1);
	var is_aol3  = (is_aol && is_ie3);
	var is_aol4  = (is_aol && is_ie4);
	var is_aol5  = (agt.indexOf("aol 5") != -1);
	var is_aol6  = (agt.indexOf("aol 6") != -1);
	var is_comp   = (agt.indexOf("compuserve") != -1);
	var is_comp2000   = (agt.indexOf("cs") != -1);
	var is_compie = (is_comp && is_ie);

	if(!is_aol6 && !is_aol3 && !is_aol4 && !is_aol5 && !is_compie && !is_comp2000) {
		popupWin.opener.top.name = "opener";
     }

	popupWin.focus();
}
