    
  function hideByID(pID) { 
   document.getElementById(pID).style.display = "none";
  }

  function showByID(pID) { 
    document.getElementById(pID).style.display = "";
  }

  function getValueByID(pID) {
    return document.getElementById(pID).value
  }   
  function setValueByID(pID, pValue) {
    document.getElementById(pID).value = pValue;
  } 
  
  function rmStdValue(pID, pStdValue) {
    if (getValueByID(pID) == pStdValue) {
      setValueByID(pID, '');
    }
  }
  
  function setStdValue(pID, pValue) {
    if (getValueByID(pID) == '') {
      setValueByID(pID, pValue);
    }
  }
  function CJumpyDefaultValue(pID) {
    this.defaultValue = '';
    this.field;  
    this.field = document.getElementById(pID); 
    
    this.setDefaultValue = function setDefaultValue(pValue) {
      if ( this.field.value == '' ) {
	      this.defaultValue = pValue;
	      this.field.value = this.defaultValue;
	    }
    }    
    this.rmDefaultValue = function rmDefaultValue() {
      if (this.field.value == this.defaultValue) {
        this.field.value = '';  
      }
    }
  }
  
  
  function CKursdetailsList() {
    this.add = function add(pElement) {
      var knr = pElement.getKnr();
      this.kursdetails[knr] = pElement;
      return 0;
    }
    this.setActive = function setActive (pKnr) {
      //Deaktivieren der alten Kursdetails
      if (this.activeKnr != 0) {             
        var kd = this.getKd4Knr(this.activeKnr);
        kd.setActive(0);
      }
      // Aktivieren der gewählten Kursdetails 
      kd = this.getKd4Knr(pKnr);
      if (typeof kd != "undefined") {
        kd.setActive(1);
        this.activeKnr = pKnr;
      }
      // Vorbereitung fürs drucken!
      return 0;
    }
    this.setInactive = function setInactive (pKnr) {
      kd = this.getKd4Knr(pKnr);
      if (typeof kd != "undefined") {
        kd.setActive(0);
        this.activeKnr = 0;
      }
      document.body.className = "";
      return 0;
    }
    
    this.getKd4Knr = function getKd4Knr (pKnr) {
      if (typeof this.kursdetails[pKnr] != "undefined") {
        return this.kursdetails[pKnr];
      }
    }
    
    /* Prüfung ob die Kursdetails aktiv sind aufgrund der URL */
    this.setActiveByURL = function setActiveByURL() {
      var URLactiveKnr = 0;
      var rx = /activeKdKnr:(\w+)/;
      var URL = document.URL;
      var result = rx.exec(URL); 
      if (result) {
        URLactiveKnr = result[1];
        if (URLactiveKnr != this.activeKnr) {
          this.setActive(URLactiveKnr);
        }
      }
      return 0;
    } 

    this.kursdetails = new Array();
    this.activeKnr = 0;
    this.setActiveByURL();
  }
  
  
  function CKursdetails(pKnr, pTagID) {
    this.knr   = pKnr;
    this.tagID = pTagID;
    this.orginal = document.getElementById(pTagID);
    this.clone;

    this.setActive = function setActive(pActive) {
      /* Aufgrund mehrer Probleme werden die Kursdetails kopiert und beim Body Element eingehängt! */
      if (pActive == 1) {
       if (this.clone === undefined) {
	        this.clone = this.orginal.cloneNode(true);
	        this.clone.id = this.tagID + "_clone";
	        this.clone.style.display = "";
	        document.getElementsByTagName("body")[0].appendChild(this.clone);
        } else {
        	this.clone.style.display = "";
        }
      } else {
        if (this.clone != undefined) {
	        this.clone.style.display = "none";
        }
      }
      return 0;
    } 
    this.print = function print() {
      window.print();
      
    }
    this.getKnr = function getKnr() {
      return this.knr;
    }
  }
  
  function CAsMap(pImgStartID) {
    this.imgStartID = pImgStartID;
    this.imgIDPrefix = this.imgStartID;
    this.activeID;
    
    this.setActive = function setActive(pID) {
      this.activeID = pID;
      showByID(this.genActiveImgID());
      hideByID(this.imgStartID);
    }
    this.reset = function reset() {
      hideByID(this.genActiveImgID());
      showByID(this.imgStartID);
    }    
    this.genActiveImgID = function genActiveImgID() {
      return this.imgIDPrefix + "_" + this.activeID;
    }
  }
  
  function CAsList(pPrefix) {
    this.prefix = pPrefix;
    this.activeId = -1;
    this.setActive = function(pAsId) {
      if (this.activeId != -1) {
        var tagId = this.prefix + this.activeId;
        document.getElementById(tagId).className = "aussenstelle";
      }
      var tagId = this.prefix + pAsId;
      document.getElementById(tagId).className = "aussenstelle active";
      this.activeId = pAsId;
    }
    this.setActiveByURL = function() {
      var rx = /#as(\w+)/;
      var id = -1;
      var URL = document.URL;
      var result = rx.exec(URL); 
      if (result) {
        id = result[1];
        if (id != this.activeId) {
          this.setActive(id);
        }
      }
    }
    
  }