var obj = null;
function checkHover() {
	if (obj) {
		if (obj.children().is("ul")){
			obj.removeClass('open');
		}
		obj.find('ul').fadeOut('fast');
		//obj.children('ul').fadeOut('fast');	
	} //if
} //checkHover

$(document).ready(function() {
	/* teste para verificar se o cookie está habilitado */
	var testck = 0;
	$("#msgcookie").hide();
	$.cookie("testcookie",'1');
	testck = $.cookie("testcookie");
	if (testck == undefined || testck == 0){
		$("#msgcookie").show();
	}
	$.cookie('testcookie',null);
	
	$("#login .flogin").hide();
	$("#login .abre a").toggle(function() {
			$("#login .flogin").animate({
				height: 'show',
				opacity: 'show'
			}, 'slow');
		}, function() {
			$("#login .flogin").animate({
				height: 'hide',
				opacity: 'hide'
			}, 'slow');
	});
	$('#nav ul > li').hover(function() {
		if (obj) {
			if (obj.children().is("ul")){
				obj.removeClass('open');
			}
			obj.find('ul').fadeOut('fast');
			//obj.children('ul').fadeOut('fast'); 
			obj = null;
		} //if
		
		if ($(this).children().is("ul")){
			$(this).addClass('open');
		}
		$(this).children('ul').fadeIn('normal');
	}, function() {	
		obj = $(this);
		setTimeout(
			"checkHover()",
			200);
	});
});

function popup(nome,nomejan,posx,posy,vlx,vly,scrol) 
{
	var attrib="toolbar=no,scrollbars="+scrol+",no,resizable=no,top="+posy+",left="+posx+",width="+vlx+",height="+vly;
	if (nomejan == '')
	{	nomejan='_blank';	}
	open (nome,nomejan,attrib);
}