/******************************************************************
// global variable indicating that javascript is active
******************************************************************/
document.js = true;
/******************************************************************
// break frames
******************************************************************/
// if (top.location.hostname.indexOf('obdp.org') <= 0) {
	/* if (window != window.top) {
		top.location.replace(location.href);
	} */
/*	if (self != top && (typeof(bNoBreakFrm)=='undefined')) top.location.replace(location.href);
} */
/******************************************************************
// set focus on the current window
******************************************************************/
window.focus();
document.focus();
/******************************************************************
// functions to remove the focus border on links
******************************************************************/
function remove_focus() {
	if (document.links) {
		try {
			for (var i = 0; i < document.links.length; i++) {
				document.links[i].blur();
			}
		}
		catch(e) {}
	}
}
document.onClick = remove_focus();
function hideFocusBorders() {
	var theahrefs = document.getElementsByTagName("a");
	if (!theahrefs)	{
		return;
	}
	for(var x = 0; x != theahrefs.length; x++) {
		theahrefs[x].onfocus = function stopLinkFocus() {
			this.hideFocus = true;
		};
	}
}
/******************************************************************
// select menu links
******************************************************************/
function menuGo(select) {
	var loc = select.options[select.selectedIndex].value;
	if (loc != '#') {
		location = loc;
	}
	else {
		select.selectedIndex = 0;
	}
}
/******************************************************************
// manual pop-ups
******************************************************************/
var popWindow = '';
function popItUp(URL, Name, W, H) {
	popWindow = window.open(URL, Name, 'titlebar=1, toolbar=0, location=0, directories=0, status=1, menubar=0, scrollbars=1, resizable=1, width=' + W + ', height=' + H + ', top=10, left=10');
	if (popWindow.opener == null) {
		popWindow.opener = self;
	}
	if (window.focus) popWindow.focus();
}
/******************************************************************
// cookie crumb url map
******************************************************************/
var path = "";
var href = document.location.href;
var s = href.split("/");
for (var i = 2; i < (s.length - 1); i++) {
	path += "<a href=\"" + href.substring(0, href.indexOf(s[i]) + s[i].length) + "/\" title=\"Cookie Crumb Navigation\" onfocus=\"this.blur()\">" + s[i] + "</a>/";
}
i = s.length - 1;
path += "<a href=\"" + href.substring(0, href.indexOf(s[i]) + s[i].length) + "\" title=\"Cookie Crumb Navigation\" onfocus=\"this.blur()\">" + s[i] + "</a>";
var url = window.location.protocol + "//" + path;
function writeURL() {
	document.writeln(url);
}
/******************************************************************
// count characters on comments textarea field
******************************************************************/
function textCounter(field, countfield, maxlimit) {
	if (field.value.length > maxlimit)
		field.value = field.value.substring(0, maxlimit);
	else
		countfield.value = maxlimit - field.value.length;
}
/******************************************************************
// script for submenus - necessary for IE
// written by Patrick Griffiths and Dan Webb
// http://www.htmldog.com/articles/suckerfish/dropdowns/
******************************************************************/
sfHover = function() {
	var sfEls = document.getElementById("headerNav").getElementsByTagName("li");
	for (var i = 0; i < sfEls.length; i++) {
		sfEls[i].onmouseover = function() {
			this.className += " sfhover";
		}
		sfEls[i].onmouseout = function() {
			this.className = this.className.replace(new RegExp(" sfhover\\b"), "");
		}
	}
}
if (window.attachEvent) window.attachEvent("onload", sfHover);