// JavaScript Document
//$(function(){
//	positionFooter(); 
//	
//	$(window)
//		.scroll(positionFooter)
//		.resize(positionFooter)
//	alert( 'document body: ' + $(document.body).height() + '\n. window height: ' + $(window).height());
//	function positionFooter(){
//		if($(document.body).height() < $(window).height()){
//			alert( 'document body: ' + $(document.body).height() + '\n. window height: ' + $(window).height());
//			$('#bottomContainer').css({position:'absolute',bottom:0})
//			$("#bottomContainer").css({position: "absolute",top:($(window).scrollTop()+$(window).height()-$("#bottomContainer").height())+"px"})
//		}	
//	}
//
//});

$(document).ready(function() {
  positionFooter();
 
  $(window)
    .scroll(positionFooter)
    .resize(positionFooter);
 
  function positionFooter() {
    var docHeight = $(document.body).height() - $("#sticky-footer-push").height();
	  //alert( 'document body: ' + $(document.body).height() + '\nwindow height: ' + $(window).height() + '\ndocHeight: ' + docHeight);    
    if(docHeight < $(window).height()){
      var diff = $(window).height() - docHeight - 191;
      if (!$("#sticky-footer-push").length > 0) {
        $("#bottomContainer").before('<div id="sticky-footer-push"></div>');
      }
      $("#sticky-footer-push").height(diff);

    }   
  }
});
