$(document).ready(function(){
	$.ImageBox.init({
		loaderSRC: URL_BASE + '/imagem/imagebox/loading.gif',
		closeHTML: '<img src="' + URL_BASE + '/imagem/imagebox/close.jpg" alt="Fechar"/>',
		textImage: 'Exibindo: ',
		textImageFrom: 'de'
	});
	
	$('a[@rel=external]').attr('target', '_blank');
	
	$('#cabecalho .media').media({ 
		width:     778, 
		height:    260, 
		autoplay:  true, 
		src:       URL_BASE + '/swf/topo.swf',
		flashvars: {
			'urlBase': URL_BASE + '/'
		},
		params:    {
			wmode: 'transparent'
		},
		caption: false
	});
	$('#cabecalho .media').css({
		'text-indent': '0'
	});
	
	$('#banner').media({ 
		width:     468, 
		height:    60, 
		autoplay:  true, 
		src:       URL_BASE + '/_arquivo/banner/fullbanner.swf',
		params:    {
			wmode: 'transparent'
		},
		caption: false
	});
	
	$('a[@rel=foto-popup]').click(function(){
		window.open(URL_BASE + '/popupImagem/?imagem=' + encodeURIComponent($(this).attr('href')) + '&titulo=' + encodeURIComponent($(this).attr('title')), '', 'width=550,height=400');
		return false;
	});
	
	if($('#conteudo.home').size() > 0){
		$('#conteudo.home #videos .video').media({ 
			width:     355, 
			height:    235, 
			autoplay:  true, 
			src:       URL_BASE + '/swf/video_player_sample.swf',
			flashvars: {
				'urlBase': URL_BASE + '/'
			},
			params:    {
				wmode: 'transparent'
			},
			caption: false
		});
	}
	$('#chamada .video2').media({ 
		width:     205, 
		height:    120, 
		autoplay:  true, 
		src:       URL_BASE + '/swf/marcas_home.swf',
		params:    {
			wmode: 'transparent'
		},
		caption: false
	});
});