$(document).ready(function() {
  if ($('#rightmenu_container').length) {
    // Rechter menu bestaat, niets doen
  } else {
    // Rechter menu bestaat niet, verander de padding van 180px naar 5px
    $('#content').css('padding-right','8px');
  }

  elem = document.getElementById('content_container');
  if (elem.clientHeight < elem.scrollHeight) {
    // Heeft een scrollbar, laat de width zo
  } else {
    // Heeft geen scrollbar, width = -24px;
    $('#content_container').css({width:'815px'});
  }

  $('.imgShowerPicture').click(function () {
    changePicture(this.id);
  });

  $('.left').click(function() {
    var id = $('#imgShower').attr("alt");
    id--;
    if (id < 0) {
      id = images.length - 1;
    }
    changePicture(id);
  });

  $('.right').click(function() {
    var id = $('#imgShower').attr("alt");
    id++;
    if (id > images.length - 1) {
      id = 0;
    }
    changePicture(id);
  });

  function changePicture(id) {
    if (!$('#imgCont').html()) {
      $('#picNav').show();
      $('#imgCont').html('<img id="imgShower" />');
    }
    $("#imgShower").hide();
    $('#imgShower').attr("src",'http://www.rossholidays.nl'+images[id][0]);
    $('#imgShower').attr("alt",[id]);
    $('#imgShower').attr("title",images[id][1]);
    $('#imgDescr').html(images[id][2]);
    $("#imgShower").show();
  }
});