var xmlHttp2

function subscribe(str) {
	var regEx = /^[\w\.\+-]{1,}\@([\da-zA-Z-]{1,}\.){1,}[\da-zA-Z-]{2,6}$/; 
	if (!regEx.test(str)) { 
		alert('failed');
	  document.getElementById('email').value = 'Invalid Email';
	  return;
	}	
	/*xmlHttp2=GetXmlHttpObject2()
	
	if (xmlHttp2==null) {
		alert ('Your browser does not support the XMLHttpRequest object!');
		return;
	} 
	
	var url='../controls/dosubscribe.aspx?email=' + str + '&amp;sid=' + Math.random(); // prevent caching
	xmlHttp2.onreadystatechange = stateChanged2;
	xmlHttp2.open('GET',url,true); // GET method
	xmlHttp2.send(null); // always use null for GET method*/
}

function validateEmail(id) {
	str = document.getElementById(id).value;
	var regEx = /^[\w\.\+-]{1,}\@([\da-zA-Z-]{1,}\.){1,}[\da-zA-Z-]{2,6}$/; 
	if (!regEx.test(str)) { 
	  email = document.getElementById(id);
	  email.value = 'Invalid Email';
	  email.focus();
	  email.select();
	  return false;
	}		
	else {
		return true;
	}
}
	
function GetXmlHttpObject2()
{ 
	var xmlHttp2=null
	
	if (window.XMLHttpRequest)
	{
		xmlHttp2=new XMLHttpRequest()
	}
	else if (window.ActiveXObject)
	{
		xmlHttp2=new ActiveXObject("Microsoft.XMLHTTP")
	}
	
	return xmlHttp2
} 

function stateChanged2()
{ 
	if (xmlHttp2.readyState == 4 || xmlHttp2.readyState == "complete") { 
		document.getElementById('nlsignup').innerHTML = 'Thank You';
	} 
}
