// URL BASE

// TARGET VÁLIDO

function externalLinks() {
 if (!document.getElementsByTagName) return;
 var anchors = document.getElementsByTagName("a");
 for (var i=0; i<anchors.length; i++) {
   var anchor = anchors[i];
   if (anchor.getAttribute("href") &&
       anchor.getAttribute("rel") == "externo")
     anchor.target = "_blank";
 }
}
window.onload = externalLinks;



function init_Price(){
	var opened=0;
	var counter=0;
	$('.produto').each(function(element){
		counter++;
		$(this).find('.detalhe_preco').hide();
		$(this).find('h2').attr('rel','fechado'+counter);		
		
	})
	$('.produto h2').click(function(e){	
		$(this).parent().find('.detalhe_preco').slideToggle();	
	

	})
}

function init_Titulos(){

	$('.titulo').each(function(e){
		var texto=$(this).text();
		$(this).media({ 
			width: '100%',
			height: '20',
			autoplay: true,
			src: URL_BASE+"swf/titulo.swf",
			flashvars: {
				url_titulo:texto 
			},
			params: {
				wmode: 'transparent',
				menu: false,
				quality: 'high',				
				allowScriptAccess: 'sameDomain'
				
			},
			caption: false
		});
  });
	
	/*$('.titulo-red2').each(function(e){
		var texto=$(this).text();
		$(this).media({ 
			width: '100%',
			height: '20',
			autoplay: true,
			src: URL_BASE+"swf/titulo2.swf",
			flashvars: {
				url_titulo:texto 
			},
			params: {
				wmode: 'transparent',
				menu: false,
				quality: 'high',				
				allowScriptAccess: 'sameDomain'
			},
			caption: false
		});
  });
	
	
	
	$('.titulo-red').each(function(e){
		var texto=$(this).text();
		$(this).media({ 
			width: '100%',
			height: '20',
			autoplay: true,
			src: URL_BASE+"swf/titulo.swf",
			flashvars: {
				url_titulo:texto 
			},
			params: {
				wmode: 'transparent',
				menu: false,
				quality: 'high',				
				allowScriptAccess: 'sameDomain'
			},
			caption: false
		});
  });*/
		
		
	

$('h1.titu-sec').each(function(e){
		var texto=$(this).text();		
		$(this).media({ 
			
			width: '100%',
			height: '33',
			autoplay: true,
			src: URL_BASE+ "swf/titulo_sessao.swf",
			flashvars: {
				url_titulo:texto 
			},
			params: {
				wmode: 'transparent',
				menu: false,
				quality: 'high',				
				allowScriptAccess: 'sameDomain'
			},
			caption: false
		});
  });
	
	
}
	
$(document).ready(function(){
		init_Titulos();
	})
