// JavaScript  -  External Windows Document

function TJKpop(){ // v1.0 | www.TJKDesign.com
  var e = document.getElementById('container');
  if (e){
    var a=
e.getElementsByTagName('a');

    for (var i=0;i<a.length;i++){
		
    if (a[i].getAttribute('href') != null && a[i].getAttribute('href').indexOf("http://") >= 0 && a[i].getAttribute('href').toUpperCase().indexOf(
document.domain.toUpperCase()) == -1){

        a[i].className+=a[i].className?' outlink':'outlink';
        a[i].title+=' (opens in new window)';
				var rand = Math.round((Math.random
() * 10000));
				a[i].onclick=function(){newWin=window.open(this.href,rand);if(window.focus){newWin.focus()} return false;}
        a[i].onkeypress=function(){newWin=window.open(this.href,rand);if(window.focus){newWin.focus
()} return false;}
      }
    }
  }
}

function addLoadEvent(func) {
  var oldonload = window.onload;
  if (typeof window.onload != 'function') {
    window.onload = func;
  } else {

    window.onload = function() {
      oldonload();
      func();
    }
  }
}

addLoadEvent(function(){if(document.getElementById) TJKpop();});

// End External Windows Document

function addBlueBar() {
	if (!document.getElementsByTagName) return false;
	var places = document.getElementsByTagName("h4");
	for (var theseElements=0; theseElements < places.length; theseElements ++) {
		/* The below section adds the image before the heading */
		var br = document.createElement("br");
		br.setAttribute("style", "clear: both;");

		var img = document.createElement("img");
		img.setAttribute("src", "fileadmin/template/main/images/news-divider1.gif");
		img.setAttribute("alt", "News Divider");
		img.setAttribute("style", "float: left; margin: 5px 0px 10px 0px !important;");
			
		var firstCH = places[theseElements].firstChild;
		places[theseElements].insertBefore(br, firstCH);

		var firstCH = places[theseElements].firstChild;
		places[theseElements].insertBefore(img, firstCH);
	}
}   
