// Expiring within 60 days

function expiring60() {
	document.getElementById('pageContent').value = 'My expiration message';
	alert('selected');
	window.location.reload();
}
// Left sidebar

function emailSubmit() { // Add to email list
  if (document.addEmail.email.value == "" ||
    document.addEmail.email.value.indexOf('@')==-1 ||
    document.addEmail.email.value.indexOf('.')==-1 ||
    document.addEmail.email.value.length < 10) {
    alert('Please type a valid e-mail address.');
    document.addEmail.email.focus();
    return false;
  } else {
    return true;
  }
  
}

function checkSpecialty() { // Find a Photographer
  if (document.searchPhotographer.Search.value == "") {
    alert('Please select a type of photographer from the list.');
	document.searchPhotographer.focus();
    return false;
  } else {
    return true;
  }
}

function searchSubmit(form) {
  form.q.value="site:www.pmpa.net "+form.searchstring.value;  
}


function verifySearch(form) {
	if (form.txtsearch.value == "") {
		alert('Please type a search value.');
		form.txtsearch.focus();
		return false;
	} else {
		return true;
	}
}

// Login Page

function loginCheck(form) {
  if (form.email.value == "" ||
    form.email.value.indexOf('@')==-1 ||
    form.email.value.indexOf('.')==-1 ||
    form.email.value.length < 10) {
    alert('Please type a valid e-mail address.');
    form.email.focus();
    return false;
  } else if (form.password.value.length< 6 ) {
    alert('Password must be at least 6 characters.');
	form.password.focus();
	return false;
  } else if (form.password.value.length>12 ) {
    alert('Too many characters in password, 12 maximum.');
	form.password.focus();
	return false;
  } else {
    return true;
  }
}

function forgotCheck() { // I forgot my password
  if (document.login.email.value == "" ||
    document.login.email.value.indexOf('@')==-1 ||
    document.login.email.value.indexOf('.')==-1 ||
    document.login.email.value.length < 10) {
    alert('Please type a valid e-mail address.');
    document.login.email.focus();
  } else {
    document.login.submit();
  }
}

function forgotPassword() { // I forgot my password
  if (document.forgot.email.value == "" ||
    document.forgot.email.value.indexOf('@')==-1 ||
    document.forgot.email.value.indexOf('.')==-1 ||
    document.forgot.email.value.length < 10) {
    alert('Please type a valid e-mail address.');
    document.forgot.email.focus();
	return false;
  } else {
    return true;
  }
}


// Join Page

        function my_submit() {
        
            var elms=document.application.elements;
            var noVol=true;
            for (var i=0; i<elms.length; i++)
            if (elms[i].name=='Vol[]') {
                thisElem=elms[i];
                if (thisElem.checked) noVol=false;
            }
        
            if (document.application.First.value == '') {
                alert('Please type your first name');
                document.application.First.focus();
                return false;
            } else if (document.application.Last.value == '') {
                alert('Please type your last name');
                document.application.Last.focus();
                return false;
            } else if (document.application.Company.value == '') {
                alert('Please type your Company');
                document.application.Company.focus();
                return false;
            } else if (document.application.Address.value == '') {
                alert('Please type your Address');
                document.application.Address.focus();
                return false;
            } else if (document.application.City.value == '') {
                alert('Please type your City');
                document.application.City.focus();
                return false;
            } else if (document.application.Zip.value == '') {
                alert('Please type your Zipcode');
                document.application.Zip.focus();
                return false;
            } else if (document.application.Phone.value == '') {
                alert('Please type your Phone');
                document.application.Phone.focus();
                return false;
            } else if (document.application.Email.value == "" ||
                document.application.Email.value.indexOf('@')==-1 ||
                document.application.Email.value.indexOf('.')==-1 ||
                document.application.Email.value.length < 10) {
                alert('Please type a valid e-mail address.');
                document.application.Email.focus();
                return false;
            } else if (document.application.code_of_ethics.checked != true) {
                alert('Please read and agree to the Code of Ethics by clicking on the box.');
                document.application.code_of_ethics.focus();
                return false;
            } else if (noVol) {
                alert('You must volunteer in one committee.');
                return false;
            } 
            return true;
        }

