﻿$(document).ready(function() {
  $('.hoverbox').click(function() {
    $(this).parent().children('a').click();
  });

  $('.centerbox').hover(
    function() {
      var obj = $(this);
      obj.css({'z-index': 1000});
      obj.next().fadeIn(250);
    },
    function() {
      var obj = $(this);
      if(obj.is('.centerbox')) obj = obj.children('.hoverbox');
      obj.next().fadeOut(500);
      obj.parent().css({'z-index': 10});
    }
  );
});
