
<!--

    /** @@ AU Sept.2009 : attach Google Analytics handle  to download-style links **/


 // alert('qq') ;

var regeexp = /(\w|[-.])+$/

if (document.all||document.getElementById){
if (document.all)
var links=document.all.tags("A")
else if (document.getElementById)
var links=document.getElementsByTagName("A")
var total=links.length
// var win2=window.open("","","menubar,scrollbars,status")
// win2.document.write("<h2>Total Links="+total+"</h2><br>")
for (i=0;i<total;i++){
if (links[i].href && isURL(links[i].href) && (links[i].target == '_blank') && (links[i].href.lastIndexOf('/') != -1 ))			
/* URLs that end up a with a dot + 3 or 4 chracters AND at least one of them letter AND target= _blank*/
	{				
	if (links[i].href.indexOf('?') != -1 )
		{										//... Origami viewer link found
	 		a = regeexp.exec(links[i].href) ;
			//	alert(a[0]);
			links[i].onclick = function() { javascript: pageTracker._trackPageview('/origami/' + a[0]); }
		}
	else {										//....regular download link found
			lp = links[i].href.length;                  //the whole boat - for "#..." adjustment
			fp = links[i].href.lastIndexOf('/')+1;		//after the last slash
			sp = links[i].href.lastIndexOf('/')-1;		//before the last slash - the startpoint for second search
			ep = links[i].href.lastIndexOf('/', sp)+1;	//after the "slash before the last"
		
			a_str = links[i].href.substring(ep,lp) ;
			//	alert(a_str) ;
			links[i].onclick = function() { javascript: pageTracker._trackPageview('/downloads/' + a_str); }
		}
	}
// win2.document.write('<a href="'+links[i]+'">'+links[i].innerHTML+'</a><br>')
}
// win2.document.close()
}

//-->

