/* Anchor Highlight - Colorize defined DIV area for anchors including direct jumps from other pages -
following needs to be defined in stylesheet (modify as necessary):
.faq:target, .sftarget {
	background-color: #eeeef7;
	border: 4px dotted #ffffff;
	position: relative;
	top: -2px;
	padding: 0 1em;
}

define a DIV to highlight where "t1" for example is the anchor name like this:
<div id="t1" class="faq">
---
RHackenberg (GOULD) - 03082007
(original code from http://www.htmldog.com/)
*/
function xzone9_hilite(type, tag, parentId) {
	if (window.attachEvent) {
		window.attachEvent("onload", function() {
			var sfEls = (parentId==null)?document.getElementsByTagName(tag):document.getElementById(parentId).getElementsByTagName(tag);
			type(sfEls);
		});
	}
}

sfTarget = function(sfEls) {
	var aEls = document.getElementsByTagName("A");
	document.lastTarget = null;
	for (var i=0; i<sfEls.length; i++) {
		if (sfEls[i].id) {
			if (location.hash==("#" + sfEls[i].id)) {
				sfEls[i].className+=" sftarget";
				document.lastTarget=sfEls[i];
			}
			for (var j=0; j<aEls.length; j++) {
				if (aEls[j].hash==("#" + sfEls[i].id)) {
					aEls[j].targetEl = sfEls[i];
					aEls[j].onclick = function() {
						if (document.lastTarget) document.lastTarget.className = document.lastTarget.className.replace(new RegExp(" sftarget\\b"), "");
						this.targetEl.className+=" sftarget";
						document.lastTarget=this.targetEl;
						return true;
					}
				}
			}
		}
	}
}
xzone9_hilite(sfTarget, "DIV", "main");
