function getElementOfId(id) {
	var el = null;
	if (document.getElementById) {
		el = document.getElementById(id);
	} else if (document.all) {
		el = document.all[id];
	} else if (document.layers) {
		el = document.layers[el];
	}
	return el;
}

function newImage(arg) {
	if (document.images) {
		rslt = new Image();
		rslt.src = arg;
		return rslt;
	}
}

var swapProductOriginalImageID = null;
var productImagesArray = new Array();

function swapProductImage(imageID) {
	var el = getElementOfId("productImage");
	if (el) el.src = productImagesArray["id" + imageID].src;
}

function unSwapProductImage() {
	swapProductImage(swapProductOriginalImageID);
}

// Force the page into the frameset unless a special variable has been set
if ((window.top == self) && (window.location.search.indexOf("frameset=false") == -1) && (window.location.pathname.indexOf("/store/") == -1)) {
	var parentURL = "index.php";
	var childURLArray = window.location.href.split("/");
	var childURL = childURLArray[childURLArray.length-1];
	window.location.href = parentURL + "?page=" + childURL;
}
