function subscribeNewsletter() {
	var idlist = 1;
	var prefers = -1;
	if (document.selectNLForm.email.value.length==0) {
		alert("Please enter your email address.");
		document.selectNLForm.email.focus();
	} else if (document.selectNLForm.name.value.length==0) {
		alert("Please enter your name.");
		document.selectNLForm.name.focus();
	} else {
		openWindowNL("/eft/newsletter/forms/optIn2.asp?email="+document.selectNLForm.email.value+"&name="+document.selectNLForm.name.value+"&idlist="+idlist+"&prefers="+prefers);
	}
}
function subscribeNewsletterAffiliate(affiliateId) {
	var idlist = 1;
	var prefers = -1;
	if (document.selectNLForm.email.value.length==0) {
		alert("Please enter your email address.");
		document.selectNLForm.email.focus();
	} else if (document.selectNLForm.name.value.length==0) {
		alert("Please enter your name.");
		document.selectNLForm.name.focus();
	} else {
		openWindowNL("http://www.efitnesstracker.com/goto.asp?af="+affiliateId+"&page=eft/newsletter/forms/optIn2.asp?email="+document.selectNLForm.email.value+"&name="+document.selectNLForm.name.value+"&idlist="+idlist+"&prefers="+prefers);
	}
}
var newWindowNL = "";
function openWindowNL(location) {
  if (!newWindowNL || newWindowNL.closed) {
  } else {
		newWindowNL.window.close();
  }    
	newWindowNL = window.open(location,"newWindowNL",'scrollbars=yes,toolbar=no,resizable=no,menubar=no,status=no,location=no,width=400,height=400,top='+(screen.height-200)/2+',left='+(screen.width-350)/2);
	if (!newWindowNL) {
		alert("Please enable popups to view the requested window.");
	} else {
		newWindowNL.opener = this.window;
		newWindowNL.focus();
	}
}
function emailvalidation(field, alertbox) {
	var goodEmail = field.value.match(/\b(^(\S+@).+((\.com)|(\.net)|(\.edu)|(\.mil)|(\.gov)|(\.org)|(\.info)|(\.sex)|(\.biz)|(\.aero)|(\.coop)|(\.museum)|(\.name)|(\.pro)|(\..{2,2}))$)\b/gi);
	apos=field.value.indexOf("@");
	dotpos=field.value.lastIndexOf(".");
	lastpos=field.value.length-1;
	var badEmail = (apos<1 || dotpos-apos<2 || lastpos-dotpos>3 || lastpos-dotpos<2)
	if (goodEmail && !badEmail) {
		return true;
	} else {
		alert(alertbox);
		field.focus();
		field.select();
		return false;
  }
}