function submitit()
{
if(confirm("Submit this form for processing?"))
	{return true;}
else	{return false;}
}

function basket(){
window.location="http://www.greenol.co.uk/basket.php";
}

function caddie(){
window.location="http://www.greenol.co.uk/caddie.htm";
}

function trolley(){
window.location="http://www.greenol.co.uk/trolley.htm";
}

function setCookie(name, value) {
document.cookie = name + "=" + escape(value) + ";path=/;";
}

function getCookie(name)
{
var search = name + "="
if (document.cookie.length > 0)	// check for cookie
	{ 
	offset = document.cookie.indexOf(search) 
	if (offset != -1)	// if cookie exists then
		{
		offset += search.length;	// find beginning of value
		end = document.cookie.indexOf(";", offset); // find end of value
		if (end == -1)
			{
			end = document.cookie.length;
			}
		return unescape(document.cookie.substring(offset, end));
		} 
	}
return "";
}

function addtoBasket(add)
	{
	if (confirm ("If you are a member, please click OK to add this item to your basket for UK delivery.\n\n"))
		{
		var value = getCookie("Basket");
		value += add;
		setCookie("Basket", value);
		}
	else {window.location="http://www.greenol.co.uk/delivery.php";}
	}

function confirmaddtoBasket(add)
	{
	if (confirm ("If you are a member, please click OK to add this item to your basket for UK delivery.\n\n"))
		{
		var value = getCookie("Basket");
		value += add;
		setCookie("Basket", value);
		}
	else {window.location="http://www.greenol.co.uk/delivery.php";}
	}

function addtoCaddie(add)
	{
	if (confirm ("If you are a member, please click OK to add this item to your caddie for delivery within the EU.\n\n"))
		{
		var value = getCookie("Caddie");
		value += add;
		setCookie("Caddie", value);
		}
	else {window.location="http://www.greenol.co.uk/delivery.php";}
	}

function addtoTrolley(add)
	{
	if (confirm ("If you are a member, please click OK to add this item to your trolley for UK delivery.\n\n"))
		{
		var value = getCookie("Trolley");
		value += add;
		setCookie("Trolley", value);
		}
	else {window.location="http://www.greenol.co.uk/delivery.php";}
	}


function gotoCheckout() {
var checkout = "http://www.greenol.co.uk/memberlogin.php?";
checkout += escape(getCookie("Basket"));
window.location=checkout;
}

function gotoEuCheckout() {
var eucheckout = "http://www.greenol.co.uk/memberlogineu.php?";
eucheckout += escape(getCookie("Caddie"));
window.location=eucheckout;
}

function gotoBulkCheckout() {
var bulkcheckout = "http://www.greenol.co.uk/memberloginbulk.php?";
bulkcheckout += escape(getCookie("Trolley"));
window.location=bulkcheckout;
}

function gotoNonMemCheckout(buynow) {
var checkout = "http://www.greenol.co.uk/nonmembercheckout.php?";
checkout += escape(buynow);
window.location=checkout;
}

function scroll(incr)
{
var msgRun="Thank you for visiting Greenline On-Line. If you can't find it here, try one of the Google links on the right hand side :-)     ";
var msgEnd="Greenline On-Line: Ethical Trading for a better world..."
var opt=" ";
var c=1;

if (incr>0)
	{
	for (c=0;c<incr;c++){opt+=" ";}
	opt+=msgRun;
	incr-=2;
	window.status=opt;
	timer=setTimeout ("scroll ("+incr+")",125);
	}
else
	{
	if (-incr<msgRun.length)
		{opt+=msgRun.substring (-incr,msgRun.length);
		incr-=2;
		window.status=opt;
		timer=setTimeout ("scroll ("+incr+")",200);
		}
	else
		{window.status=msgEnd;
		timer=setTimeout ("scroll (120)",19000);
		}
	}
}
