jQuery(function(){
	//geeks sidebar menu
	$('#sidebar ul li:not(.active) ul').hide();
	$('#sidebar>ul li a').click(function() {
		if ($(this).attr('href') == '#') {
			$('#sidebar ul ul:visible').slideUp();
			$('#sidebar ul li.active').removeClass('active');
			$(this).siblings('ul').slideDown();
			$(this).parent().addClass('active');
			return false;
		} else {
			return true;
		}
	});
	
	//expanders
	$('.expand').next('div').hide();
	$('.expand').click(function() {
		$(this).toggleClass('expanded').next('div').slideToggle();
		return false;
	});
	
	$('.hide').hide();
	$('.show').click(function() {
		$(this).prev('.hide').slideDown();
		$(this).remove();
		return false;
	});
	
	
	//pageID = window.location.hash;
	//console.log(pageID);
	//$(pageID).show();
	//$('.hide>div').hide();
	$('.tips a').click(function() {
		linkID = $(this).attr('hash').replace('#','');
		$('.expand a[name='+linkID+']').parent().toggleClass('expanded').next('div').slideToggle();
	});
	
	$('.hide>div').hide();
	$('.coffee-machines li a').click(function() {
		$('#intro').hide();
		$('#determining-your-needs').hide();
		$('#understanding-the-components').hide();
		$('#coffee-machines').show();
		$('.machine').hide();
		linkID = $(this).attr('hash');
		$(linkID).show();
		return false;
	});
	
	$('.understanding-the-components li a').click(function() {
		$('#intro').hide();
		$('#determining-your-needs').hide();
		$('#coffee-machines').hide();
		$('#understanding-the-components').show();
		$('.component').hide();
		linkID = $(this).attr('hash');
		$(linkID).show();
		return false;
	});
	
	$('.determining-your-needs a').click(function() {
		$('.active').removeClass();
		$(this).parent().addClass('active');
		$('#intro').hide();
		$('#understanding-the-components').hide();
		$('#coffee-machines').hide();
		$('#determining-your-needs').show();
		return false;
	})
	
});
