/* CUFON
-------------------------*/
$(function(){
	$("aside div.agendaArtikel:first").addClass('first');
});

/* CUFON
-------------------------*/
Cufon.replace('ul#menu li a span', { fontFamily: 'Myriad Pro' });

Cufon.replace('h1, div#container h3', {hover: true, fontFamily: 'Helvetica LT Std'});
Cufon.replace('h1, div#container h3', { fontFamily: 'Helvetica LT Std' });

Cufon.replace('h2, h3, h4, div#content a.calltoaction', {hover: true, fontFamily: 'Helvetica'});
Cufon.replace('h2, h3, h4, .bulletsubtitlestyle, a.calltoaction', { fontFamily: 'Helvetica' });


/* GEEN PADDING TUSSEN P EN UL
-------------------------*/
$(function(){
	$("#content ul").prev("p").css("padding-bottom", 0);
});

/* GALLERY
-------------------------*/
$(function() {
		$("div.scrollable").scrollable();
	});

	$(function() {
		$(".items img").click(function() {
			var url = $(this).attr("big").replace("_small", "");
			var wrap = $("#image_wrap");   //.fadeTo("medium", 0.5)
			var img = new Image();
			img.onload = function() {
				wrap.fadeTo("fast", 1);
				wrap.find("img").attr("src", url);
			};
			img.src = url;
			
			if($(this).next("div.imgInfo").length > 0){
				$("#image_wrap").find("div.description").css("display", "block")
					.find("p").html($(this).next("div.imgInfo").html());
			} else {
				$("#image_wrap").find("div.description").css("display", "none");
			}

			if($(".scrollable img.active").nextAll("img").length > 0){
				$("a.nextImg").css("display", "block");
			} else {
				$("a.nextImg").css("display", "none");
			}
			
			if($(".scrollable img.active").prevAll("img").length > 0){
				$("a.prevImg").css("display", "block");
			} else {
				$("a.prevImg").css("display", "none");
			}
		}).filter(":first").click();

		$("a.nextImg").click(function() {
			$(".scrollable img.active").nextAll("img:lt(1)").click();
		});

		$("a.prevImg").click(function() {
			$(".scrollable img.active").prevAll("img:lt(1)").click();
		});
	});


/* BACKUP
-------------------------
$(function() {
		$("div.scrollable").scrollable();
	});

	$(function() {
		$(".items img").click(function() {
			var url = $(this).attr("big").replace("_small", "");
			var wrap = $("#image_wrap");   //.fadeTo("medium", 0.5)
			var img = new Image();
			img.onload = function() {
				wrap.fadeTo("fast", 1);
				wrap.find("img").attr("src", url);
			};
			img.src = url;
		}).filter(":first").click();
	});
*/

/* INPUT
-------------------------*/
(function($) {
	$.fn.defaultValue = function() {
		return this.each(function() {

			$(this).data("originalText", $(this).val());

			$(this).blur(function() {
				if ($(this).val() == "") {
					$(this).val($(this).data("originalText"));
					$(this).removeClass("enabled");
				}
			});

			$(this).focus(function() {
				if ($(this).val() == $(this).data("originalText")) {
					$(this).val("");
					$(this).addClass("enabled");
				}
			});

		});
	}
})(jQuery);

$(document).ready(function() {
	$("#saddr").defaultValue();
});

$(document).ready(function() {
	$('div#slider').cycle({
		fx: 'fade',
		pager: '#nav1'
	});
});

$(function() {
	$('div.plattegrondSlide') 
		.cycle({ 
			fx:     'fade', 
			speed:  '400', 
			timeout: 3000
		});
	});

$(function() {
	$("#quickMenuToggle").click(function() {
		$("#quickMenu").slideDown();
		return false;
	});
});
