/******************************************
--  This site was designed and implemented by Miller Systems.
--  (c) Copyright 2002.  All rights reserved.
--  http://www.millersystems.com
--  Miller Systems, Inc. Boston MA 02116
******************************************/

var arPreloadedImages = new Array();
var initialized = false;

///////////////////////
// init()
//////////////////////
function init() {
	preloadImage("btn_about","/images/home/btn_about.gif");
	preloadImage("btn_about_hl","/images/home/btn_about_hl.gif");
	preloadImage("btn_our","/images/home/btn_our.gif");
	preloadImage("btn_our_hl","/images/home/btn_our_hl.gif");
	preloadImage("btn_oncology","/images/home/btn_oncology.gif");
	preloadImage("btn_oncology_hl","/images/home/btn_oncology_hl.gif");
	preloadImage("btn_eirb","/images/home/btn_eirb.gif");
	preloadImage("btn_eirb_hl","/images/home/btn_eirb_hl.gif");
	preloadImage("btn_hippa","/images/home/btn_hippa.gif");
	preloadImage("btn_hippa_hl","/images/home/btn_hippa_hl.gif");
	preloadImage("btn_forms","/images/home/btn_forms.gif");
	preloadImage("btn_forms_hl","/images/home/btn_forms_hl.gif");
	preloadImage("btn_contact","/images/home/btn_contact.gif");
	preloadImage("btn_contact_hl","/images/home/btn_contact_hl.gif");
	
	initialized = true;
}

window.onload = init;

///////////////////////
// preloadImage()
//////////////////////
function preloadImage(label,source) {
	arPreloadedImages[label] = new Image;
	arPreloadedImages[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","/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;
		}
	}
}

// * - fixes an issue with Netscape 4.x browsers
//   - when a user resized the browser, absolute positioning would be lost
// * - document information will be lost if not saved

if (document.layers) {
	origWinWidth = window.innerWidth;
	origWinHeight = window.innerHeight;
	
	window.onresize = function() {
		currWinWidth = window.innerWidth;
		currWinHeight = window.innerHeight;
		if((origWinWidth != currWinWidth) || (origWinHeight != currWinHeight)) location.reload();
	}
}