function goRoll()
{
	if (document.getElementById && document.createTextNode)
	{
		var goimg=document.getElementById ('goImg');
		if (goimg) 
		{
			goimg.onmouseover=function(){goimg.src="images/go_btn_ON.jpg";return false}
			goimg.onmouseout=function(){goimg.src="images/go_btn_OFF.jpg";return false}
		}
	}	
}

function preloadGo()
{
	var dontcare = new Image();
	dontcare.src="images/go_btn_ON.jpg";
}

function addpopups() 
{
	if (document.getElementById && document.createTextNode)
	{
		var atags = document.getElementsByTagName ('a');
		for (var i=0;i<atags.length;i++)
		{
			if (atags[i].getAttribute('target') && atags[i].getAttribute('target')=='popup') 
			{
				atags[i].onclick = winpop;
			}
		}
	}
}

function winpop ()
{
	var target=this.href;
	var scr="no";
	var wwidth=600;	// window width
	if (target.indexOf('events') !=-1) 
	{
		scr="yes";
		wwidth = wwidth + 15	// add space for the scrollbar
	}
	
	var newwin = window.open(target, "winpop", ("width="+wwidth+", height=600, resizable=no, status=no, toolbar=no, menubar=no, scrollbars="+scr));
	newwin.focus();
	return false;
}

window.onload = function()
  {
  	preloadGo();
    goRoll();
	addpopups();
  }
  
  
  
/* This adds the function to the body tag to make sure the nav is not longer 
	than the content */

function addLoadEvent(func) {
  var oldonload = window.onload;
  if (typeof window.onload != 'function') {
    window.onload = func;
  } else {
    window.onload = function() {
      oldonload();
      func();
    }
  }
}

function clickablePicLink() 
{
	if (document.getElementById && document.createTextNode)
	{
		var atags = document.getElementsByTagName ('a');
		for (var i=0;i<atags.length;i++)
		{
			if (atags[i].getAttribute('target') && atags[i].getAttribute('target')=='_self') 
			{
				atags[i].onclick = selfpop;
			}
		}
	}
}

function selfpop ()
{
	var target=this.href;
	location.href = target;
	return false;
}


addLoadEvent(clickablePicLink); 

 
  