$(document).ready(function() {
	
	if($('#headerfoto > img').length>1){
		$('#headerfoto').cycle({ fx:'fade', timeout: 40, speed: 3000,  pause:  1, next:  '#headerfoto > img'  });
	}else{
		$('#headerfoto > img').fadeIn(1000);
	}
	
	$('.lightbox').fancybox({ 
		'hideOnContentClick': false, 'fixedNavigation':true,'overlayShow': true
	});
	
	
	buildNewHeight();
	
	var bodyheight = $('body').height();
	var windowheight = $(window).height();
	//alert(bodyheight+' - '+ windowheight);
	var maxHeight=Math.max(bodyheight,windowheight);
	
	if(maxHeight>450){
		$('#fancy_overlay').css({'height':maxHeight});
	}
	
});

function buildNewHeight(){
	var a=$('#left').height();
	var b=$('#right').height();
	//alert(a+" - "+b);
	if(a!=b){
		var maxHeight=Math.max(a,b);
		if(maxHeight>450){
			$('#left').css({height:maxHeight});
			$('#right').css({height:maxHeight});
		}
	}
}



