	
	
	var first_slides = new Array();
	
	
	function fade_out(item,opacity) {
		
		opacity -= 1; 
		
		item.style.opacity = opacity/10;
		item.style.filter = 'alpha(opacity=' + opacity*10 + ')';
		
		if (opacity>=0) {
			window.setTimeout(function () { fade_out(item,opacity);}, 50);
			return 1;
		} else {
			item.style.display = 'none';
			return 1;
		}
	}
	
	function fade_in(item_in, opacity) {
		
		opacity += 1;
		
		item_in.style.opacity = opacity/10;
		item_in.style.filter = 'alpha(opacity=' + opacity*10 + ')';
		
		if (opacity<=10) {
			window.setTimeout(function () { fade_in(item_in,opacity);}, 50);
			return 1;
		} else {
			return 0;
		}
		
	}
	
	
	function animate(slides, index) {
		
		index1 = index;
		
		if (index == (slides.length -1)) {
			index2 = 0;
			index = 0;
		} else {
			index2 = index + 1;
		}
		
		fade_out(slides[index1],10);
		
		slides[index2].style.display = 'block';
		fade_in(slides[index2],0);
		
		window.setTimeout(function () { animate(slides,index);}, 3000);
	}
	
	function slides() {
		
		var slideshow = document.getElementById('slideshow');
		var slides = slideshow.childNodes; 
		var slide_id = new Array();
		
		for (slide in slides) {
			
			if (slides[slide].nodeType == 1 && slides[slide].className != 'ikonky') {
				//alert(slides[slide].id);
				
				slides[slide].style.opacity = 1;
				slides[slide].style.filter = 'alpha(opacity=100)';
				
				slide_id = slides[slide].id.split('_');
				if (slide_id[1]=='1') {
					//alert('Prvni snimek: ' + slides[slide].id);
					first_slides.push(slides[slide]);
				}
			}
		}
	}
	
	function BasicSlideshow() {
		
		slides();
		
		animate(first_slides, 0);
		
	}
	
	//BasicSlideshow();
	
	
	
	
	
	
	/* docasny switchovani */
	function switch_slide(show, hide) {
		var last;
		last = show;
		var showSmall = document.getElementById('nb_'+ show);
		var loader = document.getElementById('loader');
		var show = document.getElementById('hd_'+ show);
		
		if (show.style.display == 'none') {
			
			var hide_arr = new Array();
			hide_arr = hide.split(',');
			
			for (x in hide_arr) {
				
				document.getElementById('hd_'+ hide_arr[x]).style.display = 'none';
				
				if (x !=0) {
					//if (document.getElementById('nb_'+ hide_arr[x])) {
						document.getElementById('nb_'+ hide_arr[x]).removeAttribute('class');
					//}
				}
				
			}
			
			if (last == 0) {
				document.getElementById('nb_1').removeAttribute('class');
			}
			
			show.style.display = 'block';
			if (showSmall) {
				showSmall.setAttribute('class','show');
			}
			//showSmall.style.top = '-12px';
			//showSmall.style.height = '127px';
			//showSmall.style.backgroundImage = 'url(template/design/header-menu_bg_hover.png)';
		}
	}
