var newURL = ""
var mycgiurl = "http://www.realsob.org/poll/results.php"
var p1name = "pollid"
var p2name = "showTotal"
var p1 = ""
var p2 = ""
var editWindow

if (top.location != self.location) {
	top.location = self.location
}

function popUp(p1,p2) {
	var access = Math.floor(Math.random()*10000)
	newURL = mycgiurl+"?"+p1name+"="+p1+"&"+p2name+"="+p2+"&access="+access
/*	alert(newURL)*/
	editWindow = window.open('http://www.realsob.org/poll/popUp.html','popUpWin','menubar=no,toolbar=no,location=no,scrollbars=yes,resizable=yes,status=no,width=300,height=300')
/*	editWindow = window.open('http://www.realsob.org/poll/popUp.html','popUpWin','menubar=yes,toolbar=yes,location=yes,scrollbars=yes,resizable=yes,status=yes,width=400,height=300')*/
}
function setURL() {
	editWindow.location.replace(newURL)
	editWindow.focus
}

function alertMsg(message) {
	alert(message);
}
function relocate() {
	window.moveTo(40,40);
	opener.setURL()
}
function backtocontrol() {
	location.replace('http://www.realsob.org/Webmaster/')
}
function checkVote(form) {
	// make sure they select one of the choices
	selectedChoice = -1
	for (i=0; i<form.choices.length; i++) {
		if (form.choices[i].checked) {
			selectedChoice = i
		}
	}
	if (selectedChoice == -1 ) {
		alert ("Please make a selection before submitting your vote.")
		return false
	}
	return true
}
function closeWindow() {
	window.close()
}