window.addEvent('domready', function(){
//----------------
	if($chk($('flashcontent'))){ 
	var obj = new Swiff('pic/map_linasi.swf', {
		width:  452, 
		height: 280, 
		container: $('flashcontent'),
		params: {
			wmode: 'transparent',
			bgcolor: '#FFFFFF',
			menu:'false'
		}
	});
	};
//----------------------
//MAP MAP MAP MAP MAP MAP MAP MAP 
if($chk($('slideshow-map'))){
	var showDuration1 = 3000;
		var container1 = $('slideshow-map');
		var images1 = container1.getElements('img');
		var currentIndex1 = 0;
		var interval1;
		var toc1 = [];
		var tocWidth1 = 20;
		var tocActive1 = 'toc-active';
		
		/* new: starts the show */
		var start1 = function() { interval1 = show1.periodical(showDuration1);};
		var stop1 = function() { $clear(interval1); };
		/* worker */
		var show1 = function(to) {
			images1[currentIndex1].fade('out');
			toc1[currentIndex1].removeClass(tocActive1);
			images1[currentIndex1 = ($defined(to) ? to : (currentIndex1 < images1.length - 1 ? currentIndex1+1 : 0))].fade('in');
			toc1[currentIndex1].addClass(tocActive1);
			//if(currentIndex == 2){stop();}
			
		};
		
		images1.each(function(img,i){
			if(i > 0) { img.set('opacity',0); }
		});

		images1.each(function(img,i){
			toc1.push(new Element('class',{
				text: i+1,
				//href: '#',
				'class': 'toc' + (i == 0 ? ' ' + tocActive1 : ''),
				events: {
					mouseenter: function(e) {stop1();show1(i);},
					mouseleave: function(f) {start1();}
				},
				styles: {left: ((i + 1) * (tocWidth1 + 10))}
			}).inject(container1));
			if(i > 0) { img.set('opacity',0); }
		});
	
start1();
}
//MAP MAP MAP MAP MAP MAP MAP MAP 
}); 
