// JavaScript Document
menuL = {
	indexBairro : 0,
	carregaBairros : function(idCidade,indexBairro){
		if(idCidade!=''){
			menuL.indexBairro=indexBairro;
			_inc_menuLeft.carregaBairrosDT(idCidade,menuL.carregaBairrosDrop);
		}
	},
	
	carregaBairrosDrop : function(retorno){
		var dt = retorno.value;
		if(dt!=null && typeof(dt) == "object"){
			var drop = document.getElementById('dropBuscaBairro');
			drop.length = 1;
			for(i=0;i<dt.Rows.length;i++){
				var row = dt.Rows[i];
				var novo = document.createElement("option");
			    novo.setAttribute("id", "opcoes");
			    novo.value = i;
			    novo.text  = row.bairro;
				if(menuL.indexBairro==i){
					novo.select = true;
				}
				drop.options.add(novo);
			}			
		}
		document.getElementById('dropBuscaBairro').value=menuL.indexBairro;
	},
	
	enviaBuscaAvancada : function(){
		var dropBuscaCidade = document.getElementById('menuLeft_dropBuscaCidade').value;
		var dropBuscaBairro = document.getElementById('dropBuscaBairro').value;
		var DropBuscaTipoImovel = document.getElementById('DropBuscaTipoImovel').value;
		var DropBuscaArea = document.getElementById('DropBuscaArea').value;
		var DropBuscaObra = document.getElementById('DropBuscaObra').value;
		var DropBuscaPreco = document.getElementById('DropBuscaPreco').value;
		var DropBuscaDorm = document.getElementById('DropBuscaDorm').value;
		var busca =  'busca_avancada.aspx?c=' + dropBuscaCidade;
		busca +=  '&b=' + dropBuscaBairro;
		busca +=  '&t=' + DropBuscaTipoImovel;
		busca +=  '&a=' + DropBuscaArea;
		busca +=  '&o=' + DropBuscaObra;
		busca +=  '&p=' + DropBuscaPreco;
		busca +=  '&d=' + DropBuscaDorm;
		
		window.location.href = busca
	},
	
	nomeCadastro : '',
	emailCadastro : '',
	
	validaCadastro : function(){
		menuL.nomeCadastro = document.getElementById('txtNomeCadastro').value;
		menuL.emailCadastro = document.getElementById('txtEmailCadastro').value;
		
		if(menuL.nomeCadastro=='' || menuL.nomeCadastro=='nome')
			return 'Preencha o campo nome corretamente';
		if(FuncoesGerais.ValidaEmail(menuL.emailCadastro)==0)
			return 'Preencha o campo e-mail corretamente';
			
		return 'ok';
	},
	
	enviaCadastro : function(){
		var validado = menuL.validaCadastro();
		if(validado=='ok'){
			if(isNaN(classCadastro.inseri(menuL.nomeCadastro,menuL.emailCadastro).value)){
				document.getElementById('divFormNewsStatusMensagem').innerHTML = 'Essa e-mail já foi cadastrado';
				document.getElementById('divFormNewsStatusMensagem').style.color = '#9d2828';
				document.getElementById('divFormNewsStatusVoltar').style.display = '';
				document.getElementById('divFormNewsStatus').style.display = '';
				document.getElementById('divFormNews').style.display = 'none';
			}else{
				document.getElementById('divFormNewsStatusMensagem').innerHTML = 'Obrigado, seu cadastro foi realizado com sucesso.';
				document.getElementById('divFormNewsStatusMensagem').style.color = 'black';
				document.getElementById('divFormNewsStatusVoltar').style.display = 'none';
				document.getElementById('divFormNewsStatus').style.display = '';
				document.getElementById('divFormNews').style.display = 'none';
			}
		}else{
			document.getElementById('divFormNewsStatusMensagem').innerHTML = validado;
			document.getElementById('divFormNewsStatusMensagem').style.color = '#9d2828';
			document.getElementById('divFormNewsStatusVoltar').style.display = '';
			document.getElementById('divFormNewsStatus').style.display = '';
			document.getElementById('divFormNews').style.display = 'none';
		}
	},
	
	voltarCadastro : function(){
		document.getElementById('divFormNewsStatus').style.display = 'none';
		document.getElementById('divFormNews').style.display = '';
	},
	
	carregaCidades : function(uf,dropDestino){
		var drop = document.getElementById(dropDestino);
		drop.length = 0;
		if(uf!=''){
			var dt = _inc_menuLeft.carregaCidades(uf).value;
			if(dt!=null && typeof(dt) == "object"){
				for(i=0;i<dt.Rows.length;i++){
					var row = dt.Rows[i];
					var novo = document.createElement("option");
					novo.setAttribute("id", "opcoes");
					novo.value = row.cidade;
					novo.text  = row.cidade;
					drop.options.add(novo);
				}			
			}
		}
	},
	
	emailEnviaAteEmail : '',
	
	abreAtendimentoEmail : function(){
		try{_ME.track('even_atendimento-online_email');}catch (e){}
		if(document.getElementById('hidIdEmpreendimento')){
			idEmpreendimento = document.getElementById('hidIdEmpreendimento').value;
			var rateio = FG.buscaParametro('rat');
			var dt =null;
			var tipo = '';
			if(rateio==1){
				dt = _inc_menuLeft.carregaAtendimento(idEmpreendimento,'EMAILRAT').value;
				tipo='rat';
				if(dt.Rows.length==0){
					dt = _inc_menuLeft.carregaAtendimento(idEmpreendimento,'EMAIL').value;
					tipo='email';
				}
			}else{
				//dt = _inc_menuLeft.carregaAtendimento(idEmpreendimento,'EMAILRATPESO').value;
				//tipo='peso';
				//if(dt.Rows.length==0){
					//dt = _inc_menuLeft.carregaAtendimento(idEmpreendimento,'EMAILRAT').value;
					//tipo='rat';
					//if(dt.Rows.length==0){
						dt = _inc_menuLeft.carregaAtendimento(idEmpreendimento,'EMAIL').value;
						tipo='email';
					//}
				//}
			}
		
				
			if(dt!=null && typeof(dt) == "object"){
				var row = dt.Rows[0];
				if(row.atendimento.toString().indexOf('http:')!=-1){
					FG.popup(row.atendimento,570,605,'EVEN');
				}else{
					lightbox.abrir('divLightboxAtendimentoOnline');
					menuL.emailEnviaAteEmail = row.atendimento;
				}
			}
		}else
			lightbox.abrir('divLightboxAtendimentoOnline');
	},
	
	
	
	NomeAteEmail : '',
	EmailAteEmail : '',
	TelefoneAteEmail : '',
	EstadoAteEmail : '',
	CidadeAteEmail : '',
	EmpreendimentoAteEmail : '',
	AssuntoAteEmail : '',
	MensagemAteEmail : '',
	
	validaAteEmail : function(){
		menuL.NomeAteEmail = document.getElementById('txtNomeAteEmail').value;
		menuL.EmailAteEmail = document.getElementById('txtEmailAteEmail').value;
		menuL.TelefoneAteEmail = document.getElementById('txtDDDAteEmail').value + '-' + document.getElementById('txtFoneAteEmail').value;
		menuL.EstadoAteEmail = document.getElementById('todasAsLayers_dropEstadoAteEmail').value;
		menuL.CidadeAteEmail = document.getElementById('dropCidadeAteEmail').value;
		menuL.EmpreendimentoAteEmail = document.getElementById('todasAsLayers_dropEmpreendimentoAteEmail').options[document.getElementById('todasAsLayers_dropEmpreendimentoAteEmail').selectedIndex].text;
		menuL.AssuntoAteEmail = document.getElementById('txtAssuntoAteEmail').value;
		menuL.MensagemAteEmail = document.getElementById('txtMensagemAteEmail').value;
		var validado = 'ok';	
		
		if(menuL.NomeAteEmail==''){
			validado = 'erro';
			document.getElementById('txtNomeAteEmail').style.backgroundColor = '#ffe2e2';
		}else
			document.getElementById('txtNomeAteEmail').style.backgroundColor = 'white';
		
				
		if(FuncoesGerais.ValidaEmail(menuL.EmailAteEmail)==0){
			validado = 'erro';
			document.getElementById('txtEmailAteEmail').style.backgroundColor = '#ffe2e2';
		}else
			document.getElementById('txtEmailAteEmail').style.backgroundColor = 'white';

		if(menuL.TelefoneAteEmail.length!=11){
			validado = 'erro';
			document.getElementById('txtDDDAteEmail').style.backgroundColor = '#ffe2e2';
			document.getElementById('txtFoneAteEmail').style.backgroundColor = '#ffe2e2';
		}else{
			document.getElementById('txtDDDAteEmail').style.backgroundColor = 'white';
			document.getElementById('txtFoneAteEmail').style.backgroundColor = 'white';
		}
			
		if(menuL.EstadoAteEmail==''){
			validado = 'erro';
			document.getElementById('todasAsLayers_dropEstadoAteEmail').style.backgroundColor = '#ffe2e2';
		}else
			document.getElementById('todasAsLayers_dropEstadoAteEmail').style.backgroundColor = 'white';
		if(menuL.CidadeAteEmail==''){
			validado = 'erro';
			document.getElementById('dropCidadeAteEmail').style.backgroundColor = '#ffe2e2';
		}else
			document.getElementById('dropCidadeAteEmail').style.backgroundColor = 'white';
		if(menuL.EmpreendimentoAteEmail=='Selecione'){
			validado = 'erro';
			document.getElementById('todasAsLayers_dropEmpreendimentoAteEmail').style.backgroundColor = '#ffe2e2';
		}else
			document.getElementById('todasAsLayers_dropEmpreendimentoAteEmail').style.backgroundColor = 'white';
		if(menuL.AssuntoAteEmail==''){
			validado = 'erro';
			document.getElementById('txtAssuntoAteEmail').style.backgroundColor = '#ffe2e2';
		}else
			document.getElementById('txtAssuntoAteEmail').style.backgroundColor = 'white';
		if(menuL.MensagemAteEmail==''){
			validado = 'erro';
			document.getElementById('txtMensagemAteEmail').style.backgroundColor = '#ffe2e2';
		}else
			document.getElementById('txtMensagemAteEmail').style.backgroundColor = 'white';
			
		return validado;
	},
	
	enviaAteEmail : function(){
		var validado = menuL.validaAteEmail();
		if(validado=='ok'){
			classSAC.inseri('E', menuL.AssuntoAteEmail, menuL.NomeAteEmail, menuL.EmailAteEmail, '', menuL.EstadoAteEmail, menuL.CidadeAteEmail, menuL.EmpreendimentoAteEmail, '', '', '', '', '', menuL.MensagemAteEmail).value;

			var conteudoHTM ='';
			conteudoHTM+='Nome: ' + menuL.NomeAteEmail + '<br>';
			conteudoHTM+='E-mail: ' + menuL.EmailAteEmail + '<br>';
			conteudoHTM+='Telefone: ' + menuL.TelefoneAteEmail + '<br>';
			conteudoHTM+='Estado: ' + menuL.EstadoAteEmail + '<br>';
			conteudoHTM+='Cidade: ' + menuL.CidadeAteEmail + '<br>';
			conteudoHTM+='Empreendimento: ' + menuL.EmpreendimentoAteEmail + '<br>';
			conteudoHTM+='Titulo: ' + menuL.AssuntoAteEmail + '<br>';
			conteudoHTM+='Mensagem: ' + menuL.MensagemAteEmail + '<br>';
			//funcoes.sendmail('bruno@playercom.net', menuL.EmailAteEmail, 'EVEN - CONTATO EMAIL', conteudoHTM, '');
			funcoes.sendmail('institucionaleven@webtalkers.com.br', menuL.EmailAteEmail, 'EVEN - CONTATO EMAIL', conteudoHTM, '');
			
			if(menuL.emailEnviaAteEmail==''){
				/*var dt = _inc_menuLeft.carregaAtendimento(document.getElementById('todasAsLayers_dropEmpreendimentoAteEmail').value,'EMAIL').value;
				if(dt!=null && typeof(dt) == "object"){
					if(dt.Rows.length!=0){
						for(i=0;i<dt.Rows.length;i++){
							var row = dt.Rows[i];
							funcoes.sendmail(row.atendimento, menuL.EmailAteEmail, 'EVEN - CONTATO EMAIL', conteudoHTM, '');
						}
					}else{*/
						if(menuL.EstadoAteEmail=='RJ'){
							funcoes.sendmail('vmoura@even.com.br', menuL.EmailAteEmail, 'EVEN - CONTATO EMAIL', conteudoHTM, '');
							funcoes.sendmail('wrodrigues@even.com.br', menuL.EmailAteEmail, 'EVEN - CONTATO EMAIL', conteudoHTM, '');
						}else if(menuL.EstadoAteEmail=='MG'){
							funcoes.sendmail('institucionaleven_bh@webtalkers.com.br', menuL.EmailAteEmail, 'EVEN - CONTATO EMAIL', conteudoHTM, '');
						}else if(menuL.EstadoAteEmail=='GO'){
							funcoes.sendmail('gerenciamentoeven_k@webtalkers.com.br ', menuL.EmailAteEmail, 'EVEN - CONTATO EMAIL', conteudoHTM, '');
						}else if(menuL.EstadoAteEmail=='SP'){
							funcoes.sendmail('faleconosco@evenvendas.com.br', menuL.EmailAteEmail, 'EVEN - CONTATO EMAIL', conteudoHTM, '');
						}
					//}
				//}
			}else{
				funcoes.sendmail(menuL.emailEnviaAteEmail, menuL.EmailAteEmail, 'EVEN - CONTATO EMAIL', conteudoHTM, '');
				menuL.emailEnviaAteEmail='';
			}
			if(empreendimentoU!=''){
				pageTracker._trackPageview('/ATENDIMENTO/POREMAIL' + empreendimentoU);
			}else{
				pageTracker._trackPageview('/ATENDIMENTO/POREMAIL/');
			}

			if(document.getElementById('chkNewsAteEmail').checked)
				classCadastro.inseri(menuL.NomeAteEmail,menuL.EmailAteEmail);
				
			document.getElementById('divLightboxAtendimentoOnlineForm').style.display = 'none';
			document.getElementById('divLightboxAtendimentoOnlineFormValidacao').style.display = '';
			document.getElementById('txtNomeAteEmail').value='';
			document.getElementById('txtEmailAteEmail').value='';
			document.getElementById('todasAsLayers_dropEstadoAteEmail').value='';
			document.getElementById('dropCidadeAteEmail').length=0;
			document.getElementById('todasAsLayers_dropEmpreendimentoAteEmail').value='';
			document.getElementById('txtAssuntoAteEmail').value='';
			document.getElementById('txtMensagemAteEmail').value='';
			document.getElementById('divLightboxAtendimentoOnlineFormRed').style.display = 'none';
			//menuL.verificaTagPredicta('even_atendimento_email_atual');
			
			
		}else
			document.getElementById('divLightboxAtendimentoOnlineFormRed').style.display = '';
	},
	
	voltarAteEmail : function(){
		document.getElementById('divLightboxAtendimentoOnlineFormRed').style.display = 'none';
		document.getElementById('divLightboxAtendimentoOnlineForm').style.display = '';
		document.getElementById('divLightboxAtendimentoOnlineFormValidacao').style.display = 'none';
	},
	
	NomeAteTelefone : '',
	EmailAteTelefone : '',
	EstadoAteTelefone : '',
	CidadeAteTelefone : '',
	EmpreendimentoAteTelefone : '',
	TelefoneoAteTelefone : '',
	HorarioAteTelefone : '',
	
	validaAteTelefone : function(){
		menuL.NomeAteTelefone = document.getElementById('txtNomeAteTelefone').value;
		menuL.EmailAteTelefone = document.getElementById('txtEmailAteTelefone').value;
		menuL.EstadoAteTelefone = document.getElementById('todasAsLayers_dropEstadoAteTelefone').value;
		menuL.CidadeAteTelefone = document.getElementById('dropCidadeAteTelefone').value;
		menuL.EmpreendimentoAteTelefone = document.getElementById('todasAsLayers_dropEmpreendimentoAteTelefone').options[document.getElementById('todasAsLayers_dropEmpreendimentoAteTelefone').selectedIndex].text;
		menuL.TelefoneoAteTelefone = document.getElementById('txtDDDAteTelefone').value + '-' + document.getElementById('txtTelAteTelefone').value;
		menuL.HorarioAteTelefone = document.getElementById('dropHorarioAteTelefone').value;
		var validado = 'ok';		
		if(menuL.NomeAteTelefone==''){
			validado = 'erro';
			document.getElementById('txtNomeAteTelefone').style.backgroundColor = '#ffe2e2';
		}else
			document.getElementById('txtNomeAteTelefone').style.backgroundColor = 'white';
		if(FuncoesGerais.ValidaEmail(menuL.EmailAteTelefone)==0){
			validado = 'erro';
			document.getElementById('txtEmailAteTelefone').style.backgroundColor = '#ffe2e2';
		}else
			document.getElementById('txtEmailAteTelefone').style.backgroundColor = 'white';
		if(menuL.EstadoAteTelefone==''){
			validado = 'erro';
			document.getElementById('todasAsLayers_dropEstadoAteTelefone').style.backgroundColor = '#ffe2e2';
		}else
			document.getElementById('todasAsLayers_dropEstadoAteTelefone').style.backgroundColor = 'white';
		if(menuL.CidadeAteTelefone==''){
			validado = 'erro';
			document.getElementById('dropCidadeAteTelefone').style.backgroundColor = '#ffe2e2';
		}else
			document.getElementById('dropCidadeAteTelefone').style.backgroundColor = 'white';
		if(menuL.EmpreendimentoAteTelefone=='Selecione'){
			validado = 'erro';
			document.getElementById('todasAsLayers_dropEmpreendimentoAteTelefone').style.backgroundColor = '#ffe2e2';
		}else
			document.getElementById('todasAsLayers_dropEmpreendimentoAteTelefone').style.backgroundColor = 'white';
		if(menuL.TelefoneoAteTelefone.length<9){
			validado = 'erro';
			document.getElementById('txtDDDAteTelefone').style.backgroundColor = '#ffe2e2';
			document.getElementById('txtTelAteTelefone').style.backgroundColor = '#ffe2e2';
		}else{
			document.getElementById('txtDDDAteTelefone').style.backgroundColor = 'white';
			document.getElementById('txtTelAteTelefone').style.backgroundColor = 'white';
		}
		if(menuL.HorarioAteTelefone==''){
			validado = 'erro';
			document.getElementById('dropHorarioAteTelefone').style.backgroundColor = '#ffe2e2';
		}else
			document.getElementById('dropHorarioAteTelefone').style.backgroundColor = 'white';
			
		return validado;
	},
	
	enviaAteTelefone : function(){
		var validado = menuL.validaAteTelefone();
		if(validado=='ok'){
			classSAC.inseri('T', '', menuL.NomeAteTelefone, menuL.EmailAteTelefone, '', menuL.EstadoAteTelefone, menuL.CidadeAteTelefone, menuL.EmpreendimentoAteTelefone, menuL.TelefoneoAteTelefone, '', '', '', menuL.HorarioAteTelefone,'').value;
			
			var conteudoHTM ='';
			conteudoHTM+='Nome: ' + menuL.NomeAteTelefone + '<br>';
			conteudoHTM+='E-mail: ' + menuL.TelefoneAteTelefone + '<br>';
			conteudoHTM+='Estado: ' + menuL.EstadoAteTelefone + '<br>';
			conteudoHTM+='Cidade: ' + menuL.CidadeAteTelefone + '<br>';
			conteudoHTM+='Empreendimento: ' + menuL.EmpreendimentoAteTelefone + '<br>';
			conteudoHTM+='Telefone: ' + menuL.TelefoneoAteTelefone + '<br>';
			conteudoHTM+='Horario: ' + menuL.HorarioAteTelefone + '<br>';
			//funcoes.sendmail('bruno@playercom.net', menuL.EmailAteTelefone, 'EVEN - CONTATO TELEFONE', conteudoHTM, '');
			
			var dt = _inc_menuLeft.carregaAtendimento(document.getElementById('todasAsLayers_dropEmpreendimentoAteTelefone').value,'LIGAMOS').value;
			if(dt!=null && typeof(dt) == "object"){
				if(dt.Rows.length!=0){
					for(i=0;i<dt.Rows.length;i++){
						var row = dt.Rows[i];
						funcoes.sendmail(row.atendimento, menuL.EmailAteTelefone, 'EVEN - CONTATO TELEFONE', conteudoHTM, '');
					}
				}else{
					if(menuL.EstadoAteTelefone=='RJ'){
						funcoes.sendmail('vmoura@even.com.br', menuL.EmailAteTelefone, 'EVEN - CONTATO TELEFONE', conteudoHTM, '');
						funcoes.sendmail('wrodrigues@even.com.br', menuL.EmailAteTelefone, 'EVEN - CONTATO TELEFONE', conteudoHTM, '');
					}else if(menuL.EstadoAteTelefone=='MG'){
						funcoes.sendmail('institucionaleven_bh@webtalkers.com.br', menuL.EmailAteTelefone, 'EVEN - CONTATO TELEFONE', conteudoHTM, '');
					}else if(menuL.EstadoAteTelefone=='GO'){
						funcoes.sendmail('institucionaleven_go@webtalkers.com.br', menuL.EmailAteTelefone, 'EVEN - CONTATO TELEFONE', conteudoHTM, '');
					}else if(menuL.EstadoAteTelefone=='SP'){
						funcoes.sendmail('ligamosparavoce@evenvendas.com.br', menuL.EmailAteTelefone, 'EVEN - CONTATO TELEFONE', conteudoHTM, '');
					}else{
						funcoes.sendmail('ligamosparavoce@evenvendas.com.br', menuL.EmailAteTelefone, 'EVEN - CONTATO TELEFONE', conteudoHTM, '');	
					}
				}
			}
			
			if(empreendimentoU!=''){
				pageTracker._trackPageview('/ATENDIMENTO/LIGAMOSPARAVOCE' + empreendimentoU);
			}else{
				pageTracker._trackPageview('/ATENDIMENTO/LIGAMOSPARAVOCE/');
			}
			
			if(document.getElementById('chkNewsAteTelefone').checked)
				classCadastro.inseri(menuL.NomeAteTelefone,menuL.EmailAteTelefone);
				
			document.getElementById('divLightboxAtendimentoOnlineTelefoneForm').style.display = 'none';
			document.getElementById('divLightboxAtendimentoOnlineTelefoneFormValidacao').style.display = '';
			document.getElementById('txtNomeAteTelefone').value='';
			document.getElementById('txtTelefoneAteTelefone').value='';
			document.getElementById('todasAsLayers_dropEstadoAteTelefone').value='';
			document.getElementById('dropCidadeAteTelefone').length=0;
			document.getElementById('todasAsLayers_dropEmpreendimentoAteTelefone').value='';
			document.getElementById('txtDDDAteTelefone').value='';
			document.getElementById('txtTelAteTelefone').value='';
			document.getElementById('dropHorarioAteTelefone').value='';
			//menuL.verificaTagPredicta('even_ligamos_atual');
			
		}else
			document.getElementById('divLightboxAtendimentoOnlineTelefoneFormRed').style.display = '';
	},
	
	voltarAteTelefone : function(){
		document.getElementById('divLightboxAtendimentoOnlineTelefoneFormRed').style.display = 'none';
		document.getElementById('divLightboxAtendimentoOnlineTelefoneForm').style.display = '';
		document.getElementById('divLightboxAtendimentoOnlineTelefoneFormValidacao').style.display = 'none';
	},

	iniciaAtendimentoOnline : function(idEmpreendimento){
		if(idEmpreendimento==-1){
			FG.popup('http://200.225.91.178/Even/Chat4/cliente/frm_login.asp?IDArea=86&sel=Insitucional_SP',450,605
					 ,'EVEN');
		}else{
		  if(document.getElementById('hidIdEmpreendimento'))
			  idEmpreendimento = document.getElementById('hidIdEmpreendimento').value;
		  var rateio = FG.buscaParametro('rat');
		  var tipo='';
		  var dt=null;
		  if(rateio=='')
			  var dt = _inc_menuLeft.carregaAtendimento(idEmpreendimento,'ONLINE').value;
		  else
			  var dt = _inc_menuLeft.carregaAtendimento(idEmpreendimento,'ONLINERAT').value;
	  /*	if(rateio==1){
			  dt = _inc_menuLeft.carregaAtendimento(idEmpreendimento,'ONLINERAT').value;
			  tipo='rat';
			  if(dt.Rows.length==0){
				  dt = _inc_menuLeft.carregaAtendimento(idEmpreendimento,'ONLINE').value;
				  tipo='email';
			  }
		  }else{
			  dt = _inc_menuLeft.carregaAtendimento(idEmpreendimento,'ONLINERATPESO').value;
			  tipo='peso';
			  if(dt.Rows.length==0){
				  dt = _inc_menuLeft.carregaAtendimento(idEmpreendimento,'ONLINERAT').value;
				  tipo='rat';
				  if(dt.Rows.length==0){
					  dt = _inc_menuLeft.carregaAtendimento(idEmpreendimento,'ONLINE').value;
					  tipo='email';
				  }
			  }
		  }*/
		  if(dt!=null && typeof(dt) == "object"){
			  //menuL.verificaTagPredicta('even_atendimento-online_atual');
			  pageTracker._trackPageview('/ATENDIMENTO/ONLINE' + empreendimentoU);
			  var row = dt.Rows[0];
			  if(row.atendimento.toString().indexOf('evenrio211')!=-1){
				  FG.popup(row.atendimento,470,605,'EVEN');
			  }else if(row.atendimento.toString().indexOf('even_bh')!=-1){
				  FG.popup(row.atendimento,500,700,'EVEN');
			  }else if(row.atendimento.toString().indexOf('webtalkers993')!=-1){
				  FG.popup(row.atendimento,407,605,'EVEN');
			  }else if(row.atendimento.toString().indexOf('Even')!=-1){
				  FG.popup(row.atendimento,407,605,'EVEN');
			  }else{
				  FG.popup(row.atendimento,407,605,'EVEN');
			  }
		  }
		}

	},
	
	iniciaAtendimentoOnlineUF : function(UF){
		if(UF!=''){
			try{_ME.track('even_atendimento-online_chat');}catch (e){}
			pageTracker._trackPageview('/ATENDIMENTO/ONLINE/' + UF);
			//menuL.verificaTagPredicta('even_atendimento-online');
			if(UF=='RJ'){
				FG.popup('http://200.225.91.179/evenrio211/chat4/cliente/frm_login.asp?IDArea=1&sel=HomePage',450,605,'EVEN');
			}else if(UF=='MG'){
				FG.popup('http://200.225.91.179/webtalkers993/chat4/even_bh/frm_login.asp?IDArea=75&sel=Site_Institucional_MG',500,700,'EVEN');
			}else if(UF=='GO'){
				FG.popup('http://200.225.91.178/webtalkers993/chat4/even/frm_login.asp?IDArea=19&sel=Institucional_GO',500,700,'EVEN');
			}else if(UF=='SP'){
				var campanha = FuncoesGerais.BuscaParametro('c');
				if((campanha=='' && window.location.toString().indexOf('promocoes.aspx')==-1))
					FG.popup('http://200.225.91.178/Even/Chat4/cliente/frm_login.asp?IDArea=86&sel=Insitucional_SP',450,605,'EVEN');
				else if((campanha=='' || campanha=='int') && window.location.toString().indexOf('promocoes.aspx')!=-1)
					FG.popup('http://200.225.91.178/Even/Chat4/cliente/frm_login.asp?IDArea=86&sel=campanha_selecao',450,605,'EVEN');
				else if(campanha=='cor' && window.location.toString().indexOf('promocoes.aspx')!=-1)
					FG.popup('http://200.225.91.178/Even/Chat4/cliente/frm_login.asp?IDArea=86&sel=campanha_corinthians',450,605,'EVEN');
					
			}
			//FG.popup('http://200.225.91.178/Even/Chat4/cliente/frm_login2.asp?IDArea=86&sel=Insitucional_SP',450,480,'EVEN');
		}
	},
	
	verificaCamposLogin : function(){
		if(document.frmExcluseven.login.value!='' && document.frmExcluseven.senha.value!='' && document.frmExcluseven.login.value!='*Login' && document.frmExcluseven.senha.value!='*Senha')
			document.frmExcluseven.submit();
	},
	
	verificaCamposLoginImobiliarias : function(){
		if(document.frmExclusevenI.login.value!='' && document.frmExclusevenI.senha.value!='')
			document.frmExclusevenI.submit();
	},
	
	verificaTagPredicta : function(tag){
		if(window.location.href.toString().indexOf('empreendimento.aspx')!=-1){
			/*if(empreendimentoPredicta=='atual' && paramPredicta!=''){
				//alert(tag);
				atmCLL(tag);
			}*/					
		}
		if(window.location.href.toString().indexOf('default.aspx')!=-1 || window.location.href=='http://www.even.com.br/'){
				tag = tag.replace('_atual','');
				atmCLL(tag);
		}
	}
	
        
}
