// Author: Dewayne Debbs
// Date 6/13/2007
// If a #content div is longer than x pixels, create a "back to top" link.
function backToTops() {
  var c=document.getElementById("content");
  var s=document.getElementById("smallcontent");
  if (c && c.offsetHeight>400 && !s) {
  	var link = document.createElement('a');
		link.setAttribute('href', '#top');
		link.setAttribute('class', 'toplink');
		link.setAttribute('className', 'toplink');
		link.innerHTML = 'Top';
		c.appendChild(link);
  }
}

// Author: Dewayne Debbs
// Date: 05/26/2006
// Changes all links with target=_blank to use javascript
function modifyPopups() {
	var a=document.getElementsByTagName("a");
	for(var i=0;i<a.length;i++){
	  if (a[i].target.toLowerCase()=="_blank") {
		a[i].onclick = popUp;
	  }
	}
}

function popUp() {
	var newWindow = window.open(this.getAttribute('href'), '', 'toolbar=1,scrollbars=1,location=1,statusbar=1,menubar=1,resizable=1,left = 20,top = 20');
	newWindow.focus();
	return false;
}

function startup(){
  modifyPopups();
  backToTops();
}


window.onload = startup;




