function getWindowHeight() {
	var windowHeight = 0;
	if (typeof(window.innerHeight) == 'number') {
		windowHeight = window.innerHeight;
	} else {
		if (document.documentElement && document.documentElement.clientHeight) {
			windowHeight = document.documentElement.clientHeight;
		} else {
			if (document.body && document.body.clientHeight) {
				windowHeight = document.body.clientHeight;
			}
		}
	}
	return windowHeight;
}

function setFooter() {
	var windowHeight = getWindowHeight();
	if (windowHeight>0){
		var wrapperHeight = $("#wrapper").offsetHeight;
		var contentHeight = $("#content").offsetHeight;
		var footerElement = $("#footer");
		footerElement.style.height = windowHeight-(wrapperHeight+contentHeight-15)+'px';
	}
}

function setNewsletter()
{
	post = $("#nletter").serialize();
	url = "controllers.php?do=setNewsletter&what=set";
	$.ajax({
   type: "post",
   url: url,
   data: post,
   success: function(resp){
     $('#nlsuccess1').fadeIn('slow').animate({opacity: 0.8}, 5000).fadeOut('slow', function() { $(this).remove(); });
   }
 });
}

window.onload = function() {
  setFooter();
}
window.onresize = function() {
  setFooter();
}

$(document).ready(function(){
	$("#textcontent-c a.fancy").fancybox({
		'overlayShow': true, 
		'overlayOpacity': 0.80
	});
	$("#right a.fancymap").fancybox({
		'zoomSpeedIn': 0, 
		'zoomSpeedOut':	0, 
		'overlayShow': true,
		'overlayOpacity': 0.80
	});
}); 