function relWindow(relval, atarget) {
	if (!document.getElementById) return;
	if (!document.getElementsByTagName) return;
	if ( !document.getElementsByTagName('a') ) return;
	var links = document.getElementsByTagName('a');
	for (var i = 0; i < links.length; i++) {
		var link = links[i];
		if (link.getAttribute('href') && link.getAttribute('rel') == relval) {
			var re = RegExp(relval, 'gi');
			if ( re.test( link.getAttribute('rel') ) ) {
				link.className = relval; // add a class with the rel value
				link.target = atarget;
				if ( !link.getAttribute('title') ) {
					link.setAttribute('title', 'link opens in another window');
				}
			}
		}
	}
}
