function MM_openBrWindow(theURL,winName,features) { //v2.0
	window.open(theURL,winName,features);
}

function showStatus(text) {
	window.status="' + text + '";
    window.setTimeout('window.status="' + text + '"', 1);
}

function setCookie(styleid) {
	var the_date = new Date("December 31, 2023");
	var the_cookie_date = the_date.toGMTString();

	var the_cookie = "style=" + styleid;
	the_cookie = the_cookie + ";expires=" + the_cookie_date;
	document.cookie = the_cookie;
}

function clearYourPick(layername) {
	ns4 = (document.layers)? true:false;
	pollformref = document.pollform;
	if(ns4 && layername != "") {
		pollformref = document.layers[layername].document.pollform;
	}
	if(pollformref.yourpickfield.value == "Add Your Pick?") {
		pollformref.yourpickfield.value = "";
	}
}

function setYourPickFocus(layername) {
	ns4 = (document.layers)? true:false;
	pollformref = document.pollform;
	if(ns4 && layername != "") {
		pollformref = document.layers[layername].document.pollform;
	}
	pollformref.yourpickfield.focus();
}

function setYourPickRadio(layername) {
	ns4 = (document.layers)? true:false;
	pollformref = document.pollform;
	if(ns4 && layername != "") {
		pollformref = document.layers[layername].document.pollform;
	}
	pollformref.choiceradio[5].checked = true;
}

function setGuestPickRadio(layername) {
	ns4 = (document.layers)? true:false;
	pollformref = document.pollform;
	if(ns4 && layername != "") {
		pollformref = document.layers[layername].document.pollform;
	}
	pollformref.choiceradio[4].checked = true;
}

function validatePoll(layername) {
	ns4 = (document.layers)? true:false;
	pollformref = document.pollform;
	if(ns4 && layername != "") {
		pollformref = document.layers[layername].document.pollform;
	}

	if(!pollformref.choiceradio[0].checked &&
	   !pollformref.choiceradio[1].checked &&
	   !pollformref.choiceradio[2].checked &&
	   !pollformref.choiceradio[3].checked &&
	   !pollformref.choiceradio[4].checked &&
	   !pollformref.choiceradio[5].checked) {
			alert("Please Make a Selection!");
			return false;
	   }

	if(pollformref.choiceradio[4].checked) {
		if(pollformref.guestpickselect.value == "none") {
			alert("Please Choose a Valid Guest Pick!");
			return false;
		}
	}
	else if(pollformref.choiceradio[5].checked) {
		if(pollformref.yourpickfield.value == "Add Your Pick?" || pollformref.yourpickfield.value == "") {
			alert("Please Type in a Write-In Vote!");
			return false;
		}
	}
	MM_openBrWindow('about:blank','pollresult','scrollbars=yes,resizable=yes,width=550,height=450');
	return true;
}

function seepoll(mypollid) {
	MM_openBrWindow('pollresult.php?pollid=' + mypollid,'pollresult','scrollbars=yes,resizable=yes,width=550,height=450');
}
