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;
}
var documentHeightInit
function setFooter() {
	
	var windowHeight = getWindowHeight()
	var documentHeight = $(document).height()
	var bodyHeight = $('body').height();
	var contentHeight = $('#content').height()
	var footerHeight = $('#footer').height()
	var headerHeight = $('#header').height()
	
	if (bodyHeight<=windowHeight){
		$('#content').css("height", windowHeight-footerHeight-headerHeight-1);
	}
	if (windowHeight<documentHeight && documentHeight>documentHeightInit){
		$('#content').css("height","auto")
	}
}

window.onload = function() {
	documentHeightInit = $(document).height();
	setFooter();
	addCalendarTips()
}
$(window).resize(function(){
 /*if (!$.browser.msie)*/setFooter();
});
$(window).ready(function(){
	documentHeightInit = $(document).height();
 setFooter();
});

//----------------
//CALENDAR
//----------------
function getCalendar(dateToShow){
	$.ajax({url:dateToShow,type:"GET",data: "",success:function(data){
						$("#feature_calendar").html(data);
						addCalendarTips();
					}});
}
function addCalendarTips(){
		$(".day_overlayer").each(function(e){
			$(this).parent().mouseover(function(e){					
				$(this).children(".day_overlayer").css("display","block");
				$(this).children("ul").css("margin-top","-5px");
				$(this).children("ul").css("margin-left","5px")});
			$(this).parent().mouseout(function(e){					
				$(this).children(".day_overlayer").css("display","none")});
		})
}


