// PopUp Maker 5.0 by CodeBrain.com
// PopUp Window Script
// Place this script in the <head> of your page.

var popUpPollW = 590;
var popUpPollH = 465;
var popUpPollX = (screen.width/2)-(popUpPollW/2);
var popUpPollY = (screen.height/2)-(popUpPollH/2);
var pos = "left="+popUpPollX+",top="+popUpPollY;

function popUpPoll(pollid){
	popUpPollWindow = window.open("../../../libroot/jsp/showpoll.jsp?pollid="+pollid,"Poll","width="+popUpPollW+",height="+popUpPollH+","+pos);
}

function popUpPollURL(url){
	popUpPollWindow = window.open(url,"Poll","width="+popUpPollW+",height="+popUpPollH+","+pos);
}

function popUpPollPost(){

	var choice = "";

	for (i = 0; i < document.poll.choice.length; i++) {
		if (document.poll.choice[i].checked == true) {
			choice = document.poll.choice[i].value;
            document.poll.choice[i].checked = false;
		}
	}
  	
	if (choice == "") {
		alert("You must make a choice!");
		return;
	}
	
	var pollid = document.poll.pollid.value;	
	var url = "../../../Poll?pollid="+pollid+"&choice="+choice;
	popUpPollWindow = window.open(url,"Poll","width="+popUpPollW+",height="+popUpPollH+","+pos);
}
