addLoadListener(init);

function init()
{
  document.getElementById('all_saints').onclick = function()
  {var survey = makePopup(this.href, 720, 520, 'scroll'); return survey.closed;};
  document.getElementById('st_andrew').onclick = function()
  {var survey = makePopup(this.href, 720, 520, 'scroll'); return survey.closed;};
  document.getElementById('St_Augustine').onclick = function()
  {var survey = makePopup(this.href, 720, 520, 'scroll'); return survey.closed;};
  document.getElementById('St_Benedict').onclick = function()
  {var survey = makePopup(this.href, 720, 520, 'scroll'); return survey.closed;};

  document.getElementById('St_Clement').onclick = function()
  {var survey = makePopup(this.href, 720, 520, 'scroll'); return survey.closed;};
  document.getElementById('St_Edmund').onclick = function()
  {var survey = makePopup(this.href, 720, 520, 'scroll'); return survey.closed;};
  document.getElementById('St_Etheldreda').onclick = function()
  {var survey = makePopup(this.href, 720, 520, 'scroll'); return survey.closed;};
  document.getElementById('St_George_Colegate').onclick = function()
  {var survey = makePopup(this.href, 720, 520, 'scroll'); return survey.closed;};

  document.getElementById('St_George_Tombland').onclick = function()
  {var survey = makePopup(this.href, 720, 520, 'scroll'); return survey.closed;};
  document.getElementById('St_Giles').onclick = function()
  {var survey = makePopup(this.href, 720, 520, 'scroll'); return survey.closed;};
  document.getElementById('St_Gregory').onclick = function()
  {var survey = makePopup(this.href, 720, 520, 'scroll'); return survey.closed;};
  document.getElementById('St_Helen').onclick = function()
  {var survey = makePopup(this.href, 720, 520, 'scroll'); return survey.closed;};

  document.getElementById('St_James_Pockthorpe').onclick = function()
  {var survey = makePopup(this.href, 720, 520, 'scroll'); return survey.closed;};
  document.getElementById('St_John_de_Sepulchre').onclick = function()
  {var survey = makePopup(this.href, 720, 520, 'scroll'); return survey.closed;};
  document.getElementById('St_John_Maddermarket').onclick = function()
  {var survey = makePopup(this.href, 720, 520, 'scroll'); return survey.closed;};
  document.getElementById('St_John_Timberhill').onclick = function()
  {var survey = makePopup(this.href, 720, 520, 'scroll'); return survey.closed;};
  
  document.getElementById('St_Julian').onclick = function()
  {var survey = makePopup(this.href, 720, 520, 'scroll'); return survey.closed;};
  document.getElementById('St_Lawrance').onclick = function()
  {var survey = makePopup(this.href, 720, 520, 'scroll'); return survey.closed;};
  document.getElementById('St_Margaret').onclick = function()
  {var survey = makePopup(this.href, 720, 520, 'scroll'); return survey.closed;};
  document.getElementById('St_Martin_at_Oak').onclick = function()
  {var survey = makePopup(this.href, 720, 520, 'scroll'); return survey.closed;};

  document.getElementById('St_Martin_at_Palace').onclick = function()
  {var survey = makePopup(this.href, 720, 520, 'scroll'); return survey.closed;};
  document.getElementById('St_Mary_Coslany').onclick = function()
  {var survey = makePopup(this.href, 720, 520, 'scroll'); return survey.closed;};
  document.getElementById('St_Mary_the_Less').onclick = function()
  {var survey = makePopup(this.href, 720, 520, 'scroll'); return survey.closed;};
  document.getElementById('St_Michael_Coslany').onclick = function()
  {var survey = makePopup(this.href, 720, 520, 'scroll'); return survey.closed;};

  document.getElementById('St_Michael_at_Plea').onclick = function()
  {var survey = makePopup(this.href, 720, 520, 'scroll'); return survey.closed;};
  document.getElementById('St_Peter_Hungate').onclick = function()
  {var survey = makePopup(this.href, 720, 520, 'scroll'); return survey.closed;};
  document.getElementById('St_Peter_Mancroft').onclick = function()
  {var survey = makePopup(this.href, 720, 520, 'scroll'); return survey.closed;};
  document.getElementById('St_Peter_Parmentergate').onclick = function()
  {var survey = makePopup(this.href, 720, 520, 'scroll'); return survey.closed;};

  document.getElementById('St_Saviour').onclick = function()
  {var survey = makePopup(this.href, 720, 520, 'scroll'); return survey.closed;};
  document.getElementById('St_Simon_and_St_Jude').onclick = function()
  {var survey = makePopup(this.href, 720, 520, 'scroll'); return survey.closed;};
  document.getElementById('St_Stephen').onclick = function()
  {var survey = makePopup(this.href, 720, 520, 'scroll'); return survey.closed;};
  document.getElementById('St_Swithin').onclick = function()
  {var survey = makePopup(this.href, 720, 520, 'scroll'); return survey.closed;};	

  return true;
}

function makePopup(url, width, height, overflow)
{

  if (overflow == '' || !/^(scroll|resize|both)$/.test(overflow))
  {
    overflow = 'both';
  }

  var win = window.open(url, '',
      'width=' + width + ',height=' + height
      + ',scrollbars=' + (/^(scroll|both)$/.test(overflow) ? 'yes' : 'no')
      + ',resizable=' + (/^(resize|both)$/.test(overflow) ? 'yes' : 'no')
      + ',status=yes,toolbar=no,menubar=no,location=no'
  );

  return win;
}

function addLoadListener(fn)
{
  if (typeof window.addEventListener != 'undefined')
  {
    window.addEventListener('load', fn, false);
  }
  else if (typeof document.addEventListener != 'undefined')
  {
    document.addEventListener('load', fn, false);
  }
  else if (typeof window.attachEvent != 'undefined')
  {
    window.attachEvent('onload', fn);
  }
  else
  {
    var oldfn = window.onload;
    if (typeof window.onload != 'function')
    {
      window.onload = fn;
    }
    else
    {
      window.onload = function()
      {
        oldfn();
        fn();
      };
    }
  }
}

