$(document).ready(function() {
  /* Setup a global hover */
  $(".hover").hover(
    function() {
      $(this).children().not(".over").hide();
      $(".over",this).show();
    },
    function () {
      $(this).children().not(".over").show();
      $(".over",this).hide();
    }
  );
  
  /* Hide via javascript (as opposed to CSS) */
  $(".hidden-js").hide();

  /* Transition page via jQuery */
  $(".page").each(function() {
    $(this).click(function() {
      page($(this).attr("rel"));
      return false;
    });
  });
  
  /* Play video on the home page */
  $("#playvideo").click(function() {
    $(this).fadeOut(function() {
      $(".video object").fadeIn();
    });
    return false;
  });
});

function page(target) {
  $(".content").animate({opacity:0},500,function() {
    $(this).animate({opacity:1.0});
  });
}

function trim(str) {
 return str.replace(/^\s+|\s+$/g,'');
}
