function dislay_message(msg)
{
    $.fancybox({
        //modal: true,
        autoDimensions: true,
        padding: "30px",
        scrolling: "no",
        'transitionIn'	: 'none',
        speedOut: 200,
        content: '<div class="content_fancybox"><p>' + msg + '</p></div>'
	        });	
}


	
jQuery.fn.hoverbox = function(a) {
    var b = jQuery.extend({id: "tooltip",top: 0,left: 15}, a);
    var d;
    function c(e) {
        if (!d) {
            d = $('<div style="position:absolute" id="' + b.id + '"></div>').appendTo(document.body).hide()
        }
        if (e) {
            d.css({top: (e.pageY - b.top) + "px",left: (e.pageX + b.left) + "px"})
        }
        return d
    }
    this.each(function() {
    	if ($('#hover_' + this.id).html()) {
	        $(this).hover(function(f) {
	            if (this.title) {
	                //this.t = this.title;
	                this.t = $('#hover_' + this.id).html();
	                this.title = "";
	                this.alt = "";
	                c(f).html(this.t).fadeIn("fast")
	            }
	        }, function() {
	            if (this.t) {
	                this.title = this.t;
	                c().hide()
	            }
	        });
	        $(this).mousemove(c)
        }
    })
};	


(function($) {

	// Dom Ready
	$(function() {
	
	
		$("#news_scroller").jCarouselLite({
			"vertical": true,
			"btnNext":  "#home_news .scroll_down",
			"btnPrev":  "#home_news .scroll_up",
			"visible": 3,
			"scroll":  3,
			"circular": false
			//"beforeStart": function(elements) { },
			//"afterEnd": function(elements) {  }
		});	
		$("#agenda_scroller").jCarouselLite({
			"vertical": true,
			"btnNext":  "#home_agenda .scroll_down",
			"btnPrev":  "#home_agenda .scroll_up",
			"visible": 5,
			"scroll":  5,
			"circular": false
			//"beforeStart": function(elements) { },
			//"afterEnd": function(elements) {  }
		});	
		$("#media_scroller").jCarouselLite({
			"vertical": false,
			"btnNext":  "#footer .scroll_right",
			"btnPrev":  "#footer .scroll_left",
			"visible": 6,
			"scroll":  6,
			"circular": false,
			//"beforeStart": function(elements) { },
			"afterEnd": function(elements) { 
				$("#media_scroller .first").removeClass("first");
				$(elements).eq(0).addClass("first");
			}
		});
		
		/**/
		$("#message_scroller").jCarouselLite({
			"vertical": true,
			"btnNext":  "#3_content .scroll_down",
			"btnPrev":  "#3_content .scroll_up",
			"visible": 5,
			"scroll":  5,
			"circular": false
			//"beforeStart": function(elements) { },
			//"afterEnd": function(elements) {  }
		});
	
		//docenten -> project 
		$('.expl_button').click(function() {
	        var msg = $(this).children(".expl_text").text();
	        dislay_message(msg);
		});
		
		
		/*
		$('.horizontal_scroll_list li').hover(
  			function () { $(this).addClass('hover'); }, 
  			function () { $(this).removeClass('hover'); }
		);
		*/
		
	
	$('.wie_zijn_wij #content img').hoverbox();

		 
	/* placeholder fix for older browsers */
	if(!('placeholder' in document.createElement('input'))){
		$('[placeholder]').each(function(){
			if ($(this).val() == "" ) {
				$(this).addClass('placeholder_text');
				$(this).val($(this).attr('placeholder'));
			}
		});
		
		$('[placeholder]').focus(function() {
			if ($(this).val() == $(this).attr('placeholder') ) {
				$(this).removeClass('placeholder_text');
				$(this).val("");
			}
		}).blur(function() {
			if ($(this).val() == "" ) {
				$(this).addClass('placeholder_text');
				$(this).val($(this).attr('placeholder'));
			}
		});		
		
	}		 

	
	});



})(jQuery);
