$(document).ready(function() {
	$("#accordion-l").accordion({
		autoHeight: false,
		navigation:true
	});
	
	function formatText(index, panel) {
			  return index + "";
		    }
 
	$(function () {
  
		$('.anythingSlider').anythingSlider({
			easing: "easeInOutExpo",        // Anything other than "linear" or "swing" requires the easing plugin
			autoPlay: true,                 // This turns off the entire FUNCTIONALY, not just if it starts running or not.
			delay: 10000,                    // How long between slide transitions in AutoPlay mode
			startStopped: false,            // If autoPlay is on, this can force it to start stopped
			animationTime: 1200,             // How long the slide transition takes
			hashTags: true,                 // Should links change the hashtag in the URL?
			buildNavigation: true,          // If true, builds and list of anchor links to link to each slide
			pauseOnHover: true,             // If true, and autoPlay is enabled, the show will pause on hover
			startText: "Go",             // Start text
			stopText: "Stop",               // Stop text
			navigationFormatter: formatText       // Details at the top of the file on this use (advanced use)
		});

		$("#slide-jump").click(function(){
			$('.anythingSlider').anythingSlider(6);
		});

	});
	
	$('#s-ext').addClass('org-show');
	$('#s-int').addClass('org-hide');
	$('#s-muz').addClass('org-hide');
	$('#l-ext').addClass('sel');
	
	$('#l-ext').click(function() {
		$('#l-int').removeClass('sel');
		$('#l-muz').removeClass('sel');
		$(this).addClass('sel');
		
		$('#s-ext').removeClass('org-show');
		$('#s-int').removeClass('org-show');
		$('#s-muz').removeClass('org-show');
		
		$('#s-ext').removeClass('org-hide');
		$('#s-int').removeClass('org-hide');
		$('#s-muz').removeClass('org-hide');
		
		$('#s-ext').addClass('org-show');
		$('#s-int').addClass('org-hide');
		$('#s-muz').addClass('org-hide');
		
		return false;
	});
	
	$('#l-int').click(function() {
		$('#l-ext').removeClass('sel');
		$('#l-muz').removeClass('sel');
		$(this).addClass('sel');
		
		$('#s-ext').removeClass('org-show');
		$('#s-int').removeClass('org-show');
		$('#s-muz').removeClass('org-show');
		
		$('#s-ext').removeClass('org-hide');
		$('#s-int').removeClass('org-hide');
		$('#s-muz').removeClass('org-hide');
		
		$('#s-ext').addClass('org-hide');
		$('#s-int').addClass('org-show');
		$('#s-muz').addClass('org-hide');
		
		return false;
	});
	
	$('#l-muz').click(function() {
		$('#l-ext').removeClass('sel');
		$('#l-int').removeClass('sel');
		$(this).addClass('sel');
		
		$('#s-ext').removeClass('org-show');
		$('#s-int').removeClass('org-show');
		$('#s-muz').removeClass('org-show');
		
		$('#s-ext').removeClass('org-hide');
		$('#s-int').removeClass('org-hide');
		$('#s-muz').removeClass('org-hide');
		
		$('#s-ext').addClass('org-hide');
		$('#s-int').addClass('org-hide');
		$('#s-muz').addClass('org-show');
		
		return false;
	});
	
	$('.evlink').click(function() {

		$('.evlink').each(function(i) {
			$(this).removeClass('sel');
		});

		$(this).addClass('sel');

		var evid = $(this).attr('href');

		$('.evart').each(function(i) {
			$(this).removeClass('org-show').removeClass('org-hide').addClass('org-hide');
		});

		$(evid).removeClass('org-hide').addClass('org-show');
		
		return false;
	});
	
	$('.nwslink').click(function() {

		$('.nwslink').each(function(i) {
			$(this).removeClass('sel');
		});

		$(this).addClass('sel');

		var nwsid = $(this).attr('href');

		$('.nwsart').each(function(i) {
			$(this).removeClass('org-show').removeClass('org-hide').addClass('org-hide');
		});

		$(nwsid).removeClass('org-hide').addClass('org-show');
		
		return false;
	});
	
	//fancybox setup

		$("a.fancyb").fancybox({
			'autoScale'         : false,
			'autoDimensions'    : true,
			'transitionIn'		: 'elastic',
			'transitionOut'		: 'elastic',
			'easingIn'			: 'swing',
			'easingOut'			: 'swing',
			'speedIn'			: 200,
			'speedOut'			: 50
		});
		
		$("a.fancyf").fancybox({
			'type'				: 'iframe',
			'autoScale'         : false,
			'autoDimensions'    : true,
			'transitionIn'		: 'elastic',
			'transitionOut'		: 'elastic',
			'easingIn'			: 'swing',
			'easingOut'			: 'swing',
			'speedIn'			: 200,
			'speedOut'			: 50
		});
});
