var xmlhttp = false;
if( window.XMLHttpRequest ){
	xmlhttp = new XMLHttpRequest();
	xmlhttp.overrideMimeType('text/html');
}else if( window.ActiveXObject ){
	xmlhttp = new ActiveXObject('Microsoft.XMLHTTP');
}

function get_conversion(){
	
	var amount = document.getElementById('amount').value;
	var from = document.getElementById('from').value;
	var to = document.getElementById('to').value;
	var url = 'ajax_func/converter_func.php?amount=' + amount  + '&from=' + from + '&to=' + to;
	xmlhttp.open('GET',url,true);
	xmlhttp.onreadystatechange = convert;
	xmlhttp.send(null);
}

function convert(){
	if( xmlhttp.readyState == 4 && xmlhttp.status == 200 ){
		//document.getElementById('load_image').style.display = 'none';
		document.getElementById('amount_converted').innerHTML = xmlhttp.responseText;
	}else{
		//document.getElementById('load_image').style.display = '';
	}
}