
/*
	Checks to see if the navigation is on the page, 
	and if it is, finds all links whose href ends 
	with .pdf and watches them to perform popPDF
	when they are clicked.
	
	Requires prototype and the popPDF.
*/

Event.observe(window, 'load', function(event) {
	if ($$('a').length > 0) {
		$$('a').select(function(lnk) {
			return lnk.href.strip().endsWith('.pdf') &&
			      !lnk.onclick;
		}).invoke('observe', 'click', function(event) {
			Event.stop(event);
			popPDF(Event.element(event));
		});
	}
});
