var currentMenu = 0;
// Menu colours
var tx = "#888"			// Menu Caption Text
var tx_hl = "#f00"	// Menu Caption Text (hilit)
var bg = "#eee";		// Background colour

// Menu tab colours
var c1 = "#bbbbbb"; // Home
var c2 = "#99CC66"; // Services
var c3 = "#FFFF66"; // About
var c4 = "#66CCCC"; // Links
var c5 = "#9999CC"; // Contact

// [Client DHTML function]
// show the initial menu item (body.onLoad)
function showMenu(i){
	var layout = document.getElementById("Layout");
	layout.style.borderColor = eval('c'+i);
	setState(i);
	currentMenu = i;
}
// [Client DHTML function]
// hilite menu item onMouseOver 
function hilite(i){
	var menu = document.getElementById("menuBarItem"+i);
	var menuText = document.getElementById("menuBarText"+i);
	var line;
	if(currentMenu!=i) {
		menuText.style.color = tx_hl;
		menu.style.backgroundColor = eval('c'+i);
		for (j = 1; j <= i; j++ ) {
			line = document.getElementById("menuBarLine"+j);
			line.style.backgroundColor = eval('c'+i);
		}
		for (j = i+1; j < 6; j++ ) {
			line = document.getElementById("menuBarLine"+j);
			line.style.backgroundColor = bg;
		}
	}
	else {
		line = document.getElementById("menuBarLine"+i);
		line.style.backgroundColor = eval('c'+i);
	}
}
// [Client DHTML function]
// unhilite menu item onMouseOut 
function unHilite(i){
	var menu = document.getElementById("menuBarItem"+i);
	var menuText = document.getElementById("menuBarText"+i);
	var line;
	if(currentMenu!=i) {
		menuText.style.color = tx;
		menu.style.backgroundColor = bg;
		for (j = 1; j <= currentMenu; j++ ) {
			line = document.getElementById("menuBarLine"+j);
			line.style.backgroundColor = eval('c'+currentMenu);
		}
		for (j = currentMenu+1; j < 6; j++ ) {
			line = document.getElementById("menuBarLine"+j);
			line.style.backgroundColor = bg;
		}
	}
	else {
		line = document.getElementById("menuBarLine"+i);
		line.style.backgroundColor = eval('c'+i);
	}
}
// [Client DHTML function]
// set the state of the main menu selected
function setState(i){
	hilite(i);
}
// [Client DHTML function]
// hide email from source
function print_mail_to_link(lhs, rhs, rhs2) 
{
   document.write("<a href=\"mailto");
   document.write(":" + lhs + "@");
   document.write(rhs + "." + rhs2 + "\">");
   document.write(lhs + "@");
   document.write(rhs + "." + rhs2);
	 document.write("<\/a>");
}
function print_mail_to_link2(lhs, rhs, rhs2, str) 
{
   document.write("<a href=\"mailto");
   document.write(":" + lhs + "@");
   document.write(rhs + "." + rhs2 + "\">");
   document.write(str);
	 document.write("<\/a>");
}
