// JavaScript Document
	function envSelect(cont, valor, operacao, variavel, label){
		if (valor.length == 0){
			alert('O campo ' + label + ' não foi preenchido!');
		} else {
			if (cont == 1){
				// vindo direto do campo // envia com enter
				if (event.keyCode == 13) {
					location = "../../ServClienteJur?operacao=" + operacao + "&" + variavel + "="+ valor;
					return true;
				} else {
					return false;
				}
			}
			if (cont == 2){
				location = "../../ServClienteJur?operacao=" + operacao + "&" + variavel + "="+ valor;
			}
		}		
	}
	function validaCheck(tCliente, check) {
		if (tCliente ==1){
			if(check.checked == true){
				formJur.emiteNota.value = 1;
			}else{
				formJur.emiteNota.value = 0;
			}
		} else if (tCliente == 2){
			if(check.checked == true){
				formFisico.emiteNota.value = 1;
			}else{
				 formFisico.emiteNota.value = 0;
			}
		}
	}
	function mostraDiv(controle, foco, idDiv){
		var visib = "visible";
		if (controle == 1){
			document.getElementById(idDiv).style.visibility = visib;
		} else {
			visib = "hidden";
			document.getElementById(idDiv).style.visibility = visib;
			foco;
		}
	}
	function redir(redir){
		location = redir;
	}
	function abrePopCanto(redir, name, config){
		window.open(redir,name,config);
		window.opener = window;
		//window.close('#');
	}
	function abrePop(redir, name, w, h, scrol, tools) {
		tools = tools + ', ';
		var wL = (screen.width - w) / 2;
		var wT = (screen.height - h) / 2;
		winProps = tools + 'height='+h+',width='+w+',top='+wT+',left='+wL+',scrollbars='+scrol;
		win = window.open(redir, name, winProps);
		//window.close('#');
		if (parseInt(navigator.appVersion) >= 4) {
			win.window.focus();
		}
	}
	function atualizaFrame(){
		//Atualiza frame pai
		parent.location.reload();
	}
	function menu(m1){
		var visib = "visible";
		var hVisib = "hidden";
		if(document.getElementById(m1).style.visibility == hVisib){
			document.getElementById(m1).style.visibility = visib;
		} else if (document.getElementById(m1).style.visibility == visib){
			document.getElementById(m1).style.visibility = hVisib;
		}
	}//Function
	function envEnter() {
		if (event.keyCode == 13) {
			document.f-distr.submit();
			return true;
		} else {
			return false;
		}
	}
	//confirma
	function confirma(msg,redir){
		if (confirm (msg)){
			location = redir;
		}
	}
	//radio button
	function alterRadio(id){
		id.cheked = false;
	}
	
	function visibLancamento(){
		document.getElementById('tdLancamento').style.visibility = 'visible';
		document.getElementById('tdLancamento').innerHTML = "" + 
		
		"<table width='500' border='0' cellspacing='2'><tr>" +
		"<td width='240'><table width='241' border='0' cellspacing='2'><tr>" +
		"<td width='235'  onClick=redir('produtos/porta_fus.html'); " + 
		"style='cursor:pointer'>Novos conectores. C&oacute;digos 730/732/733<br>" + 
		"Clique aqui para maiores detalhes.</td></tr>"+
		"</table></td>" +
		"<td width='250' bgcolor='#006666'>" + 
		"<img src='../_img/produtos/fotos/porta_fus/CLYM-730.jpg' width='80' height='92'></td>" +
		"<td bgcolor='#006666'><img src='../_img/home/CLYM-732.jpg' width='90' height='92'></td>"+
		"<td bgcolor='#006666'><img src='../_img/home/CLYM-733.jpg' width='70' height='92'></td>"+
		"</tr></table>";
}

