echo "<style type='text/css'>";
echo " @media print { .noprint { font-size: 40pt; display: none; } }";
echo "</style>";
+echo "<script type='text/javascript'>";
+echo " function conditionalPrint() {";
+echo " var doPrint = true; var agent = navigator.userAgent.toLowerCase();";
+echo " if (agent.indexOf('safari') != -1) { doPrint = false; }";
+echo " if (doPrint) { print(); }";
+echo " }";
+echo "</script>";
echo "<title>" . $id . "</title><body onload='print(); return false;'>";
-echo "<p class='noprint' style='text-align: right'><button class='GBicon rollover print' title='Print' onclick='print(); return false;'></button> <a href='#' onclick='print(); return false;'>Print</a></p>";
+echo "<p class='noprint' style='text-align: right'>";
+echo "<button class='GBicon rollover print' title='Print' onclick='conditionalPrint(); return false;'></button> <a href='#' onclick='print(); return false;'>Print</a></p>";
echo "<p style='text-align:center;'>";
echo imageURL($paperAspect, $index, $format, $width, $height);
echo "</p>";