$(function(){

  if ($.browser.msie && $.browser.version == '6.0') {
    $('.event h5 a ins').each(function(){
      $(this).width($(this).parent().width() - 4);
      $(this).height($(this).parent().height() -4);
      $(this).css('line-height',$(this).parent().height() - 4);

    });


    $('.event h5 a').hover(function(){
      $(this).children('ins').show();
    }, function(){
      $(this).children('ins').hide();
    });

  } else {

    $('.event h5 a ins').each(function(){
      $(this).width($(this).parent().width() - 4);
      $(this).height($(this).parent().height() - 4);
    });
  }

  $('a.switch','#header').click(mapOpen);

  //$('div.events-overview ul').jcarousel({scroll: 1, auto: 5, wrap: 'circular'});

  $('div.events-overview').fixedScrollGallery();

 setArtwallHeight();
  
});

function setArtwallHeight() {
  var artwall = $('div.events-box'),
      aside = $('#aside'),
      aside_bottom = aside.offset().top + aside.height();

  if (aside_bottom < artwall.offset().top + artwall.height()) {
    var artwall_height = Math.ceil((aside_bottom - artwall.offset().top) / 201) * 201 + 3;
    artwall.height(artwall_height);
  }
}
