
// JavaScript Document
function barra_de_idiomas () {
	// Inclusão da Barra de Idiomas
	var topo;
	topo = document.getElementById('topo').innerHTML;
	document.getElementById('topo').innerHTML = "\
		<div id=\"barra_de_idiomas\" >\
			<ul>\
			    <li style=\"padding-right:54px;padding-left:17px;\"><a href=\"mapa-do-site.asp\">Carte du Site</a></li>\
			         	<li style=\"padding-right:8px;\"><a href=\"../index.asp\"><img src=\"../img/brasil.gif\" border=0 alt=\"Portugu&ecirc;s\"  /></a></li>\
		            	<li style=\"padding-right:8px;\"><a href=\"../index_en.asp\"><img src=\"../img/eua.gif\" border=0 alt=\"English\"  /></a></li>\
		            	<li style=\"padding-right:8px;\"><a href=\"../index_sp.asp\"><img src=\"../img/espana.gif\" border=0 alt=\"Espa&ntilde;ol\" /></a></li>\
		        </li>\
			</ul>\
				</div>" + topo;		
}

function conserta_destaques() {
	var i, j = 0, d = new Array(), destaques;
	for (i=0;i<document.getElementsByTagName("div").length;i++) {
		destaques = document.getElementsByTagName("div")[i];
		if (destaques.className.indexOf("destaque_corpo") != -1){
			d[j] = destaques;
			j++;
		}
	}
	for (i=0;i<d.length;i++) {
		d[i].style.clear = 'none';
		if (i%2 == 0) {
			d[i].style.clear = 'left';
		}
	}
}

function troca_topo() {
	barra_de_idiomas();
	conserta_destaques();
	//Configuração da Figura de fundo
	if (document.getElementById('path').innerHTML.indexOf("Carte") != -1) {
		document.getElementById('geral').style.backgroundImage = 'url(../img/topo_a_silimed.gif)';
	}
	var conteudo = document.getElementById('menu_esquerda').getElementsByTagName("ul")[0].getElementsByTagName("li")[0].innerHTML;
	if (conteudo.indexOf("Silimed") != -1) {
		document.getElementById('geral').style.backgroundImage = 'url(../img/topo_industria_proteses.gif)';
	} else if (conteudo.indexOf("Qualit") != -1) {
		document.getElementById('geral').style.backgroundImage = 'url(../img/topo_industria_mao_silicone.gif)';
	} else if (conteudo.indexOf("Bien-") != -1) {
		document.getElementById('geral').style.backgroundImage = 'url(../img/topo_saude_e_bem_estar.gif)';
	} else if (conteudo.indexOf("Perguntas") != -1) {
		document.getElementById('geral').style.backgroundImage = 'url(../img/topo_faq.gif)';
	} else if (conteudo.indexOf("minine") != -1) {
		document.getElementById('geral').style.backgroundImage = 'url(../img/topo_mulher.gif)';
	} else if (conteudo.indexOf("Masculine") != -1) {
		document.getElementById('geral').style.backgroundImage = 'url(../img/topo_homem.gif)';
	} else if (conteudo.indexOf("Infantile") != -1) {
		document.getElementById('geral').style.backgroundImage = 'url(../img/topo_crianca.gif)';
	} else if (conteudo.indexOf("cheter") != -1) {
		document.getElementById('geral').style.backgroundImage = 'url(../img/topo_a_silimed.gif)';
	} else if (conteudo.indexOf("Medgel") != -1) {
		document.getElementById('geral').style.backgroundImage = 'url(../img/topo_medgel_matridex.gif)';
	} else {
		document.getElementById('geral').style.backgroundImage = 'url(../img/topo_faq.gif)';
	}
}


function seleciona_pergunta() {
	var url = new Array();
	url = document.URL.split('#');
	for (i=0; i<document.getElementsByTagName("h3").length; i++) {
			document.getElementsByTagName("h3")[i].style.display = 'none';
	}
	mostra_resposta(url[1]);
}

function mostra_resposta(id) {
	var i;
	var qtdh2 = document.getElementsByTagName("h2").length;
	var qtdh3 = document.getElementsByTagName("h3").length;
	if (document.getElementById(id).getElementsByTagName("h3")[0].style.display == 'none') {
		for (i=0; i<document.getElementsByTagName("h2").length; i++) {
			if (document.getElementsByTagName("h2")[i].parentNode.id != 'corpo') {
				document.getElementsByTagName("h2")[i].style.color = '#656672';
			} 
		}
		for (i=0; i<document.getElementsByTagName("h3").length; i++) {
				document.getElementsByTagName("h3")[i].style.display = 'none';
		}
		document.getElementById(id).getElementsByTagName("h3")[0].style.display = 'block';
		document.getElementById(id).getElementsByTagName("h2")[0].style.color = '#ff610d';
	} else {
		document.getElementById(id).getElementsByTagName("h3")[0].style.display = 'none';
		document.getElementById(id).getElementsByTagName("h2")[0].style.color = '#656672';
	}
}

//Pop-up
function pop(newLoc, width, height) {
	var param;
	if (width <= 750) {
		param = "height = "+height+"px, width="+width+"px,	scrollbars=no, location = no, status = no, resizable = yes"; 
	} else {
		param = "height = "+height+"px, width="+width+"px, scrollbars=yes, location = no, status = no, resizable = yes"; }
	window.open(newLoc, 'Titulo', param);
}

//Execução do Flash
AC_FL_RunContent( 'codebase','http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0','width','349','height','300','title','Onde Comprar','src','swf/mapa_mundi_por','quality','high','pluginspage','http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash','movie','swf/mapa_mundi_por' ); //end AC code