// JavaScript Document
startList = function() {
if (document.all&&document.getElementById) {
	navRoot = document.getElementById("nav");
	for (i=0; i<navRoot.childNodes.length; i++) {
		node = navRoot.childNodes[i];
			if (node.nodeName=="LI") {
				node.onmouseover=function() {
					this.className+=" over";
				}
				node.onmouseout=function() {
					this.className=this.className.replace(" over", "");
				}
			}
		}
	}
}
function doNews(obj, currentObj) {
    if (currentObj) {
        $(currentObj).removeClass("active");    
    }
    currentObj = obj;
    $(obj).addClass("active");    
    
    newsPicturePath = $(obj).find("img").attr("src");
    newsHeadlineVar = $(obj).find("h3").html();
    newsTeaserTextVar = $(obj).find("h4").html();
    newsLinkVar = $(obj).find("a").attr("href");
    $("#newsPicture").attr({ src: newsPicturePath, alt: newsHeadlineVar, title: newsHeadlineVar });
    $("#newsHeadline").html(newsHeadlineVar);
	$("#newsTeaserText").html(newsTeaserTextVar);
    $("#newsLink").attr({ href: newsLinkVar });
    return currentObj;
}
$(document).ready(function(){
    $(".pane-list li").click(function(){
      window.location=$(this).find("a").attr("href"); return false;
    });
    $("ul.pane-list li.normal").attr("id", function (arr) {
      return "ausrichtung" + arr;
    });
	$("ul.pane-list div.active").attr("class", function (arr) {
      return "umbruch" + arr;
    });
    $(".newsgross").click(function(){
      window.location=$(this).find("a").attr("href"); return false;
    });
});
$(document).ready(function(){
    var firstTime = false;
    var currentObj;
    currentObj = doNews(".pane-list li:first", currentObj);
    
/*    $(".pane-list li").hover(function(){
        currentObj = doNews(this,currentObj);                              
    });*/
    
    $("#loaderblock").fadeOut("slow", function() {
        $("#news").fadeIn("slow");
    });
});
