var paginaImagens = false;

function openImagem(indice) {
	tb_show(false,"imagem_detalhe.php?indice="+indice+"&amp;width=810&amp;height=570&amp;modal=false&amp;margem=especial",null);
}

function openVideo(indice)
{
	
	tb_show(false,"video_detalhe.php?indice="+indice+"&amp;width=810&amp;height=540&amp;modal=false&amp;margem=especial",null);
	//tb_show(null,"maps.php?width=804&amp;height=680&amp;endereco="+indice+"&amp;modal=true&amp;TB_iframe=true");
	//tb_show(false,"imagem_detalhe.php?indice="+indice+"&amp;width=820&&amp;height=540&amp;modal=false&amp;TB_iframe=true&amp;margem=especial",null);
	//tb_show(false,"imagem_detalhe.php?indice="+indice+"&amp;width=820&amp;height=540&amp;modal=false&amp;margem=especial",null);	
}

function openTour(nomeArquivo,indice)
{
	
	tb_show(false,"tour/"+nomeArquivo+".php?idEmpreendimento="+indice+"&amp;width=810&amp;height=540&amp;modal=false&amp;margem=especial",null);
	//tb_show(null,"maps.php?width=804&amp;height=680&amp;endereco="+indice+"&amp;modal=true&amp;TB_iframe=true");
	//tb_show(false,"imagem_detalhe.php?indice="+indice+"&amp;width=820&&amp;height=540&amp;modal=false&amp;TB_iframe=true&amp;margem=especial",null);
	//tb_show(false,"imagem_detalhe.php?indice="+indice+"&amp;width=820&amp;height=540&amp;modal=false&amp;margem=especial",null);	
}
function openMap(endereco)
{
	tb_show(null,"maps.php?width=804&amp;height=455&amp;endereco="+endereco+"&amp;modal=true&amp;TB_iframe=true");
}

function iniciar_at()
{
	tb_show(false,"http://interacoes.grupoagre.com.br/atendimento-online-novo.php?TB_iframe=true;width=525&amp;height=470&amp;modal=false",null);
}

function superTroca(nome, idAgre, localidade)
{
	//tb_show(null,"http://fess-xseries/agre-portal/lightbox-supertroca.php?produto=" + nome + "&amp;localidade=" + localidade + "&amp;idAgre=" + idAgre + "&amp;TB_iframe=true&amp;width=510&amp;height=360&amp;modal=true&amp;supertroca=true");
	tb_show(null,"http://www.grupoagre.com.br/lightbox-supertroca.php?produto=" + nome + "&amp;localidade=" + localidade + "&amp;idAgre=" + idAgre + "&amp;TB_iframe=true;width=510&amp;height=360&amp;modal=true&supertroca=true");
}

function procuraImagem(src)
{
		var indice = 0;
		for(cont=0; cont<arImages.length; cont++){
			if (arImages[cont] == src) indice = cont;
		}
		openImagem(indice);
}

function doBusca(idEtapa){
	var idEstado 	= jQuery('#uf-filter').val();
	var sigla 		= '';
	
	jQuery('#uf-filter option').each(function() {
		if( jQuery(this).val() == idEstado )
		{
			sigla = jQuery(this).text();
		}
	});
	
	//jQuery('#etapa').val('4');
	//jQuery('#frmTopSearch').submit();
	
	
	//document.location = "busca.php#"+sigla+",,,,breve+lancamento";
}

var utm_source = '';
var utm_medium = '';
var utm_content = '';
var utm_campaign = '';
var externalProduto = '';
var externalIdEmpreendimento = '';
var externalIdAntigo = '';
var externalLocalidade = '';
var externalCidade = '';
var externalEstado = '';

function openInteracao(tipo,produto,idAntigo,localidade,extra)
{
    if (produto 	== '' && externalProduto != '')		produto 	= externalProduto;
    if (idAntigo 	== '' && externalIdAntigo != '') 	idAntigo 		= externalIdAntigo;
    if (localidade 	== '' && externalLocalidade != '') 	localidade 	= externalLocalidade;
    
    var is_chrome = navigator.userAgent.toLowerCase().indexOf('chrome') > -1;
    var is_safari = navigator.userAgent.toLowerCase().indexOf('safari') > -1;
    
    if ((is_chrome == true || is_safari == true) && tipo == 'interacaocomcorretor'){
		tipo = 'informacoesporemail';
		alert("Esta ferramenta não oferece suporte para o seu navegador de internet. Por favor, entre em contato através do nosso atendimento por e-mail.");
	}	
    
	//var url = 'http://pdg.com.br/interacoes/'+tipo+'.php?produto='+produto+'&localidade='+localidade+'&idEmpreendimento='+idAgre+'&origemSite=pdg';
	//var url = 'http://pdg.com.br/interacoes/'+tipo+'.php?produto='+produto+'&localidade='+localidade+'&idEmpreendimento='+idEmpreendimento+'&origemSite=pdg-sp';
	var url = 'http://fess-xseries/pdg-interacoes/'+tipo+'.php?origemSite=pdg-portal&produto='+produto+'&localidade='+localidade+'&idAgre='+idAgre;
	    
	url += '&amp;utm_source='+utm_source;
	url += '&amp;utm_medium='+utm_medium;
	url += '&amp;utm_content='+utm_content;
	url += '&amp;utm_campaign='+utm_campaign;

	if (jQuery.url.param("campanha") != undefined)
		url += '&amp;campanha='+jQuery.url.param("campanha");

	if (extra != '') url += extra.replace('&','&amp;');

	if (tipo == 'interacaocomcorretor')
    {
        if(navigator.appName=='Microsoft Internet Explorer')
        {
            url += '&amp;width=525&amp;height=440&amp;unidadenegocio='+extra;		
        }
        else
        {
            url += '&amp;width=525&amp;height=425&amp;unidadenegocio='+extra;
        }
    }
		
	if (tipo == 'simuleofinanciamento')
		url += '&amp;width=622&amp;height=500&amp;' + extra;
        
	if (tipo == 'ligamospravoce')
    {
		if(navigator.appName=='Microsoft Internet Explorer')
        {
			url += '&amp;width=525&amp;height=490';
        }
        else
        {
			url += '&amp;width=525&amp;height=490';
		}
    }
    
	if (tipo == 'informacoesporemail')
    {
        if(navigator.appName=='Microsoft Internet Explorer')
        {
            url += '&amp;width=519&amp;height=525';
        }
		
        else
        {
				if(is_chrome == true)
			{
				
			  url += '&amp;width=514&amp;height=515';
			}else{
				url += '&amp;width=514&amp;height=498';
				}
		}
    }
	
    if (tipo == 'atendimento-online')
    {
        if(navigator.appName=='Microsoft Internet Explorer')
        {
            url += '&amp;width=525&amp;height=580';
        }
        else
        {
            url += '&amp;width=525&amp;height=540';
        }
    }
    
	if (tipo == 'simuleofinanciamento')
    {
		url += '&amp;width=525&amp;height=520';
    }
    
	if (tipo == 'agendevisita')
    {
        if(navigator.appName=='Microsoft Internet Explorer'){
            url += '&amp;width=525&amp;height=500';}
        else
        {	
            url += '&amp;width=525&amp;height=495';
        }
    }
    
	if (tipo == 'enviarproposta')
    {
        if(navigator.appName=='Microsoft Internet Explorer')
        {
            url += '&amp;width=525&amp;height=500';
        }
        else
        {
            url += '&amp;width=525&amp;height=500';
		}
    }
    
	if (tipo == 'mapadelocalizacao')
		url += '&amp;width=705&amp;height=500';

	url += '&amp;modal=true&amp;TB_iframe=true';

	tb_show(null,url);
}

function popup(pagina,w,h,s)
{
	if (self.screen)
	{
		sw = screen.width;
		sh = screen.height;
		cx = (.5*sw) - (w*.5);
		cy = (.5*sh) - (h*.5);
		var  dimentions_and_such = 'width='+w+','+'height='+h+',' + 'screenX=' +cx+','+'screenY='+cy+','+'left='+cx+','+'top='+cy+',scrollbars='+s;
	}
	Pop=window.open(pagina,"popagre",dimentions_and_such);
}

function openMapa()
{
	tb_show(false,"imagem.html?width=670&amp;height=500&amp;modal=false",null);
}

/* Ajax pra excluir os últimos visitados */
function removeAjax( id, idRegiao )
{
    idEmpreendimentoRemove      =   id;
    
    jQuery.ajax
    (
        {
            url:    '_services/AJAX-remove.php',
            cache:  false,
            type:   'POST',
            data:
            {
                idEmpreendimentoRemove:  idEmpreendimentoRemove
            },
            dataType: 'html',
            error: function()
            {
                alert('Ocorreu um erro ao tentar excluir o item visitado. Tente novamente.');
            },
            success:
            function(data)
            {
                $(".list-last-visited").find('ul').html("");
                insereVisitados(idRegiao);   
            }
        }
    )            
}

function mapanchor(link,teste){
	
	location.href = link;
	
	if(teste == 'true')
	{
		
		$("#informacoes-gerais > li > a").each(function(){
			if( $(this).attr('href') == "#financie" )
			{
				$(this).trigger("click");
			}
		});
		
	}
	
}

function insereVisitados(idRegiao)
{
    // Cria uma variável para passar por post para evitar problemas com o plugin jquery.ajax
    var hack        = 0;
    var qtdade      = 0;
    var imprime     = '';
    var lancamento  = '';
	
    jQuery.ajax
    (
        {
            url:    '_services/AJAX-insere-visitados.php',
            cache:  false,
            type:   'POST',
            data:
            {
                'idRegiao': idRegiao
            },
            dataType: 'html',
            error: function()
            {
                alert('Ocorreu um erro ao tentar excluir o item visitado. Tente novamente.');
            },
            success:
            function(data)
			{
				$(".list-last-visited").find('ul').append(data);
				
				// Se for breve lançamento, troca o texto
				lancamento = $(".list-last-visited").find('ul').find('li').attr('rel');
				if(lancamento == 'breve-lancamento')
				{
						$(".right-side-bar").find('.insereCufont').html("Grandes <strong>Oportunidades</strong>");						
				}
				Cufon.replace(".cufont", {hover: true, hoverables: {strong:true, em:true}});
           }
        }
    )
}

function iniciaTV( tipo )
{
	jQuery(function() {
		Display.load(tipo)
	});
}

jQuery('document').ready(function()
{

    /* Ajax para envio de tweets */
    $("#enviar-tweet-emp").bind("click",function(){
       
        var loginTwitter        = "";
        var passTwitter         = "";
        var idEmpTwitter        = 0;
       
        loginTwitter =  $("#input-nome-twitter").val();
        passTwitter  =  $("#input-senha-twitter").val();
        idEmpTwitter =  $("#idEmpreendimentoForm").val();
       
        jQuery.ajax
        (
            {
                url:    '_services/envio_twitter.php',
                cache:  false,
                type:   'POST',
                data:
                {
                    login:  loginTwitter,
                    senha:  passTwitter,
                    id:     idEmpTwitter
                },
                dataType: 'json',
                error: function()
                {
                    alert('Não foi possível completar essa ação. Verifique a sua conexão.');
                },
                success:
                function(data)
                {		
                    if( data.ok == "true" )
                    {
                      alert('Sua mensagem foi enviada com sucesso.')
                    }
                    else
                    {
                      alert('Ocorreu um erro. Tente novamente.')
                    }
                }
            }
        )
       
    });

    /* Ajax para envio de emails */
    $("#enviar-email-emp").bind("click",function(){
        var nomeEnvioEmail      = "";
        var emailEnvioEmail     = "";
        var idEmpEmail          = 0;
        
        nomeEnvioEmail  = $("#input-nome-email").val();
        emailEnvioEmail = $("#input-email-email").val();
        idEmpEmail      =  $("#idEmpreendimentoForm").val();
        
        jQuery.ajax
        (
            {
                url:    '_services/envio_email.php',
                cache:  false,
                type:   'POST',
                data:
                {
                    nome:   nomeEnvioEmail,
                    email:  emailEnvioEmail,
                    id:     idEmpEmail
                },
                dataType: 'json',
                error: function()
                {
                    alert('Não foi possível completar essa ação. Verifique a sua conexão.');
                },
                success:
                function(data)
                {		
                    if( data.ok == "true" )
                    {
                      alert('Dados enviados para o e-mail')
                    }
                    else
                    {
                      alert('Ocorreu um erro. Tente novamente.')
                    }
                }
            }
        )
        
    })
	
    //OVER DOS BOTÕES DE CARROSSEL DA HOME
    jQuery('.carrousel-superior > ul > li > a').each(function(i){
            jQuery(this).click(function(){
                    jQuery('.carrousel-superior > ul > li > a').each(function(i){
                            jQuery(this).removeClass('ativo');
                    });	
                    
                    jQuery(this).addClass('ativo');
            });
    });
		
    //OVER DOS BOTÕES DE CARROSSEL DA INTERNA
    jQuery('#abas-dados-inner > ul > li > a').each(function(i){
            jQuery(this).click(function(){
                    jQuery('#abas-dados-inner > ul > li > a').each(function(i){
                            jQuery(this).removeClass('aba-ativa');
                    });	
                    
                    jQuery(this).addClass('aba-ativa');
            });
    });
		
    //OVER DOS BOTÕES DE CARROSSEL DA INTERNA
    jQuery('#abas-informacoes-gerais > ul > li > a').each(function(i){
            jQuery(this).click(function(){
                    jQuery('#abas-informacoes-gerais > ul > li > a').each(function(i){
                            jQuery(this).removeClass('aba-ativa');
                    });	
                    
                    jQuery(this).addClass('aba-ativa');
            });
    });	
		
	Cufon.replace(".cufont", {fontFamily: "DIN"});
	Cufon.replace(".cufont", {hover: true, hoverables: {strong:true, em:true}});
//	if(Cufon){console.info("cufon work");}

	/*CSS*/
	jQuery('table.table-imoveis tbody tr.item:last').addClass("noborder");
	jQuery('ul.order-by li:last').addClass('noborder');
	jQuery('ul.links li:last').addClass('noborder');
	jQuery('div.middle-filter ul:last').addClass('noborder');
	jQuery('ul.abas-color li:last').css('margin-right','0');
	
	//BARRA LATERAL DA HOME ADICIONANDO A CLASSE APENAS PARA O PRIMEIRO ELEMENTO DA LIST DE IMOVEIS
	jQuery('div.list-last-visited ul li').eq(0).addClass('first-of-all');
	
	/*ABAS*/
	jQuery.tabula('#abas-dados-inner', '.container-carrossel-superior-interno', '#dados-inner', null, 4, 214,4);
	jQuery.tabula('#abas-informacoes-gerais', '.wrapc', '#informacoes-gerais',null, 1,null,1);
	jQuery.tabula('.carrousel-superior', '.container-carrossel-superior-home', '.abas-color',null,3,null,3);
	
	/*mostra a localizacao
	jQuery('a#show-local').click(function(){
		jQuery('.wrapc').hide();
		var anchor = jQuery(this).attr('href');
		anchor = anchor.split(".");
		alert(anchor[4]);
		jQuery(anchor[4]).show();
	});*/
	
	/*mostra mapa do site*/
	jQuery('.map-content').hide();
	jQuery('#show-site-map').click(function()
	{
		if( $(".map-content").is(":visible") )
		{
			$(".sitemap").css("background-image","url(_images/bg-bt-sitemap.gif)");
		}
		else
		{
			$(".sitemap").css("background-image","url(_images/bg-bt-sitemap-ativo.gif)");
		}
		$('.map-content').slideToggle('600');
	});
	
	
	/*apaga bt*/
	jQuery('ul.bank-flags').hide();
	jQuery('#bt-desapair').click(function(){
		jQuery(this).fadeOut('fast');
		jQuery('ul.bank-flags').fadeIn('fast');
	});

	/*jQuery('table.progress-phase div.fill-progress').each(function(i){
		jQuery('.value-progress').eq(i).text(jQuery(this).css('width') );
	});*/

	/*ABAS SOCIAL MEDIA*/
	//jQuery('.abas-social-media').children().hide();
	jQuery('a.bt-voltar-social').click(function(){
		jQuery('a.bt-voltar-social').css('visibility',"hidden");
		jQuery('.abas-social-media').children().fadeOut('normal');
		jQuery('.textos-abas').text('');
	});
	
	/*jQuery('#envie-celular').click(function(){
	
		jQuery('.abas-social-media').css("visibility","visible");
		jQuery("#celular").fadeIn('normal');
		jQuery('.bt-voltar-social').css("visibility","visible");
	});*/
	
	
	jQuery('.social-media-list li a').each(function(){
        if(jQuery(this).attr('class') != 'rss'){
            jQuery(this).click(function(){
                //jQuery('.abas-social-media').css("visibility","visible");
                jQuery(jQuery('.abas-social-media').children()).fadeOut('slow');
                jQuery(jQuery(this).attr('href')).fadeIn('normal');
                
                if(jQuery(this).attr('href') != "#RSS")			
                    jQuery('.bt-voltar-social').css("visibility","visible");
                    
                return false;
            });
        }
	});
	
	var textoativo = '';
	var separa = '';
    
    $('.social-media-list li a').each
    (
        function()
        {
            if($(this).attr("class") == 'email')
            {
               this.ativo = true;
              $(this).css("border","1px solid #c7c6c6");
			    $(this).css("background-color","white");
	    $(this).css("border-bottom","2px solid white");
             //  jQuery('.textos-abas').text("Email");
       //  textoativo = "Email";
            }
        }
            
    )
    
	$('.social-media-list li a').bind
    (
        'click',
        function()
        {
            jQuery('.social-media-list li a').each(function()
            {
                $(this).css("border","0");
				$(this).css("background-color","transparent");
                this.ativo = false;
            });
            this.ativo = true;
            $(this).css("border","1px solid #c7c6c6");
				 $(this).css("border-bottom","2px solid white");
				 $(this).css("background-color","white");
            separa = $(this).attr('href').split("#");
            textoativo = separa[1];
        }
    );
	
	$('.social-media-list li a').bind('mouseover',function(){
	
	});
	
	$('.social-media-list li a').bind
    (
        'mouseleave',function()
        {
            if( this.ativo == true )
                $(this).css("background-position","center center");
            else
            {
              
                jQuery('.textos-abas').text(textoativo);
            }
        }
    );
	
	jQuery('.social-media-list li a').each(function(){
		//var legendaMedia = jQuery(this).text();
		jQuery(this).mouseover(function(){	
			jQuery('.textos-abas').text(legendaMedia);
		});
		jQuery(this).mouseleave(function(){
			//jQuery('.textos-abas').text();
		});
	});


	jQuery('table.table-imoveis tbody tr.item').each(function(){
		jQuery(this).find('td').addClass('rule-bottom');
	});
	jQuery('table.table-imoveis tbody tr.item:last').each(function(){
		jQuery(this).find('td').removeClass('rule-bottom');
	})
	Carroussel._init('#carrousel-inferior',4,null,4);
	Carroussel._init('#galeria-patri',4);
	/*TABELA DE FICHA TÉCNICA*/
	jQuery(jQuery('table.ficha-tecnica tbody tr:nth-child(odd)')).each(function(){
		jQuery(this).find('td').addClass('oddLine');
	});
	jQuery('table.ficha-tecnica tbody tr td:nth-child(odd)').addClass('title-ficha-tecnica');

	/*FAZ O LINK DO MENU FICAR ATIVO QUANDO A PÁGINA FOR CARREGADA*/
	paginaAtual = window.location+"";
	paginaAtual = paginaAtual.split("/").pop();
	if(paginaAtual != ""){
		jQuery('li.teste a[href="'+paginaAtual+'"]').addClass('ativo');
		jQuery('li.teste a[href="'+paginaAtual+'"]').siblings('ul').removeClass('recolheSubItem');
		jQuery('li.teste a[href="'+paginaAtual+'"]').parents('ul').removeClass('recolheSubItem').siblings('a').addClass('ativo');
	}   
});

/* lightbox gallery */
var LightGallery =
{
	pick	    : null,
	index	    : 0,
    intervalo   : null,
	
	init	: function()		
	{		
		jQuery('#light-navLeft').bind (
			'click',
			function() {
				LightGallery.prev();
			}
		)
		jQuery('#light-navRight').bind (
			'click',
			function() {
				LightGallery.next();
			}
		)
		LightGallery.index = 0;
	},
	setItem	: function(intIndex) {
		
		jQuery('#image-loader').animate({
			"opacity"	: "1"
		}, 100);
		
		/*jQuery('#pic').css('opacity','0');
		jQuery('#pic').css('filter','alpha(opacity=0)');
		*/
			
		jQuery('#pic').fadeOut();
		jQuery('#pic').hide();
			
		LightGallery.pick			= null;
		LightGallery.pick			= new Image();
		LightGallery.pick.src		= arImages[intIndex];
		LightGallery.pick.onload	= LightGallery.loadComplete;
		LightGallery.pick.onerror	= LightGallery.onError;
		
		LightGallery.index			= intIndex;
				
		if(intIndex == 0) {
			jQuery('#light-navLeft').hide();
		}
		if( intIndex == (arImages.length-1) ) {
			jQuery('#light-navRight').hide();
		}
		
		jQuery('#image-loader').animate({
			"opacity"	: "0"
		}, 500);
	},
	
	loadComplete : function(a) {
		
		jQuery('#pic').attr('src', LightGallery.pick['src']);		
		jQuery('#pic').fadeIn();
		
        var arTipos = new Array();
        arTipos[1] = "Projeto";
        arTipos[2] = "Plantas";
        arTipos[3] = "Bairro";
        arTipos[4] = "Obras";
        arTipos[5] = "Lazer";
        
		jQuery('.lbl').html(arSubTitles[LightGallery.index]);
		jQuery('.lbl-contador').html('Imagem '+(LightGallery.index+1)+' de '+arSubTitles.length);
        jQuery('.legenda-area > p').html(  arTipos[arSubTitlesarea[LightGallery.index]] );
		
	},

	onError	: function(error)
	{
		tb_remove();
	},
	
	prev	: function()
	{
		if(LightGallery.index > 0) {
			LightGallery.setItem(LightGallery.index - 1);
			jQuery('#light-navRight').show();
		}
	},
	next	: function() {
		if(LightGallery.index < (arImages.length - 1)) {
			LightGallery.setItem(parseInt(LightGallery.index) + 1);
		}
		jQuery('#light-navLeft').show();
	},
    nextSlideShow	: function() {
        if(LightGallery.index < arImages.length - 1)
        {
            LightGallery.next();
        }
        else
        {
            LightGallery.setItem(0);  
        }
	},
	slideShow : function() {
        slideIniciado = true;
        intervalo = setInterval
        (
           'LightGallery.nextSlideShow()',
            2000
        );
	},
    stopSlideShow : function()
    {
        clearInterval(intervalo);
    }
}

var VideoGallery =
{
	pick	    : null,
	index	    : 0,
    intervalo   : null,
	init	: function( indexInicial )		
	{
		jQuery('#light-navLeft').bind(
			'click',
			function()
			{
				VideoGallery.prev();
			}
		)
		jQuery('#light-navRight').bind(
			'click',
			function()
			{
				VideoGallery.next();
			}
		)
		VideoGallery.index = indexInicial;
		
		if(VideoGallery.index == 0)
		{
			jQuery('#light-navLeft').hide();
		}
		
		if( VideoGallery.index == (arVideos.length-1) )
		{
			jQuery('#light-navRight').hide();
		}
		
	},
	setItem	: function(intIndex)
	{
		VideoGallery.index = intIndex;
		
		$("#legenda_imagem").html( arVideosLeg[ VideoGallery.index ] );	
		$(".troca-video").fadeOut();
		$(".troca-video").html('');
		
		var embedaSwf = '';
		embedaSwf += '<object width="560" height="405">';
		embedaSwf += 	'<param id="youtube" name="movie" value="http://www.youtube.com/v/' + arVideos[VideoGallery.index] + '?fs=1&amp;hl=pt_BR"></param>';
		embedaSwf += 	'<param name="allowFullScreen" value="true"></param>';
		embedaSwf += 	'<param name="allowscriptaccess" value="always"></param>';
		embedaSwf += 	'<param name="wmode" value="transparent"></param>';
		embedaSwf += 	'<embed id="youtubeIE" src="http://www.youtube.com/v/' + arVideos[VideoGallery.index] + '?fs=1&amp;hl=pt_BR" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="560" wmode="transparent" height="405"></embed>';
		embedaSwf += '</object>';
		
		$(".troca-video").fadeIn();
		$(".troca-video").html(embedaSwf);
		
		if(VideoGallery.index == 0)
		{
			jQuery('#light-navLeft').hide();
		}
		
		if( VideoGallery.index == (arVideos.length-1) )
		{
			jQuery('#light-navRight').hide();
		}
		
		
	},
	loadComplete	: function()
	{
		jQuery('#image-loader').animate({
			"opacity"	: "0"
		}, 100);
				
		jQuery('#pic').attr('src', VideoGallery.pick['src']);
		jQuery('#pic').animate({
			"opacity"	: "1"
		}, 500);
		
        var arTipos = new Array();
        arTipos[1] = "Projeto";
        arTipos[2] = "Plantas";
        arTipos[3] = "Bairro";
        arTipos[4] = "Obras";
        arTipos[5] = "Lazer";
        
		jQuery('.lbl').html(arSubTitles[VideoGallery.index]);
		jQuery('.lbl-contador').html((VideoGallery.index+1)+' de '+arSubTitles.length);
        jQuery('.legenda-area > p').html(  arTipos[arSubTitlesarea[VideoGallery.index]] );
	},
	onError	: function(error)
	{
		tb_remove();
	},
	prev	: function()
	{
		if(VideoGallery.index > 0)
		{
			VideoGallery.setItem(VideoGallery.index - 1);
			jQuery('#light-navRight').show();
		}
	},
	next	: function()
	{
		if(VideoGallery.index < (arVideos.length - 1))
		{
			VideoGallery.setItem(parseInt(VideoGallery.index) + 1);
		}
		jQuery('#light-navLeft').show();
	}
}
