
// remap jQuery to $
(function($){

 
	
	//colored table rows for older browsers	
	$(".maincontent tr:odd").css("background-color", "#F7F7F7");
	$("tr:odd").addClass("odd");
  	
	//overlay
	$('a.overlay').each(function() {
		var $link = $(this);
		var $dialog = $('<div></div>')
			.load($link.attr('href') + ' .dialog')
			.dialog({
				autoOpen: false,
				title: $link.attr('title'),
				width: 520,
				height: 200,	
				modal: true	
			});

		$link.click(function() {
			$dialog.dialog('open');

			return false;
		});
	});
	
	//uitklapbare tabellen jaarverslag		

	$('.heading').click(function() {
		$(this).next().toggle();
		$(this).toggleClass("close");
		return false;
	}).next().hide();
	
	$('.videolink').click(function() {
		opendialog();
	})
	$('aside .video .moreinfo').click(function() {
		opendialog();
	})
	
	

})(this.jQuery);




// usage: log('inside coolFunc',this,arguments);
// paulirish.com/2009/log-a-lightweight-wrapper-for-consolelog/
window.log = function(){
  log.history = log.history || [];   // store logs to an array for reference
  log.history.push(arguments);
  if(this.console){
    console.log( Array.prototype.slice.call(arguments) );
  }
};



// catch all document.write() calls
(function(doc){
  var write = doc.write;
  doc.write = function(q){ 
    log('document.write(): ',arguments); 
    if (/docwriteregexwhitelist/.test(q)) write.apply(doc,arguments);  
  };
})(document);





