/* Declare a namespace for the site */
var Site = window.Site || {};

/* Create a closure to maintain scope of the '$'
   and remain compatible with other frameworks.  */
(function($) {
	
	//same as $(document).ready();
	$(function() {
		
		//FANCY TOOLTIPS 
		$('.hastip').tooltipsy({
    		offset: [-10, 0],
    		show: function (e, $el) {
        		$el.css({
		            'left': parseInt($el[0].style.left.replace(/[a-z]/g, '')) - 50 + 'px',
		            'opacity': '0.0',
		            'display': 'block'
		        }).animate({
		            'left': parseInt($el[0].style.left.replace(/[a-z]/g, '')) + 50 + 'px',
		            'opacity': '1.0'
		        }, 300);
		    },
		    hide: function (e, $el) {
		        $el.slideUp(100);
		    }
		});
		
		//STICKY FOOTER
		positionFooter(); 
		$(window)
		.scroll(positionFooter)
		.resize(positionFooter);
		
		function positionFooter() {
			var docHeight = $(document.body).height() - $("#sticky-footer-push").height();
			if(docHeight < $(window).height()){
			  var diff = $(window).height() - docHeight;
			  if (!$("#sticky-footer-push").length > 0) {
			    $("footer").before('<div id="sticky-footer-push"></div>');
			  }
			  $("#sticky-footer-push").height(diff);
			}
		}


	});


	$(window).bind("load", function() {
		
		
	
	});
	
})(jQuery);
