// Estilizador de seta Dropdown
$(document).ready(function(){
		$('select.select').each(function(){
			var title = $(this).attr('title');
			if( $('option:selected', this).val() != ''  ) title = $('option:selected',this).text();
			$(this)
				.css({'z-index':10,'opacity':0,'-khtml-appearance':'none'})
				.after('<span class="select">' + title + '</span>')
				.change(function(){
					val = $('option:selected',this).text();
					$(this).next().text(val);
					})
		});
});

//jQuery Blank
	jQuery(document).ready(function() {
	$("a[rel=blank]").attr("target", "_blank");
	$("a[rel=parent]").attr("target", "_parent");
});

// Sub-Menus
$(document).ready(function(){
	$("div#topo ul li:nth-child(6)").click(function(){
		$(this).toggleClass("menu_hover");
		$("div#topo div ol:nth-child(3)").fadeToggle("slow");
	});
	$("div#topo ul li:nth-child(8)").click(function(){
		$(this).toggleClass("menu_hover");
		$("div#topo div ol:nth-child(2)").fadeToggle("slow");
	});
});


// jQuery Cycle
$(document).ready(function(){
    $('.cycle').cycle({
		fx: 'fade',
		speed:  1000,
		timeout:  5500,
		speedIn: null,
		pause:1 
    });
    $('.cycle_prix').cycle({
		fx: 'fade',
		speed:  1000,
		timeout:  5500,
		speedIn: null,
		pause:1,
		startingSlide: 2
    });
})

//jQuery Smoothscroll
$(function(){			
	$("a[href^=#]").smoothScroll(2500,10,0,250);
	$("a[href^=.]").smoothScroll(2500,10,0,125)
})

var scrollInt
var scrTime, scrSt, scrDist, scrDur, scrInt, scrSl, scrDistX

function easeInOut(t,b,c,d)
{
	return (c/2 * (1 - Math.cos(Math.PI*t/d)) + b);
}

// Hover Colaboradores
$(document).ready(function(){
	$('div#aside ol > li').click(function(){
		$('> ul', this).fadeToggle('slow', function(){
			$('div#aside ol > li ul').not(this).fadeOut();
		});
	});
});

// Toggle do menu Prix
jQuery(document).ready(function() {
$("div#prix > div:last-child").toggle(function(){
		$("div#prix > div:last-child > ol li a").addClass("prix_ativo");
    	$("div#prix").animate({top:0},1000);
	},
    	function(){
		$("div#prix > div:last-child > ol li a").removeClass("prix_ativo");
    	$("div#prix").animate({top:-340},1000);
		}
	);
});

// Hover das empresas Prix
$(document).ready(function(){
	$('div#prix > div > ul li ol li a').hoverIntent({
		over: mostraEmpresa, 
		timeout: 250, 
		out: someEmpresa
	});
});

function mostraEmpresa(){$('> span', this).fadeIn('slow');}
function someEmpresa(){$('> span', this).fadeOut('slow');}

// Twitter
getTwitters('tweet', { 
  id: 'grupoprix',
  count: 3, 
  enableLinks: true, 
  ignoreReplies: true, 
  clearContents: true,
  template: '%text%<small class="data_hora">%time%.</small>'
});


// Caça-talentos
$(document).ready(function(){
      $('.talentos_menu').change(function() {
            $('div.talentos_arquivo').hide();
            $('div.20' + $(this).val()).fadeIn();
      }).change();
});

// Shadowbox
Shadowbox.init({
    language:   "pt-BR",
	players:    ["flv", "html", "iframe", "img", "qt", "swf", "wmp"]
});

// Vídeos
$(document).ready(function (){
	$('iframe').each(function(){
		var url = $(this).attr("src")
		$(this).attr("src",url+"?wmode=transparent")
	});
});
