jQuery.easing.backout = function(x,t,b,c,d){if(t<d/2)return 2*c*t*t/(d*d)+b;var a=t-d/2;return-2*c*a*a/(d*d)+2*c*a/d+c/2+b}
var current = 0;
var total;
$(document).ready(function() {
	var img = new Image();
	$(img).load(function () {
      $(this).hide();
      $('#background').append(this);
    	
      $(this).fadeIn();
      resize_bg();
    }).attr('src', bgImage);
	$( window ).bind("resize", function() {
			resize_bg();
	});
	resize_bg();
	$('h1.quote').append('<div class="quoteclose"></div>');
	
	$( 'ul#submenu li').hover( function() {
		$( this ).not('.active').find('a').animate({ marginTop: '15px'}, 120, 'backout');
	}, function() {
		$( this ).not('.active').find('a').animate({ marginTop: '20px'}, 120);
	}	);
	
	$( 'div#tabmenu ul li').hover( function() {
		$( this ).not('.active').css({ marginTop: '0px'});
	}, function() {
		$( this ).not('.active').css({ marginTop: '2px'});
	}	);
	
	$( '#submenu li.active a').css({ opacity: 0.3 });
	$( 'a.stelling_active').css({ opacity: 0.3 });
	
});

function resize_bg() {
	var ratio = 955 / 280;
	wth = $( window ).width();
	hgh = wth / ratio;
	
	mnl = 0 - (wth / 2);
	mnt = 0 - ((wth / ratio) - 280);

	if ( wth > 955 ) {
		$('#background img').css({ width: wth + 'px', height: hgh + 'px' });
		$('#background').css({ marginTop: mnt });
		$('#holder').css({ marginLeft: '-450px', left: '50%' });
	} else {
		$('#holder').css({ marginLeft: '10px', left: 0 });
	}
	$('#background').css({ marginLeft: mnl });
	
	
}

