// Object containing global website navigation links
function HomeLinkObject(description,page,iName,offImg,onImg)
{
	this.description = description
	this.page = page
	this.imgName = iName;
	this.offImage = offImg;
	this.onImage = onImg;
}

// Constants for the main navigation menu items
SERVICES 	= 0
SAMPLES 	= 1
CONTACT 	= 2
ABOUT	 	= 3

// List containing object for the main navigation menu
HomeLinkList = new Array()
HomeLinkList[SERVICES] = new HomeLinkObject('Services','tntpages.htm?services','home_services','images/services.gif','images/services-over.gif')
HomeLinkList[SAMPLES] = new HomeLinkObject('Samples','tntpages.htm?samples','home_samples','images/samples.gif','images/samples-over.gif')
HomeLinkList[CONTACT] = new HomeLinkObject('Contact','tntpages.htm?contact','home_contact','images/contact.gif','images/contact-over.gif')
HomeLinkList[ABOUT] = new HomeLinkObject('About','tntpages.htm?about','home_about','images/about.gif','images/about-over.gif')


function preloadImages()
{
	//Preload the images used by this page
	if (document.images) 
	{
		var myimages = new Array()
		for (x=0; x<=3; x++)
		{
			myimages[x] = new Image()
			myimages[x].src = HomeLinkList[x].onImage
		}
	}
}


function replacePage(pageURL)
{
	window.location.replace(pageURL)
}

function gotoPage(pageURL)
{
	window.location.href = pageURL
}

// Link to a page from the main navigation menu
function doHomeLink(index)
{
	if ((index >= SERVICES) && (index <= ABOUT)) 
	{
		curLink = HomeLinkList[index]
		if (curLink != null)
		{
			if (curLink.page == '')
			{
				alert('The page "'+curLink.description+'" is under construction.  Please check again at a later date.')
			}
			else
			{
				gotoPage(curLink.page)
			}
		}
	}
}

// Function to perform rollovers for the main navigation menu
function changeImage(index,state)
{
	curImage = HomeLinkList[index]
	if ((curImage != null) && (document.images[curImage.imgName] != null))
	{
		if (!curImage.selected)
		{
			if (state == 1) 
			{
				document.images[curImage.imgName].src = curImage.onImage;
			}
			else
			{
				document.images[curImage.imgName].src = curImage.offImage;
			}
		}
	}
}


