function getStanden(team) {
  //alert(team);
  // get standen html with the url in the db
  $.ajax({
    type: "GET",
    url:  "ajax/ajaxcalls.php", 
    data: "action=standen&team="+team,
    success: function(data){
      // fill lightbox
      $('.lightbox_detail').html(data);

      $('#overlay_bg_container').fadeIn();                 
      TOP = (getBrowserSize()[1]-600)/2;
      LEFT = (((getBrowserSize()[0]-780)/2));
      $('#overlay_details').css("top",TOP);          //Plaats de overlay in het midden van het scherm
      $('#overlay_details').css("left",LEFT);        //Plaats de overlay in het midden van het scherm
    
      // vind nog een manier om target van nbb links naar new window te laten gaan
      window.setTimeout("$('#overlay_details').fadeIn()", 100);  //Fade de overlay in
      //api.reinitialise();
    }
  });
  return false;

}

function getBrowserSize() {
          
    var theWidth, theHeight;
  // Window dimensions: 
  if (window.innerWidth) {
  theWidth=window.innerWidth;
  }
  else if (document.documentElement && document.documentElement.clientWidth) {
  theWidth=document.documentElement.clientWidth;
  }
  else if (document.body) {
  theWidth=document.body.clientWidth;
  }
  if (window.innerHeight) {
  theHeight=window.innerHeight;
  }
  else if (document.documentElement && document.documentElement.clientHeight) {
  theHeight=document.documentElement.clientHeight;
  }
  else if (document.body) {
  theHeight=document.body.clientHeight;
  }

  return [theWidth,theHeight];
}

function closeLightbox() {
  $('#overlay_details').hide();
  $('#overlay_bg_container').hide();   
}

/*
$(document).ready( function(){

  $('.lightbox_detail').jScrollPane(
    {
      showArrows: true,
      scrollbarWidth: 5,
      horizontalGutter: 30,
      verticalGutter: 30,
      verticalArrowPositions: 'before',
      horizontalArrowPositions: 'before',
      verticalDragMinHeight: 20,
      verticalDragMaxHeight: 20
    }
  );

  //$('#column1').jScrollPane({showArrows:true, scrollbarWidth: 5, arrowSize: 5});

});
*/
$(document).ready( function(){
  /* versturen formulier */
  $('#verstuuraanmelding').click(function(){
    if ($('#wedstrijddatum').val() == '') {
      $('#aanmelden_datum').attr('class','error');
      $('#errmessage').html('<span class="error">Kies svp een datum</span>');
      $('#errmessage').show();
      $
      return false;
    } 
    else if ($('#naam_aanmelding').val() == '') {
      $('#aanmelden_datum').removeClass();
      $('#aanmelden_naam').attr('class','error');
      $('#errmessage').html('<span class="error">Vul svp uw naam in</span>');
      $('#errmessage').show();
      return false;
    } else {
      $('#aanmelding').submit();
      return false;
    }
  })
  /* versturen formulier */
  $('#verstuurlidworden').click(function(){
    if ($('#lidworden_naam').val() == '') {
      alert ('Vul svp uw naam in');
      return false;
    } else {
      $('#lidworden').submit();
      return false;
    }
  })
});   
