// JavaScript Document
var currentBtn = -1;
var currentSubNav = "";
var fontColor = 000000;

var lowlites = new Array(4);
lowlites[0] = new Image();
//lowlites[0].src = "";
lowlites[1] = new Image();
lowlites[1].src = "images/aboutbtn.gif";
lowlites[2] = new Image();
lowlites[2].src = "images/servicesbtn.gif";
lowlites[3] = new Image();
lowlites[3].src = "images/contactbtn.gif";
lowlites[4] = new Image();
lowlites[4].src = "images/techtipsbtn.gif";
var hilites = new Array(4);
hilites[0] = new Image();
//hilites[0].src = "";
hilites[1] = new Image();
hilites[1].src = "images/abouthi.gif";
hilites[2] = new Image();
hilites[2].src = "images/serviceshi.gif";
hilites[3] = new Image();
hilites[3].src = "images/contacthi.gif";
hilites[4] = new Image();
hilites[4].src = "images/techtipshi.gif";
var selites = new Array(4);
selites[0] = new Image();
//selites[0].src = "";
selites[1] = new Image();
selites[1].src = "images/aboutsel.gif";
selites[2] = new Image();
selites[2].src = "images/servicessel.gif";
selites[3] = new Image();
selites[3].src = "images/contactsel.gif";
selites[4] = new Image();
selites[4].src = "images/techtipssel.gif";

function setup() {
	if (location.href.indexOf("index.htm") != -1)
		currentBtn = 0;
	else if (location.href.indexOf("about.htm") != -1 ||
				location.href.indexOf("carol.htm") != -1 ||
				location.href.indexOf("mike.htm") != -1 ||
				location.href.indexOf("partners.htm") != -1) {
		currentBtn = 1;
		document.images["aboutbtn"].src = selites[currentBtn].src;
		if (location.href.indexOf("about.htm") != -1)
			currentSubNav = "about";
		else if (location.href.indexOf("carol.htm") != -1)
			currentSubNav = "carol";
		else if (location.href.indexOf("mike.htm") != -1)
			currentSubNav = "mike";
		else if (location.href.indexOf("partners.htm") != -1)
			currentSubNav = "partner";
		textHilite(currentSubNav);
		}
	else if (location.href.indexOf("services.htm") != -1 ||
				location.href.indexOf("inspect.htm") != -1 ||
				location.href.indexOf("support.htm") != -1 ||
				location.href.indexOf("planning.htm") != -1 ||
				location.href.indexOf("maint.htm") != -1 ||
				location.href.indexOf("personal.htm") != -1 ||
				location.href.indexOf("reviews.htm") != -1 ||
				location.href.indexOf("custom.htm") != -1) {
		currentBtn = 2;
		document.images["servicesbtn"].src = selites[currentBtn].src;
		if (location.href.indexOf("services.htm") != -1)
			currentSubNav = "services";
		else if (location.href.indexOf("planning.htm") != -1)
			currentSubNav = "planning";
		else if (location.href.indexOf("reviews.htm") != -1 ||
					location.href.indexOf("custom.htm") != -1)
			currentSubNav = "reviews";
		else if (location.href.indexOf("support.htm") != -1 ||
					location.href.indexOf("maint.htm") != -1 ||
					location.href.indexOf("personal.htm") != -1 ||
					location.href.indexOf("inspect.htm") != -1 ||
					location.href.indexOf("techtips/") != -1)
			currentSubNav = "support";
		textHilite(currentSubNav);
		}
	else if (location.href.indexOf("contact.htm") != -1) {
		currentBtn = 3;
		document.images["contactbtn"].src = selites[currentBtn].src;
		}
	else if (location.href.indexOf("techtips.htm") != -1 ||
				location.href.indexOf("lasttip.htm") != -1 ||
				location.href.indexOf("tiplist.htm") != -1 ||
				location.href.indexOf("whattips.htm") != -1 ||
				location.href.indexOf("tip200") != -1) {
		currentBtn = 4;
		document.images["techtipsbtn"].src = selites[currentBtn].src;
		if (location.href.indexOf("techtips.htm") != -1)
			currentSubNav = "techtip";
		else if (location.href.indexOf("lasttip.htm") != -1)
			currentSubNav = "lasttip";
		else if (location.href.indexOf("tiplist.htm") != -1 ||
					location.href.indexOf("tip200") != -1)
			currentSubNav = "tiplist";
		else if (location.href.indexOf("whattips.htm") != -1)
			currentSubNav = "whattips";
		textHilite(currentSubNav);
		}
}

function hilite(num,name) {
	if (num != currentBtn)
		document.images[name].src = hilites[num].src;
}

function lowlite(num,name) {
	if (num != currentBtn)
		document.images[name].src = lowlites[num].src;
}

function textHilite(name) {
	//document.getElementById(name).style.fontWeight = 'bold';
	fontColor = document.getElementById(name).style.color;
	document.getElementById(name).style.color = '000000';
}

function textLowlite(name) {
	//document.getElementById(name).style.fontWeight = 'normal';
	if (name != currentSubNav)
		document.getElementById(name).style.color = fontColor;
}