// JavaScript Document
var oXHR = false;
if (window.XMLHttpRequest){
	oXHR = new XMLHttpRequest();
} else if (window.ActiveXObject) {
	oXHR = new ActiveXObject("Microsoft.XMLHTTP");
}

function getData (dataSource, divID, thefunction, thedefault) {
	//alert(dataSource);
	var thisobj = document.getElementById(divID);
	if (oXHR){
		if (thedefault != '') {thisobj.innerHTML = '' + thedefault + '';}		
		oXHR.open('GET', dataSource);
		oXHR.onreadystatechange = function(){
			if (oXHR.readyState == 4 && oXHR.status == 200){
				thisobj.style.display = '';
				thisobj.innerHTML = oXHR.responseText;
				if (thefunction != ''){
					eval(thefunction);	
				}
			}
		}
		oXHR.send(null);
	}

}

function fillData (dataSource, defval, obj) {
	//alert(dataSource);
	var thisobj = document.getElementById(obj);
	if (oXHR){
		oXHR.open('GET', dataSource);
		oXHR.onreadystatechange = function(){
			if (oXHR.readyState == 4 && oXHR.status == 200){thisobj.value= defval + '' + oXHR.responseText;}
		}
		oXHR.send(null);
	}
}