$(function() {
		
	 /*TABS*/
		$('#mais').tabs(1,{ fxFade: true, fxSpeed: 'fast',fxAutoHeight: false });
		$('#destaque').tabs({ fxFade: true, fxSpeed: 'fast',fxAutoHeight: false });

	/*CARROSSEL*/
		function mycarousel_initCallback(carousel)
		{
		    // Disable autoscrolling if the user clicks the prev or next button.
		    carousel.buttonNext.bind('click', function() {
		        carousel.startAuto(0);
		    });

		    carousel.buttonPrev.bind('click', function() {
		        carousel.startAuto(0);
		    });

		    // Pause autoscrolling if the user moves with the cursor over the clip.
		    carousel.clip.hover(function() {
		        carousel.stopAuto();
		    }, function() {
		        carousel.startAuto();
		    });
		};

		$('#carrossel').jcarousel({
			animation: 'slow',
			animate: 'easein',
			auto: 5,
			scroll: 4,
			wrap: 'both',
			start: 2,
			initCallback: mycarousel_initCallback
		});
		
		$('#carrosseledicoes').jcarousel({
			animation: 'slow',
			animate: 'easein',
			auto: 5,
			scroll: 4,
			wrap: 'both',
			start: 2,
			initCallback: mycarousel_initCallback
		});
		
		
	/*FIM CARROSSEL*/
	/*RESIZE TEXT NOTÍCIA*/
	//Font resize
	//reset font size
	var currentFontSizeNum = 13;

	//size1
	$(".small").click(function(){
		var newFontSize = currentFontSizeNum*1;
		$('#corponoticia').css('font-size',newFontSize);
		return false;
	});
	//size2
	$(".medium").click(function(){
		var newFontSize = currentFontSizeNum*1.2;
		$('#corponoticia').css('font-size',newFontSize);
		return false;
	});
	//size3
	$(".large").click(function(){	
		var newFontSize = currentFontSizeNum*1.4;
		$('#corponoticia').css('font-size',newFontSize);
		return false;
	});
	//size4
	$(".huge").click(function(){
		var newFontSize = currentFontSizeNum*1.6;
		$('#corponoticia').css('font-size',newFontSize);
		return false;
	});
	
	//FANCYBOX
	
	$("#noticia a[href$='.jpg']").addClass('fancybox');
	$("#noticia a[href$='.png']").addClass('fancybox');
	$("#edicaopost a[href$='.jpg']").addClass('fancybox');
	$("#edicaopost a[href$='.png']").addClass('fancybox');
	
	
	$("#noticia a.fancybox").fancybox({
		'zoomSpeedIn':	100, 
		'zoomSpeedOut':	100,
		'overlayShow':	true,
		'overlayOpacity': .5,
		'imageScale': true
	});
	
	$("#edicaopost a.fancybox").fancybox({
		'zoomSpeedIn':	100, 
		'zoomSpeedOut':	100,
		'overlayShow':	true,
		'overlayOpacity': .5,
		'imageScale': true
	});
	
	//$('div#corponoticia p:first').fancyletter();
	//$('div#edicaopost p:first').fancyletter();


	/*EXTERNAL LINKS*/
	$('#corponoticia a').filter(function() {
	    return this.hostname && this.hostname !== location.hostname;
	}).after(' <img src="/wp-content/themes/marketeer/images/external.png" class="externallink" alt="link externo" title="link externo" />');
	
	$('#pagina a').filter(function() {
	    return this.hostname && this.hostname !== location.hostname;
	}).after(' <img src="/wp-content/themes/marketeer/images/external.png" class="externallink" alt="link externo" title="link externo" />');

	/*PRINT LINK*/
	$('.printlink').click(function(){
		print();
	});
	
	<!--HISTORY-->
	$('.history').click(function(){
	     history.go(-1);
	 });


});


