function newImage(arg) {
	if (document.images) {
		rslt = new Image();
		rslt.src = arg;
		return rslt;
	}
}

function changeImages() {
	if (document.images && (preloadFlag == true)) {
		for (var i=0; i<changeImages.arguments.length; i+=2) {
			document[changeImages.arguments[i]].src = changeImages.arguments[i+1];
		}
	}
}

var preloadFlag = false;
function preloadImages() {
	if (document.images) {
		index_06_over = newImage("images/index_06-over.gif");
		index_07_over = newImage("images/index_07-over.gif");
		index_08_over = newImage("images/index_08-over.gif");
		index_36_over = newImage("images/index_36-over.gif");
		index_38_over = newImage("images/index_38-over.gif");
		index_40_over = newImage("images/index_40-over.gif");
		index_50_over = newImage("images/index_50-over.gif");
		index_52_over = newImage("images/index_52-over.gif");
		index_54_over = newImage("images/index_54-over.gif");
		index_65_over = newImage("images/index_65-over.gif");
		index_66_over = newImage("images/index_66-over.gif");
		index_67_over = newImage("images/index_67-over.gif");
		index_68_over = newImage("images/index_68-over.gif");
		index_69_over = newImage("images/index_69-over.gif");
		preloadFlag = true;
	}
}

function OpenLargeViewer(img){
	url = "large_image.asp?i=" + img
	window.open(url,"viewer","width=420,height=460")
}
function ShippingPopup() {window.open("ShippingPopup.asp","Shipping","width=300,height=300");}
function AddlShipPopUp() {window.open("AddlShippingPopup.asp","Shipping","width=300,height=300");}
function NeedHelpPopup() {window.open("NeedHelp.asp","Help","width=500,height=500,scrollbars=yes");}
function ContactUsPopup() {window.open("ContactUsPopup.asp","Shipping","width=300,height=300");}
function NoBreakagePopUp() {window.open("NoBreakagePopup.asp","Shipping","width=400,height=200,scrollbars=yes");}
function AboutUsPopup() {window.open("AboutUsPopup.asp","Shipping","width=500,height=400,scrollbars=yes");}
function ShoppingCartPopup() {window.open("shoppingcart.asp","ShoppingCart","width=300,height=300");}
function windowPopUp(url){
	var aX = document.body.offsetWidth - 30;
	var aY = document.body.offsetHeight - 30;
	window.open(url,"","width="+aX+",height="+aY+",scrollbars=yes,toolbar=yes,resizable=yes,status=yes,location=yes");
	}
function VerifySearch()
{
	if (document.searchform.search.value.length == 0) {alert("Please Enter Search Keywords"); document.searchform.search.focus(); return false;}
	return true;
}
function AddToCart()
{
	var jsQty = new Number(document.AddProduct.qty.value);
	if (isNaN(jsQty)) {alert("Please use numbers only"); document.AddProduct.qty.value=""; document.AddProduct.qty.focus(); return false;}
	if (jsQty != Math.round(jsQty)) {alert("Please use whole numbers only"); document.AddProduct.qty.value=""; document.AddProduct.qty.focus(); return false;}
	if (jsQty<=0) {alert("Please enter quantity for this product"); document.AddProduct.qty.value=""; document.AddProduct.qty.focus(); return false;}
	if (iThreshold>-1 && jsQty > iThreshold)
	{
		if(!confirm("There are only "+iThreshold+" currently available. Would you like to adjust quantity automatically?")) return;
	}
	document.AddProduct.submit();
	return false;
}
function SizeMenu()
{
	RandProdList.style.height=Math.round((LeftMenuTD.clientHeight - 230) / 19) * 19;
	//window.setTimeout("slScroll()",1000);
}
function slScroll()
{
	RandProdList.doScroll("down");
	window.setTimeout("slScroll()",1000);
}
function GoToCheckout()
{
window.location='shoppingcart.asp';
}
