function showPhoto(inventoryNumber) {
	displayWindow = window.open('largePhoto.php?'+inventoryNumber,'display','width=750,height=416,menubar=yes,resizable=yes,titlebar=no,status=no,toolbar=no,scrollbars=yes');
	displayWindow.focus();
}





var allNav = new Array('collections','about','ordering','retail','care','press','contact','gifts','wholesale','search','home');


function preLoad() {
	for (i=0; i<allNav.length; i++) {
		var each = new Image();
		each.src="images/nav_" + allNav[i] + "_on.gif";
	}
}

function on(name) {
	document[name].src="images/nav_" + name + "_on.gif";
}

function off(name) {
	if (window.parent.displayFrame.location.href.indexOf(name) > 0) {
		//document[name].src="images/nav_" + name + ".gif";
	} else {
		document[name].src="images/nav_" + name + ".gif";
	}
}





var allJPG = new Array('join');


function preLoadJPG() {
	for (i=0; i<allJPG.length; i++) {
		var each = new Image();
		each.src="images/" + allJPG[i] + "_on.jpg";
	}
}

function onJPG(name) {
	document[name].src="images/" + name + "_on.jpg";
}

function offJPG(name) {
	document[name].src="images/" + name + ".jpg";
}






function showCollection(imageName) {
	document.featuredItem.src = "../featuredItems/featuredItem_" + imageName + ".jpg";
}

function hideCollection() {
	document.featuredItem.src = "../featuredItems/featuredItem_default.jpg";
}



function choose(name) {
	for (i=0; i<allNav.length; i++) {
		document[allNav[i]].src="images/nav_" + allNav[i] + ".gif";
	}
	document[name].src="images/nav_" + name + "_on.gif";
	//window.parent.thumbnailFrame.location.href="blank.html";
}



function setNav(name) {
	window.top.navFrame[name].src="images/nav_" + name + "_on.gif";
	window.top.navFrame[name].blur();
}


function goToCollection(collection) {
	window.self.location.href="displayFrame.php?collection=" + collection;
	window.top.displayFrame.thumbnailFrame.location.href="thumbnailFrame.php?collection=" + collection;
}



function keywordSearch(keyWords) {
	window.self.location.href="displayFrame.php?keywords=" + keyWords;
	window.top.displayFrame.thumbnailFrame.location.href="thumbnailFrame.php?keywords=" + keyWords;
}



//DATABASE STUFF

function chooseOrder(whichColumn) {
	temp = document.location.href;
	if (temp.indexOf('index.php') < 0)  {
		temp = temp + "index.php";
	}
	
	if (temp.indexOf('?') < 0)  {
		temp = temp+ "?";
	}
	
	
	if (temp.indexOf('orderBy') < 0)  {
		document.location.href = temp + "&orderBy=" + whichColumn;
	} else {
		temp = temp.slice(0,temp.indexOf('orderBy')-1);
		document.location.href = temp+ "&orderBy=" + whichColumn;
	}
	
}


//HOLIDAY STUFF


function buyIt() {

	promoWindow = window.open("../discounts/springDiscount.php",'discount','width=325,height=200,screenX=150,screenY=150,left=150,top=150,status=yes,scrollbars=auto,titlebar=yes,location=no,menubar=yes,personalbar=no');
	document.buyIt.submit();

}



function validateCoupon() {

	temp = document.enterCoupon.coupon.value.toLowerCase();
	
	if (temp == "spring!") {
		document.discountPrice.submit();
	} else {
		document.fullPrice.submit();
	}


	//window.self.close();
}




function validateLucky() {
	temp = document.enterCoupon.coupon.value.toLowerCase();

	if (temp == "lucky") {
		document.discountPrice.submit();
	} else {
		document.fullPrice.submit();
		document.location.href="luckyDiscountFailure.php";
	}


	//window.self.close();
}




function showPopup() {

	thePopup = window.open("../popup/index.html",'popup','width=325,height=225,screenX=150,screenY=150,left=150,top=150,status=yes,scrollbars=auto,titlebar=yes,location=no,menubar=yes,personalbar=no');
	thePopup.focus();
	
}


function holidayOrders() {

	thePopup = window.open("../discounts/holiday2004.html",'orders','width=325,height=225,screenX=150,screenY=150,left=150,top=150,status=yes,scrollbars=auto,titlebar=yes,location=no,menubar=yes,personalbar=no');
	thePopup.focus();
	
}



















