function enlargeImage(imageName)
{
	newWindow = window.open("", "Enlarged", "width=800, height=600, scrollbars=no, status=yes, toolbar=no, location=no, resizable=no");
	newWindow.document.write("<html><!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.1//EN' 'http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd'><html xmlns='http://www.w3.org/1999/xhtml'><title>"+imageName+".jpg</title></head><body style='margin:0px'><p style='margin:0px'><img src='images/"+imageName+".jpg' alt='Norfolk Transport Services - "+imageName+"' title='Norfolk Transport Services - "+imageName+"' />");
	newWindow.document.write("</p></body></html>");
	newWindow.document.close();
}

function checkform()
{
	var filter=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i;
	var result=true;

	if(document.getElementById("contact").forename.value=="")
	{	
		result=false;
		document.getElementById("contact").forename.style.backgroundColor='#FFDDFF';
	}
	else
	{
		document.getElementById("contact").forename.style.backgroundColor='#FFFFFF';
	}
	
	if(document.getElementById("contact").surname.value=="")
	{	
		result=false;
		document.getElementById("contact").surname.style.backgroundColor='#FFDDFF';
	}
	else
	{
		document.getElementById("contact").surname.style.backgroundColor='#FFFFFF';
	}
	
	if(document.getElementById("contact").email.value=="")
	{	
		result=false;
		document.getElementById("contact").email.style.backgroundColor='#FFDDFF';
	}
	else
	{
		document.getElementById("contact").email.style.backgroundColor='#FFFFFF';
	}
	
	if(document.getElementById("contact").phone.value=="")
	{	
		result=false;
		document.getElementById("contact").phone.style.backgroundColor='#FFDDFF';
	}
	else
	{
		document.getElementById("contact").phone.style.backgroundColor='#FFFFFF';
	}
	
	if(document.getElementById("contact").comments.value=="")
	{	
		result=false;
		document.getElementById("contact").comments.style.backgroundColor='#FFDDFF';
	}
	else
	{
		document.getElementById("contact").comments.style.backgroundColor='#FFFFFF';
	}

	if(!filter.test(document.getElementById("contact").email.value))
	{
		document.getElementById("contact").email.style.backgroundColor='#FFDDFF';
		result= false;
	}
	else
	{
		document.getElementById("contact").email.style.backgroundColor='#FFFFFF';
	}														  
	
	if(result==false)
	{
		alert("Please complete the highlighted fields correctly");
	}
	
	return result;
}
