jQuery.noConflict();

(function($) { 
	
	$(function() {
		
		// Skyline
		setTimeout(function() {
			var main = $("#hk-main");
			var sidebar = $("#hk-sidebar");
			var mainHeight = main.height();
			var sidebarHeight = sidebar.height();
			(mainHeight > sidebarHeight) ? sidebar.height(mainHeight) : main.height(sidebarHeight);
		}, 50);
		
		// Hide TOC by default
		$("#toc__header").click();
		
		// Navigation
		var $dropdwonTimeout;
		$('#hk-navigation li.level1').mouseover(function() {
			//hideDropdown();
			var $self = $(this);
			$lv2 = $(this).find('ul:first');

			$lv2.show().css({
				top: $self.position().top+65,
				left: $self.position().left
			});
			
			$(this).mouseleave(function() {
				$lv2.hide();
			});
		});
		
		function hideDropdown() {
			$('#hk-navigation li.level2').hide();
		}
		
	});
	
})(jQuery);

