$(document).ready(function(){	
	$('.show_langs').click(function(e){
		e.preventDefault();
		e.stopPropagation();
		$(this).find('.arrow.flag').toggleClass('upsidedown');
		$('#list_langs').slideToggle(500);
	});

	/* TOP MENU - SHOW/HIDE */
	if($('#navbar').length > 0){
		$('#navbar li.category.submenu a.category').click(function(e){
			e.preventDefault();
		});
		$('#navbar li.category').hover(
				function(){
					$(this).find('ul').show();
				},
				function(){
					$(this).find('ul').hide();
				}
		);
	} 

	// accordion slider
	jQuery("#featured").not('.fadeslider, .newsslider').kricordion({
			slides: '.featured',		// wich element inside the container should serve as slide
			animationSpeed: 900,		// animation duration in milliseconds
			autorotation: true,			// autorotation true or false?
			autorotationSpeed:5,		// duration between autorotation switch in Seconds
			event: 'mouseover',			// event to focus a slide: mouseover or click
			imageShadow:true,			// should the image get a drop shadow to the left
			imageShadowStrength:0.5		// how dark should that shadow be, recommended values: between 0.3 and 0.8, allowed between 0 and 1
	});
	
	$('.cycle').cycle();
	$('.autopad').autopadding();
	$('.fancybox').fancybox();
	$('.scroll').jScrollPane();
	
	var first_click = true;
	var time = 200;
	$('.showslideshow').click(function(){
		//$('#split_container #text').hide("slide", { direction: "left" }, 1000);
		(first_click)
			? $('#split_container #text').animate({width:'0px'}, time, function(){
				$('.body.scroll').data('jsp').reinitialise();
			})
			: $('#split_container #text').animate({width:'350px'}, time, function(){
				$('.body.scroll').data('jsp').reinitialise();
			});
		
		first_click = !first_click;
		$('.body.scroll').data('jsp').reinitialise();
		
	});
	
	$('.showtext').click(function(){
		//$('#split_container #text').show("slide", { direction: "left" }, 1000);
		(first_click)
			? $('#split_container #text').animate({width:'960px'}, time, function(){
				$('.body.scroll').data('jsp').reinitialise();
			})
			: $('#split_container #text').animate({width:'350px'}, time, function(){
				$('.body.scroll').data('jsp').reinitialise();
			});
			
		first_click = !first_click;
		$('.body.scroll').data('jsp').reinitialise();
	});
	
});

