/* LIGHTBOX(NOTICIAS DETALHES) */
hs.graphicsDir = 'images/graphics/';
hs.align = 'center';
hs.transitions = ['expand', 'crossfade'];
hs.outlineType = 'rounded-white';
hs.fadeInOut = true;
hs.headingEval = 'this.thumb.alt';
hs.headingOverlay.position = 'below';
hs.addSlideshow({
	interval: 5000,
	repeat: false,
	useControls: true,
	fixedControls: 'fit',
	overlayOptions: {
		opacity: .75,
		position: 'bottom center',
		hideOnMouseOut: true
	}
});
/* FIM LIGHTBOX(NOTICIAS DETALHES) */
$(document).ready(function() {
	$("#lancamentos .items > div").mouseover(function() {
		$("#lancamentos .items > div h3").stop();
		$("h3", this).animate({bottom:0}, 500)
	});
	$("#lancamentos .items > div").mouseout(function() {
		$("#lancamentos .items > div h3").stop();
		$("h3", this).animate({bottom:-40}, 500)
	});
	$("#login div label").mouseup(function() {
		$(this).parent().children("input").focus();
	});
	$("#login div input").focus(function() {
		$(this).parent().children("label").animate({opacity:0}, 500);
	});
	$("#login div input").blur(function() {
		if ($(this).val() == "") {
			$(this).parent().children("label").animate({opacity:1}, 500);
		}
	});
	/* EBIS */
	$("#link").mouseover(function() {
		$("#ebis img").stop();
		$("#ebis img:first-child").animate({top:0, opacity: 0}, 250, function() {
			$(this).animate({top:15, opacity: 1}, 250);
			$("#ebis img + img").animate({top:35, opacity: 1}, 250);
		});
	});
	$("#link").mouseout(function() {
		$("#ebis img").stop();
		$("#ebis img + img").animate({top:45, opacity: 0}, 250);
		$("#ebis img:first-child").animate({top:0, opacity: 0}, 250, function() {
			$(this).animate({top:15, opacity: 1}, 250);
		});
	});
	/* MENU */
	$("#menu li a").mouseover(function() {
		if(!$(this).parent().hasClass("selected")){
			$(this).parent().children("img + img").stop();
			$(this).parent().children("img + img").animate({top: 0}, 500);
		};
	});
	$("#menu li a").mouseout(function() {
		if(!$(this).parent().hasClass("selected")){
			$(this).parent().children("img + img").stop();
			$(this).parent().children("img + img").animate({top: -93}, 500);
		};
	});
	/* BANNERS HOME */
	$(".scrollable").scrollable({easing: 'swing', speed: 1200, circular: true});
	/* PAGINACAO */
	$("#pagination").parent().children("ul").css("border-bottom", "#ccc 1px dotted");
	/* LINHAS */
	$("#linhas").corner("5px");
	$("#produtos h2 a").click(function() {
		if(!$("#linhas").hasClass("selected")){
			$("#linhas").addClass("selected");
			var j = $("#linhas ul").innerHeight();
			$("#linhas").animate({height:j}, 500);
		}else{
			$("#linhas").removeClass("selected");
			$("#linhas").animate({height:0}, 500);
		};
	});
	/* BUSCA */
	$("#busca div label").mouseup(function() {
		$(this).parent().children("input").focus();
	});
	$("#busca div input").focus(function() {
		$(this).parent().children("label").stop();
		$(this).parent().children("label").animate({opacity:0}, 500, function(){
			$(this).css("display", "none");
		});
	});
	$("#busca div input").blur(function() {
		if ($(this).val() == "") {
			$(this).parent().children("label").stop();
			$(this).parent().children("label").css("display", "block");
			$(this).parent().children("label").animate({opacity:1}, 500);
		};
	});
	/* FLASH */
	$('#anim div').flash(
		{ src: 'images/animacao.swf',
			width: 950,
			height: 378,
			wmode: 'transparent'
			}
	);
	$('#anim div.alt').remove();
});


