var test_adress;
function checkAddress(strasse, plz, ort, land, message)
{
	if (is_numeric(ort) || (strasse == '' && plz == '' && ort == ''))
	{
		alert(message);
		return false;
	}

	new Ajax.Request('/customer/ajax/googlemapsadresstest.php?strasse=' + strasse + '&plz=' + plz + '&ort=' + ort + '&land=' + land,
	{
		asynchronous: false,
	    method: 'post',
	    onSuccess: function(transport)
	    {
	        var response = transport.responseText;
	        test_adress = response;

	    },
	    onFailure: function(){ alert('Something went wrong...') }
	});
	
	if (test_adress == 'true')
	{
		return true;
	}
	else
	{
		alert(message);
		return false;
	}
}

function is_numeric(sText)
{
   var ValidChars = "0123456789.";
   var IsNumber=true;
   var Char;

   for (i = 0; i < sText.length && IsNumber == true; i++) 
   { 
      Char = sText.charAt(i); 
      if (ValidChars.indexOf(Char) == -1) 
         {
         IsNumber = false;
         }
   }
   return IsNumber;s 
}
