var xmlHttp
	
	function get_email_signup()
	{
	
			em = document.frm.email_signup.value;
	
			if(em == "")
			{
				alert("Please enter email address.");
				return false;
			}
			if(!checkEmail(em))
			{
				alert("Please enter valid email address.");
				return false;
			}
			
			xmlHttp = GetXmlHttpObject()
	
			if (xmlHttp==null)
			{
				alert ("Error while processing request.")
				return false;
			} 
			
			
			var url = "get_email_signup.php";

			xmlHttp.onreadystatechange = alertContents;
			
			function alertContents() {
				  if (xmlHttp.readyState == 4) {
					 if (xmlHttp.status == 200) 
					 {
						//alert(http_request.responseText);
						result = xmlHttp.responseText;
						alert("You have been successfully signed up for free demo.\n\nThe Aster team will be in touch with you within the next few days.");	
						return false;			           
					 } 
					 else 
					 {
						
						alert('There was a problem with the request.');
						return false;
					 }
				  }
			   }
			
			xmlHttp.open("POST",url,true);
			xmlHttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
			
			param = "e=" + em + "&tng=tn";
			xmlHttp.send(param);
	}
	
	
	function GetXmlHttpObject()
	{ 
		var objXMLHttp=null
		if (window.XMLHttpRequest)
		{
			objXMLHttp=new XMLHttpRequest()
		}
		else if (window.ActiveXObject)
		{
			objXMLHttp=new ActiveXObject("Microsoft.XMLHTTP")
		}
		return objXMLHttp
	} 
	
	//Email Function
		function checkEmail(email)
		{
		 if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(email))
		 {
			return (true)
		 }
			return (false)
		}
