function slideSwitch() {
    var $active = $('#banner IMG.active');

    if ( $active.length == 0 ) $active = $('#banner IMG:last');

    var $next =  $active.next().length ? $active.next()
        : $('#banner IMG:first');

    $active.addClass('last-active');

    $next.css({opacity: 0.0})
        .addClass('active')
        .animate({opacity: 1.0}, 1000, function() {
            $active.removeClass('active last-active');
        });
}

function confirma(href){
	cof = confirm('Deseja realmente excluir este registro?');
	
	if(cof){
		window.location = href;
	}
}

function pegaCusto(){
	var qtde = $('.custos').length;
	var nova = qtde+1;
	var tipo = $('#CustoTipo').val();
	var custo = $('#CustoValor').val();
	var desc = $('#CustoDesc').val();
	
	if(tipo == 'Outros'){
		tipo = desc;
	}
	$('#precoCustos').append('<tr><td>Tipo: <input type="text" name="custos['+nova+'][nome]" class="custos" value="'+tipo+'" /></td><td>Valor <input type="text" name="custos['+nova+'][valor]" value="'+custo+'" /></td><td><input type="checkbox" name="custos['+nova+'][show_web]" value="1" /> Mostrar</td></tr>')

	$('#CustoDesc').val('');
	$('#CustoValor').val('');
}

$(function(){
	$('#negocios ul li').each(function(){
		var tamanhoH2 = $(this).find('h2').css('height');
		//alert(tamanhoH2);
		if(tamanhoH2 == '38px'){
			$(this).find('p').css('min-height','110px');
		}
	});
})
