<!--
var bLoaded=false;

function init() {
	if (document.getElementById && document.createTextNode) {
		//_hideSideNotes("span");
		//_hideSideNotes("div");
		//_hideSideNotes("li");
		_initPopups();
	}
	bLoaded = true;
}

function _hideSideNotes(tag) {
	var tags = document.getElementsByTagName(tag);
	for (var i=0;i<tags.length;i++)
	{
		var el = tags[i];
		if (el.className == 'noteInline') {
			_Toggle(el);
		}
		else if (el.className == 'noteBlock') {
			_Toggle(el.parentNode);
		}
	}
}

/**
 * Show and hide functions ... do we need both parts (Hide + HideText) here?
 *
 */
 
function Page_HideSideNote(id) {
	_Hide(document.getElementById(id));
	_HideText(document.getElementById("expand" + id), '&laquo;', '&raquo;');
	return false;
}
function _Hide(el) { 
	if (el) { el.style.display = 'none'; } 
}
function _HideText(el, textOn, textOff){
	if (el) { el.innerHTML = textOff; }
}

function Page_ShowSideNote(id) {
	_Show(document.getElementById(id));
	_ShowText(document.getElementById("expand" + id), '&laquo;', '&raquo;');
	return false;
}
function _Show(el) {
	if (el) { el.style.display = 'inline'; }
}

function _ShowText(el, textOn, textOff){
	if (el) { el.innerHTML = textOn; }
}


function Page_ToggleSideNote(id) {
	_Toggle(document.getElementById(id));
	_ToggleText(document.getElementById("expand" + id), '&laquo;', '&raquo;');
	return false;
}

function _Toggle(el){
	if (el) { el.style.display = (el.style.display == 'none') ? 'inline' : 'none'; }
}

function _ToggleText(el, textOn, textOff){
	if (el) { el.innerHTML = (el.innerHTML == '»') ? textOn : textOff; }
}



var sideNoteTitle = 'Click to display or hide additional information';
function Page_SideNoteOver(el) {
	el.className = 'noteHighlightOn';
	window.status = sideNoteTitle;
	el.title = sideNoteTitle 
}

function Page_SideNoteOut(el) {
	el.className = 'noteHighlightOff';
	window.status = '';
}


var sAltLinks = 'Note, if the above link has <span style=\"cursor: help; border-bottom-style: dotted; border-bottom-width: 1px; border-bottom-color: Gray;\" title=\"Links to external sites are beyond my control and may occassionally expire.\">expired</span>, please try the following alternative'

function _initPopups() {
	var divs = document.getElementsByTagName("div");
	for (var i=0; i<divs.length; i++) {
		var div = divs[i];
		if (div.className == 'popupBox') {
			ps = div.getElementsByTagName("p");
			for (var j=0; j<ps.length; j++) {
				var p = ps[j];
				if (p.className == 'actual') p.innerHTML = 'The link you selected would take you to';
				else if (p.className == 'alt') p.innerHTML = sAltLinks;
				else if (p.className == 'alts') p.innerHTML = sAltLinks + ' locations';
				else if (p.className == 'popup-continue') p.innerHTML = '<strong>Click on a link to continue<br/>Or, click anywhere else on this box to close it.</strong>';
			}
		}
	}
}

function Page_ShowPopup(event, el, topPos) {
	if (el.blur) {
		el.blur();
	}

	var position = topPos ? 50 : 200;
	var divToDisplay = document.getElementById(el.id + "Text");
	divToDisplay.style.visibility = "visible";

	x = _GetPageOffsetLeft(el);
	y = _GetPageOffsetTop(el) + el.offsetHeight;
	
//	divToDisplay.style.left = x + "px";
	divToDisplay.style.left = "200px";
	divToDisplay.style.top  = (y - position) + "px";
	divToDisplay.style.visibility = "visible";

	return _returnEvent(event);
}

function _returnEvent(event) {
	if (navigator.appName == "Microsoft Internet Explorer") {
		window.event.cancelBubble = true;
	}
	else {
		event.stopPropagation();
	}
	return false;
}

function Page_HidePopup(el) {
	el.style.visibility = "hidden";
}

// Return the x coordinate of an element relative to the page.
function _GetPageOffsetLeft(el) {		
	var x = el.offsetLeft;
	if (el.offsetParent != null) {
		x += _GetPageOffsetLeft(el.offsetParent);
	}
	return x;
}

// Return the x coordinate of an element relative to the page.
function _GetPageOffsetTop(el) {
	var y = el.offsetTop;
	if (el.offsetParent != null) {
		y += _GetPageOffsetTop(el.offsetParent);
	}	
	return y;
}

function Page_ShowUpdate(event, sDate) {
	if (document.getElementsByTagName) {
		var insTags = document.getElementsByTagName("ins");
		for (var i = 0; i < insTags.length; i++) {
			var curr = insTags[i];
			var datetime = curr.datetime ? curr.datetime : curr.dateTime; // IE 5.x uses all lowercase
			curr.className = (datetime == sDate || sDate == 'all') ? "ins-on" : "ins-off";
		}
		Page_HidePopup(document.getElementById("last-updatedText"));
	}
	return _returnEvent(event);
}
// -->
