$(function () {

  // Headings
  Cufon.replace('h1, h2, h3, h4, #banner_title span, .boldp, .boldp_border, #banner_title_not_home');

	// Finds rel="external" and makes the link open in a new window, plus adds a new window icon
  $('a[rel*=external]').click( function(e) {
      e.preventDefault();
      window.open(this.href);
  }).append('&#160;<img class="external-img" src="/images/backgrounds/external-bg.gif" width="11" height="8" alt="This link will open in a new window." />');
  
  $('#header li.bookmark').next().addClass('group');
  
	$("a.bookmark").click(function(e){

    e.preventDefault();
  	var bookmarkUrl = this.href;
  	var bookmarkTitle = this.title;
  	if (window.sidebar) {
  	  window.sidebar.addPanel(bookmarkTitle, bookmarkUrl,"");
  	} else if( window.external || document.all) {
  		window.external.AddFavorite( bookmarkUrl, bookmarkTitle);
  	} else if(window.opera) {
  		$("a.bookmark").attr("href",bookmarkUrl);
  		$("a.bookmark").attr("title",bookmarkTitle);
  		$("a.bookmark").attr("rel","sidebar");
  	} else {
  	  alert('Your browser does not support this bookmark action');
  	  return false;
  	}
  });
    
});
