//	Disclaimer - Free Script only with this Disclaimer
//	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
//	Disclaimer ends here

//	different languages in an array
//	[x][0] is the identifier for an external link
//	[x][1] is the additional text to announce a new window
//	var languages = new Array(x), x defines the among of languages
var languages = new Array(3);
//	and now we make each array-element to an array with 2 dimensions
for(i = 0; i < languages.length; i++) {
	languages[i] = new Array(2);
}

languages[0][0] = "Externer Link";
languages[0][1] = "[in einem neuem Fenster]";

languages[1][0] = "Beispiel anzeigen";
languages[1][1] = " [in einem neuem Fenster]";

languages[2][0] = "Screenshot anzeigen";
languages[2][1] = " [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) {
// and now we get through our different languages
			for(j = 0; j < languages.length; j++) {
//	let us check, if our defined identifier of that language for external links is present
				if(titleOld.indexOf(languages[j][0]) != -1) {
//	split up the given title-Tag to get the text behind our identifier
					titleAddition = titleOld.substring((titleOld.indexOf(languages[j][0])) + languages[j][0].length, titleOld.length);
//	write the new title-Tag
					singleLink.setAttribute("title", languages[j][0] + " " + languages[j][1] + 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";
//	and if we got this, we do not need the for-loop of the languages anymore
					break;
				}
			}
		}
	}
}
	
	temp = window.onload;
	counter = 0;
	window.onload = function() {
						if(temp != null && counter == 0) {
							counter++;
							temp();
						}
						changeTitleAndTarget();
					}
