function externLink(url, name) {
	externWindow=window.open(url, name, "location=yes, menubar=yes, resizable=yes, scrollbars=yes, status=yes, toolbar=yes" );
	externWindow.focus();
	return false;
}

$(document).ready(function() {
	
	$("a.pdf").each(function(a) {
		$(this).attr("target","_blank"); // target=_blank bei externen links
		
		/*if(window.ie == undefined && $(this).getElementsByTagName("img")[0]) { // bei bildern kein icon anzeigen
			a.removeClass("pdf");
			a.removeClass("extern");
		}*/
		
		if($.browser.msie) { // fuer ie das icon (hintergrund: span) hinzufuegen
			var linkClass = $(this).attr("class");
			$(this).addClass("js-" + linkClass).removeClass(linkClass);
			
			/*var icnLinkExtern = new Element("span"); // span tag in link einbauen
			icnLinkExtern.attr("class","icon");
			alert(icnLinkExtern) ;*/
			$(this).prepend('<span class="icon"></span>');
		}
		
	});
});

/**************************************************************************/
/* ReadSpeaker Functions
/**************************************************************************/
function rsTextSelection()
{
	if (document.getSelection) { // older Mozilla versions
		var selectedString = document.getSelection();
	}
	else if (document.all) { // MSIE 4+
		var selectedString=document.selection.createRange().text;
	}
	else if (window.getSelection) { // recent Mozilla versions
		var selectedString=window.getSelection();
	}
	document.getElementById('rs_form').selectedtext.value = selectedString;
	if (document.getElementById('rs_form').url) {
		if (!document.getElementById('rs_form').url.value) {
			if (window.location.href) {
				document.getElementById('rs_form').url.value=window.location.href;
			}
			else if (document.location.href) {
				document.getElementById('rs_form').url.value=document.location.href;
			}
		}
	}
}

function copyselected() {
	setTimeout("rsTextSelection()",50);
	return true;
}

function openAndRead() {
	document.getElementById('rs_button').setAttribute("target","rs");
	document.getElementById('rs_form').setAttribute("target","rs");
    var mywindow = window.open("","rs","width=310,height=220,toolbar=0");
    setTimeout("document.getElementById('rs_form').submit();",500);
}

document.onmouseup = copyselected;
document.onkeyup = copyselected;

/**************************************************************************/