function ladeContainer (zielContainer, zielUrl) {
	with (new Ajax()) {
		container = zielContainer;
		url	  = "formatInIsoNorm.php?file=" + zielUrl;
		method    = "GETPHP";
		params="";
		onSuccess = function(txt,xml){
			document.getElementById(container).innerHTML = txt;
		};
		doRequest();
	}
}

function ladeContainerOhneIso (zielContainer, zielUrl) {
	with (new Ajax()) {
		container = zielContainer;
		url	  = zielUrl;
		method    = "GETPHP";
		params="";
		onSuccess = function(txt,xml){
			document.getElementById(container).innerHTML = txt;
			tb_init('a')
		};
		doRequest();
	}
}

function Ajax(){
	this.ready = false;	
	this.url = "";
	this.params = "";
	this.method = "GET";
	this.onSuccess = null;
	this.onError = function (msg) {
		alert(msg);
	};
}

Ajax.prototype.doRequest = function() {
	//Überprüfen der Angaben
	if (!this.url) {
		this.onError("Keine URL angegeben. Request abgebrochen");
		return false;
	}
	
	if (!this.method) {
		this.method = "GET";
	} else {
		this.method = this.method.toUpperCase();
	}
	
	//XMLHttpRequest-Object erstellen
	var xmlHttpRequest = getXMLHttpRequest();
	
	if(!xmlHttpRequest) {
		this.onError("Es konnte kein XMLHttpRequest Object erstellt werden");
		return false;
	}
	
	//Zugriff für readyStateHandler auf Klasse ermöglichen
	var _this = this;
	
	switch (this.method) {

		case "GETPHP": xmlHttpRequest.open("GET", this.url, true);
					xmlHttpRequest.onreadystatechange = readyStateHandler;
					xmlHttpRequest.send(null);
					break;

		case "GET": xmlHttpRequest.open(this.method, this.url + "?" + this.params, true);
					xmlHttpRequest.onreadystatechange = readyStateHandler;
					xmlHttpRequest.send(null);
					break;
		case "POST": xmlHttpRequest.open(this.method, this.url, true);
					 xmlHttpRequest.onreadystatechange = readyStateHandler;
					 xmlHttpRequest.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
					 xmlHttpRequest.send(this.params);
					 break;					
	}
	
	function readyStateHandler(){
		_this.state = xmlHttpRequest.readyState;
		
		if (xmlHttpRequest.readyState < 4) {
			return false;
		}
		if (xmlHttpRequest.status == 200 ||xmlHttpRequest.status == 304 ) {
			if (_this.onSuccess) {
				_this.onSuccess(xmlHttpRequest.responseText, xmlHttpRequest.responseXML);
				_this.ready = true;
			}
		}
		else {
			if (_this.onError) {
				_this.onError("[" + xmlHttpRequest.status + " " + xmlHttpRequest.statusText + "] Fehler bei Datenübertragung!");
			}
		}
	}
}

Ajax.prototype.hasLoaded = function(){
	return this.ready;
}

function getXMLHttpRequest(){
	if (window.XMLHttpRequest) {
		// firefox, opera, safari, ...
		return new XMLHttpRequest();
	}
	else {
		if (window.ActiveXObject) {
			try {
				// neuer IE
				return new ActiveXObject("Msxml2.XMLHTTP");
			}
			catch (e) {
				try {
					// alter IE
					return new ActiveXObject("Microsoft.XMLHTTP");
				}
				catch (e) {
					return null;
				}
			}
		}
	}
	return null;
}