if(document.all) {
function alert_timeout() {
        
	alert("Die Abfrage dauert leider zu lang. Bitte probieren Sie es sp&auml;ter nochmal.");
}

var xdr;

function loadedContent() {
	
	document.getElementById('vis3result').innerText = xdr.responseText;
}

function requestVis3() {
        
	var url = 'http://public.seodiver.com/d.api?d=sv&url=' + document.getElementById('vis3input').value + '&format=text&decimals=4&decimal=,';
	var timeout = 300000;
	if (window.XDomainRequest) 
       {
            xdr = new XDomainRequest(); 
            if (xdr)
            {

              xdr.ontimeout = alert_timeout;
              xdr.timeout = timeout;
		xdr.onload = loadedContent;
              xdr.open("get", url);                        
              xdr.send();
            }
            else
            {
                alert('Failed to create new XDR object.');
            }
        }
        else
        {
            alert('XDR does not exist.');
        }
}
} else {
function requestVis3() {           
            $hp = $('#vis3input').val();
            
            $resultNode = $('#vis3result');
            $resultNode.empty();
            $now = $.now();
            
            $.support.cors = true;
            
            $.ajax({
                  url : 'http://public.seodiver.com/d.api?d=sv&url=' + $hp + '&format=json&decimals=4&decimal=,&_=' + $now ,
                  method : 'GET',
                  timeout: 300000,
                  cache: false,
                  dataType : 'json',
                  beforeSend: function(xhr){
                         xhr.withCredentials = true;
                  },
                  success: function( jsonData ) {
                  if(jsonData && jsonData.value) {
                        $resultNode.html(jsonData.value);
                  }
                  }
            });  
}
}
