	var menuCount;

	function init() {
		mItems = document.images;
		for (i=0;i < mItems.length; i++) {
			if (mItems[i].getAttribute('srcb') != "") {
				mItems[i].parentNode.style.backgroundImage = 'url('+mItems[i].getAttribute('srcb')+')';
				mItems[i].parentNode.style.backgroundRepeat = 'no-repeat';
			}
		}
	}

	function selectService() {
		var dest = window.prompt("Service Required?");
		if (dest && dest != "undefined") {
			var s = "/?" + location + "," + dest;
			window.location = dest.split(",")[0] + s;
		}
	}

	function collapse() {
		mItems = document.body.getElementsByTagName("div");
		for (i=0;i<mItems.length;i++) {
			s = mItems[i].className.split(' ');
			if (s[0]=="menuentry") {
				mItems[i].style.display = 'none';
			}
		}
	}

	function getFilename() {
		s = document.location.href;
		n = s.lastIndexOf("/");
		return s.substr(n + 1);
	}
	
	function setMenuCount(strings) {
		menuCount = strings.split(",");
		s = getFilename();
// open menu section
		if (s == "index.shtml") {
			document.write("<style>.i1 {display: block}</style>");
		} else {
			document.write("<style>.i" + s.substr(0,1) + " {display: block}</style>");
		}
// mark selected link
		if (s != "index.shtml") {
			x = ".m" + s.substr(0,1) + s.substr(2,1);
			document.write("<style>" + x + " {color: white}</style>");
		}
	}

	function makeLinks() {
		if (getFilename() == "index.shtml") {
			document.write("<img class=\"left\" src=\"images/Fblank.gif\">");
			document.write("<img class=\"left\" src=\"images/Fblank.gif\">");
		} else {
			document.write("<img class=\"left\" src=\"images/Fhome.gif\" srcb=\"images/Bhome.gif\" onclick=\"navigate('home')\" onmousedown=\"off(this)\">");
			document.write("<img class=\"left\" src=\"images/Fprior.gif\" srcb=\"images/Bprior.gif\" onclick=\"navigate('prior')\" onmousedown=\"off(this)\">");
		}

		if (getFilename() == menuCount[0] + "$" + menuCount[menuCount.length - 1] + ".shtml") {
			document.write("<img class=\"left\" src=\"images/Fblank.gif\">");
			document.write("<img class=\"left\" src=\"images/Fblank.gif\">");
		} else {
			document.write("<img class=\"left\" src=\"images/Fnext.gif\" srcb=\"images/Bnext.gif\" onclick=\"navigate('next')\" onmousedown=\"off(this)\">");
			document.write("<img class=\"left\" src=\"images/Fend.gif\" srcb=\"images/Bend.gif\" onclick=\"navigate('end')\" onmousedown=\"off(this)\">");
		}
	}

	function getPrior() {
		fn = getFilename();
		if (fn == "1$1.shtml") {
			result = "index.shtml";
		} else {
			section = fn.substr(0,fn.indexOf("$"));
			entry = fn.substr(fn.indexOf("$") + 1,fn.indexOf(".") - fn.indexOf("$") - 1);
			if (entry > 1) {entry--;} 
			else {
				section--;
				entry = menuCount[section];
			}
			result = String(section) + "$" + String(entry) + ".shtml";
		}
		return result;
	}

	function getNext() {
		fn = getFilename();
		if (fn == "index.shtml") {
			result = "1$1.shtml";
		} else {
			section = fn.substr(0,fn.indexOf("$"));
			entry = fn.substr(fn.indexOf("$") + 1,fn.indexOf(".") - fn.indexOf("$") - 1);
			if (entry < menuCount[section]) {entry++;} 
			else {
				section++;
				entry = 1;
			}
			result = String(section) + "$" + entry + ".shtml";
		}
		return result;
	}

	function navigate(option) {
		if (option == "home") window.location="index.shtml";
		else if (option == "prior") window.location = getPrior();
		else if (option == "next") window.location = getNext();
		else if (option == "end") window.location = String(menuCount[0]) + '$' + String(menuCount[menuCount.length - 1]) + ".shtml";
	}

	function switchMenu(obj) {
		collapse();
		mText = obj.getElementsByTagName("div")[1];
		if (window.getComputedStyle) {
			s = window.getComputedStyle(mText,'div').display
		} else {
			s = mText.currentStyle.display
		}
	  	if (s != 'block') {
	  		mText.style.display = 'block';
	  	} else {
		  	mText.style.display = 'none';
		}
	}

	function getOpacity(objId) {
		obj = document.getElementById(objId);
  // Safari 1.2, newer Firefox and Mozilla, CSS3
		if (typeof(obj.style.opacity)!="undefined") {
			result = obj.style.opacity;
			if (result == '') result = 1;
			result = result * 100;
		}
  // IE/Win
		if (typeof(obj.style.filter)!="undefined") {
			result = obj.style.filter;
			if (result != '') {result = result.substr(14,result.length - 15);}
			if (result == '') result = 100;
		}
  // Safari<1.2, Konqueror
		if (typeof(obj.style.KHTMLOpacity)!="undefined") {
			result = obj.style.KHTMLOpacity;
			if (result == '') result = 1;
			result = result * 100;
		}
  // Older Mozilla and Firefox
		if (typeof(obj.style.MozOpacity)!="undefined") {
			result = obj.style.MozOpacity;
			if (result == '') result = 1;
			result = result * 100;
		}
		return result;
	}

	function setOpacity(objId,value) {
		if (value < 0) value = 0;
		if (value > 100) value = 100;
		obj = document.getElementById(objId);
  // Safari 1.2, newer Firefox and Mozilla, CSS3
		if (typeof(obj.style.opacity)!="undefined") obj.style.opacity = value / 100;
  // IE/Win
		if (typeof(obj.style.filter)!="undefined") obj.style.filter = "alpha(opacity:" + value + ")"
  // Safari<1.2, Konqueror
		if (typeof(obj.style.KHTMLOpacity)!="undefined") obj.style.KHTMLOpacity = value / 100;
  // Older Mozilla and Firefox
		if (typeof(obj.style.MozOpacity)!="undefined") obj.style.MozOpacity = value / 100;
	}

	var frameInterval = 40	// interval between effects frames in millisecs.  Fixed at 25 fps

	function changeOpacity(objId, opacity) {
		obj = document.getElementById(objId);
      Op = getOpacity(objId) * 1 + opacity * 1;
      setOpacity(objId,Op)
      if (Op >= 0 && Op <= 100) {
			obj.timerID = window.setTimeout("changeOpacity('" + objId + "', " + opacity + ")",frameInterval)
		} else obj.timerID = 0;
	}

	function fover(iid, frameCount) {
		if (iid.timerID != 0) window.clearTimeout(iid.timerID);
		iid.timerID = window.setTimeout("changeOpacity('" + iid.id + "', " + -1 * (100 / frameCount) + ")",frameInterval)
	}

	function fout(iid, frameCount) {
		if (iid.timerID != 0) window.clearTimeout(iid.timerID);
		iid.timerID = window.setTimeout("changeOpacity('" + iid.id + "', " + 100 / frameCount+")",frameInterval)
	}

	function off(obj) {
		s = obj.src;
		obj.src = obj.getAttribute('srcb');
		obj.setAttribute('srcb',s);
	}

	function locate(id,imgsrc) {
		obj = document.getElementById(id);
		obj.src = imgsrc;
		obj.title="click to hide image";
	}

	function makeImage(mode,pos,bg,fg) {
		switch (mode) {
			case 0: // switch in & out
				document.write(
					"<img class=\"" + pos + "\" src=\"images/" + fg + "\" srcb=\"images/" + bg
					+ "\" onmouseover=\"off(this)\" onmouseout=\"off(this)\">"
				);
				break;
			case 200: // segmented fade
				document.write(
					"<span class=\"" + pos + "\"> " + "<img id=\"ID" + bg.substr(4,3) + "\" src=\"images/" + fg
					+ "\" srcb=\"images/" + bg
					+ "\" onmouseover=\"fover(this,5)\" onmouseout=\"fout(this,300)\"> " + "</span>"
				);
				break;
			default: // fade in & out mode = framecount
				document.write(
					"<span class=\"" + pos + "\"> " + "<img id=\"ID" + bg.substr(4,3) + "\" src=\"images/" + fg
					+ "\" srcb=\"images/" + bg
					+ "\" onmouseover=\"fover(this," + mode + ")\" onmouseout=\"fout(this," + mode + ")\"> " + "</span>"
				);
		}
	}












