jQuery.fn.popup = function(options) {
  options = $.extend({
    location:   'yes',
    resizable:  'yes',
    status:     'yes',
    scrollbars: 'no',
    menubar:    'no'
  }, options);
  
  var features = [];
  for (var key in options) {
    features.push(key + "=" + options[key]);
  }
  
  $(this).click(function() {
    window.open($(this).attr('href'), "popup", features.join(','));
    return false;
  });
};

$(function() {
  $('.bio').each(function() {
    var src = $(this).attr('src');
    var bio = $('<div class="bio" />');
    
    bio.css({
      'background-image': 'url(' + src + ')',
      'width': '215px',
      'height': '400px',
      'cursor': 'pointer'
    });
    bio.hover(function() { $(this).css('background-position', '0 -400px'); }, function() { $(this).css('background-position', '0 0'); })
    
    $(this).replaceWith(bio);
  });
  
  $('.nav-in-stores a').popup({ width: 703, height: 380 });
  $('.nav-feedback a').popup({ width: 703, height: 430 });
  $('.nav-sign-up a').popup({ width: 703, height: 460 });
});
