/* AJAX.JS made by OCTAGONO */

var xmlhttp = false ;

if (!xmlhttp && typeof XMLHttpRequest != 'undefined')
	{
	try {
		xmlhttp = new XMLHttpRequest ();
		}
	catch (e) {
		xmlhttp = false}
	}

function myXMLHttpRequest ()
{
	var xmlhttplocal;
	try {
		xmlhttplocal = new ActiveXObject ("Msxml2.XMLHTTP")
		}
	catch (e) {
		try {
			xmlhttplocal = new ActiveXObject ("Microsoft.XMLHTTP")
			}
		catch (E) {
			xmlhttplocal = false;
		}
	}

if (!xmlhttplocal && typeof XMLHttpRequest != 'undefined') {
	try {
		var xmlhttplocal = new XMLHttpRequest ();
	}
catch (e) {
var xmlhttplocal = false;
}
}
return (xmlhttplocal);
}

var mnmxmlhttp = Array ();
var mnmxmlhttp2 = Array ();

var mnmString = Array ();
var mnmPrevColor = Array ();
var responsestring = Array ();
var myxmlhttp = Array ();
var responseString = new String;

var i=0;
var ii = 0;

var a=0;
var aa = 0;

/* Testemunhos */
function ajax_update()
{

	function getValue(varname)
	{
	  // First, we load the URL into a variable
	  var url = window.location.href;
	  // Next, split the url by the ?
	  var qparts = url.split("?");
	  // Check that there is a querystring, return "" if not
	  if (qparts.length == 0)
	  {
	    return "";
	  }
	  // Then find the querystring, everything after the ?
	  var query = qparts[1];
	  // Split the query string into variables (separates by &s)
	  var vars = query.split("&");
	  // Initialize the value with "" as default
	  var value = "";
	  // Iterate through vars, checking each one for varname
	  for (i=0;i<vars.length;i++)
	  {
	    // Split the variable by =, which splits name and value
	    var parts = vars[i].split("=");
	    // Check if the correct variable
	    if (parts[0] == varname)
	    {
	      // Load value into variable
	      value = parts[1];
	      // End the loop
	      break;
	    }
	  }
  
  // Convert escape code
  value = unescape(value);

  // Convert "+"s to " "s
  value.replace(/\+/g," ");

  // Return the value
  return value;
}

	
var link_seo = window.location.href;
var link_array = link_seo.split("/");
var lingua = link_array[4];	

if (lingua == "esp" || lingua == "port" || lingua == "eng" || lingua == "alem")
{
	url = "../../ajax_php.php?lingua=" + lingua;
	target2 = document.getElementById ('content');	
}else
{
	var name = getValue("lingua");
	url = "../../ajax_php.php?lingua=" + name;
	target2 = document.getElementById ('content');
}

ii = i++;

var content = "i=" + ii ;

mnmxmlhttp = new myXMLHttpRequest ();

if (mnmxmlhttp) {
mnmxmlhttp.open ("POST", url, true);
mnmxmlhttp.setRequestHeader ('Content-Type',
'application/x-www-form-urlencoded');

mnmxmlhttp.send (content);
errormatch = new RegExp ("^ERROR:");

target2 = document.getElementById ('content');

mnmxmlhttp.onreadystatechange = function () {
if (mnmxmlhttp.readyState == 4) {
mnmString = mnmxmlhttp.responseText;

if (mnmString.match (errormatch)) {
mnmString = mnmString.substring (6, mnmString.length);

target = document.getElementById ('content');
target2.innerHTML = mnmString;

} else {
target = document.getElementById ('content');
target2.innerHTML = mnmString;

}
}
}
}

setTimeout('ajax_update()', 8000);
}