function start()
{
  if(CCL.Debug)
    CCL.Warn('CCL load complete.');
  
  CCL.LoadScript('/lib/_ajax/Poorterij.js', function()
  {
    window.Poorterij = new Poorterij();
  });     
}


$(document).ready(function() {
    if(/-new/i.test(document.location.href)) {
        $('link[href*="style.css"]').remove();
    }
    $('a.fancybox').each(function()
    {
        $(this).addClass('iframe');
        $(this).fancybox({width: Math.min($(window).width() - 75, 830), height: Math.min($(window).height() - 75, 398 )});
        $(this).click();
    });
    
    //
    // Check for at least 5 voorstellingen
    //
    $('#C4_Form .voorstelling-form').each(function() {
      $('#C4_Form').submit(function() {
        var iSelected = ($('input.voorstelling:checked').length);
        
        if (iSelected < 5)
        {
          alert('U dient tenminste 5 voorstellingen te selecteren');
          return false;
        }        
        
        return true;
      
      });
    });
});


// Adding Search and SubMenu functions

$(document).ready(function() {
    /* Initialize search field */
  $('#searchfield').click(function() {
    if(this.value == this.defaultValue) {
      this.value = '';
    }
    $(this).addClass('focus');
  }).blur(function() {
    if(this.value == '') {
      this.value = this.defaultValue;
    }
    $(this).removeClass('focus');
  });
  
  /* Initialize drop-down menu's */
  $('#menu li').hover(
    function(){$('> ul', $(this)).fadeIn()},
    function(){$('> ul', $(this)).hide()}
  );
  
  /*
  $('#menu li').mouseover(function() {
    $('> ul', $(this)).show();
  }).mouseleave(function() {
    $('> ul', $(this)).hide();
  });
  */
});



