$(document).ready(function(){
	$("a[rel^='prettyPhoto']").prettyPhoto({theme: 'light_square'});

	$('#loopheader').cycle({ 
		fx:    'fade', 
		speed:  1000,
		timeout: 4000,
		random:  1 
	 });

 	if (jQuery.browser.msie) { 
	if(parseInt(jQuery.browser.version) <= 6) { 
		var oldbrowser = 1;
	} }
	if(oldbrowser==1) {
		fixFooterIE();
		window.onresize = fixFooterIE;
	} else {
		fixFooter();
		window.onresize = fixFooter;
	}
});

function fixFooterIE() {
	fixBackground();
}

function fixFooter() {
	 var windowheight = $(window).height();
	 var cmsheight = $('#aveqcms').height();
	 var displayheight = cmsheight+105
	 
	 if(windowheight>displayheight) {
		// Pinned footer
	 	//alert("Ja overflow want: window:"+windowheight+" > displayHeight:"+displayheight+"\nFooter topPos: "+cmsheight);
	 	$('body').css({overflow: "hidden"});
	 	$('html').css({overflow: "hidden"});
	 	$('#footer').css({top: cmsheight, height: '100%'});
	 	$('#aveqcms').css({padding: '0'});
	 } else {
	 	// Sticky fixed footer
	 	//alert("Nee overflow want: window:"+windowheight+" < displayHeight:"+displayheight);
	 	$('body').css({overflow: "auto"});
	 	$('html').css({overflow: "auto"});
	 	
	 				var footerHeight = '151';
				
	 	$('#footer').css({bottom: 0, top: 'auto', height: footerHeight+'px'});
	 	$('#aveqcms').css({padding: ' 0px 0px '+footerHeight+'px 0px'});
	 	
		// ie6 fixed footer fix
	 }
	 
	 fixBackground();
}

function fixBackground() {
	//var newheight = $(window).scrollTop() +  $(window).height();
	//alert($(window).scrollTop());

}

/* Cache rendered in 0,00938 seconds. */