$(document).ready(function(){
    $("input[type='text'],textarea").focus(function(){
	if($(this).val() == "Este campo é obrigatório"){
		$(this).css({"backgroundColor":"#E2E7E8","color":"#074E81"}).val("");
	}
	if($(this).val() == $(this).attr("valor")){
	    $(this).val("");
	}
    });	
    $("input[type='text'],textarea").blur(function(){
	if($(this).val() == ""){
	    $(this).val($(this).attr("valor"));
	}
    });	
    $("form.autenticar").submit(function(){
	var erro = 0;
	$(".obrigatorio").css("borderColor","#D7DADB");
	$(this).find(".obrigatorio").each(function(){
	    if($(this).val() == "" || $(this).val() == $(this).attr("valor")){
 		erro++;
		$(this).css({"backgroundColor":"#ffd5d5","color":"#f00"}).val("Este campo é obrigatório");
	    }
	});
	if(erro > 0){
	    return false;
	}
    });
	setInterval(function(){
		var img = $(".boxcliente .cliente:last").clone();
		$(".boxcliente .cliente:last").fadeOut(400,function(){
			$(".boxcliente .cliente:last").remove();
			$(".boxcliente").prepend(img);
		});
	},4000);
	$(".interna .main .noticia").find("img").each(function(){
		$(this).after("<span>"+$(this).attr("alt")+"</span>");
	});
});

