$(document).ready(function()
{
	var subNavTimer; 
	
	$('.other').bind('mouseenter', function()
	{
		clearTimeout(subNavTimer);
		
		$('.other').not(this).find('.sub-menu').hide(300);
		$(this).find('.sub-menu').show(300);
		
	});
	
	$('.other').bind('mouseleave', function()
	{
		subNavTimer = setTimeout('$(".sub-menu:visible").hide(200);', 1000);
	});
	
	
	$('.test').bind('mouseenter', function()
	{
		clearTimeout(subNavTimer);

		$('.test').not(this).find('.nav-partners').fadeOut(400);
		$(this).find('.nav-partners').fadeIn(400);

	});

	$('.test').bind('mouseleave', function()
	{
		subNavTimer = setTimeout('$(".nav-partners:visible").fadeOut(300);', 1000);
	});
	
	$('.thickbox').fancybox({
			'zoomSpeedIn': 200,
			'zoomSpeedOut': 200,
			'frameWidth': 100,
			'frameHeight': 100,
			'overlayShow': true
		});	

		$('.map-toggle a').click(function(){
		var rel = $(this).attr('rel');

		if (rel == 'map-scheme')
		{
			//$('.maps').find('#map-google').fadeOut(500);
			$('.maps').find('#map-scheme').fadeIn(500);
			$('.map-toggle').find('.maps-yandex').removeClass('active');
			$('.map-toggle').find('.map-scheme').addClass('active');
		}
		else
		{
			$('.maps').find('#map-scheme').fadeOut(500);
			$('.map-toggle').find('.maps-yandex').addClass('active');
			$('.map-toggle').find('.map-scheme').removeClass('active');
		}

		return false;

	})
	
});
