var Site = window.Site || {};

(function($) {

	function initMenu() {
	  $('nav ul ul').hide();
	  $('nav ul li.active ul').show();
	  $('nav li a:first-child').click(
	    function() {
	      var checkElement = $(this).next();
	      if((checkElement.is('ul')) && (checkElement.is(':visible'))) {
	        // return false;
	        }
	      if((checkElement.is('ul')) && (!checkElement.is(':visible'))) {
	        $('nav ul ul:visible').slideUp('normal', 'easeOutCirc');
	        checkElement.slideDown('normal', 'easeOutCirc');
			var href = $(this).attr('href');
			setTimeout(function() {window.location = href}, 500);
			$('nav li.active').removeClass();
			$(this).parent().addClass('active') // remove in live version
	        return false;
	        }
	      }
	    );
	  }
	$(document).ready(function() {initMenu();});
		
    $(document).ready(function(){
         $('header').stickyfloat({ duration: 400 });
     });

	$(function() {
		$('#social-links img').css({opacity: '.2'});
	});
	$(function() {
		$('#social-links img').hover(function() {
			$(this).stop().animate({opacity: '.73'}, 'fast', 'easeInCirc');
		},
		function() {
			$(this).stop().animate({opacity: '.2'}, 'fast', 'easeOutCirc');
		});
	});
	
	$(function() {
	    $('#info').animate({ width: 'hide'}, 0);
	    $('.dalink').hover(
	        function()
	        {
	            $('#info').animate({ width: 'show'}, 'normal', 'easeOutCirc');
	        },
	        function() {
	            $('#info').animate({ width: 'hide'}, 'fast', 'easeInCirc');
	    });     
	});

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


