// Full List Code V1.00 - uses internally generated JavaScript object containing all price names and combinations
var taxrate = 1.175;		// Set to 1.175 if you want tax inclusive prices.  Set to 1 for tax exclusive
var perms = new Object();

function changeprice(ref){
  var span = document.getElementById(ref + '_clist');
  var sels = span.getElementsByTagName('select');
  var thistext = ref;
  for ( var i=0; i < sels.length; i++ )
    {
    thissel = sels[i];
    thistext += '|' + thissel.options[thissel.selectedIndex].text;
    }
  var val;
  if ( perms[thistext] == null ) 	// the Allow none option
    {
    val = '<font color="gray">£0.00</font>';
    }
  else
    {
    var val = perms[thistext] - 0;
    if ( val == -1 )
      {
      alert('This combination is sold out, sorry');
      val = '<font color="red">£---</font>';
      }
    else
      {
      val = val * taxrate;
      val = '£' + val.toFixed(2);
      }
    }
  if ( document.getElementById(ref + '_ctotal') )
    {
    document.getElementById(ref + '_ctotal').innerHTML = val;
    }
}

function setupprices(ref){
  var span = document.getElementById(ref + '_clist');
  var sels = span.getElementsByTagName('select');
  for ( var i=0; i < sels.length; i++ )
    {
    thissel = sels[i];
    thissel.onchange = function(){changeprice(ref);};
    }
  changeprice(ref)
}

