$(document).ready(function() {

	
	$('.desc_trabalho').hover(
		function(){
			$(this).removeClass('desc_trabalho');
			$(this).addClass('over_desc');
		},
		function(){
			$(this).removeClass('over_desc');
			$(this).addClass('desc_trabalho');
		}
	);
	
	
	//Clientes Coloridos ou P&B no Rollover
	$('.img_cliente a').hover(
		function() {
			$(this).find('img').fadeOut('fast');
		},
		function() {
			$(this).find('img').fadeIn('fast');
		}		
	);
	
	
	$('.img_cliente a').each(function(i) {
		var cliente = $(this);
		var img = $(cliente).find('img').attr('src'); //Pega a imagem do Cliente
		
		$(cliente).css({background: 'url('+img+')'}); //Deixa todos os BGs Preto & Branco
		
		img = img.replace('.jpg','_cor.jpg'); //Altera nome da imagem
		img = img.replace('.gif','_cor.gif'); //Altera nome da imagem
		
		
		//Verifica por Ajax se a imagem Colorida Existe no servidor
		jQuery.ajax({
			url: img,
			type:'post',
			success: function(html) {
				$(cliente).css({background: 'url('+img+')'}); //Se existir, altera o BG para Colorido
		  	}
		});		
		
	});

	
});
