// Abre Corretor Online
function AbreJanela(theURL,winName,features) {
	window.open(theURL,winName,features);
}

// Submenu
function SubMenu(id) {
	_div = document.getElementById(id).style.display;
	if ( _div == 'none' ) {
		document.getElementById(id).style.display = 'block';
	} else {
		document.getElementById(id).style.display = 'none';
	}
}

// JavaScript Document
$(document).ready(function(){
	$('h1').flash(
        { 
            src: 'swf/myriad.swf', 
            flashvars: { 
                css: [
                    '* { color:#000000; }',
                ].join(' ')
            },
			wmode: "transparent"
        },
		
        { version: 7 },
        function(htmlOptions) {
            htmlOptions.flashvars.txt = this.innerHTML;
            this.innerHTML = '<div>'+this.innerHTML+'</div>';
            var $alt = $(this.firstChild);
            htmlOptions.height = 30;
            htmlOptions.width = 440;
            $alt.addClass('alt');
            $(this)
                .prepend($.fn.flash.transform(htmlOptions));						
        }
    );		
});

$(document).ready(function(){
	$('h2').flash(
        { 
            src: 'swf/myriad.swf', 
            flashvars: { 
                css: [
                    '* { color:#000000; }',
                ].join(' ')
            },
			wmode: "transparent"
        },
		
        { version: 7 },
        function(htmlOptions) {
            htmlOptions.flashvars.txt = this.innerHTML;
            this.innerHTML = '<div>'+this.innerHTML+'</div>';
            var $alt = $(this.firstChild);
            htmlOptions.height = 30;
            htmlOptions.width = 440;
            $alt.addClass('alt');
            $(this)
                .prepend($.fn.flash.transform(htmlOptions));						
        }
    );		
});

// Destaques Home
$(function(){
	$("#cycleDestaques .jCarouselLite").jCarouselLite({
		btnNext: "#cycleDestaques .next",
		btnPrev: "#cycleDestaques .prev",
		//auto: 3500,
		speed: 800,
		visible: 3,
		cleartype: 1
	});
});

// Lançamentos
$(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));
	});					   
						   
	$('#fichaLancamento').tabs({
		fxSlide:	false,
		fxFade:		true,
		fxSpeed:	500
	});
});

