//search text swap on click
function SearchSwap(input,newText,currentText){
	if (input.value == currentText) {
	input.value = newText;
	}
}
//getting window height and increasing wrapper height so footer is at bottom and wrapper is height of window.  move footer back inside outerwrapper for this to work		
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() {
	if (document.getElementById) {
		var windowHeight = getWindowHeight();
		if (windowHeight > 0) {
			var contentElement = document.getElementById('wrapper');
			var contentHeight  = contentElement.offsetHeight;
			var footerElement = document.getElementById('footer');
			var footerHeight  = footerElement.offsetHeight;
			if (windowHeight - (contentHeight + footerHeight) >= 0) {
				contentElement.style.height = (contentHeight + (windowHeight - (contentHeight + footerHeight))) + 'px';
			}
			else {
				footerElement.style.top = 'auto';
			}
		}
	}
}
/*		window.onload = function() {
			setFooter();
		}
		window.onresize = function() {
			setFooter();
		}*/
		
if (Drupal.jsEnabled) {
  $(document).ready(function () {

		if(undefined===window.ft_tag) {
			ft_tag = false;
		}

		var excludeFooterRedraw = ft_tag ? true : false;
	 	
		if(!excludeFooterRedraw) {
			setFooter();
		} 
		 
	});
}
