jQuery.extend( jQuery.easing,
{
	easeInQuad: function (x, t, b, c, d) {
		return c*(t/=d)*t + b;
	},
	easeOutQuad: function (x, t, b, c, d) {
		return -c *(t/=d)*(t-2) + b;
	}
});

/* functie om hele blokken klikbaar te maken, en hover toevoegen */
$.fn.hoverClick = function()
{
	this.each(function()
	{
		$(this).hover(
			function() { $(this).addClass("hover").css("cursor", "pointer"); },
			function() { $(this).removeClass("hover").css("cursor", "pointer"); }
		);
		
		$(this).attr("title", $("a:first", this).attr("title"));
		
		$(this).click(function(){
			window.location = $("a:first", this).attr("href");
		});
	});
	
	return this;
};

function setBubbels1()
{
	var containerhoogte = $("#container").height();
	$(".bubbels1").css({
		top: containerhoogte+'px',
		left: '-20px',
		opacity: 0
	}).animate({
		top: (containerhoogte-30)+'px',
		opacity: 1
	}, 3000, 'easeInQuad').animate({
		top: (containerhoogte-60)+'px',
		opacity: 0
	}, 3000, 'easeOutQuad');
	setTimeout('setBubbels1()', 10000); 
}

function setBubbels2()
{
	$(".bubbels2").css({
		top: '350px',
		left: '-55px',
		opacity: 0
	}).animate({
		top: '310px',
		opacity: 1
	}, 2500, 'easeInQuad').animate({
		top: '270px',
		opacity: 0
	}, 2500, 'easeOutQuad');
	setTimeout('setBubbels2()', 8000); 
}

function setBubbels3()
{
	var containerhoogte = $("#container").height();
	$(".bubbels3").css({
		top: containerhoogte+'px',
		right: '-3px',
		opacity: 0
	}).animate({
		top: (containerhoogte-30)+'px',
		opacity: 1
	}, 2100, 'easeInQuad').animate({
		top: (containerhoogte-60)+'px',
		opacity: 0
	}, 2100, 'easeOutQuad');
	setTimeout('setBubbels3()', 7000); 
}

$(function()
{
	
	// Formulier focus op velden
	$("#content input, #content textarea").focus(function() { $(this).addClass("veldfocus"); });
	$("#content input, #content textarea").blur(function() { $(this).removeClass("veldfocus"); });

	// Hover menu 
	var menuclass = '';
	$("#menu li").hover( 
	function() 
	{ 
		menuclass = $(this).attr('class').split(' ')[0];
		$(this).addClass(menuclass+"-hover hover"); 
	},
	function()	
	{ 
		menuclass = $(this).attr('class').split(' ')[0];
		$(this).removeClass(menuclass+"-hover hover"); 
	});
	
	// Bubbels
	$("#container").append('<div class="bubbels1"></div><div class="bubbels2"></div><div class="bubbels3"></div>');
	setBubbels1();
	setBubbels2();
	setBubbels3();


});
 
function maak_sifr()
{
	sIFR.replaceElement(named({ sSelector:".home #content h1", sFlashSrc: submap + "/fla/metaplus.swf", sColor:"#1c5066", sBgColor:"#FFFFFF", sWmode:"transparent" }));
	sIFR.replaceElement(named({ sSelector:"#content h1", sFlashSrc: submap + "/fla/metaplus.swf", sColor:"#FFFFFF", sBgColor:"#FFFFFF", sWmode:"transparent" }));
}
