var xmlhttp;
var result;
var AJAX_callFunction = null;
var AJAX_callParam = null;

function loadXMLDoc(url, myFunc, myParam) {
	if(myFunc != '' && myFunc != undefined && myFunc != null){
		AJAX_callFunction = myFunc;
	}
	if(myParam != '' && myParam != undefined && myParam != null){
		AJAX_callParam = myParam;
	}
	// Native
	if (window.XMLHttpRequest) {
		xmlhttp = new XMLHttpRequest();
		xmlhttp.onreadystatechange = processStateChange;
		xmlhttp.open("GET", url, false);
		xmlhttp.send('');
	// ActiveX
	} else if (window.ActiveXObject) {
		xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
		if (xmlhttp) {
			xmlhttp.onreadystatechange = processStateChange;
			xmlhttp.open("GET", url, false);
			xmlhttp.send();
		}
	}
}

function processStateChange() {
	if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
		result = xmlhttp.responseText;
		
		document.getElementById('ym_wrapper').innerHTML = result;
		
		if(AJAX_callFunction != null){
			eval(AJAX_callFunction + '(\'' + result + '\', \'' + AJAX_callParam.replace(', ', '\', \'') + '\')');
		}
  }
}

document.write('<span id="ym_wrapper"></span>');

loadXMLDoc('http://www.bootcamp.ro/bunuri/ym/ym.php');
