/*
         ___                         _____       __
        /  /\        ________       /    /\     / /\
(-----//  /  \//----/_____/__\\--) /____/  \___/_/ //--------------------------)
      /  /   /      \     | //     \    \  /    /\/    this code was created by
     /__/   /        \    |///-----\\____\/____/  \                       sigea
(---\\  \  /   (-----\\___|/        /    /\    \  /       
      \__\/                        /____/ /\____\/            __       sigea.ch
                                   \____\/  \  /             /\_\--------------)
                                         \___\//-------------\/_/  

*/
var banner;
function Banner(){
	var selectionID='banner';
	var showInterval=10000;
	var showIntervalTipp=20000;
	var nr=0;
	var timeout;
	this.prepare=function(){
		if(!document.getElementById(selectionID)) return false;
		var list=document.getElementById(selectionID).getElementsByTagName('li');
		for(var i=0; i < list.length; i++){
			//alert(list[i].getElementsByTagName('object').length);
			if(list[i].getElementsByTagName('object').length>0){
				if(list[i].outerHTML){
					var tmp=list[i].innerHTML;//list[i].getElementsByTagName('object')[0].outerHTML;
					list[i].innerHTML='';
					list[i].innerHTML=tmp;
				}
			}
		}
		if(list.length>1){
			var tempInterval=showInterval;
			if(list[0].className.indexOf('tipp') != -1){
				tempInterval=showIntervalTipp;
			}
			timeout=setTimeout('banner.showNext();',tempInterval);
		}
		list=null;
		return true;
	}
	this.showNext=function(){
		if(timeout)
			clearTimeout(timeout)
		var list=document.getElementById(selectionID).getElementsByTagName('li');
		addClass(list[nr],'hidden');
		if(nr>=list.length-1)
			nr=0
		else
			nr++;
		removeClass(list[nr],'hidden');
		var tempInterval=showInterval;
		if(list[nr].className.indexOf('tipp') != -1){
			tempInterval=showIntervalTipp;
		}
		timeout=setTimeout('banner.showNext();',tempInterval);
	}
}
function prepareBanner(){
	banner=new Banner();
	banner.prepare();
}
addLoadEvent(prepareBanner);