/* --------------------------------------------------- */
/* name:     j5utilities.js                            */
/* author:   J5 Development                            */
/* purpose:  javascript utility functions              */
/* --------------------------------------------------- */

/* image rollover functions */
function imgOn(imgName) {
  if (document.images) {
    document[imgName].src = eval(imgName + "On.src");
  }
}
function imgOff(imgName) {
  if (document.images) {
    document[imgName].src = eval(imgName + "Off.src");
  }
}

/* image display functions */
function showZoom(elementID) {
	if (document.getElementById) {
		content = document.getElementById(elementID).style;
		content.visibility = "visible";
	}
}
function hideZoom(elementID) {
	if (document.getElementById) {
		content = document.getElementById(elementID).style;
		content.visibility = "hidden";
	}
}

/* page through multi-page list display */
function getPage(formName,number) { 
  thisForm = eval("document." + formName);
  thisForm.pageNum.value = number;
  thisForm.submit(); 
}

/* open new browser window with no controls */
function popWindow(url, width, height, windowName) {
  /* defaults if not passed to function */
  if (!width) { width = 600; }
  if (!height) { height = 450; }
  if (!windowName) { windowName = "J5pop"; }
  wref = window.open (url, windowName,
        "toolbar=no,location=no,width=" + width + ",height=" + height +
        ",directories=no,status=no,scrollbars=no,resizable=no,menubar=no");
  if (navigator.appName == "Netscape" || navigator.appVersion.substring(0,1) == '5') {
    wref.focus();
  }
}

/* open new browser window with full controls */
function newWindow(url, width, height, windowName) {
  /* defaults if not passed to function */
  if (!width) { width = 800; }
  if (!height) { height = 600; }
  if (!windowName) { windowName = "J5new"; }
  wref = window.open (url, windowName,
        "toolbar=yes,location=yes,width=" + width + ",height=" + height +
        ",directories=yes,status=yes,scrollbars=yes,resizable=yes,menubar=yes");
  if (navigator.appName == "Netscape" || navigator.appVersion.substring(0,1) == '5') {
    wref.focus();
  }
}
