//------------------------------------------------------------------------------------
// hashImage Class
//------------------------------------------------------------------------------------
function hashImage(imgPath)
{
	this.images = new Array();
	this.keys = new Array();
	this.length = 0;
	this.path = imgPath;	
}
hashImage.prototype.addImage = function(key, value)
{
	if (!document.images) return;
			
	if (typeof(key) == 'undefined') return;
	if (typeof(value) == 'undefined') return;
	
	if (typeof(this.images[key]) == 'undefined')
	{
		this.keys[this.keys.length] = key;
		this.length = this.keys.length;
	}
	this.images[key] = new Image();
	this.images[key].src = this.path + value;
}
hashImage.prototype.getImage = function(key)
{
	if (typeof(key) == 'undefined')
		return;

	for (var i = 0; i < this.keys.length; i++)
	{
		if (this.keys[i] == key)
		{
			return this.images[this.keys[i]].src;
		}	
	}
	return null;
}
//------------------------------------------------------------------------------------
// Functions
//------------------------------------------------------------------------------------
function displayPage(page)
{
	document.location.href = page + '.htm';
}
function imgOut(key)
{
	if(document.getElementById(key+'_nav'))
	{
		document.getElementById(key+'_nav').src = hi.getImage(key+'_out');
	}
}
function imgOver(key)
{
	if(document.getElementById(key+'_nav'))
	{
		document.getElementById(key+'_nav').src = hi.getImage(key+'_over');
	}
}
function showAsHref(key, active)
{
	if(document.getElementById(key))
	{
		if(active)
		{
			document.getElementById(key).style.cursor="hand";
		}
		else
		{
			document.getElementById(key).style.cursor="default";
		}
	}
}
function subnavOn(key)
{
	if(key=='jsubnav')
	{
		if(document.getElementById('jump-subnavigation'))
		{
			document.getElementById('jump-subnavigation').style.textDecoration = "underline";
		}		
	}
	else
	{
		if(document.getElementById(key+'_snav'))
		{
			document.getElementById(key+'_snav').style.textDecoration = "underline";
		}
	}
}
function subnavOff(key)
{
	if(key=='jsubnav')
	{
		if(document.getElementById('jump-subnavigation'))
		{
			document.getElementById('jump-subnavigation').style.textDecoration = "none";
		}		
	}
	else
	{
		if(document.getElementById(key+'_snav'))
		{
			document.getElementById(key+'_snav').style.textDecoration = "none";
		}
	}
}
//------------------------------------------------------------------------------------
// Code
//------------------------------------------------------------------------------------
var hi = new hashImage("images/nav/");
hi.addImage("about_out","about_renlaw.gif");
hi.addImage("about_over","about_renlaw_over.gif");
hi.addImage("services_out","services.gif");
hi.addImage("services_over","services_over.gif");
hi.addImage("rensaw_out","rensaw.gif");
hi.addImage("rensaw_over","rensaw_over.gif");
hi.addImage("contactus_out","contactus.gif");
hi.addImage("contactus_over","contactus_over.gif");
hi.addImage("support_out","support.gif");
hi.addImage("support_over","support_over.gif");
