document.observe('dom:loaded', function(){

 $$('#fmp-heading, #bento-heading').invoke('hide'); 
 $$('#news-nav a').each(function(a) {
    a.observe('click', function(e) {
      Event.stop(e);
  		
  		// select view from news nav    
      $$('#news-nav li').invoke('removeClassName','selected');
      var newsview = $(this).up('li').id;
      $(newsview).addClassName('selected');
      
      // show selected content
      var showthese = ($(this).readAttribute('href')).substr(1); // get href, minus the hash
      var showthese2 = showthese+'-heading';
      if(showthese=='all') { // if 'all' show everything
        $$('#all-heading, #fmp-heading, #bento-heading').invoke('hide'); 
        $('all-heading').show();
      	$$('#fmp, #bento, #all-heading').invoke('show');
      } else {
      	$$('#fmp, #bento').invoke('hide'); // hide everything
      	$$('#all-heading, #fmp-heading, #bento-heading').invoke('hide'); 
      	$(showthese).show(); // show only fmp or bento      	
      	$(showthese2).show();
      }
    }.bindAsEventListener(a));
  })

});

// similar script done for /contact/media/press-releases/index.html
