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("COPYRIGHT TRAVEL TOTS : Please don't copy our site content.");
		return false;
	} return true;
}

function addToFavourites() 
{

urlAddress = "http://www.traveltotsuk.com"; 
pageName = "TRAVEL TOTS :: BECAUSE HOLIDAYING WITH TOTS SHOULD BE EASY";

	if(window.external) 
	{ 
	window.external.AddFavorite(urlAddress,pageName) 
	} 
	else 
	{ 
	alert("Sorry! Your browser doesn't support this function."); 
	} 
}

basketNum = 0;
basketCost = 0.00;
inBasket = "";
basketArray = new Array();
order = "";
basketString = "";
bagText = "";
$pageLoaded=false;

function pageLoad()
{
$pageLoaded=true;
}

function decPlace(price)
{
price += "";

pos = price.indexOf('.');

if(pos == -1)
{
price = price + ".00";
}
else
{

   price = price.split(".");
   pricebit = price[1].length;

   if(pricebit == 1)
   {
      price = price[0] + "." + price[1] + "0";
   }

}

return price;

}

<!-- 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]);
	      
	      costArray = new Array();
	      costArray = ((artArray[k].split('/'))[1]).split(':');
	      
	      basketCost = (parseFloat(basketCost) + parseFloat(costArray[1]*(parseInt((artArray[k].split('/'))[2]))));
	      
	      }

	      if((artArray[k].split('/'))[0] != "")
	      {
	      		
		basketString = '<table class="cartText">';
		basketString += '<tr><td class="cartText">YOUR PARCEL</td></tr>';
		basketString += '<tr><td class="cartText">CONTAINS ' + basketNum + ' item(s)</td></tr>';
	        basketString += '<tr><td class="cartText">PARCEL COST &pound;' + basketCost.toFixed(2) + '</td></tr>';
		basketString += '<tr><td class="cartText"><a href="basket.php" class="logLink">EDIT PARCEL</a></td></tr>';
		basketString += '<tr><td class="cartText"><a href="checkout.php" class="logLink">CHECKOUT</a></td></tr>';
		//basketString += '<tr><td class="cartText">POST COST &pound;0.00</td></tr>';
		//basketString += '<tr><td class="cartText">WEIGHT 0g</td></tr>';
		basketString += '</table>';		
			      
	      }

	   }

      document.getElementById("BAG").innerHTML = basketString;
      writeCookie();
   }

}
<!-- -->

function popPrice(item)
{

document.getElementById('SIZE0').value = ((document.getElementById('PRICEDROP').value).split('/'))[4];
document.getElementById('COLOUR0').value = ((document.getElementById('PRICEDROP').value).split('/'))[2] + "/" + ((document.getElementById('PRICEDROP').value).split('/'))[3];
document.getElementById('PRICEID0').value = ((document.getElementById('PRICEDROP').value).split('/'))[0] + "/" + ((document.getElementById('PRICEDROP').value).split('/'))[1];

addToBasket(item,0);

}

function addToBasket(item,number)
{

if($pageLoaded==true)
{

	if((document.getElementById('SIZE' + number).value == "") || (document.getElementById('COLOUR' + number).value == ""))
	{
	
	alert('Please ensure you have selected your size and colour.');
	
	}
	else
	{
	
	   if(((document.getElementById('COLOUR' + number).value).split('/'))[1] <= 0)
	   {
	   
	   alert('Sorry this product is not currently in stock.');
	   
	   }
	   else
	   {
	   
	   //alert('TEST2');
	
		match = "false";
		newQuantity = "";

		pid = document.getElementById('PRICEID' + number).value;

		sizecolour = document.getElementById('SIZE' + number).value + '/' + ((document.getElementById('COLOUR' + number).value).split('/'))[0];

		thingyArray = new Array();
		thingyArray = pid.split('/');

		//quantity = parseInt(document.getElementById('quantity1').value);
		quantity = 1;
		cost = thingyArray[1];

		for(i=0; i<basketArray.length; i++)
		{

		testProduct = (basketArray[i].split('/'))[0] + "/" + (basketArray[i].split('/'))[1];

		sc = (basketArray[i].split('/'))[3] + '/' + (basketArray[i].split('/'))[4];

		//if(testProduct == (item + "/" + thingyArray[0] + ":" + thingyArray[1]))
		if(((basketArray[i].split('/'))[0] == item) && ((basketArray[i].split('/'))[1] == (thingyArray[0] + ":" + thingyArray[1])) && (sc == sizecolour))
		{
		
		match = "true";
		newQuantity = parseInt((basketArray[i].split('/'))[2]) + parseInt(quantity);
		
		   if(newQuantity <= ((document.getElementById('COLOUR' + number).value).split('/'))[1])
		   {
		   basketArray[i] = item + "/" + thingyArray[0] + ":" + cost + "/" + newQuantity + "/" + sizecolour;
		   }
		
		}
		}

		if(match == "false")
		{
		basketArray[parseInt(basketArray.length)] = item + "/" + thingyArray[0] + ":" + thingyArray[1] + "/" + quantity + "/" + sizecolour;
		}

		if(newQuantity <= ((document.getElementById('COLOUR' + number).value).split('/'))[1])
		{
		basketNum = basketNum + quantity;

		basketCost = (parseFloat(basketCost) + parseFloat(thingyArray[1])).toFixed(2);
		
		bagText = '<table class="cartText">';
		bagText += '<tr><td class="cartText">YOUR PARCEL</td></tr>';
		bagText += '<tr><td class="cartText">CONTAINS ' + basketNum + ' item(s)</td></tr>';
	        bagText += '<tr><td class="cartText">PARCEL COST &pound;' + basketCost + '</td></tr>';
		//bagText += '<tr><td class="cartText">POST COST &pound;0.00</td></tr>';
		//bagText += '<tr><td class="cartText">WEIGHT 0g</td></tr>';
		bagText += '</table>';		

		document.getElementById("BAG").innerHTML = bagText;
		}
		
		arrayContent = 0;

		chocChipCookie = "GENBASKET=";

		for(i=0; i<basketArray.length; i++)
		{

		if(basketArray[i] != "undefined")
		{

		chocChipCookie += basketArray[i] + "#"
		arrayContent++;
		}
		}

		chocChipCookie;

		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)";
		}		

		if(newQuantity <= ((document.getElementById('COLOUR' + number).value).split('/'))[1])
		{
		alert(item + " added to your basket.");
		}
		else
		{
		alert('Sorry we do not currently have sufficient stock.');
		}


                location.reload(true);

                //window.location.href="stockUpdate.php?productID=" + pid + "&sizeID=" + document.getElementById('SIZE' + number).value + "&colourID=" + document.getElementById('COLOUR' + number).value + "&quantity=" + quantity;

		writeCookie();
		}

	}

}
else
{
alert("Please wait for the page to fully load.");
}

}


function writeCookie()
{
arrayContent = 0;

chocChipCookie = "GENBASKET=";

	for(i=0; i<basketArray.length; i++)
	{

	   if(basketArray[i] != "undefined")
	   {

          chocChipCookie += basketArray[i] + "#"
          arrayContent++;
	   }
	}
	
	chocChipCookie;

    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 bigPic(image)
{

var picturePath = "product images popup/" + image;

opener = window.open(picturePath,'blank','left=100,top=100,scrollbars=1');
opener.focus();

}
