<!--
function addLoadEvent(func) {
  var oldonload = window.onload;
  if (typeof window.onload != 'function') {
    window.onload = func;
  } else {
    window.onload = function() {
      oldonload();
      func();
    }
  }
}

function childWindow(theURL) { //v2.0
	winHite = 434;
	winWith = 648;
	col = (screen.width-winWith) / 2;
	row = (screen.height-winHite) / 2;
	window.focus();
	window.open(theURL,'contact','toolbar=0,location=0,status=0,menubar=1,scrollbars=1,resizable=1,width='+winWith+',height='+winHite+',left='+col+',top='+row);
}

function viewport() {
	var vp = new Array();

// the more standards compliant browsers (mozilla/netscape/opera/IE7) use window.innerWidth and window.innerHeight
	if (typeof window.innerWidth != 'undefined')
	{
		vp[0] = window.innerWidth,
		vp[1] = window.innerHeight
	}

// IE6 in standards compliant mode (i.e. with a valid doctype as the first line in the document)
	else if (typeof document.documentElement != 'undefined'
		&& typeof document.documentElement.clientWidth != 'undefined' 
		&& document.documentElement.clientWidth != 0)
	{
  		vp[0] = document.documentElement.clientWidth,
  		vp[1] = document.documentElement.clientHeight
	}

 // older versions of IE
	else
	{
		vp[0] = document.getElementsByTagName('body')[0].clientWidth,
		vp[1] = document.getElementsByTagName('body')[0].clientHeight
	}
	return vp;
}

function fsWindow(theURL, picHite) { //v2.0
	winWith = 650;
	vp = viewport();
	col = (vp[0]-winWith)/2;
	winHite = Math.min(picHite+230,vp[1]*1.03);
	row = (vp[1]-winHite)*1.5/5;
	window.focus();
	window.open(theURL,'contact','toolbar=0,location=0,status=0,menubar=1,scrollbars=1,resizable=1,width='+winWith+',height='+winHite+',left='+col+',top='+row);
}

function glosWindow(theURL)	{
	window.focus();
	var glosWin = window.open(theURL,'glossary','dependent=1,resizable=1,scrollbars=1,width=335,height=465');
	glosWin.window.focus();
}

function featureWindow(theURL) {
	var winWith = 520;
	var winHite = 500;
	var vp = viewport();
	var col = Math.max((vp[0]-winWith)/2,0);
	var row = Math.max((vp[1]-winHite)*1.5/5,0);
	if(!theURL) theURL = 'feature/feature.htm';
	var featWin = window.open(theURL,'feature','dependent=0,resizable=1,scrollbars=1,width=520,height=465,left='+col+',top='+row);
	featWin.window.focus();
}

/* Popup Windows - height and width passed in */
function popWin(theURL,theID,theWidth,theHeight) {
	window.focus();
	var theSpecs = "'dependent=1,resizable=1,scrollbars=1,width=" + theWidth + ",height=" + theHeight + "'";
	var winPop = window.open(theURL,theID,theSpecs);
	winPop.window.focus();
}

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";
	}
}

function setHand() {
	if(elm = document.getElementById("lnkHome")) elm.style.cursor='hand';
}

delay=3000;thum=12;last=0;
function chgThum() {
	do{rand=Math.floor(Math.random()*11)+1;}
	while(rand == last);
	img = document.getElementById('img'+rand);
	src = 'images/bite-sized/'+imagearray[thum++];
	img.src = src;last = rand;
	if(thum == imagearray.length) thum = 1;
	setTimeout("chgThum()",delay);
}

function init() {
	externalLinks();
	setHand();
//	if(window.imagearray) setTimeout("chgThum()",delay);
	window.focus();
}
window.onload = init;

//-->
