// JavaScript Document

/* This script and many more are available free online at
The JavaScript Source!! http://javascript.internet.com
Created by: CodeLifter.com | http://www.codelifter.com */

var hypemail='info@huckleberryyouth.org';

function checkEmailAddress(field) {
// the following expression must be all on one line...
var goodEmail = field.value.match(/\b(^(\S+@).+((\.com)|(\.net)|(\.edu)|(\.mil)|(\.gov)|(\.org)|(\..{2,2}))$)\b/gi);
  if (goodEmail) {
    return true;
  } else {
    alert('Please enter a valid e-mail address.');
    field.focus();
    field.select();
    return false;
  }
}


function mailThisUrl() {
	u = window.location;

	//m = "I thought you should check out the Huckleberry Youth Program site...";
    // the following expression must be all on one line...
    //window.location = 'mailto:'+ hypemail +'?subject='+m+'&body='+document.title+'  <'+u+'>';
	window.location = 'mailto:'+ hypemail;
}

function subscriptionRequest(sFromEmail,sToEmail) {
	m = "Newsletter Subscription Request";
	//document.eMailer.address
	sToEmail = "support@huckleberry.com";
  if (checkEmailAddress(sFromEmail)) {
    // the following expression must be all on one line...
    window.location = "mailto:"+hypemail+"?subject="+m+"&body="+sFromEmail.value+" has requested a newsletter subscription";
  }
}




