// ONLINE SHOP STUFF
    function buyItem(newItem, newPrice, newTaxable, newQuantity) {
        if(newQuantity<=0) {
            rc = alert('The quantity entered is incorrect');
        } else {
            if (confirm('Add '+newQuantity+' x '+newItem+' to basket? ')) {
                index=document.cookie.indexOf('TheBasket');
                countbegin=(document.cookie.indexOf('=',index)+1);
                countend=document.cookie.indexOf(';',index);
                if(countend==-1) {
                    countend=document.cookie.length;
                }
                document.cookie='TheBasket='+document.cookie.substring(countbegin,countend)+'['+newItem+'|'+newPrice+'|'+newTaxable+'|'+newQuantity+']; expires=Friday, 1-Jan-2012 00:00:00 GMT';
            }
        }
    }

    function goBuy() {
        ilist='';
        index=document.cookie.indexOf('TheBasket');
        countbegin=(document.cookie.indexOf('=', index)+1);
        countend=document.cookie.indexOf(';',index);
        if(countend==-1) { countend=document.cookie.length; }
        fulllist=document.cookie.substring(countbegin,countend);
        for(var i=0; i<= fulllist.length;i++) {
            if(fulllist.substring(i,i+1)=='[') {
                itemstart=i;
            } else if (fulllist.substring(i,i+1)==']') {
                itemend=i+1;
                ilist=ilist+fulllist.substring(itemstart,itemend);
            }
        }
        ilist=changeSpaces(ilist);
        top.location='buy.htm?items='+ilist;
    }

    function changeSpaces(tstring) {
        nstring='';
        for (var i=0; i <= tstring.length; i++) {
            if (tstring.charAt(i)==' ') { nstring=nstring+'^';
            } else { nstring=nstring+tstring.charAt(i); }
        }
        return nstring;
    }

// TOOLBAR STUFF
function dtl()
{
  // Set variables
  imgwidth=780;  // logo width, in pixels
  imgheight=20;  // logo height, in pixels
  if (navigator.appName == "Netscape")
  {
    horz=".left";
    vert=".top";
    docStyle="document.";
    styleDoc="";
    innerW="window.innerWidth";
    innerH="window.innerHeight";
    offsetX="window.pageXOffset";
    offsetY="window.pageYOffset";
    checkLocationNS();	//Start toolbar with NS parameters
  }
  else
  {
    horz=".pixelLeft";
    vert=".pixelTop";
    docStyle="";
    styleDoc=".style";
    innerW="document.body.clientWidth";
    innerH="document.body.clientHeight";
    offsetX="document.body.scrollLeft";
    offsetY="document.body.scrollTop";
    checkLocationIE();	//Start toolbar with IE parameters
  }
}
function checkLocationIE()
{
  objectXY="branding";
  var availableX=810;
  var availableY=40;
  var currentX=eval(offsetX);
  var currentY=eval(offsetY);
  x=availableX-(imgwidth+30)+currentX;
  y=availableY-(imgheight+20)+currentY;
  evalMove();
  setTimeout("checkLocationIE()",1);
}
function checkLocationNS()
{
  objectXY="branding";
  var availableX=808;
  var availableY=38;
  var currentX=eval(offsetX);
  var currentY=eval(offsetY);
  x=availableX-(imgwidth+30)+currentX;
  y=availableY-(imgheight+20)+currentY;
  evalMove();
  setTimeout("checkLocationNS()",10);
}
function evalMove()
{
  eval(docStyle + objectXY + styleDoc + horz + "=" + x);
  eval(docStyle + objectXY + styleDoc + vert + "=" + y);
}

