// JavaScript doucment for American Car Club of Australia (http://www.americancarclub.net/)
// Created by Mark Kolaric.

//Declare variables for use by functions in this file.
arrHeaders = new Array("images/imgHeader1.jpg","images/imgHeader2.jpg","images/imgHeader3.jpg","images/imgHeader4.jpg","images/imgHeader5.jpg","images/imgHeader6.jpg","images/imgHeader7.jpg","images/imgHeader8.jpg","images/imgHeader9.jpg")
thisHeader = 0
imgCount = arrHeaders.length

//Rotate Headers
//This function is used by every page to rotate the main page header between the different header images.
function rotateHeaders()
{
	if (document.images)
	{
		thisHeader++
		if (thisHeader == imgCount)
		{
			thisHeader = 0
		}
		document.mainHeader.src=arrHeaders[thisHeader]
		setTimeout("rotateHeaders()", 3 * 1000)
	}
}

// New Window
// This function is used by the photo gallery pages to open a new window to display the full sized image for the thumbnail clicked on.
function newWindow(imgName,imgWidth,imgHeight)
{
	imgWindow = window.open("", "imgWin", "width=" + imgWidth + ",height=" + imgHeight + ",top=100")
	imgWindow.document.write("<html><head><title>American Car Nationals 2008</title><link rel='stylesheet' type='text/css' href='style/americancarclub.css' /><script src='style/americancarclub.js' language='javascript' type='text/javascript'></script></head><body><img src=" + imgName + "><br /><br /><div id='dynamicwindow'><font size='2'><i><a href='javascript:closeWindow()' style='font-size:12px;font-style:oblique;color:#000000;text-decoration:none;'>Close Window</i></a></font></div></body></html>")
	imgWindow.focus()
}

// Close Window
// This function closes the dynamic windows opened by the photo gallery.
function closeWindow()
{
		this.close()
}