﻿// Script, das nur den div mit spezifischer ID druckt (Daten&Fakten)
     
      var gAutoPrint = true;

      // druckt den div mit ID ccenter 
      function processPrint() {

      if (document.getElementById != null) {
          var html = '<HTML>\n<HEAD>\n';
            
//          if (document.getElementsByTagName != null) {
//          var headTags = document.getElementsByTagName("head");
//          if (headTags.length > 0) html += headTags[0].innerHTML;
//          }
          //CSS injection
          html += "<link href=\"/Kalaidos Bildungsgruppe Schweiz/Kalaidos-FH/IfWI/Css/print.css\" rel=\"stylesheet\" media=\"print\" />";
          html += "<link href=\"/Kalaidos Bildungsgruppe Schweiz/Kalaidos-FH/IfWI/Css/ifwi.css\" rel=\"stylesheet\"  />";
          html += '<style type="text/css">table * {font-size: 11px;}</style>';

          // alle Tabs mit id="tabbody1-4" einblenden
          html += '<script language=\"javascript\" type=\"text/javascript\">function displayTabbody(){document.getElementById(\"tabbody1\").style.display = \"block\"; document.getElementById(\"tabbody2\").style.display = \"block\"; document.getElementById(\"tabbody3\").style.display = \"block\"; document.getElementById(\"tabbody4\").style.display = \"block\";}</script>';

          html += '\n</HE' + 'AD>\n<BODY onload=\"displayTabbody()\">\n';

          // Titel einblenden
          html += '<div><h2 style="color:#000;">Departement Gesundheit</h2><br/><h3 style="color:#000;">Kalaidos Fachhochschule</h3></div><br">';

            var printReadyElem = document.getElementById("ccenter");
            if (printReadyElem != null) html += printReadyElem.innerHTML;
            else {
            alert("Error, no contents.");
            return;
            }

            html += '\n</BO' + 'DY>\n</HT' + 'ML>';
            var printWin = window.open("", "processPrint");
            printWin.document.open();
            printWin.document.write(html);
            printWin.document.close();
            if (gAutoPrint) printWin.print();
            } else alert("Browser not supported.");

    }
 

