// parseUri 1.2.2
// (c) Steven Levithan <stevenlevithan.com>
// MIT License

function parseUri (str) {
	var	o   = parseUri.options,
		m   = o.parser[o.strictMode ? "strict" : "loose"].exec(str),
		uri = {},
		i   = 14;

	while (i--) uri[o.key[i]] = m[i] || "";

	uri[o.q.name] = {};
	uri[o.key[12]].replace(o.q.parser, function ($0, $1, $2) {
		if ($1) uri[o.q.name][$1] = $2;
	});

	return uri;
};

parseUri.options = {
	strictMode: false,
	key: ["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"],
	q:   {
		name:   "queryKey",
		parser: /(?:^|&)([^&=]*)=?([^&]*)/g
	},
	parser: {
		strict: /^(?:([^:\/?#]+):)?(?:\/\/((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?))?((((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/,
		loose:  /^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/
	}
};


$(document).ready(function(){

	var pathname = window.location.href;
	if ( parseUri( pathname ).anchor != '' ){
		$('#toc_content').hide();
		var vara1 = parseUri(pathname).anchor;
		$('#content_box').html( $('#'+vara1+'_content').html() );
		$('#toclink').show();
	} else {
		$('#content_box').html( $('#toc_content').html() );
	}

$('.showit').click( function() {
	var vara = $(this).attr('href').replace('http://www.regionalfoodbank.org/Take-Action/Volunteer', '');

	if (vara== '#toc'){
		$('#content_box').html(' ');
		$('#toc_content').show();
		$('#toclink').hide();
	} else {
		$('#toc_content').hide();
		$('#content_box').html( $(vara+'_content').html() );
		$('#toclink').show();
	}
	return false;
});
});

