
		function validateForm()
		{
		    var form = document.forms['SubscribeForUpdates'];
		    if (!form) 
		    {
			    form = document.SubscribeForUpdates;
		    }
		    var strError = "";

			// check title field is complete
			if(form.title.value=="")
			{
				strError += "Please provide your title\n";
			}    
			
			// check firstname field is complete
			if(form.firstname.value == "")
			{
				strError += "Please provide your first name\n";
			}
			
			// check surname field is complete
			if(form.lastname.value == "")
			{
				strError += "Please provide your last name\n";
			}
			
			// check that user has agreed to terms
			if(form.agreed_To_Terms.checked == false)
			{
				strError += "You must agree to the terms before submitting\n";
			}
			
			// check e-mail address field is complete
			if(form.email.value=="")
			{
				strError += "Please enter an e-mail address\n";
			}
			
			// check e-mail address is a valid e-mail address
			if(!isEmail(form.email.value))
			{
				strError += "E-mail must be valid\n";
			}

			if(strError == "")
			{
				form.submit();
				return true;
			}
			else
			{
				alert(strError);
				return false;
			}
		}

		function isEmail(str) 
		{
			// are regular expressions supported?
			var supported = 0;
			if (window.RegExp) 
			{
				var tempStr = "a";
				var tempReg = new RegExp(tempStr);
				if (tempReg.test(tempStr)) supported = 1;
			}
			if (!supported)
				return (str.indexOf(".") > 2) && (str.indexOf("@") > 0);
			    var r1 = new RegExp("(@.*@)|(\\.\\.)|(@\\.)|(^\\.)");
				var r2 = new RegExp("^.+\\@(\\[?)[a-zA-Z0-9\\-\\.]+\\.([a-zA-Z]{2,3}|[0-9]{1,3})(\\]?)$");
				return (!r1.test(str) && r2.test(str));
		}
