$(document).ready(function() {	

	$('#m1').mouseover(function (){
		document.getElementById('apagaMenu').style.display = "block";

		if(navigator.appName == 'Microsoft Internet Explorer'){
			document.getElementById('subMenuInst').style.display = "block";
		} else {
			$("#subMenuInst").fadeIn("fast");
		}

		document.getElementById('im1').src = "images/btnMenu2b.gif";
	});	

	$('#m2').mouseover(function (){
		document.getElementById('apagaMenu').style.display = "block";

		if(navigator.appName == 'Microsoft Internet Explorer'){
			document.getElementById('subMenuGal').style.display = "block";
		} else {
			$("#subMenuGal").fadeIn("fast");
		}

		document.getElementById('im2').src = "images/btnMenu4b.gif";
	});	

	$('#apagaMenu').mouseover(function (){
	   $(".subMenu").fadeOut("fast");
	   document.getElementById('apagaMenu').style.display = "none";
		document.getElementById('im1').src = "images/btnMenu2.gif";
		document.getElementById('im2').src = "images/btnMenu4.gif";
	});	

	$('.someSub').mouseover(function (){
	   $(".subMenu").fadeOut("fast");
	   document.getElementById('apagaMenu').style.display = "none";
		document.getElementById('im1').src = "images/btnMenu2.gif";
		document.getElementById('im2').src = "images/btnMenu4.gif";
	});	


});
