$(document).ready(function() {
  
  $("#mainNav li").hover(
    function() {
      $(this).children('.dropdown').css({'display':'block'})
      $(this).children('.topnav').addClass("hover")
    },
    function() {
      $(this).children('.dropdown').css({'display':'none'})
      $(this).children('.topnav').removeClass("hover")
    }
  );
  
  $(".mainContent div.overview").hover(
    function() {
      $(this).children('a').css({'background-position':'bottom'})
    },
    function() {
      $(this).children('a').css({'background-position':'top'})
  });
  
  $( "#radio" ).buttonset();

  
});
      
$.fn.resize = function(max_size) {
  m = Math.ceil;
  if (max_size == undefined) {
    max_size = 50;
  }
  h=w= max_size;
  $(this).each(function() {
    image_h = $(this).height();
    image_w = $(this).width();
    if (image_h > image_w) {
      w = m(image_w / image_h * max_size);
    } else {
      h = m(image_h / image_w * max_size);
    }
    $(this).css({height:h,width:w});
  })
};




