$(document).ready(function()
{
  $(window).resize(function()
  {
    repositionFooter();
  });
  repositionFooter();
  
  // Params for video player
  var params = {
    menu: "false",
    wmode: "transparent",
    salign: "lb"
  };
  
  $('.article-image').innerfade({
    speed: 'slow',
    timeout: 3500,
    type: 'sequence',
    containerheight: '300px'
  }); 
 
  $('.play-me').each(function()
  {
    $(this).children().each(function()
    {
      swfobject.embedSWF("/assets/flash/sound_player.swf", $(this).children().attr('id'), "155", "85", "9.0.0", "", {src: $(this).attr('class')}, params, {});
    });
  });
});

function repositionFooter()
{
  dh = $(document).height();
  wh = $("#wrapper").height();

  if (dh > wh)
  {
    $("#wrapper").css("height", dh);
    $("#footer").css("position", "absolute");
    $("#footer").css("bottom", "0");
  }
}
