//text swap on click
function TextSwap(input,newText,currentText){
	if (input.value == currentText) {
	input.value = newText;
	}
}

// ie hover on li
ieHover = function() {
	var ieEls = document.getElementById("main-nav").getElementsByTagName("LI");
	for (var i=0; i<ieEls.length; i++) {
		ieEls[i].onmouseover=function() {
			this.className+=" hover";
		}
		ieEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" hover\\b"), "");
		}
	}
}
if (window.attachEvent) window.attachEvent("onload", ieHover);


// anchor scroll

$(document).ready(function() {
	$("a.anchorLink").anchorAnimate()
});

jQuery.fn.anchorAnimate = function(settings) {

 	settings = jQuery.extend({
		speed : 2000
	}, settings);	
	
	return this.each(function(){
		var caller = this
		$(caller).click(function (event) {	
			event.preventDefault()
			var locationHref = window.location.href
			var elementClick = $(caller).attr("href")
			
			var destination = $(elementClick).offset().top;
			$("html:not(:animated),body:not(:animated)").animate({ scrollTop: destination}, settings.speed, function() {
				window.location.hash = elementClick
			});
		  	return false;
		})
	})
}

// slide in
function showSlidingDiv(){
$("#slidingDiv").animate({"height": "toggle"}, { duration: 1000 }, { easing: "easeOutBounce" });
}


/* 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('content-container');
					var contentHeight = contentElement.offsetHeight;
					var footerElement = document.getElementById('footer');
					var footerHeight  = footerElement.offsetHeight;
					var headerElement = document.getElementById('header');
					var headerHeight  = headerElement.offsetHeight;
					var primaryElement = document.getElementById('primary');
					var primaryHeight  = primaryElement.offsetHeight;
					if (windowHeight - (contentHeight + footerHeight + headerHeight) >= 0) {
						contentElement.style.height = ((windowHeight - (contentHeight + headerHeight + footerHeight)) + contentHeight) + 'px';
						primaryElement.style.height = '100%';
					}
					else {
						contentElement.style.height = 'auto';
					}
				}					
			}
		}
		window.onload = function() {
			setFooter();
		}
		window.onresize = function() {
			setFooter();
		} 
*/		
