$(document).ready(function() {
  /*
   * Poista viimeisen uutisotsikon alamarginaali
   *
   */
  $(".news li:last-child").css("padding", "0");


  /*
   * Näytä maisema
   *
   */
  $(".scenery_open").click(function() {
    $(this).hide();
    $(".scenery_close").show();

    if (jQuery.support.leadingWhitespace) {
      $(".header, .frame, .footer").fadeOut("slow");
      $(".scenery_selector").fadeIn("slow");
    } else {
      $(".header, .frame, .footer").hide();
      $(".scenery_selector").show();
    }

    $(".scenery").fadeIn("slow");
  });


  /*
   * Piilota maisema
   *
   */
  $(".scenery_close").click(function() {
    $(this).hide();
    $(".scenery_open").show();
    $(".scenery_selector").hide();

    if (jQuery.support.leadingWhitespace) {
      $(".header, .frame, .footer").fadeIn("slow");
    } else {
      $(".header, .frame, .footer").show();
    }

    $(".scenery").fadeOut("slow");
  });


  /*
   * Pienennä sisältöaluetta jos pikkukuva käytössä
   *
   */
  if ($(".smallphoto").length) {
    $(".column_right").height($(".column_right").height() - ($(".smallphoto").height() + 20));
  }
});
