function booking(fm)
	{
	mt=true;
	checker(fm.fullname,'You must enter your name')
	checker(fm.address1,'You must enter the first line of your address')
	checker(fm.address2,'You must enter the second line of your address')
	checker(fm.tel,'You must enter a telephone number')
	email(fm.email)
	checker(fm.answer,'Sorry, please answer the maths question, as it prevents spam')
	return mt
	}

function checker(obj,msg)
	{if(obj.value=="" && mt==true)message(obj,msg)}
	
function message(obj,msg)
	{alert(msg);obj.focus();mt=false}

function 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) && mt==true){message(obj,"Email address seems incorrect (check @ and .'s)")}
	if (mt==true){var user=matchArray [1];var domain=matchArray [2];if (user.match(userPat)==null)message(obj,"The username doesn't seem to be valid.")}
	if (mt==true){var IPArray=domain.match(ipDomainPat);if (IPArray!=null){for (var j=1;j<=4;j++){if (IPArray[j]>255)message(obj,"Destination IP address is invalid!")}}}
	if (mt==true){var domainArray=domain.match(domainPat);if (domainArray==null)message(obj,"The domain name doesn't seem to be valid.")}
	if (mt==true){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>4)message(obj,"The address must end in a two,three or four letter domain")}
	if ((len<2) && mt==true)message(obj,"This address is missing a hostname!");
	}
	
function cursor_sniff(obj)
	{if (document.all)obj.cursor="hand";else obj.cursor="pointer"}
	
function start()
	{	
	//Submit Mouseover
	if(document.getElementById("admin")){document.getElementById("admin").userid.focus()}
	
	var a = document.getElementsByTagName("INPUT");for (var b=0;b<a.length;b++){if(a[b].className=="submit"){a[b].onmouseover = function(){cursor_sniff(this.style)}}}
	}
	
function inc(filename)
	{
	var head = document.getElementsByTagName('head').item(0);
	var js = document.createElement('script');
 	js.setAttribute('type', 'text/javascript');
	js.setAttribute('src', "/includes/" + filename);
	head.appendChild(js)
	}

function moodalbox()
	{	
	inc("mootools.js")
	inc("moodalbox.js")
	}
	
window.onload=start