function printable_version(){
    var getBody = document.body.innerHTML;
    var bodyText = getBody.toLowerCase();
    var posBegin;
    var posEinde;
    var v_start_pos;
    var v_stop_pos;
    
    //Alle browsers behandelen de quotes van de id anders: IE verwijdert ze, Mozilla voegt dubbele quotes toe, Opera voegt enkele quotes toe!
    //(is om het moeilijk te maken ;-)) Dus we doen de nodige searches.    
    posBegin = bodyText.indexOf('<span id=startprintable></span>') + 31;
    if(posBegin == 30)  //(-1 + 30)
        posBegin = bodyText.indexOf('<span id="startprintable"></span>') + 33;
    if(posBegin == 32)  //(-1+33)
        posBegin = bodyText.indexOf('<span id=\'startprintable\'></span>') + 33;
    
    posEinde = bodyText.indexOf('<span id=stopprintable></span>');
    if(posEinde == -1)
        posEinde = bodyText.indexOf('<span id="stopprintable"></span>');
    if(posEinde == -1)
        posEinde = bodyText.indexOf('<span id=\'stopprintable\'></span>');
        
    bodyText = getBody.substring(posBegin, posEinde);

    /*We verwijderen alle document.write statements omdat die anders dubbele output opleveren. We vervangen alle occurrences door "//" (commentaar). "gi" betekent alle occurrences vervangen, case insensitive.*/
    bodyText = bodyText.replace(/document.write/gi, "//");
    
    /*VOOR OPERA*/
    if (navigator.userAgent.toLowerCase().indexOf("opera")!=-1){
        /*Van bv. width="100%" maakt de Opera parser width='-100', dus dit vervangen we terug (voor alle procenten van 1-100)*/
        for(i=1; i<101; i++){
            while (bodyText.indexOf("WIDTH='-" + i + "'") != -1){
                bodyText = bodyText.replace("WIDTH='-" + i + "'", "WIDTH='" + i + "%'");
            }
        }
        /*Om een of andere reden verwijdert Opera de spatie na elke </a>!*/
        bodyText = bodyText.replace(/<\/a>/gi, "</a> ");  //overal een spatie na </a> zetten.
        bodyText = bodyText.replace(/<\/a> \./gi, "</a>.");  //bij een punt na </a> mag de spatie terug weg.
        bodyText = bodyText.replace(/<\/a> \,/gi, "</a>,");  //bij een komma na </a> mag de spatie terug weg.
        bodyText = bodyText.replace(/<\/a> \;/gi, "</a>;");  //bij een puntkomma na </a> mag de spatie terug weg.
        bodyText = bodyText.replace(/<\/a> \:/gi, "</a>:");  //bij een dubbelpunt na </a> mag de spatie terug weg.
        bodyText = bodyText.replace(/<\/a> \?/gi, "</a>?");  //bij een vraagteken na </a> mag de spatie terug weg.
    }
    /*EINDE OPERA*/
    
    /*We vervangen alle "<a href"'s, want vanuit het print-window mag men niet klikken naar andere pagina's.*/
    bodyText = bodyText.replace(/<a href/gi, '<span class="dummy_href" href');
    bodyText = bodyText.replace(/<a target/gi, '<span class="dummy_href" href');
    bodyText = bodyText.replace(/<a onclick/gi, '<span class="dummy_href" href');
    bodyText = bodyText.replace(/<\/a>/gi, '</span>');
    
    /*We vervangen alle onClick en onMouse events, zodat ook buttons en andere events niet meer werken in het print-window.*/
    bodyText = bodyText.replace(/onClick="/gi, 'onClick="return null;');
    bodyText = bodyText.replace(/onMouseOver="/gi, 'onMouseOver="return null;');
    bodyText = bodyText.replace(/onMouseOut="/gi, 'onMouseOut="return null;');
    bodyText = bodyText.replace(/onClick=/gi, 'onClick=return null;');
    bodyText = bodyText.replace(/onMouseOver=/gi, 'onMouseOver=return null;');
    bodyText = bodyText.replace(/onMouseOut=/gi, 'onMouseOut=return null;');
    /*Ook submitbuttons*/
    bodyText = bodyText.replace(/type="submit"/gi, 'type="button"');
    bodyText = bodyText.replace(/type='submit'/gi, 'type="button"');
    bodyText = bodyText.replace(/type=submit/gi, 'type="button"');
    
    /*We disablen alle javascripts, zodat deze geen problemen kunnen geven.*/
    bodyText = bodyText.replace(/<script/gi, '<!--NOSCRIPT');
    bodyText = bodyText.replace(/<\/script>/gi, 'END NOSCRIPT-->');
    
    var printWin=window.open('','','buttons=yes,scrollbars=yes, menubar=yes, resizable=no, width=650, height=580, top=0, left=0');
    printWin.document.write('<html>');
    printWin.document.write('  <head>');
    printWin.document.write('    <title>Printvriendelijke versie</title>');
    printWin.document.write('    <style type="text/css" media="print">.no_print {display:none;}}</style>');
    printWin.document.write('    <style>');
    printWin.document.write('       .no_print {border-bottom: 1pt solid black; padding-bottom: 10px; width: 100%}');
    printWin.document.write('       body {font-family: verdana, arial; font-size: 8pt}');
    printWin.document.write('       table {font-family: verdana, arial; font-size: 8pt}');
    printWin.document.write('       td {font-family: verdana, arial; font-size: 8pt}');
    printWin.document.write('       .dummy_href {text-decoration: none; color: #DDB70A}');
    printWin.document.write('    </style>');
    printWin.document.write('  </head>');
    printWin.document.write('  <body>');
    printWin.document.write('    <div class="no_print"><center>');
    printWin.document.write('       <input type="button" value="Afdrukken" onClick="window.print();">');
    printWin.document.write('       <input type="button" value="Sluiten" onClick="window.close();">');
    printWin.document.write('    </center></div><br>');
    printWin.document.write(     bodyText);
    printWin.document.write('  </body>');
    printWin.document.write('</html>'); 
    printWin.document.close();
}
