{ "translatorID":"4fd6b89b-2316-2dc4-fd87-61a97dd941e8", "translatorType":4, "label":"Library Catalog (InnoPAC)", "creator":"Simon Kornblith and Michael Berkowitz", "target":"(search~|\\/search\\?|(a|X|t|Y|w)\\?|\\?(searchtype|searchscope)|frameset&FF)", "minVersion":"1.0.0b3.r1", "maxVersion":"", "priority":200, "inRepository":true, "lastUpdated":"2008-05-28 18:30:00" } function detectWeb(doc, url) { if (!url.match(/SEARCH=/) && !url.match(/searchargs?=/) && !url.match(/&FF/)) return false; // First, check to see if the URL alone reveals InnoPAC, since some sites don't reveal the MARC button var matchRegexp = new RegExp('^https?://[^/]+/search[^/]*\\??/[^/]+/[^/]+/[0-9]+\%2C[^/]+/frameset(.+)$'); if(matchRegexp.test(doc.location.href)) { if (!url.match("SEARCH") && !url.match("searchtype")) { return "book"; } } // Next, look for the MARC button var namespace = doc.documentElement.namespaceURI; var nsResolver = namespace ? function(prefix) { if (prefix == 'x') return namespace; else return null; } : null; var xpath = '//a[img[@src="/screens/marcdisp.gif" or starts-with(@alt, "MARC ") or @src="/screens/regdisp.gif" or @alt="REGULAR RECORD DISPLAY"]]'; var elmt = doc.evaluate(xpath, doc, nsResolver, XPathResult.ANY_TYPE, null).iterateNext(); if(elmt) { return "book"; } // Also, check for links to an item display page var tags = doc.getElementsByTagName("a"); for(var i=0; i