function berekenvaluta(el){
	aantal=parseFloat(el.value.replace(',','.'));
	koers=parseFloat(document.getElementById('CZK_hidden').value);
	document.getElementById('CZK_zichtbaar').value=CurrencyFormatted((aantal*koers));
}
function berekenvalutaTerug(el){
	aantal=parseFloat(document.getElementById('CZK_zichtbaar').value.replace(',','.'));
	koers=parseFloat(document.getElementById('CZK_hidden').value);
	document.getElementById('aantalKoers').value=CurrencyFormatted((aantal/koers));
}
function CurrencyFormatted(amount)
{
	amount=Math.round(amount*100)/100;
	s=amount.toString().replace('.',',');
	return s;
}
function importCUR(url)
{
	var loader= (window.ActiveXObject) ? new ActiveXObject("Microsoft.XMLHTTP"): new XMLHttpRequest();
	loader.open('GET', url, false);
	loader.send(null);
	s = new String();
	s=trim(loader.responseText.toString());
	document.getElementById('CZK_hidden').value=s;
	document.getElementById('CZK_zichtbaar').value=CurrencyFormatted(s);
}
function trim(str) {
        return str.replace(/^\s+|\s+$/g,"");
    }
window.onload=function (){
	importCUR(ajaxURL+'currency.php');
}
