$(function(){
//side nav
	$('#menu ul li a').each(function(){
		var location = window.location;
		var href=location.href;
		if (this.href.toLowerCase() == href.toLowerCase()) {$(this).addClass('on'); return false};
	});
//EasuOut
		$.easing.elasout = function(x, t, b, c, d) {
			var s=1.70158;var p=0;var a=c;
			if (t==0) return b;  if ((t/=d)==1) return b+c;  if (!p) p=d*.3;
			if (a < Math.abs(c)) { a=c; var s=p/4; }
			else var s = p/(2*Math.PI) * Math.asin (c/a);
			return a*Math.pow(2,-10*t) * Math.sin( (t*d-s)*(2*Math.PI)/p ) + c + b;
		};
// for footer
	function getWindowHeight() {
		var windowHeight = 0;
		if (typeof(window.innerHeight) == 'number') return window.innerHeight;
		if (document.documentElement && document.documentElement.clientHeight) return document.documentElement.clientHeight;
		if (document.body && document.body.clientHeight) return document.body.clientHeight;
		return 0;
	}
	function setFooter() {
		if (document.getElementById) {
			var windowHeight = getWindowHeight();
			if (windowHeight > 0) {
				var height = windowHeight - ($('#wrapper')[0].offsetHeight + $('#footer')[0].offsetHeight);
				if (height >= 0) {
					$('#footer').css({'position':'relative','top': height+'px'});
				}
				else {
					$('#footer').css('position','static');
				}
			}
		}
	}
	$(window).resize(setFooter).trigger('resize');

    
});


//Smooth Scroll
 function scroller() {
	scrollTo ({top:'50px', left:'0px'}, 3500, {easing:'elasout'});
    };

