function preloadImages() {
	var aryPreload = new Array();
	var aryImages = Array(
		"images/loadingAnimation.gif",
		"images/spacer.gif",
		"images/noimage.jpg",
		"images/icon_close_over.png"
	);
	for (var i=0; i<aryImages.length; i++) {
		aryPreload[i] = new Image();
		aryPreload[i].src = aryImages[i];
	}
}

function switchImage(id, path, text) {
	var element = document.getElementById(id);
	var link = document.getElementById(id + "_link");
	var image = document.getElementById(id + "_image");
	var caption = document.getElementById(id + "_caption");
	if (element) {
		if (path.replace(/^(\s)*$/g, "") != "") {
			if (link && image) {
				link.href = path;
				link.title = text;
				image.src = "webitems/thumbnail.aspx?image=" + path + "&width=246";
				image.alt = text;
				if (caption) {
					caption.innerHTML = text;
				}
			}
		}
	}
	return false;
}

var popupWindow;
function openWindow(url, width, height) {
	popupWindow = window.open(url, 'littlemineral_player', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,top=100,left=100,height='+height+',width='+width);
	if (window.focus) { popupWindow.focus(); }
}

function closeWindow() {
	window.close();
}