function loadImages()
{
	var Image1= new Image(49,15)
	Image1.src = "images/beautyB.jpg"

	var Image2 = new Image(53,15)
	Image2.src = "images/fashionB.jpg"

	var Image3 = new Image(61,15)
	Image3.src = "images/editorialB.jpg"

	var Image4 = new Image(54,15)
	Image3.src = "images/contactB.jpg"
}

function checkContactForm()
{
	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='#ffee91';
	}
	else
	{
		document.getElementById("contact").forename.style.backgroundColor='#FFFFFF';
	}
	
	if(document.getElementById("contact").surname.value=="")
	{	
		result=false;
		document.getElementById("contact").surname.style.backgroundColor='#ffee91';
	}
	else
	{
		document.getElementById("contact").surname.style.backgroundColor='#FFFFFF';
	}
	
	if(document.getElementById("contact").phone.value=="")
	{
		document.getElementById("contact").phone.style.backgroundColor='#ffee91';
		result= false;
	}
	else
	{
		document.getElementById("contact").phone.style.backgroundColor='#FFFFFF';
	}

	if(!filter.test(document.getElementById("contact").email.value))
	{
		document.getElementById("contact").email.style.backgroundColor='#ffee91';
		result= false;
	}
	else
	{
		document.getElementById("contact").email.style.backgroundColor='#FFFFFF';
	}	
	
	if(document.getElementById("contact").comments.value=="")
	{	
		result=false;
		document.getElementById("contact").comments.style.backgroundColor='#ffee91';
	}
	else
	{
		document.getElementById("contact").comments.style.backgroundColor='#FFFFFF';
	}
	
	if(result==false)
	{
		alert("The highlighted fields are mandatory and have not been completed correctly.  Please check and try again.");
	}
	
	return result;
}


var height = "";
var width = "";

function enlarge(name, no)
{
	var newImg = new Image();
	newImg.src = "images/"+name+"/enlarged/"+name+no+".jpg";
	
	if(newImg.height==0)
	{
		setTimeout("enlarge('"+name+"', '"+no+"')",200);
	}
	else
	{
	if(newImg.width>newImg.height)
	{
		if(newImg.width>900)
		{
			var scale = 900/newImg.width;
			width = "900";
			height = newImg.height*scale;
		}
		else
		{
			width = newImg.width;
			height = newImg.height;
		}
	}
	else
	{
		if(newImg.height>650)
		{
			var scale = 650/newImg.height;
			height = "650";
			width = newImg.width*scale;
		}
		else
		{
			width = newImg.width;
			height = newImg.height;
		}
	}
	
	
	/*newWindow = window.open("", "Enlarged", "width="+width+", height="+(height+30)+", scrollbars=no, status=yes, toolbar=no, location=no, resizable=no");
	newWindow.document.write("<html><head><title>Enlarged Image</title><script src='Scripts/rightClick.js' type='text/javascript'></script></head><body onblur='this.close();' style='margin:0px'><img src='"+newImg.src+"' alt='Enlarged Image' title='Enlarged Image' /><p style='text-align:center; padding-top:5px; margin:0px'>");
	newWindow.document.write("<a href='javascript:this.close()'>Close Window</a></p></body></html>");
	newWindow.document.close();*/
	
	newWindow = window.open("", "Enlarged", "width="+width+", height="+(height+30)+", scrollbars=no, status=yes, toolbar=no, location=no, resizable=no");
	newWindow.document.write("<html><head><script>function msg(){alert(\"The entire content of this site is protected by copyright. \\nNo reproduction without written permission from Kylie Macbeth\"); return false;}</script><title>Enlarged Image</title></head><body oncontextmenu='return msg();' onblur='this.close();' style='margin:0px'><img src='"+newImg.src+"' alt='Enlarged Image' title='Enlarged Image' width='"+width+"' height='"+height+"' />");
	newWindow.document.write("<p style='text-align:center; padding-top:5px; margin:0px'><a href='javascript:this.close()'>Close Window</a></p></body></html>");
	newWindow.document.close();
	}
}

function openContact(desc)
{
	newWindow = window.open("http://www.goodallsmotorcycles.com/contactWindow.php?title="+desc, "Arrange_Viewing", "width=509, height=495, scrollbars=no, status=yes, toolbar=no, location=no, resizable=no");
}
