function createXMLHttpRequest() {
   try { return new ActiveXObject("Msxml2.XMLHTTP"); } catch(e) {} //IE
   try { return new ActiveXObject("Microsoft.XMLHTTP"); } catch(e) {} //IE
   try { return new XMLHttpRequest(); } catch(e) {} //Native Javascript 
   alert("XMLHttpRequest not supported");
   return null;
};


function displayCaptcha(){
	var xmlHttp=createXMLHttpRequest();
	xmlHttp.open("get","captcha.php?rd="+Math.random(),true);
	xmlHttp.onReadyStateChange=function(){
		if(xmlHttp.readyState==4){
			if(xmlHttp.status==200){
				document.getElementById("captcha").innerHTML=xmlHttp.responseText;
			}else{
				document.write(xmlHttp.statusText);
			}
		}
	}
	xmlHttp.send(null);
}
