function invocar(url,alvo,mensagem)
  {
  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("Your browser does not support AJAX!");
        return false;
        }
      }
    }
	if(alvo == undefined || alvo == 'undefined' || alvo == '' || alvo == null){
		alvo = 'centroTexto';
	}
	if(mensagem == undefined || mensagem == 'padrao' || mensagem == null){
		mensagem = '<h2><img src="imagens/ajax-loader.gif" width="220" height="19" /><br />Carregando...</h2>';
	}
	xmlHttp.onreadystatechange = function(){
		if(mensagem != ''){
			if(xmlHttp.readyState <=3){
				
				document.getElementById(alvo).innerHTML = mensagem;
			}
		}
		if(xmlHttp.readyState == 4){
			document.getElementById(alvo).innerHTML = xmlHttp.responseText;
		}
	}
	//xmlHttp.open("POST",url,true);
	agora = new Date();
	hr = agora.getHours();
	minu = agora.getMinutes();
	sec = agora.getSeconds();
	c = hr+ "0" + minu + "0" + sec;
	teste = url.split(".php");
	if(teste[1]){
		url = url + "&nunesethamacelia=" + c;
	}else{
		url = url + "?" + c;
	}
	xmlHttp.open("GET",url,true);
	//xmlHttp.open("POST","open.php?"+url,true);
/*	xmlHttp.setRequestHeader("Content-type=application/x-www-form-urlencoded");
	if(formato == undefined){
		
	}else{
		xmlHttp.send(formato);
	}*/
	xmlHttp.send(null);
	
  }
  
  
  
  
 function postar(pagina,valor,alvo)
  {
  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 nao suporta ajax, por favor, atualize-se!");
        return false;
        }
      }
    }
	
	
	xmlHttp.onreadystatechange = function(){
	
	if(xmlHttp.readyState <= 3){
	document.getElementById(alvo).innerHTML='<h2>Aguarde, processando dados...</h2>';
	}
		if(xmlHttp.readyState == 4){
			//document.myForm.time.value = xmlHttp.responseText;
			document.getElementById(alvo).innerHTML=xmlHttp.responseText;
		}
	}
	
	
	xmlHttp.open("POST",pagina,true);
	xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
	xmlHttp.send(valor);
	//xmlHttp.send('valor='+valor);
	
  }


 function postar_login(pagina,valor,alvo)
  {
  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 nao suporta ajax, por favor, atualize-se!");
        return false;
        }
      }
    }
	
	
	xmlHttp.onreadystatechange = function(){
	
	if(xmlHttp.readyState <= 3){
		document.getElementById('topoCentro').innerHTML = "<h4 class=\"branco\">LOGIN</h4>";
		document.getElementById(alvo).innerHTML='<h2>Aguarde, processando dados...</h2>';
	}

	if(xmlHttp.readyState == 4){
			aux = xmlHttp.responseText;
			a_aux = aux.split(';');
			url=a_aux[0];
			if(url != 'ok'){
				document.getElementById(alvo).innerHTML='Usuário e senha não conferem.';
				alert('Usuário e senha não conferem.');
			} else {
				document.login.url.value='www.nossosistema.com/' + document.login.login_empresa.value;
				document.login.submit();
			}
		}
	}
	
	
	xmlHttp.open("POST",pagina,true);
	xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
	xmlHttp.send(valor);
	//xmlHttp.send('valor='+valor);
	
  }

