// CODE AND FUNCTIONS RELATED TO PAGE NAVIGATION BARS*******************************

// Pre load navigation images (normal, over, active) only if Javascript 1.1 is supported
	// Create an object for each image, then load each image (normal, over, active) from source
	// Image naming convention must be image_1.gif, imageo_1.gif, imagea_1.gif, image_2.gif, etc...
	// The "_x" naming convention is supported by Macromedia Fireworks slice export options
	for (i = 1; i <= numImages; i++) {
		eval(strImageName + '_' + i + ' = new Image();');
		eval(strImageName + '_' + i + 'o = new Image();');
		eval(strImageName + '_' + i + 'a = new Image();');
		eval(strImageName + '_' + i + '.src = "' + strFileBase + '_' + i + '.gif"');
		eval(strImageName + '_' + i + 'o.src = "' + strFileBase + 'o_' + i + '.gif"');
		eval(strImageName + '_' + i + 'a.src = "' + strFileBase + 'a_' + i + '.gif"');
	}
	
	//Create strThisPage variable
	var strThisPage = strImageName + '_' + intThisImgNum;

		
// Image swap and status bar message function
function changeImg(intImgNum, strAction) 
{
	var strImgName;
	var intOldImgNum;
	var strOldSource;
	var strNewSource;

	// Function only if image number is zero
	if (intImgNum != 0) 
	{
		// Checks browser supports images
		if (document.images) 
		{ 
				// Sets image object values based on function parameters received
				strImgName = strImageName + '_' + intImgNum;
					
				//If changing page, reset current image and update page variable
				if (strAction == 'a')
				{
		  			// Change currently active image back to normal state
					strOldSource = strFileBase + '_' + intThisImgNum + '.gif';
		  	      	eval('document.images["' + strThisPage + '"].src = "' + strOldSource + '"');
					
					//Check whether frameset double-change is required
					if (top.location != self.location)
					{
						if (self.name != strFrameName)
						{
							//parent.frames[strFrameName].changeImg(intImgNum,'a');
							window.setTimeout('parent.frames[strFrameName].changeImg(' + intImgNum + ',"a")', 400);						
						}
					}
	  	   	
					// Updates the currently active page tracking variables
	  	   			intThisImgNum = intImgNum;			
					strThisPage = strImgName; 
				}

				//Check whether this is the active page
				if (strImgName == strThisPage && strAction == '')
				{
					strAction = 'a';
				}
				
				//Determine source for the required image
				strNewSource = strFileBase + strAction + '_' + intImgNum + '.gif';

  		      	// Show requested image (Accesses image object from array by name)
	  	      	eval('document.images["' + strImgName + '"].src = "' + strNewSource + '"');
  	    }
		
		// Swap status bar messages as required
		if (strAction == 'o')
		{
			window.setTimeout('window.status="' + strTitles[intImgNum] + '"', 1);
		}
		else
		{
			window.status = '';
		}
		
	}
} 


