// Função para iniciar as demais
$(document).ready(function() 
{

	/* ALTERNA EFEITO HOVER DOS MENUS */
	$('.lk-produtos').mouseover(function (e) 
	{
		$('.lk-play').removeClass('ativo');
	});
	$('.lk-play').mouseover(function (e) 
	{
		$('.lk-produtos').removeClass('ativo');	
	});
	
	/** EFEITO DE TRANSICAO DE COR **/
	/* LOGO */
	$(".logo").hover(function () {
		$(".tt-converse").stop(true);
		$(".tt-converse").animate({opacity:0},300);
	}, function ()
	{
		$(".tt-converse").stop(true);
		$(".tt-converse").animate({opacity:1},300);
    });
	/* MENU APOIO */
	$(".menu-apoio li a").hover(function () {
		$(this).stop(true);
		$(this).animate({'color':'#FFFFFF'},300);
	}, function ()
	{
		$(this).stop(true);
		$(this).animate({'color':'#837F7B'},300);
    });
	/* INPUT PESQUISAR */
	$(".txt-pesquisar").focus(function () {
		$(".bg-input-pesquisar").addClass('ativo');
	}).blur(function ()
	{
		$(".bg-input-pesquisar").removeClass('ativo');	
	});
	/** LUPA **/
	$(".bt-pesquisar-1").hover(function () {
		$(".bt-pesquisar-1").stop(true);
		$(".bt-pesquisar-1").animate({opacity:0},300);
	}, function ()
	{
		$(".bt-pesquisar-1").stop(true);
		$(".bt-pesquisar-1").animate({opacity:1},300);
    });
	/* MENU RODAPE */
	$("#rodape li a").hover(function () {
		$(this).stop(true);
		$(this).animate({'color':'#FFFFFF'},300);
	}, function ()
	{
		$(this).stop(true);
		$(this).animate({'color':'#A7A1A1'},300);
    });


	/** EFEITO OVER DOS PARAGRAFOS DO MENU PLAY **/
	$(".over-play-tv").mouseover(function () {
      $(".play-tv h3").css({'opacity':0.3});
    });
	$(".over-play-nice").mouseover(function () {
      $(".play-nice h3").css({'opacity':0.3});
    });
	$(".over-play-nice, .over-play-tv").mouseout(function () {
      $(".play-nice h3, .play-tv h3").css({'opacity':1});
    });
	
	
	$(".play-nice, .play-tv").mouseover(function () {
      $(this).css({'cursor':'pointer'});
    });
	

});

function RetornarIntersecao(objeto)
{
	var posicoes = Object;
	var posicaoX1 = parseInt(objeto.css('left'));
	var posicaoY1 = parseInt(objeto.css('top'));
	var posicaoX2 = posicaoX1 + parseInt(objeto.css('width'));
	var posicaoY2 = posicaoY1 + parseInt(objeto.css('height'));
	
	var posicoes = Object;
	posicoes.X = parseInt(posicaoX1);
	posicoes.Y = parseInt(posicaoY1);
	posicoes.X2 = parseInt(posicaoX2);
	posicoes.Y2 = parseInt(posicaoY2);
	
	return posicoes;
}

function AnimarMenuDeslisante(objeto, posicaoTop, tempo)
{
	objeto.animate( { top: posicaoTop}, tempo );
}
function VerificarIntersecao(objeto, e)
{
	var valido = true;
	var posicaoElemento = RetornarIntersecao(objeto);
	
	var posicaoMouse = Object;
		
	posicaoMouse.X = e.pageX;
	posicaoMouse.Y = e.pageY;
	
	if(posicaoMouse.X < posicaoElemento.X || (posicaoMouse.X > posicaoElemento.X2))
	{
		valido = false;
	}
	if(posicaoMouse.Y < posicaoElemento.Y || posicaoMouse.Y >  posicaoElemento.Y2)
	{
		valido = false;
	}
	return valido;
}