var ActiveMenu="";

function ShowMenu(M) {

if (ActiveMenu) {

HideMenu(ActiveMenu);

}

document.getElementById(M).style.visibility="visible";
ActiveMenu=M;

}

function HideMenu(AM) {

document.getElementById(AM).style.visibility="hidden";
ActiveMenu="";
clearTimeout(MenuClose);

}

function CloseMenu() {


MenuClose=setTimeout("HideMenu(ActiveMenu)",1000);

}



function goPage(src) {
		
if(src != "null") {

if(src.indexOf('%') != -1) {
src = src.slice(0,-1);
var newWindow = window.open(src, '', 'scrollbars,resizable,toolbar,status,menubar,location');

} else {
window.location.href = src;
			
}
	
}

}



function ValidateCalendarSubmissions() {

if (!document.calendar.performer.value) {

alert("You did not enter a performer");
document.calendar.performer.focus();

return false;

}

if (!document.calendar.venue.value) {

alert("You did not enter a venue name");
document.calendar.venue.focus();

return false;

}

if (!document.calendar.address1.value) {

alert("You did not enter an address");
document.calendar.address1.focus();

return false;

}

if (!document.calendar.city.value) {

alert("You did not enter a city");
document.calendar.city.focus();

return false;

}

if (!document.calendar.zip.value) {

alert("You did not enter a zip code");
document.calendar.zip.focus();

return false;

}

if (!document.calendar.phone.value) {

alert("You did not enter a phone number");
document.calendar.phone.focus();

return false;

}

if (!document.calendar.url.value) {

alert("You did not enter a web site");
document.calendar.url.focus();

return false;

}

if (!document.calendar.ContactName.value) {

alert("You did not enter a contact name");
document.calendar.ContactName.focus();

return false;

}

if (!document.calendar.ContactPhone.value) {

alert("You did not enter a contact phone number");
document.calendar.ContactPhone.focus();

return false;

}

if (!document.calendar.ContactEmail.value) {

alert("You did not enter a contact email address");
document.calendar.ContactEmail.focus();

return false;

}

}



function ValidateCalendarUpdateSearch() {

if (!document.calendar.ContactName.value) {

alert("You did not enter a contact name");
document.calendar.ContactName.focus();

return false;

}

if (!document.calendar.ContactEmail.value) {

alert("You did not enter a contact email address");
document.calendar.ContactEmail.focus();

return false;

}

}



function ValidateGiveawayEntry() {

if (!document.giveaway.firstname.value) {

alert("You did not enter a first name");
document.giveaway.firstname.focus();

return false;

}

if (!document.giveaway.lastname.value) {

alert("You did not enter a last name");
document.giveaway.lastname.focus();

return false;

}

if (!document.giveaway.town.value) {

alert("You did not enter a town");
document.giveaway.town.focus();

return false;

}

if (!document.giveaway.zip.value) {

alert("You did not enter a zip code");
document.giveaway.zip.focus();

return false;

}

if (!document.giveaway.email.value) {

alert("You did not enter an email address");
document.giveaway.email.focus();

return false;

}

if (!document.giveaway.memberno.value) {

alert("You did not enter a member number");
document.giveaway.memberno.focus();

return false;

}

}



function ValidateMemberLibraryLogin() {

if (!document.library.memberno.value) {

alert("You did not enter your member number");
document.library.memberno.focus();

return false;

}

if (!document.library.zip.value) {

alert("You did not enter your zip code");
document.library.zip.focus();

return false;

}

}



function ValidateSpecialEvents() {

if (!document.sevents.FirstName.value) {

alert("You did not enter a first name");
document.sevents.FirstName.focus();

return false;

}

if (!document.sevents.LastName.value) {

alert("You did not enter a last name");
document.sevents.LastName.focus();

return false;

}

if (!document.sevents.City.value) {

alert("You did not enter a city");
document.sevents.City.focus();

return false;

}

if (!document.sevents.Comment.value) {

alert("You did not enter a comment");
document.sevents.Comment.focus();

return false;

}

}



function ValidateTellFriend() {

if (!document.friend.yourname.value) {

alert("You did not enter your name");
document.friend.yourname.focus();

return false;

}

if (!document.friend.youremail.value) {

alert("You did not enter your email address");
document.friend.youremail.focus();

return false;

}

if (!document.friend.name1.value) {

alert("You did not enter a friend name");
document.friend.name1.focus();

return false;

}

if (!document.friend.email1.value) {

alert("You did not enter a friend email address");
document.friend.email1.focus();

return false;

}

}



function ValidateVolunteerApplication() {

if (!document.volunteer.name.value) {

alert("You did not enter your name");
document.volunteer.name.focus();

return false;

}

if (!document.volunteer.address.value) {

alert("You did not enter your address");
document.volunteer.address.focus();

return false;

}

if (!document.volunteer.city.value) {

alert("You did not enter a city");
document.volunteer.city.focus();

return false;

}

if (!document.volunteer.zip.value) {

alert("You did not enter your zip code");
document.volunteer.zip.focus();

return false;

}

if (!document.volunteer.phone.value) {

alert("You did not enter your phone number");
document.volunteer.phone.focus();

return false;

}

if (!document.volunteer.email.value) {

alert("You did not enter your email address");
document.volunteer.email.focus();

return false;

}

}



function ValidateEmailList(form) {
  var agree=true;
  if (form.optin_email.value=='' || form.optin_email.value=='ENTER YOUR EMAIL HERE') {alert('Please enter your email address.'); agree=false;}
  if (agree && form.optin_action[1].checked) agree=confirm('Are you sure you want to unsubscribe?');
  if (agree) window.open('','optin','resizable=yes,scrollbars=yes,status=no,width=300,height=200, top=10,left=10,screenX=10,screenY=10'); 
  return agree;
}



function ValidatePollSubmission() {

for (i=0;i<document.poll.pollanswer.length;i++) {

if (document.poll.pollanswer[i].checked) {

var user_input = document.poll.pollanswer[i].value;
	
}

}

if (!user_input) {

alert("You did not select an answer, please submit the poll again.");

return false;

}

}


function ViewPhoto(url, width, height) {
window.open(url, '_blank', 'width=' + width + ',height=' + height + ',left=10,top=20,scrollbars=no,resizable=yes')
}

function ViewPoll(url) {
window.open(url, 'poll', 'width=340,height=340,left=10,top=20,scrollbars=yes,resizable=yes')
}



function checkPledge() {

if (!document.pledge.firstname.value) {

alert("Please enter your first name.");
document.pledge.firstname.focus();
return (false);
    
}

if (!document.pledge.lastname.value) {

alert("Please enter your last name.");
document.pledge.lastname.focus();
return (false);
    
}

if (!document.pledge.address1.value) {

alert("Please enter your address.");
document.pledge.address1.focus();
return (false);
    
}

if (!document.pledge.city.value) {

alert("Please enter your city.");
document.pledge.city.focus();
return (false);
    
}

if (!document.pledge.zip.value) {

alert("Please enter your zip code.");
document.pledge.zip.focus();
return (false);
    
}

if (!document.pledge.email.value) {

alert("Please enter your email address.");
document.pledge.email.focus();
return (false);
    
}

if (document.getElementById("other").checked) {

if (!document.pledge.otheramount.value) {

alert("Please enter a pledge amount.");
document.pledge.otheramount.focus();
return (false);

}

}
    
}




function viewGifts(url) {

window.open(url, 'gifts', 'width=740,height=400,left=10,top=30,scrollbars=yes,resizable=yes')

}


function viewLevels(url) {

window.open(url, 'levels', 'width=740,height=400,left=10,top=30,scrollbars=yes,resizable=yes')

}






