// simple hide and show div functions 
// must supply DIV ID 
function hidediv(div_id) 
{
	document.getElementById(div_id).style.display = 'none';
}
function showdiv(div_id) 
{
	document.getElementById(div_id).style.display = 'block';
}

//display a random image
function displayRandomImage(arrImages, imgId)
{
  if(arrImages == null || arrImages.length <= 0)
      return;
      
  if(document.images)
    {
      var iRandomNumber = Math.floor((Math.random() * arrImages.length));
      
      //get the image element
      var img = document.getElementById(imgId);
      if(img == null)
        return;
      img.src = arrImages[iRandomNumber];
    }
}




// topnav hover function for IE

tnHover = function() {
	var topNav = document.getElementById("topnav");
	if (topNav == null) return;
	
	var tnEls = topNav.getElementsByTagName("LI");
	if (tnEls == null) return;
	
	for (var i=0; i<tnEls.length; i++) {
		tnEls[i].onmouseover=function() {
			this.className+=" tnhover";
		}
		tnEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" tnhover\\b"), "");
		}
	}
}
if (window.attachEvent) window.attachEvent("onload", tnHover);
