/******************************************
--  This site was designed and implemented by Miller Systems.
--  (c) Copyright 2003.  All rights reserved.
--  http://www.millersystems.com
--  Miller Systems, Inc. Boston MA 02116
******************************************/

var arPreloadedImg = new Array();
var initialized = false;
var isDOM = (document.getElementById)?true:false;
var isGecko = (navigator.userAgent.indexOf("Gecko")!=-1)?true:false;
var isIE = (document.all)?true:false;

///////////////////////
// init()
//////////////////////
function init() {
	if ((parent.frames.length != 0) && (self.location.href.indexOf("phcadmin")==-1)) top.location.href = self.location.href;	

	initialized = true;
}

window.onload = init;

///////////////////////
// preloadImage()
//////////////////////
function preloadImage(label,source) {
	arPreloadedImg[label] = new Image;
	arPreloadedImg[label].src = source;
}

///////////////////////
// swapImage()
// - used to swap a named image's src attribute for another
// - arguments - unlimited number of image name/source pairs
// - example - swapImage("foo","/bin_web/images/foo.gif")
///////////////////////
function swapImage() {
	if (!initialized) return;

	if (document.images) {
		for(var i=0;i<arguments.length;i++) {
			document.images[arguments[i]].src = arguments[i+1];
			++i;
		}
	}
}

///////////////////////
// reloadPage()
// - reloads page on resize to reset image spacer height
///////////////////////
function reloadPage() {
	setTimeout("window.location.reload(0)",500);
}
window.onresize = reloadPage;

///////////////////////
// getDocumentHeight()
// - returns height of document window
///////////////////////
function getDocumentHeight() {
	var h = (isIE)?document.body.offsetHeight - 6:(isGecko)?window.innerHeight:1;
	return h;
}

