function chk_browser()
	{
	if(!document.getElementsByTagName){alert('You will need to update your browser to view this site properly')}
	//IE6 re-style
	app = navigator.appVersion.split(';',3)
	if (app[1]==" MSIE 6.0")
		{document.getElementById("fed").style.marginRight="10px";document.getElementById("middle").style.marginLeft="10px"}
	}
	
function contact()
	{
	empty=false;fm=document.details
	checker(fm.fname,'first Name');checker(fm.lname,'last Name')
	check_email(fm.email)
	if(empty==false){fm.submit()}
	}
	
function check_email(obj)
	{
	var emailStr=obj.value;var emailPat=/^(.+)@(.+)$/
	var specialChars="\\(\\)!£$%^&*()+='#~?<>@,;:\\\\\\\"\\.\\[\\]";var validChars="\[^\\s" + specialChars + "\]";var quotedUser="(\"[^\"]*\")";var ipDomainPat=/^\[(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})\]$/
	var atom=validChars + '+';var word="(" + atom + "|" + quotedUser + ")";var userPat=new RegExp("^" + word + "(\\." + word + ")*$");var domainPat=new RegExp("^" + atom + "(\\." + atom +")*$");var matchArray=emailStr.match(emailPat)
	if ((matchArray==null) && empty==false){alert("Email address seems incorrect (check @ and .'s)");empty=true}
	if (empty==false){var user=matchArray [1];var domain=matchArray [2];if (user.match(userPat)==null){alert("The username doesn't seem to be valid.");empty=true}}
	if (empty==false){var IPArray=domain.match(ipDomainPat);if (IPArray!=null){for (var j=1;j<=4;j++){if (IPArray[j]>255){alert("Destination IP address is invalid!");empty=true}}}}
	if (empty==false){var domainArray=domain.match(domainPat);if (domainArray==null){alert("The domain name doesn't seem to be valid.");empty=true}}
	if (empty==false){var atomPat=new RegExp(atom,"g");var domArr=domain.match(atomPat);var len=domArr.length;if (domArr[domArr.length-1].length<2 || domArr[domArr.length-1].length>3){alert("The address must end in a three-letter domain, or two letter country.");empty=true}}
	if ((len<2) && empty==false){alert("This address is missing a hostname!");empty=true};
	}

function checker(obj,msg)
	{if(obj.value=='' && empty==false){alert('The ' + msg + ' field must not be blank');empty=true;obj.focus()}}

window.onload = chk_browser
