function addProductEvent() {
  $$('.prodDetails .addToBasket input.submitButton').each(function(e){
    e.observe('click', function(event) {
      var element = Event.element(event);
      element.up('form').down('input[type=hidden]').value = element.readAttribute('rel');
    });
  });
}

// Postal code autoselect events setting
//
function setAutocompleteEvents_Firezza() {
  var url = 'http://firezza.com/ajax_find_postcodes.php';
  new Ajax.Autocompleter('postalCodeField', 'postalCodeList', url, {
    choices: 10,
    minChars: 1,
    indicator: 'postalCodeLoading',
    paramName: 'first_chars'
  });

  $('postalCodeField').observe('keyup', function(event){
      if($('postalCodeField').value == '') $('postalCodeWarning').hide();
  });

  $('postalCodeField').observe('keyup', function(event){
    var ch = (event.which) ? event.which : event.keyCode;
    if(ch == 8) $('postalCodeWarning').hide();
  });
}

function clickConfirm() {
  return confirm('WARNING! You will be logged out and your basket will be lost. Do you want to continue?');
}

