Shadowbox.init();

checkEmail = function() {
    $.ajax({
        type: "POST",
        url: "/imdt.php/pesquisa/check-user-email/",
        data: $('input[name=email]').serialize()+'&'+$('input[name=codigo_pesquisa]').serialize(),
        success: function(retorno) {
            if($.trim(retorno) !== $.trim('win')) {
                $('#dialog').html(retorno);
                $('#dialog').dialog({
                    title: 'Aviso',
                    modal: true,
                    draggable: false,
                    resizable: false,
                    buttons: {
                        Ok: function() {
                            $( this ).dialog( "close" );
                            $('#dialog').html('');
                        }
                    }
                });  
            }
        },
        beforeSend: function(){
            //$('#loading').fadeIn('slow');
        },
        complete: function(){
            //$('#loading').fadeOut('slow');
        }
    });
}

menuHover = function(){     
		if(!$(this).children('.img-hover').children('img').hasClass('hovered')) {        
			$('.img-hover').children('img').stop(true, true);
			$('.img-hover').children('img').removeAttr('style');   
			$('.img-hover').children('img').removeClass('hovered');   
			$(this).children('.img-hover').children('img').addClass('hovered').animate({
				opacity: 1,
				bottom: '-4'
			}, 500).animate({bottom: '-10'}, 100).animate({bottom: '-4'}, 100);
		}
};
       
$(document).ready(
    function() {
        $('.menu li').hover(menuHover,function(){}); 
        $('.sidebar').height($('.content').height());
        $('.boxContainer ul li a').hover(function(){
             $(this).children().each(function(){
                $(this).css('color','#EB3B11');
            });
        }, function(){
            $(this).children().each(function(){
                $(this).css('color','#484848');
            });
        });    
    });
	

function ir() {
	url = document.selectWide.w_wide.value;
	window.open(url);
} 

function ShowBox(div){
	var num = document.getElementById("num");
	//alert(num.value);
	n = num.value;
	
	for(i = 1; i < n; i++){
		
		hide = document.getElementById("A" + i);
		//alert(hide)
		hide.style.display = 'none';
	}
	
	show = document.getElementById(div);
	show.style.display = 'block';	
}

