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


/* replacement for _blank target -- use: rel="external" to activate */
function externalLinks() 
{ 
	if (!document.getElementsByTagName) return; 
	var anchors = document.getElementsByTagName("a"); 
	for (var i=0; i<anchors.length; i++) 
	{
		var anchor = anchors[i]; 
		if (anchor.getAttribute("href") &&  anchor.getAttribute("rel") == "external") anchor.target = "_blank"; 
	}
}

/* generic popup window script */
function newWin(i_url, i_name, i_width, i_height, i_y, i_x, i_scroll, i_resizeable)
{
	// center the window
	i_x = (screen.width - i_width) / 2; 
	i_y = (screen.height - i_height) / 2;
	
	// pass in the rest of the goodies 
	params = 'height='+ i_height +', width='+ i_width +', top='+ i_y +', left='+ i_x +', scrollbars='+ i_scroll +', resizable='+ i_resizeable +',status=0,location=0';
    window.open(i_url, i_name, params);
}


/* slipform flv popup window */
function flvWindow()
{
	document.getElementById("slipFormWin").onclick = function()
	{
		this.href = "javascript:void(0)"; // kill the normal url clicky action
		newWin("/flv.asp", "slipform", 616, 533);
	
	}	
}


/* fire events when DOM is ready */
addLoadEvent(externalLinks);
addLoadEvent(flvWindow);
