// JavaScript Document

jQuery(function() {
			jQuery('.areas li div').click(function() { location.href = jQuery('a.link', this).attr('href'); return false; });
			jQuery('.areas li').mouseover(function() {
				jQuery('.hit', this).stop().animate({					
					height: '106px',
					width: '106px',
					border: '5px solid #fff'
			  	}, 100);
				
				if(jQuery('.bhover', this).attr('rel') == 'atuacao') { jQuery('.bhover', this).attr('src',URL + 'images/a_atuacao.jpg'); }				
				if(jQuery('.bhover', this).attr('rel') == 'equipe') { jQuery('.bhover', this).attr('src',URL + 'images/a_equipe.jpg'); }				
				if(jQuery('.bhover', this).attr('rel') == 'artigos') { jQuery('.bhover', this).attr('src',URL + 'images/a_artigos.jpg'); }				
				if(jQuery('.bhover', this).attr('rel') == 'novidades') { jQuery('.bhover', this).attr('src',URL + 'images/a_links.jpg'); }				
				if(jQuery('.bhover', this).attr('rel') == 'contato') { jQuery('.bhover', this).attr('src',URL + 'images/a_contato.jpg'); }
				
			});
			
			jQuery('.areas li').mouseout(function() {
				jQuery('.hit', this).stop().animate({
					height: '114px',
					width: '114px',
					border: '1px solid #fff'					
			  	}, 100);
				
				if(jQuery('.bhover', this).attr('rel') == 'atuacao') { jQuery('.bhover', this).attr('src',URL + 'images/b_atuacao.jpg'); }				
				if(jQuery('.bhover', this).attr('rel') == 'equipe') { jQuery('.bhover', this).attr('src',URL + 'images/b_equipe.jpg'); }				
				if(jQuery('.bhover', this).attr('rel') == 'artigos') { jQuery('.bhover', this).attr('src',URL + 'images/b_artigos.jpg'); }				
				if(jQuery('.bhover', this).attr('rel') == 'novidades') { jQuery('.bhover', this).attr('src',URL + 'images/b_links.jpg'); }				
				if(jQuery('.bhover', this).attr('rel') == 'contato') { jQuery('.bhover', this).attr('src',URL + 'images/b_contato.jpg'); }
			});
});


function change_atuacao(id, pagina)
{
	var data = 'id=' + id +
			   '&pagina=' + pagina;
				
	jQuery.ajax({
		url: "includes/atuacao.ajax.php",	
		type: "GET",		
		data: data,
			
		beforeSend: function(){},
		success: function(msg){	
			var json = jQuery.parseJSON(msg); 
			jQuery(".return").html( '<p>' + json.resume + '</p>' );
			jQuery(".title").html( json.title );			
			jQuery('.return').jScrollPane();
		}				
	});
}

function change_noticias(id, pagina)
{
	var data = 'id=' + id +
			   '&pagina=' + pagina;
				
	jQuery.ajax({
		url: "includes/noticias.ajax.php",	
		type: "GET",		
		data: data,
			
		beforeSend: function(){},
		success: function(msg){	
			var json = jQuery.parseJSON(msg); 
			jQuery(".return").html( '<p>' + json.resume + '</p>' );
			jQuery(".title").html( json.title );			
			jQuery('.return').jScrollPane();
		}				
	});
}

function change_artigos(id, pagina)
{
	var data = 'id=' + id +
			   '&pagina=' + pagina;
				
	jQuery.ajax({
		url: "includes/artigos.ajax.php",	
		type: "GET",		
		data: data,
			
		beforeSend: function(){},
		success: function(msg){	
			var json = jQuery.parseJSON(msg); 
			jQuery(".return").html( '<p>' + json.resume + '</p>' );
			jQuery(".title").html( json.title );			
			jQuery('.return').jScrollPane();
		}				
	});
}
