<!--

function fValidaNecessidade()
{
	var vForm=document.frmSuaNecessidade;
	
	if(vForm.txtNome.value=="")
	{
		alert("Digite o nome!");
		vForm.txtNome.focus();
		return false;
	}
	if(vForm.txtEmail.value=="")
	{
		alert("Digite o e-mail!");
		vForm.txtEmail.focus();
		return false;
	}
	if(vForm.txtTelefone.value=="")
	{
		alert("Digite o telefone!");
		vForm.txtTelefone.focus();
		return false;
	}
	if(vForm.txtDescricao.value=="")
	{
		alert("Digite a descrição!");
		vForm.txtDescricao.focus();
		return false;
	}
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function SendMe()
{
	var opt;
	if(document.frmVendas.txtHRegiao.value=='')
	{

		if(document.frmVendas.txtRegiao[0].checked==true)
		{
			opt=document.frmVendas.txtRegiao[0].value;
		}
		else if(document.frmVendas.txtRegiao[1].checked==true)
		{
			opt=document.frmVendas.txtRegiao[1].value;
		}
		else if(document.frmVendas.txtRegiao[2].checked==true)
		{
			opt=document.frmVendas.txtRegiao[2].value;
		}
		else if(document.frmVendas.txtRegiao[3].checked==true)
		{
			opt=document.frmVendas.txtRegiao[3].value;
		}
		else if(document.frmVendas.txtRegiao[4].checked==true)
		{
			opt=document.frmVendas.txtRegiao[4].value;
		}
		else if(document.frmVendas.txtRegiao[5].checked==true)
		{
			opt=document.frmVendas.txtRegiao[5].value;
		}
		else if(document.frmVendas.txtRegiao[6].checked==true)
		{
			opt=document.frmVendas.txtRegiao[6].value;
		}
	}
	else
	{
		opt=document.frmVendas.txtHRegiao.value;
	}

	if(document.frmVendas.txtU.value=='')
	{
	  var uf='';
	}
	else
	{
	  var uf=document.frmVendas.txtU.value;
	}

	var where_to = document.frmVendas.vendas.options[document.frmVendas.vendas.selectedIndex].value;
	if(where_to != '')
	{
		if(opt==2)
		{
			var tmp=where_to;
			if(tmp.slice(23,tmp.indexOf('&',23))==13)
			{
			   where_to=tmp.replace('vend_pesq.asp','vend_ini_terrenos.asp');
			}
		}
	
	   if(uf!='' || uf!='undefined')
	   {
	      location = where_to + "&r=" + opt + "&u=" + uf;
	   }
	   else
	   {
	      location = where_to + "&r=" + opt;
	   }	   
	 }
	return false
}

function SendMeLoc()
{
	var opt;
	if(document.frmLocacao.txtHRegiao.value=='')
	{

		if(document.frmLocacao.txtRegiao[0].checked==true)
		{
			opt=document.frmLocacao.txtRegiao[0].value;
		}
		else if(document.frmLocacao.txtRegiao[1].checked==true)
		{
			opt=document.frmLocacao.txtRegiao[1].value;
		}
		else if(document.frmLocacao.txtRegiao[2].checked==true)
		{
			opt=document.frmLocacao.txtRegiao[2].value;
		}
		else if(document.frmLocacao.txtRegiao[3].checked==true)
		{
			opt=document.frmLocacao.txtRegiao[3].value;
		}
		else if(document.frmLocacao.txtRegiao[4].checked==true)
		{
			opt=document.frmLocacao.txtRegiao[4].value;
		}
		else if(document.frmLocacao.txtRegiao[5].checked==true)
		{
			opt=document.frmLocacao.txtRegiao[5].value;
		}
		else if(document.frmLocacao.txtRegiao[6].checked==true)
		{
			opt=document.frmLocacao.txtRegiao[6].value;
		}
	}
	else
	{
		opt=document.frmLocacao.txtHRegiao.value;
	}

	if(document.frmLocacao.txtU.value=='')
	{
	  var uf='';
	}
	else
	{
	  var uf=document.frmLocacao.txtU.value;
	}


	var where_to = document.frmLocacao.locacao.options[document.frmLocacao.locacao.selectedIndex].value;
		if (where_to != '')
		{
		   if(uf!='')
		   {
			  location = where_to + "&r=" + opt + "&u=" + uf;
		   }
		   else
		   {
			  location = where_to + "&r=" + opt;
		   }	   
		}
	return false
}


function SendMeTemporada()
{
	var opt;
	if(document.frmVendas.txtHRegiao.value=='')
	{

		if(document.frmVendas.txtRegiao[0].checked==true)
		{
			opt=document.frmVendas.txtRegiao[0].value;
		}
		else if(document.frmVendas.txtRegiao[1].checked==true)
		{
			opt=document.frmVendas.txtRegiao[1].value;
		}
		else if(document.frmVendas.txtRegiao[2].checked==true)
		{
			opt=document.frmVendas.txtRegiao[2].value;
		}
		else if(document.frmVendas.txtRegiao[3].checked==true)
		{
			opt=document.frmVendas.txtRegiao[3].value;
		}
		else if(document.frmVendas.txtRegiao[4].checked==true)
		{
			opt=document.frmVendas.txtRegiao[4].value;
		}
		else if(document.frmVendas.txtRegiao[5].checked==true)
		{
			opt=document.frmVendas.txtRegiao[5].value;
		}
		else if(document.frmVendas.txtRegiao[6].checked==true)
		{
			opt=document.frmVendas.txtRegiao[6].value;
		}
	}
	else
	{
		opt=document.frmVendas.txtHRegiao.value;
	}

	if(document.frmVendas.txtU.value=='')
	{
	  var uf='';
	}
	else
	{
	  var uf=document.frmVendas.txtU.value;
	}

	var where_to = document.frmVendas.vendas.options[document.frmVendas.vendas.selectedIndex].value;
	if(where_to != '')
	{
		if(opt==2)
		{
			var tmp=where_to;
			if(tmp.slice(23,tmp.indexOf('&',23))==13)
			{
			   where_to=tmp.replace('temporada_pesq.asp','vend_ini_terrenos.asp');
			}
		}
	
	   if(uf!='' || uf!='undefined')
	   {
	      location = where_to + "&r=" + opt + "&u=" + uf;
	   }
	   else
	   {
	      location = where_to + "&r=" + opt;
	   }	   
	 }
	return false
}

function Ordena(tp)
{
var where_to = document.forms[1].order.options[document.forms[1].order.selectedIndex].value;
	if (tp==1 ){
	if (where_to != "value") location = where_to + "&optTpOrder=desc"
	return false
	}
	else {
	if (tp==2){
	 if (where_to != "value") location = where_to
	return false
	}
}
}

function fEnviar(setor,atendente)
{
var varLocal = 'atendimento.asp?opt=alterasetor&idSetor='+setor+'&idAtendente='+atendente;

			 document.frmGeral.action=varLocal;
		     document.frmGeral.method="post";
			 document.frmGeral.submit();
	   	     return false
}

function Imprimir() {
  var mac = (navigator.userAgent.indexOf("Mac") != -1); 
  var doc = (document.all) ? 1 : 0;
  var ie_ns = (window.print) ? 1 : 0;

  if (ie_ns)     			// Se for netscape 4 ou ie5
    window.print();
  else if (doc && !mac)     // Se for ie4
    vbPrintPage()
  else     					// Outros
    alert("Opção não suportada pela navegador ");
    return false;
}


function fCarregaLancamento(varID)
{
	if(varID!=0)
	{
		var varUrl='lancamento/lancamento_view.asp?id='+varID;
		MM_openBrWindow(varUrl,'jLancamento','width=300,height=500');
	}
}

function fMapa(varUrl,vW,vH)
{
	if(varUrl!='')
	{
	   window.open(varUrl,'jMapa','width='+vW+',height='+vH);	   
	}
}

function fFiltrarPorUF()
{
	var vForm=document.frmFiltroTopo;
	var vUF=vForm.txtUF.options[vForm.txtUF.selectedIndex].value;
	alert(vUF);	
}


function fFiltrarPorCidade()
{
	var vForm=document.frmFiltroTopo;
	var vCidade=vForm.txtCidade.options[vForm.txtCidade.selectedIndex].value;
	alert(vCidade);	
}

function fAbrirJanela(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}
//-->