function ImageProp(strImage,ProdId,strLocation)
{
	if (document.images)
	{
		{
		if (strLocation == null)
			strLocation=' '
		}
		var prodheight = document.images.prod.height;
		var strhref='proddisplay.asp?ProductID=' + ProdId + '&Prodheight=' +  prodheight + '&Location=' + strLocation;
//		alert(strhref);
		location.href= strhref;
	}
}
function BlueBox(objDivID)
{
	document.getElementById(objDivID).className = 'productImage';
}
function RedBox(objDivID)
{
	document.getElementById(objDivID).className = 'productImageRED';
}
function MM_preloadImages()
{
	var d=document;
	if(d.images)
	{
		if(!d.MM_p)
			d.MM_p=new Array();
		var i,j=d.MM_p.length,a=MM_preloadImages.arguments;
		for(i=0; i<a.length; i++)
		if (a[i].indexOf("#")!=0)
		{
			d.MM_p[j]=new Image;
			d.MM_p[j++].src=a[i];
		}
	}
}

function showClock()
{
	DateText = "";
	Now = new Date();
	Year = Now.getFullYear();
	Month = Now.getMonth();
	Dates = Now.getDate();
	Hour = Now.getHours();
	Minutes = Now.getMinutes();
	Seconds = Now.getSeconds();

	Dates2 = Dates + "<SUP>th</SUP>";
	if ((Dates == 1)||(Dates == 21)||(Dates == 31))
		Dates2 = Dates + "<SUP>st</SUP>";
	if ((Dates == 2)||(Dates == 22))
		Dates2 = Dates + "<SUP>nd</SUP>";
	if (Dates == 3)
		Dates2 = Dates + "<SUP>rd</SUP>";

	if (Month == 0) { Month = "January"; }
	if (Month == 1) { Month = "February"; }
	if (Month == 2) { Month = "March"; }
	if (Month == 3) { Month = "April"; }
	if (Month == 4) { Month = "May"; }
	if (Month == 5) { Month = "June"; }
	if (Month == 6) { Month = "July"; }
	if (Month == 7) { Month = "August"; }
	if (Month == 8) { Month = "September"; }
	if (Month == 9) { Month = "October"; }
	if (Month == 10) { Month = "November"; }
	if (Month == 11) { Month = "December"; }

	if (Hour<10)
		Hour = "0" + Hour;

	if (Minutes<10)
		Minutes = "0" + Minutes;

	if (Seconds<10)
		Seconds = "0" + Seconds;

	DateText = Month + " " + Dates2 + " " + Year + "&nbsp;";
	TimeText = Hour + ":" + Minutes + ":" + Seconds;

	time.innerHTML = TimeText+" - "+DateText;
	setTimeout("showClock()",1000);
}

function openWindow(url)
{
	var params="menubar=no,toolbar=no,location=no,directories=no,status=no,scrollbars=yes,resizable=yes,dependent,left=20,top=20,width=500,height=400";
	popupWin = window.open(url, 'remote',params);
}

function showDefaultThumb(img)
{
	img.src='images/noimage_thumb.gif';
}

function showDefaultMain(img)
{
	img.src='images/noimage_default.gif';
}

function openImage(img)
{
	var params="menubar=no,toolbar=no,location=no,directories=no,status=no,scrollbars=no,resizable=no,dependent,top=0,left=0,width=1,height=1";
	var random = Math.floor(Math.random()*9999999);
	popupWin = window.open('',random,params);
	popupWin.document.write('<HTML><HEAD><TITLE>utensils-direct.co.uk</TITLE><LINK HREF="styles/styles.css" REL="stylesheet" TYPE="text/css"><SCRIPT SRC="scripts.js"></SCRIPT></HEAD><BODY><DIV><A HREF="javascript:window.close()"><IMG SRC="'+img+'" BORDER="0" ALT="Click to close window" NAME="image" ONERROR="showDefaultThumb(this)"></A></DIV></BODY></HTML>');
	setTimeout('reSize()',500);
}

function reSize()
{
	var width = popupWin.document.image.width;
	var height = popupWin.document.image.height;

	if (document.layers)
	{
		popupWin.window.outerWidth = width;
		popupWin.window.outerHeight = height;		
	}
	else
		popupWin.window.resizeTo(width+10,height+29);
}

function sameAddress()
{
	f = document.form;
	if (f.sameaddress.checked==true)
	{
		f.BillingAddress.value = f.DeliveryAddress.value;
		f.BillingPostCode.value = f.DeliveryPostCode.value;
	}
	else
	{
		f.BillingAddress.value = "";
		f.BillingPostCode.value = "";
	}
}

function Right_click(e) 
{
	var msg = "Sorry, images are copyright.";
	if (navigator.appName == 'Netscape' && e.which == 3) 
	{
		alert(msg);
		return false;
	}
	if (navigator.appName == 'Microsoft Internet Explorer' && event.button==2) 
	{
	alert(msg);
	return false;
	}
	else return true;
}

function Rc_set() 
{
	if(document.images)
	{
	for(i=0;i<document.images.length;i++)
	    {
			document.images[i].onmousedown = Right_click;
			document.images[i].onmouseup = Right_click;
	    }
	}
}