﻿function gmobj(mtxt) { if (document.getElementById) { m = document.getElementById(mtxt) } else if (document.all) { m = document.all[mtxt] } else if (document.layers) { m = document[mtxt] } return m; }

function CheckDomain(Domain,Ext,divID,checkboxid,imgid) {
    AjaxRequest.get(
    {
        "url": "Whois.ashx?Domain=" + Domain + "&ext=" + Ext
        
        , 'onLoading': function() {
            gmobj(divID).innerHTML = "<img src=\"http://blog.meotom.net/images/ajax-loader.gif\" border=\"0\" />"
        }
        
	    , 'onSuccess': function(req) {
	        var strResponse = req.responseText;
	        if (strResponse == "True") {
	            gmobj(divID).innerHTML = "<span style=\"color:red;\">Đã đăng ký</span>";
	            
	            var checkObj = document.getElementById(checkboxid);
	            var imgObj = document.getElementById(imgid) ;
	            
	            checkObj.disabled="disabled";
	            imgObj.width="0px";
	            imgObj.height="0px";
	            
	            
	        } else {
    	        gmobj(divID).innerHTML = "<span style=\"color:green;\">Chưa đăng ký</span>";
	        }
	    }
	    , 'onError': function(req) {
	        gmobj(divID).innerHTML = req.statusText;
	        var imgObj = document.getElementById(imgid) ;
            imgObj.width="0px";
            imgObj.height="0px";
	    }
    });
}
