	function scrollUp(amount){
		$('.scrollable').stop().scrollTo( '-=' + amount, 500 ); 
	}

	function scrollDown(amount){
		$('.scrollable').stop().scrollTo( '+=' + amount, 500 ); 
	}

	(function($) {
		$.fn.hasScrollBar = function() {
			return this.get(0).scrollHeight > this.height();
		}
	})(jQuery);

	$(document).ready(function () {

		if ($('.webshop').length)	{
			if ($('#myorder').length) {
				var newHeight = $('#myorder').height() + 300;
				
				$('#container').height(newHeight < 600 ? 600 : newHeight);
			}
			$('#menu').scrollTo( '#eshop', { duration: 0 } );
		}

		if ($('.language').length)	{
			$('#menublock, #menu').slideDown(1800, 'easeOutBounce');
		}

		if ($('#content').length)	{
			$('#content').fadeIn(1500, 'easeInOutExpo');
		}

		if ($('.scrollable').length && $('.scrollable').hasScrollBar()) {
			$('.scrollbar').show();
			
			if ($('.scrollable.fast').length) {
				var scrollAmount = 200;
			} else {
				scrollAmount = 100;
			}
			
			// scrolling options for text
			$('.scrollbar .up').click(function(e){
				e.preventDefault();
				scrollUp(scrollAmount);

			});		
			// scrolling options for text
			$('.scrollbar .down').click(function(e){
				e.preventDefault();
				scrollDown(scrollAmount);
			});

			// scroll with mousewheel too
			$('.scrollable').bind('mousewheel', function(event, delta) {
				delta > 0 ? scrollUp(scrollAmount) : scrollDown(scrollAmount);
			});
		} else {
			$('.scrollbar').hide();
		}

		$("a[rel^='showroom']").prettyPhoto({
			social_tools: false,
			show_title: false,
			allow_resize: true,
			deeplinking: false,
			theme: 'light_rounded',
			overlay_gallery: false
		});

		$("a[rel^='articles']").prettyPhoto({
			social_tools: false,
			show_title: true,
			allow_resize: true,
			default_width: '95%',
			default_height: '95%',
			deeplinking: false,
			theme: 'light_rounded'
		});

		if ($('.showroom').length)	{
			$('#firstimage').trigger('click');
		}
		
		$.localScroll({
			target: '#menu', // could be a selector or a jQuery object too.
			easing: 'easeInOutExpo',
			items: $('#menuscroller > ul'),
			navigation: '#menuscroller a.menunav',
			duration:1500
		});
		
	});
