$(function(){$.fn.scrollToTop=function(){$(this).hide().removeAttr("href");if($(window).scrollTop()!="0"){$(this).fadeIn("slow")}var scrollDiv=$(this);$(window).scroll(function(){if($(window).scrollTop()=="0"){$(scrollDiv).fadeOut("slow")}else{$(scrollDiv).fadeIn("slow")}});$(this).click(function(){$("html, body").animate({scrollTop:0},"slow")})}});

  $(function() {
                $("#top").scrollToTop();
            });
        
  function CriaSecao(){
	  $.post("criaSecao.php",{ secao: $("#novaSecao").val() }, function(resposta){
		if(resposta!="ERRO"){
			$("#tableSecoes").html(resposta);
		}		   
	  });
  }
  
  function DeletaSecao(id){
	  $.post("deletaSecao.php",{ secao: id }, function(resposta){		  
		if(resposta!="ERRO"){			
			$("#tableSecoes").html(resposta);
		}		   
	  });
	  
  }
  
  function AtualizaPagina(){
	  self.location = "index.php?d=2";
	  self.location = "index.php?d=2";
  }
  
  
