function paymethods()
{
  q = confirm('At PayPal, you can use a range of credit and debit cards \n' +
              'and you can also transfer money from your bank account. \n\n' +
              'If you want to post a cheque to us, you can register the \n' +
              'payment online to save paperwork. You will receive a \n' +
	      'reference number to write on the back of your cheque\n\n' +
   	      'Do you want to go to the payment information page for \n' +
              'further information?');
  return q;
}

function listEurope()
{
  q = confirm('Western Europe comprises the following list of countries,  \n' +
  	      'Austria, Belgium, Denmark, Finland, France, Germany,  \n' +
  	      'Greece, Greenland, Iceland, Republic of Ireland, Italy,  \n' +
  	      'The Netherlands, Norway, Portugal, Spain, Sweden,  \n' +
  	      'Switzerland. All other European countries (whether or not \n' +
  	      'they are in the European Union) count as \'Rest of World\').\n\n' +
   	      'Do you want to go to the publications FAQ page for \n' +
              'further information?');
  return q;
}


function ageBCRA()
{
  d = new Date();
  age = d.getFullYear() - 1973;
  document.write(age);
  document.close();
}


// ------------------------------------------------------------
// Trap all calls to forms
// ------------------------------------------------------------

/* The following function is used as...
   <A ONCLICK="return roadworks(this.href);" HREF="forms/M1.html">
   <A ONMOUSEOVER="this.search='?f=M1';" HREF="forms.html" ONCLICK="return roadworks(this.search);"

... which is now replaced (to cure the Nick Williams bug) by

   <A ONCLICK="return roadworks(this.href);" HREF="forms/M1.html">
   <A ONMOUSEOVER="this.href='forms.html?f=M1';" HREF="forms.html" ONCLICK="return roadworks(this.href);"
*/

function roadworks(s)
{
  if (s.indexOf('?f=') > 0)   // was ==0 but s now contains whole URL, incl 'html' so this test now goes first;
  {
  // ----- PDF documents -----

    if (s.indexOf('M2') > 0)
    {
      q = window.confirm(
      '[ref: ' + s + ' ]\n\n' +
      'A downloadable form M2 is not yet available from this site. \n' +
      'However, you can use the version of the form that is on the \n' +
      'main BCA web-site at http://british-caving.org.uk/?page=19 \n' +
      '\n' +
      'Do you want to go there now?');
      
      if (q)
      {
        location.href = 'http://british-caving.org.uk/?page=19';
      }
      
      return false;
    }

    if (s.indexOf('M5') > 0)
    {
      q = window.confirm(
          '[ref: ' + s + ' ]\n\n' +
          'Form M5 is for internal use by BCRA staff only. \n' +
          'Its not exactly secret but there is no point in \n' +
          'looking at it if you are not a BCRA officer.\n' +
          '\n' +
          'Do you want to download it?');
          
          return q;
    }

    
    if (s.indexOf('M1') > 0) return true;
    if (s.indexOf('M3') > 0) return true;
    if (s.indexOf('M4') > 0) return true;
    if (s.indexOf('D1') > 0) return true;
    if (s.indexOf('D2') > 0) return true;
    if (s.indexOf('D3') > 0) return true;
    if (s.indexOf('P1') > 0) return true;
    if (s.indexOf('P2') > 0) return true;
    
    window.alert(
    '[ref: ' + s + ' ]\n\n' +
    'Programming error 02. Feel like reporting it?');	// form reference not found in forms.html?f=nn
    return false;
  }

  else if (s.indexOf('html') > 0)
  {
  // ----- HTML documents -----

    if (s.indexOf('M2') > 0)
    {
      window.alert(
      '[ref: ' + s + ' ]\n\n' +
      'Online payment and general information for Groups \n' +
      'and Access-Controlling Bodies is not yet available \n' +
      'on this site. \n\n' +
      'However, we expect that most clubs will wish to \n' +
      'pay by cheque from a club account, so this should \n' +
      'not cause you too much inconvenience. To pay by \n' +
      'PayPal, please ask for a payment reference. Online \n' +
      'payment forms will be available at a later date.\n')
      return false;
    }

    if (s.indexOf('M1') > 0) return true;
    if (s.indexOf('M3') > 0) return true;
    if (s.indexOf('M4') > 0) return true;
    if (s.indexOf('D1') > 0) return true;
    if (s.indexOf('D2') > 0) return true;
    if (s.indexOf('D3') > 0) return true;
    if (s.indexOf('P1') > 0) return true;
    if (s.indexOf('P2') > 0) return true;
    
    window.alert(
    '[ref: ' + s + ' ]\n\n' +
    'Programming error 01. Feel like reporting it?');	// form reference not found in forms/nn.html
    return false;
  }
  
  else
  {
    window.alert(
    '[ref: ' + s + ' ]\n\n' +
    'Programming error 03. Feel like reporting it?');   // call didnt contain either of above expressions
    return false;
  }

}


