$(document).ready(function(){
	$("#navmenu-h li,#navmenu-v li").hover(
		function() { $(this).addClass("iehover"); },
		function() { $(this).removeClass("iehover"); }
	);

	
	//setInterval(seila,4000);

	
	/* ------------------------------------  Resolve o problema de não fechar o 2º nível do menu no IE 7 ---------------------------------------------------*/
	jQuery.each(jQuery.browser, function(i, val) {
		//Se for IE 7 
		if(i=="msie" && jQuery.browser.version.substr(0,3)=="7.0"){
			$("ul#navmenu-v li:hover ul li, ul#navmenu-v li:hover ul ul li, ul#navmenu-v li.iehover ul li, ul#navmenu-v li.iehover ul ul li").mouseleave(function(){
				$(this).children(".submenu").css("display","none");	
			});
			$("ul#navmenu-v li:hover ul li, ul#navmenu-v li:hover ul ul li, ul#navmenu-v li.iehover ul li, ul#navmenu-v li.iehover ul ul li").mouseenter(function(){
				$(this).children(".submenu").css("display","block");	
			});
		}
	 });

	//$(".box-menu").corner("top: 5px;");
	/*$(".borda-top").corner("round top 5px;");
	$(".borda-bot").corner("round bottom 5px;");*/

	$(".sub li:last-child").each(function(){
		$(this).css("border-bottom","0");
		$(this).prev().css("border-bottom","0");
	});

	$(".sub li:first-child").each(function(){
		$(this).css("border-bottom","0");
		$(this).prev().css("border-bottom","0");
	});

	//------------------------------  hover top border -------------------------------------------------

	//function seila(){
		$(".sub").each(function(){
			$(this).find(".borda-top").each(function(){
				var $this = $(this);
				$this.next().find("*").mouseenter(function(){
					$this.css("background-image","url(/images/navegacao/borda-top-hover.gif)");
				});
				$this.next().mouseleave(function(){
					$this.css("background-image","url(/images/navegacao/borda-top.gif)");
				});
			});
			$(this).find(".borda-bot").each(function(){
				var $this = $(this);
				$this.prev().find("*").mouseenter(function(){
					$this.css("background-image","url(/images/navegacao/borda-bot-hover.gif)");
				});
				$this.prev().mouseleave(function(){
					$this.css("background-image","url(/images/navegacao/borda-bot.gif)");
				});
			});
		});
	//}
});

