+
+
+// Expand links for printing
+
+String.prototype.hasClass = function(classWanted)
+{
+ var classArr = this.split(/\s/);
+ for (var i=0; i<classArr.length; i++)
+ if (classArr[i].toLowerCase() == classWanted.toLowerCase()) return true;
+ return false;
+}
+
+var expandedURLs;
+
+onbeforeprint = function() {
+ expandedURLs = [];
+
+ var contentEl = document.getElementById("content");
+
+ if (contentEl)
+ {
+ var allLinks = contentEl.getElementsByTagName("a");
+
+ for (var i=0; i < allLinks.length; i++) {
+ if (allLinks[i].className.hasClass("external") && !allLinks[i].className.hasClass("free")) {
+ var expandedLink = document.createElement("span");
+ var expandedText = document.createTextNode(" (" + allLinks[i].href + ")");
+ expandedLink.appendChild(expandedText);
+ allLinks[i].parentNode.insertBefore(expandedLink, allLinks[i].nextSibling);
+ expandedURLs[i] = expandedLink;
+ }
+ }
+ }
+}
+
+onafterprint = function()
+{
+ for (var i=0; i < expandedURLs.length; i++)
+ if (expandedURLs[i])
+ expandedURLs[i].removeNode(true);
+}
\ No newline at end of file