var SoapUrl = "http://www.onlinecampagne.eu/MessagentSoap/MessagentSOAP.asmx";

function getAddress() {
	var strPostcode   = document.getElementById("POSTCODE").value+document.getElementById("POSTCODE_TOEV").value;
	var strHuisnummer = document.getElementById("HUISNUMMER").value;

	if(strPostcode.length=6 && strHuisnummer != "")
	{
		var pl = new SOAPClientParameters();
		pl.add("Gebruikersnaam", 	"collectieconcepten");
		pl.add("Wachtwoord", 		"coco666");
		pl.add("Postcode", 			strPostcode);
		pl.add("Huisnummer", 		strHuisnummer);
		SOAPClient.invoke(SoapUrl, "CendrisAdresXpress", pl, true, GetAddress_callBack);
	}
};

function GetAddress_callBack(cl)
{
	var straatnaam, huisnummer, postcode, woonplaats, netnummer, status;
	var output = "";
	status = "0";
	if(cl)
	{
		if(cl.length == 0)
		{
			status = "0";
			ParseErrors("HUISNUMMER|POSTCODE|POSTCODE_TOEV");
		}
		else
		{
			straatnaam	= "" + cl.Straat;
			woonplaats	= "" + cl.Woonplaats;
			netnummer	= "" + cl.NetNummer;
			status		= "" + cl.Status;
			
			document.getElementById("STRAATNAAM").value 	= straatnaam != "null" ? straatnaam : "";
			document.getElementById("WOONPLAATS").value 	= woonplaats != "null" ? woonplaats : "";
		}
	}
	else
		ParseErrors("HUISNUMMER|POSTCODE|POSTCODE_TOEV");

	if(status == "0")	// niet gevonden
	{
		document.getElementById("STRAATNAAM").readOnly = false;
		document.getElementById("WOONPLAATS").readOnly = false;
	}
	else
	{
		document.getElementById("STRAATNAAM").readOnly = true;
		document.getElementById("WOONPLAATS").readOnly = true;
	}

}
