$(document).ready(function() {	

	$("a[rel=imagesNews]").fancybox({
		'titlePosition' 	: 'over',
		'titleFormat'		: function(title, currentArray, currentIndex, currentOpts) {
			return '<span id="fancybox-title-over"><span style="color:#656565">' + (currentIndex + 1) + ' | ' + currentArray.length + '</span>' + (title.length ? ' &nbsp; ' + title : '') + '</span>';
		}
	});
	
	$('.wp_bannerize_store').before('<div id="navStore" class="nav">').cycle({
		fx:'fade',
		speed:'slow',
		pager:  '#navStore'
	});
	
	$('.wp_bannerize_banner').before('<div id="navBanner" class="nav">').cycle({ 
	    fx:     'fade', 
	    speed:  'fast',
	    pager:  '#navBanner',
		before: function() {  
			$('#captionBanner').html($(this).find('img').attr('alt'))
		} 
    }); 
	
    $('#mediaRotate').cycle({ 
	    fx:     'fade', 
	    speed:  'fast',
	    pager:  '#navMedia',
	    timeout: 0,
	    before: function() {  
			$('#legenda').html(this.title); 
		},
		pagerAnchorBuilder: function(idx, slide) { 
        	return '#navMedia li:eq(' + idx + ') a'; 
    	} 

    });

	$(".previewPhotosGallery img, .previewPhotosGallery, #navMedia a, .ngg-gallery-thumbnail img").tipTip({
		maxWidth		: 	"auto",
		edgeOffset		:	3,
		delay			:	0
	});
	
	$("a[rel=galeriaImagens]").fancybox({
		'titlePosition' 	: 'over',
		'onStart'			:	function(){
			$('#fancyTv').remove();
		}
	});
	
	$("#videoList a, .videoProfile a").click(function() {
		$.fancybox({
			'padding'		: 0,
			'autoScale'		: false,
			'transitionIn'	: 'fade',
			'transitionOut'	: 'fade',
			'centerOnScroll'	: 'true',
			'width'			: 640,
			'height'		: 385,
			'href'			: this.href.replace(new RegExp("watch\\?v=", "i"), 'v/'),
			'type'			: 'swf',
			'swf'			: {
			'wmode'				: 'transparent',
			'allowfullscreen'	: 'true'
			},
			'onStart'			:	function(){
					
					$('#fancybox-outer').after("<div id='fancyTv'>");
				},
			'onClose'			:	function(){
					$('#fancyTv').remove();
				}
		});

		return false;
	});
	
	$('.teamList ul li').hover(function(){
		$(this).find('h2, h3').css('background-color','#e4e3e3');
		$(this).find('h2, h3').css('color','#c32d0f');
	}, 
	function(){
		$(this).find('h2, h3').css('background-color','#333333');
		$(this).find('h2, h3').css('color','#ffffff');
    });

	
});






