function addLoadEvent(a){var b=window.onload;if(typeof window.onload!="function"){window.onload=a}else{window.onload=function(){if(b){b()}a()}}}addLoadEvent(function(){add_print_link("headOD")});function add_print_link(c){if(!document.getElementById||!document.getElementById(c)){return}var a=document.getElementById(c);var b=document.createElement("p");b.className="print-link";b.onclick=function(){print_preview();return false};b.appendChild(document.createTextNode("Print the Page"))}function print_preview(){setActiveStyleSheet("show");add_preview_message();window.print()}function add_preview_message(){var b=document.getElementById("headerOD");var f=b.parentNode;if(document.getElementById){var g=document.createElement("div");g.id="printMessage";var c=document.createElement("h3");var i=document.createTextNode("Podgląd strony do wydruku");c.appendChild(i);var a=document.createElement("p");var e=document.createTextNode("Niniejszy komunikat nie zostanie wydrukowany. ");var d=document.createElement("a");d.onclick=function(){cancel_print_preview();return false};d.setAttribute("href","#");var h=document.createTextNode("Wróć do poprzedniego widoku.");d.appendChild(h);a.appendChild(e);a.appendChild(d);g.appendChild(c);g.appendChild(a);f.insertBefore(g,b)}}function cancel_print_preview(){var a=document.getElementById("printMessage");var b=a.parentNode;b.removeChild(a);setActiveStyleSheet("hide")}function setActiveStyleSheet(d){var c,b;for(c=0;(b=document.getElementsByTagName("link")[c]);c++){if(b.getAttribute("rel").indexOf("stylesheet")!=-1&&b.getAttribute("media")=="screen"){b.disabled=(d=="show")?true:false;if(b.getAttribute("title")=="Print Preview"){b.disabled=(d=="show")?false:true}}}};
