jQuery(function($) {
	//put your init junk here
	setupZoom();
	
	var slug = window.location.pathname;
	
  //alert(slug);
	
	jQuery('a[rel*=facebox]').facebox()
	
	Cufon.replace(".quote");
	Cufon.replace(".source");
	
	$("#events").cycle({
	  fx: 'scrollUp'
	});
	
	$("#header li").mouseover(function(){
	  $(this).attr("class", "selected");
	  $(this).click( function() {
	    clicked = $(this).children(".item").children(".link").attr("href");
	    window.location = clicked;
	  });
  });
  
  $("#header li").mouseout(function(){
	  $(this).attr("class", "");
	  //if slug is same as link, keep it selected.	  
  	SelectMenu();
  });
});

function SelectMenu() {
  var slug = window.location.pathname;
  $("#header li .link").each( function (){
    var current = $(this).attr("href");
	  if (current == slug) {
	    $(this).parent().parent().attr("class", "selected");
	  }
  });
};

jQuery(function($) {
  setOutlineHeight();
});

function setOutlineHeight() {
  height = Math.max($('#right').height(), $('#left').height());
  $.each([$('#outline')], function() {
    this.css('height', height + 'px');
  });
}

function switchToQuote() {
  //alert("switch!");
  $.get("/index/quote", function(data) {
    $('#left').html(data);
    Cufon.replace(".quote");
    Cufon.replace(".source");
    Cufon.now();
  });

}