
// cache the rollover images if we can
function loadImages() {
	window.IMG_ARRAY = new Array();
	var imgArr = window.IMG_ARRAY;
	if(document.images) {
		imgArr ['baked_on'] = new Image();
		imgArr ['baked_off'] = new Image();
		imgArr ['baked_on'].src = "images/baked_on.gif";
		imgArr ['baked_off'].src = "images/baked_off.gif";

		imgArr ['specialty_on'] = new Image();
		imgArr ['specialty_off'] = new Image();
		imgArr ['specialty_on'].src = "images/specialty_on.gif";
		imgArr ['specialty_off'].src = "images/specialty_off.gif";

		imgArr ['stock_on'] = new Image();
		imgArr ['stock_off'] = new Image();
		imgArr ['stock_on'].src = "images/stock_on.gif";
		imgArr ['stock_off'].src = "images/stock_off.gif";

		imgArr ['savory_on'] = new Image();
		imgArr ['savory_off'] = new Image();
		imgArr ['savory_on'].src = "images/savory_on.gif";
		imgArr ['savory_off'].src = "images/savory_off.gif";

		imgArr ['cook_books_on'] = new Image();
		imgArr ['cook_books_off'] = new Image();
		imgArr ['cook_books_on'].src = "images/cook_books_on.gif";
		imgArr ['cook_books_off'].src = "images/cook_books_off.gif";
	}
}

function swapImage(elemName, imgName) {
	var imgArr = window.IMG_ARRAY;
	if(document.images && isDefined(imgArr)) {
		document.images[elemName].src = imgArr[imgName].src;
	}
}

function zoomPic(type, index) {
	var url = "zoom.php?type=" + type + "&src=" + index;
	var win = window.open(url,"zoom","status=1,resizable=1,scrollbars=1,height=670,width=850,top=40,left=40");
	win.focus();
}

function isDefined(obj) {
	if( (typeof obj == 'undefined') || obj == null ) return false;
	else return true;
}

