<!--
// This Mini Ajax is taken from http://marc.theaimsgroup.com/?l=php-general&m=112198633625636&w=2
// This is cool enuff, I don't need the bloated JQuery just to perform this little ajax.

function createRequestObject() {
    var ro;
    var browser = navigator.appName;
    if(browser == "Microsoft Internet Explorer"){
        ro = new ActiveXObject("Microsoft.XMLHTTP");
    }else{
        ro = new XMLHttpRequest();
    }
    return ro;
}

var http = createRequestObject();

function cekdomain(random_key) {
	var domain = document.getElementById('domain').value;
	var ext = document.getElementById('ext').value;
	
	if(domain.length>=2){

		// disable both text and button field
		document.getElementById("domain").disabled = true;
		document.getElementById("ext").disabled = true;
		
		// display loading things
		loading();
		
		// okay, send request to starfleet
		http.open('get', 'http://promo.rumahweb.com/wp-content/themes/titan/cekdomain.php?random='+random_key+'&domain='+domain+'&ext='+ext);
		http.onreadystatechange = handleResponse;
		http.send(null);
	}
	else{
		// yeah, at least please tell me what to download :P
		alert('Domain yang Anda masukkan terlalu pendek.');
	}
}
function handleResponse() {
    if(http.readyState == 4){
       	var response = http.responseText;
        
		document.getElementById("hasil").innerHTML = response;
		
		// undisabled all disabled items
		document.getElementById("domain").disabled = false;
		document.getElementById("ext").disabled = false;
	    
        return false;
        //}
    }
}

function loading(){
	document.getElementById("hasil").style.display = "block";
	document.getElementById("hasil").innerHTML = "<p align='center'>Sedang memeriksa domain..<br /><img src='http://promo.rumahweb.com/images/loading.gif' /></p>";
	return false;
}

// this is a hack for IE T_T
if (navigator.userAgent.indexOf("MSIE")!=-1) {
	var newdiv = document.createElement("div");
	var container = document.getElementById("hasil");
	container.appendChild(newdiv);
}
-->