function makeXmlHttp()
{
        var xmlhttp;

        /** Special IE only code ... */
        /*@cc_on
          @if (@_jscript_version >= 5)
              try
              {
                  xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
              }
              catch (e)
              {
                  try
                  {
                      xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
                  }
                  catch (E)
                  {
                      xmlhttp = false;
                  }
             }
          @else
             xmlhttp = false;
        @end @*/

        /** Every other browser on the planet */
        if (!xmlhttp && typeof XMLHttpRequest != 'undefined')
        {
            try
            {
                xmlhttp = new XMLHttpRequest();
            }
            catch (e)
            {
                xmlhttp = false;
            }
        }
        return xmlhttp;
}

function verzenden()
{
        var keywords = document.getElementById('keywords').value;
        var domain = document.getElementById('domain').value;
		var depth = document.getElementById('depth').value;
             
        xmlHttp = makeXmlHttp();
        
        xmlHttp.onreadystatechange = function()
        {
                // alert("xmlHttp.readyState: "+xmlHttp.readyState); // deze doet het niet :(
                
                if ( xmlHttp.readyState == 4 )
                {
                        // alert("xmlHttp.status: "+xmlHttp.status);
                        if ( xmlHttp.status == 200 )
                        {
                                if ( xmlHttp.responseText == 'False' )
                                {
                                        document.getElementById("seoresult").innerHTML = '&nbsp;&nbsp;<font color="#009900">Beschikbaar</font>';
                                }
                                else if ( xmlHttp.responseText == 'Nothing' )
                                {
                                        document.getElementById("seoresult").innerHTML = '&nbsp;&nbsp;';
                                }
                                else
                                {
										// alert (xmlHttp.responseText);
                                        document.getElementById("seoresult").innerHTML = '&nbsp;&nbsp;<font color="#dd0000">' + xmlHttp.responseText + '</font>';
                                }
                        }
                }
        }
        
        xmlHttp.open("POST", "serp.php?keywords=" + keywords + "&depth=" + depth + "&domain=" + domain, true);
        xmlHttp.send('');
}


  
