function validateContest() {
	
	var total = 0;
	var max = document.giveawayform.elements["vote[]"].length;
	for (var idx = 0; idx < max; idx++) {
		if (document.giveawayform.elements["vote[]"][idx].checked) {
			total++;
		}
	}
//	alert("You selected " + total + " boxes.");
	if (total != 2) {
		alert("Please select exactly two organizations");
		return false;
	}

	if (document.giveawayform.email.value == "") {
		alert("Please enter your email");
		return false;
	}
	
	var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;
  	var address = document.giveawayform.email.value;
	if(reg.test(address) == false) {
		alert('Invalid email address');
		return false;
	}
	
}

function highlightContest() {
	var max = document.giveawayform.elements["vote[]"].length;
	for (var idx = 0; idx < max; idx++) {
		if (document.giveawayform.elements["vote[]"][idx].checked) {
//			document.elements["giveawaybox"][idx].backgroundColor = "#66FFFF";
//			alert("trigger");
		}
	}
}
