
function HandleSubscription()
	{
if (document.getElementById('subscribeform')){
document.getElementById('subscribeform').onsubmit = function()
		{
		var str=document.getElementById('strEmail').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('strEmail').focus();
					var EmailField = document.getElementById("strEmail");
        			EmailField.focus();					
					testresults=false;
					}
				 return (testresults)
		}	
	
		//clear email field when user puts focus on field
		document.getElementById('strEmail').onfocus = function()
			{
				if(this.value == "Enter your email address"){this.value = "";}
			};
		
		//return value to default text if field loses focus and is still empty	
		document.getElementById('strEmail').onblur = function()
			{
				if(this.value == ""){this.value = "Enter your email address";}
			};
			
			
	}
	}

