Cufon.replace('div#recipe_results h3, div#recipe_results h2, div.float-holder-left h3');

$(document).ready(function() {
  $('#most_popular ul.tabs li').each(function() {
    $(this).click(function() {
      $('#most_popular ul.tabs li.active').removeClass('active');
      $('#most_popular ul.tab.active').removeClass('active');
      
      $(this).addClass('active');
      target = '#most_popular ul.tab.'+$(this).attr('ref');
      $(target).addClass('active');
    })
    $(this).css('cursor', 'pointer')
  })
  
  // setup accordion links.
  // traverses the dom to know which links to toggle.
  $('div.float-holder-left li.more a').each(function() {
    $(this).click(function() {
      $(this).parent().parent().children('li.more_children').each(function() {
        var display = $(this).css('display')
        $(this).css('display', display == 'none' ? 'block' : 'none');
      })
      
      if ($(this).attr('old_html')) {
        $(this).html($(this).attr('old_html'))
        $(this).attr('old_html', '')
      } else {
        $(this).attr('old_html', $(this).html())
        $(this).html('[-] see less');
      }
      
      return false;
    })
  })
  // tell the headings to link to the same thing as the a links
  $('div.float-holder-left h3').each(function() {
    $(this).css('cursor', 'pointer')
    $(this).click(function() {
      $(this).next().find('li.more a').click()
    })
  })
})