﻿function gallerie() {
	bildchen = document.getElementById("uebersicht").getElementsByTagName("li");
	for(bi=0;bi<bildchen.length;bi++){
		bildchen[bi].onmouseover = function() {
			this.style.width = "85px";
			this.style.height = "85px";
			this.style.border = "4px solid #F7931E";
			bilder = this.getElementsByTagName("img");
			bilder[0].style.margin = "-4px";
		}
		bildchen[bi].onmouseout = function() {
			this.style.width = "93px";
			this.style.height = "93px";
			this.style.border = "0px";
			bilder = this.getElementsByTagName("img");
			bilder[0].style.margin = "0px";
		}
		bildchen[bi].onclick = function() {
			klein = this.getElementsByTagName("img");
			tausch = document.getElementById("bildgross").getElementsByTagName("img");
			tausch[0].src = klein[0].src.substr(0,klein[0].src.lastIndexOf("/")+1)+klein[0].src.substr(klein[0].src.lastIndexOf("_")+1);
			text(klein[0].src.substr(0,klein[0].src.lastIndexOf("/")+1)+klein[0].src.substr(klein[0].src.lastIndexOf("_")+1).replace("jpg","txt"));
		}
	}
}
function text(datei) {
	var xmlHttp = null;
	if (typeof XMLHttpRequest != 'undefined') {
		xmlHttp = new XMLHttpRequest();
	}
	if (!xmlHttp) {
		try {
			xmlHttp  = new ActiveXObject("Msxml2.XMLHTTP");
		} catch(e) {
			try {
				xmlHttp  = new ActiveXObject("Microsoft.XMLHTTP");
			} catch(e) {
				xmlHttp  = null;
			}
		}
	}
	if (xmlHttp) {
		xmlHttp.open('GET', datei, true);
		xmlHttp.onreadystatechange = function () {
			if (xmlHttp.readyState == 4) {
				document.getElementById("seitentext").innerHTML = xmlHttp.responseText;
			}
		};
		xmlHttp.send(null);
	}
}
