
var cIndicarAmigo;

function indicarAmigo( valor, uri, lang ) {
	
    http.open("GET", "ajax/indicarAmigo.php?lang="+lang+"&email="+ valor+"&uri="+uri, true);

	indicarAmigoBck();
	
    http.onreadystatechange = handleHttpResponseIndicarAmigo;

	

//	document.getElementById("fbia_conteudo").innerHTML = "<img src='img/layout/aguarde.gif' />";
	http.send(null);
}

function handleHttpResponseIndicarAmigo() {

  campo_text = document.getElementById("fbia_conteudo");

  if (http.readyState == 4) {

	x = http.responseText.split("|erro");
	if(x.length > 1) {
		alert("Campo Email não pode estar em branco");
		campo_text.innerHTML = cIndicarAmigo;
	} else {
	    campo_text.innerHTML = x[0];
	}
  }
}

function indicarAmigoBck() {
	x = document.getElementById("fbia_conteudo");
	this.cIndicarAmigo = x.innerHTML;
}

