jQuery(document).ready(function() {
	jQuery('.slideshow').cycle({
		fx:     'fade',
        speed:  'fast',
		speedIn:	   0,  // speed of the 'in' transition
	speedOut:	   0,  // speed of the 'out' transition
		timeoutFn: calculateTimeout 
	})
function calculateTimeout(currElement, nextElement, opts, isForward) { 
    // here we set even number slides to have a 2 second timeout; 
    // by returning false for odd number slides we let those slides 
    // inherit the default timeout value (4 sec) 
     var index = opts.currSlide; 
    return index % 2 ? 5000 : false;
}
	jQuery('.slideshow2 div').cycle({
		fx: 'fade'// choose your transition type, ex: fade, scrollUp, shuffle, etc...
	})
jQuery('.mainmenu-hover')
		.css( {backgroundPosition: "-20px 41px"} )
		.mouseover(function(){
			jQuery(this).stop().animate({backgroundPosition:"(-20px 130px)"}, {duration:500})
		})
		.mouseout(function(){
			jQuery(this).stop().animate({backgroundPosition:"(40px 41px)"}, {duration:500, complete:function(){
				jQuery(this).css({backgroundPosition: "-20px 41px"})
			}})
		})
	jQuery('.mainmenu-selected')
	 .css( {backgroundPosition: "-20px 130px"} )
		.mouseover(function(){
			jQuery(this).stop().animate({backgroundPosition:"(-20px 41px)"}, {duration:500})
		})
		.mouseout(function(){
			jQuery(this).stop().animate({backgroundPosition:"(40px 130px)"}, {duration:500, complete:function(){
				jQuery(this).css({backgroundPosition: "-20px 130px"})
			}})
		})
        positionFooter();
        
        jQuery(window)
          .scroll(positionFooter)
          .resize(positionFooter);
        
        function positionFooter() {
          var docHeight = jQuery(document.body).height() - jQuery("#sticky-footer-push").height();
          if(docHeight < jQuery(window).height()){
            var diff = jQuery(window).height() - docHeight;
            if (!jQuery("#sticky-footer-push").length > 0) {
              jQuery("#footer").before('<div id="sticky-footer-push"></div>');
            }
            jQuery("#sticky-footer-push").height(diff);
          } 
        }
      });
