/*
 * Javascript for dynamic menu
 * For FReC 2011 template
 *
 * Script by Redsandro Media http://www.Redsandro.com/
 * Copyright 2010-2011, www.FrecLeeuwarden.nl
 *
 * Created:		2010-11-22
 * Last edit:	2010-11-24
 */



// DOM loaded

jQuery(document).ready(function(){

	// Admin tab float right
		jQuery("#header_menu ul > li").each(function(index) {
			if (jQuery(this).children("a").attr('title') == 'Private') // Oh yes you got me, it sais 'Private' so now you can haxor my site oh noes!!!11
				jQuery(this)
					.addClass('admintab')
					.css("float", "right");
		});

	// WTFwoot, I need to do this before CSS is overruled. (But without JS, the menu still works)
	jQuery("#header_menu > ul > li > ul").fadeOut(1).fadeIn(1).fadeOut(1);

	// Menu
	jQuery("#header_menu > ul > li").hover(
		function () {
			// Menu open
			var el = jQuery(this).children("ul");
			if (!el.is(':animated')) {
				el.fadeIn(200);
			}
		}, 
		function () {
			// Menu close
			var el = jQuery(this).children("ul");
			el.delay(400).fadeOut(500);
		}
	);
});

