code_viewer = function() {
    $('a.codeExample').each (
      function( i ) {
        $( this ).after( '<pre class="codeExample"><code></code></pre>' ).end().hide();
      }
    )
    $('a.codeExample').toggle ( 
      function() {
		if( !this.old ){
		  this.old = $(this).html();
		}
        $(this).html('ausblenden');
        parseCode(this);
      },
      function() {
        $(this).html(this.old);
        $(this.nextSibling).slideUp();
      }
    )
    function parseCode(o){
      if(!o.nextSibling.hascode){
          $.get (o.href,
            function(code){
              code=code.replace(/&/mg,'&#38;');
              code=code.replace(/</mg,'&#60;');
              code=code.replace(/>/mg,'&#62;');
              code=code.replace(/\"/mg,'&#34;');
              code=code.replace(/\t/g,'  ');
              code=code.replace(/\r?\n/g,'<br>');
              code=code.replace(/<br><br>/g,'<br>');
              code=code.replace(/ /g,'&nbsp;');
              o.nextSibling.innerHTML='<code>'+code+'</code>';
              o.nextSibling.hascode=true;
            }
          );
      }
      $(o.nextSibling).slideDown();
    }
  }
$(document).ready(function() {
  code_viewer();
});