$(document).ready(function() {
  $('#band').css('opacity', 0.5);
  if($('div#webetui_toolbar').length == 0) {
    var height = $('#text').height();
    //$('#text').css('height', height);
    
    var min = $('<a id="min" class="knop"></a>');
    min.click(function() {
        $('#menu, p, form, .gallery, #map, ul').fadeOut(500);
        $('#text').animate({height:'15px'}, 500, 'swing', 
          function() {
            $('a#min').addClass('clicked');
            $('a#plus').removeClass('clicked').text('klik hier');
          });
      });
    
    var plus = $('<a id="plus" class="knop clicked"></a>');
    plus.click(function() {
        $('#menu, p, form, .gallery, #map, ul').fadeIn(500);
        $('#text').animate({height:height}, 500, 'swing',
          function() {
            $('a#plus').addClass('clicked').text('');
            $('a#min').removeClass('clicked');
            
          });
      });
    
    $('#text').append(min).append(plus);
  }
  
  $('div.thumbs img').click(function() {
    var src = $(this).attr('src');
    src = src.replace(/_thumb/, '');
    var img = $('<img class="groot" src="' + src + '" width="336" height="496"/>').hide();
    $('div#text').append(img);
    img.fadeIn('medium');
  });
  
  /*
  if($('div#map').length) {
    $('div#map, div#text').animate({width:575});
  }
  if($('div.thumbs').length) {
    $('div#text').animate({width:420});
  }
  */
});