var categories = new Array("home", "exhibitions", "collection", "events", "education", "visting", "about", "press", "membership", "store");
var collection = new Array("collection", "african", "american", "ancient", "ancient", "asian", "costumes", "egyptian", "european", "oceanic", "nativeamerican", "precolumbian");
var preloadFlag = false;

function newImage(arg) {
	if (document.images) {
		rslt = new Image();
		rslt.src = arg;
		return rslt;
	}
}

function changeImages() {
	// remove the following line to 
	// turn on rollovers
	if (document.images && (preloadFlag == true)) {
		for (var i=0; i<changeImages.arguments.length; i+=2) {
			document[changeImages.arguments[i]].src = changeImages.arguments[i+1];
		}
	}
}

function preloadImages(catid) {
	for(i=0; i<categories.length; i++) {
		newImage("images/banner/" + catid + "/" + categories[i] + "_over.gif");
	}
	if (catid == "collection") {
			for(i=0; i<collection.length; i++) {
				newImage("images/submenu/collection/" + collection[i] + ".gif");
			}
	}
    if (catid == "exhibitions") {
        newImage("images/body/exhibitions/newturf2-over.gif");
        newImage("images/body/exhibitions/hewitt-over.gif");
        newImage("images/body/exhibitions/terrain-over.gif");

    }

	preloadFlag = true;
}

function popupslide(path) {
	_width = 700;
	_height = (1000 > screen.height) ? (screen.height*.9) : 1000;
	_left = (screen.width - _width) / 2;
	_top = (screen.height - _height) / 2;

	slidewin=window.open(path,"slidewin","width="+_width+",height="+_height+",menubar=0,toolbar=0,scrollbars=1,copyhistory=0,resizable=0,left="+_left+",top="+_top);
	slidewin.focus();
}

