jQuery(function( $ ){
	$.localScroll.defaults.axis = 'yx';
	
	$.localScroll.hash({
		queue:false,
		duration:550
	});
	
	$.localScroll({
		queue:false,
		duration:1050,
		hash:true,
		onBefore:function( e, anchor, $target ){
		},
		onAfter:function( anchor, settings ){
		//$('#pointer').show();
		}
	});
});

$(document).ready(function(){
    $('.menublock>ul>li>a').click(
        function() {
			if ($(this).parent().is('.disabled')) {return;}
            $('.menublock2:visible').hide();
			var rmenu=$(this).parent().find('ul:first');
            rmenu.stop(true, true);
            ////$(this).parent().find('ul:first').fadeIn("fast");
			rmenu.show();
			rmenu.css('margin-left','0px');
			rmenu.animate({ marginLeft: "180px" }, 150 ,"swing");
			$('a#selectedtop').each(function(){
				$(this).removeAttr('id');
			});
		$('#selected').removeAttr('id');
		$(this).attr('id','selected');
        }
    );    
	$('.topmenu>a').click(
        function() {
			if ($(this).is('.disabledtop')) {return;}
            $('.menublock2:visible').hide();
			$('a#selectedtop').each(function(){
			$(this).removeAttr('id');
			});
			$(this).attr('id','selectedtop');
			$('#selected').each(function(){
				$(this).removeAttr('id');
			});
        }
    );
	
	$('.menublock2>li>a').click(function() {
	if ($(this).parent().is('.disabled')) {return;}
		$('a#selectedtop').each(function(){
			$(this).removeAttr('id');
		});
	$('#selected2').removeAttr('id');
	$(this).attr('id','selected2');
	});
	
	
	$(".popup").each(function(){
	$(this).fancybox({
		'zoomOpacity' 		: true,
		'width'				: 920,
		'height'			: '90%',
		'autoScale'			: false,
		'transitionIn'		: 'elastic',
		'transitionOut'		: 'elastic',
		'type'				: 'iframe',
		'padding'			: 20
	});
	});
});
