function prepIcons() {
	var i;
	var alinks = document.getElementById("content").getElementsByTagName("a");
	for (i=0; i<alinks.length; i++) {
		var currentLink = alinks[i];
		var images = currentLink.getElementsByTagName("img");
		/*Check if the link is an image (we don't want icons next to images) and that ".pdf" appears in the link href.*/
		if (images.length == 0 && currentLink.href.indexOf('.pdf') != -1) {
		  var curClass = currentLink.getAttribute("class");
		  if (curClass != null) { currentLink.className = curClass + " pdf"; }
		  else { currentLink.className = "pdf"; }
		}

		if (images.length == 0 && currentLink.href.indexOf('.jpg') != -1) {
		  var curClass = currentLink.getAttribute("class");
		  if (curClass != null) { currentLink.className = curClass + " jpg"; }
		  else { currentLink.className = "jpg"; }
		}
		
		if (images.length == 0 && currentLink.href.indexOf('.tif') != -1 || currentLink.href.indexOf('.eps') != -1) {
		  var curClass = currentLink.getAttribute("class");
		  if (curClass != null) { currentLink.className = curClass + " tif"; }
		  else { currentLink.className = "tif"; }
		}		

		if (images.length == 0 && currentLink.href.indexOf('.doc') != -1) {
		  var curClass = currentLink.getAttribute("class");
		  if (curClass != null) { currentLink.className = curClass + " doc"; }
		  else { currentLink.className = "doc"; }
		}	

		if (images.length == 0 && currentLink.href.indexOf('.xls') != -1) {
		  var curClass = currentLink.getAttribute("class");
		  if (curClass != null) { currentLink.className = curClass + " xls"; }
		  else { currentLink.className = "xls"; }
		}	
		
	}
}
window.onload = function() {
prepIcons();
}