function checkAnchorInsideToggle() {
	var anchor = "";
	var anchorName = "";
	if (location.href.lastIndexOf("#") != -1) {
		anchorName = location.href.substring(location.href.lastIndexOf("#")+1, location.href.length);
	}

	if (anchorName) {
		var anchorElements = document.getElementsByTagName("a");
		var theAnchorElement = null;
		for (var i = 0; i < anchorElements.length; i++) {
			if (anchorName == anchorElements[i].name) {
				theAnchorElement = anchorElements[i];
			}
		}

		var theParent = theAnchorElement.parentNode;
		while(theParent) {
			if ( (theParent.tagName == "TABLE") && (theParent.id.lastIndexOf("TOGGLE") === 0) ) {
				HMToggle('toggle',theParent.id,'$' + theParent.id + '_ICON');
			}
			theParent = theParent.parentNode;
		}
		window.setTimeout("location.hash = '" + anchorName + "'", 250);
	}
}


function addEvent( obj, type, fn )
{
	if (obj.addEventListener)
		obj.addEventListener( type, fn, false );
	else if (obj.attachEvent)
	{
		obj["e"+type+fn] = fn;
		obj[type+fn] = function() { obj["e"+type+fn]( window.event ); }
		obj.attachEvent( "on"+type, obj[type+fn] );
	}
}

addEvent(window, "load", checkAnchorInsideToggle);

