<!--
function popupCenteredWindow(sUrl, lWidth, lHeight, sName, bScroll, bStatus){
	//	sURL	(URL of the page to open)
	//	lWidth	(width of the popup)
	//	lHeight	(height of the popup)
	//	sName	(name given to the window)
	//	bScroll	(allow scroll bars [yes|no|1|0])
	//	bStatus	(allow status bar [yes|no|1|0])
	lLeft = (window.screen.width/2) - ((lWidth/2) + 10); //half the screen width minus half the new window width (plus 5 pixel borders).
	lTop = (window.screen.height/2) - ((lHeight/2) + 30); //half the screen height minus half the new window height (plus title and status bars).
	newWin = window.open(sUrl, sName, "height=" + lHeight + ", width=" + lWidth + ", left=" + lLeft + ", top=" + lTop + ", screenX=" + lLeft + ", screenY=" + lTop + ", scrollbars=" + bScroll + ", status=" + bStatus);
	newWin.focus();
}

function Subscribe(){
	var sEmail = document.subscribe.emailaddress.value;
	var sURL = '/signup.asp?email='
	if (sEmail != ''){
		popupCenteredWindow(sURL + sEmail ,400,400,'SGSignupWnd',0,0);
	}else{
		alert("Please type your email address in the box then click 'Sign up!'.")
	}
}

/**
 * DHTML email validation script. Courtesy of SmartWebby.com (http://www.smartwebby.com/dhtml/)
 */

function echeck(str) {

		var at="@"
		var dot="."
		var lat=str.indexOf(at)
		var lstr=str.length
		var ldot=str.indexOf(dot)
		if (str.indexOf(at)==-1){
		   alert("Invalid E-mail Address, please review!")
		   return false
		}

		if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
		   alert("Invalid E-mail Address, please review!")
		   return false
		}

		if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
		    alert("Invalid E-mail Address, please review!")
		    return false
		}

		 if (str.indexOf(at,(lat+1))!=-1){
		    alert("Invalid E-mail Address, please review!")
		    return false
		 }

		 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
		    alert("Invalid E-mail Address, please review!")
		    return false
		 }

		 if (str.indexOf(dot,(lat+2))==-1){
		    alert("Invalid E-mail Address, please review!")
		    return false
		 }
		
		 if (str.indexOf(" ")!=-1){
		    alert("Invalid E-mail Address, please review!")
		    return false
		 }

 		 return true					
	}

