var xmlhttp;

function getCaptcha(str,page)
{
	alert("dsf");
xmlhttp=GetXmlHttpObject();
if (xmlhttp==null)
  {
  alert ("Browser does not support HTTP Request");
  return;
  }
var url="http://76.12.241.221/wp-content/themes/DI/getcaptcha.php";
url=url+"?q="+str+"&page="+page;
url=url+"&sid="+Math.random();
xmlhttp.onreadystatechange=imageChanged;
xmlhttp.open("GET",url,true);
xmlhttp.send(null);
}

function imageChanged()
{
if (xmlhttp.readyState==1)
{
document.getElementById("captchaDiv").innerHTML="<div style='margin-left:10px; margin-top:3px;'><img src='./wp-content/themes/DI/images/loading.gif' align='center'></div>";
}
else if(xmlhttp.readyState==4)
{
document.getElementById("captchaDiv").innerHTML=xmlhttp.responseText;
}
}

function GetXmlHttpObject()
{
if (window.XMLHttpRequest)
  {
  // code for IE7+, Firefox, Chrome, Opera, Safari
  return new XMLHttpRequest();
  }
if (window.ActiveXObject)
  {
  // code for IE6, IE5
  return new ActiveXObject("Microsoft.XMLHTTP");
  }
return null;
}