// JavaScript Document
criador = "Eduardo Bastian";

urlSite = "http://www.ctsinformatica.com.br/";

//armazena sempre qual objeto foi clicado
eventoClique = null;

var ie = /msie/i.test(navigator.userAgent);
var versao = navigator.appVersion;
var versaoIE = null;

if(ie) {	
	versaoIE = versao.substring(versao.indexOf("MSIE")+5, versao.length);	
	versaoIE = versaoIE.split(";");
	versaoIE = Math.floor(Number(versaoIE[0]));
	if(versaoIE<6) {
		alert("Você possui uma versão muito antiga do navegador, o que não permite visualizar as caracteristicas de nosso site.! Faça o download do Internet Explorer 6 ou superior, ou do Mozila Firefox 2 ou superior para utilizar site!");
	}
}

var ieBox = ie && (document.compatMode == null || document.compatMode == "BackCompat");
var canvasEl = ieBox ? document.body : document.documentElement;

//resolucao do pc
var wRes = screen.width; 
var hRes = screen.height;

//área da pagina no browser
var wTela = canvasEl.clientWidth || window.innerWidth;
var hTela = canvasEl.clientHeight || window.innerHeight;

//controle do menu
var itemMenuId = null;

var totalItensMenu = 13;

//controla as abas
var posicaoNormalAbas = true;
var abaId = 0;

//controle dos checkBox
var totalChecks = 15;
var arrChecked = new Array();

//controla quais interesses foram selecionados
/*
0 - nenhum
1 - fono
2 - fisio
3 - fono e fisio
*/
interesseId = 0;

var laudoErgoImagens = Array();
laudoErgoImagens[0] = 1;
laudoErgoImagens[1] = "images/screenshots/laudoErgo1.jpg";

var escutaAtivaImagens = Array();
escutaAtivaImagens[0] = 1;
escutaAtivaImagens[1] = "images/screenshots/escutaAtiva1.jpg";
escutaAtivaImagens[2] = "images/screenshots/escutaAtiva2.jpg";
escutaAtivaImagens[3] = "images/screenshots/escutaAtiva3.jpg";

var pedroAcampImagens = Array();
pedroAcampImagens[0] = 1;
pedroAcampImagens[1] = "images/screenshots/pedroAcamp1.jpg";
pedroAcampImagens[2] = "images/screenshots/pedroAcamp2.jpg";
pedroAcampImagens[3] = "images/screenshots/pedroAcamp3.jpg";

/*
produtos e categorias de fonoaudiologia
12 -> 4 - PedroParque
11 -> 4 - EarMix
10 -> 0 - FonoSpeak
9  -> 4 - Pedro
8  -> 4 - AudiReport
7  -> 1 - VoxGames
6  -> 0 - Avalie
5  -> 1 - VoxMetria
4  -> 3 - FonoFlex
3  -> 2 - FonoTools
2  -> 1 - FonoView
1  -> 1 - VoiceReport
0  -> 0 - DesafioFonemas


0 - fala e linguagem
1 - voz
2 - distúrbios da comunicação
3 - leitura e escrita
4 - audio e pa
5 - motricidade
*/

//configuracao dos produtos nas respectivas abas //cada número indica o cod da linha no arquivo: fonoaudiologia.html
fonoCategorias = new Array();
fonoCategorias[0] = new Array("0", "6", "10");
fonoCategorias[1] = new Array("1", "2", "5", "7", "14", "15");
fonoCategorias[2] = new Array("3");
fonoCategorias[3] = new Array("4");
fonoCategorias[4] = new Array("8", "9", "11", "12", "16", "17");
fonoCategorias[5] = new Array("13");

totalProdFono = 0;
for(i=0;i<fonoCategorias.length;i++) {
	totalProdFono += fonoCategorias[i].length;
	/*
	for(i2=0;i2<fonoCategorias[i].length;i2++) {
		if(Number(fonoCategorias[i][i2])>totalProdFono) {
			totalProdFono = Number(fonoCategorias[i][i2]);
		}
	}
	*/
}

var totalLinhasAtual = 19;
//arrAtualizacoes[codProduto] = (linhas com atualizacao do prduto)
arrAtualizacoes = new Array();
arrAtualizacoes[0] = new Array("4"); //audireport
arrAtualizacoes[1] = new Array("3"); //fonoView
arrAtualizacoes[2] = new Array("12"); //avalie
arrAtualizacoes[3] = new Array("2"); //pedroNaCasa
arrAtualizacoes[4] = new Array("1"); //desafioFonemas
arrAtualizacoes[5] = new Array("17"); //voiceReport
arrAtualizacoes[6] = new Array("5"); //fonoTools
arrAtualizacoes[7] = new Array("6"); //voxGames
arrAtualizacoes[8] = new Array("7", "15"); //fonoFlex
arrAtualizacoes[9] = new Array("9", "8"); //voxMetria
arrAtualizacoes[10] = new Array("14"); //fonospeak
arrAtualizacoes[11] = new Array("16"); //fisiMetrix
arrAtualizacoes[12] = new Array("18"); //earMix
arrAtualizacoes[13] = new Array("11"); //pedroParque
arrAtualizacoes[14] = new Array("19"); //motrisis
arrAtualizacoes[15] = new Array(); //vocalgrama
arrAtualizacoes[16] = new Array(); //andrea adpater
arrAtualizacoes[17] = new Array(); //memoTraining
arrAtualizacoes[18] = new Array(); //triAudi

totalAtualizacoes = 0;
for(i=0;i<arrAtualizacoes.length;i++) {
	if(arrAtualizacoes[i].length>0) {
		totalAtualizacoes += arrAtualizacoes[i].length;
	} else {
		arrAtualizacoes[i];
	}	
}

//BANCO DE COMPRA DE PRODUTOS
arrConfigProdutos = new Array();

//armazena o xml com as config dos produtos
baseCts = null;

xmlCont = null;

novoCodProduto = null;
novaAba = null;

function iniciaSite(codProd, nroAba) {
	var1 = encodeURI(codProd);
	var2 = encodeURI(nroAba);
	window.location = urlSite + "/redirecionar.php?var1=" + var1 + "&var2=" + var2;	
}

function carregarXML(url) {
	var xmlDoc = null;
	if (window.ActiveXObject) {
		xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
	} else if (document.implementation && document.implementation.createDocument) {
		xmlDoc=document.implementation.createDocument("","",null);
	}
	
	xmlDoc.async = false;
	try {
		xmlDoc.load(url);	
	} catch(e) {
		try {
			var xmlhttp = new window.XMLHttpRequest();
			xmlhttp.open("GET", url, false);
			xmlhttp.send(null);
			xmlDoc = xmlhttp.responseXML.documentElement;
		} catch(e) {
			alert("Erro ao carregar o site. Faça o download do Internet Explorer 7 ou superior, ou do Mozila Firefox 2 ou superior para utilizar site!"); 		
		}
	}	
	return xmlDoc;
}

function getNroRegistros(xmlDoc) {
	return xmlDoc.getElementsByTagName("PRODUTOID").length;
}

//carrega as config dos produtos em um array
function carregaXmlProduto(xmlDoc, produtoId) {
	arrProd = new Array();
	for(i=0;i<xmlDoc.getElementsByTagName("PRODUTOID").length;i++) {
		if(Number(xmlDoc.getElementsByTagName("PRODUTOID")[i].childNodes[0].nodeValue) == Number(produtoId)) {			
				arrProd.push(xmlDoc.getElementsByTagName("PRODUTOID")[i].childNodes[0].nodeValue);
				arrProd.push(xmlDoc.getElementsByTagName("NOME")[i].childNodes[0].nodeValue);
				arrProd.push(xmlDoc.getElementsByTagName("CATEGORIA")[i].childNodes[0].nodeValue);
				arrProd.push(xmlDoc.getElementsByTagName("IMAGEM")[i].childNodes[0].nodeValue);
				arrProd.push(xmlDoc.getElementsByTagName("VALOR1")[i].childNodes[0].nodeValue);
				arrProd.push(xmlDoc.getElementsByTagName("CUSTO")[i].childNodes[0].nodeValue);
				arrProd.push(xmlDoc.getElementsByTagName("TIPO")[i].childNodes[0].nodeValue);
				arrProd.push(xmlDoc.getElementsByTagName("VALOR4")[i].childNodes[0].nodeValue);
				arrProd.push(xmlDoc.getElementsByTagName("PROMOCAO")[i].childNodes[0].nodeValue);
				arrProd.push(xmlDoc.getElementsByTagName("DOWNLOAD")[i].childNodes[0].nodeValue);
				arrProd.push(xmlDoc.getElementsByTagName("DESCONTO")[i].childNodes[0].nodeValue);
				arrProd.push(xmlDoc.getElementsByTagName("JUROS")[i].childNodes[0].nodeValue);			
				arrProd.push(xmlDoc.getElementsByTagName("PARCELAS")[i].childNodes[0].nodeValue);			
			return arrProd;
		}  
	}
	return false;
}

function carregaXmlCampoProduto(xmlDoc, produtoId, nomeCampo) {	
	try {
		nomeCampo = nomeCampo.toUpperCase();
		for(i=0;i<xmlDoc.getElementsByTagName("PRODUTOID").length;i++) {
			if(Number(xmlDoc.getElementsByTagName("PRODUTOID")[i].childNodes[0].nodeValue) == Number(produtoId)) {
				return xmlDoc.getElementsByTagName(nomeCampo)[i].childNodes[0].nodeValue;
			}
		}
		return false;
	} catch(e) {
		return false;
	}
}

function recarregaPagProd(produtoId) {	
	try {
		if(document.getElementById("campoValor1")!=null && (document.getElementById("campoValor1").innerHTML=="XXXXX" || document.getElementById("campoValor1").innerHTML=="" || document.getElementById("campoValor1").innerHTML=="&nbsp;") && produtoId!=11 && produtoId!=13) {
			if(Number(arrConfigProdutos[produtoId][8])==0) {
				//reiniciaPagina();
				//alert("Click Ok.");
				//window.history.back();
				window.setTimeout(refreshh, 500);
			}
		}
	} catch(e) {
		
	}
}

function refreshh() {
	window.location.reload();
}

function tentativa() {
	window.history.forward();	
}


function getValorFrete(uf) {	
	return baseFrete.getElementsByTagName(uf.toUpperCase())[0].childNodes[0].nodeValue;
}

function mostraMensagem(msg, wQuad, hQuad) {	

	document.body.style.visibility = "hidden";

	mostraTelaEscura();
	
	document.getElementById("divGeral").style.width = wQuad + "px";
	document.getElementById("divGeral").style.height = hQuad + "px";
		
	document.getElementById("divGeral").className = "divQuadMensagem";	
	document.getElementById("divGeral").style.left = Math.floor(wTela/2 - wQuad/2) + "px";
	yTopo = ((document.documentElement && document.documentElement.scrollTop) ? document.documentElement.scrollTop : document.body.scrollTop);
	document.getElementById("divGeral").style.top = (yTopo+Math.floor(hTela/2)-(hQuad/2)) + "px";
	document.getElementById("divGeral").style.visibility = "visible";
	
	document.getElementById("divGeral").innerHTML = "<table width=\"100%\" height=\"" + hQuad + "\" border=\"0\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\" class=\"divMensagem\"><tr><td width=\"34\" height=\"" + hQuad + "\" align=\"right\"><img alt=\"\" src=\"images/carregando.gif\" width=\"18\" height=\"18\"></td><td width=\"10\" align=\"center\" class=\"fonte21\">&nbsp;</td><td width=\"" + (wQuad-34) + "\" align=\"left\" class=\"fonte21\" style=\"font-size:15px;\">" + msg + "</td></tr></table>";
	
}

function fechaMensagem() {
	document.getElementById("divGeral").className = "divGeral";
	fecharDiv();
	document.body.style.visibility = "visible";	
	document.getElementById("divGeral").style.width = 500 + "px";
	document.getElementById("divGeral").style.height = 400 + "px";
}

function carregarBanco() {	
	mostrarAviso("carregando...", "corpo");
	okOk = true;
	if(prods.length>0) {
		//clearInterval(timerBanco);
		try {
			for(i=0;i<prods.length;i++) {
				arrProd = new Array();
				arrProd.push(prods[i].getElementsByTagName("PRODUTOID")[0].childNodes[0].nodeValue);
				arrProd.push(prods[i].getElementsByTagName("NOME")[0].childNodes[0].nodeValue);
				arrProd.push(prods[i].getElementsByTagName("CATEGORIA")[0].childNodes[0].nodeValue);
				arrProd.push(prods[i].getElementsByTagName("IMAGEM")[0].childNodes[0].nodeValue);
				arrProd.push(prods[i].getElementsByTagName("VALOR1")[0].childNodes[0].nodeValue);
				arrProd.push(prods[i].getElementsByTagName("CUSTO")[0].childNodes[0].nodeValue);
				arrProd.push(prods[i].getElementsByTagName("TIPO")[0].childNodes[0].nodeValue);
				arrProd.push(prods[i].getElementsByTagName("VALOR4")[0].childNodes[0].nodeValue);
				arrProd.push(prods[i].getElementsByTagName("PROMOCAO")[0].childNodes[0].nodeValue);
				arrProd.push(prods[i].getElementsByTagName("DOWNLOAD")[0].childNodes[0].nodeValue);
				arrProd.push(prods[i].getElementsByTagName("DESCONTO")[0].childNodes[0].nodeValue);
				arrProd.push(prods[i].getElementsByTagName("JUROS")[0].childNodes[0].nodeValue);
				arrProd.push(prods[i].getElementsByTagName("PARCELAS")[0].childNodes[0].nodeValue);
				arrConfigProdutos.push(arrProd);
			}
		} catch(e) {
			alert("Erro ao carregar banco de dados! Seu navegador pode estar impedindo que os dados sejam carregados! Sugerimos que você abra o site em outro navegador!\n\n" + e);
			okOk = false;
		}
		
		if(okOk) {
			//se foi aberto o site por outra pagina senao a inicial carrega o banco e redireciona para a pagina que
			//havia sido aberta
			switch(Number(novoCodProduto)) {
				case 0: {
					novaUrl = "audiReport.html";					
					break;
				}
				case 1: {
					novaUrl = "fonoView.html";					
					break;
				}
				case 2: {
					novaUrl = "avalie.html";					
					break;
				}
				case 3: {
					novaUrl = "pedroNaCasa.html";					
					break;
				}
				case 4: {
					novaUrl = "desafioFonemas.html";					
					break;
				}
				case 5: {
					novaUrl = "voiceReport.html";					
					break;
				}
				case 6: {
					novaUrl = "fonoTools.html";					
					break;
				}
				case 7: {
					novaUrl = "voxGames.html";					
					break;
				}
				case 8: {
					novaUrl = "fonoFlex.html";					
					break;
				}
				case 9: {
					novaUrl = "voxMetria.html";					
					break;
				}
				case 10: {
					novaUrl = "fonospeak.html";					
					break;
				}
				case 11: {
					novaUrl = "fisiMetrix.html";					
					break;
				}
				case 12: {
					novaUrl = "earMix.html";					
					break;
				}
				case 13: {
					novaUrl = "pedroParque.html";					
					break;
				}
				case 14: {
					novaUrl = "motrisis.html";					
					break;
				}
				case 15: {
					novaUrl = "vocalgrama.html";					
					break;
				}
				case 16: {
					novaUrl = "andreaPureAudioUSB.html";					
					break;
				}
				case 17: {
					novaUrl = "memoTraining.html";					
					break;
				}
				case 18: {
					novaUrl = "triAudi.html";					
					break;
				}
				default: {
					novaUrl = -1;	
				}
			}
			if(novaUrl!=-1 && novaUrl!=null && String(novaUrl).length>4) {			
				if(novaAba!=null) {								
					carregaPagina(novaUrl + "{paginaProduto!" + novoCodProduto + "&" + novaAba);
					//alert("oi");
				} else {
					carregaPagina(novaUrl);
				}
			} else {
				if(window.location.hash == "" || window.location == urlSite + "/#") {
					carregaPagina("home.html");	
				} else {
					if(!ie) {			
						document.getElementById("corpo").innerHTML = tempHTML2;			
					}
				}
			}
			window.setTimeout(fechaMensagem, 3000);
		} else {
			fechaMensagem();
		}
	}		
}

//guarda as opcoes de compra
arrCestaCompras = new Array();

//dados individuais de cada produto para a cts
arrPrecosProdCalc = new Array();

//nroProdCompra        
//arrCestaCompras[0] = new Array(codCompra, formaEnvio, quantidade);

//se false ao abrir a pag comprarProdutos retorna pra pag anterior
//var podeContinuarCompra = true;

//anti spam em botoes
var primeiroClique = true;

//controle das ancoras das paginas
var ancora = null;

//nro de produtos diferentes selecionados (grid)
var contProdutos = 0;

//NUMERO DE PACOTES
var nroPacotes = 14;

//atributos: área - nome do produto
var arrProdDesenvolvimento = new Array();
arrProdDesenvolvimento[0] = new Array(2, "Ergonomia");
arrProdDesenvolvimento[1] = new Array(1, "Escuta Ativa");


/** LISTA DE DOWNLOADS
eventoId - id - download
----------------//----------------//----------------
pagina de downloads

tdDown0 -  0 - Documento com Descrição dos Produtos (e-Folders)
tdDown1 -  1 - Dicas para o VoxMetria
tdDown2 -  2 - Dicas para o FonoView 
tdDown3 -  3 - Versão do VoxGames válida por 7 dias
tdDown4 -  4 - Versão do VoxMetria válida por 7 dias
tdDown5 -  5 - Versão do AudiReport válida por 15 dias
tdDown6 -  6 - Versão do FonoView válida por 7 dias
tdDown7 -  7 - Demonstrativo do FisiMetrix
tdDown11 -  11 - Demonstrativo do EarMix
tdDown12 -  12 - Gabarito de Modelos do EarMix
tdDown14 -  14 - Versão do MemoTraining válida por 7 dias
tdDown15 -  15 - Versão do TriAudi válida por 15 dias

tdDown21 -  21 - Versão do AgenSis válida por 30 dias //www.agensis.com.br/util/AgensisTrial.exe downAgenSisTrial.html
tdDown22 -  22 - Versão do Sesmo válida por 15 dias //www.sesmo.com.br/sesmotrial.exe downSesmoTrial.html

----------------//----------------//----------------
pagina de atualizacoes

tabProduto8  - 8  - VoxMetria 2.8
tabProduto15 - 9  - FonoFlex 1.1
tabProduto16 - 10 - FisiMetrix 1.3
tabProduto19 - 13 - Atualização Motrisis 1.1
*/

prods = null;

function carregarSite(codProduto, aba) {
	
	mostraMensagem("Aguarde, carregando...", 250, 50);
	makePOSTRequest("contador.php", "divCont", "");
	
	initialize();	
	//tt = history[history.length-1];
	//history = new Array(tt.toString());	
	var itemMenuId = null;	
	baseCts = carregarXML("basects/baseCts.xml");
	baseFrete = carregarXML("basects/baseFrete.xml");
	mostrarAviso("iniciando...", "corpo");
	if(codProduto!=null) {
		if(codProduto=="") {
			novoCodProduto = -1;
		} else {
			novoCodProduto = codProduto;
		}		
	} else {
		novoCodProduto = -1;
	}
	if(aba!=null) {
		novaAba = aba;	
	}
	prods = baseCts.getElementsByTagName("PRODUTO");
	//timerBanco = window.setInterval(carregarBanco, 200);	
	//timerBanco = window.setTimeout(carregarBanco, 200);	
	carregarBanco();
	ajustarTela();
}

function deletarComponente(componente) {
	if(document.getElementById(componente)!=null) {
		var componente = document.getElementById(componente);
	}
	componente.parentNode.removeChild(componente);
}

function addEvento(objeto, evType, funcao, useCapture) {
	try {
		if(objeto.addEventListener) {
			objeto.addEventListener(evType, funcao, useCapture);
		} else if(objeto.attachEvent) {
			objeto.attachEvent("on" + evType, funcao);
		}
	} catch(e) {
		alert("Erro: " + e.message);	
	}
}

function getAtributosTela() {
	//resolucao do pc
	wRes = screen.width; 
	hRes = screen.height;	
	//área da pagina no browser
	wTela = canvasEl.clientWidth || window.innerWidth;
	hTela = canvasEl.clientHeight || window.innerHeight;	
}

function ajustarTela() {
	getAtributosTela();
	document.getElementById("tabMenu").style.height = hTela-145 + "px";	
}

function no() {
}

function $(id){return document.getElementById(id);}

function $tag(tag){return document.getElementsByTagName(tag);}

function random(algs){return Math.random().toString().replace(/(\.|0)/g, "").substr(0, algs)}

function arredondar(valor, casas) {
	var novo = Math.round(valor*Math.pow(10,casas))/Math.pow(10,casas);
   	return(novo);
}

//clique do menu
function itemMenuClicar(cod) {
	fecharDiv();
	primeiroClique = true;
	//if(cod!=itemMenuId || cod==3 || cod==4 || cod==7 || cod==10 || cod==6) {
	if(true) {
		
		if(cod==88) {				
			marcarMenu(8);
		} else {
			marcarMenu(cod);
		}
		
		switch(cod) {
			case 0: {
				carregaPagina("home.html");
				break;
			}
			case 1: {
				carregaPagina("empresa.html");
				break;
			}
			case 2: {
				carregaPagina("produtos.html");			
				break;
			}
			case 3: {
				abaFono = 0;
				carregaPagina("fonoaudiologia.html");
				break;
			}
			case 4: {
				carregaPagina("fisioterapia.html");			
				break;
			}
			case 5: {
				carregaPagina("emDesenvolvimento.html");
				break;
			}
			case 6: {
				carregaPagina("atualizacoes.html");
				break;
			}
			case 7: {
				carregaPagina("downloads.html");
				break;
			}
			case 8: {
				temFuncao = false;
				carregaPagina("cadastro.html");				
				break;
			}
			case 9: {
				carregaPagina("representantes.html");
				break;
			}
			case 10: {
				primeiroClique = true;			
				carregaPagina("suporte.html");				
				break;
			}
			case 11: {
				carregaPagina("contato.html");
				break;
			}	
			case 12: {
				carregaPagina("artigosPublicacoes.html");
				break;
			}
			case 13: {
				carregaPagina("controleL.html");
				break;
			}
			case 88: {
				carregaPagina("cadastroDesenv.html");
				break;
			}
		}
		itemMenuId = cod;		
	}
	document.getElementById("tabMenu").style.height = hTela-145 + "px";	
}

function carregaAtual() {
}

function desmarcarMenu(limparVar) {
	for(i=0;i<totalItensMenu+1;i++) {
		if(document.getElementById("mnu"+i)!=null) {
			document.getElementById("mnu"+i).className = "tdMenuItem";
		}
	}
	if(limparVar)
		itemMenuId = null;
}

function marcarMenu(cod) {
	desmarcarMenu();
	if(itemMenuId!=null && cod>0) {
		if(cod==3 || cod==4 || cod==7 || cod==10 || cod==6) {
			document.getElementById("mnu"+cod).className = "marcarTd2";
		} else {
			document.getElementById("mnu"+cod).className = "marcarTd";
		}
	}
}

function mouseSobreMenu(cod) {
	if(itemMenuId!=cod) {
		document.getElementById("mnu"+cod).className = "mouseSobreTd";
	} else {
		if(cod==3 || cod==4 || cod==7 || cod==10 || cod==6) {
			document.getElementById("mnu"+cod).className = "marcarTd2";
		} else {
			document.getElementById("mnu"+cod).className = "marcarTd";
		}
	}	
}

function mouseSaiForaMenu(cod) {
	if(itemMenuId!=cod) {
		document.getElementById("mnu"+cod).className = "tdMenuItem";
	} else {
		if(cod==3 || cod==4 || cod==7 || cod==10 || cod==6) {
			document.getElementById("mnu"+cod).className = "marcarTd2";
		} else {
			document.getElementById("mnu"+cod).className = "marcarTd";
		}
	}
}

function selItemPainel(cod) {
	document.getElementById(cod).className = "itemPainelSel";
}

function desSelItemPainel(cod) {
	document.getElementById(cod).className = "itemPainel";
}

function selLinguagem(linguagemId) {
	/*
		0 - português
		1 - inglês
		2 - espanhol	
	*/
	switch(linguagemId) {
		case 1: {
			alert("IE? " + ie);
		}		
	}	
}

function carregaImagem(imgSrc, alvo) {
	document.getElementById(alvo).src = imgSrc;
}

function fecharDiv() {
	try {
		document.getElementById("divGeral").style.visibility = "hidden";
		document.getElementById("telaEscura").className = "invisivel";
		document.getElementById("swfCabecalho").style.visibility = "visible";
		document.onkeypress = null;

		document.getElementsByTagName("html")[0].className = null;
	} catch(e) {		
	}
	
}

function mostraTelaEscura() {		
	posY = ((document.documentElement && document.documentElement.scrollTop) ? document.documentElement.scrollTop : document.body.scrollTop);		
	document.getElementById("telaEscura").className = "telaEscura1";
	document.getElementById("telaEscura").style.top = posY + "px";
	document.getElementById("telaEscura").style.left = "0px";
	document.getElementById("telaEscura").style.width = wRes + "px";
	document.getElementById("telaEscura").style.height = hRes + "px";
	document.getElementById("swfCabecalho").style.visibility = "hidden";			
	document.onkeypress = rejeitaTeclas;
	
	document.getElementsByTagName("html")[0].className = "bodyEscuro";
	scrollTo(0, posY);
}


function bloqueiaRefresh(e) {
	if(window.event) {
		var tecla = e.keyCode;
	} else if(e.which) {
		var tecla = e.which;
	}
	if(Number(tecla)==116) {
		e.cancelBubble = true;
		e.returnValue = false;
		return false;
	}
}

function rejeitaTeclas(oEvent) {    

    var keyF5=116; //tecla que quer bloquear. 116 é o código da tecla F5
	var keyPageUp=33;
	var keyPageDown=34;
	var keySpace=0;

    //filtrando o evento
    var oEvent = oEvent ? oEvent : window.event;
    var tecla = (oEvent.keyCode) ? oEvent.keyCode : oEvent.which;
    
    if(oEvent.type=="keydown" && navigator.appName.indexOf('Internet Explorer')<0 ){
        //se for keydown e não for o IE, vazarei pois o keypress já foi executado
        return false;
    }    
    if(typeof(oEvent.keyCode)=='number' && oEvent.keyCode==keyF5 && oEvent.keyCode==keyPageUp && oEvent.keyCode==keyPageDown && oEvent.keyCode==keySpace) {
        if (typeof(oEvent.preventDefault)=='function'){
            oEvent.preventDefault();
        } else {
            oEvent.returnValue = false;
            oEvent.keyCode = 0;
        }
    }
    return false;
}

function ampliarImagem(fonte, titulo, wImg, hImg) {	

	mostraTelaEscura();
	if(wImg=="" || wImg==null)
		wImg = 400;
	if(hImg=="" || hImg==null)
		hImg = 300;

	url = ('popImgAmpliada.html*' + titulo + "&" + fonte.src  + "&" + wImg  + "&" + hImg);
	carregarPaginaDadosEm(url, 'divGeral');
	
	document.getElementById("divGeral").className = "divGeralOn";	
	document.getElementById("divGeral").style.left = Math.floor(wTela/2 - 500/2) + "px";
	yTopo = ((document.documentElement && document.documentElement.scrollTop) ? document.documentElement.scrollTop : document.body.scrollTop);
	document.getElementById("divGeral").style.top = (yTopo+Math.floor(hTela/2)-(400/2)) + "px";
	document.getElementById("divGeral").style.visibility = "visible";
}

function avancaImagem(produto) {
	switch(produto) {		
		case "laudoErgonomico": {
			if(laudoErgoImagens[0]<laudoErgoImagens.length-1) {
				laudoErgoImagens[0]++;
			} else {
				laudoErgoImagens[0] = 1;	
			}
			carregaImagem(laudoErgoImagens[laudoErgoImagens[0]], "imgLaudoErgon");
			document.getElementById("txtNroImgLaud").innerHTML = (laudoErgoImagens[0]) + " de " + (laudoErgoImagens.length-1);
			break;			
		}
		case "laudoEscutaAtiva": {
			if(escutaAtivaImagens[0]<escutaAtivaImagens.length-1) {
				escutaAtivaImagens[0]++;
			} else {
				escutaAtivaImagens[0] = 1;	
			}
			carregaImagem(escutaAtivaImagens[escutaAtivaImagens[0]], "imgEscutaAtiva");
			document.getElementById("txtNroEscutaAtiva").innerHTML = (escutaAtivaImagens[0]) + " de " + (escutaAtivaImagens.length-1);
			break;			
		}
		case "pedroAcampamento": {
			if(pedroAcampImagens[0]<pedroAcampImagens.length-1) {
				pedroAcampImagens[0]++;
			} else {
				pedroAcampImagens[0] = 1;	
			}
			carregaImagem(pedroAcampImagens[pedroAcampImagens[0]], "imgPedroAcampamento");
			document.getElementById("txtNroPedroAcampamento").innerHTML = (pedroAcampImagens[0]) + " de " + (pedroAcampImagens.length-1);
			break;			
		}
	}	
}

function voltaImagem(produto) {
	switch(produto) {		
		case "laudoErgonomico": {
			if(laudoErgoImagens[0]>1) {
				laudoErgoImagens[0]--;
			} else {
				laudoErgoImagens[0] = laudoErgoImagens.length-1;	
			}
			carregaImagem(laudoErgoImagens[laudoErgoImagens[0]], "imgLaudoErgon");
			document.getElementById("txtNroImgLaud").innerHTML = (laudoErgoImagens[0]) + " de " + (laudoErgoImagens.length-1);
			break;
		}
		case "laudoEscutaAtiva": {
			if(escutaAtivaImagens[0]>1) {
				escutaAtivaImagens[0]--;
			} else {
				escutaAtivaImagens[0] = escutaAtivaImagens.length-1;	
			}
			carregaImagem(escutaAtivaImagens[escutaAtivaImagens[0]], "imgEscutaAtiva");
			document.getElementById("txtNroEscutaAtiva").innerHTML = (escutaAtivaImagens[0]) + " de " + (escutaAtivaImagens.length-1);
			break;
		}
		case "pedroAcampamento": {
			if(pedroAcampImagens[0]>1) {
				pedroAcampImagens[0]--;
			} else {
				pedroAcampImagens[0] = pedroAcampImagens.length-1;	
			}
			carregaImagem(pedroAcampImagens[pedroAcampImagens[0]], "imgPedroAcampamento");
			document.getElementById("txtNroPedroAcampamento").innerHTML = (pedroAcampImagens[0]) + " de " + (pedroAcampImagens.length-1);
			break;
		}
	}	
}

function trocaCSS(cod, classe) {
	document.getElementById(cod).className = classe;
}

function mouseSobre(cod, classe) {
	document.getElementById(cod).className = classe;
}

function mouseFora(cod, classe) {
	document.getElementById(cod).className = classe;
}

abaFono = null;

function abaClicar(cod, boolCarregar) {
	tempL = document.getElementById("aba" + cod).parentNode.id;
	tempL = tempL.substring(5, tempL.length);
	
	if(tempL!="" && tempL!=null) {
		tempC = document.getElementById("abas" + tempL).parentNode.id;
		tempC = tempC.substring(9, tempC.length);
	} else {
		alert("bug");	
	}
	if(tempC==1) {
		alternaAbas();
	}
	marcarAba(cod);
	if(boolCarregar) {
		abaFono = cod;
		carregarProdutos(cod);
	}	
	abaId = cod;
}

function marcarAba(cod) {
	//if(abaId!=null) {
		if(document.getElementById("aba"+abaId)!=null) {
			document.getElementById("aba"+abaId).className = "abaNormal";
		}
		if(cod>-1) {
			document.getElementById("aba"+cod).className = "abaSelecionada";			
		}
	//}	
}

function mouseSobreAba(cod) {
	if(abaId!=cod) {
		document.getElementById("aba"+cod).className = "abaSobre";
	} else {
		document.getElementById("aba"+cod).className = "abaSelecionada";
	}	
}

function mouseForaAba(cod) {
	if(abaId!=cod) {
		document.getElementById("aba"+cod).className = "abaNormal";
	} else {
		document.getElementById("aba"+cod).className = "abaSelecionada";
	}
}

function alternaAbas() {
	tempHTML = document.getElementById("lugarAbas0").innerHTML;
	document.getElementById("lugarAbas0").innerHTML = document.getElementById("lugarAbas1").innerHTML;
	document.getElementById("lugarAbas1").innerHTML = tempHTML;
	
	posicaoNormalAbas = !posicaoNormalAbas;
}

function marcarCheck(cod) {
	if(cod.substring(0,4)=="quad") {
		cod = cod.substring(4, cod.length);
	} 
	
	prodId = cod.substring(3, cod.length);
	if(document.getElementById(cod).className!="btnCheckBoxSel") {
		document.getElementById(cod).className = "btnCheckBoxSel";
		document.getElementById("quad" + cod).className = "quadCheckBoxSel";
		arrChecked.push(prodId);
	} else {
		document.getElementById(cod).className = "btnCheckBox";

		document.getElementById("quad" + cod).className = "quadCheckBox";
		arrChecked.removerItem(prodId);
	}
	validaCheck(arrChecked, "Produto");
}

function mouseSobreCheck(cod) {
	if(cod.substring(0,4)=="quad") {
		cod = cod.substring(4, cod.length);
	} 
	
	if(document.getElementById(cod).className!="btnCheckBoxSel") {
		document.getElementById(cod).className = "btnCheckBoxSobre";
	} else {
		document.getElementById(cod).className = "btnCheckBoxSel";
	}	
}

function mouseForaCheck(cod) {
	if(cod.substring(0,4)=="quad") {
		cod = cod.substring(4, cod.length);
	} 
	
	if(document.getElementById(cod).className!="btnCheckBoxSel") {
		document.getElementById(cod).className = "btnCheckBox";
	} else {
		document.getElementById(cod).className = "btnCheckBoxSel";
	}
}

function cadastrarse(codProduto) {	
	scrollTo(0, 0);
	marcarMenu(8);
	itemMenuId = 8;
	carregaPagina("cadastro.html{preparaComboProd!" + codProduto);	
}

function preparaComboProd(codProd) {
	if(Number(codProd)==12) {
		marcarCheckInter("chkFisio");
		inter = 2;
		interesseId = 2;
	} else {
		marcarCheckInter("chkFono");
		inter = 1;
		interesseId = 1;
	}	
	montaCheckProd2(inter, "marcarCheckProd", "tdProdutos", codProd);
}

function marcarCheckInter(cod) {
	if(cod.substring(0,4)=="quad") {
		cod = cod.substring(4, cod.length);
	}
	if(cod=="chkFono") {
		catId = 1;
	} else if("chkFisio") {
		catId = 2;
	}
	if(document.getElementById(cod).className!="btnCheckBoxSel") {
		document.getElementById(cod).className = "btnCheckBoxSel";
		document.getElementById("quad" + cod).className = "quadCheckBoxSel";
		interesseId = Number(interesseId) + Number(catId);
		
	} else {
		document.getElementById(cod).className = "btnCheckBox";
		document.getElementById("quad" + cod).className = "quadCheckBox";
		interesseId = Number(interesseId) - Number(catId);
	}	
	montaCheckProd2(interesseId, "marcarCheckProd", "tdProdutos");
}

function marcarCheckProdD(cod) {
	if(cod.substring(0,4)=="quad") {
		cod = cod.substring(4, cod.length);
	}
	prodId = cod.substring(3, cod.length);	
	if(document.getElementById(cod).className!="btnCheckBoxSel") {
		document.getElementById(cod).className = "btnCheckBoxSel";
		document.getElementById("quad" + cod).className = "quadCheckBoxSel";
		arrChecked.push(prodId);
	} else {
		document.getElementById(cod).className = "btnCheckBox";
		document.getElementById("quad" + cod).className = "quadCheckBox";
		arrChecked.removerItem(prodId);
	}
}


function marcarCheckProd(cod) {
	if(cod.substring(0,4)=="quad") {
		cod = cod.substring(4, cod.length);
	}
	prodId = cod.substring(3, cod.length);
	if(document.getElementById(cod).className!="btnCheckBoxSel") {
		document.getElementById(cod).className = "btnCheckBoxSel";
		document.getElementById("quad" + cod).className = "quadCheckBoxSel";
		arrChecked.push(prodId);
	} else {
		document.getElementById(cod).className = "btnCheckBox";
		document.getElementById("quad" + cod).className = "quadCheckBox";
		arrChecked.removerItem(prodId);
	}
}

function marcarCheckAtual(cod) {
	if(cod.substring(0,4)=="quad") {
		cod = cod.substring(4, cod.length);
	}
	prodId = cod.substring(3, cod.length);
	if(document.getElementById(cod).className!="btnCheckBoxSel") {
		document.getElementById(cod).className = "btnCheckBoxSel";
		document.getElementById("quad" + cod).className = "quadCheckBoxSel";
		arrChecked.push(arrConfigProdutos[prodId][0]);
	} else {
		document.getElementById(cod).className = "btnCheckBox";
		document.getElementById("quad" + cod).className = "quadCheckBox";
		arrChecked.removerItem(arrConfigProdutos[prodId][0]);
	}	
	arrProdAtualSel	= new Array();
	for(i=0;i<arrChecked.length;i++) {
		for(i2=0;i2<arrAtualizacoes[arrChecked[i]].length;i2++) {
			arrProdAtualSel.push(arrAtualizacoes[arrChecked[i]][i2]);
		}
	}
	
	if(arrProdAtualSel.length>0) {
		document.getElementById("tabVisualizar").className = "tabVisivel";	
		document.getElementById("tabAviso").className = "tabInvisivel";
	} else {		
		document.getElementById("tabVisualizar").className = "tabInvisivel";
		if(arrChecked.length>0) {
			document.getElementById("tabAviso").className = "tabVisivel";
		} else {
			document.getElementById("tabAviso").className = "tabInvisivel";
		}
	}
}

function mostrarAtualizacoes() {
	mostrarCheck(false);
	carregarAtualizacoes(arrProdAtualSel);	
}

function mostrarCheck(okMostrar) {
	if(okMostrar) {
		document.getElementById("trCheckProd").className = "trVisivel";
		document.getElementById("trListaAtual").className = "tabInvisivel";
	} else {
		document.getElementById("trCheckProd").className = "tabInvisivel";
		document.getElementById("trListaAtual").className = "trVisivel";		
	}
}

function montaCheckProd(catId, funcaoClique, funcaoOver, funcaoOut, lugarId) {	
	/*
	0 - nenhum
	1 - fono
	2 - fisio
	3 - fono e fisio
	*/	
	
	try {
		tab1 = "<table width=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"6\" class=\"compForm\" id=\"tabProd\">";
		tab2 = "</table>";
		tempHTML = "";
	
		contProd = 0;
		arrProdTemp = new Array();
		arrChecked = new Array();
		
		if(catId>0) {
			for(i=0;i<arrConfigProdutos.length;i++) {
				if(Number(arrConfigProdutos[i][0])!=-1) {
					if(catId!=3) {
						if(arrConfigProdutos[i][2]==catId) {
							arrProdTemp.push(i);
						}
					} else {
						arrProdTemp.push(i);
					}
				}
			}
			
			contLinhas = arrProdTemp.length;
			if(contLinhas%2!=0) {
				contLinhas = Math.floor(contLinhas/2)+1;
			} else {
				contLinhas = contLinhas/2;
			}
			for(l=0;l<contLinhas;l++) {
				tempHTML += "<tr>"
				for(c=0;c<2;c++) {
					if(arrProdTemp[contProd]!=null) {
						nome = String(arrConfigProdutos[arrProdTemp[contProd]][1]);
						
						quadHTML = "<td onClick=\"javascript:" + funcaoClique + ";\" onMouseOut=\"javascript:" + (funcaoOut!=""?funcaoOut:"mouseForaCheck(this.id)") + ";\" onMouseOver=\"javascript:" + (funcaoOver!=""?funcaoOver:"mouseSobreCheck(this.id)") + ";\" width=\"17\" align=\"center\" class=\"quadCheckBox\" id=\"quadchk" + arrProdTemp[contProd] + "\">X</td>";					
											
						nome = (nome.length<20 ? nome : (nome.substring(0, 17)+"..."));
						nomeHTML = "<td onClick=\"javascript:" + funcaoClique + ";\" onMouseOut=\"javascript:" + (funcaoOut!=""?funcaoOut:"mouseForaCheck(this.id)") + ";\" onMouseOver=\"javascript:" + (funcaoOver!=""?funcaoOver:"mouseSobreCheck(this.id)") + ";\" width=\"133\" id=\"chk" + arrProdTemp[contProd] + "\">" + nome + "</td>";
						tempHTML = tempHTML + quadHTML + nomeHTML;			
					} else {
						quadHTML = "<td width=\"17\" align=\"center\"></td>";
						nomeHTML = "<td width=\"133\">&nbsp;</td>";
						tempHTML = tempHTML + quadHTML + nomeHTML;
					}
					contProd++;
				}
				tempHTML += "</tr>"
			}
			document.getElementById(lugarId).innerHTML = tab1 + tempHTML + tab2;
		} else {
			document.getElementById(lugarId).innerHTML = "Selecione uma área de interesse.";
		}
	} catch(e) {
		montaCheckProd(catId, funcaoClique, funcaoOver, funcaoOut, lugarId);		
	}
}

function montaCheckProd2(catId, nomeFuncao, lugarId, prodMarcado) {	

	/*
	0 - nenhum
	1 - fono
	2 - fisio
	3 - fono e fisio
	*/	
	try {
		tab1 = "<table width=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"6\" class=\"compForm\" id=\"tabProd\">";
		tab2 = "</table>";
		tempHTML = "";
	
		contProd = 0;
		arrProdTemp = new Array();
		arrChecked = new Array();
		
		if(catId>0) {		
			for(i=0;i<arrConfigProdutos.length;i++) {
				if(Number(arrConfigProdutos[i][0])!=-1) {				
					if(catId!=3) {
						if(Number(arrConfigProdutos[i][2])==catId) {
							arrProdTemp.push(i);
						}
					} else {
						arrProdTemp.push(i);
					}
				}
			}
			contLinhas = arrProdTemp.length;
			if(contLinhas%2!=0) {
				contLinhas = Math.floor(contLinhas/2)+1;
			} else {
				contLinhas = contLinhas/2;
			}
			
			for(l=0;l<contLinhas;l++) {
				tempHTML += "<tr>"
				for(c=0;c<2;c++) {
					if(arrProdTemp[contProd]!=null) {
						nome = String(arrConfigProdutos[arrProdTemp[contProd]][1]);
						if(nome.indexOf("(")!=-1) {
							nome = nome.substring(0, nome.indexOf("(")-1);
						}
						quadHTML = "<td onClick=\"javascript:" + nomeFuncao + "(this.id);\" onMouseOut=\"javascript:mouseForaCheck(this.id);\" onMouseOver=\"javascript:mouseSobreCheck(this.id);\" width=\"17\" align=\"center\" class=\"quadCheckBox\" id=\"quadchk" + arrProdTemp[contProd] + "\">X</td>";					
						
						nome = (nome.length<20 ? nome : (nome.substring(0, 17)+"..."));
						nomeHTML = "<td onClick=\"javascript:" + nomeFuncao + "(this.id);\" onMouseOut=\"javascript:mouseForaCheck(this.id);\" onMouseOver=\"javascript:mouseSobreCheck(this.id);\" width=\"133\" id=\"chk" + arrProdTemp[contProd] + "\">" + nome + "</td>";
						tempHTML = tempHTML + quadHTML + nomeHTML;
					} else {
						quadHTML = "<td width=\"17\" align=\"center\"></td>";						
						nomeHTML = "<td width=\"133\">&nbsp;</td>";
						tempHTML = tempHTML + quadHTML + nomeHTML;
					}
					contProd++;
				}
				tempHTML += "</tr>"
			}	
			document.getElementById(lugarId).innerHTML = tab1 + tempHTML + tab2;
		
			if(prodMarcado!=null) {
				marcarCheckProd("chk" + prodMarcado);
			}
		} else {
			document.getElementById(lugarId).innerHTML = "Selecione uma área de interesse.";
		}
	} catch(e) {
		try {
			montaCheckProd2(catId, nomeFuncao, lugarId, prodMarcado);
		} catch(e) {}
	}
}

function enviaFormSuporte() {
	
	if(primeiroClique) {

		nome = document.getElementById("txtNome").value;
		email = document.getElementById("txtEmail").value;
		telefone = document.getElementById("txtTelefone").value;	
		produtos = "";	
		
		for(i=0;i<arrChecked.length;i++) {		
			if(i<arrChecked.length-1) {
				produtos += arrConfigProdutos[arrChecked[i]][1] + ", ";
			} else {
				produtos += arrConfigProdutos[arrChecked[i]][1] + ".";
			}
		}
		questao = document.getElementById("txtQuestao").value;
		
		cont = 1;
		while(questao.indexOf("\n")!=-1) {
			
			questao = questao.replace("\n", "<br>");		
			cont++;
		}	
		
		htmlHead = "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\"><html xmlns=\"http://www.w3.org/1999/xhtml\"><head><meta http-equiv=\"Content-Type\" content=\"text/html; charset=ISO-8859-1\"/><title>enviando email...</title></head><body>";
		
		html1Form = "<form id=\"formSuporte\" name=\"formSuporte\" method=\"post\" action=\"javascript:getFormSuporte(document.getElementById('formSuporte'), 'corpo');\" target=\"_parent\">";
		
		html2Form = "</form></body></html>";	
		
		htmlNome = "<input id=\"campoNome\" type=\"hidden\" name=\"nome\" value=\"" + nome + "\"/>";	
		htmlEmail  = "<input id=\"campoEmail\" type=\"hidden\" name=\"email\" value=\"" + email + "\"/>";	
		htmlTelefone = "<input  id=\"campoTelefone\" type=\"hidden\" name=\"telefone\" value=\"" + telefone + "\"/>";	
		htmlProdutos = "<input id=\"campoProdutos\" type=\"hidden\" name=\"produtos\" value=\"" + produtos + "\"/>";
		htmlQuestao = "<input id=\"campoQuestao\" type=\"hidden\" name=\"questao\" value=\"" + questao + "\"/>";	
		
		htmlPronto = htmlHead + html1Form + htmlNome + htmlEmail + htmlTelefone + htmlProdutos + htmlQuestao + html2Form;	
		document.getElementById("divGeral2").innerHTML = htmlPronto;	
		document.formSuporte.submit();
		primeiroClique = false;
		mostrarAviso("enviando...", "corpo");
	}
}


function validaFormSuporte(idBtnEnviar) {	
	/*
		eventoId:
		0 - sobreBotao
		1 - cliqueDoBotao	
	*/
	
	if(idBtnEnviar!=null) {
		trocaCSS(idBtnEnviar, 'botaoTdSobre');	
	} else {
		ok = true;
	}
	
	if(retirarEspacos(document.getElementById("txtNome").value) == "") {
		document.getElementById("tdNome").className = "compFormContainerErro";
		document.getElementById("tdErroNome").className = "tdAsteriscoErro";
		ok = false;
	} else {
		document.getElementById("tdNome").className = "compFormContainer";
		document.getElementById("tdErroNome").className = "tdAsteriscoOk";
	}
	
	if(document.getElementById("txtEmail").value == "") {
		document.getElementById("tdEmail").className = "compFormContainerErro";
		document.getElementById("tdErroEmail").className = "tdAsteriscoErro";
		ok = false;
	} else {
		if(document.getElementById("txtEmail").value.indexOf("@")!=-1 && document.getElementById("txtEmail").value.indexOf("@")==document.getElementById("txtEmail").value.lastIndexOf("@")) {
			document.getElementById("tdEmail").className = "compFormContainer";
			document.getElementById("tdErroEmail").className = "tdAsteriscoOk";
		} else {
			document.getElementById("tdEmail").className = "compFormContainerErro";
			document.getElementById("tdErroEmail").className = "tdAsteriscoErro";
			ok = false;
		}
	}
	
	if(document.getElementById("txtQuestao").value == "") {
		document.getElementById("tdQuestao").className = "compFormContainerErro";
		document.getElementById("tdErroQuestao").className = "tdAsteriscoErro";
		ok = false;
	} else {
		document.getElementById("tdQuestao").className = "compFormContainer";
		document.getElementById("tdErroQuestao").className = "tdAsteriscoOk";
	}	
	
	if(arrChecked.length==0) {
		document.getElementById("tdProduto").className = "compFormContainerErro";
		document.getElementById("tdErroProduto").className = "tdAsteriscoErro";
		ok = false;
	} else {
		document.getElementById("tdProduto").className = "compFormContainer";
		document.getElementById("tdErroProduto").className = "tdAsteriscoOk";
	}
	
	if(idBtnEnviar==null) {
		if(ok) {
			enviaFormSuporte();
		} else {
			alert("Os campos marcados em vermelho não estão corretamente preenchidos!");	
		}
	}
}

function validaCampo(nomeValor) {
	if(retirarEspacos(document.getElementById("txt" + nomeValor).value)=="") {
		document.getElementById("td" + nomeValor).className = "compFormContainerErro";
		document.getElementById("tdErro" + nomeValor).className = "tdAsteriscoErro";
		return false;
	} else {
		tirarCaracteresInvalidos(document.getElementById("txt" + nomeValor));
		document.getElementById("td" + nomeValor).className = "compFormContainer";
		document.getElementById("tdErro" + nomeValor).className = "tdAsteriscoOk";
		return true;
	}	
}

function tirarCaracteresInvalidos(objeto) {
	objeto.value = objeto.value.replace(/&/gi, "e");
}

function validaCEP(campoValor, campoErro) {
	if(document.getElementById(campoValor).value.length!=9) {
		document.getElementById(campoValor).parentNode.className = "compFormContainerErro";
		document.getElementById(campoErro).className = "tdAsteriscoErro";
		return false;
	} else {
		document.getElementById(campoValor).parentNode.className = "compFormContainer";
		document.getElementById(campoErro).className = "tdAsteriscoOk";		
		return true;
	}
}

function mascara(e, src, mask) {
	try {
		if(window.event) { 
			_TXT = e.keyCode; 
		} else if(e.which) { 
			_TXT = e.which; 
		}
		if(_TXT > 47 && _TXT < 58) {
			var i = src.value.length; 
			var saida = mask.substring(0,1); 
			var texto = mask.substring(i);
			if(texto.substring(0,1) != saida) { 
				src.value += texto.substring(0,1); 
			}
			return true; 
		} else { 
			if (_TXT != 8) { 
				return false; 
			} else { 
				return true; 
			}
		}
	} catch(e) {}
}

function retirarEspacos(texto) {
	texto = texto.replace(/ /gi, "");	
	return texto;
}

function validaEmail(nomeEmail) {
	document.getElementById("txt" + nomeEmail).value = retirarEspacos(document.getElementById("txt" + nomeEmail).value);
	email = document.getElementById("txt" + nomeEmail).value;
	
	if(email=="" || email.indexOf("@.")!=-1 || email.substring(email.lastIndexOf(".")+1, email.length)<1) {
		ok = false;
	} else {		
		if(email.indexOf("@")!=-1 && email.indexOf("@")==email.lastIndexOf("@")) {
			if(email.lastIndexOf("@")<email.lastIndexOf(".")-1) {
				if(email.substring(0, email.lastIndexOf("@")).length>0) {
					ok = true;
				} else {
					ok = false;	
				}
			} else {
				ok = false;
			}
		} else {
			ok = false;
		}
	}
	if(ok) {
		document.getElementById("td" + nomeEmail).className = "compFormContainer";
		document.getElementById("tdErro" + nomeEmail).className = "tdAsteriscoOk";
		return true;
	} else {
		document.getElementById("td" + nomeEmail).className = "compFormContainerErro";
		document.getElementById("tdErro" + nomeEmail).className = "tdAsteriscoErro";
		return false;
	}
}

function validaCheck(varArray, nomeValor) {
	if(varArray.length==0) {
		document.getElementById("td" + nomeValor).className = "compFormContainerErro";
		document.getElementById("tdErro" + nomeValor).className = "tdAsteriscoErro";
		return false;
	} else {
		document.getElementById("td" + nomeValor).className = "compFormContainer";
		document.getElementById("tdErro" + nomeValor).className = "tdAsteriscoOk";
		return true;
	}	
}

function limparCamposFormSuporte() {
	document.getElementById("txtNome").value = "";
	document.getElementById("txtEmail").value = "";
	document.getElementById("txtTelefone").value = "";
	document.getElementById("txtQuestao").value = "";	
	
	arrChecked = new Array();
		
	for(i=0;i<20;i++) {
		if(document.getElementById("chk" + i)!=null) {
			document.getElementById("chk" + i).className = "btnCheckBox";
			document.getElementById("quadchk" + i).className = "quadCheckBox";
		}
	}
}

Array.prototype.removerItem = function(itemASerRemovido) {
	for(i=0;i<this.length;i++) {
		if(this[i]==itemASerRemovido) {
			this.splice(i, 1);	
		}
	}
}

function abrirPopUp(url) {	
	carregarPaginaDadosEm(url, 'divGeral');	
	document.getElementById("divGeral").className = "divGeralOn";
	
	document.getElementById("divGeral").style.left = (Math.floor((wRes-800)/2) + 223) + "px";
	yTopo = ((document.documentElement && document.documentElement.scrollTop) ? document.documentElement.scrollTop : document.body.scrollTop);
	document.getElementById("divGeral").style.top = (yTopo+Math.floor(hTela/2)-((yTopo>50)?200:160)) + "px";
	document.getElementById("divGeral").style.visibility = "visible";
}

function executaPHP(url) {
	carregaPagina(url);
}

function reiniciaPagina() {
	interesseId = 0;
	arrChecked = new Array();
	primeiroClique = true;
	itemMenuId = null;
	carregaPagina("home.html");	
}

function gotoHome() {
	carregaPagina("home.html");
}

function topoPagina() {
	scrollTo(0,0);
}

function getAnchorPosition(anchorname) {
	var useWindow=false;
	var coordinates=new Object();
	var x=0,y=0;
	var use_gebi=false, use_css=false, use_layers=false;
	
	if(document.getElementById){
		use_gebi=true;
	} else if(document.all){
		use_css=true;
	} else if(document.layers){
		use_layers=true;
	}
	
	if(use_gebi && document.all) {
		x=AnchorPosition_getPageOffsetLeft(document.all[anchorname]);
		y=AnchorPosition_getPageOffsetTop(document.all[anchorname]);
	} else if(use_gebi) {
		var o=document.getElementById(anchorname);
		x=AnchorPosition_getPageOffsetLeft(o);
		y=AnchorPosition_getPageOffsetTop(o);
	} else if(use_css){
		x=AnchorPosition_getPageOffsetLeft(document.all[anchorname]);
		y=AnchorPosition_getPageOffsetTop(document.all[anchorname]);
	} else if(use_layers){
		var found=0;
		for(var i=0;i<document.anchors.length;i++) {
			if(document.anchors[i].name==anchorname) {
				found=1;
				break;
			}
		} 
		if(found==0){
			coordinates.x=0;
			coordinates.y=0;
			return coordinates;
		}
		x=document.anchors[i].x;
		y=document.anchors[i].y;
	} else {
		coordinates.x=0;
		coordinates.y=0;
		return coordinates;
	}
	coordinates.x=x;
	coordinates.y=y;
	return coordinates;
}
	
function getAnchorWindowPosition(anchorname) {
	var coordinates=getAnchorPosition(anchorname);
	var x=0;
	var y=0;
	if(document.getElementById) {
		if(isNaN(window.screenX)) {
			x=coordinates.x-document.body.scrollLeft+window.screenLeft;
			y=coordinates.y-document.body.scrollTop+window.screenTop;
		} else { 
			x=coordinates.x+window.screenX+(window.outerWidth-window.innerWidth)-window.pageXOffset;
			y=coordinates.y+window.screenY+(window.outerHeight-24-window.innerHeight)-window.pageYOffset;
		}
	} else if(document.all) {
		x=coordinates.x-document.body.scrollLeft+window.screenLeft;
		y=coordinates.y-document.body.scrollTop+window.screenTop;
	} else if(document.layers) {
		x=coordinates.x+window.screenX+(window.outerWidth-window.innerWidth)-window.pageXOffset;
		y=coordinates.y+window.screenY+(window.outerHeight-24-window.innerHeight)-window.pageYOffset;
	}
	coordinates.x=x;
	coordinates.y=y;
	return coordinates;
}

function AnchorPosition_getPageOffsetLeft(el) {
	try {
		var ol=el.offsetLeft;
		while((el=el.offsetParent) != null) {
			ol += el.offsetLeft;
		} 
		return ol;
	} catch(e) {
		
	}
}

function AnchorPosition_getWindowOffsetLeft(el) {
	try {
		return AnchorPosition_getPageOffsetLeft(el)-document.body.scrollLeft;
	} catch(e) {
		
	}
}

function AnchorPosition_getPageOffsetTop(el) {
	try {
		var ot=el.offsetTop;
		while((el=el.offsetParent) != null) {
			ot += el.offsetTop;
		}
		return ot;
	} catch(e) {
		
	}
}

function AnchorPosition_getWindowOffsetTop(el) {
	try {
		return AnchorPosition_getPageOffsetTop(el)-document.body.scrollTop;
	} catch(e) {
		
	}
}

function gotoAncora(nomeAncora) {
	//tt = document.getElementById(nomeAncora);
	//window.location.hash = nomeAncora;	
	scrollTo(0, (Number(getAnchorPosition(nomeAncora).y)-25));
	//scrollBy(0, -10);	
}

function gotoAncora2(nomeAncora, plusY) {
	scrollBy(0, (Number(getAnchorPosition(nomeAncora).y)+Number(plusY)));
	//window.location.hash = nomeAncora;
	//scrollBy(0, Number(plusY));
}

function efetuaDownload(eventoId) {
	eventoId = Number(eventoId.substring(6, eventoId.length));
	titulo = document.getElementById("titulo" + eventoId).innerHTML;
	funcaoVoltar = "javascript:carregarPaginaEm('listaDownloads.html', 'divFormDown');";	
	carregarPaginaDadosEm("formDownload.html*" + titulo + "&" + eventoId + "&" + funcaoVoltar, "divFormDown");
}

function efetuaDownload2(eventoId) {
	eventoId = Number(eventoId.substring(6, eventoId.length));
	titulo = document.getElementById("titulo" + eventoId).innerHTML;	
	switch(eventoId) {
		case 1:
		case 4: cod = 9; break;
		case 2:
		case 6: cod = 1; break;
		case 3: cod = 7; break;
		case 5: cod = 0; break;
		case 7: cod = 11; break;
		case 11: 
		case 12: cod = 12; break;
		case 13: cod = 13; break;
		case 14: cod = 17; break; //memo Training
	}
	funcaoVoltar = "javascript:paginaProduto(" + cod + ", 4)";
	
	carregarPaginaDadosEm("formDownload.html*" + titulo + "&" + eventoId + "&" + funcaoVoltar, "corpoProduto");
}

function voltaDownload(cod) {		
	if(itemMenuId==6) {
		mostrarAviso("carregando...", "corpo");
		itemMenuid = -1;
		itemMenuClicar(6);
	} else if(itemMenuId==7) {
		carregarPaginaEm("downloads.html{carregarPaginaEm!listaDownloads.html&divFormDown", "corpo");
	} else {	
		mostrarAviso("carregando...", "corpo");	
		switch(Number(cod)) {
			case 0: {
				url = "audiReport.html";			
				break;
			}
			case 1: {
				url = "fonoView.html";			
				break;
			}
			case 2: {
				url = "avalie.html";			
				break;
			}
			case 3: {
				url = "pedroNaCasa.html";
				break;
			}
			case 4: {
				url = "desafioFonemas.html";
				break;
			}
			case 5: {
				url = "voiceReport.html";
				break;
			}
			case 6: {
				url = "fonoTools.html";
				break;
			}
			case 7: {
				url = "voxGames.html";			
				break;
			}
			case 8: {
				url = "fonoFlex.html";			
				break;
			}
			case 9: {
				url = "voxMetria.html";
				break;
			}
			case 10: {
				url = "fonospeak.html";
				break;
			}
			case 11: {
				url = "fisiMetrix.html";
				break;
			}
			case 12: {
				url = "earMix.html";
				break;
			}
			case 13: {
				url = "pedroParque.html";
				break;
			}
			case 14: {
				url = "motrisis.html";
				break;
			}
			case 15: {
				url = "vocalgrama.html";					
				break;
			}
			case 16: {
				url = "andreaPureAudioUSB.html";					
				break;
			}
			case 17: {
				url = "memoTraining.html";					
				break;
			}
			case 18: {
				url = "triAudi.html";					
				break;
			}
		}	
		url = url + "{paginaProduto!" + cod + "&4";
		carregarPaginaEm(url, "corpo");		
	}
}

function efetuaDownloadAtual(eventoId) {
	eventoId = Number(eventoId.substring(10, eventoId.length));	
	titulo = "Atualização: " + document.getElementById("titulo" + eventoId).innerHTML;
	switch(eventoId) {
		case 15: eventoId = 9; break;
		case 16: eventoId = 10; break;
		case 19: eventoId = 13; break;
	}
	carregarPaginaDadosEm("formAtualizacao.html*" + titulo + "&" + eventoId, "corpoAtualizacoes");
	document.getElementById("trCorpoAtualizacoes").className = "painel";
	document.getElementById("trListaAtual").className = "tabInvisivel";
}

function voltaFormAtual() {
	//carregarPaginaEm('atualizacoes.html', 'corpo');
	document.getElementById("trCheckProd").className = "trVisivel";
	document.getElementById("trCorpoAtualizacoes").className = "tabInvisivel";
	document.getElementById("corpoAtualizacoes").innerHTML = "&nbsp;";
}

function limparCamposFormDownload() {
	document.getElementById("txtNome").value = "";
	document.getElementById("txtEmail").value = "";
	document.getElementById("txtTelefone").value = "";
	document.getElementById("txtCidade").value = "";	
	document.getElementById("txtPais").value = "Brasil";	
	document.getElementById("txtCEP").value = "";
	document.getElementById("txtEndereco").value = "";	
	document.getElementById("txtEstado").selectedIndex = 0;
	document.getElementById("txtProfissao").selectedIndex = 0;
}

function validaFormDownload(idBtnEnviar) {
	if(idBtnEnviar!=null) {
		trocaCSS(idBtnEnviar, 'botaoTdSobre');	
	} else {
		ok = true;
	}	
	
	ok1 = validaCampo("Nome");
	ok2 = validaEmail("Email");
	
	ok = ok1 && ok2;
	
	if(idBtnEnviar==null) {
		if(ok) {
			enviaFormDownload();
		} else {
			alert("Os campos marcados em vermelho não estão corretamente preenchidos!");	
		}
	}
}

function enviaFormDownload() {
	
	if(primeiroClique) {

		nome = document.getElementById("txtNome").value;
		email = document.getElementById("txtEmail").value;
		telefone = document.getElementById("txtTelefone").value;
		cidade = document.getElementById("txtCidade").value;
		cep = document.getElementById("txtCEP").value;
		pais = document.getElementById("txtPais").value;
		profissao = document.getElementById("txtProfissao").value;
		estado = document.getElementById("txtEstado").value;
		endereco = document.getElementById("txtEndereco").value;
		
		nomeDownload = document.getElementById("divNomeDownload").innerHTML;	
		downloadId = document.getElementById("divDownloadId").innerHTML;
	
		htmlHead = "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\"><html xmlns=\"http://www.w3.org/1999/xhtml\"><head><meta http-equiv=\"Content-Type\" content=\"text/html; charset=ISO-8859-1\"/><title>enviando email...</title></head><body>";
		
		html1Form = "<form id=\"formDownload\" name=\"formDownload\" method=\"post\" action=\"javascript:getFormDownload(document.getElementById('formDownload'), 'corpo');\" target=\"_parent\">";
		
		html2Form = "</form></body></html>";	
		
		htmlNome = "<input id=\"campoNome\" type=\"hidden\" name=\"nome\" value=\"" + nome + "\"/>";	
		htmlProfissao  = "<input id=\"campoProfissao\" type=\"hidden\" name=\"profissao\" value=\"" + profissao + "\"/>";		
		htmlEndereco = "<input id=\"campoEndereco\" type=\"hidden\" name=\"endereco\" value=\"" + endereco + "\"/>";
		htmlCidade = "<input id=\"campoCidade\" type=\"hidden\" name=\"cidade\" value=\"" + cidade + "\"/>";			
		
		htmlEstado = "<input id=\"campoEstado\" type=\"hidden\" name=\"estado\" value=\"" + estado + "\"/>";
		htmlCEP = "<input id=\"campoCEP\" type=\"hidden\" name=\"cep\" value=\"" + cep + "\"/>";			
		htmlPais = "<input id=\"campoPais\" type=\"hidden\" name=\"pais\" value=\"" + pais + "\"/>";			
		
		htmlTelefone = "<input  id=\"campoTelefone\" type=\"hidden\" name=\"telefone\" value=\"" + telefone + "\"/>";
		htmlEmail  = "<input id=\"campoEmail\" type=\"hidden\" name=\"email\" value=\"" + email + "\"/>";	
		
		htmlNomeDownload  = "<input id=\"campoDownload\" type=\"hidden\" name=\"nomeDownload\" value=\"" + nomeDownload + "\"/>";	
		htmlDownloadId  = "<input id=\"campoDownloadId\" type=\"hidden\" name=\"downloadId\" value=\"" + downloadId + "\"/>";	
		
		htmlPronto = htmlHead + html1Form + htmlNome + htmlProfissao + htmlEndereco + htmlCidade + htmlEstado + htmlCEP + htmlPais + htmlTelefone + htmlEmail + htmlNomeDownload + htmlDownloadId + html2Form;	
			
		document.getElementById("divGeral2").innerHTML = htmlPronto;	
		
		document.formDownload.submit();
		primeiroClique = false;
		mostrarAviso("enviando...", "corpo");
	}
}

function baixaArquivo(urlArq) {
	window.location = urlArq;
}

function marcarCheckPessoa(cod) {
	if(cod.substring(0,4)=="quad") {
		cod = cod.substring(4, cod.length);
	}
	if(cod=="chkF") {
		catPessoa = 1;
		document.getElementById("chkF").className = "btnCheckBoxSel";
		document.getElementById("quadchkF").className = "quadCheckBoxSel";
		document.getElementById("chkJ").className = "btnCheckBox";
		document.getElementById("quadchkJ").className = "quadCheckBox";
		document.getElementById("divCpfCnpj").innerHTML = "CPF:";
		document.getElementById("divNomeRazao").innerHTML = "Nome Completo:";
		document.getElementById("trDepto").className = "tabInvisivel";
		document.getElementById("trRG").className = "trVisivel";
		
		document.getElementById("txtPessoaClinica").value = "-----";
		document.getElementById("txtRg").value = "";
	} else if("chkJ") {
		catPessoa = 2;
		document.getElementById("chkJ").className = "btnCheckBoxSel";
		document.getElementById("quadchkJ").className = "quadCheckBoxSel";
		document.getElementById("chkF").className = "btnCheckBox";
		document.getElementById("quadchkF").className = "quadCheckBox";
		document.getElementById("divCpfCnpj").innerHTML = "CNPJ:";
		document.getElementById("divNomeRazao").innerHTML = "Razão Social:";
		document.getElementById("trDepto").className = "trVisivel";
		document.getElementById("trRG").className = "tabInvisivel";
		
		document.getElementById("txtPessoaClinica").value = "";
		document.getElementById("txtRg").value = "-----";
	}
}

function limparCamposFormCadastro() {
	document.getElementById("txtNome").value = "";
	document.getElementById("txtEndereco").value = "";
	document.getElementById("txtBairro").value = "";
	document.getElementById("txtEmail").value = "";
	document.getElementById("txtTelefoneC").value = "";
	document.getElementById("txtTelefoneR").value = "";
	document.getElementById("txtFax").value = "";
	document.getElementById("txtCidade").value = "";	
	document.getElementById("txtPais").value = "Brasil";	
	document.getElementById("txtCEP").value = "";	
	document.getElementById("txtSugestao").value = "";	
	document.getElementById("txtEstado").selectedIndex = 0;	
	
	document.getElementById("chkFono").className = "btnCheckBox";
	document.getElementById("quadchkFono").className = "quadCheckBox";
	document.getElementById("chkFisio").className = "btnCheckBox";
	document.getElementById("quadchkFisio").className = "quadCheckBox";
	interesseId = 0;
	//montaCheckProd(interesseId, "tdProdutos");	
	document.getElementById("tdProdutos").innerHTML = "Selecione uma área de interesse.";
	arrChecked = new Array();
}

function limparCamposFormCadastroD() {
	document.getElementById("txtNome").value = "";
	document.getElementById("txtEndereco").value = "";
	document.getElementById("txtBairro").value = "";
	document.getElementById("txtEmail").value = "";
	document.getElementById("txtTelefoneC").value = "";
	document.getElementById("txtTelefoneR").value = "";
	document.getElementById("txtFax").value = "";
	document.getElementById("txtCidade").value = "";	
	document.getElementById("txtPais").value = "Brasil";	
	document.getElementById("txtCEP").value = "";	
	document.getElementById("txtSugestao").value = "";	
	document.getElementById("txtEstado").selectedIndex = 0;	
	interesseId = 0;
	interesse = "";
	for(i=0;i<arrProdDesenvolvimento.length;i++) {
		document.getElementById("quadchk"+i).className = "quadCheckBox";
		document.getElementById("chk"+i).className = "btnCheckBox";
	}
	arrChecked = new Array();
}

function validaFormCadastro(emDesenvolv, idBtnEnviar) {
	if(idBtnEnviar!=null) {
		trocaCSS(idBtnEnviar, 'botaoTdSobre');	
	} else {
		ok = true;
	}		
	
	ok1 = validaCampo("Nome");
	ok2 = validaEmail("Email");
	
	ok = ok1 && ok2;
	
	if(idBtnEnviar==null) {
		if(ok) {
			enviaFormCadastro(emDesenvolv);
		} else {
			alert("Os campos marcados em vermelho não estão corretamente preenchidos!");	
		}
	}
}

function enviaFormCadastro(emDesenvolv) {
	
	if(primeiroClique) {
		
		nome = document.getElementById("txtNome").value;
		endereco = document.getElementById("txtEndereco").value;
		bairro = document.getElementById("txtBairro").value;		
		email = document.getElementById("txtEmail").value;
		telefoneR = document.getElementById("txtTelefoneR").value;
		telefoneC = document.getElementById("txtTelefoneC").value;
		fax = document.getElementById("txtFax").value;
		cidade = document.getElementById("txtCidade").value;
		cep = document.getElementById("txtCEP").value;
		pais = document.getElementById("txtPais").value;
		estado = document.getElementById("txtEstado").value;		
		
		produtos = "";
		if(emDesenvolv) {
			inter = 0;
			for(i=0;i<arrChecked.length;i++) {
				if(arrProdDesenvolvimento[arrChecked[i]][0]==1 && inter<10) {
					inter += 10;	
				} else if(arrProdDesenvolvimento[arrChecked[i]][0]==2 && inter%2==0) {
					inter += 1;
				}
				if(i<arrChecked.length-1) {
					produtos += arrProdDesenvolvimento[arrChecked[i]][1] + ", ";
				} else {
					produtos += arrProdDesenvolvimento[arrChecked[i]][1] + ".";
				}
			}
			interesseId = 0;
			if(inter>=10) {
				interesseId	+= 1;
			} 
			if(inter%2==1) {
				interesseId	+= 2;
			}
		} else {
			for(i=0;i<arrChecked.length;i++) {
				if(i<arrChecked.length-1) {
					produtos += arrConfigProdutos[arrChecked[i]][1] + ", ";
				} else {
					produtos += arrConfigProdutos[arrChecked[i]][1] + ".";
				}
			}
		}
		
		if(interesseId==0) {
			interesse = "";
		} else if(interesseId==1) {
			interesse = "Fonoaudiologia";
		} else if(interesseId==2) {
			interesse = "Fisioterapia";
		} else if(interesseId==3)	{
			interesse = "Fonoaudiologia e Fisioterapia";
		}

		sugestao = document.getElementById("txtSugestao").value;		
		cont = 1;
		while(sugestao.indexOf("\n")!=-1) {			
			sugestao = sugestao.replace("\n", "<br>");		
			cont++;
		}		
		
		htmlHead = "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\"><html xmlns=\"http://www.w3.org/1999/xhtml\"><head><meta http-equiv=\"Content-Type\" content=\"text/html; charset=ISO-8859-1\"/><title>enviando email...</title></head><body>";
		
		html1Form = "<form id=\"formCadastro\" name=\"formCadastro\" method=\"post\" action=\"javascript:getFormCadastro(document.getElementById('formCadastro'), 'corpo');\" target=\"_parent\">";
		
		html2Form = "</form></body></html>";			
				
		htmlNome = "<input id=\"campoNome\" type=\"hidden\" name=\"nome\" value=\"" + nome + "\"/>";	
		htmlEndereco = "<input id=\"campoEndereco\" type=\"hidden\" name=\"endereco\" value=\"" + endereco + "\"/>";
		htmlBairro = "<input id=\"campoBairro\" type=\"hidden\" name=\"bairro\" value=\"" + bairro + "\"/>";
		htmlEmail  = "<input id=\"campoEmail\" type=\"hidden\" name=\"email\" value=\"" + email + "\"/>";		
		htmlCidade = "<input id=\"campoCidade\" type=\"hidden\" name=\"cidade\" value=\"" + cidade + "\"/>";		
		htmlEstado = "<input id=\"campoEstado\" type=\"hidden\" name=\"estado\" value=\"" + estado + "\"/>";
		htmlCEP = "<input id=\"campoCEP\" type=\"hidden\" name=\"cep\" value=\"" + cep + "\"/>";			
		htmlPais = "<input id=\"campoPais\" type=\"hidden\" name=\"pais\" value=\"" + pais + "\"/>";
		htmlTelefoneR = "<input  id=\"campoTelefoneR\" type=\"hidden\" name=\"telefoneR\" value=\"" + telefoneR + "\"/>";
		htmlTelefoneC = "<input  id=\"campoTelefoneC\" type=\"hidden\" name=\"telefoneC\" value=\"" + telefoneC + "\"/>";
		htmlFax = "<input id=\"campoFax\" type=\"hidden\" name=\"fax\" value=\"" + fax + "\"/>";
		htmlInteresse = "<input  id=\"campoInteresse\" type=\"hidden\" name=\"interesse\" value=\"" + interesse + "\"/>";
		htmlProdutos = "<input  id=\"campoProdutos\" type=\"hidden\" name=\"produtos\" value=\"" + produtos + "\"/>";
		htmlSugestao = "<input  id=\"campoSugestao\" type=\"hidden\" name=\"sugestao\" value=\"" + sugestao + "\"/>";
			
		htmlPronto = htmlHead + html1Form + htmlNome + htmlEndereco + htmlBairro + htmlEmail + htmlCidade + htmlEstado + htmlCEP + htmlPais + htmlTelefoneR + htmlTelefoneC + htmlFax + htmlInteresse + htmlProdutos + htmlSugestao + html2Form;	
			
		document.getElementById("divGeral2").innerHTML = htmlPronto;	
		
		document.formCadastro.submit();
		primeiroClique = false;
		mostrarAviso("enviando...", "corpo");
	}
}

function mostrarAviso(msg, lugarId) {
	topoPagina();
	document.getElementById(lugarId).innerHTML = "<center><div class=\"divCarregando\">" + msg + "</div></center>";
}

function paginaProduto(produtoId, codAba) {	
	primeiroClique = true;
	switch(Number(produtoId)) {		
		case 0: {
			novaUrl = "audiReport";
			break;
		}
		case 1: {
			novaUrl = "fonoView";
			break;
		}
		case 2: {
			novaUrl = "avalie";
			break;
		}
		case 3: {
			novaUrl = "pedroNaCasa";
			break;
		}
		case 4: {
			novaUrl = "desafioFonemas";
			break;
		}
		case 5: {
			novaUrl = "voiceReport";
			break;
		}
		case 6: {
			novaUrl = "fonoTools";
			break;
		}
		case 7: {
			novaUrl = "voxGames";			
			break;
		}
		case 8: {
			novaUrl = "fonoFlex";			
			break;
		}
		case 9: {
			novaUrl = "voxMetria";
			break;
		}
		case 10: {
			novaUrl = "fonospeak";
			break;
		}
		case 11: {
			novaUrl = "fisiMetrix";
			break;
		}
		case 12: {
			novaUrl = "earMix";
			break;
		}
		case 13: {
			novaUrl = "pedroParque";
			break;
		}
		case 14: {
			novaUrl = "motrisis";
			break;
		}
		case 15: {
			novaUrl = "vocalgrama";					
			break;
		}
		case 16: {
			novaUrl = "andreaPureAudioUSB";
			break;
		}
		case 22:
		case 17: {
			novaUrl = "memoTraining";					
			break;
		}
		case 18: {
			novaUrl = "triAudi";					
			break;
		}
	}
	if(!novaUrl) {
		reiniciaPagina();	
	} else {
		novaUrl = novaUrl + codAba + ".php?ok=1";	
		if(produtoId==10 && codAba==4) {
			novaUrl = novaUrl + "{carregaPagPrecosProd!" + 	11;
		} else if(produtoId==11 && codAba==3) {
			novaUrl = novaUrl + "{carregaPagPrecosFisiM";			
		} else if(produtoId==12 && codAba==3) { //EARMIX
			novaUrl = novaUrl + "{carregaPagPrecosProd!" + 	15;
		} else if(produtoId==13 && codAba==3) { //PEDRO NO PARQUE
			novaUrl = novaUrl + "{carregaPagPrecosProd!" + 	16;
		} else if(produtoId==14 && codAba==3) { //MOTRISIS
			novaUrl = novaUrl + "{carregaPagPrecosProd!" + 	17;
		} else if(produtoId==15 && codAba==3) { //VOCALGRAMA
			novaUrl = novaUrl + "{carregaPagPrecosProd!" + 	18;
		} else if(produtoId==16 && codAba==3) { //ANDREA ADAPTER + FONO
			novaUrl = novaUrl + "{carregaPagPrecosProd!" + 	19;
		} else if(produtoId==17 && codAba==3) { //MEMO TRAINING
			novaUrl = novaUrl + "{carregaPagPrecosProd!" + 	22;
		} else if(produtoId==18 && codAba==3) { //MEMO TRAINING
			novaUrl = novaUrl + "{carregaPagPrecosProd!" + 	23;
		} else if(codAba==3) {
			novaUrl = novaUrl + "{carregaPagPrecosProd!" + 	produtoId;		
		}

		if(abaId==codAba) {
			if(produtoId>=0) {
				marcarAba(codAba);
				carregarPaginaEm(novaUrl, 'corpoProduto');
			}
		} else {
			marcarAba(codAba);
			carregarPaginaEm(novaUrl, 'corpoProduto');
			abaId = codAba;
		}
	}	
	if(codAba!=null) {
		abaId = codAba;	
	}
}

function abreProduto(produtoId, codPagProd) {
	escondeAjuda();
	scrollTo(0, 0);
	abaId = null;
	switch(produtoId) {
		case 0: {
			url = "audiReport.html";
			break;
		}
		case 1: {
			url = "fonoView.html";
			break;
		}
		case 2: {
			url = "avalie.html";			
			break;
		}
		case 3: {
			url = "pedroNaCasa.html";
			break;
		}
		case 4: {
			url = "desafioFonemas.html";
			break;
		}
		case 5: {
			url = "voiceReport.html";
			break;
		}
		case 6: {
			url = "fonoTools.html";
			break;
		}
		case 7: {
			url = "voxGames.html";			
			break;
		}
		case 8: {
			url = "fonoFlex.html";			
			break;
		}
		case 9: {
			url = "voxMetria.html";
			break;
		}
		case 10: {
			url = "fonospeak.html";
			break;
		}
		case 11: {
			url = "fisiMetrix.html";
			break;
		}
		case 12: {
			url = "earMix.html";
			break;
		}
		case 13: {
			url = "pedroParque.html";
			break;
		}
		case 14: {
			url = "motrisis.html";
			break;
		}
		case 15: {
			url = "vocalgrama.html";					
			break;
		}
		case 16: {
			url = "andreaPureAudioUSB.html";					
			break;
		}
		case 17: {
			url = "memoTraining.html";					
			break;
		}
		case 18: {
			url = "triAudi.html";					
			break;
		}
		default: {
			url = "home.html";
		}
	}
	if(url=="home.html") {
		carregaPagina(url);
	} else {
		if(codPagProd!=null) {
			carregaPagina(url + "{paginaProduto!" + produtoId + "&" + codPagProd);	
		} else {
			carregaPagina(url + "{paginaProduto!" + produtoId + "&1");	
		}
	}
}

function abreProdutoDown(produtoId) {
	switch(produtoId) {		
		case 0: {
			url = "audiReport.html";			
			break;
		}
		case 1: {
			url = "fonoView.html";			
			break;
		}
		case 2: {
			url = "avalie.html";			
			break;
		}
		case 3: {
			url = "pedroNaCasa.html";
			break;
		}
		case 4: {
			url = "desafioFonemas.html";
			break;
		}
		case 5: {
			url = "voiceReport.html";
			break;
		}
		case 6: {
			url = "fonoTools.html";
			break;
		}
		case 7: {
			url = "voxGames.html";			
			break;
		}
		case 8: {
			url = "fonoFlex.html";			
			break;
		}
		case 9: {
			url = "voxMetria.html";
			break;
		}
		case 10: {
			url = "fonospeak.html";
			break;
		}
		case 11: {
			url = "fisiMetrix.html";
			break;
		}
		case 12: {
			url = "earMix.html";
			break;
		}
		case 13: {
			url = "pedroParque.html";
			break;
		}
		case 14: {
			url = "motrisis.html";
			break;
		}
		case 15: {
			url = "vocalgrama.html";
			break;
		}
		case 16: {
			url = "andreaPureAudioUSB.html";					
			break;
		}
		case 17: {
			url = "memoTraining.html";					
			break;
		}
		case 18: {
			url = "triAudi.html";					
			break;
		}
	}	
	carregaPagina(url + "{paginaProduto!" + produtoId + "&4");	
}

function abreAbaProdut(produtoId, aba) {
	switch(produtoId) {		
		case 0: {
			url = "audiReport.html";			
			break;
		}
		case 1: {
			url = "fonoView.html";			
			break;
		}
		case 2: {
			url = "avalie.html";			
			break;
		}
		case 3: {
			url = "pedroNaCasa.html";
			break;
		}
		case 4: {
			url = "desafioFonemas.html";
			break;
		}
		case 5: {
			url = "voiceReport.html";
			break;
		}
		case 6: {
			url = "fonoTools.html";
			break;
		}
		case 7: {
			url = "voxGames.html";			
			break;
		}
		case 8: {
			url = "fonoFlex.html";			
			break;
		}
		case 9: {
			url = "voxMetria.html";
			break;
		}
		case 10: {
			url = "fonospeak.html";
			break;
		}
		case 11: {
			url = "fisiMetrix.html";
			break;
		}
		case 12: {
			url = "earMix.html";
			break;
		}
		case 13: {
			url = "pedroParque.html";
			break;
		}
		case 14: {
			url = "motrisis.html";
			break;
		}
		case 15: {
			url = "vocalgrama.html";
			break;
		}
		case 16: {
			url = "andreaPureAudioUSB.html";					
			break;
		}
		case 17: {
			url = "memoTraining.html";					
			break;
		}
		case 18: {
			url = "triAudi.html";					
			break;
		}
	}	
	carregaPagina(url + "{paginaProduto!" + produtoId + "&" + aba);	
}

function carregaPagProd(produtoId) {

	if(produtoId!=12) {
			if(formataDinheiro(arrConfigProdutos[produtoId][4])!=null) {				
				valorBase = formataDinheiro(arrConfigProdutos[produtoId][4]);	

				if(Number(arrConfigProdutos[produtoId][8])==0) {
					if(document.getElementById("campoValor1")!=null) {
						document.getElementById("campoValor1").innerHTML = "<span class=\"fonte21\" style=\"font-size:15px;color:#0066CC\">R$ " + valorBase + " &agrave; vista</span>";				
					}

					//document.getElementById("par"+i).innerHTML = "R$ " + formataDinheiro(arredondar(calcularValorTabela(valorBase, jTabProd, i)/i, 2));
					//document.getElementById("total"+i).innerHTML = "R$ " + formataDinheiro(calcularValorTabela(valorBase, jTabProd, i));
					jTabProd = Number(arrConfigProdutos[produtoId][11].split("/")[1]);	
					maxParcBoleto = 4;
					for(contParc=4;contParc>1;contParc--) {
						if(arredondar(calcularValorTabela(Number(arrConfigProdutos[produtoId][4]), jTabProd, contParc)/contParc, 2)<50) {
							maxParcBoleto = contParc-1;
						}
					}

					document.getElementById("tdAPrazo4").innerHTML = "ou até " + maxParcBoleto + "x de R$ " + formataDinheiro(arredondar(calcularValorTabela(Number(arrConfigProdutos[produtoId][4]), jTabProd, maxParcBoleto)/maxParcBoleto, 2)) + " (boleto banc&aacute;rio)";
					document.getElementById("tdAPrazo6").innerHTML = "ou até 6x de R$ " + formataDinheiro(arredondar(calcularValorTabela(Number(arrConfigProdutos[produtoId][4]), jTabProd, 6)/6, 2)) + " (apenas cart&atilde;o) <img src=\"images/visa.jpg\" width=\"22\" height=\"14\">&nbsp;<img src=\"images/mastercard.jpg\" width=\"22\" height=\"14\"></span>";
					
					
					/*
					for(i=4;i>0;i--) {
						if(Number(arrConfigProdutos[produtoId][3+i])!=0) {			
							if(i==1) {					
								document.getElementById("tdAPrazo").innerHTML = "&nbsp;";
							} else {
								document.getElementById("campoMaxVezes").innerHTML = i;
								document.getElementById("campoMaxValorPrazo").innerHTML = formataDinheiro(arrConfigProdutos[produtoId][3+i]);
			
							}
							break;
						}
					}		
					*/
					document.getElementById("tdImgPromocao").className = "tabInvisivel";
					
				} else {
					/*
					PROMOÇÃO
					*/
				}			
			} else {
				//iniciaSite(produtoId, 1);
			}
		//} catch(e) {
			//alert("Ocorreu algum erro inesperado! Clique novamente no item desejado!\n" + e);	
			//carregaPagProd(produtoId);
			//alert(e);
		//}
	}
}

function carregarProdutos(cod) {	
	if(cod==0) {
		for(i=0;i<totalProdFono;i++) {
			document.getElementById("lin"+i).className = "trVisivel";
		}	
		document.getElementById("prodDesenv").className = "tabInvisivel";
	} else {
		for(i=0;i<totalProdFono;i++) {
			document.getElementById("lin"+i).className = "tabInvisivel";
		}	
		if(fonoCategorias[cod-1].length>0) {
			document.getElementById("prodDesenv").className = "tabInvisivel";
			cont = 0;										
			for(i=0;i<totalProdFono;i++) {
				ok = false;
				for(iProd=0;iProd<fonoCategorias[cod-1].length;iProd++) {
					if(fonoCategorias[cod-1][iProd]==i) {
						document.getElementById("lin"+i).className = "trVisivel";
						ok = true;
						break;
					}
				}
			}
		} else {
			document.getElementById("prodDesenv").className = "trVisivel";
		}
	}
}

function carregarAtualizacoes(arrProdSel) {
	if(arrProdSel.length>0) {								
		for(i=1;i<=totalLinhasAtual;i++) {									
			ok = false;
			for(iProd=0;iProd<arrProdSel.length;iProd++) {	
				if(arrProdSel[iProd]==i) {
					if(document.getElementById("lin"+i)!=null) {
						document.getElementById("lin"+i).className = "trVisivel";
					}
					ok = true;
					break;
				}				
			}
			if(!ok) {
				if(document.getElementById("lin"+i)!=null) {
					document.getElementById("lin"+i).className = "tabInvisivel";
				}
			}
		}
	} else {
		if(arrChecked>0) {
			for(i=1;i<=totalLinhasAtual;i++) {
				//deletarComponente("lin"+i);
				if(document.getElementById("lin"+i)!=null) {
					document.getElementById("lin"+i).className = "tabInvisivel";
				}
			}
		} else {
			//document.getElementById(idLugar).innerHTML = "";
		}
	}
}

/*
	 0-parcelamento
	 1-forma pagamento
	 2-opcao de correio
	 3-sedex convencional (pagamento foi sedex a cobrar)
*/

function mostraAjuda(codAjuda, event) {	
	var alturaDiv = 0;
	codAjuda = Number(codAjuda);
	ok = false;
	
	switch(codAjuda) {
		case 0: {
			titulo = "Parcelas";
			texto = "Se você comprar apenas um produto o valor das parcelas é calculado baseado em uma tabela para cada produto.";
			texto += "<br><br>Na compra de produtos diferentes ";
			alturaDiv = 160;
			break;
		}
		case 1: {			
			titulo = "Formas de pagamento";
			texto = "";
			texto += "<strong>Boleto Bancário:</strong><br>";
			texto += "Emita o boleto bancário diretamente através do site, imprima-o e pague-o em qualquer agência bancária ou casa lotérica até a data de vencimento.  Aguardaremos que o valor seja compensado (o que pode demorar até 4 dias úteis), para enviarmos seu pedido para o endereço especificado.<br><br>";
			texto += "<strong>Depósito Bancário:</strong><br>";
			texto += "Realize o depósito bancário em nossa conta corrente, e depois envie o comprovante por fax. Caso o depósito seja em cheque, aguardaremos a compensação para enviar os produtos.<br><br>";	
			texto += "<strong>Sedex à Cobrar</strong><br>";
			texto += "Você terá cinco dias corridos a contar da data de emissão do aviso, para ir até a agência de correios mais próxima ao endereço especificado (endereço de sua casa  ou de sua clínica), fazer a retirada do produto e o pagamento da primeira parcela diretamente ao agente dos Correios.<br><br>";	
			texto += "<strong>Cartão de Crédito (apenas VISA e MASTERCARD)</strong><br>";
			texto += "Nos pedidos parcelados no cartão de crédito, observe o valor de seu limite. Ele deve ser maior que o valor total deste pedido, não importando o valor de cada parcela.<br><br>";
			//document.getElementById("divGeral2").style.height = 260 + "px";
			alturaDiv = 375;
			ok = true;
			break;
		}
		case 2: {
			if(ie) {
				versaoIE = versao.substring(versao.indexOf("MSIE")+5, versao.length);
				versaoIE = versaoIE.split(";");
				versaoIE = Math.floor(Number(versaoIE[0]));
				if(versaoIE<7) {
					document.getElementById("txtEstado").style.visibility = "hidden";
				}
			}
			titulo = "Formas de envio";
			texto = "<br>";
			texto += "<strong>Sedex convencional</strong><br><br>";
			texto += "Sedex (Serviço de Encomenda Expressa) é um serviço da Empresa Brasileira de Correios e Telégrafos de despacho expresso de correspondências, documentos e objetos.<br>";	
			texto += "O valor do SEDEX varia de acordo com o estado ao qual será enviado o pedido.<br><br>";
			texto += "<strong>Encomenda (PAC)</strong><br><br>";
			texto += "É o serviço de encomenda da linha econômica para o envio exclusivo de mercadoria. Os prazos de entrega variam de acordo com as localidades de origem e destino (10 a 15 dias).<br><br>";			
			
			alturaDiv = 260;
			ok = true;
			break;
		}
		case 3: {
			
			titulo = "Sedex";
			texto = "Se você selecionou a forma de pagamento SEDEX À COBRAR, a forma de envio será por SEDEX, serviço disponibilizado pelos Correios.<br><br>";
			if(ie) {
				versaoIE = versao.substring(versao.indexOf("MSIE")+5, versao.length);
				versaoIE = versaoIE.split(";");
				versaoIE = Math.floor(Number(versaoIE[0]));
				if(versaoIE<7) {
					document.getElementById("txtEstado").style.visibility = "hidden";
				}
			}
			alturaDiv = 100;
			ok = true;			
			break;
		}
		case 4: {
			titulo = "Formas de envio";
			texto = "<br>";
			texto += "<strong>Sedex convencional</strong><br><br>";
			texto += "Sedex (Serviço de Encomenda Expressa) é um serviço da Empresa Brasileira de Correios e Telégrafos de despacho expresso de correspondências, documentos e objetos.<br>";	
			texto += "O valor do SEDEX varia de acordo com o estado ao qual será enviado o pedido.<br><br>";
			texto += "<strong>Encomenda (PAC)</strong><br><br>";
			texto += "É o serviço de encomenda da linha econômica para o envio exclusivo de mercadoria. Os prazos de entrega variam de acordo com as localidades de origem e destino (10 a 15 dias).<br><br>";			
			texto += "<strong>Donwload</strong><br><br>";
			texto += "O software é baixado diretamente de nosso site e instalado em seu computador. Você não receberá o CD-ROM e o manual impresso, porém o produto é exatamente o mesmo que o enviado pelo correio.<br><br>";				
			if(ie) {
				versaoIE = versao.substring(versao.indexOf("MSIE")+5, versao.length);
				versaoIE = versaoIE.split(";");
				versaoIE = Math.floor(Number(versaoIE[0]));
				if(versaoIE<7) {
					document.getElementById("txtEstado").style.visibility = "hidden";
				}
			}			
			
			alturaDiv = 340;
			ok = true;
			break;
		}
		
		case 5: {
			titulo = "Código de Segurança do Cartão";
			//texto = "<br>";
			texto = "";
			texto += "<strong>O que é?</strong><br><br>";
			texto += "O código de segurança do cartão de crédito é uma sequência numérica complementar ao número do cartão, que garante a veracidade dos dados de uma transação eletrônica, uma vez que essa informação é verificada somente pelo portador do cartão e não consta em nenhum tipo de leitura magnética.<br><br>Por recomendação da sua Administradora de Cartões, esta informação é utilizada para complementar o processo de compra.<br><br>";
			texto += "<strong>Onde está localizado?</strong><br><br>";
			texto += "O código de segurança dos cartões está localizado no verso do cartão e corresponde aos três últimos dígitos da faixa numérica.<br><br><center><img name=\"imgProd\" width=\"299px\" height=\"43px\" src=\"images/CodSegCartao.gif\"></center>";			
			if(ie) {
				versaoIE = versao.substring(versao.indexOf("MSIE")+5, versao.length);
				
				versaoIE = versaoIE.split(";");
				versaoIE = Math.floor(Number(versaoIE[0]));
				if(versaoIE<7) {
					document.getElementById("txtMesVal").style.visibility = "hidden";
					document.getElementById("txtAnoVal").style.visibility = "hidden";
				}
			}
			//document.getElementById("divGeral2").style.height = 340 + "px";
			alturaDiv = 350;
			ok = true;
			break;
		}
		
	}
	document.getElementById("divGeral2").style.height = alturaDiv + "px";
	if(ok) {
		html = "<table style=\"border: 3px solid #B6CEE7\" width=\"100%\" height=\"100%\" align=\"center\" cellpadding=\"0\" cellspacing=\"10\"><tr><td id=\"nomeProd\" width=\"264\" height=\"20\" align=\"left\" class=\"fonte21 tdSeparadorBottom\">" + titulo + "</td></tr><tr><td id=\"desProd\" height=\"36\" align=\"left\" class=\"fonte22\">" + texto + "</td></tr></table>";
			
		document.getElementById("divGeral2").className = "divAjuda";  		
		document.getElementById("divGeral2").innerHTML = html;
		
		yTopo = ((document.documentElement && document.documentElement.scrollTop) ? document.documentElement.scrollTop : document.body.scrollTop);
		
		document.getElementById("divGeral2").style.width = 400 + "px";
		document.getElementById("divGeral2").style.left = (Math.floor((wRes-800)/2) + 200) + "px";
		document.getElementById("divGeral2").style.top = (yTopo+Math.floor(hTela/2)-(alturaDiv/2) + 20) + "px";
		document.getElementById("divGeral2").style.visibility = "visible";	
	}
}

var tempCodHTML = "";

function mostraAjudaEspecial(codAjuda) {
	switch(codAjuda) {
		case 0: {
			tempCodHTML = document.getElementById("tdMostraProd").innerHTML;		
			titulo = "Licenças de uso";
			texto = "Ao adquirir o produto você tem direito a uma senha principal (para um computador) e terá direito a uma senha reserva (como garantia para o caso de ocorrer algum problema no computador onde o software foi instalado).<br><br>";		
			texto += "Se você quiser utilizar esta senha reserva para instalar em um outro micro (Ex. um laptop), você pode, porém lembramos que se ocorrer algum problema em um dos dois computadores (furto, pane elétrica, ou um problema que impossibilite de que o mesmo possa ser utilizado), você não receberá uma terceira senha gratuitamente e perderá o direito de uso do software no micro que ocorreu o problema.";
			document.getElementById("tdMostraProd").innerHTML = "<table style=\"border: 0px solid #B6CEE7\" width=\"100%\" height=\"181px\" align=\"center\" cellpadding=\"0\" cellspacing=\"10\"><tr><td id=\"nomeProd\" width=\"264\" height=\"20\" align=\"left\" class=\"fonte21 tdSeparadorBottom\">" + titulo + "</td></tr><tr><td id=\"desProd\" height=\"36\" align=\"left\" class=\"fonte22\">" + texto + "</td></tr></table>" ;
			break;
		}
	}
}

function escondeAjudaEspecial(codAjuda) {
	switch(codAjuda) {
		case 0: {
			document.getElementById("tdMostraProd").innerHTML = tempCodHTML;
			tempCodHTML = "";
			break;
		}
	}
}

function escondeAjuda() {
	try {
		document.getElementById("divGeral2").className = "tabInvisivel";	
	} catch(e) {}	
	
	if(ie) {
		versaoIE = versao.substring(versao.indexOf("MSIE")+5, versao.length);
		versaoIE = versaoIE.split(";");
		versaoIE = Math.floor(Number(versaoIE[0]));
		if(versaoIE<7) {
			try {
				document.getElementById("txtEstado").style.visibility = "visible";
			} catch(e) {}
			try {
				document.getElementById("txtMesVal").style.visibility = "visible";
				document.getElementById("txtAnoVal").style.visibility = "visible";
			} catch(e) {}
		}
	}
}

function fechaHintProd(codProd) {
	document.getElementById("divGeral2").className = "tabInvisivel";
	abreProduto(codProd);	
}

function mostraHint(texto, event, larguraHint) {
	document.getElementById("divGeral2").style.height = 19 + "px";
	if(larguraHint!=null) {
		document.getElementById("divGeral2").style.width = larguraHint + "px";
	} else {
		document.getElementById("divGeral2").style.width = 250 + "px";
	}

	html = "<table align=\"center\"><tr><td class=\"fonte22\" valign=\"middle\"><center>" + texto + "</center></td></tr></table>";
			
	document.getElementById("divGeral2").className = "divHint";
	document.getElementById("divGeral2").innerHTML = html;
	
	yTopo = ((document.documentElement && document.documentElement.scrollTop) ? document.documentElement.scrollTop : document.body.scrollTop);
	document.getElementById("divGeral2").style.left = (event.clientX - 30) + "px";
	document.getElementById("divGeral2").style.top = (yTopo + event.clientY + 21) + "px";
	document.getElementById("divGeral2").style.visibility = "visible";
}