	$(document).ready(function() {
	
	// initialize png fix for IE6
		if(window.DD_belatedPNG) { DD_belatedPNG.fix('#logo img, #nav-main, #nav-main li.first.selected, #nav-meta li, .top, .bot, #footer, #footer img'); }
		
		if(window.print && $('#btn_print').length > 0) { 
			$('#btn_print').show(); 
			$('#btn_print').click(function () { window.print(); return false; });
		}
		
	// initialize photoalbums in content pages.
		$('.photo a').nvsAlbum({overlayTransparancy: '0.7'});

	// initialize home project animation
		if($('#projecten img').length > 0) { $('#projecten img').artAnimation(); }
		
	// initialize people mouseOvers + tooltip
		$('#people .person').hover(function(e) {
				pos = $(this).position();
				l = parseInt($(this).css('marginLeft'));
			// css hover simulation which IE6 does not support
				$('img', this).css({ marginTop: '-119px' });
			// show tooltip
				$('div.tooltip', this).css({ top: pos['top']+121, left: pos['left']+8+l }).fadeIn(500);
		}, function() {
			// css hover simulation which IE6 does not support
				$('img', this).css({ marginTop: '0' });
			// hide tooltip
				$('div.tooltip', this).fadeOut(100)
		});

	// initialize fancy search button
		$('#frm-search .submit, #frm-search-results .submit, #frm-archive .submit, #frm-who .submit').css({ 
			background: 'url(/img/frm-search_btn.gif) no-repeat center top',
			width: 60,
			height: 21,
			border: 0,
			cursor: 'pointer'
		}).attr('value','').hover(
			function() { $(this).css({ backgroundPosition: 'bottom left' }) },
			function() { $(this).css({ backgroundPosition: 'top left' }) }
		);

	// initialize fancy filter button
		$('#frm-archive .filter, #frm-who .filter').css({ 
			background: 'url(/img/frm-archive_btn_filter.gif) no-repeat center top',
			width: 60,
			height: 21,
			border: 0,
			cursor: 'pointer'
		}).attr('value','').hover(
			function() { $(this).css({ backgroundPosition: 'bottom left' }) },
			function() { $(this).css({ backgroundPosition: 'top left' }) }
		);

	// initialize fancy send button
		$('#frm-contact .submit').css({ 
			background: 'url(/img/frm_btn_verstuur.gif) no-repeat center top',
			width: 89,
			height: 21,
			border: 0,
			cursor: 'pointer'
		}).attr('value','').hover(
			function() { $(this).css({ backgroundPosition: 'bottom left' }) },
			function() { $(this).css({ backgroundPosition: 'top left' }) }
		);

	// initialize fancy send button
		$('#frm-aanvraag .submit').css({ 
			background: 'url(/img/frm_btn_verstuur.gif) no-repeat center top',
			width: 89,
			height: 21,
			border: 0,
			cursor: 'pointer'
		}).attr('value','').hover(
			function() { $(this).css({ backgroundPosition: 'bottom left' }) },
			function() { $(this).css({ backgroundPosition: 'top left' }) }
		);

	// initialize fancy readmore button
		$('a.readmore').css({ 
			display: 'block',
			background: 'url(/img/btn_readmore.gif) no-repeat center top',
			width: 62,
			height: 21,
			textIndent: -10000,
			border: 0,
			marginTop: '8px',
			cursor: 'pointer'
		}).attr('value','').hover(
			function() { $(this).css({ backgroundPosition: 'bottom left' }) },
			function() { $(this).css({ backgroundPosition: 'top left' }) }
		);

	// initialize captcha onclick action
		$('#refresh_captcha').css({ visibility: 'visible' })
		$('#refresh_captcha').click(function(){
			$('#captcha_holder').load('/ajax/refresh_captcha.ajax.php');
		});
		
	// #frm-conventions show beurzen
	    /*$(".choose-convention").change(function () {
	        $("#frm-conventions .show_beursdagen").css({ display: 'block' });
	        $("#frm-conventions .show_error_beursdagen").css({ display: 'block' });
        });*/

	
	});
	
	(function($) {
		
			$.fn.artAnimation = function(options) { 
				var defaults = {
					speed: 			4500,
					fadeSpeed: 		1000,
					activeImage:	0,
					imageCount:		0,
					TO:				''
				};	
				
				var options = $.extend(defaults, options);
				var jQueryMatchedObj = this; 
				options.imageCount = jQueryMatchedObj.length;
							
				function start() {
					window.clearTimeout(options.TO);
					options.TO = window.setTimeout(function() { animate() }, options.speed); 
				} 	
				
				function animate() {
					
					$('#nav-projecten li').css("background", ""	).removeClass('hover');
					if(options.activeImage+1 < options.imageCount) {
						$(jQueryMatchedObj[options.activeImage+1]).fadeIn(options.fadeSpeed, endAnimation);
						$('#nav-projecten li').eq(options.activeImage+1).css("background", "url(/img/nav-projecten_li_bg.gif) no-repeat center top").addClass('hover');
					} else {
						$(jQueryMatchedObj[options.imageCount-1]).fadeOut(options.fadeSpeed, endAnimation);
						$('#nav-projecten li').eq(0).css("background", "url(/img/nav-projecten_li_bg.gif) no-repeat center top").addClass('hover');
					}
				
				}
				
				function endAnimation() {
					if(parseInt(options.activeImage) > 0 ) {
						$(jQueryMatchedObj[options.activeImage]).hide(1);
					} 
					
					if(options.activeImage+1 < options.imageCount) {
						options.activeImage++;
					} else {
						options.activeImage = 0;	
					}
					start();
				}
				
				function pauseAnimation() { 
					window.clearTimeout(options.TO);
				}
				
				$('#nav-projecten li a ').hover( function () {
						pauseAnimation();
						options.activeImage = $("#nav-projecten li a").index(this);
						$('#projecten img:not(.first)').hide(); 
						$('#projecten img').eq(options.activeImage).show();
						$('#nav-projecten li').css("background", ""	).removeClass('hover');
						$(this).parent().css("background", "url(/img/nav-projecten_li_bg.gif) no-repeat center top").addClass('hover');;
					}, function() { 
						 start();
					}
				);

				
				$('#nav-projecten li').eq(0).css("background", "url(/img/nav-projecten_li_bg.gif) no-repeat center top").addClass('hover');
				start(jQueryMatchedObj);
			}
	})(jQuery);

/**
 *
 *
 *
 */   
function geef_beursdagen(beurs_nav_id) {
	$("#container_div").parent().remove();
	
	
	$("#beursdatum_holder").append('<li><div id="container_div" class="choose-date"></div></li>');
		
	$("#container_div").load('/ajax/geef_beursdagen.ajax.php', {beurs_nav_id: beurs_nav_id} );
}
