var xmlHttp

function getIP()
{
	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null)
	  {
	  alert ("Browser does not support HTTP Request")
	  return
	  } 
	  var url="http://www.hackwars.net/ipgenerator.php"
	xmlHttp.onreadystatechange=stateChanged 
	xmlHttp.open("GET",url,true)
	xmlHttp.send(null)
} 
function stateChanged() 
{ 
	if(xmlHttp.readyState==4 || xmlHttp.readyState=="complete"){
		
		var ip1 = document.getElementById("edit-ip1")
		var ip2 = document.getElementById("edit-ip2")
		var ip3 = document.getElementById("edit-ip3")
		var ip4 = document.getElementById("edit-ip4")
		xmlDoc=xmlHttp.responseXML;
		var nip1 = xmlDoc.getElementsByTagName("ip1")[0].childNodes[0].nodeValue;
		var nip2 = xmlDoc.getElementsByTagName("ip2")[0].childNodes[0].nodeValue;
		var nip3 = xmlDoc.getElementsByTagName("ip3")[0].childNodes[0].nodeValue;
		var nip4 = xmlDoc.getElementsByTagName("ip4")[0].childNodes[0].nodeValue;
		
		ip1.value = nip1;
		ip2.value = nip2;
		ip3.value = nip3;
		ip4.value = nip4;
		
	}
 
}
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;
}
