$(document).ready(function($) {
  
  //$('.lightbox_trigger').click(function(e) {
    
    //Prevent default action (hyperlink)
    //e.preventDefault();
    
    //Get clicked link href
    //var link_href = $(this).attr("href");
    //Voor Sabrina:
    var link_href = 'popup.aspx'; 
    
    /*   
    If the lightbox window HTML already exists in document, 
    change the content of div to the disclaimer through ajax
    
    If the lightbox window HTML doesn't exists, create it and insert it.
    (This will only happen the first time)
    */
    
    if ($('#lightbox').length > 0) { // #lightbox exists
      
      //Place href as img src value
      $('#testcontent').html( function() {
        $.get( link_href, function(data){
          $('#testcontent').append($('#content',data));
        });
      });
         
      //Show lightbox window - you could use .show('fast') for a transition
      $('#lightboxwrapper, #lightbox, #testcontent').show();
    }
    
    else { //#lightbox does not exist - create and insert (runs 1st time only)
      
      //Create HTML markup for lightbox window
      var lightbox = 
    '<div id="lightboxwrapper">' +  
      '<div id="lightbox">' +
        '<p>Sluiten</p>' +
          
            
      '</div>'+
      '<div id="testcontent">'+       
       '<span class="lightboxClose"> X </span>' +             
      '</div>'+            
    '</div>';
        
      //Insert lightbox HTML into page
      $('body').append(lightbox);
      $.get(link_href, function(data){
        $('#testcontent').append($('#content',data));
      });
    }
    
  //});
  
  //Click anywhere on the page to get rid of lightbox window
  $('#lightbox, .lightboxClose').live('click', function() { //must use live, as the lightbox element is inserted into the DOM
    $('#lightboxwrapper, #lightbox, #testcontent').hide();
  });

});
