// Timeout ID for rollover menus
var tID;

window.onload = function() {
	
	// Look for tables and shade alternating rows
	// Only apply shading to tables in this class
	var targetClass = "altRows";
	
	// Shade table headings? (the <th> tag)
	var includeHeadings = false;
	
	// Color definitions
	var evenColor = "#fff";
	var oddColor = "#eee";
	
	var tables = document.getElementsByTagName("table");
	
	for (var i=0; i<tables.length; i++) {
		if (tables[i].className == targetClass) {
			var tbody = tables[i].firstChild;
			if (tbody.hasChildNodes()) {
				for (j=0; j<tbody.childNodes.length; j++) {
					var tr = tbody.childNodes[j];
					if (tr.nodeName.toLowerCase() == "tr") {
						for (k=0; k<tr.childNodes.length; k++) {
							var td = tr.childNodes[k];
							if (td.nodeName.toLowerCase() == "td" || (includeHeadings && td.nodeName.toLowerCase() == "th")) {
								td.style.background = j/2 == parseInt((j/2).toString()) ? evenColor : oddColor;
							}
						}
					}
				}
			}
		}
	}
	
	if (document.getElementById) {
		var nav = document.getElementById("leftNav");
		for (var i=0; i<nav.childNodes.length; i++) {
			node = nav.childNodes[i];
			if (node.nodeName.toLowerCase() == "li") {
				node.onmouseover = function() {
					this.className = this.className ? this.className : "over";
					clearTimeout(tID);
					with (this.parentNode) {
						for (var d=0; d<childNodes.length; d++) {
							if (childNodes[d].nodeName.toLowerCase() == "li" && childNodes[d] != this) {
								childNodes[d].className = childNodes[d].className == "current" ? "current" : "";
							}
						}
					}
				}
	  			node.onmouseout = function() {
					target = this;
	  				tID = setTimeout("target.className = target.className == 'current' ? 'current' : ''",500);
				}
			}
		}
	}
}

// Function to show disclaimer for external links
function disclaimer(url) {
	var legalText="NOTICE: Thank you for visiting The First State Bank of Fountain. You are now leaving The First State Bank of Fountain Website and being transferred to a third party website that is not affiliated with The First State Bank of Fountain and may have different privacy policies. The First State Bank of Fountain is not responsible for the content of any linked site, or have control over the content on any linked site. The inclusion of a link does not imply or constitute an endorsement by The First State Bank of Fountain, its ownership or management, the products or services it offers, or any advertisers or sponsors appearing on the linked sites. Please click on OK to continue or CANCEL to return to the previous page.";
	var openWin = window.confirm(legalText) ? window.open(url,"_blank") : null;
}
function securityNotice(url) {
	var legalText="NOTICE: The First State Bank of Fountain will never ask you to send non-public private information through e-mail, such as PIN numbers, Social Security numbers, or account numbers.  Please do not respond to any e-mails requesting this type of information.";
	var openWin = window.confirm(legalText) ? null : null;
}