function fnOnSignup() {
 var oForm = document.forms["frmSignup"];
 
 if (!fnValidateSignupFields(oForm)) return false;
 
 //insert validation code to check that information was entered in each field
 window.open("", "wndEmailSignup", "width=680px,height=450px,resizable=no,toolbar=no,scrollbars=yes")
 
 document.frmSignup.action = "http://dc-0.net/d2ls/quick_signup.asp?s=chambermusicsociety"
 document.frmSignup.target = "wndEmailSignup"
 document.frmSignup.submit()
 
 return true;
}

function fnValidateSignupFields(oForm) {
if (oForm.Zipcode.value == "") {
alert("Please enter a zip code.");
return false;
}
if (oForm.Email.value == "") {
alert("Please enter your email address.");
return false;
}
else {
if (!fnIsValidEmail(oForm.Email.value)) {
alert("The email address you entered appears to be invalid. Please check to make sure you have entered your address correctly.");
return false;
}
}
return true;
} 
function fnIsValidEmail(email) {

var at_pos;
var pd_pos;
var sp_pos;
var em_len; 
// Make sure there is a value
em_len = email.length;
if (em_len < 1) {
return false;
} 
// Check for spaces
sp_pos = email.indexOf(" ", 0);
if (sp_pos != -1) {
return false;
} 
// Check for an @ symbol
at_pos = email.indexOf("@", 0);
if (at_pos == -1) {
return false;
} 
// Check for a period after the @ symbol
pd_pos = email.indexOf(".", at_pos);
if (pd_pos == -1) {
return false;
}

// Check for period as last character
if (pd_pos == (em_len - 1)) {
return false;
} 
// Make sure there is at least one character between @ and .
if (pd_pos == (at_pos + 1)) {
return false;
} 
// Make sure address doesn't start with @ symbol
if (at_pos == 0) {
return false;
} 
return true;
}