
// Netscape Resize Fix
if (document.layers) {
	windowWidth = window.innerWidth;
	windowHeight = window.innerHeight;
	window.onResize = resizeFix();
}

/* resizeFix
	Fix for Netscape 4 bug when Browser Window is resized which causes
	css presentation data to become corrupted plus a few other little oddities
*/
function resizeFix() {
	if (windowWidth != window.innerWidth || windowHeight != window.innerHeight)
	document.location.href = document.location.href
}


// Image Swap Function
function swapImage(image, swapImageURL){
	var objectString,imageObject;
	if(document.images){
		if (typeof(image) == 'string') {
			objectString = 'document.' + image;
			imageObject = eval(objectString);
			if (imageObject && imageObject.src);{
				imageObject.src = swapImageURL;
			}
		} else if ((typeof(image) == 'object') && image && image.src) {
      		image.src = swapImageURL;
    	} else if ((typeof(image) == 'number') && document.images[image] && document.images[image].src) {
			document.images[image].src = swapImageURL;
		}
  	}
}

// Image Pre Loading Function supply the images as a series of string
// arguments representing the url's to pre-load
function preLoadImages(){
	if(document.images){
		imageObjects = new Array();
		for (i=0; i < arguments.length; i++){
			imageObjects[i] = new Image();
			imageObjects[i].src = arguments[i];
		}
	}
}


// Window Opener function
function openWindow(pageURL, windowName, width, height, atts){
	// set sensible default values
	if (!windowName) windowName = "popup";
	if (!width) width = 450;
	if (!height) height = 300;
	
	attributes = "width=" + width + ",height=" + height;
	attributes = (atts) ? attributes + "," + atts : attributes;
	
	// open window saving a reference to the window object
	_popup = window.open(pageURL, windowName, attributes);
	
	// ensure window is brought to front after 1/4 second once opened
	// this will also give focus to an already open window.
	popupTimer=setTimeout("_popup.focus()",250);
	
	//return the window object reference
	return _popup
}





	
	







