// array of "normal state" images
var normalImages = new Array('images/nav_home.jpg', 'images/nav_about.jpg', 'images/nav_photos.jpg', 'images/nav_questions.jpg', 'images/bird1.png', 'images/bird2.png');

// array of "hover state" images
var hoverImages = new Array('images/nav_home_on.jpg', 'images/nav_about_on.jpg', 'images/nav_photos_on.jpg', 'images/nav_questions_on.jpg', 'images/bird1_over.png', 'images/bird2_over.png');


// this function is called on page load
// it preloads all the hover and click images
// for faster swap response time
function preloadImages() 
{
	var i=0;

	objImage = new Image();

	for	(i=1; i<=hoverImages.length; i++)
	{
		objImage.src = hoverImages[i];
	}

}

// this function resets all the images to their "normal" state // used when clicking on an image, to reset all images 
function resetAll()
{
	for	(i=1; i<=normalImages.length; i++)
	{
		obj = eval('document.image' + i);
		obj.src = normalImages[i];
	}

}

// used on mouseover
// swap the named image into "hover" state
// but only if it is not already in "click" state
function setHover(num)
{
	obj = eval('document.image' + num);
	str = obj.src;

	obj.src = hoverImages[num];

}


// used on mouseout
// swap the named image into "normal" state
// but only if it is not already in "click" state
function setNormal(num)
{
	obj = eval('document.image' + num);
	str = obj.src;

	obj.src = normalImages[num];

}
