// JavaScript Document


// JavaScript Document
var $ = jQuery.noConflict();

$(document).ready(function(){
 if(jQuery.trim($('.admin').html()) == '')
 {
 $('.admin').css("display", "none");
 }
 else
 {
 $('.admin').css("display", "block");
 }

 $('#contentMenu').css('height', 'auto');

 //Variavel definida nas páginas, elas indicam se deve ou não o menu ficar aberto
 if(!menuAberto)
 {
 $('#contentMenu ul').hide();
 }
 $('#contentMenu h3').click(function(){
 $(this).next().slideToggle();
 $(this).toggleClass('corrente');
 $(this).next().toggleClass("on");

 var soma=0;
 $("li",$(this).next()).each(function() {
 soma += $(this).outerHeight();
 });
 if(($(this).next()).hasClass("on")) {
 $("body").height($("body").height()+soma+10);
 }
 else {
 $("body").height($("body").height()-soma-10);
 }
 $("#containerLeft").height($("body").height());
 });

 $(".boxTema dl dt a").click(function() {
 var $this = $(this).parent().next()[0];
 $(".boxTema dl dd").each(function() {
 if($this !== $(this)[0]) {
 $(this).prev().removeClass("on");
 $(this).slideUp();
 }
 });
 $(this).parent().next().slideToggle();
 $(this).parent().toggleClass("on");
 return false;
 });

 $("body").height($(document).height());

$("#containerLeft").height($(document).height());

 /* EVENTO DE ABRIR O LIGHTBOX */
 $('.boxRss p a').click(function(){

 /* VERIFICA A ALTURA DA DIV CONTAINER */
 var alturaContainer = $('.containerInterna').height();
 /* APLICA A OPACIDADE NA DIV, PARA VALIDAR NO W3C */
 $('.lightbox').animate({opacity:'0.5'},0);
 $('.lightbox').fadeIn(800);
 /* APLICA A ALTURA NO LIGHTBOX */
 $('.lightbox').animate({height:alturaContainer},0);
 $('.containerLightbox').fadeIn('slow');
 /* CARREGA NA DIV .conteudoLightBox, a página "rss.htm" */
 $('.containerLightbox .conteudoLightBox').load('rss.htm');

 var browser=navigator.appName;
 var b_version=navigator.appVersion;
 b_version = b_version.substring(22,23);

 if(browser.indexOf("Microsoft Internet Explorer") !== -1 && b_version == 6) {
 $("select").css("visibility","hidden");
 }
 return false;
 });

/* EVENTO DE FECHAR O LIGHTBOX */
 $('.txt_comercial a').click(function(){
									   	alert('Funfa');
 //$('.containerLightbox').fadeOut('slow');
// $('.lightbox').fadeOut('slow');
//
// var browser=navigator.appName;
// var b_version=navigator.appVersion;
// if(browser.indexOf("Microsoft Internet Explorer") !== -1 && b_version == 6) {
// $("select").css("visibility","visible");
// }
// return false;
// });
});

function RedirectToCategory(link){
 location.href = link;
}

$(document).ready(function(){
$('#boxTooltip a').tooltip({
track: true,
delay: 0,
showURL: false,
extraClass: "right"
});
});

$(document).ready(function(){
var elementoDiv = '.containerRight .boxConteudo .containerBlog .boxCenter .boxPost .boxTexto div[align]';
var elementoP = '.containerRight .boxConteudo .containerBlog .boxCenter .boxPost .boxTexto p[align]';

if($(elementoDiv).attr("align") == "right")
{

$(elementoDiv).addClass("floatRight");
$(elementoDiv).removeAttr("align");
}

if($(elementoDiv).attr("align") == "left")
{

$(elementoDiv).addClass("floatLeft");
$(elementoDiv).removeAttr("align");
}

if($(elementoP).attr("align") == "right")
{

$(elementoP).addClass("floatRight");
$(elementoP).removeAttr("align");
}

if($(elementoP).attr("align") == "left")
{

$(elementoP).addClass("floatLeft");
$(elementoP).removeAttr("align");
}
});

//$(document).ready(function(){
//	$('.btnAjuda').click(function(){
//		/* VERIFICA A ALTURA DA DIV CONTAINER */
//		var alturaContainer = $('#containerInterna').height();
//		/* APLICA A OPACIDADE NA DIV, PARA VALIDAR NO W3C */
//		$('.lightbox').animate({opacity:'0.5'},0);
//		$('.lightbox').fadeIn(800);
//		/* APLICA A ALTURA NO LIGHTBOX */
//		//$('.lightbox').animate({height:alturaContainer+50},0);
//		$('.containerLightbox').fadeIn('slow');
//		/* CARREGA NA DIV .conteudoLightBox, a página "rss.htm" */
//		$('.containerLightbox .conteudoLightBox').load('http://boticario.tv1.com.br/mundomaisbelo/AconteceNasEscolas/Util/Usc/lightboxVideo.aspx');
//		
//		var browser=navigator.appName;
//		var b_version=navigator.appVersion;
//		b_version = b_version.substring(22,23);
//
//		if(browser.indexOf("Microsoft Internet Explorer") !== -1 && b_version == 6) {
//			$("select").css("visibility","hidden");
//		}
//		return false;		
//	});    
//});