
$(function () {
  
 // check for 0
 // $('#tabs').tabs();
  
  $('#question-mark').cluetip( { cluetipClass: 'jtip', arrows: true, 
                                 local: true, dropShadow: true, hoverIntent: false });
  
  // show shopping sub-category when hovered over
  $('#n-shop').mouseover( function() {
    $('#main-nav-sub').slideDown();
    ('#n-shop a').attr('class', 'active');
  });

  $('#bd').mouseover( function() {
   $('#n-shop a').attr('class', '');
  });

  $('#n-home').mouseover( function() {
    $('#n-shop a').attr('class', '');
  });

  $('#n-farmers').mouseover( function() {
    $('#n-shop a').attr('class', '');
  });

  $('.splash-slideshow .pic-select').mouseover(function() {  // slideshow rollover
    $('.pic-select a').attr('class', 'bunk');
    $(this).children('a').attr('class', 'active');   // change active highlight
    
    var id = $(this).attr('id').split('-')[1]; // grab the id name of the list
    $('.slide').hide();
    $('#' + id).show(); // list id corresponds to the slideshow to display
  });

  $(":input[name='zipcode']").focus(function () {
    $(":input[name='zipcode']").val(''); // clear zipcode box when focus obtained
  });

  //populateFreshThisWeek();
  //populateBlogEntries();
});


// Populate the fresh this week list from twitter list.
function populateFreshThisWeek() {
  $('#fresh-this-week').hide();
  $('#fresh-this-week').load('/home/fresh_this_week', null, function() {
    $('#spinner-fresh-this-week').hide();
    $('#fresh-this-week').slideDown();
  });
}

// Populate the blog entries from the greenling blog.
function populateBlogEntries() {
  $('#blog-tab').load('/home/blog_entries', null, function() {
    $('spinner-blog-tab').hide();
  });
}


