$(document).ready(function(){
	$(".menulateral img").hover(
		function(){
			$(this).attr("src",$(this).attr("src").replace('.jpg','_f2.jpg'));
		},
		function(){
			$(this).attr("src",$(this).attr("src").replace('_f2.jpg','.jpg'));
		}
	);
	$("#sobresubmenu span").click(
		function (){
			var sobremenu = document.getElementById("sobresubmenu");
			var numopcoes = sobremenu.getElementsByTagName("span").length;
			$(".submenucont").hide();
			var opcao = this.id.split("_");
			$("#cont_"+opcao[1]).fadeIn("slow");
		}
	);
	$("#atend_msn").click(function(){
		var janela = window.open('http://settings.messenger.live.com/Conversation/IMMe.aspx?invitee=5506272d0760abd1@apps.messenger.live.com&mkt=pt-PT','_blank','width=300,height=400');
		janela.moveTo(300,100);
	});
	$(".submenuabas .abas div").click(function(){
		var idselect = this.id;
		var idinfo = idselect.split("_");
		$(this).css("z-index",21);
		$(this).css("color","#0066CC");
		$(this).css("background-image",$(this).css("background-image").replace(".png","_f2.png"));
		var i = 20;
		$(".submenuabas .abas div").each(function(key, value) { 
			if(this.id != idselect){
			$(this).css("color","#333333");
				$(this).css("background-image",$(this).css("background-image").replace("_f2.png",".png"));
				$(this).css("z-index",i);
			}
			i--;
		});
		$(".submenuabas .conteudo div").hide();
		$("#abacont_"+idinfo[1]).show();
	});
});

// Google Analytics
  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-8611104-3']);
  _gaq.push(['_trackPageview']);

  (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  })();
