function ajaxInit(){		var req;		try {				req = new ActiveXObject("Microsoft.XMLHTTP");		}catch(e){				try {						req = new ActiveXObject("Msxml2.XMLHTTP");				}catch(ex){						try {								req = new XMLHttpRequest();						}catch(exc) {								alert("Esse browser não tem recursos para uso do Ajax");								req = null;				}				}		}			return req;}function trim(str){		return str.replace(/^\s*|\s*$/g,"");}function format(value,format){		value = value.replace(/\D/g,"");		var result="";			if(format.length < value.length)		return value;			for(i=0,j=0;(i<format.length)&&(j<value.length);i++){		var ch = format.charAt(i) ;				if(ch == '#'){						result += value.charAt(j++);			continue;		}		result += ch;	}		return result;}function add_news(){	var new_nome = document.getElementById("nome");	var new_email = document.getElementById("email");	if(new_nome.value==""){			alert("Preencha o Nome corretamente.");				new_nome.focus();				return false;		}		if(new_email.value=="" || new_email.value.indexOf(".") == -1 || new_email.value.indexOf("@") == -1){				alert("Preencha o E-mail corretamente.");				new_email.focus();				return false;		}		var ajax = ajaxInit();		ajax.open("GET", "action_news.php?nome="+new_nome.value+"&email="+new_email.value);		ajax.onreadystatechange = function(){				if(ajax.readyState == 1){						}				if(ajax.readyState == 4){						if(ajax.status == 200){								alert(ajax.responseText);								if(ajax.responseText != ""){										new_nome.value = "";										new_email.value = "";								}						}						}		}	ajax.send(null);}		function popcenter(pagina, largura, altura) {	var esquerda = (screen.width - largura)/2;	var topo = (screen.height - altura)/2;	window.open(pagina,'','height=' + altura + ', width=' + largura + ', top=' + topo + ', left=' + esquerda); }function changeOption(el,upEl){	var ajax = ajaxInit();		ajax.open("GET", "action_busqueLorenge.php?opt="+upEl+"&flag="+el.value);		ajax.onreadystatechange = function(){				if(ajax.readyState == 1){}				if(ajax.readyState == 4){						if(ajax.status == 200){						if(ajax.responseText != ""){					switch(upEl){						case "bairro":							document.getElementById("cod_bairro").innerHTML = ajax.responseText;							break;					}				}						}						}		}	ajax.send(null);}/* FUNCOES DO CORRETOR ONLINE */	function abreCorretor(strPagina, numLargura, numAltura)	{		var numEsquerda = (screen.width - numLargura)/2;		var numTopo = (screen.height - numAltura)/2;		window.open(strPagina,'','height=' + numAltura + ', width=' + numLargura + ', top=' + numTopo + ', left=' + numEsquerda);	}	function trackFlash(strUrl)	{		_gaq.push(['_trackPageview', strUrl]);	}	function getCorretorOnline(strEmpreendimento) {		strURLCorretor = 'http://web.atendimentoaovivo.com.br/chat.asp?idc=5386&pre_empresa=1102&pre_depto=auto&vivocustom=&vivocustom2=&idtemplate=2';				abreCorretor(strURLCorretor,'520','590');						trackFlash('/imoveis/' + strEmpreendimento + '/corretor-solicitado-teste.html');			}/* END FUNCOES DO CORRETOR ONLINE */
