$(document).ready(function() {
	
 	//Cufon.set('fontFamily', 'TradeGothic');
 	//Cufon.replace('#content h1');
 	 	
	$('.menu-content li:not(".active")').hover(function() {
		$(this).addClass('hover');
	}, function() {
		$(this).removeClass('hover');
	});
	
	$('.menu-content li').click(function() {
		window.location = $(this).find("a").attr("href");
	});
	
	
		
//	var state = readCookie('top_state');
//	
//	if (state == 'collapsed') {
//		top_large = true; // wordt in anim_collapse getoggled
//		anim_collapse(20);
//	} else {
//		$('#animation-top-collapsed').css('display', 'none');
//		top_large = true;
//	}
	
	
	/*
	$('img[rel^=photogallery]').each(function() {
		var gallery_id    = $(this).attr('rel').split(':')[1];
		var gallery_style = $(this).attr('style'); // tinymce uses style="float: right;" instead of align="right"
		var gallery_class = $(this).css('float') == 'right' ? 'align-right' : 'align-left';
		var gallery_img   = $(this);
		
		gallery_img.attr('src', '/spacer.gif');
		
		$.getJSON('ajax/get_gallery.php?gallery_id=' + gallery_id, function(data)
		{
			if (data.status != 'OK') {
				return false;
			}
			
			var img_url       = data.path + '/' + data.files[0];
			var img_thumb_url = data.path + '/thumb/' + data.files[0];
			var gallery       = '';
			
			gallery += '<a class="gallery-thumb ' + gallery_class + '" style="' + gallery_style + '" id="gallery-thumb-' + gallery_id + '" rel="gallery_' + gallery_id + '" href="' + img_url + '" title="' + data.title + '">';
			gallery += '	<img src="' + img_thumb_url + '" alt="" />';
			gallery += '	<img src="img/buttons/button-gallery.gif" alt="" class="gallery-label" />';
			gallery += '	<span>' + data.title + '</span>';
			gallery += '</a>';
			
			gallery += '<div style="display: none;">';
			for (var i = 1; i < data.files.length; i++) {
				var img_url = data.path + '/' + data.files[i];
				gallery += '	<a rel="gallery_' + gallery_id + '" href="' + img_url + '" title="' + data.title + '"><img src="' + img_url + '" alt="" /></a>';
			}
			gallery += '</div>';
			gallery_img.replaceWith(gallery);
			
			$('a[rel=gallery_' + gallery_id + ']').fancybox({
				'titlePosition'	: 'inside'
			});
		});
	});
	*/
	
	
	
	$('#animation-top-collapsed img').hover(
		function() {
			var src = $(this).attr('src').replace('off', 'on');
			$(this).attr('src', src);
		}, 
		function() {
			var src = $(this).attr('src').replace('on', 'off');
			$(this).attr('src', src);
		}
	);
	
	
	$('#boekingen-links').hide();
	$('#boekingen').css({'cursor': 'pointer'});
	//var preload_image1 = $('<img />').attr('src', 'img/splash/buttons/button-boekingen-up.gif');
	$('#boekingen').click(function() {
		$('#boekingen-links').toggle();

		
		/*
		if($('#boekingen').attr('src') == 'img/splash/buttons/button-boekingen-up.gif') {
			$('#boekingen').attr('src', 'img/splash/buttons/button-boekingen-down.gif');
		} else {
			$('#boekingen').attr('src', 'img/splash/buttons/button-boekingen-up.gif');
		}
		*/
	});
	
	$('body').click(function(event) {
		//Hide the menus if visible
		if(event.target.id !== "boekingen") {
			if($('#boekingen-links').is(':visible') ) {
				$('#boekingen-links').toggle();
			}
		}
	});
	
	// z-index fix IE:
	//var zIndexNumber = 1000;
	//$('div').each(function() {
	//	$(this).css('zIndex', zIndexNumber);
	//	zIndexNumber -= 10;
	//});

	
	
});

