/**
 *
 * Arquivo de funções do Site
 * Autor: Gustavo Borges Michel
 * Website: www.gust.com.br
 *
 */

//Funções que inicializam com o Site
$(document).ready(function(){

	//Replace Facelift
	FLIR.init({
		path: base_url + 'assets/site/js/facelift/'
	});

	//Replace Facelift
	FLIR.replace(
		'p.nome-site' ,
		new FLIRStyle({
			cFont	: 'bauhaus'
		})
	);

	//Replace Facelift
	FLIR.replace(
		'div.funcao-site h4' ,
		new FLIRStyle({
			cFont	: 'myriad-cond'
		})
	);

	//Replace Facelift
	FLIR.replace(
		'div.funcao-site h5' ,
		new FLIRStyle({
			cFont	: 'myriad-cond'
		})
	);

	//Replace Facelift
	FLIR.replace(
		'div.menu ul li a.lower' ,
		new FLIRStyle({
			cFont	: 'myriad-cond'
		})
	);

	//Replace Facelift
	FLIR.replace(
		'div.box-geral h3' ,
		new FLIRStyle({
			cFont	: 'myriad-cond'
		})
	);

	FLIR.replace(
		'h2.tit-projeto' ,
		new FLIRStyle({
			cFont	: 'myriad-cond'
		})
	);

	//PNG Fix para IE6
    if($.browser.msie && ($.browser.version == "6.0")){
       DD_belatedPNG.fix('.png-fix');
    }

	//Voltar para a home
	$('#logo').click(function(){
		window.location = base_url;
	});
	
	//CORRECAO: Bug Facelift	
	$('.menu ul').find('span').remove();
	
	//Adiciona uma classe ao ultimo elemento	
	$('.coluna-esquerda .box-geral .cabecalho-box ul li:last').addClass('ultimo-item');
	
	//Botões dos Links Sociais
	$('.cabecalho-box .link-social').click(function(){
		$('.cabecalho-box .link-ativo').removeClass('link-ativo');
		$(this).addClass('link-ativo');
		str = eval("x_"+$(this).attr('rel'));
		return str();
	});

	//Twitter
	$('.cabecalho-box .twitter a').click();

	//Navegação de Projetos
	navegacao.init();
	
	//Correção BUG IE6
	$('.bg-detalhes').each(function(){

		htmlTemp = $(this).parent().find('.conteudo-detalhes').html();

		$('body').append('<div class="auxiliar none">'+htmlTemp+'</div>');

		if($.browser.msie){
			height = parseInt($('.auxiliar').height()) + 25;
		} else {
			height = parseInt($('.auxiliar').height()) + 30;
		}

		$(this).height(height);
		$('.auxiliar').remove();		

	});	
	
});
