$(document).ready(function()
{ 
	var active_sub = 'null';
	
	// Asetetaan alasvedon paikka
	var par = $('#tuotteet');
	$('#subnavi_0').css('position', 'absolute') ;
	$('#subnavi_0').css('top', par.offset().top + 23 ); 
	$('#subnavi_0').css('left', par.offset().left - 0 ); 
	
	$('#subnavi_0').hide();	
	
	$('#tuotteet').mouseover(function() 
	{	
		if (active_sub != '#subnavi_0') 
			$(active_sub).hide('fast');							
		active_sub = '#subnavi_0';
		$('#subnavi_0').show('fast');
	});
	
	$('#subnavi_0').bind("mouseenter", (function()							
	{
		$(this).show();
	}));
	
	$('#subnavi_0 > *').bind("mouseenter", (function()							
	{
		$('#subnavi_0').show();
	
	}));						
						
	$('#subnavi_0 > *').bind("mouseleave", (function()
	{							
		$('#subnavi_0').hide('fast');
	}));
	
	
	// Asetetaan alasvedon paikka
	var par = $('#hoidot');
	$('#subnavi_1').css('position', 'absolute') ;
	$('#subnavi_1').css('top', par.offset().top + 23 ); 
	$('#subnavi_1').css('left', par.offset().left - 0 ); 
	
	$('#subnavi_1').hide();	
	
	$('#hoidot').mouseover(function() 
	{	
		if (active_sub != '#subnavi_1') 
			$(active_sub).hide('fast');							
		active_sub = '#subnavi_1';
		$('#subnavi_1').show('fast');							
	});
	
	$('#subnavi_1').bind("mouseenter", (function()							
	{
		$(this).show();
	}));
	
	$('#subnavi_1 > *').bind("mouseenter", (function()							
	{
		$('#subnavi_1').show();
	
	}));						
						
	$('#subnavi_1 > *').bind("mouseleave", (function()
	{							
		$('#subnavi_1').hide('fast');															
	}));
	
	
	// Asetetaan alasvedon paikka	
	var par = $('#dayspa');
	$('#subnavi_2').css('position', 'absolute') ;
	$('#subnavi_2').css('top', par.offset().top + 23 ); 
	$('#subnavi_2').css('left', par.offset().left + 15 ); 
	
	$('#subnavi_2').hide();	
	
	$('#dayspa').mouseover(function() 
	{	
		if (active_sub != '#subnavi_2') 
			$(active_sub).hide('fast');							
		active_sub = '#subnavi_2';
		$('#subnavi_2').show('fast');							
	});
	
	$('#subnavi_2').bind("mouseenter", (function()							
	{
		$(this).show();
	}));
	
	$('#subnavi_2 > *').bind("mouseenter", (function()							
	{
		$('#subnavi_2').show();
	
	}));						
						
	$('#subnavi_2 > *').bind("mouseleave", (function()
	{							
		$('#subnavi_2').hide('fast');															
	}));
	
	
	// Asetetaan alasvedon paikka	
	var par = $('#yonka');
	$('#subnavi_3').css('position', 'absolute') ;
	$('#subnavi_3').css('top', par.offset().top + 23 ); 
	$('#subnavi_3').css('left', par.offset().left + 0 ); 
	
	$('#subnavi_3').hide();	
	
	$('#yonka').mouseover(function() 
	{	
		if (active_sub != '#subnavi_3') 
			$(active_sub).hide('fast');							
		active_sub = '#subnavi_3';
		$('#subnavi_3').show('fast');							
	});
	
	$('#subnavi_3').bind("mouseenter", (function()							
	{
		$(this).show();
	}));
	
	$('#subnavi_3 > *').bind("mouseenter", (function()							
	{
		$('#subnavi_3').show();
	
	}));						
						
	$('#subnavi_3 > *').bind("mouseleave", (function()
	{							
		$('#subnavi_3').hide('fast');															
	}));
							



//tuote testi	
	$('.tuote').hide();
	
	$('.show').click(function()
		{														
			$('.tuote').show("slow");					
		}
	);
	
	$('.hide').click(function()
		{														
			$('.tuote').hide("slow");					
		}
	);
	
	
});