document.onmousedown=right;
if (document.layers) window.captureEvents(Event.MOUSEDOWN);
	window.onmousedown=right;
	
function right(e) 
{
	if (navigator.appName == 'Netscape' &&
		(e.which == 3 || e.which == 2))
		return false;
	else if (navigator.appName == 'Microsoft Internet Explorer' &&
		(event.button == 2 || event.button == 3)) {
		alert("© BUYATILL.COM LIMITED 2007 : Please don't copy our site content.");
		return false;
	} return true;
}

basketNum = 0;
inBasket = "";
basketArray = new Array();
order = "";
basketString = "";

<!-- CODE ADDED 10-04-05 -->
function readCookie()
{

   if((document.cookie).indexOf("GENBASKET") != -1)
   {
       orderArray = document.cookie.split(";");

       for(j=0; j<orderArray.length; j++)
       {
		  if(orderArray[j].indexOf("GENBASKET") != -1)
		  {
		     order = orderArray[j];
		  }
       }

       fullArray = ((order.split("="))[1]).split("#");
       artArray = new Array();
       placeInArray = 0;

	   for(p=0; p<fullArray.length; p++)
	   {
	      if(fullArray[p] != "")
	      {
	      artArray[placeInArray] = fullArray[p];
	      placeInArray++;
	      }
	   }

	   for(k=0; k<artArray.length; k++)
	   {

	   basketArray[k] = artArray[k];


          if((artArray[k].split('/'))[0] != "")
          {
	      basketNum += parseInt((artArray[k].split('/'))[2]);
	      }

	      if((artArray[k].split('/'))[0] != "")
	      {
	      
	      basketString = 'shopping bag contains <SPAN class="bag2">' + basketNum + ' item(s)</SPAN><BR><A HREF="basket.php" class="basketText">view bag</A> &#8226; <A HREF="checkout.php" class="basketText">go to checkout</A>';
	      
	      }

	   }

      document.getElementById("BAG").innerHTML = basketString;
      writeCookie();
   }
}
<!-- -->

function addToBasket(item)
{

   match = "false";
   newQuantity = "";
        
        pid = document.getElementById("PRICEID").value;
        quantity = parseInt(document.getElementById("QUANTITY").value);
 
	for(i=0; i<basketArray.length; i++)
	{
	testProduct = (basketArray[i].split('/'))[0] + "/" + (basketArray[i].split('/'))[1];

	if(testProduct == (item + "/" + pid))
	{
	match = "true";
	newQuantity = parseInt((basketArray[i].split('/'))[2]) + parseInt(quantity);
	basketArray[i] = item + "/" + pid + "/" + newQuantity;
	}
	}

	if(match == "false")
	{
	basketArray[parseInt(basketArray.length)] = item + "/" + pid + "/" + quantity;
	}

	basketNum = basketNum + quantity;

	document.getElementById("BAG").innerHTML = 'shopping bag contains <SPAN class="bag2">' + basketNum + ' item(s)</SPAN><BR><A HREF="basket.php" class="basketText">view bag</A> &#8226; <A HREF="checkout.php" class="basketText">go to checkout</A>';

	alert(item + " added to your bag.");

	writeCookie2();

}

function addToBasket2(item,no)
{

   match = "false";
   newQuantity = "";
        
        quantity = "1";
        
        nameString = "PRICEID" + no;
        
        alert(nameString);
        
        pid = document.getElementById(nameString).value;
 
	for(i=0; i<basketArray.length; i++)
	{
	testProduct = (basketArray[i].split('/'))[0] + "/" + (basketArray[i].split('/'))[1];

	if(testProduct == (item + "/" + pid))
	{
	match = "true";
	newQuantity = parseInt((basketArray[i].split('/'))[2]) + parseInt(quantity);
	basketArray[i] = item + "/" + pid + "/" + newQuantity;
	}
	}

	if(match == "false")
	{
	basketArray[parseInt(basketArray.length)] = item + "/" + pid + "/" + quantity;
	}

	basketNum = basketNum + quantity;

	document.getElementById("BAG").innerHTML = 'shopping bag contains <SPAN class="bag2">' + basketNum + ' item(s)</SPAN><BR><A HREF="basket.php" class="basketText">view bag</A> &#8226; <A HREF="checkout.php" class="basketText">go to checkout</A>';

	alert(item + " added to your bag.");

	writeCookie2();

}


function writeCookie()
{
arrayContent = 0;

chocChipCookie = "GENBASKET=";

	for(i=0; i<basketArray.length; i++)
	{

	   if(basketArray[i] != "undefined")
	   {

          chocChipCookie += basketArray[i] + "#"
          arrayContent++;
	   }
	}
	
	//chocChipCookie += ";path=/";

    if(arrayContent != 0)
    {
    document.cookie = chocChipCookie;
    }
    else
    {
    var kill_time = new Date("February 11, 1975");
    document.cookie = "GENBASKET=;expires=" + kill_time.toGMTString();
    document.getElementById("BAG").innerHTML = "<B>Shopping Basket</B> 0 item(s)";
    }

}

function writeCookie2()
{
arrayContent = 0;

chocChipCookie = "GENBASKET=";

	for(i=0; i<basketArray.length; i++)
	{

	   if(basketArray[i] != "undefined")
	   {

          chocChipCookie += basketArray[i] + "#"
          arrayContent++;
	   }
	}
	
	//chocChipCookie += ";path=/";

    if(arrayContent != 0)
    {
    document.cookie = chocChipCookie;
    }
    else
    {
    var kill_time = new Date("February 11, 1975");
    document.cookie = "GENBASKET=;expires=" + kill_time.toGMTString();
    document.getElementById("BAG").innerHTML = "<B>Shopping Basket</B> 0 item(s)";
    }
    
    window.location.href = "basket.php";

}

function makeNew()
{

var picturePath = "http://www.multimap.com/map/browse.cgi?client=public&search_result=&db=pc&cidr_client=none&lang=&keepicon=true&pc=WF58NS&advanced=&client=public&addr2=&quicksearch=WF5+8NS&addr3=&addr1=";

opener = window.open(picturePath,'blank','left=100,top=100,scrollbars=1');
opener.focus();

}
