// ##################################################################################
function NavBarMOver(imgName) 
{
	if (document.images) 
	{
		document.images[imgName].src = this.NavBarImgOver[imgName].src;
	}
}
// ----------------------------------------------------------------------------------
function NavBarMOut(imgName) 
{
	if (document.images) 
	{
		document.images[imgName].src = this.NavBarImgReg[imgName].src;
	}
}
// ##################################################################################
function NavBar( names, sect, active, path, type) 
{
	if (document.images) 
	{
		// Allocate navbar images
		this.NavBarImgOver = new Object; // over images
		this.NavBarImgReg = new Object; // regular images
		
		// load navbar images
		for (i = 0; i < names.length; i++)
		{
			var filename;
			this.NavBarImgOver[names[i]]= new Image();
			this.NavBarImgReg[names[i]]= new Image();
	
			fileName = path + sect + "_" + names[i] + '_on.' + type;
			//alert(fileName)
			this.NavBarImgOver[names[i]].src = fileName;
		
			// Set the source for the regular images
			if (names[i] == active) 
			{
				fileName = path + sect + "_" + names[i] + '_on.' + type;
			}
			else
			{
				fileName = path +  sect + "_" + names[i] + '_off.' + type;
			}
			this.NavBarImgReg[names[i]].src = fileName;
		}	
		this.MOver = NavBarMOver;
		this.MOut = NavBarMOut;
	}
}
// ##################################################################################
// ----------------------------------------------------------------------------------
function SideBarMOver(image_name) 
{
	if (document.images[image_name]) 
	{
		document.images[image_name].src = this.NavBarImgOver[image_name].src;
	}
}
// ----------------------------------------------------------------------------------
function SideBarMOut(image_name) 
{
	if (document.images[image_name]) 
	{
			document.images[image_name].src = this.NavBarImgReg[image_name].src;
	}
}
// ----------------------------------------------------------------------------------
// ----------------------------------------------------------------------------------
function SideBarSetActive(image_name) 
{
	if (document.images) 
	{
			this.NavBarImgReg[image_name].src = this.NavBarImgOver[image_name].src;
	}
}
// ----------------------------------------------------------------------------------
// ##################################################################################
function SideNavBar( names, path, type) 
{
	if (document.images) 
	{
		// Allocate navbar images
		this.NavBarImgOver = new Array(names.length); // over images
		this.NavBarImgReg = new Array(names.length); // regular images
		
		// load navbar images
		for (i = 0; i < names.length; i++)
		{
			var filename;
			this.NavBarImgOver[names[i]]= new Image();
			this.NavBarImgReg[names[i]]= new Image();
	
			fileName = path + names[i] + '_on.' + type;
			this.NavBarImgOver[names[i]].src = fileName;
			
			fileName = path + names[i] + '_off.' + type;
			this.NavBarImgReg[names[i]].src = fileName;
		}	
		this.SideMOver = SideBarMOver;
		this.SideMOut = SideBarMOut;
		this.SetActive = SideBarSetActive;
	}
}

