﻿// JavaScript Document
jQuery.noConflict();
jQuery(document).ready(function(){
	var carregando = jQuery('#carregando');
	var conteudoAjax = jQuery('#conteudo-ajax');

	function preCarregamento(){
		carregando.css('display', 'block').fadeIn(1000);
		conteudoAjax.html("");
	};
	
	function aposCarregamento(){
		carregando.fadeOut(0);
	};  

	jQuery("a.ajax").each(function() {
	   var href = jQuery(this).attr('href');
	   jQuery(this).attr('href','javascript:void(0)');
	   jQuery(this).click(function(){
		    preCarregamento();
			jQuery.get(href, function(data){
				conteudoAjax.html(data);
				aposCarregamento();
			});
			return null;
	});
 });
});
