﻿function showMenu(){
        document.write("<table >");
        document.write("<tr style='height:30px;'><td id='m0' align='left' width=150><a href='index.html' class='menu_link'>&nbsp;Home</a></td></tr>");
        document.write("<tr style='height:30px;'><td id='m1' align='left' width=150><a href='programm.htm' class='menu_link'>&nbsp;Das Programm</a></td></tr>");
        document.write("<tr style='height:30px;'><td id='m2' align='left' width=150><a href='kursleitung.htm' class='menu_link'>&nbsp;Kursleitung</a></td></tr>");
        document.write("<tr style='height:30px;'><td id='m7' align='left' width=150><a href='angebot.htm' class='menu_link'>&nbsp;Kursangebote</a></td></tr>");
        document.write("<tr style='height:30px;'><td id='m3' align='left' width=150><a href='termine.htm' class='menu_link'>&nbsp;Termine</a></td></tr>");
        document.write("<tr style='height:30px;'><td id='m4' align='left' width=150><a href='empfehlungen.htm' class='menu_link'>&nbsp;Empfehlungen</a></td></tr>");
        document.write("<tr style='height:30px;'><td id='m5' align='left' width=150><a href='kontakt.htm' class='menu_link'>&nbsp;Kontakt</a></td></tr>");
        document.write("<tr style='height:30px;'><td id='m6' align='left' width=150><a href='impressum.htm' class='menu_link'>&nbsp;Impressum</a></td></tr>");
        document.write("</table>");
        
        var curURL = location.href;
        if(curURL.indexOf("index.html")>0)
            document.getElementById("m0").style.background="background-image: url('images/selected.gif')";
        else if(curURL.indexOf("programm.htm")>0)
            document.getElementById("m1").style.background="background-image: url('images/selected.gif')";
        else if(curURL.indexOf("achtsamkeit.htm")>0)
            document.getElementById("m1").style.background="background-image: url('images/selected.gif')";
        else if(curURL.indexOf("angebot.htm")>0)
            document.getElementById("m7").style.background="background-image: url('images/selected.gif')";
        
        else if(curURL.indexOf("kursleitung.htm")>0)
            document.getElementById("m2").style.background="background-image: url('images/selected.gif')";
        else if(curURL.indexOf("termine.htm")>0)
            document.getElementById("m3").style.background="background-image: url('images/selected.gif')"; 
        else if(curURL.indexOf("empfehlungen.htm")>0)
            document.getElementById("m4").style.background="background-image: url('images/selected.gif')";
        else if(curURL.indexOf("kontakt.htm")>0)
            document.getElementById("m5").style.background="background-image: url('images/selected.gif')";
        else if(curURL.indexOf("impressum.htm")>0)
            document.getElementById("m6").style.background="background-image: url('images/selected.gif')";           
        else
            document.getElementById("m0").style.background="background-image: url('images/selected.gif')";
        
}

function showTermine(){
    var xmlDoc = "";
    try {
        xmlDoc  = new ActiveXObject("Microsoft.XMLDOM");
        xmlDoc.async = "false";
        xmlDoc.load("files/termine.xml");    
        var terminElement = xmlDoc.getElementsByTagName("termin");
        for (var i = 0; i < terminElement.length; i++){
            document.write("<b>" + terminElement.item(i).attributes(0).value + "</b><br /><br />"); 
        
            var textOut =  terminElement.item(i).text;
            textOut = textOut.replace(/\r|\n|\r\n/g, "<br>");
      
            textOut = textOut.replace(/\[f1\]/gi, "<b>");
            textOut = textOut.replace(/\[f2\]/gi, "</b>");
            document.write(textOut + "<hr /><br/>");       
            }
         }
    catch(err){
        
            document.write("<b>Ihr Browser kann diese Seite nicht anzeigen.</b><br/><br/>");
            //document.write("Alle Termine stehen als <a class='text_link' href='../files/termine.pdf' title='Termine' target='_blank'>.pdf Download</a> bereit.");  
            //document.write("<br /><br />");                
               
        }         
}
    
function showEmail(){
    a="info";
    b="mbsr-mudita.de";
    document.write('<a class="text_link" href=\"mailto:'+a+'@'+b+'\">');
    document.write(a+'@'+b+'<\/a>');
}  
