// JavaScript Document
$(document).ready(function() {
	 $('a[class*=external]').attr('target', '_blank');
	$('li[class*=external] a').attr('target', '_blank');
});
/* Untermenues Ebene 1 fuer den IE; Quelle http://www.htmldog.com/articles/suckerfish/hover/ */

var sfHover = function() {
	if(document.getElementById("navMain")) {
		var sfEls = document.getElementById("navMain").getElementsByTagName("LI");
		for (var i=0; i<sfEls.length; i++) {
			sfEls[i].onmouseover=function() {
				this.className+=" sfhover";
			}
			sfEls[i].onmouseout=function() {
				this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
			}
		}
	}
}
if (window.attachEvent) window.attachEvent("onload", sfHover);

/* Hover-Fkt fuer andere Elemente als a fuer den IE; Quelle http://www.htmldog.com/articles/suckerfish/hover/ */

sfHover = function() {
	if(document.getElementById("buttonSet")) {
		var sfEls = document.getElementById("buttonSet").document.getElementsByTagName("INPUT");
		for (var i=0; i<sfEls.length; i++) {
			sfEls[i].onmouseover=function() {
				this.className+=" sfhover";
			}
			sfEls[i].onmouseout=function() {
				this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
			}
		}
	}
}

/* Externe Links öffnen sich in einem neuen Fenster bzw. Tab */

function init() {
   
    var as = document.getElementsByTagName('a');
    for(i = 0; i < as.length; i++) {
        if(as[i].getAttribute('rel') && as[i].getAttribute('rel').indexOf('extern') != -1)
            as[i].target = '_blank';
    }
    
}


window.onload = init;


