var CR2008 = Class.create();
CR2008.prototype = {
  initialize : function(){
   	this.side_nav();
   	this.link_glossary();
  },

	// Do Side Nav Hover Actions
	side_nav: function(){
		$$('#cr-nav li').each(function(li) {
			Event.observe(li, 'mouseover', function(item){ li.addClassName('hover')});
			Event.observe(li, 'mouseout', function(item){ li.removeClassName('hover')});
		});
	},
	
	
	link_glossary: function(){
    var content = $('innercontent');
    var content_string = content.innerHTML;
    var terms = ["Barrel" , "bbl", "bcfe/d" , "boe" , "boe/d" , "CH<sub>4</sub>" , "CO<sub>2</sub>e" , "Corporate Responsibility" , "EU" , "Environmental Audit" , "Environmental Impact Assessment or EIA" , "Gigajoules" , "GJ", "Global Reporting Initiative" , "GRI", "Kyoto Protocol" , "m<sup>3</sup>" , "mboe/d" , "mcf" , "mg/L" , "mmboe" , "mmcf/d" , "Non-Government Organizations" , "NGOs", "Operator" , "Production Carbon Intensity" , "PCI", "Production Energy Intensity" , "PEI", "UK" , "UNGC", "UN " , "US"]
    for (var t = terms.length - 1; t >= 0; t--){
      if(content_string.indexOf(terms[t]) > -1){
        content_string = content_string.gsub(terms[t], '<a href="/2008/glossary-and-abbreviations.html">'+terms[t]+'</a>');
      }
    }
    if (window.location.href.indexOf('glossary-and-abbreviations') == -1) {
      content.innerHTML = content_string;
    }
	}
	
	
};

Event.observe(window, 'load', function(){cr = new CR2008();})




