
function HandleSubscription()
	{
if (document.getElementById('subscribeform')){
document.getElementById('subscribeform').onsubmit = function()
		{
		var str=document.getElementById('thingy').value;
		var filter=/^[\w-]+(\.[\w-]+)*@([a-z0-9-]+(\.[a-z0-9-]+)*?\.[a-z]{2,6}|(\d{1,3}\.){3}\d{1,3})(:\d{4})?$/;
	
			if (filter.test(str))
					testresults=true;
			else 	{
					alert("There is a wee problem with your subscription - Please input a valid email address - using the format youremail@yourdomain.ext!");
					document.getElementById('thingy').focus();
					var EmailField = document.getElementById("thingy");
        			EmailField.focus();					
					testresults=false;
					}			 return (testresults)
		}	
	
		//clear email field when user puts focus on field
		document.getElementById('thingy').onfocus = function()
			{
				if(this.value == "Enter your email"){this.value = "";}		};
		
		//return value to default text if field loses focus and is still empty	
		document.getElementById('thingy').onblur = function()
			{
				if(this.value == ""){this.value = "Enter your email";}		};
	}}

