
$(document).ready(function() {
	
	// --------------- Viewchanger
	
	// Options
	var active_class	= 'active';
	
	// First, hide all...
	$('.hiddenArea').hide();
	
	// On Load, get current, or default (the first one)
	var currentSelect;
	var currentLink;	
	var hash			= window.location.hash;
	var defaultSelect	= $('.first-article');
	var defaultLink		= $('#gallery-slider li:first a, #hiddenController li:first a');

	if (hash == '') {
		defaultSelect.show();
		defaultLink.addClass('active');
	}else{
		currentSelect = $('.hiddenArea'+hash);
		currentLink = $('#gallery-slider li a[href*='+hash+'], #hiddenController li a[href*='+hash+']');
		currentSelect.show();
		currentLink.addClass(active_class);
	}

	// On click
	$('#gallery-slider li a, #hiddenController li a').click(function(){
		// Hide everything, and disable active links
		$('.hiddenArea').hide();
		var actives = $('#gallery-slider li, #hiddenController li').find('a.active');
		
		actives.each( function() {
			$(this).removeClass('active');
		});
		
		// Activate Clicked...
		var current = $(this).attr('href');
		currentSelect = $('.hiddenArea'+current);
		currentLink = $(this);
		
		currentSelect.show();
		currentLink.addClass(active_class);
		return false;
	});
	
	
});
