
//Copyright 2002 BKJ Productions
//www.bkjproductions.com
//bkj@bkjproductions.com

//convertHrefPDFs
//This function runs through all of the HREF links on a page, looking
// PDF hrefs


function convertHrefPDFs () {
	var q = "'";
	var L=document.links.length;
	var targ='';
	thetarget= '_blank';
	theclass= 'lipdf';	
	thetitle="Open PDF";
	//alert(L + ' links on this page.');
	// if converting to autowindow, use this:
	//format is "javascript:autowindow(@,200,200);"
	// We replace the @ character with the data in the link
	for (var i=0; i<L; i++) {
		thelink=document.links[i].href;
		targ=document.links[i].target;
		document.status=(targ + "\r" + thelink);
		if (thelink>'') {
		if (thelink.toLowerCase().indexOf('.pdf')>-1) {
			//targArray=targ.split('@');
			//NewLink=targArray[0] + q + thelink + q + targArray[1];
			//NewLink =informant+document.links[i].href;
			//alert(NewLink);
			//document.links[i].href=NewLink;
			document.links[i].target = thetarget; 
			document.links[i].className = theclass;
			document.status=('Revised target: ' + thelink + ' ' + thetarget);
			// test: document.links[i].href=('Revised target: ' + thelink + ' ' + thetarget);
			document.links[i].title=thetitle;
			
			// something like
			//document.getElementById('theButton').className =theclass
			
			
			}
			}
		}
	}
	
	
	