// JavaScript Document
var conteudoGMapas = "";
conteudoGMapas += '<div id="modulo_gmaps">';
conteudoGMapas += '<a class="close" href="javascript: fechaBox();"><img src="modulos/google_maps/img/btn_janela_close.png" style="width:auto; height:auto" /></a>';

conteudoGMapas += '<iframe name="detGoogleMaps" id="detGoogleMaps" frameborder="0" marginheight="0" marginwidth="0" scrolling="no" src="modulos/google_maps/detGoogleMaps.php" width="480" height="410" style="overflow-x: hidden; margin-bottom:10px;"></iframe>';
conteudoGMapas += '</iframe>';

conteudoGMapas += '<strong class="name">Acácia Consultoria</strong> - ';
conteudoGMapas += '<span class="street">Av. Rio Branco, 1132 - térreo - Ed. Rio Negro Center</span><br />';
conteudoGMapas += '<span class="city_state">CEP 17502-000 - Marília/SP</span><br />';
conteudoGMapas += '<span class="phone">Fone: +55 (14)2105-3333<br />E-mail: acacia@acaciaconsultoria.com.br</span>';

conteudoGMapas += '</div>';

ModuloIndique = function(args)  {
	args	= escape(args);
	novoBox('modulos/indique/cadIndique.php?pagina=' + args, '', 400, 346);
}

function applySelectedTo(link, abrir) {
	var ul = document.getElementById("sanfona"); // get the first ul tag on the page
	var allLinks = ul.getElementsByTagName("h3"); // get all the links within that ul
	
	for (var i=0; i<allLinks.length; i++) { // iterate through all those links
		allLinks[i].className = ""; // and assign their class names to nothing
		document.getElementById(allLinks[i].lang).style.display='none';
	}
	link.className = "ativo";  // finally, assign class="selected" to our chosen link
	document.getElementById(abrir).style.display='';
}

function bookmarksite(title,url){
	if (window.sidebar) // firefox
		window.sidebar.addPanel(title, url, "");
	else if(window.opera && window.print){ // opera
		var elem = document.createElement('a');
		elem.setAttribute('href',url);
		elem.setAttribute('title',title);
		elem.setAttribute('rel','sidebar');
		elem.click();
	}else if(document.all)// ie
		window.external.AddFavorite(url, title);
}

// Para usar coloque o comando: "javascript:mudaTamanho('tag_ou_id_alvo', -1);" para diminuir
// e o comando "javascript:mudaTamanho('tag_ou_id_alvo', +1);" para aumentar
 
// Especificando os possíveis tamanhos de fontes, poderia ser: x-small, small...
var tamanhos = new Array('100%','120%','130%','140%','150%');
var tamanhoInicial = 0;
 
function mudaTamanho( idAlvo,acao ){
  if (!document.getElementById) return
  var selecionados = null,tamanho = tamanhoInicial,i,j,tagsAlvo;
  tamanho += acao;
  if ( tamanho < 0 ) tamanho = 0;
  if ( tamanho > 4 ) tamanho = 4;
  tamanhoInicial = tamanho;
  if ( !( selecionados = document.getElementById( idAlvo ) ) ) selecionados = document.getElementsByTagName( idAlvo )[ 0 ];
  
	dives	= document.getElementsByTagName('div');
	for (i=0;i<dives.length;i++)  {
		if (dives[i].id==idAlvo)  {
			dives[i].style.fontSize = tamanhos[ tamanho ];
		}
	}
}

function scrollTop()  {
	window.scroll(0,0); 
}

function voltaBack()  {
	history.back();
}

function montaForm(tipo,codsolucao,codcliente_segmento,codcliente_ramoatividade,codestado) {
	
	var industria = false;
	var div_resultado = '';
	
	if (tipo == 'solucao') {
		div_resultado = 'combo_filho_solucao';
		document.getElementById('codcliente_ramoatividade').disabled = true;
		document.getElementById('codcliente_ramoatividade').selectedIndex = 0;
	} else if (tipo == 'segmento') {
		div_resultado = 'combo_filho_ramoatividade';
		if (document.forms['buscaCliente'].codcliente_segmento[document.forms['buscaCliente'].codcliente_segmento.selectedIndex].text == 'Indústria') {
			document.getElementById('codcliente_ramoatividade').disabled = false;	
			div_resultado = 'combo_filho_segmento';
			industria = true;
		} else {
			document.getElementById('codcliente_ramoatividade').disabled = true;	
			document.getElementById('codcliente_ramoatividade').selectedIndex = 0;
		}
	} else if (tipo == 'ramoatividade') {
		div_resultado = 'combo_filho_ramoatividade';
	} else if (tipo == 'estado') {
		div_resultado = 'combo_filho_estado';
	}
	
 	gtr_makeRequest('modulos/cliente/manMontaForm.php?codsolucao=' + codsolucao + '&codcliente_segmento=' + codcliente_segmento + '&codcliente_ramoatividade=' + codcliente_ramoatividade + '&codestado=' + codestado + '&tipo=' + tipo + '&industria=' + industria, div_resultado);

}
