function create_http_object()
{
	var ActiveXTypes = [
		"Microsoft.XMLHTTP",
		"MSXML2.XMLHTTP.5.0",
		"MSXML2.XMLHTTP.4.0",
		"MSXML2.XMLHTTP.3.0",
		"MSXML2.XMLHTTP"
	];

	for( var i = 0; i < ActiveXTypes.length; i++ )
	{
		try
		{
			return new ActiveXObject( ActiveXTypes[i] );
		}
		catch( e )
		{ }
	}

	try
	{
		return new XMLHttpRequest();
	}
	catch( e )
	{ }

	return false;
} 



function get_ip (host_name, cElement){
	
	
	var client = create_http_object();
	client.open("GET", "../tools/get_ip.php?hostname=" + host_name , true);
	client.setRequestHeader('Content-Type', 'text/plain');
	client.send(null);
	
	client.onreadystatechange = function() {	
		
		 if(client.readyState == 4) { 
		  	
			if (client.status == 200){
					if ( client.responseText != 0 ){
				 		
						document.getElementById(cElement).value = client.responseText;		
						return true;	
					}
					else {
						return false;	
					}
			}
			
		 }
		
	}
}

function domain_options (id){		
	var client = create_http_object();
	if ( id != ""){
		client.open("GET", "dm_options.php?id=" + id , true);
		client.setRequestHeader('Content-Type', 'text/plain');
		client.send(null);
		
		client.onreadystatechange = function() {	
			
			 if(client.readyState == 4 && client.status == 200) { 
				
				document.getElementById ('domain_manage').innerHTML = client.responseText;
										
				if ( response_text != 0 ){
					return response_text;
				}
				
			 }
		}
	}
}


