function validate()
{
	var strErrorMsg		= "";
	var strErrEmail		= "";
	
//alert("its me");
	
	if (document.getElementById('title').value=="select")
	{
		if (strErrorMsg == "")
		{
			document.getElementById('title').focus();
		}
		strErrorMsg = strErrorMsg + '- Please select your Title\n';
	}

	if (document.getElementById('forename').value=="")
	{
		if (strErrorMsg == "")
		{
			document.getElementById('forename').focus();
		}
		strErrorMsg = strErrorMsg + '- Please enter your Forename\n';
	}

	if (document.getElementById('surname').value=="")
	{
		if (strErrorMsg == "")
		{
			document.getElementById('surname').focus();
		}
		strErrorMsg = strErrorMsg + '- Please enter your Surname\n';
	}

	if (document.getElementById('email').value=="")
	{
		if (strErrorMsg == "")
		{
			document.getElementById('email').focus();
			
		}
		strErrorMsg = strErrorMsg + '- Entered Email address is invalid.\n';
	}
	
	
	if (document.getElementById('email').value!=document.getElementById('vemail').value)
	{
			//alert("not matched");
		
        if (strErrorMsg == "")
		{
			document.getElementById('email').focus();
		}
			strErrorMsg = strErrorMsg + '- The entered Email Addresses do not match.\n';

	}

	if (document.getElementById('searchhouse').value=="")
	{
		if (strErrorMsg == "")
		{
			document.getElementById('searchhouse').focus();
		}
		strErrorMsg = strErrorMsg + '- Please enter your House number/name and Postcode and\n  then click the Find My Address button\n';
	}

	else if (document.getElementById('postcode').value=="")
	{
		if (strErrorMsg == "")
		{
			document.getElementById('postcode').focus();
		}
		strErrorMsg = strErrorMsg + '- Please enter your Postcode and then click the Find My Address button\n';
	}

	if (document.getElementById('address1').value=="")
	{
		if (strErrorMsg == "")
		{
			document.getElementById('address1').focus();
		}
		strErrorMsg = strErrorMsg + '- Please enter the first line of your address\n';
	}

	if (document.getElementById('address3').value=="")
	{
		if (strErrorMsg == "")
		{
			document.getElementById('address3').focus();
		}
		strErrorMsg = strErrorMsg + '- Please enter your Town\n';
	}



	if (strErrorMsg == "")
	{
		if (document.getElementById('DPact').checked!=true)
		{
			alert("Before you can view the brochure:\nPlease tick the box to confirm you have read the data protection document.");
			document.getElementById('DPact').focus();
			return false;
		}
		document.getElementById('atlas').src = "http://switch.atdmt.com/action/cdk666_sagaequitybrochurepdf_10";
		return true;
	}
	else
	{
		strErrorMsg = 'Please check the following:' + '\n\n' + strErrorMsg + ' ';
		alert(strErrorMsg);
		return false;
	}
}


function showIt()
{
 if(document.getElementById('persreq').checked)
 {document.getElementById('theBox').style.display = 'block';}
 else
 {document.getElementById('theBox').style.display = 'none';}
}
