(function ($) {
	
	// HOVER ON CURRENT PROJECT
	Drupal.behaviors.sidebarproject = {
		attach: function(context, settings) {
			$('#block-views-projecten-sidebar-block .tekst').hide();
			
			$('#block-views-projecten-sidebar-block a').hover(function () {
					$(this).find('.tekst').fadeIn('fast');
				}, function () {
					$(this).find('.tekst').fadeOut('fast');
				}
			);

    }
  }
	
	// EQUAL HEIGHT ITEMS ON OVERVIEW PROJECTS
	Drupal.behaviors.projectheight = {
		attach: function(context, settings) {

			function equalHeight(group) {
				var tallest = 0;
				group.each(function() {
					var thisHeight = $(this).height();
					if(thisHeight > tallest) {
						tallest = thisHeight;
					}
				});
				group.height(tallest);
			}

			equalHeight($("#content .view-projecten .field-name-title"));
			equalHeight($("#content .view-projecten .field-name-field-project-intro"));

		}
  }
	
	// EDITOR MENU
	Drupal.behaviors.editormenu = {
		attach: function(context, settings) {
			
			$('#wrapper #block-menu-menu-editor-menu .content li ul').hide();
			
			$('#wrapper #block-menu-menu-editor-menu .content>ul').hover(function () {
					$(this).addClass('over');
					$(this).find('ul').slideDown();
				}, function () {
					$(this).removeClass('over');
					$(this).find('ul').slideUp();
				}
			);

		}
  }
	
})(jQuery);;

