function GetXmlHttpObject()
{
var xmlHttp=null;

try
 {
 // Firefox, Opera 8.0+, Safari
 xmlHttp=new XMLHttpRequest();
 }
catch (e)
 {
 //Internet Explorer
 try
  {
  xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
  }
 catch (e)
  {
  xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
 }

return xmlHttp;
}

function generateCaptcha(mode,submit,name,id,style,script)
{ 
 document.getElementById("qicHere").innerHTML='<font color=red size=1>Please wait while human verification is loaded ...</font> '
 xmlHttp=GetXmlHttpObject()
 if (xmlHttp==null)
 {
  alert ("Browser does not support HTTP Request")
  return
  }
 var hurl="QICGenerate.php?mode="+mode+'&st='+submit+'&sn='+name+'&si='+id+'&ss='+style+'&sc='+script
 hurl=hurl+"&sid="+Math.random()
 xmlHttp.onreadystatechange=stateChanged 
 xmlHttp.open("GET",hurl,true)
 xmlHttp.send(null)
}

function validateCaptcha()
{ 

 var code=document.getElementById('qicSelect').value
 document.getElementById("qicHere").innerHTML='Validating '+code
 xmlHttp=GetXmlHttpObject()
 if (xmlHttp==null)
 {
  alert ("Browser does not support HTTP Request")
  return
  }
 var url="QICValidate.php?code="+code
 url=url+"&sid="+Math.random()
 xmlHttp.onreadystatechange=stateChanged 
 xmlHttp.open("GET",url,true)
 xmlHttp.send(null)
}

function matchTest(pix)
{ 
 src=document.getElementById("QICPix"+pix).src;
 document.getElementById("QICPix"+pix).style.display='none';
 xmlHttp=GetXmlHttpObject()
 if (xmlHttp==null)
 {
  alert ("Browser does not support HTTP Request")
  return
  }
 var url="QICValidate.php?code="+src
 url=url+"&sid="+Math.random()
 xmlHttp.onreadystatechange=stateChanged 
 xmlHttp.open("GET",url,true)
 xmlHttp.send(null)
}

function stateChanged() 
{ 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 if (xmlHttp.responseText!='')
  { 
    document.getElementById("qicHere").innerHTML=xmlHttp.responseText 
  } 
}



