function ImgCange01() {
    document.getElementById("img01").src == "/mediadata/icon_a-minus.gif";
    
    if (document.getElementById("img03").src = "/mediadata/icon_a-plus_akt.gif")
       {document.getElementById("img03").src = "/mediadata/icon_a_plus.gif";
        document.getElementById("img01").src = "/mediadata/icon_a-minus_akt.gif";}
        
    if (document.getElementById("img02").src = "/mediadata/icon_a_akt.gif")
        {document.getElementById("img02").src = "/mediadata/icon_a.gif";
        document.getElementById("img01").src = "/mediadata/icon_a-minus_akt.gif";}            
        
        document.getElementById("img02").src = "/mediadata/icon_a.gif";
        document.getElementById("img03").src = "/mediadata/icon_a_plus.gif";
}
function ImgCange02() {
    document.getElementById("img01").src = "/mediadata/icon_a-minus.gif";
        document.getElementById("img02").src = "/mediadata/icon_a_akt.gif";
            document.getElementById("img03").src = "/mediadata/icon_a_plus.gif";
}
function ImgCange03() {
    document.getElementById("img01").src = "/mediadata/icon_a-minus.gif";
        document.getElementById("img02").src = "/mediadata/icon_a.gif";
            document.getElementById("img03").src = "/mediadata/icon_a-plus_akt.gif";
}

function getElementsByClassNameAndTag(classname,tag) {
     if(!tag) tag = "*";
     var anchs =  document.getElementsByTagName(tag);
     var total_anchs = anchs.length;
     var regexp = new RegExp('\\b' + classname + '\\b');
     var class_items = new Array()
     var idname = document.getElementById(classname);
     if (idname) {
        class_items.push(idname);
     }
     else {
        for(var i=0;i<total_anchs;i++) { //Go thru all the links seaching for the class name
            var this_item = anchs[i];
            if(regexp.test(this_item.className)) {
                class_items.push(this_item);
            }
        }
    }
    return class_items;
}




document.getElementsByClassName = function(clsName){
    var retVal = new Array();
    var elements = document.getElementsByTagName("*");
    for(var i = 0;i < elements.length;i++){
        if(elements[i].className.indexOf(" ") >= 0){
            var classes = elements[i].className.split(" ");
            for(var j = 0;j < classes.length;j++){
                if(classes[j] == clsName)
                    retVal.push(elements[i]);
            }
        }
        else if(elements[i].className == clsName)
            retVal.push(elements[i]);
    }
    return retVal;
}


openContext = function()
{
    activeNav = document.getElementsByClassName('activea');
    
    
    for(i = 0; i<=  activeNav.length -1; i++ )
    {
        if (document.getElementsByClassName('activea')[i].innerHTML == "INDEX")
        {        
            if(document.getElementById('indexblock')){document.getElementById('indexblock').className = "open";}
        }
        if (document.getElementsByClassName('activea')[i].innerHTML == "TRAUB")
        {        
            if(document.getElementById('traubblock')){document.getElementById('traubblock').className = "open";}
        }
    
    }
}



/*** Settings Raisfactor End ***/
function changeContentFontSize(nameClass, mode, factor, maxSize, minSize) {
    var schriftgroesse = getElementsByClassNameAndTag(nameClass, 'div')[0].style;
    if (schriftgroesse.fontSize==""){
        getElementsByClassNameAndTag(nameClass, 'div')[0].style.fontSize="1em"
    }    
    if (mode=="raise") {
        if (schriftgroesse.fontSize.replace("em", '') < maxSize) {
            schriftgroesse.fontSize = schriftgroesse.fontSize.replace("em", '') * factor+'em';
        }
    }
    if (mode=="raise2") {
        if (schriftgroesse.fontSize.replace("em", '') > minSize) {
            schriftgroesse.fontSize = schriftgroesse.fontSize.replace("em", '') / factor+'em';
        }
    }
    
    
 }


function raiseContentSize() {
     //changeContentFontSize('classe/id', 'raise', 'factor', 'max', 'min');
     getElementsByClassNameAndTag('container', 'div')[0].style.fontSize="1.4em";
     getElementsByClassNameAndTag('startTeaser', 'div')[0].style.fontSize="1.1em";}

function raise2ContentSize() {
     getElementsByClassNameAndTag('container', 'div')[0].style.fontSize="1.2em";
     getElementsByClassNameAndTag('startTeaser', 'div')[0].style.fontSize="1.1em;" }

function standardContentSize() {
     getElementsByClassNameAndTag('container', 'div')[0].style.fontSize="1em";
     getElementsByClassNameAndTag('startTeaser', 'div')[0].style.fontSize="1.1em;"}

function raiseContentSizeStart() {
     //changeContentFontSize('classe/id', 'raise', 'factor', 'max', 'min');
     getElementsByClassNameAndTag('topNavi', 'div')[0].style.fontSize="1.4em";
     getElementsByClassNameAndTag('containercontext', 'div')[0].style.fontSize="1.4em";
     getElementsByClassNameAndTag('bottomTeaser', 'div')[0].style.fontSize="1.4em";
     getElementsByClassNameAndTag('footer', 'div')[0].style.fontSize="1.4em";
}
function raise2ContentSizeStart() {
     getElementsByClassNameAndTag('topNavi', 'div')[0].style.fontSize="1.2em";
     getElementsByClassNameAndTag('containercontext', 'div')[0].style.fontSize="1.2em";
     getElementsByClassNameAndTag('bottomTeaser', 'div')[0].style.fontSize="1.2em";
     getElementsByClassNameAndTag('footer', 'div')[0].style.fontSize="1.2em"; }
function standardContentSizeStart() {
     getElementsByClassNameAndTag('topNavi', 'div')[0].style.fontSize="1em";
     getElementsByClassNameAndTag('containercontext', 'div')[0].style.fontSize="1em";
     getElementsByClassNameAndTag('bottomTeaser', 'div')[0].style.fontSize="1em";
     getElementsByClassNameAndTag('footer', 'div')[0].style.fontSize="1em";}


function openContextBlock(ziel){        
    if (ziel.parentNode.className == "closed"){
        ziel.parentNode.className="open";
    } else {
        ziel.parentNode.className="closed";
    }
}
/**
 * Image Slideshow
 * 
 * @author FrHe@edoras, 2006-01-21
 * @editor EuKr@edoras, 2006-06-29
 *   
 * @param  elementId         PageId of the RedDot slideshow element
 * @param  placeholderImage  Placeholder image if slideshow is empty
 */   
 
 function footerfix()
 {     
     // Fix for IE 6 Rendering bug
    document.getElementById('containercontent').style.position="static";
    document.getElementById('containercontent').style.position="relative";
 }

function slideshow(elementId)
{
  this.slideshowImages       = new Array();
  this.slideshowCaption         = new Array();
  this.slideshowDescriptions = new Array();
  this.slideshowPopupLinks   = new Array();
  this.slideshowPopupHeadline= new Array();
  this.slideshowPopupText    = new Array();
  this.counter               = 0;
  this.totalImages           = 0;
  this.elementId             = elementId;
  /**
   * Push an image into the slideshow
   *
   * @param  image        Image filename
   * @param  description  Image description
   * @param  popuplink    Link to the image popup template
   */  
  this.pushImage = function(image, caption, description, popuplink, popupheadline, popuptext)
  {
    this.slideshowImages.push(image);
    this.slideshowCaption.push(caption);
    this.slideshowDescriptions.push(description);
    this.slideshowPopupLinks.push(popuplink);
    this.slideshowPopupHeadline.push(popupheadline);
    this.slideshowPopupText.push(popuptext);
  }
    /*
     * EuKr Popupscript - You can change here the HTML-Code of the POPUP  
     */
  this.imagePopUp = function(slideshowItem, itemNumber){
 
    popUpImage = window.open('', "ueberschrift", "width=500,height=700,scrollbars=yes,resizable=yes");
    popUpImage.document.open('text/html');
    // POPUP HTML-TEXT
    popUpImage.document.writeln('<!'+'DOC'+'TYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">');
    popUpImage.document.writeln('<ht'+'ml xmlns="http://www.w3.org/1999/xhtml" xml:lang="de" lang="de">');
    popUpImage.document.writeln('<he'+'ad>');
    popUpImage.document.writeln('<title>'+this.slideshowCaption[itemNumber]+'</title>');
    popUpImage.document.writeln('<meta name="keywords" content="" />    <meta name="description" content="Indexwerke" />');
    popUpImage.document.writeln('<meta http-equiv="content-type" content="text/html; charset=utf-8" />');
    popUpImage.document.writeln('<meta http-equiv="imagetoolbar" content="no" />');
    popUpImage.document.writeln('<meta name="author" content="Indexwerke" />');
    popUpImage.document.writeln('<meta name="copyright" content="Indexwerke" />');
    popUpImage.document.writeln('<meta name="page-topic" content="" />');
    popUpImage.document.writeln('<meta name="audience" content="all" />');
    popUpImage.document.writeln('<meta name="robots" content="index, follow" />');
    popUpImage.document.writeln('<style>');
    popUpImage.document.writeln('</he'+'ad>');
    popUpImage.document.writeln('<bo'+'dy>');
    popUpImage.document.writeln('html {height:100%; width:100%;}');
    popUpImage.document.writeln('body {font-family: arial, verdana; height:100%; width:100%; background:#ffffff; font-size:62.5%; margin:0px;}');
    popUpImage.document.writeln('img {border:0px; float:right;    }');
    popUpImage.document.writeln('img {border:0px; float:right;    }');
    popUpImage.document.writeln('.homelink img{margin:11px;}');
    popUpImage.document.writeln('.clear {clear:both; line-height:0px;}');
    popUpImage.document.writeln('.popup {text-align:left; margin:0px; width:100%;}');
    popUpImage.document.writeln('.popup h1 {background:#b9babe; color:#FFFFFF; font-size:1.2em; text-align:left; padding:0px 0px 0px 10px;    }');
    popUpImage.document.writeln('.popup .popupdescription {background:transparent url(/mediadata/hr.gif) repeat-x bottom; color:#000; font-size:1.1em; text-align:left; padding:0px 0px 3px 0px; margin:0px 10px 0px 10px;}');
    popUpImage.document.writeln('.popup .popupimg {background:transparent url(/mediadata/hr.gif) repeat-x bottom;    margin:0px 10px;padding:1px 0px 2px 0px;}');
    popUpImage.document.writeln('.popup .popupimg img {float:none;    }');
    popUpImage.document.writeln('.popup .ancicon {        font-size:1.1em; font-weight:bold; float:right; background-image: url(/mediadata/arrow.gif); background-position: 0 .45em; background-repeat: no-repeat; color:#747378; padding-left:6px; margin:5px 10px;    text-decoration:none;}    ');
    popUpImage.document.writeln('.popup .ancicon:hover {        background-image: url(/mediadata/arrow_black.gif); color:#000;    text-decoration:none; }');
    popUpImage.document.writeln('</style>');
    popUpImage.document.writeln('<div style="height:25px;"><br class="clear" /></div>');
    popUpImage.document.writeln('<div class="popup">    ');
    popUpImage.document.writeln('<h1 style="margin-bottom:5px; padding:3px 0 3px 10px;">'+ this.slideshowPopupHeadline[itemNumber]+'</h1><span class="clear" /></span>');
    popUpImage.document.writeln('<div class="popupdescription" style="padding-bottom:5px;">'+this.slideshowPopupText[itemNumber]+'</div><br class="clear" />');
    popUpImage.document.writeln('<div class="popupimg"><img src="'+this.slideshowPopupLinks[itemNumber]+'" onload="window.resizeTo(this.offsetWidth+50,this.offsetHeight+280)"  /></div>');
    popUpImage.document.writeln('<a class="ancicon" onclick="window.close();" href="#"  >St&auml;ng f&ouml;nster</a>');
    popUpImage.document.writeln('<br class="clear" />');
    popUpImage.document.writeln('</div>');
    popUpImage.document.writeln('</body>');
    popUpImage.document.writeln('</html>');
    
    popUpImage.document.close();
  }
  /**
   * Init slideshow after all images were added, load the first image in array
   */     
  this.initSlideshow = function()
  {
    document.getElementById('defaultImage' + this.elementId).style.display="none";
    document.getElementById('border' + this.elementId).style.display="block";
    document.getElementById('max' + this.elementId).innerHTML     = this.slideshowImages.length;
    
    this.totalImages = this.slideshowImages.length;
    
    if (this.totalImages > 0)
    {
      // Load first picture and properties
      //document.getElementById('MainArticleInBlock' + this.elementId).style.display = 'block';
      this.updateSlideshow(this.elementId, 0);
      // Display slideshow navigation only if there is more than one image
      if (this.totalImages >= 2) {
        document.getElementById('galleryHeader' + this.elementId).style.display = 'block';
        document.getElementById('GalleryNavigation' + this.elementId).style.display = 'block';
        document.getElementById('border' + this.elementId).className                = 'gallerImageCont';
      } else {
        document.getElementById('border' + this.elementId).className = 'gallerImageCont noBorder';
        /*if (document.getElementById('text' + this.elementId).innerHTML != ''){
            document.getElementById('border' + this.elementId).className = 'gallerImageCont';    
        }*/      
      }
    
      // Set total number of images
      document.getElementById('max' + this.elementId).innerHTML     = this.slideshowImages.length;
      
    }
    
  }
  /**
   * Loads previous image if current image is not the first slideshow image
   */     
  this.previousImage = function()
  {
    if (this.counter > 0)
    {
      this.counter--;
      this.updateSlideshow(this.elementId, this.counter);
    }
  }
  /**
   * Loads next image if current image is not the last slideshow image
   */     
  this.nextImage = function()
  {
    if (this.counter < this.slideshowImages.length - 1)
    {
      this.counter++;
      this.updateSlideshow(this.elementId, this.counter);
    }
  }
  /**
   * Opens the detail image popup
   * 
   * @param  width   width of the popup window
   * @param  height  height of the popup window         
   */     
  this.zoomImage = function(width, height)
  {
    var popupUrl = (this.slideshowPopupLinks[this.counter] != '') ? this.slideshowPopupLinks[this.counter] : '';
    window.open(popupUrl, 'slideshowPopup', 'width=' + width + ', height='+ height + ', resizable=yes');
  }
  /*
   * Used internally to update the slideshow element
   */
  this.updateSlideshow = function(slideshowItem, itemNumber)
  {
    document.getElementById('image' + slideshowItem).src                = this.slideshowImages[itemNumber];    
    
    // Display current image number and description
    document.getElementById('akt' + slideshowItem).innerHTML              = itemNumber + 1;
    
   
    document.getElementById('imageCaption' + slideshowItem).innerHTML     = this.slideshowCaption[itemNumber];
    
    document.getElementById('zoomIcon' + slideshowItem).style.display = (this.slideshowPopupLinks[itemNumber] != "")? "block" : "none";
    
    if (document.getElementById('imageCaption' + slideshowItem).innerHTML != ''){        
        document.getElementById('imageCaption' + slideshowItem).style.display = 'block';
    }else{
        document.getElementById('imageCaption' + this.elementId).style.display = 'none';    
    }
    
    document.getElementById('text' + slideshowItem).innerHTML            = this.slideshowDescriptions[itemNumber];
    
    if (document.getElementById('text' + slideshowItem).innerHTML == ''||document.getElementById('text' + slideshowItem).innerHTML == ' '){
        document.getElementById('text' + slideshowItem).style.display = 'none';
    } else {
        document.getElementById('text' + slideshowItem).style.display = 'block';
        //document.getElementById('border' + slideshowItem).className   = 'gallerImageCont';
    }    
        footerfix();
    }
    
}

/*** JS for CC Location ***/
function getValue(){
    a = document.forms[0].elements[0].options[document.forms[0].elements[0].options.selectedIndex].value;
    window.location.href = a;
}
function getValue2(){
    a = document.forms[0].elements[1].options[document.forms[0].elements[1].options.selectedIndex].value;
    window.location.href = a;
}



function addLoadEvent(func) {
    var oldonload = window.onload;
    if (typeof window.onload != "function") {
        window.onload = func;
    } else {
        window.onload = function () {if (oldonload) {oldonload();}func();};
    }
}
addLoadEvent( function(){ add_print_link( 'nav' ) } );

function add_print_link( id ){
 if( !document.getElementById ||
 !document.getElementById( id ) ) return;

 // add extra functions to page tools list
 var print_page = document.getElementById( id );

 // create print link
 var print_function = document.createElement('p');
 print_function.className = 'print-link';
 print_function.onclick = function(){ print_preview(); return false; };
 print_function.appendChild( document.createTextNode( 'Print the Page' ) );

}

function print_preview() {
 // Switch the stylesheet
 setActiveStyleSheet('Print Preview');

 // Create preview message
 add_preview_message();

 // Print the page
 window.print();
}

function add_preview_message(){
var main_content = document.getElementById('content');
var main_body = main_content.parentNode;

 if (document.getElementById){

 var preview_message = document.createElement('div');
 preview_message.id = 'preview-message';

 // Create Heading
 var preview_header = document.createElement('h3');
 var preview_header_text = document.createTextNode('This is a print preview of this page');
 preview_header.appendChild(preview_header_text);

 // Create paragraph
 var preview_para = document.createElement('p');
 var preview_para_text = document.createTextNode('Without this message of course. ');

 var cancel_function_link = document.createElement('a');
 cancel_function_link.onclick = function(){ cancel_print_preview(); return false; };
 cancel_function_link.setAttribute('href', '#');
 var cancel_function_link_text = document.createTextNode('Return to the existing page.');
 cancel_function_link.appendChild(cancel_function_link_text);
 preview_para.appendChild(preview_para_text); //
 preview_para.appendChild(cancel_function_link);

 // Put it all toegether
 preview_message.appendChild(preview_header);
 preview_message.appendChild(preview_para);
 main_body.insertBefore(preview_message, main_content);
 }
}

function cancel_print_preview() {
 // Destroy the preview message
 var print_preview = document.getElementById('preview-message');
 var main_body = print_preview.parentNode;
 main_body.removeChild(print_preview);

 // Switch back stylesheet
 setActiveStyleSheet('default');
}

function setActiveStyleSheet(title) {
 var i, a, main;
 for(i=0; (a = document.getElementsByTagName("link")[i]); i++) {
 if(a.getAttribute("rel").indexOf("style") != -1
 && a.getAttribute("title")) {
 a.disabled = true;
 if(a.getAttribute("title") == title) a.disabled = false;
 }
 }
}