if (document.images)
{
	var home0 = new Image();
	home0.src = "images/imgNavHomeOff.gif";
	var home1 = new Image();
	home1.src = "images/imgNavHomeOn.gif";
	var about0 = new Image();
	about0.src = "images/imgNavAboutOff.gif";
	var about1 = new Image();
	about1.src = "images/imgNavAboutOn.gif";
	var what0 = new Image();
	what0.src = "images/imgNavWhatOff.gif";
	var what1 = new Image();
	what1.src = "images/imgNavWhatOn.gif";
	var working0 = new Image();
	working0.src = "images/imgNavWorkingOff.gif";
	var working1 = new Image();
	working1.src = "images/imgNavWorkingOn.gif";
	var clients0 = new Image();
	clients0.src = "images/imgNavClientsOff.gif";
	var clients1 = new Image();
	clients1.src = "images/imgNavClientsOn.gif";
}

function rollOut(imgName) 
{
    if (document.images) 
    {
        document[imgName].src = eval(imgName+"0.src");
    }
}

function rollIn(imgName)
{
    if (document.images)
    {
        document[imgName].src = eval(imgName+"1.src");
    }
}


// Hides form elements to prevent from showing through
function prepareForm(sVisibilityToggle) 
{
	for(var i=0; i < document.forms.length; i++)
	{
		for(var j=0; j < document.forms[i].elements.length; j++) 
		{
			if (document.forms[i].elements[j].type.indexOf("select") != -1)
			{
				document.forms[i].elements[j].style.visibility = sVisibilityToggle;
			}
		}
	}
}

// Displays the submenu 
function displaySubnav(sSubnav)
{
	var sNav;
	var sElement;
	
	rollIn(sSubnav);
	
	if(document.getElementById)
	{
		sElement = "document.getElementById('" + sSubnav + "Menu')";
	}
	else if(document.all)
	{
		sElement = "document.all['" + sSubnav + "Menu']";
	}
	
	sNav = eval(sElement);
	
	if (sNav)
	{
		sNav.style.visibility = 'visible';
	}
	
	prepareForm('hidden');
}

// Hides the submenu
function hideSubnav(sSubnav, bRemoveHighlight)
{
	var sNav;
	var sElement;
	
	if (bRemoveHighlight)
	{
		rollOut(sSubnav);
	}
	
	if(document.getElementById)
	{
		sElement = "document.getElementById('" + sSubnav + "Menu')";
	}
	else if(document.all)
	{
		sElement = "document.all['" + sSubnav + "Menu']";
	}
	
	sNav = eval(sElement);
	
	if (sNav)
	{
		sNav.style.visibility = 'hidden';
	}
	
	prepareForm('visible');
	
}

var arrSubnav = new Array();

arrSubnav[0] = new Array("about",
-32, // pixels from left
171,	// width of menu
"about us",
"about.php",
"contact us",
"contact.php"
);

arrSubnav[1] = new Array("what",
40, // pixels from left
171,	// width of menu
"web strategy",
"strategy.php",
"web design",
"design.php",
"web development",
"development.php",
"web hosting",
"hosting.php",
"ecommerce",
"ecommerce.php",
"graphic design",
"graphic.php",
"technology consulting",
"technology.php",
"brand management",
"brand.php",
"business communication tools",
"tools.php"
);


arrSubnav[2] = new Array("working",
130, // pixels from left
171,	// width of menu
"our philosophy",
"philosophy.php",
"our process",
"process.php"
);

arrSubnav[3] = new Array("clients",
172, // pixels from left
171,	// width of menu
"industry expertise",
"expertise.php",
"case studies",
"cases.php",
"client login",
"login.php"
);

function loadSubnav(sHexBGColor, sHexOverColor, sHexFontColor, sHexFontOverColor, sHexLineColor, sThisPage, sThisSection)
{
	if((document.all) || (document.getElementById))
	{
		var this_arrSubnav = new Array();
		this_arrSubnav = arrSubnav;
		var sSubnav = "";
		
		for (j = 0; j < this_arrSubnav.length; j++)
		{			
			var sCurrent = this_arrSubnav[j][0];
			var arrCurrent = this_arrSubnav[j];
			var bInArray = false;
			
			for (var k = 0; k < arrCurrent.length; k++)
			{
				if (sThisPage == arrCurrent[k] || sThisSection == arrCurrent[k])
				{
					bInArray = true;
				}			
			}
			
			if (bInArray)
			{
				sSubnav += "<div id=\"" + sCurrent + "Menu\" style=\"z-index:999;position: absolute; left:50%; margin-left: " + this_arrSubnav[j][1] + "; width: " + this_arrSubnav[j][2] + ";  visibility: hidden\" onmouseover=\"displaySubnav('" + sCurrent + "');\" onmouseout=\"hideSubnav('" + sCurrent + "', false);\">";
			}
			else
			{
				sSubnav += "<div id=\"" + sCurrent + "Menu\" style=\"z-index:999;position: absolute; left:50%; margin-left: " + this_arrSubnav[j][1] + "; width: " + this_arrSubnav[j][2] + ";  visibility: hidden\" onmouseover=\"displaySubnav('" + sCurrent + "');\" onmouseout=\"hideSubnav('" + sCurrent + "', true);\">";
			}
			
			
			sSubnav += "<table cellspacing=\"0\" cellpadding=\"0\" border=\"0\" width=\"" + this_arrSubnav[j][2] + "\">";
			
			for (i=3; i < this_arrSubnav[j].length-1; i=i+2)
			{
				sSubnav += "<tr>";
				sSubnav += "<td width=\"1\" bgcolor=\"" + sHexLineColor + "\"><img src=\"images\imgSpacer.gif\" width=\"1\" height=\"22\"></td>";
				sSubnav += "<td bgcolor=\"" + sHexBGColor + "\" class=\"subNav\" onClick=\"document.location.href='" + this_arrSubnav[j][i+1] + "'\" onmouseover=\"this.bgColor='" + sHexOverColor + "';this.style.color='" + sHexFontOverColor+ "';\" onmouseout=\"this.bgColor='" + sHexBGColor + "';this.style.color='" + sHexFontColor + "'\" style=\"color: " + sHexFontColor + "\"><div style=\"padding-left:12px;\">" + this_arrSubnav[j][i] + "</a></div></td>";
				sSubnav += "<td width=\"1\" bgcolor=\"" + sHexLineColor + "\"><img src=\"images\imgSpacer.gif\" width=\"1\" height=\"22\"></td>";
				sSubnav += "</tr>";
				sSubnav += "<tr>";
				sSubnav += "<td colspan=\"3\" bgcolor=\"" + sHexLineColor + "\" height=\"1\"><img src=\"images\imgSpacer.gif\" width=\"1\" height=\"1\"></td>";
				sSubnav += "</tr>";
			}
			
			sSubnav += "</table>";
			sSubnav += "</div>";
		}
		
		document.write(sSubnav);
	}
}