function checkfields(){
var found="false"
for (x=0; x<12; x++){
if (document.Poll.choice[x].checked){
found="true"
}
}
if (found=="false"){
	alert("Please choose an option to vote in the Poll")
	return false;
}
document.Poll.submit()
}

function set_category(thecategory){
if (thecategory==0){
	return;
}
else{
	location.href="Norfolk_By_Category.asp?category="+thecategory
}
}


function checkfields_epostcard(){

var found="false"

for (x=0; x<15; x++){
if (document.epostcard.choice[x].checked){
found="true"
}
}

if (found=="false"){
	alert("Please select a photo by clicking on the one you would like to use")
	return false;
}

if (document.epostcard.fldname.value==""){
	document.epostcard.fldname.focus();
	alert("Please enter your name.")
	return false;
}

if (document.epostcard.fldmessage.value==""){
	document.epostcard.fldmessage.focus();
	alert("Please enter a message")
	return false;
}

if (document.epostcard.fldtheirname.value==""){
	document.epostcard.fldtheirname.focus();
	alert("Please enter the name of the person you are sending the e-postcard to.")
	return false;
}

var str=document.epostcard.fldtheiremail.value
var filter=/^(\w+(?:\.\w+)*)@((?:\w+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i
var testresults

if (filter.test(str))
testresults=true
else{
document.epostcard.fldtheiremail.focus()
alert("Please enter a valid email address for the person you are sending the e-postcard to.")
return false;
}

document.epostcard.submit()

}

function CheckTheLength()
{
if (epostcard.fldmessage.value.length > 200) {
	document.epostcard.fldmessage.value = document.epostcard.fldmessage.value.substring(0, 200);
}
else {
	document.epostcard.charsleft.value = 200 - document.epostcard.fldmessage.value.length;}
}


function selectRadio(n){ 
document.epostcard.choice[n].checked=true 
}

