//function for the headerBg scrolling background

var scrollSpeed = 35;       // Speed in milliseconds
var step = 1;               // How many pixels to move per step
var current = 0;            // The current pixel row
var imageHeight = 822;     // Background image height
var headerHeight = 760;     // How tall the header is.

//The pixel row where to start a new loop
var restartPosition = -(imageHeight - headerHeight);

function scrollBg(){
    
    //Go to next pixel row.
    current += step;
    
    //If at the end of the image, then go to the top.
    if (current == restartPosition){
        current = 0;
    }
    
    //Set the CSS of the header.
    $('#header').css("background-position","0 "+current+"px");
    
    
}

//Calls the scrolling function repeatedly
var init = setInterval("scrollBg()", scrollSpeed);

//function to spin the snowflake in the header

//Begin Boosh Media nav code
//Author: Jon Watkins
//http://www.boosh-media.co.uk

//function to display the dropdown menu for the navigation
$(function(){
	$('.dropdown').parent().eq(0).hover(function(){ //displays the dropdown menu when the parent element is hovered over
		$('.dropdown:eq(0)',this).slideDown(300); //mouse over
	},function(){
		$('.dropdown:eq(0)',this).slideUp(300);  //mouse out
	});
	$('.dropdown li a').hover(function(){ //nudges the dropdown links by 10px
		$(this).stop().animate({paddingLeft:'20'},100); //mouse over
	},function(){
		$(this).stop().animate({paddingLeft:'10'},100); //mouse out
	});
	$('.dropdown li a').click(function(){ //hides the dropdown when a link is clicked
		$('.dropdown').fadeOut(100);
	});
});