<!--
var strImagePath = "iB-images/";
var strImageExt = ".jpg";

var strPage = document.location.href;
	if ((strPage.lastIndexOf("/")+1 == strPage.length) || (strPage.indexOf("default.asp") > 0)) {
		strPage = "btn_home";
	} else {
		if (strPage.toLowerCase().indexOf("/ib-admin/") > 0) {
			strPage = strPage.substring(strPage.lastIndexOf("/")+1,strPage.lastIndexOf(".")).replace("adm_","btn_");
		} else {
			strPage = "btn_" + strPage.substring(strPage.lastIndexOf("/")+1,strPage.lastIndexOf("."));
		}
		if (strPage == "btn_blog_buttonbar") { strPage = "btn_blog_iblog"; }
	}

<!-- define rollover function to replace images
function rollover(strButton,intChange) {
//	var strPage = getCookie("strPage");
	var text = (intChange == 1) ? "" : arrDisplays[strButton];

	//window.status = text;
	if (ok()) {
   		if (strPage != strButton) {
 			document.images[strButton].src = strImagePath + strButton + "_" + intChange + strImageExt;
   		}
	}
}

<!-- define select function to set button as selected when user clicks it
function select(strButton,strSection) {
//	var strPage = getCookie("strPage");
	var pageURL = (strButton.indexOf(".asp") >= 0) ? strButton : arrPages[strButton];
	var target = (strButton.indexOf("btn_blog") >= 0) ? "_top" : "_self";
	var text = arrDisplays[strButton];

	//window.status = text;
	if (ok() && strButton != "btn_iblog") {
		if ((document.images[strPage]) && (strPage != "null") && (strPage != "") && (strPage != arrButtons[0])) {
			document.images[strPage].src = strImagePath + strPage + "_1" + strImageExt;
		}

		if ((document.images[strButton]) && (strButton != arrButtons[0])) {
			document.images[strButton].src = strImagePath + strButton + "_2" + strImageExt;
		}
	}

	if (strSection) {
		if (strButton == "btn_products") {
			pageURL += "?tab=" + strSection;
		} else {
			pageURL += "#" + strSection;
		}
	}

	window.open(pageURL,target);
//	document.cookie = "strPage=" + strButton + "";
//	document.cookie = "strSection=null";
//	document.cookie = "strSubSection=null";
			
	display_buttons();
}

<!-- display appropriate buttons based on current location within site
function display_buttons() {
//	var strPage;
	
	if (ok()) {
//		if (getArg("strPage") != "")
//			strPage = getArg("strPage");
//		else
//			strPage = getCookie("strPage");
		
//		if ((strPage == "") || (!arrPages[strPage])) {
//			strPage = arrButtons[0];
//			document.cookie = "strPage=" + arrButtons[0] + "";
//		}
//		if (getCookie("strSection") == "") {
//			document.cookie = "strSection=null";
//			document.cookie = "strSubSection=null";
//		}

		//reset all buttons to original up state
		for (i in arrButtons) {
			strButton = arrButtons[i];			
			if (document.images[strButton]) {
				document.images[strButton].src = strImagePath + strButton + "_1" + strImageExt;
			}
		}

		//set the current-page button to its down state
		if ((document.images[strPage])) {
	    		document.images[strPage].src = strImagePath + strPage + "_2" + strImageExt;
		}
	}
}

<!-- define cache_images function to load rollover images into cache
function cache_images() {
	var num_states = 2;
	var num_buttons = arrButtons.length;
	cached_images = new Array(num_buttons * num_states);

	for (var i=0; i<num_buttons; i++) {
		for (var j=1; j<=num_states; j++) {
			intImage =  (j + (num_states * (i - 1)));
			cached_images[intImage] = new Image();
			cached_images[intImage].src = strImagePath + arrButtons[i] + "_" + j + strImageExt;
		}
	}	
}
