var events = {
    event0:{
       name:'Michaelmas 2008',
       content:'<p>\
         This Michaelmas set out to be a term of great expectations.\
         It had been three years since Christ Church Regatta had been\
         held, and so three years since Exeter had last won it. Though\
         there were patches of heavy rain that threatened everyone\'s\
         parades, regatta week was cloudy, dry and all about the\
         rowing.  \
       </p>\
        <p>\
         The Saturday before Christ Church, four of Exeter\'s five\
         novice crews raced in Nephthys Regatta, which is a smaller\
         event run by OULRC over the Christ Church course.  All crews\
         enjoyed their introduction to racing; and the Men\'s A crew\
         won, beating St. Johns with clear water over a - shortened -\
         400m course in the final.  \
       </p>\
        <p>\
         On the first day of Christ Church, three men\'s crews and two\
         women\'s crews began racing.  The Men\'s C crew had some\
         difficulty, but all the others proceeded to swipe some\
         impressive scalps as the week went on: both B crews made it\
         to Friday, with the Men\'s Bs beating Pembroke A in the first\
         round.  \
       </p>\
        <p>\
         The Women\'s A crew were beaten in the first round by the\
         eventual winners, Wadham.  From their repechage onward, they\
         picked their way neatly through the competition, and into the\
         last 16 where they lost by less than a canvas to New. The\
         Men\'s A crew dispensed with six crews on their way to the\
         final - the closest margin being of three lengths of clear\
         water - where they met St. Peter\'s.  Exeter led for all but\
         the last 100m, but were left a few feet from what would have\
         been a well deserved win.  \
       </p>\
        <p>\
         Anyone who has ever been involved with ECBC will know how\
         much pride we take in training our novices well. There is no\
         more inclusive or dedicated programme in Oxford.  Without the\
         efforts of all the novices\' coaches - and these words so\
         poorly describe the hundreds of training hours, and the\
         degree of emotional investment given by them freely, and\
         matched by the rowers there would be no Boat Club.  \
       </p>\
        <p>\
         Both the Men\'s and Women\'s senior squads have continued to\
         train at Wallingford this term. Lynch Mason returns as\
         Exeter\'s Head Coach and Richard joins us as the Men\'s\
         coach. Both Philip Pullman and Lady Galadriel are racked at\
         Wallingford Boat House, and an Exeter coxed four currently at\
         OUBC in Wallingford has meant both the men\'s and women\'s\
         squads have had a variety of outings this term. At the end of\
         7th Week the women entered an eight made up of some senior\
         rowers and some of the novice A team into Wallingford Head\
         and recorded a fantastic time, coming 6th out of nine in the\
         Novice category. This gave them great race experience for\
         both Bedford Head and the Women\'s Head of the river next\
         term. The women have twelve experienced rowers in the senior\
         squad at the moment which together with some strong novices\
         gives us the potential to do very well in Torpids and some\
         external events next term. We also have five Exonians\
         trialling for University Squads this year. Best of luck to\
         Mike Turner, OULRC, Katherine La France and Matthew Smith,\
         OUWLRC, and Meredith Riedel and Ruth Barber, OUWBC. \
       </p>\
        <p>\
         The Olly and Deep memorial fund raised a total of\
         &pound;60,947. Some went towards the purchase of two benches\
         in memorial of the boys which are now in the Fellow\'s\
         Garden. The rest will be used to refurbish the boat house\
         next year. Both boys were members of last years Men\'s Novice\
         A boat.\
       </p>\
        <p>\
         Towards the end of Trinity term, ECBC won &pound;500 in\
         sponsorship from Ernst & Young by entering an activity day.\
         This money was put towards the purchase of three second-hand\
         ergos, bringing the boat club total to eight. Also, Matthew\
         Smith, ECBC President, worked hard at the end of the vacation\
         together with the Development Director and Old Member, DJ\
         Betts (2006, PPE) to secure new sponsorship from Parthenon. \
       </p>\
        <p>\
         We are also pleased to announce that we have acquired a\
         silver medal won by Exeter in 1880 from Sanda Lipton of\
         Antique Silver. We hope that Sanda will join us at the ECBCA\
         Dinner where the Medal will be presented as an award.\
       </p>\
        <p>\
         Our new website is up and expanding. Thanks to Ben Cox for\
         all his hard work in putting it together.\
         http://www.exetercollegebc.org.uk/ The Women would also like\
         to thank Jesse Simon (2006, DPhil in Late Roman History) for\
         designing the new Women\'s 1st VIII silver brooches. Any Old\
         Members who competed for the Women\'s 1st VIII in Torpids or\
         Eights are welcome to order one. For more details, please\
         contact jessica.houlgrave@exeter.ox.ac.uk.\
       </p>\
        <p>\
         Overall we have had a fantastic start to 2008-2009. A large\
         number of returning rowers together with some fantastic\
         potential displayed by the novices means that this year could\
         be very exciting indeed for the Boat Club.\
       </p>\
        <p>\
         Jessica Houlgrave<br />\
         Women\'s Captain<br />\
         2008-2009\
       </p>\
'
    }
};

var Dom = {
    get: function(el) {
        if (typeof el === 'string') {
            return document.getElementById(el);
        } else {
            return el;
        }
    },
    add: function(el, dest, before) {
        var el = this.get(el);
        var dest = this.get(dest);
        if (before) {
            dest.insertBefore(el, dest.firstChild);
        } else {
            dest.appendChild(el);
        }
    },
    remove: function(el) {
        var el = this.get(el);
        el.parentNode.removeChild(el);
    }
};

var Event = {
    add: function() {
        if (window.addEventListener) {
            return function(el, type, fn) {
                Dom.get(el).addEventListener(type, fn, false);
            };
        } else if (window.attachEvent) {
            return function(el, type, fn) {
                var f = function() {
                    fn.call(Dom.get(el), window.event);
                };
                Dom.get(el).attachEvent('on' + type, f);
            };
        }
    }()
};

function updateHTML(elmId, value) {
  document.getElementById(elmId).innerHTML = value;
}

function setResult(id) {
  var resultId = id.replace(/[^0-9]/, "");
  var event = eval("events.event" + resultId);
  if (event) {
    updateHTML('news', event.content);
    updateHTML('newstitle', event.name);
    document.title = event.name + " - News - Exeter College Boat Club, Oxford";
  }
}

Event.add(window, 'load', function() {
  
  var resultGetId = findGETVariable('result');
  if (resultGetId != null) {
    setResult(resultGetId);
  }
  
  var anchors = document.getElementById('menu').getElementsByTagName('a');
  for (var i = 0; i < anchors.length; i++) {
    var anchor = anchors.item(i);
    var href = anchor.href;
    
    var closureMaker = function(reference) {
      return function(e) {
        var splitReference = reference.split('=');
        setResult(splitReference[splitReference.length - 1]);
        stopDef(e);
      }
    }
    var closure = closureMaker(href);
    Event.add(anchor, 'click', closure);
  }

});

function findGETVariable(name) {
  var URL = unescape(window.document.location);
  
  if (URL.indexOf("?") > -1) {
    var pairs = URL.split("?")[1].split("&");
    for (var i = 0; i < pairs.length; i++) {
      var parts = pairs[i].split("=");
      if (parts[0] == name) {
        return parts[1];
      }
    }
  }
  return null;
}

function stopDef(e) {
  e = e || event;
  if (e.preventDefault) {
      e.preventDefault(); // All browsers except IE
  } else {
      e.returnValue = false; // IE
  }
}