/* 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($) {
	
		//lavalamp
		$(function() {
		
		$("#1, #2, #3").lavaLamp({
			fx: "backout",
			speed: 700,
			click: function(event, menuItem) {
				//return false; removed otherwise links won't work
			}
		});


		//sticky footer
		$("#footer").stickyFooter();
		});
		
		// sticky footer plugin
		(function($){
		var footer;
		
		$.fn.extend({
		  stickyFooter: function(options) {
			footer = this;
			
			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);
			  }
			}
		  }
		});

		
		//nav up and down function
		$(function() {
			var $elem = $('body');
			
			$('#nav_up').fadeIn('slow');
			$('#nav_down').fadeIn('slow');  
			
			$(window).bind('scrollstart', function(){
				$('#nav_up,#nav_down').stop().animate({'opacity':'0.2'});
			});
			$(window).bind('scrollstop', function(){
				$('#nav_up,#nav_down').stop().animate({'opacity':'1'});
			});
			
			$('#nav_down').click(
				function (e) {
					$('html, body').animate({scrollTop: $elem.height()}, 800);
				}
			);
			$('#nav_up').click(
				function (e) {
					$('html, body').animate({scrollTop: '0px'}, 800);
				}
			);
		});




	})(jQuery);;


	$(window).bind("load", function() {

			
	});
	
})(jQuery);
