var $j = jQuery.noConflict();
     
$j(document).ready(function(){

	$j('.linkTags').bind({
		mouseenter: function() {
			$j(this).parent('li').css("background-color","#63A6D1");
			$j(this).parent('li').children('.mais').children('.imagemHover').css({'display' : 'block'});
		},
		mouseleave: function() {
    		$j(this).parent('li').css("background-color","#efefef");
    		$j(this).parent('li').children('.mais').children('.imagemHover').css({'display' : 'none'});
		}
	});
	
	$j('.linkPergunta').bind({
		mouseenter: function() {
			$j(this).children('.pergunta').children('.textoPergunta').css({'text-decoration' : 'underline', 'cursor' : 'pointer'});
		},
		mouseleave: function() {
    		$j(this).children('.pergunta').children('.textoPergunta').css({'text-decoration' : 'none'});
		}
	});
	
	$j("ul li a").click(function(){
		$j('#boxDuvidas li').removeClass("fundoSelecionado");
		$j('.numero').css({'color' : '#facf21'});
			$j('.linkPergunta').css({'color' : '#FFFFFF'});
		$j('li ul').slideUp('fast');
		
		
		
		$j(this).next().slideToggle('fast');
		$j(this).parent().children('.numero').css({'color' : '#2681b7'});
		$j(this).css({'color' : '#6b6b6b'});
		$j(this).parent().addClass("fundoSelecionado");
	});
	
	$j("input#busca").focus(function () {
		document.getElementById("busca").value = "";
    });
    
    $j("input#busca").focus(function () {
		if (document.getElementById("busca").value == "buscar") {
			document.getElementById("busca").value = "";
		}
    });
    
    $j("input#busca").blur(function () {
    	if (document.getElementById("busca").value == "") {
			document.getElementById("busca").value = "buscar";
		}
    });
    
    $j(".boxEnviaDuvida input#author").focus(function () {
    	if (document.getElementById("author").value == "NOME") {
			document.getElementById("author").value = "";
		}
    });
    
    $j(".boxEnviaDuvida input#author").blur(function () {
    	if (document.getElementById("author").value == "") {
			document.getElementById("author").value = "NOME";
		}
    });
    
    $j(".boxEnviaDuvida input#email").focus(function () {
    	if (document.getElementById("email").value == "E-MAIL") {
			document.getElementById("email").value = "";
		}
    });
    
    $j(".boxEnviaDuvida input#email").blur(function () {
    	if (document.getElementById("email").value == "") {
			document.getElementById("email").value = "E-MAIL";
		}
    });
    
    $j(".boxEnviaDuvida textarea#comment").focus(function () {
    	if (document.getElementById("comment").value == "ENVIE SUA DÚVIDA") {
			document.getElementById("comment").value = "";
		}
    });
    
    $j(".boxEnviaDuvida textarea#comment").blur(function () {
    	if (document.getElementById("comment").value == "") {
			document.getElementById("comment").value = "ENVIE SUA DÚVIDA";
		}
    });
    
    var cssDegrade = {
      'opacity' : 0.50,
      'min-height' : $j(document).height()
    }
    
    $j('#fundoPreto').css(cssDegrade);
    
    $j('.linkEnvieDuvida').click(function() {
  		$j('#fundoPreto').fadeIn('fast');
  		$j('.boxEnviaDuvida').fadeIn('fast');
	});

    
    $j('#fecharEnviaDuvida').click(function() {
  		$j('#fundoPreto').fadeOut('fast');
  		$j('.boxEnviaDuvida').fadeOut('fast');
	});

});

/*function enviaComentario() {
	var nome = document.getElementById("author").value;
	var email = document.getElementById("email").value;
	var comentario = document.getElementById("comment").value;
	var id = document.getElementById("postID").value;
	var erroNome;
	var erroEmail;
	var erroEmail2;
	var erroComentario;
	
	//nome
	if (nome == "") {
    	erroNome = "sim";
    } else { 
    	erroNome = "nao";
    }
    
	//email vazio
	if (email == "") {
    	erroEmail = "sim";
    } else { 
    	erroEmail = "nao";
    }
    
	//email caracteres
    var filter  = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
    if (filter.test(email)) {
	    erroEmail2 = "sim";
    } else { 
    	erroEmail2 = "nao";
    }
    
    //comentario vazio
	if (comentario == "") {
    	erroComentario = "sim";
    } else { 8
    	erroComentario = "nao";
    }
    

	$j('#commentform').submit();
       
}*/
