/** coded by 
Shawn Hill
Bernstein Rein
12.10.2009
requires jQuery 1.2.6 **/


// this variable keeps track of the selected home.
var selected = '';

// overrides the page jump action
function goTo( newSection ){
  // get index number for home
  if (newSection.indexOf('#') > -1){ newSection = newSection.substr( newSection.indexOf('#')+2 ); }
  // only change if this is a different home
  if(selected != newSection){
    // show other home
    $('#timeline-content-'+selected).hide();
    $('#timeline-content-'+newSection).fadeIn("slow");
    // switch selected thumb
    $('#a'+selected).removeClass("selected");
    $('#a'+newSection).addClass("selected");
    // set the current home to selected variable
    selected = newSection;
				return false;
  }
}

// page initialization function
$(document).ready( function(){
  // hide home views
  $('#column-one > div').hide();
  // set up thumb links to change view
  $('#dates li a').click( function(){ return goTo( this.href.substr(2) ); });
  // show first home or linked home
  goTo( ((location.href.indexOf('#') > -1) ? location.href : '34' ) );
});


