$(document).ready(function() {
   // $('body#index div.container').each(
   //     function() {
   //       var div = $('<div></div>').addClass('transparent').css( { width:$(this).width(), height:$(this).height(), opacity:0.15 });
   //       $(this).append(div);
   //     }); 
   //   
  $('div#menu1>ul>li').webetui_pulldown({aniLen:200, hideDelay:500, slideUp:false});
  
  //$('body#index div#menubalk').css('opacity', 0.15);
  if($('div#webetui_toolbar').length == 0) {
    
    $('body#index div.intro').show();
    //$('body#index h2.doelgroep').css('opacity', 0);
    $('body#index div#kolom_rechts').hide();
    setTimeout(function() { 
      $('body#index div.intro').fadeOut(1500);
      //$('body#index h2.doelgroep').hide().css('opacity', 100).fadeIn(1500);
      $('body#index div#kolom_rechts').show();
    }, 2000);
  }

  // Expand functie, prikbord reactie  IS DEZE FUNCTIE NOG FUNCTIONEEL???
  $('h2.reactie').click( function(){
    $(this).next('div.expand').slideToggle();
    return false;
  });
  
  $('.reactie .header').click(function(event){
    event.stopPropagation();
  });
  
  $('div.reactie').click( function() {
    if ($('.message').length == 0) {
      var html = $(this).html();
      var message = $('<div class="message"/>').html(html);
      $('<div class="zoomin"/>').append(message).appendTo('#page').click(function() {
        $(this).remove();
      });
    }    
  });

//  $('div.forum div.reactie:even').addClass('even');
  $('div.forum div.forum_reactie:even').addClass('even');
  
  $('select[name=kies_sport]').change(function() {
    var sport = $(this).val();
    if (sport) {
      location = '/netwerk/alle_sporters?sport=' + sport;
    } else {
      location = '/netwerk/alle_sporters';
    }
  });

  $('select[name=kies_woonplaats]').change(function() {
    var woonplaats = $(this).val();
    if (woonplaats) {
      location = '/netwerk/alle_sporters?woonplaats=' + woonplaats;
    } else {
      location = '/netwerk/alle_sporters';
    }
  });

});

function confirmation(what, page, delId) {
	var answer = confirm(
    "U staat op het punt " + what + " te verwijderen.\nWeet u zeker dat u dit wilt doen?"
	);
	if (answer){
		window.location = "/" + page + "?" + delId;
	}
	else{
	}
}

function propositionChanged(target) {
	window.location = '?action=show&activeProposition=' + target;
}


