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("© Soneka 2000-2007 : Please don't copy our site content.");
		return false;
	} return true;
}

basketCost = 0;
basketNum = 0;
inBasket = "";
basketArray = new Array();
order = "";
basketString = "";

<!-- CODE ADDED 10-04-05 -->
function decPlace(price)
{

   if((price.toString()).indexOf(".") == -1)
   {
      price = price.toString() + ".00";
   }
   else
   {

      strPrice = price.toString();
      priceArray = strPrice.split(".");

      if(priceArray[1].length == 1)
      {
         price = priceArray[0] + "." + priceArray[1] + "0";
      }
   }

   return price;

}

function readCookie()
{

orderString = "<TABLE width='500px'>";
basketCost = 0;
basketNum = 0;

   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];

	   }

      writeCookie();
   }

}
<!-- -->

function updateBag()
{

   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++)
   {
   
   
          if((artArray[k].split('/'))[0] != "")
          {
          quantityValue = "QUANT" + k;
	  basketArray[k] = (artArray[k].split('/'))[0] + "/" + (artArray[k].split('/'))[1] + "/" + document.getElementById(quantityValue).value;
	  }

   }

   writeCookie();
   window.location.href="basket.php";

}

function removeItem(arrayNumber)
{
      
  //alert(basketArray[arrayNumber]);
  basketArray[arrayNumber] = "undefined";

  writeCookie();
  window.location.href="basket.php";

}


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();
    }

}

function emptyBag()
{
    var kill_time = new Date("February 11, 1975");
    document.cookie = "GENBASKET=;expires=" + kill_time.toGMTString();
 
    window.location.href="basket.php";
}

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 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";

}
