/**
 * @author growin
 */

/*	====================================================================================
 * 	Função que cria o objeto XMLHttpRequest e envia para a pagina PHP que ira executar o 
 * 	as ações necessarias.
 * 	====================================================================================
 */
function ajaxFunction()
{	
	var xmlHttp;
	try {
		// Firefox, Opera 8.0+, Safari
		xmlHttp = new XMLHttpRequest();
	} 
	catch (e) {
		// Internet Explorer
		try {
			xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
		} 
		catch (e) {
			try {
				xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
			} 
			catch (e) {
				alert("Seu Navegador é muito antigo, ou não atinge os requisitos minimos!!!");
				return false;
			}
		}
	}
	return xmlHttp;
}
	
/*	====================================================================================
 * 	Get form content in GuruResponde page.
 * 	====================================================================================
 */	
getFormGuruResponde_ajax = function(method, URL, idTagReturn)
{
	xmlHttp = ajaxFunction();

	if (idTagReturn == "guruResponde") 
	{
		xmlHttp.onreadystatechange = function getReturn(){
			if (xmlHttp.readyState == 4) {
				document.getElementById("guruResponde").innerHTML = xmlHttp.responseText;
			}
		}
	}
	xmlHttp.open(method, URL, true);
	xmlHttp.send(null);
}

