$(function () {
        
        $('a#tulostin,a#etusivu,a#palvelut,a#tekniset_ohjeet,a#caset,a#media,a#tyonhakijat,a#yhteys,a#tarjous,#painotyohotelli,#pagevision,#viestintatoimisto')
            .append('<span class="hover" />').each(function () {
                    var $span = $('> span.hover', this).css('opacity', 0);
                    $(this).hover(function () {
                        // on hover
                        $span.stop().fadeTo(250, 1);
                    }, function () {
                        // off hover
                        $span.stop().fadeTo(350, 0);
                    });
                });
                
    });

$(document).ready(function(){

	$("a#infoboxlink1").click(function() { //When trigger is clicked...

		//Following events are applied to the subnav itself (moving subnav up and down)
		$("#infobox1").fadeIn(600).show(); //Drop down the subnav on click
	});

	$("a#infoboxlink2").click(function() { //When trigger is clicked...

		//Following events are applied to the subnav itself (moving subnav up and down)
		$("#infobox2").fadeIn(600).show(); //Drop down the subnav on click
	});

	$("a#infoboxlink3").click(function() { //When trigger is clicked...

		//Following events are applied to the subnav itself (moving subnav up and down)
		$("#infobox3").fadeIn(600).show(); //Drop down the subnav on click
	});

		$("a#infobox_close").click(function() { //When trigger is clicked...

		//Following events are applied to the subnav itself (moving subnav up and down)
		$("#infobox1,#infobox2,#infobox3").fadeOut(600); //Drop down the subnav on click
	});

});

$(function () {
$('#painotyohotelli')
	.css( {backgroundPosition: "-5px 0"} )
	.mouseover(function(){
		$(this).stop().animate(
			{backgroundPosition:"(0px 0)"}, 
			{duration:200})
		})
	.mouseout(function(){
		$(this).stop().animate(
			{backgroundPosition:"(-5px 0)"}, 
			{duration:200})
		})
$('#pagevision')
	.css( {backgroundPosition: "-5px -195px"} )
	.mouseover(function(){
		$(this).stop().animate(
			{backgroundPosition:"(0px -195px)"}, 
			{duration:200})
		})
	.mouseout(function(){
		$(this).stop().animate(
			{backgroundPosition:"(-5px -195px)"}, 
			{duration:200})
		})
$('#viestintatoimisto')
	.css( {backgroundPosition: "-5px -385px"} )
	.mouseover(function(){
		$(this).stop().animate(
			{backgroundPosition:"(0px -385px)"}, 
			{duration:200})
		})
	.mouseout(function(){
		$(this).stop().animate(
			{backgroundPosition:"(-5px -385px)"}, 
			{duration:200})
		})
});
