var dir="http://www.anjowebsolutions.nl/";

document.getElementsByClassName = function (needle, domNode){
    var s = [], r = [], undefined;
    var e = (domNode!=null) ? domNode : (document.documentElement || document.body) ;
    var re = new RegExp('(^|\\s)' + needle + '(\\s|$)');
    while (e !== undefined)    {
        while (e)        {
            if (e.nodeType == 1)            {
                if (e.className && re.test(e.className)) r.push(e);
                s.push(e.firstChild);
            }
            e = e.nextSibling;
        }
        e = s.pop();
    }
    return r;
}
function makeXmlHttp(){
	var xmlhttp = null;
	if(window.XMLHttpRequest){
	xmlhttp = new XMLHttpRequest();
	}else{
		try{
			xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
		}catch(e){
			window.alert("Uw browser ondersteunt het XMLHttpRequest object niet!");
		}
	}
	
	return xmlhttp;
}
var timedOut = false;
function DomainCheck(input){
	if(timedOut == false){
		setTimeout(function(){DomainCheck(input); },4000);
		var row = document.getElementById(input);
		var status = document.getElementsByClassName('dmtdstatus',row);
		var domain = document.getElementsByClassName('dmtddomain',row)[0].innerHTML;
		var xmlhttp = makeXmlHttp();
		xmlhttp.open("POST", dir+"pagina.php", true);
		xmlhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
		xmlhttp.onreadystatechange = function() {
			if(xmlhttp.readyState == 4){
				row.innerHTML = xmlhttp.responseText;
			}
		}
		xmlhttp.send('domain='+domain);
	}
}
function MultipleDomainCheck(input){
	if(timedOut == false){
		setTimeout(function(){MultipleDomainCheck(input); },9000);
		var table = document.getElementById('domains');
		var xmlhttp = makeXmlHttp();
		xmlhttp.open("POST", dir+"pagina.php", true);
		xmlhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
		xmlhttp.onreadystatechange = function() {
			if(xmlhttp.readyState == 4){
				table.innerHTML = xmlhttp.responseText;
				timedOut = true;
			}
		}
		xmlhttp.send('domain='+input);
	}
}