function roll(direction, id) {
	if (direction == "over") {
		document.getElementById(id).src = "images/nav/"+id+"_roll.gif";
	} else if (direction == "out") {
		document.getElementById(id).src = "images/nav/"+id+".gif";
	} else {
		window.alert("Rollover direction not specified for "+id);	
	}
}
function preload(){
	var overStates = new Array;
	for (i=0;i<preload.arguments.length;i++) {
		overStates[i] = new Image;
		overStates[i].src = "images/nav/"+preload.arguments[i]+"_roll.gif";
	}
}

function setSize() {
	if (navigator.appName.indexOf("Microsoft")!=-1){
		var windowWidth = popupWindow.document.body.clientWidth;
		var windowHeight = popupWindow.document.body.clientHeight;
	} else {
		var windowWidth = popupWindow.outerWidth;
		var windowHeight = popupWindow.outerHeight;
	}
	var left = (screen.width/2)-(windowWidth/2);
	var top = (screen.height/2)-(windowHeight/2);
	popupWindow.moveTo(left, top);
	popupWindow.focus();
}
function openPopup(page, height, width){
	popupWindow = window.open(page, 'popupWindow', 'channelmode=0,directories=0,fullscreen=0,location=0,menubar=0,resizable=0,scrollbars=1,status=0,titlebar=0,toolbar=0,personalbar=0,dependent=0,dialog=0,height='+height+',width='+width);
	if (navigator.appName.indexOf("Microsoft")!=-1){
		popupWindow.attachEvent("onload", setSize);
	} else {
		popupWindow.onload = function() {setSize();}
	}
} 
function toggleLayer(whichLayer)
{
  if (document.getElementById)
  {
      // this is the way the standards work
      var style2 = document.getElementById(whichLayer).style;
      style2.display = style2.display? "":"block";
  }
  else if (document.all)
  {
      // this is the way old msie versions work
      var style2 = document.all[whichLayer].style;
      style2.display = style2.display? "":"block";
  }
  else if (document.layers)
  {
      // this is the way nn4 works
      var style2 = document.layers[whichLayer].style;
      style2.display = style2.display? "":"block";
  }
}
/*
function openClosePanel(tableRow, sibling, defaultHeight)
{
	while (sibling.nodeType==3) { // Fix for Mozilla/FireFox Empty Space becomes a TextNode 
		sibling = sibling.nextSibling;
	};
	var myFx = new Fx.Tween(sibling);
	if (sibling.style.height == defaultHeight){
		var trueHeight = sibling.scrollHeight;
		myFx.start('height', trueHeight);
	}else{
		myFx.start('height', defaultHeight);
	}
}*/
function ChangeColor(tableRow, bgColor, highLight)
{
    if (highLight)
    {
    tableRow.style.backgroundColor = bgColor;
    tableRow.style.cursor = 'pointer';

    }
    else
    {
    tableRow.style.backgroundColor = bgColor;
    tableRow.style.cursor = 'default';
    }
}
function rowAltered(saveButtonID)
{
	document.getElementById(saveButtonID).src = "/_site/images/members/icons/save.gif";
}
function isNumberKey(evt)
{
   var charCode = (evt.which) ? evt.which : event.keyCode
   if (charCode > 31 && (charCode < 48 || charCode > 57))
      return false;

   return true;
}
