window.onload=init;function init(){EFFECTS.init();setRoleAttr();SLIDER.init();CHANGER.init()}function myPreload(img_src){var d=document;if(d.images){if(!d.p){d.p=new Array()}var key=d.p.length;d.p[key]=new Image;d.p[key].src=img_src}}function preloadImages(){var a=preloadImages.arguments;for(i=0;i<a.length;i++){if(a[i].indexOf("#")!=0){myPreload(a[i])}}}function w$(id){return document.getElementById(id)}function setRoleAttr(){if(w$('header')){w$('header').setAttribute('role','banner')}if(w$('navi')){w$('navi').setAttribute('role','navigation')}if(w$('col1')){w$('col1').setAttribute('role','complementary')}if(w$('col2')){w$('col2').setAttribute('role','complementary')}if(w$('col3')){w$('col3').setAttribute('role','main')}if(w$('footer')){w$('footer').setAttribute('role','contentinfo')}}function c$(c){var tag="*";if(arguments[1]!=""){tag=arguments[1]}var els=document.getElementsByTagName(tag);var pattern=new RegExp('(^|\\s)'+c+'(\\s|$)');var returnEls=[];for(var i in els){if(pattern.test(els[i].className)){returnEls.push(els[i])}}return returnEls}var EFFECTS={init:function(){EFFECTS.initOnOver();if(w$('pic')){EFFECTS.initOnClick();EFFECTS.initArrows();EFFECTS.pic_src=w$('pic').src}},initOnOver:function(){var data=c$('onOver','img');for(var x=0;x<data.length;x++){var orig_src=data[x].src;var over_src=orig_src.replace(/.jpg/,"_hover.jpg");over_src=over_src.replace(/.gif/,"_hover.gif");over_src=over_src.replace(/.png/,"_hover.png");data[x].onmouseover=new Function("this.src ='"+over_src+"'");data[x].onmouseout=new Function("this.src ='"+orig_src+"'");myPreload(over_src)}},pic_nr:1,initOnClick:function(){var data=c$('onClick','img');for(var x=0;x<data.length;x++){var new_src=w$('pic').src.replace(/01/,"0"+(x+1));data[x].onclick=new Function("w$('pic').src='"+new_src+"'; EFFECTS.setCurrentImg("+x+"); EFFECTS.pic_nr="+(x+1));myPreload(new_src)}if(data.length>0){EFFECTS.setCurrentImg(0)}},setCurrentImg:function(x){var data=c$('onClick','img');for(y=0;y<data.length;y++){data[y].className=data[y].className.replace("onCurrent","")}data[x].className+=" onCurrent"},initArrows:function(){if(w$('arrowMinus')){w$('arrowMinus').onclick=new Function("EFFECTS.minusArrow();")}if(w$('arrowPlus')){w$('arrowPlus').onclick=new Function("EFFECTS.plusArrow();")}},minusArrow:function(){var pic_count=c$('onClick','img').length;var minus=EFFECTS.pic_nr-1;if(minus==0){minus=pic_count}var new_src=EFFECTS.pic_src.replace(/01/,"0"+minus);w$('pic').src=new_src;EFFECTS.pic_nr=minus;EFFECTS.setCurrentImg((minus-1))},plusArrow:function(){var pic_count=c$('onClick','img').length;var plus=EFFECTS.pic_nr+1;if(plus==(pic_count+1)){plus=1}var new_src=EFFECTS.pic_src.replace(/01/,"0"+plus);w$('pic').src=new_src;EFFECTS.pic_nr=plus;EFFECTS.setCurrentImg((plus-1));}};var SLIDER={init:function(){var data=c$('toSlide','*');for(var x in data){if(data[x].parentNode&&data[x].style){if(data[x].style.display=='none'){data[x].parentNode.style.height='1px';data[x].slideDown=true;data[x].style.display='block';data[x].scheduleHeight=data[x].offsetHeight;data[x].style.display=='none';data[x].style.marginTop='1px'}else{data[x].scheduleHeight=data[x].offsetHeight;data[x].style.marginTop='1px'}data[x].parentNode.style.overflow='hidden'}}},slide:function(id){var data=c$('toSlide','*');SLIDER.stepLength=25;timeOt=50;SLIDER.element=w$(id);if(arguments[1]==true){for(var x in data){if(data[x].id!=id&&data[x].slideDown!=true){SLIDER.toSwitch((data[x].id))}}}SLIDER.toSwitch(id)},toSwitch:function(id){SLIDER.element=w$(id);if(SLIDER.element.slideDown){if(parseInt(SLIDER.element.scheduleHeight)-parseInt(SLIDER.element.parentNode.style.height)<=SLIDER.stepLength){SLIDER.stepLength=parseInt(SLIDER.element.scheduleHeight)-parseInt(SLIDER.element.parentNode.style.height)}SLIDER.element.parentNode.style.height=parseInt(SLIDER.element.parentNode.offsetHeight)+SLIDER.stepLength+"px";if(parseInt(SLIDER.element.parentNode.style.height)>=parseInt(SLIDER.element.scheduleHeight)){return SLIDER.element.slideDown=false}setTimeout("SLIDER.toSwitch('"+id+"')",timeOt)}else{if(parseInt(SLIDER.element.parentNode.style.height)<=SLIDER.stepLength){SLIDER.stepLength=parseInt(SLIDER.element.parentNode.style.height)-1}SLIDER.element.parentNode.style.height=parseInt(SLIDER.element.parentNode.offsetHeight)-SLIDER.stepLength+"px";if(parseInt(SLIDER.element.parentNode.style.height)<=2){return SLIDER.element.slideDown=true}setTimeout("SLIDER.toSwitch('"+id+"')",timeOt)}}};var CHANGER={pic_count:0,pic_step:1000,init:function(){if(CHANGER.pic_count>1&&w$('changer')){var div=w$('changer');var imgHtml=div.innerHTML;div.innerHTML+=imgHtml;CHANGER.ele=div.childNodes[0];CHANGER.ele2=div.childNodes[1];div.style.height=CHANGER.ele.offsetHeight+"px";div.style.width=CHANGER.ele.offsetWidth+"px";CHANGER.ele.style.filter='alpha(opacity=100)';CHANGER.ele2.style.filter='alpha(opacity=100)';CHANGER.ele.style.opacity=1;CHANGER.ele2.style.opacity=1;CHANGER.ele.style.position='absolute';CHANGER.ele2.style.position='absolute';CHANGER.ele.style.zIndex=5;CHANGER.ele2.style.zIndex=0;CHANGER.ele2.src=CHANGER.ele2.src.replace("1","2");CHANGER.ele.picSrc=1;CHANGER.ele2.picSrc=2;CHANGER.orig_src=CHANGER.ele.src;setTimeout("CHANGER.change()",CHANGER.pic_step)}},change:function(){if(navigator.appName.indexOf("Microsoft")!=-1&&parseInt(navigator.appVersion)>=4){CHANGER.ele.filters.alpha.opacity=CHANGER.ele.filters.alpha.opacity-5;if(CHANGER.ele.filters.alpha.opacity<5){CHANGER.ele2.style.zIndex=5;CHANGER.ele.style.zIndex=0;CHANGER.ele.filters.alpha.opacity=100;CHANGER.ele.picSrc=CHANGER.ele.picSrc+1;if(CHANGER.ele.picSrc>CHANGER.pic_count){CHANGER.ele.picSrc=1}CHANGER.ele.src=CHANGER.orig_src.replace("1",CHANGER.ele.picSrc);myPreload(CHANGER.ele.src);CHANGER.ele_middle=CHANGER.ele2;CHANGER.ele2=CHANGER.ele;CHANGER.ele=CHANGER.ele_middle;setTimeout("CHANGER.change()",CHANGER.pic_step/2)}else{setTimeout("CHANGER.change()",60)}}else{CHANGER.ele.style.opacity=CHANGER.ele.style.opacity-0.05;if(CHANGER.ele.style.opacity<0.05){CHANGER.ele2.style.zIndex=5;CHANGER.ele.style.zIndex=0;CHANGER.ele.style.opacity=1;CHANGER.ele.picSrc=CHANGER.ele.picSrc+1;if(CHANGER.ele.picSrc>CHANGER.pic_count){CHANGER.ele.picSrc=1}CHANGER.ele.src=CHANGER.orig_src.replace("1",CHANGER.ele.picSrc);CHANGER.ele_middle=CHANGER.ele2;CHANGER.ele2=CHANGER.ele;CHANGER.ele=CHANGER.ele_middle;setTimeout("CHANGER.change()",CHANGER.pic_step/2)}else{setTimeout("CHANGER.change()",60)}}}};var url="includes/newsbox_klicks.php?param=";function handleHttpResponse(){if(http.readyState==4){results=http.responseText.split(",");alert(results[0])}}function cntNc(id){http.open("GET",url+id,true);http.send(null)}function getHTTPObject(){var xmlhttp;/*@cc_on@if(@_jscript_version>=5)try{xmlhttp=new ActiveXObject("Msxml2.XMLHTTP")}catch(e){try{xmlhttp=new ActiveXObject("Microsoft.XMLHTTP")}catch(E){xmlhttp=false}}@else xmlhttp=false;@end@*/if(!xmlhttp&&typeof XMLHttpRequest!='undefined'){try{xmlhttp=new XMLHttpRequest()}catch(e){xmlhttp=false}}return xmlhttp}var http=getHTTPObject();
jQuery.cookie=function(name,value,options){
if(typeof value!='undefined'){
options=options||{};
if(value===null){value='';options.expires=-1;}
var expires='';
if(options.expires&&(typeof options.expires=='number'||options.expires.toUTCString)){
var date;
if(typeof options.expires=='number'){
date=new Date();
date.setTime(date.getTime()+(options.expires*24*60*60*1000));
}else{date=options.expires;}
expires='; expires='+date.toUTCString();
}
var path=options.path?'; path='+(options.path):'';
var domain=options.domain?'; domain='+(options.domain):'';
var secure=options.secure?'; secure':'';
document.cookie=[name,'=',encodeURIComponent(value),expires,path,domain,secure].join('');
}else{
var cookieValue=null;
if(document.cookie&&document.cookie!=''){
var cookies=document.cookie.split(';');
for(var i=0;i<cookies.length;i++){
var cookie=jQuery.trim(cookies[i]);
if(cookie.substring(0,name.length+1)==(name+'=')){
cookieValue=decodeURIComponent(cookie.substring(name.length+1));break;
}}}
return cookieValue;}
};
$(document).ready(function(){
$("#topbar div#fontsizes a").click(function(){changeFontSize($(this));return false;});
$("#newsbox_prev").click(function(){changeNewsbox('prev'); stop_auto = true;});
$("#newsbox_next").click(function(){changeNewsbox('next'); stop_auto = true;});
$("#newsbox_navi").show();
stop_auto = false;
autoChangeNewsbox();
});
function autoChangeNewsbox(){bla = setTimeout('changeNewsbox("next")',7000);}
function changeFontSize(e){var c=$(e).attr('class');$("body").removeClass("small normal large");$("body").addClass(c);$("#topbar #fontsizes a").removeAttr("id");$(e).attr("id","current_fontsize");$.cookie('fs',c);}
var current_newsbox=1;
function changeNewsbox(d){
if(d=='next'){current_newsbox++;if(current_newsbox<1||current_newsbox>3){current_newsbox=1;}}
else{current_newsbox--;if(current_newsbox<1||current_newsbox>3){current_newsbox=3;}}
hideNewsbox(current_newsbox);
}
function hideNewsbox(box){$('#newsbox_wrapper').fadeOut('slow',function(){showNewsbox(box);});}
function showNewsbox(box){
if(nb[box]==null){return false;}
$("#newsbox_current").html(nb[box].box);
var nbl='';if(nb[box].linkurl!=''){nbl='<span>&raquo; <a href="'+nb[box].linkurl+'" target="'+nb[box].linkart+'">mehr dazu</a></span>';}
var nbi='';if(nb[box].bild!=''){nbi='<img class="float_left" src="'+nb[box].bild+'" width="120" height="120" alt="" />';}
var nbc=$('<h2>'+nbl+nb[box].titel+'</h2><div id="newsbox_content">'+nbi+'<p>'+nb[box].text+'</p></div>');
$("#newsbox_wrapper").html(nbc);
$('#newsbox_wrapper').fadeIn();
if(stop_auto != true) {
	autoChangeNewsbox();
} else {
	clearTimeout(bla);
}
}
