$(document).ready(function() {
	
	$("#mainmenu a").mouseenter(function() {
		$(this).animate({
			backgroundPosition: '(-700px 0px)'		
		}, 50);
		$(this).css("color", "#ffff90");
	});
	
	$("#mainmenu a").mouseleave(function() {
		$(this).animate({
			backgroundPosition: '(0px 0px)'
		}, 400);
		$(this).css("color", "#ffffff");
	
	});
	
	$(".item").mouseenter(function() {
		var wid = $(this).width();
		$(this).animate(
		{
			marginLeft: '-15px',
			marginright: '15px'
		}, 100
		);
		
	});
	
	$(".item").mouseleave(function() {
		$(this).animate(
		{
			marginLeft: '0px',
			marginright: '0px'
		}, 500
		);
		
	});
	
		
// 	$("img#en").mouseenter(function() {
// 		var wid = $(this).width();
// 		$(this).attr('src','images/langmenu/en-hover.png');
// 	});
	
// 	$("img#en").mouseleave(function() {
// 		var wid = $(this).width();
// 		$(this).attr('src','images/langmenu/en-bottom.png');
// 	});

	
// 	$("img#fi").mouseenter(function() {
// 		var wid = $(this).width();
// 		$(this).attr('src','images/langmenu/fi-hover.png');
// 	});
	
// 	$("img#fi").mouseleave(function() {
// 		var wid = $(this).width();
// 		$(this).attr('src','images/langmenu/fi-bottom.png');
// 	});		
	
	$('#refshuffle').cycle({
	    fx:     'shuffle',
	    easing: 'backout',
	    speed: 500,
	    shuffle: { top:15, left: -190 },
	    delay:  5000,
	    pause: true
	});
	
	$('#refshuffle').mouseenter(function() {
		var offset = $('#refshuffle').offset();
		var x = offset.left + 195;
		var y = offset.top + 17;

		$('#preview').css("top", y);
		$('#preview').css("left", x);
		
		$('#preview').show();
	});
	
	$('#refshuffle').mouseleave(function() {
		$('#preview').hide();
	});
		
			
});