/*	
	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") == "doc"))
		{
			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;
			}
		}
	}
}
window.onload = externalLinks;


function popUp(url,windowWidth,windowHeight) {

newWin = window.open (url, "win", 'toolbar=0, location=0, directories=0, status=0, menubar=0, scrollbars=1, resizable=0, width='+windowWidth+', height='+windowHeight+', left=300,top=50,screenX=150,screenY=250');
newWin.focus();


}