function w(s)
		{
		document.write(s);
		}


function wl(s)
		{
		document.writeln(s);
		}


function setCookie(c_name, value, expiredays, path)
		{
		var exdate=new Date();
		exdate.setDate(exdate.getDate()+expiredays);

		var copt="";

		if (expiredays != null) copt = copt+";expires="+exdate.toGMTString();
		if (path != null) copt = copt+";javahere=yes;path="+path;

		document.cookie=c_name+ "=" +escape(value)+ copt;
		}


function getCookie(c_name)
		{
		if (document.cookie.length>0)
			{
			c_start=document.cookie.indexOf(c_name + "=");
			if (c_start!=-1)
				{ 
				c_start=c_start + c_name.length+1; 
				c_end=document.cookie.indexOf(";",c_start);
				if (c_end==-1) c_end=document.cookie.length;
				return unescape(document.cookie.substring(c_start,c_end));
				} 
			}

		return "";
		}


function getBasketID()
		{
		var	id;

		id = getCookie("basketid");

		//alert('read basket id '+id);

		return id;
		}


function setBasketID(id)
		{
		setCookie("basketid", id, 1, "/");

		//alert('wrote basket id '+id);
		}


function doAddToBasket(id)
		{
		shop.returnurl.value = document.URL;
		shop.quantity.value = 1;
		shop.item.value = id;
		shop.action.value = "add";
		shop.basket.value = getBasketID();
		shop.submit();
		}


