$(document).ready(function(){ // wait for the DOM to load, then:

	$('#slideshow').innerfade({ 	// home slideshow arguments
		speed: 1500, 				// transition duration		
		timeout: 6000, 			// pause duration
		type:'sequence', 			// cycle order for list items
		containerheight:'240px' 	// must match height of ul#slideshow
	}); 							// more info: : http://medienfreunde.com/lab/innerfade/
	
	$('.hover').hover(	// inline image replacement
		function(){	// find img with 'hover' class and switch its source
			$(this).attr('src', $(this).attr('src').replace(/off.png/, 'on.png'));
		},
		function(){	// switch the source back on mouseout
			$(this).attr('src', $(this).attr('src').replace(/on.png/, 'off.png'));
	});
	
	$('#header li').hover (
		function(){
			$('ul', this)./*fadeIn(150)*/show();
		},
		function(){
			$('ul', this).fadeOut(300);
		});
		
/*	$('#menubox img').fadeTo(100, 0.7);
	$('#menubox img').hover (
		function(){
			$(this).stop().fadeTo(150, 1.0);
		},
		function(){
			$(this).fadeTo(300, 0.7);
		});
*/
	$('#menubox img').hover (
		function(){
			$('#menubox img').stop().fadeTo(200, 0.5);
			$(this).stop().fadeTo(200, 1.0);
		},
		function(){
			$('#menubox img').stop().fadeTo(400, 1.0);
		});

/*	$('#menubox img').mousedown(function(){
		$(this).fadeTo(50, 0.8);
		}).mouseup(function(){
		$(this).fadeTo(80, 1.0);
	});
*/	
	$('#download-menu a img').hover (
		function(){
			$(this).stop().animate({top:'-391px'},300);
		},
		function(){
			$(this).stop().animate({top:'0'},300);
		});
	
	$('a.popup').fancybox({
		'speedIn'		:	600, 
		'speedOut'		:	200, 
		'overlayShow'	:	true,
		'hideOnOverlayClick'	:	true,
		'hideOnContentClick'	:	true,
		'enableEscapeButton'	:	true,
		'overlayColor'	:	'#000',
		'overlayOpacity'	:	0.5
	});
	
}); 

