$(document).ready(function(){ 
	$(document).pngFix(); 
	$("#global #conteudo div").hide();
	$("#global #conteudo div").fadeIn("slow");
	

		
		
	$("div#menu a").click(function(){
		$("div#menu a[class*='ativo']").removeClass('ativo');
		$(this).addClass('ativo');
		
	});
	
	$("#carregando").dblclick(function(){
		$(this).fadeOut("slow");	
	});
	
}); 
function Abre (DIV, PAGINA){
	$("#"+DIV).ajaxStart(function(){
		$("#"+DIV).empty().append("<img src=\"img/icones/load.gif\" /> Carregando...");
	});
						
	$.get(PAGINA, function(data) {
		$("#"+DIV).empty().html(data);	
	});

}
function AbreAgenda (DIV,PAGINA){
		  var Load = '<img src="img/icones/carregando.gif" alt="carregando" />';
		  
/*		  
		  	$.get(PAGINA, function(data) {
					 	$("#"+DIV).empty().html(data);	
		  	});
*/
	$.ajax({
            type: 'GET',// Usando metodo Post
            url: PAGINA, // this.action pega o script para onde vai ser enviado os dados
            data: "ajax=ok", // os dados que pegamos com a função serialize()

            beforeSend: function(){// Antes de enviar
               $('#carregando').fadeIn("slow");
					 $('#carregando').html(Load);
            },
            success: function(data){
					 $('#carregando').fadeOut("slow");
            	$("#"+DIV).html(data);// Escrevo a mensagem
            },
            error: function(data){// Se acontecer algum erro é executada essa função
                $("#"+DIV).html("<h1>Erro 404: A página solicitada não foi econtrada</h1>");
            }
        })
	

}