jQuery(document).ready(function($) {
    
	var COOKIE_NAME = 'Expanded ' + document.title.replace(/[^\w\d\s]/ig, "");
	var options = {
		expires : 10,
		path : '/'
	};

	if ($.cookie(COOKIE_NAME) && $.cookie(COOKIE_NAME) != 'All') {

		$(".LetterContainer").hide();
		$(".LetterContainer"+$.cookie(COOKIE_NAME)).show();

	} else {
		$(".LetterContainer").show();
	}

	$(".AtoZ a").click(function() {
		var str = $(this).text();
		if (str == "All") {
			$.cookie(COOKIE_NAME, 'All', options);

			$(".LetterContainer").show();

		} else {

			$.cookie(COOKIE_NAME, "#" + str, options);

			$(".LetterContainer").hide();

			$(".LetterContainer#" + str).show();

		}

		return false;
	});

	var COOKIE_NAME2 = 'Expanded2 ' + document.title.replace(/[^\w\d\s]/ig, "");
	var options = {
		expires : 10,
		path : '/'
	};

	if ($.cookie(COOKIE_NAME2) && $.cookie(COOKIE_NAME2) != 'All') {

		$(".LetterContainer2").hide();
		$(".LetterContainer2"+$.cookie(COOKIE_NAME2)).show();

	} else {
		$(".LetterContainer2").show();
	}

	$(".AtoZ2 a").click(function() {

		var str = $(this).text();
		if (str == "All") {
			$.cookie(COOKIE_NAME2, 'All', options);

			$(".LetterContainer2").show();

		} else {

			$.cookie(COOKIE_NAME2, "#" + str, options);

			$(".LetterContainer2").hide();

			$(".LetterContainer2#" + str).show();

		}

		return false;
	});

});

