function loadXMLDoc(dname) {
	if (window.XMLHttpRequest) {
		xhttp=new XMLHttpRequest();
	} else {
		xhttp=new ActiveXObject("Microsoft.XMLHTTP");
	}
	xhttp.open("GET",dname,false);
	xhttp.send("");
	return xhttp.responseXML;
}


function loadXMLString(txt) {
	if (window.DOMParser) {
		parser=new DOMParser();
		xmlDoc=parser.parseFromString(txt,"text/xml");
	} else { // Internet Explorer
		xmlDoc=new ActiveXObject("Microsoft.XMLDOM");
		xmlDoc.async="false";
		xmlDoc.loadXML(txt);
	}
	return xmlDoc;
}


function displayResult() {
	xml=loadXMLDoc("katalog.xml");
	xsl=loadXMLDoc("katalog.xsl");
	// code for IE
	if (window.ActiveXObject) {
		ex= ment.getElementById("example").innerHTML=ex;
	} else if (document.implementation && document.implementation.createDocument)
	{  // code for Mozilla, Firefox, Opera, etc.
		xsltProcessor=new XSLTProcessor();
		xsltProcessor.importStylesheet(xsl);
		resultDocument = xsltProcessor.transformToFragment(xml,document);
		document.getElementById("example").appendChild(resultDocument);
	}
}


function table_from_xsl(xmlfn, xslfn, target)  {
	xml=loadXMLDoc(xmlfn);
	xsl=loadXMLDoc(xslfn);
	// code for IE
	if (window.ActiveXObject)
	{
		ex=xml.transformNode(xsl);
		document.getElementById(target).innerHTML=ex;
	} else if (document.implementation && document.implementation.createDocument)
	{  // code for Mozilla, Firefox, Opera, etc.
		xsltProcessor=new XSLTProcessor();
		xsltProcessor.importStylesheet(xsl);
		resultDocument = xsltProcessor.transformToFragment(xml,document);
		document.getElementById(target).appendChild(resultDocument);
	}
}


function katalogSelect(i) {
	document.getElementById("showKatalogDebug").textContent  = i+" klickedO";
	window.frames['inhalt'].href = "katalog.html";
	document.getElementById("showKatalogDebug2").textContent  = i+" klickedO";
	window.frames['inhalt'].document.getElementById("showKatalogDebug2").textContent  = i+" klickedO";
	window.frames['inhalt'].document.getElementById("showKatalogDebug2").textContent  = i+" klickedO";
	window.frames['inhalt'].document.getElementById("Streichorchester").style.visibility  = "collapse";
	window.frames['inhalt'].document.getElementById("Kammerorchester").style.visibility   = "collapse";
	window.frames['inhalt'].document.getElementById("Sinfonieorchester").style.visibility = "collapse";
	window.frames['inhalt'].document.getElementById("Solokonzerte").style.visibility      = "visible";
	window.frames['inhalt'].document.getElementById("DuoTrio").style.visibility           = "collapse";
	window.frames['inhalt'].document.getElementById("Quartett").style.visibility          = "collapse";
	window.frames['inhalt'].document.getElementById("QuintettMehr").style.visibility      = "collapse";
}
function katalogOff() {
	document.getElementById("showKatalogDebug").textContent  = i+" klickedO";
	location.href = "katalog.html";
	document.getElementById("showKatalogDebug2").textContent  = i+" klickedO";
	window.frames['inhalt'].document.getElementById("showKatalogDebug2").textContent  = i+" klickedO";
	window.frames['inhalt'].document.getElementById("showKatalogDebug2").textContent  = i+" klickedO";
	window.frames['inhalt'].document.getElementById("Streichorchester").style.visibility  = "collapse";
	window.frames['inhalt'].document.getElementById("Kammerorchester").style.visibility   = "collapse";
	window.frames['inhalt'].document.getElementById("Sinfonieorchester").style.visibility = "collapse";
	window.frames['inhalt'].document.getElementById("Solokonzerte").style.visibility      = "visible";
	window.frames['inhalt'].document.getElementById("DuoTrio").style.visibility           = "collapse";
	window.frames['inhalt'].document.getElementById("Quartett").style.visibility          = "collapse";
	window.frames['inhalt'].document.getElementById("QuintettMehr").style.visibility      = "collapse";
}

function UnCryptMailto(s, shift) {
	var n=0;
	var r="";
	for(var i=0;i<s.length;i++) { 
		n=s.charCodeAt(i); 
		if (n>=8364) {n = 128;}
		r += String.fromCharCode(n-(shift)); 
	}
	return r;
}
function linkTo_UnCryptMailto(s, shift)	{
	location.href=UnCryptMailto(s, shift);
}

