checkDomain = function() {
	
	for (var i=0; i<busquedas.length; i++) {
		checkElement( busquedas[i] );
	}

}

var xmlhttp=false;
/*@cc_on @*/
/*@if (@_jscript_version >= 5)
// JScript gives us Conditional compilation, we can cope with old IE versions.
// and security blocked creation of the objects.
 try {
  xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
 } catch (e) {
  try {
   xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
  } catch (E) {
   xmlhttp = false;
  }
 }
@end @*/
if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
  xmlhttp = new XMLHttpRequest();
}


function URLDecode(  encoded ) {
   var HEXCHARS = "0123456789ABCDEFabcdef"; 
   var plaintext = "";
   var i = 0;
   while (i < encoded.length) {
       var ch = encoded.charAt(i);
	   if (ch == "+") {
	       plaintext += " ";
		   i++;
	   } else if (ch == "%") {
			if (i < (encoded.length-2) 
					&& HEXCHARS.indexOf(encoded.charAt(i+1)) != -1 
					&& HEXCHARS.indexOf(encoded.charAt(i+2)) != -1 ) {
				plaintext += unescape( encoded.substr(i,3) );
				i += 3;
			} else {
				alert( 'Bad escape combination near ...' + encoded.substr(i) );
				plaintext += "%[ERROR]";
				i++;
			}
		} else {
		   plaintext += ch;
		   i++;
		}
	} 

   return plaintext ;
}


function checkElement( elemento ) {
    url = '/cgis/chkdominio.php?dominio='+elemento.split(':')[0]  ;
    var resultado ;
    xmlhttp.open("GET",url,true);
    xmlhttp.onreadystatechange=function() {
       if (xmlhttp.readyState==4) {
		resultado = xmlhttp.responseText ;
		
		document.getElementById('resultado').innerHTML = resultado;
        
	}
    }
    xmlhttp.send(null);
    
    return false
   
    
}


//if (window.attachEvent) window.attachEvent("onload", checkDomain );
window.onload = checkDomain ;

