// Rollover script & more
// 10/03/2002 - James DiEdwardo - for the Glory of God
// Test for occurence of strings in location href to determine what button to display in it's 'over' state

// This variable indicates which button to have in it's 'over' state - 0 means no buttons lit
var navnum = 1;

// This variable indicates how many nav items there are
var itemnum = 7;

// In case a query string was passed, save it
// var qstring = self.location.search.substring(1,self.location.search.length);

// The string we're testing is the location href
var targetstr = new String(self.location);

// This array holds all the strings we'll be testing for - for main nav
var lookfor = new Array();
	lookfor[1] = /home.htm/;
	lookfor[2] = /location.htm/;
	lookfor[3] = /staff.htm/;
	lookfor[4] = /services.htm/;
	lookfor[5] = /rates.htm/;
	lookfor[6] = /contact.htm/;
	lookfor[7] = /links.htm/;

// This determines which string is present in the location href for main nav
for (i=1; i<=itemnum; i++)
	{
	var strcheck = targetstr.search(lookfor[i]);
	if (strcheck != -1)
		{
		navnum = i;
		break;
		}
	}

// If a query string was passed, use that instead to force a menu item to be lit
//if (qstring !="")
//	{
//	var navstr = new String(qstring);
//	navnum = navstr.substring(1,navstr.length)
//	}
//
// Rollover code ------------------------------------------------------------------------
//
// The filepath to the images -  don't forget to include a forward slash at the end
var path = "graphics/";

// Initialize images - for main nav
var nav_out = new Array();
var nav_over = new Array();
	for (i=1; i<=itemnum; i++)
		{
		nav_out[i] = new Image();
		nav_out[i].src = path + "menu" + i + "_out" + ".gif";
		nav_over[i] = new Image();
		nav_over[i].src = path + "menu" + i + "_over" + ".gif";
		}

// MouseOver - for main nav
function imgOn(imgNum)
	{
	// If this button is not lit
	if (("nav"+navnum)!=("nav"+imgNum))
		{
		document["menu"+imgNum].src = nav_over[imgNum].src;
		}
	}
            
// MouseOut - for main nav
function imgOut(imgNum)
	{
	// If this button is not lit
	if (("nav"+navnum)!=("nav"+imgNum))
		{
		document["menu"+imgNum].src = nav_out[imgNum].src;
		}
	}

// MouseOver - for subnav
function imgOnsub(imgNum)
	{
	// If this button is not lit
	if (("subnav"+subnavnum)!=("subnav"+imgNum))
		{
		document["subnav"+imgNum].src = subnav_over[imgNum].src;
		}
	}
            
// Handles popup windows
function popwin(url) {
	window.open(url,"popwin","menubar=no,status=no,toolbar=no,location=top,scrollbars=yes,resizable=yes,fullscreen=no") ;
	}
