function init()
	{
	//adjust header height and adjust menu position 
	a=document.getElementById("middle")
	b=document.getElementById("right")
	if(b)
		{
		if (a.scrollHeight<b.scrollHeight)
			{
			a.style.height=b.scrollHeight+10+"px"	
			}
		}
		
	var c = document.getElementById("middle").getElementsByTagName("IMG")
	for (var d=0;d<c.length;d++)
		{
		if (c[d].className=="thumb")
			{
			c[d].onmouseover=function(){cursor_sniff(this.style)}
			c[d].onclick=function(){w=500;h=300;if (this.src=='http://www.henleyconferences.co.uk/images/techtour.jpg'){w=500;h=375};obr(this.src.replace("/images","/tour").replace(".gif",".swf").replace(".jpg",".swf"),'tour','scrollbars=no,width='+w+',height='+h)}
			}	
		}
	var a = document.getElementsByTagName("A")
	for (var b=0;b<a.length;b++)
		{
		a[b].onmouseover = function(){so();num=this.id.replace(/l/,'');if(num){me(num)}}
		a[b].onmouseout  = function(){so();sa()}			
		}			
	}
	
function flash_movie()
	{
	document.write ('<object type="application/x-shockwave-flash" data="http://media2.bronco.co.uk/media/henley-intro.swf" id="flash" width="360" height="200">')
	document.write ('<param name="movie" value="http://media2.bronco.co.uk/media/henley-intro.swf">')
	document.write ('<param name="wmode" value="transparent">')
	document.write ('</object>') 
	}

function obr(a,b,c){window.open(a,b,c)}
function cursor_sniff(obj){if (document.all){obj.cursor="hand"}else{obj.cursor="pointer"}}	
function checker(obj,msg){if(obj.value=="" && mt==false){alert(msg);mt=true;obj.focus()}}
function email(fm,fobj)
	{
	obj=eval('document.'+fm+'.'+fobj)
	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==false){alert("Email address seems incorrect (check @ and .'s)");mt=true;obj.focus()}
	if (mt==false){var user=matchArray [1];var domain=matchArray [2];if (user.match(userPat)==null){alert("The username doesn't seem to be valid.");mt=true;obj.focus()}}
	if (mt==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!");mt=true;obj.focus()}}}}
	if (mt==false){var domainArray=domain.match(domainPat);if (domainArray==null){alert("The domain name doesn't seem to be valid.");mt=true;obj.focus()}}
	if (mt==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>4){alert("The address must end in a two,three or four letter domain");mt=true;obj.focus()}}
	if ((len<2) && mt==false){alert("This address is missing a hostname!");mt=true;obj.focus()};
	}
	
function send_booking()
	{
	mt=false;fm=document.details
	checker(fm.title,'You must enter a title')
	checker(fm.fname,'You must enter your first name')
	checker(fm.sname,'You must enter your surname')
	checker(fm.address1,'You must enter your address')
	checker(fm.postcode,'You must enter your postcode')
	checker(fm.tel,'You must a contact telephone number')
	email('details','email');
	if (mt==false)fm.submit()
	}
	
function validate(){mt = false;email('details','email');if (mt == false){document.details.submit()}}
	
//Drop Down Menus
var ti=null;var to=false
function show(a){var layer=eval('document.getElementById("sub'+a+'").style');l=eval('document.getElementById("l'+a+'")');layer.display="block"}
function sa(){if(to==false){ti=setTimeout("ha()",1000);to=true}}
function so(){if(to){clearTimeout(ti);ti=null;to=false;}}
function me(a){ha();show(a);so()}
function ha(){for(var a=0;a<=250;a++){var layer=eval('document.getElementById("sub'+a+'")');if(layer){layer.style.display="none"}else{break}}}
		
window.onload=init