			
			/*
			Tento script musi mit pred svym pouzitim definovany nasledujici promenne:
			
			var Images = new Array(<?= implode(",",$srcs)?>);
			var flash_image = 'flash_image';
			var ss_button = 'start_stop_btn';
			*/
			
			var Images = new Array(3);
			
			/* Nasledujici promenne je mozne prepsat */
			var current_img_id = 0;			
			var delay = 10000;
			var pause = false;
		 	/* pro zamezeni prave naplanovane akce v casovem timeoutu
				pouzito kdyz se klikne na zobrazeni dalsiho/predchoziho obsahu, aby se po kliknu nezobrazil priste a pak hned prespristi apod
			*/
 			var abort_next_action = false;
						
			function next_image(){	
				/* Switch to the next image */			
				old_id = current_img_id;
				if (current_img_id == Images.length - 1 )
					current_img_id = 0;
				else
					current_img_id++;
				
				switch_content(old_id, current_img_id);				
				return false;				
			}
			
			function prev_image(){	
				/* Switch to the prev image */			
				old_id = current_img_id;
				if (current_img_id == 0 )
					current_img_id = Images.length - 1;
				else
					current_img_id--;
					
				switch_content(old_id, current_img_id);				
				return false;				
			} 
			
			function switch_content(old_id, current_img_id){
				document.getElementById('slideshow_box_' + old_id).style.display = 'none';
				document.getElementById('slideshow_box_' + current_img_id).style.display = 'block';
				
				old_status = document.getElementById('status' + old_id);
				old_status.setAttribute('class', '');
				old_status.setAttribute('className', '');
				
				new_status = document.getElementById('status' + current_img_id);
				new_status.setAttribute('class', 'active');
				new_status.setAttribute('className', 'active');				
				
				document.getElementById('slideshow_content_id_display').innerHTML = (current_img_id+1) + '/' + Images.length;	
			}
			
		
			function image_run(){				
				if(pause)
					return;					
				
				setTimeout(image_run,delay);
				if(!abort_next_action)
					next_image();				
				abort_next_action = false;
			}
			
			function start_image_run(){				
				setTimeout(image_run,delay);
				//image_run();
			}
			
			function pause_image_run() {
				pause = true;
			}
			
			function start_stop(){
				var btn = document.getElementById('ss_button');
				if(pause) {
					pause = false;
					btn.className = "";
//					btn.src = "/images/ovladac/btn_pause.gif";
					image_run();
				} else {				
          btn.className = "play";	
//					btn.src = "/images/btn/nav-next.gif";
					pause_image_run();
				}
				return false;
			}
			
			/* kliknuto na zobrazeni dalsi stranky (zobraz ji a zamez puvodne nastavenemu Timeoutu) */
			function next_page_clicked(){				
				abort_next_action = true;
				next_image();				
				return false;
			}
			
			function prev_page_clicked(){				
				abort_next_action = true;
				prev_image();				
				return false;
			}
			
			
			
			/* ------------------------------------------- */			
			start_image_run();

