	// HABOTIN YLEISET JS TIEDOSTOT
	
	
	// POMPPIVAN MOOTOOLSIN SYSTEEMIT
	// DO THE MOO
	
	
window.addEvent('domready', function()
{

	// flyingbubbles	
	if($('flyingbubbles')){
		setBubblesJump();
		setTimeout("bubblesNew();",3000);
	}
	
	// ObjJump
	if($('page')){
		$('page').getElements('.ObjJump').each(function(element){
			var oriPos1 = element.getStyle("margin-top").toInt();
			element.addEvent('mouseenter', function(){ element.set('tween', {transition: Fx.Transitions.linear, duration: 'short'}); element.tween('margin-top', oriPos1-10); });
			element.addEvent('mouseleave', function(){ element.set('tween', {transition: Fx.Transitions.Bounce.easeOut}); element.tween('margin-top', oriPos1); });
		});
	}

	
});


function setBubblesJump()
{
	$('flyingbubbles').getElements('.ObjJump').each(function(e){
		var oriPos1 = e.getStyle("margin-top").toInt();
		e.addEvent('mouseenter', function(){ e.set('tween', {transition: Fx.Transitions.linear, duration: 'short'}); e.tween('margin-top', oriPos1-10); });
		e.addEvent('mouseleave', function(){ e.set('tween', {transition: Fx.Transitions.Bounce.easeOut}); e.tween('margin-top', oriPos1); });
	});
}

window.addEvent('domready', function(){
	//First Example
	var el = $('vieraskirja'),
		color = el.getStyle('backgroundColor');
	
	// We are setting the opacity of the element to 0.5 and adding two events
	$('vieraskirja').set('opacity', 0.5).addEvents({
		mouseenter: function(){
			// This morphes the opacity and backgroundColor
			this.morph({
				'opacity': 1,
				'background-color': 'transparent'
			});
		},
		mouseleave: function(){
			// Morphes back to the original style
			this.morph({
				opacity: 0.5,
				backgroundColor: color
			});
		}
	});

});

window.addEvent('domready', function(){
	//First Example
	var el = $('kuva1'),
		color = el.getStyle('backgroundColor');
	
	// We are setting the opacity of the element to 0.5 and adding two events
	$('kuva1').set('opacity', 0.5).addEvents({
		mouseenter: function(){
			// This morphes the opacity and backgroundColor
			this.morph({
				'opacity': 1,
				'background-color': 'transparent'
			});
		},
		mouseleave: function(){
			// Morphes back to the original style
			this.morph({
				opacity: 0.5,
				backgroundColor: color
			});
		}
	});

});

window.addEvent('domready', function(){
	//First Example
	var el = $('kuva2'),
		color = el.getStyle('backgroundColor');
	
	// We are setting the opacity of the element to 0.5 and adding two events
	$('kuva2').set('opacity', 0.5).addEvents({
		mouseenter: function(){
			// This morphes the opacity and backgroundColor
			this.morph({
				'opacity': 1,
				'background-color': 'transparent'
			});
		},
		mouseleave: function(){
			// Morphes back to the original style
			this.morph({
				opacity: 0.5,
				backgroundColor: color
			});
		}
	});

});

window.addEvent('domready', function(){
	//First Example
	var el = $('kuva3'),
		color = el.getStyle('backgroundColor');
	
	// We are setting the opacity of the element to 0.5 and adding two events
	$('kuva3').set('opacity', 0.5).addEvents({
		mouseenter: function(){
			// This morphes the opacity and backgroundColor
			this.morph({
				'opacity': 1,
				'background-color': 'transparent'
			});
		},
		mouseleave: function(){
			// Morphes back to the original style
			this.morph({
				opacity: 0.5,
				backgroundColor: color
			});
		}
	});

});

window.addEvent('domready', function(){
	//First Example
	var el = $('kuva4'),
		color = el.getStyle('backgroundColor');
	
	// We are setting the opacity of the element to 0.5 and adding two events
	$('kuva4').set('opacity', 0.5).addEvents({
		mouseenter: function(){
			// This morphes the opacity and backgroundColor
			this.morph({
				'opacity': 1,
				'background-color': 'transparent'
			});
		},
		mouseleave: function(){
			// Morphes back to the original style
			this.morph({
				opacity: 0.5,
				backgroundColor: color
			});
		}
	});

});

window.addEvent('domready', function(){
	//First Example
	var el = $('kuva5'),
		color = el.getStyle('backgroundColor');
	
	// We are setting the opacity of the element to 0.5 and adding two events
	$('kuva5').set('opacity', 0.5).addEvents({
		mouseenter: function(){
			// This morphes the opacity and backgroundColor
			this.morph({
				'opacity': 1,
				'background-color': 'transparent'
			});
		},
		mouseleave: function(){
			// Morphes back to the original style
			this.morph({
				opacity: 0.5,
				backgroundColor: color
			});
		}
	});

});


window.addEvent('domready',function() {
	/* settings */
	var showDuration = 3000;
	var container = $('slideshow-container');
	var images = container.getElements('img');
	var currentIndex = 0;
	var interval;
	/* opacity and fade */
	images.each(function(img,i){ 
		if(i > 0) {
			img.set('opacity',0);
		}
	});
	/* worker */
	var show = function() {
		images[currentIndex].fade('out');
		images[currentIndex = currentIndex < images.length - 1 ? currentIndex+1 : 0].fade('in');
	};
	/* start once the page is finished loading */
	window.addEvent('load',function(){
		interval = show.periodical(showDuration);
	});
});




/* Tips 1 */
var Tips1 = new Tips($$('.Tips1'));
 
/* Tips 2 */
var Tips2 = new Tips($$('.Tips2'), {
	initialize:function(){
		this.fx = new Fx.Style(this.toolTip, 'opacity', {duration: 500, wait: false}).set(0);
	},
	onShow: function(toolTip) {
		this.fx.start(1);
	},
	onHide: function(toolTip) {
		this.fx.start(0);
	}
});
 
/* Tips 3 */
var Tips3 = new Tips($$('.Tips3'), {
	showDelay: 400,
	hideDelay: 400,
	fixed: true
});
 
/* Tips 4 */
var Tips4 = new Tips($$('.Tips4'), {
	className: 'custom'
});



