


http_mod_request = false;
mod_action = "";

if (window.XMLHttpRequest) { // Mozilla, Safari,...
	http_mod_request = new XMLHttpRequest();
	if (http_mod_request.overrideMimeType) {
		http_mod_request.overrideMimeType('text/xml');
		// zu dieser Zeile siehe weiter unten
	}
} else if (window.ActiveXObject) { // IE
	try {
		http_mod_request = new ActiveXObject("Msxml2.XMLHTTP");
	} catch (e) {
		try {
			http_mod_request = new ActiveXObject("Microsoft.XMLHTTP");
		} catch (e) {}
	}
}



http_mod_request.onreadystatechange = function(){
	if(http_mod_request.readyState == 1){
		document.getElementById('loader').style.visibility = "visible";
	}
			
	// geladen
	if(http_mod_request.readyState == 4){
		document.getElementById('loader').style.visibility = "hidden";
		eval(http_mod_request.responseText);
		switch(mod_action){
			case 'add_tag':
				document.getElementById('new_tags_area').innerHTML = document.getElementById('new_tags_area').innerHTML + " " + added_tags;
			break;
			
			case 'update_linker_date':

			break;
		}
		
		mod_action = "";
	}
}
	


function add_tag(id0,new_tags){
	mod_action = "add_tag";
	http_mod_request.open('GET', "http://www.kottonau.ch/kome/scripts/modification_interface/tags/update_tags.php?id0="+id0+"&new_tags="+new_tags.value, true);
	http_mod_request.send(null);
	new_tags.value = ""; // Eingabefeld leeren	   
}


// Interface zum erstellen oder aktualisieren von Übersetzungsinhalten 
function update_content_translation(id0,type,content,language){
	mod_action = "update_content_translation";
	http_mod_request.open('GET', "http://www.kottonau.ch/kome/scripts/modification_interface/translation/update_content_translation.php?id0="+id0+"&types="+type+"&content="+content+"&lang="+language, true);
	http_mod_request.send(null);
}


function update_linker_date(id0){
	mod_action = "update_linker_date";
	http_mod_request.open('GET', "http://www.kottonau.ch/kome/scripts/modification_interface/linker/update_linker_data.php?id0="+id0+"&action=update_linker_date", true);
	http_mod_request.send(null);
}




