var http_request = false;
   function makePOSTRequest(url, parameters) {
      http_request = false;
      if (window.XMLHttpRequest) { // Mozilla, Safari,...
         http_request = new XMLHttpRequest();
         if (http_request.overrideMimeType) {
         	// set type accordingly to anticipated content type
            //http_request.overrideMimeType('text/xml');
            http_request.overrideMimeType('text/html');
         }
      } else if (window.ActiveXObject) { // IE
         try {
            http_request = new ActiveXObject("Msxml2.XMLHTTP");
         } catch (e) {
            try {
               http_request = new ActiveXObject("Microsoft.XMLHTTP");
            } catch (e) {}
         }
      }
      if (!http_request) {
         alert('Não pode enviar sua mensagem');
         return false;
      }
      
      http_request.onreadystatechange = alertContents;
      http_request.open('POST', url, true);
      http_request.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=ISO-8859-1");
	  http_request.setRequestHeader("Content-length", parameters.length);
      http_request.setRequestHeader("Connection", "close");
      http_request.send(parameters);
   }

   function alertContents() {
      if (http_request.readyState == 4) {
         if (http_request.status == 200) {
            //alert(http_request.responseText);
            result = http_request.responseText;
            document.getElementById('myspan').innerHTML = result;            
         } else {
            alert('Problemas no Request!');
         }
      }
   }
   
   function get(obj) {
      var poststr = "&nomme=" + escape( document.getElementById("nomme").value ) +
	  				"&emmail=" + escape( document.getElementById("emmail").value );
					
      makePOSTRequest('news.php', poststr);
   }

	function get2(obj) {
      var poststr = "&assunto=" + escape( document.getElementById("assunto").value ) +
	  				"&nome=" + escape( document.getElementById("cnome").value ) +
	  				"&emmail=" + escape( document.getElementById("cemmail").value ) +
					"&telefone=" + escape( document.getElementById("telefone").value ) +
					"&objetivo=" + escape( document.getElementById("objetivo").value ) +
					"&trabalhou=" + escape( document.getElementById("trabalhou").value ) +
					"&descricao=" + escape( document.getElementById("descricao").value ) +
					"&complemento=" + escape( document.getElementById("complemento").value );
					
      makePOSTRequest('trabalhe_obrigado.php', poststr);
   }
   
   function getcontato(obj) {
      var poststr = "&assunto=" + escape( document.getElementById("assunto").value ) +
	  				"&nome=" + escape( document.getElementById("nome").value ) +
	  				"&ddd=" + escape( document.getElementById("ddd").value ) +
	  				"&telefone=" + escape( document.getElementById("telefone").value ) +
	  				"&cemail=" + escape( document.getElementById("cemail").value ) +
					"&msn=" + escape( document.getElementById("msn").value ) +
                    "&mensagem=" + escape( document.getElementById("mensagem").value );
					
      makePOSTRequest('obrigado.php', poststr);
   }

	function getcurriculo(obj) {
      var poststr = "&assunto=" + escape( document.getElementById("assunto").value ) +
	  				"&nome=" + escape( document.getElementById("nome").value ) +
	  				"&ddd=" + escape( document.getElementById("ddd").value ) +
	  				"&telefone=" + escape( document.getElementById("telefone").value ) +
	  				"&ccemail=" + escape( document.getElementById("ccemail").value ) +
					"&msn=" + escape( document.getElementById("msn").value ) +
                    "&mensagem=" + escape( document.getElementById("mensagem").value );
					
      makePOSTRequest('obrigado_trabalhe.php', poststr);
   }
