// Initialize DHTML Menu functions
HM_DOM = (document.getElementById) ? true : false;
HM_NS4 = (document.layers) ? true : false;
HM_IE = (document.all) ? true : false;
HM_IE4 = HM_IE && !HM_DOM;
HM_Mac = (navigator.appVersion.indexOf("Mac") != -1);
HM_IE4M = HM_IE4 && HM_Mac;

if(window.event + "" == "undefined") event = null;
function HM_f_PopUp(){return false};
function HM_f_PopDown(){return false};
popUp = HM_f_PopUp;
popDown = HM_f_PopDown;
  
// Set default window status
window.defaultStatus = 'Stonewater Partners';

// Initialize global variables
var blnHomepage = false;

// Tab images cache
SpacerCache = new Image();
SpacerCache.src = "/graphics/spacer.gif";

// Include JS Date function for IR site
function MakeArray(n) {
	this.length = n
	return this
}

function customDateString(oneDate) {
	var theDay = dayNames[oneDate.getDay() + 1];
	var theMonth = monthNames[oneDate.getMonth() + 1];
	var theYear = oneDate.getFullYear();
	return theDay.substring(0,3).toUpperCase() + "  |  " + theMonth.toUpperCase() + " " + oneDate.getDate() + ", " + theYear;
}

monthNames = new MakeArray(12)
monthNames[1] = "January"
monthNames[2] = "February"
monthNames[3] = "March"
monthNames[4] = "April"
monthNames[5] = "May"
monthNames[6] = "June"
monthNames[7] = "July"
monthNames[8] = "August"
monthNames[9] = "September"
monthNames[10] = "October"
monthNames[11] = "November"
monthNames[12] = "December"

dayNames = new MakeArray(7)
dayNames[1] = "Sunday"
dayNames[2] = "Monday"
dayNames[3] = "Tuesday"
dayNames[4] = "Wednesday"
dayNames[5] = "Thursday"
dayNames[6] = "Friday"
dayNames[7] = "Saturday"

// Begin Global JS Functions
function DropdownChooser(Product) {
if (Product != "") {
window.location = Product;
		}
}

function SpawnWin(URL,W,H,Name) {
Spawned = window.open(URL,Name,"width="+W+",height="+H+",resizable=1,scrollbars='auto'");
setTimeout("Spawned.window.focus()",500);
}

function Hilite(ThisID) {
		ThisImage = ThisID;
	    document.images[ThisImage].src = document.images[ThisImage].src.substring(0, document.images[ThisImage].src.lastIndexOf('.') - 4) + "_on.gif";
}

function UnHilite(ThisID) {
		ThisImage = ThisID;
	    document.images[ThisImage].src = document.images[ThisImage].src.substring(0, document.images[ThisImage].src.lastIndexOf('.') - 3) + "_off.gif";
}

function ToggleMenuVisibility(myid){
	// Toggle DIV visibility and switch plus sign, disabled for NS4
	if ((HM_IE) || (HM_DOM)) {
		// Explorer
		if (HM_IE){
			ThisDIV = document.all["LeftNav_" + myid];
			ThisExp = document.all["LeftNavExp_" + myid];
		}
		// DOM Browsers
		else if (HM_DOM) {
			ThisDIV = document.getElementById("LeftNav_" + myid);
			ThisExp = document.getElementById("LeftNavExp_" + myid);
		}
		// If hidden, show
		if (ThisDIV.style.display == "none") {
			ThisDIV.style.display = "block";
			ThisExp.src = "/graphics/Template/DIVExpander_minus.gif";
		}
		// If showing, hide
		else {
			ThisDIV.style.display = "none";
			ThisExp.src = "/graphics/Template/DIVExpander_plus.gif";
		}
	}
}

function TriggerFlash() {
var args = TriggerFlash.arguments;
	for (x = 0; x < args.length; x++) {
		Root = eval("window." + args[x]);
		if (Root) {
			Root.Play();
		}
	}
}
