// JavaScript Document


$(document).ready(function(){

function redimImg(img){
	var limite = {
		hMax: 100,
		wMax: 140
	}
	if(img.height() > img.width()){
		img.height(limite.hMax);
		img.removeAttr("width");
	}else{
		img.width(limite.wMax);
		img.removeAttr("height");		
	}
	return(true);
}
	$("#fichaLancamento #fotos img").each(function(){
		redimImg($(this));
	});

	$('.destaque').before('<div id="nav2">').cycle({ 
		fx:     'turnDown', 
		speed:  600, 
		timeout: 6000, 
		pager:  '#nav2' 
	});

//TABS
	$('#fichaLancamento').tabs({
		fxSlide:	true,
		fxFade:		true,
		fxSpeed:	'fast'
	});
	
	$('h1').flash({
		src: 'h1.swf',
		wmode: 'transparent',
		flashvars: {
			css: ['* {color:#003E7E;}'].join(' ')
			}
		},
		{ version: 8 },
		function(htmlOptions) {
			htmlOptions.flashvars.txt = this.innerHTML;
			this.innerHTML = '<span>'+this.innerHTML+'</span>';
			var $alt = $(this.firstChild);
			htmlOptions.height = $alt.height();
			htmlOptions.width = $alt.width();
			$alt.addClass('alt');
			$(this)
			.addClass('sIFR')
			.prepend($.fn.flash.transform(htmlOptions));						
		}
	);

$('.menu3 h2').flash({
		src: 'h1.swf',
		wmode: 'transparent',
		flashvars: {
			css: ['* {color:#ffffff;}'].join(' ')
			}
		},
		{ version: 8 },
		function(htmlOptions) {
			htmlOptions.flashvars.txt = this.innerHTML;
			this.innerHTML = '<span>'+this.innerHTML+'</span>';
			var $alt = $(this.firstChild);
			htmlOptions.height = $alt.height();
			htmlOptions.width = $alt.width();
			$alt.addClass('alt');
			$(this)
			.addClass('sIFR')
			.prepend($.fn.flash.transform(htmlOptions));						
		}
	);
	
});




