<!--

// Common functions

// A dummy function in case I want a call to do absolutely NOTHING
function justDoNothing() {
// This function really does do nothing!
}

// Preload images that may be swapped in/out while page is viewed
// Call from the BODY tag's "onLoad" event
// Arguments are strings of any full file/path names of images needing preloading, comma delimited
function ssolePreloadImages() {
	if (document.images) {
    var numImages = ssolePreloadImages.arguments.length;
    var imgURL = new Array(numImages);
		for (i=0; i<numImages; i+=1) {
      imgURL[i] = new Image();
      imgURL[i].src = ssolePreloadImages.arguments[i];
		}
	}
}

// Spawn a new window, with options
// args = URL, name of window, location x, location y, width, height, and type of window
// types: noFrills, withNav, solidSize, default
function ssoleSpawn(url, winName, winX, winY, winWidth, winHeight, winType){
  switch (winType) {
    case "noFrills":
      winTypeString = "menubar=0,location=0,resizable=1,scrollbars=1,status=0,titlebar=0,toolbar=0"
      break
    case "withNav":
      winTypeString = "menubar=1,location=1,resizable=1,scrollbars=1,status=1,titlebar=1,toolbar=1"
      break
    case "solidSize":
      winTypeString = "menubar=0,location=0,resizable=0,scrollbars=1,status=0,titlebar=0,toolbar=0"
      break
    default:
      winTypeString = "menubar=0,location=1,resizable=1,scrollbars=1,status=1,titlebar=0,toolbar=0"
  }
  window.open(url,winName,"width=" + winWidth + ",height=" + winHeight + "," + winTypeString +",left=" + winX + ",top=" + winY + ",screenX=" + winX + ",screenY=" + winY)
}

// simply go back one page
function ssoleBack(){
  if (navigator.appName == "Microsoft Internet Explorer"){
    history.back();
  } else {
    window.back();
  }
}

// swap images on an event, indefinite num of args
// args follow pattern: name of image, new image url to switch to, name, url, name, url, ...
// url MUST BE FULL URL (relative or definite), not just filename
function ssoleImgSwap() {
	if (document.images) {
		for (i=0; i<ssoleImgSwap.arguments.length; i+=2) {
			document[ssoleImgSwap.arguments[i]].src = ssoleImgSwap.arguments[i+1];
		}
	}
}

//----------------------------------

// determine the present year
// write into the document the copyright-eligible years from FirstYear (given argument) to present year
function doCopyrightYears(firstYear) {
  var now_time = new Date();

  var now_year = now_time.getYear();
  if (now_year < 2000)
    now_year = now_year + 1900;
  document.write (firstYear);
  if (now_year>firstYear)
    document.write ('-'+now_year+' ');
}


// --------------------------------------

//-->

