var xmlHttp

function loonttl(str)
{ 
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }
var url="berekenttl.php"
url=url+"?ttl="+str
url=url+"&kvr="+document.loonform.kvr.value
url=url+"&sid="+Math.random()
xmlHttp.onreadystatechange=stateChanged 
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}

function loonnetto(str)
{ 
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }
var url="berekennetto.php"
url=url+"?netto="+str
url=url+"&kvr="+document.loonform.kvr.value
url=url+"&sid="+Math.random()
xmlHttp.onreadystatechange=stateChanged 
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}

function loonbruto(str)
{ 
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }
var url="berekenbruto.php"
url=url+"?bruto="+str
url=url+"&kvr="+document.loonform.kvr.value
url=url+"&sid="+Math.random()
xmlHttp.onreadystatechange=stateChanged 
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}

function stateChanged() 
{ 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 { 
xmlDoc=xmlHttp.responseXML;
document.loonform.kvr.value=xmlDoc.getElementsByTagName("kvr")[0].childNodes[0].nodeValue;
document.loonform.uitkoop.value=xmlDoc.getElementsByTagName("uitkoop")[0].childNodes[0].nodeValue;
document.getElementById("ttl").innerHTML=xmlDoc.getElementsByTagName("ttl")[0].childNodes[0].nodeValue;
document.getElementById("pr_wg").innerHTML=xmlDoc.getElementsByTagName("premiewg")[0].childNodes[0].nodeValue;
document.loonform.brutoloon.value=xmlDoc.getElementsByTagName("bruto")[0].childNodes[0].nodeValue;
document.getElementById("pr_wn").innerHTML=xmlDoc.getElementsByTagName("premiewn")[0].childNodes[0].nodeValue;
document.getElementById("lb").innerHTML=xmlDoc.getElementsByTagName("lb")[0].childNodes[0].nodeValue;
document.loonform.nettoloon.value=xmlDoc.getElementsByTagName("netto")[0].childNodes[0].nodeValue;

 } 
}

function GetXmlHttpObject()
{
var xmlHttp=null;
try
 {
 // Firefox, Opera 8.0+, Safari
 xmlHttp=new XMLHttpRequest();
 }
catch (e)
 {
 //Internet Explorer
 try
  {
  xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
  }
 catch (e)
  {
  xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
 }
return xmlHttp;
}

function alignall(){	
		hMain=document.getElementById('main-block').offsetHeight;
	hLeft=document.getElementById('left-block').offsetHeight;
	hRight=document.getElementById('right-block').offsetHeight;

	h=Math.max(hMain,Math.max(hLeft,hRight))-20;


	document.getElementById('main-block').style.height=h+"px"; 
}

function MM_preloadImages() { //v3.0
	var d=document;
	if(d.images){ 
		if(!d.MM_p) d.MM_p=new Array();    	var i,j=d.MM_p.length,a=MM_preloadImages.arguments;
	for(i=0; i<a.length; i++)
		if (a[i].indexOf("#")!=0){ 
			d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];
		}
	}}