﻿$(document).ready(function(){
	$("ul.sf-menu").supersubs({
		minWidth:    10,
		maxWidth:    25,
		extraWidth:  1.5
	}).superfish({ 
		delay:       800,                            // one second delay on mouseout 
		animation:   {opacity:'show',height:'show'},  // fade-in and slide-down animation 
		speed:       '500',                         // faster animation speed
    	autoArrows:    false
    });
});

$(document).ready(function(){
var menu_shift_duration = 0;
var menuYloc = null;

$(window).scroll(function()
{
    offset = menuYloc + $(document).scrollTop()-175;
    if(offset < 0)offset = 0;
    offset += "px";
    $('#menu').animate({top:offset},{duration:menu_shift_duration,queue:false});
});


	$('#header').mouseover(function(){
		$('#header').parallax({
      		'elements': [
	       		{
					'selector': '#wolken',
					'properties': {
						'x': {
							'background-position-x': {
								'initial': 70,
								'multiplier': 0.05,
								'invert': true,
								'unit': 'px',
								'min': 0,
								'max': 140
							}
						}
					}
				},
				{
					'selector': '#baum',
					'properties': {
						'x': {
							'background-position-x': {
								'initial': -70,
								'multiplier': 0.15,
								'unit': '%',
								'min': -140,
								'max': 0
							}
						}
					}
				}
			]
		});
	});
	
	$('#header').mouseout(function(){
		$('#header').parallax({
      		'elements': [
	       		{
					'selector': '#wolken',
					'properties': {
						'x': {
							'background-position-x': {
								'initial': 70,
								'multiplier': 0.01,
								'invert': true,
								'unit': 'px',
								'min': 0,
								'max': 140
							}
						}
					}
				},
				{
					'selector': '#baum',
					'properties': {
						'x': {
							'background-position-x': {
								'initial': -70,
								'multiplier': 0.01,
								'unit': '%',
								'min': -140,
								'max': 0
							}
						}
					}
				}
			]
		});
	});
	
});

	hs.graphicsDir = './design/css/graphics/';
	hs.align = 'center';
	hs.transitions = ['expand', 'crossfade'];
	hs.outlineType = 'rounded-white';
	hs.fadeInOut = true;
	hs.dimmingOpacity = 0.75;
	hs.wrapperClassName = 'highslide-white'; 
	
	// Add the controlbar
	if (hs.addSlideshow) hs.addSlideshow({
		//slideshowGroup: 'group1',
		interval: 5000,
		repeat: false,
		useControls: true,
		fixedControls: false,
		overlayOptions: {
			opacity: 0.75,
			position: 'center',
			hideOnMouseOut: true
		}
	});


