/*
	Menu Drop Down,,permite apenas um item com o mesmo atributo rel aberto,oculta os outros que estiverem sendo mostrados.
	Funciona com  nivel e subnivel.
	@author cristiano souza silva
*/

var $j = jQuery.noConflict();

$j(document).ready(function(){
	$j("a[@rel = 'menu']").click(function(){
		$j("a[@rel = 'menu']").each(function(){
			var display = $j(this).next().css('display');
			if(display == 'block' || display == ''){
				$j(this).next().hide();
				$j("a[@rel = 'sub']").each(function(){
					var sub	=	$j(this).next().css('display');
					if(sub == 'block' || sub == ''){
						$j(this).next().hide();
					}
				});
			}
		});
		$j(this).next().show("slow");
		return false;
	});
	$j("a[@rel = 'sub']").click(function(){
		$j("a[@rel = 'sub']").each(function(){
			var display = $j(this).next().css('display');
			if(display == 'block' || display == ''){
				$j(this).next().hide();
			}
		});
		$j(this).next().show("slow");
		if($j(this).attr('href') == '#'){
			return false;
		}
	});
});
