// Javascript functions used in the Kencart software


// make a popup window for viewing images
function image_popup(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, 'Image', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=500,height=450,left = 112,top = 84');");
}

// used to toggle the shopping list feature on and off on the show_cart page
function toggleLayer(whichLayer) {
	if (document.getElementById) {
		// this is the way the standards work
		var style2 = document.getElementById(whichLayer).style;
		style2.display = style2.display=="none" ? "block":"none";
	}
}

// alert the user if he is trying to buy more than we have in stock
function showStockWarning()
{
	return confirm('Your order includes some product quantities which are not currently avaiable in stock.\n '
		+ 'If you proceed with the order, these products will be put on a back-order and dispatched\n when they come back into stock.'
		+ ' See our Shipping Policy for more information.\n\n'
		+ 'Press \'OK\' to proceed, or \'Cancel\' to amend your order');
}