
function swichPrevLink(target, timer){
	if(timer!=-1){window.clearInterval(timer);timer=-1;}
	swichPrev(target);
}

function swichNextLink(target, timer){
	if(timer!=-1){
		window.clearInterval(timer);
		timer=-1;
	}
	swichNext(target);
}

function swichPrev(target){
	show = jQuery("#"+target + " > .display_on ");
	prev= show.prev(".display_off");
	show.removeClass("display_on").addClass("display_off").hide();
	if(prev.length==0) prev = jQuery("#"+target + " > .display_off").last();
	prev.removeClass("display_off").addClass("display_on").show();
}


function swichNext(target){
	show = jQuery("#"+target + " > .display_on ");
	next = show.next(".display_off");
	show.removeClass("display_on").addClass("display_off").hide();
	if(next.length==0) next = jQuery("#"+target + " > .display_off").first();
	next.removeClass("display_off").addClass("display_on").show();
}


//
// passt
//
var slideshow;

function startSlideshow(className) {
	slideshow = new Slideshow(className);
	slideshow.init();
	slideshow.run();
}

function stopSlideshow() {
	slideshow.stop();
}
		
function Slideshow(className) {
	var interval = 5 * 1000;
	var loop = true;
	var slides = new Array();
	var display = "block"; // default type of css display
	var current;
	var id;
	
	if (typeof Slideshow._initialized == "undefined") {
		Slideshow.prototype.add = function(oDiv) {
			this.slides.push(oDiv);
		}
		
		Slideshow.prototype.setInterval = function(iSecs) {
			this.interval = iSecs * 1000;
		}
		
		Slideshow.prototype.setLoop = function(bLoop) {
			this.loop = bLoop;
		}
		
		Slideshow.prototype.setDisplay = function(sDisplay) {
			this.display = sDisplay;
		}
		
		Slideshow.prototype.init = function() {
			this.slides = getElementsByClassName(document, "*", className);
			for (var i = 0; i < this.slides.length; i++)
				this.slides[i].style.display = "none";
				
			this.slides[0].style.display = display;
			current = 0;
		}
		
		Slideshow.prototype.run = function() {
			var oThis = this;
			function helper() {
				oThis.toggle();
			}
			
			id = window.setInterval(helper, interval);
		}
		
		Slideshow.prototype.stop = function() {
			if (id != null)
				window.clearInterval(id);
				
			this.init();
		}
		
		Slideshow.prototype.toggle = function() {
			if (current == this.slides.length - 1) {
				if (loop) {
					this.slides[current].style.display = "none";
					this.slides[0].style.display = display;
					current = 0;
				} else {
					this.stop();
				}
			} else {
				this.slides[current].style.display = "none";
				this.slides[current + 1].style.display = display;
				current++;
			}
		}
		
		Slideshow._initialized = true;
	}
}

var slideshowBis;

function startSlideshowBis(className) {
	slideshowBis = new SlideshowBis(className);
	slideshowBis.init();
	slideshowBis.run();
}

function stopSlideshowBis() {
	slideshowBis.stop();
}
		
function SlideshowBis(className) {
	var interval = 5 * 1000;
	var loop = true;
	var slides = new Array();
	var display = "block"; // default type of css display
	var current;
	var id;
	
	if (typeof SlideshowBis._initialized == "undefined") {
		SlideshowBis.prototype.add = function(oDiv) {
			this.slides.push(oDiv);
		}
		
		SlideshowBis.prototype.setInterval = function(iSecs) {
			this.interval = iSecs * 1000;
		}
		
		SlideshowBis.prototype.setLoop = function(bLoop) {
			this.loop = bLoop;
		}
		
		SlideshowBis.prototype.setDisplay = function(sDisplay) {
			this.display = sDisplay;
		}
		
		SlideshowBis.prototype.init = function() {
			this.slides = getElementsByClassName(document, "*", className);
			for (var i = 0; i < this.slides.length; i++)
				this.slides[i].style.display = "none";
				
			this.slides[0].style.display = display;
			current = 0;
		}
		
		SlideshowBis.prototype.run = function() {
			var oThis = this;
			function helper() {
				oThis.toggle();
			}
			
			id = window.setInterval(helper, interval);
		}
		
		SlideshowBis.prototype.stop = function() {
			if (id != null)
				window.clearInterval(id);
				
			this.init();
		}
		
		SlideshowBis.prototype.toggle = function() {
			if (current == this.slides.length - 1) {
				if (loop) {
					this.slides[current].style.display = "none";
					this.slides[0].style.display = display;
					current = 0;
				} else {
					this.stop();
				}
			} else {
				this.slides[current].style.display = "none";
				this.slides[current + 1].style.display = display;
				current++;
			}
		}
		
		SlideshowBis._initialized = true;
	}
}

/*
	Written by Jonathan Snook, http://www.snook.ca/jonathan
	Add-ons by Robert Nyman, http://www.robertnyman.com
*/
function getElementsByClassName(oElm, strTagName, oClassNames){
	var arrElements = (strTagName == "*" && oElm.all) ? oElm.all : oElm.getElementsByTagName(strTagName);
	var arrReturnElements = new Array();
	var arrRegExpClassNames = new Array();
	if (typeof oClassNames == "object") {
		for (var i = 0; i < oClassNames.length; i++)
			arrRegExpClassNames.push(new RegExp("(^|\\s)" + oClassNames[i].replace(/\-/g, "\\-") + "(\\s|$)"));
	} else
		arrRegExpClassNames.push(new RegExp("(^|\\s)" + oClassNames.replace(/\-/g, "\\-") + "(\\s|$)"));

	var oElement;
	var bMatchesAll;
	for (var j = 0; j < arrElements.length; j++){
		oElement = arrElements[j];
		bMatchesAll = true;
		for (var k = 0; k < arrRegExpClassNames.length; k++){
			if (!arrRegExpClassNames[k].test(oElement.className)){
				bMatchesAll = false;
				break;
			}
		}
		
		if (bMatchesAll)
			arrReturnElements.push(oElement);
	}
	
	return arrReturnElements;
}

