// to change dynamically the title-Tag and target for a link, which should open in a new window
// confirms with XHTML 1.0 Strict and the WCAG/BITV
// coded by Joern Hofer: jhATgrassi.de (2004-04-04)
// as it seems, this doesn't work on IE5 on mac
// here we go:

// indentifing the title of a link, which direct to external content
var externalLinkText = "Externer Link";
// which text do we use to show the user, that it will be in a new window
var textForNewWindow = "in einem neuem Fenster";

function changeTitleAndTarget() {
//	check, if the browser understands the new DOM, if not, stop here
//	(we can't change the title, so we can't open it in a new window, if we still want to get WCAG or BITV accessibility)
	if(!document.getElementsByTagName) return;
//	fill up an array with all links in the page
	var links = document.getElementsByTagName("a");
//	for-loop to address each single Link
	for(i=0; i < links.length; i++) {
//	declare tempVariable for single Link
		var singleLink = links[i];
//	get the title of the single Link
		titleOld = singleLink.getAttribute("title");
// if the title is available
		if(titleOld) {
//	let us check, if our defined identifier for external links is present
			if(titleOld.indexOf(externalLinkText) != -1) {
//	split up the given title-Tag to get the text behind our identifier
				titleAddition = titleOld.substring((titleOld.indexOf(externalLinkText)) + externalLinkText.length, titleOld.length);
//	write the new title-Tag
				singleLink.setAttribute("title", externalLinkText + " " + textForNewWindow + titleAddition);
//	and now we declare, that the external link should open in a new window (you can also use another name, 
//	to open all external links in one window, but than you will need an extra .focus() for that window
				singleLink.target = "_blank";
			}
		}
	}
}
//	if the document is loaded, we start our title/target-changing
window.onload = changeTitleAndTarget;

//	that's it
//	insert this JS-file to change your external Links. If JS is enabled it will change all, 
//	if not, the external links will work as normal links in the same window
