$(document).ready(
	function(){
	
	$(document).pngFix();

	// Frontpage slideshow
	if ($('.home').length > 0){
    		
		$('#panel_1').cycle({
			fx: 'scrollDown',
			speed: 1000,
    		sync:1,
			timeout: 7000,
			easing: 'easeInOutQuad',
			pause:1

		});
		$('#panel_2').cycle({
			fx: 'scrollDown',
			speed: 1000,
    		sync:1,
			timeout: 7000,
			delay:2000,
			easing: 'easeInOutQuad',
			pause:1
		});
		$('#panel_3').cycle({
			fx: 'scrollDown',
			speed: 1000,
    		sync:1,
			timeout: 7000,
			delay:4000,
			easing: 'easeInOutQuad',
			pause:1

		});
		
		$('#sliderPhoto dl dt').hide();
		
		function animate(){
			$('#sliderPhoto #panel_1 dl dt').slideDown('fast');
			$('#sliderPhoto #panel_2 dl dt').slideDown('normal');
			$('#sliderPhoto #panel_3 dl dt').slideDown('slow');
		}
		
		animate();
		
    	$('#sliderPhoto dl').hover(
 			function(){
				$(this).find('dd').css('display','block');
			},
			function(){
				$(this).find('dd').css('display','none');
 			})
    		
   	 }

	// Frontpage slideshow
	if ($('.competitions').length > 0){
		$('#sliderPhoto ul').cycle({
			fx: 'scrollDown',
			speed: 1000,
			random: '0',
			timeout: 10000,
			easing: 'easeInOutQuad'

		});
	}


	$('.caption span.name').hide();
	$('.caption').hover(
		function(){
		$('.caption span.name').show();
		},
		function(){
		$('.caption span.name').hide();
		}
	)
	
	/*$("a.zoom").fancybox({
		padding: 0,
		overlayOpacity: .7,
		overlayColor: '#000'
		});*/

	$("#details a").addClass("external").click(function() { window.open($(this).href); return false; });
	

	if ($(".label").length>0) {
	$("input:text").labelify({
		text: "label",
		labelledClass: "labeltext"
		});
	}
	
	$('#block_header li ul').hide();
	$('#block_header li').hover(
		function() {
		 $(this).find('ul').show();
		},
		function() {
		 $(this).find('ul').hide();
		}
	)
	

})

