
function Ajax() {
    var xmlHttp;
    var destinationID;

    // sets destination element I
    this.setDestination = function (obj) {
	destinationID = obj;
    }

    this.getByIdInInner = function (url, id) {
	this.setDestination(id);
	this.get(url);
    }

    this.get = function (url) {
	xmlHttp = this.createObject();
	if (xmlHttp==null)
	    {
		alert ("Your browser does not support AJAX!");
		return;
	    }
	xmlHttp.onreadystatechange= this.getContent;
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
    }

    this.createObject = function () {

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

    this.getContent = function () {

	if (xmlHttp.readyState==4)
	    {
		document.getElementById(destinationID).innerHTML=xmlHttp.responseText;
	}
    }

}
