/*
www.capital-eng.com
Nav_Slice_Class.js

written by 
Geoff Corriere
geoff@cpe1.com

created 22/August/2002
last modified 23/August/2002

*/

//######################################################################
// constructor
//######################################################################

function Nav_Slice(unvis, act, vis, hover, name, sec_arr)
{
	this.unvisited = unvis;				// path to unvisited image - constant
	this.active = act;					// path to active image - constant
	this.visited = vis;					// path to visited image - constant
	this.hover = hover;					// path to hover image - constant
	this.normal = this.unvisited;		// gets set to the appropriate image path above
	
	this.img_name = name;
	this.section_arr = sec_arr;			// an array of html pages that make up each section. most have 1 element
	//alert( this.img_name );
	//alert( "leave Nav_Slice constructor" );
}

//==================================================



//######################################################################
// public member functions
//######################################################################



Nav_Slice.prototype.rollOut = rollOut;
function rollOut()
{
	document[this.img_name].src = this.normal;
}

//==================================================



//######################################################################
// private member functions
//######################################################################


Nav_Slice.prototype.rollOver = rollOver;
function rollOver()
{
	if( this.normal != this.active )	// only show hover if normal does not equal active
	{
		document[this.img_name].src = this.hover;
	}
}

//==================================================

Nav_Slice.prototype.changeBodyLocation = changeBodyLocation;
function changeBodyLocation( x )			// change the page that is displayed in the main frame
{
	parent.frames[1].location = this.section_arr[x];
}

//==================================================

Nav_Slice.prototype.makeImageStateActive = makeImageStateActive;
function makeImageStateActive()			//	change the normal state of an image to active
{
	this.normal = this.active;
	this.rollOut();
}

//==================================================

Nav_Slice.prototype.makeImageStateVisited = makeImageStateVisited;
function makeImageStateVisited()			//	change the normal state of an image to visited is it is currently active
{
	if( this.normal == this.active )
	{
		this.normal = this.visited;
		this.rollOut();
	}
}

//==================================================

Nav_Slice.prototype.turnAltNavOn = turnAltNavOn;
function turnAltNavOn()			//	change the normal state of an image to visited is it is currently active
{
	this.normal = this.visited;
	this.rollOut();
}

//==================================================

Nav_Slice.prototype.turnAltNavOff = turnAltNavOff;
function turnAltNavOff()			//	change the normal state of an image to visited is it is currently active
{
	this.normal = this.unvisited;
	this.rollOut();
}

//==================================================



	