function bake_cookie ()
{//====================
// this function writes a cookie
	document.cookie = "javascript=enabled;";
}

function check_contact(contact_form)
{//=================================
// this function checks all the input fields on the form
// and displays an alert box if it finds anything wrong
if (contact_form.fromaddr.value == "")
	{
	alert ("Please enter your email address")
	contact_form.fromaddr.focus()
	return false
	}
if (contact_form.subject.value == "")
	{
	alert ("Please enter a subject for your message")
	contact_form.subject.focus()
	return false
	}
if (contact_form.message.value == "")
	{
	alert ("You haven't entered a message!")
	contact_form.message.focus()
	return false
	}
// set the regular expression to a pattern for email address
re = /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/
if (!re.test(contact_form.fromaddr.value))
	{
	alert ("Your email address is not in the correct format")
	contact_form.fromaddr.focus()
	return false
	}

return true
}

function large_eventpic(imageFile, imageWidth, imageHeight, imageAlt)
{//==================================================================
// this function opens a pop up window 
// to show a larger image of an event
	imagewin = window.open("","imagewin","width=750,height=500")
	imagewin.document.write ("<img src='_images/events/")
	imagewin.document.write (imageFile)
	imagewin.document.write ("' alt='")
	imagewin.document.write (imageAlt)
	imagewin.document.write ("' width='")
	imagewin.document.write (imageWidth)
	imagewin.document.write ("' height='")
	imagewin.document.write (imageHeight)
	imagewin.document.write ("' border='0'>")
	imagewin.document.write ("<div align='right'><P>&nbsp;<a href='javascript:window.close()'>Close window</a></div>")
	imagewin.document.close()
}
