	/*	
	The 'target' attribute is not valid XHTML. Best practice is to use the 'rel' attribute 
	to assign the link a relationship. For ex. if you link outside of your domain you could assign
	rel="external". This is semantically proper but adds no functionality. You can later run a javascript
	function to add targetting functionality (ex. open in new window) as the function does below.
	
	NOTE: You normally want to give the user the control to open a link in a new window or tab. This function
			should be used in a limited manner or not at all.
			
	-Lokesh Dhakar
	Sept. 26, 2005

*/

function externalLinks()
{
	if (!document.getElementsByTagName){ return;}
	
	var anchors = document.getElementsByTagName("a");
	
	for (var i=0; i<anchors.length; i++){
    	var anchor = anchors[i];
	    
		// rel="popup" or rel="doc":
		// popup in new window
		if (anchor.getAttribute("href") && (anchor.getAttribute("rel") == "popup" || anchor.getAttribute("rel") == "enlarge" || anchor.getAttribute("rel") == "external")){
			anchor.target = "_blank";
		}

		// rel="back":
		// add onclick js to move one step back in history
		if (anchor.getAttribute("href") && anchor.getAttribute("rel") == "back"){	
			anchor.onclick=function(){
				history.back();
				return false;
			}
		}
	}


	

	items = document.getElementsByClassName("pending");
	
	for (i = 0; i < items.length; i++){

		var thumbnail = items[i];
		
		var elImage = document.createElement("img");
		elImage.src = '/images/pending.png';
		elImage.style.position = 'absolute';
		elImage.style.border = '0';
		elImage.style.padding = '0';
		elImage.style.margin = '0';

		thumbnail.parentNode.insertBefore(elImage, thumbnail.parentNode.firstChild);

	}

}

window.onload = externalLinks;