$(document).ready(  
	function(){
		var hoverConfig = {	
				over: showMenu,
				timeout: 100,
				out: hideMenu
			};
		$("#nav ul li").each(
			function(ev, li) {				
				$(li).hoverIntent(hoverConfig);       
			}
		);
		
		swapValue = [];
		$(".swap-value").each(function(i){
			 swapValue[i] = $(this).val();
			 $(this).focus(function(){
					if ($(this).val() == swapValue[i]) {
						 $(this).val("");
					}
					$(this).addClass("focus");
			 }).blur(function(){
					if ($.trim($(this).val()) == "") {
						 $(this).val(swapValue[i]);
			 $(this).removeClass("focus");
					}
			 });
		});
		
		$("#nav .menu-item:first").addClass('first');  
		$("#nav .sub-menu .menu-item:first").addClass('first');  
		$("#sidebar .widget_recent_entries li:first").addClass('first');  
		$("#sidebar .comments li:first").addClass('first');  
	}
);  
function showMenu(ev) {
	li = ev.currentTarget;
  if(li.childNodes.length > 1) {
		$(li).addClass('hover');
  	$(li.childNodes[2]).fadeIn(150);
  }
}
function hideMenu(ev) {
	li = ev.currentTarget;
  if(li.childNodes.length > 1) {
		$(li).removeClass('hover');
	  $(li.childNodes[2]).fadeOut(150);
  }
}
