

/********************************************************************************/
/* Scrolls the browser window back to the top of the page
/********************************************************************************/

(function ($) {
	$.fn.scrollToTop = function () {
		$('html, body').animate({
			scrollTop: $("body").offset().top
		}, 500);
	}
	
})(jQuery);


/********************************************************************************/
/* Aligns the footer nav bar to the bottom of the browser window 
/* if the page is shorter than the window
/********************************************************************************/

(function ($) {
	$.fn.alignFooterNavToBottom = function () {
		//alert($(document).height()+"   :   "+$(window).height());
		var windowHeight = 500;
		/*
		if(1==1){
			//windowHeight = $(window).height();
		}else{
			windowHeight = 500;
		}*/
		//alert(document.body.clientHeight+"   :   "+document.documentElement.clientHeight);
		
		//if(document.body.clientHeight < document.documentElement. clientHeight){
		if(document.body.clientHeight <= $(window).height() || $(document).height() == $(window).height()){
			$('#FooterNavBarContainer').css('position','fixed');
			$('#FooterNavBarContainer').css('z-index','9999');
			$('#FooterNavBarContainer').css('bottom','0px');
		}else{
			$('#FooterNavBarContainer').css('position','relative');
			$('#FooterNavBarContainer').css('z-index','9999');
			//$('#FooterNavBarContainer').css('bottom','null');
		}
	}
	
	//-----------------------------------------------------
	
	$(window).resize(function() {
		//$.fn.alignFooterNavToBottom();
	});
	
	//-----------------------------------------------------
	
	$(document).ready(function() {
		//$.fn.alignFooterNavToBottom();
	});
	
})(jQuery);






