
var o = new Object();


o["entry-119"] = 3;

o["entry-120"] = 1;

o["entry-124"] = 3;

o["entry-125"] = 1;

o["entry-127"] = 2;

o["entry-128"] = 1;

o["entry-129"] = 2;

o["entry-133"] = 3;

o["entry-135"] = 1;

o["entry-137"] = 2;

o["entry-142"] = 3;

o["entry-143"] = 1;

o["entry-145"] = 3;

o["entry-149"] = 3;

o["entry-152"] = 4;

o["entry-153"] = 1;

o["entry-156"] = 1;

o["entry-159"] = 4;

o["entry-161"] = 2;

o["entry-162"] = 1;

o["entry-163"] = 11;

o["entry-164"] = 6;

o["entry-168"] = 7;

o["entry-169"] = 9;

o["entry-170"] = 4;

o["entry-172"] = 3;

o["entry-174"] = 13;

o["entry-175"] = 1;

o["entry-177"] = 1;

o["entry-176"] = 1;

o["entry-178"] = 7;

o["entry-179"] = 4;

o["entry-180"] = 7;

o["entry-181"] = 3;

o["entry-182"] = 2;

o["entry-193"] = 1;

o["entry-196"] = 1;

o["entry-197"] = 2;

o["entry-195"] = 1;

o["entry-200"] = 1;

o["entry-201"] = 1;

o["entry-203"] = 8;

o["entry-205"] = 1;

o["entry-207"] = 8;

o["entry-206"] = 2;

o["entry-209"] = 5;

o["entry-210"] = 4;

o["entry-212"] = 1;

o["entry-213"] = 5;

o["entry-215"] = 1;

o["entry-101"] = 1;

o["entry-219"] = 1;

o["entry-220"] = 2;

o["entry-221"] = 1;

o["entry-224"] = 1;

o["entry-225"] = 1;

o["entry-226"] = 1;

o["entry-211"] = 1;

o["entry-227"] = 7;

o["entry-229"] = 2;

o["entry-231"] = 2;

o["entry-232"] = 2;

o["entry-234"] = 2;

o["entry-237"] = 5;

o["entry-241"] = 2;

o["entry-244"] = 1;

o["entry-117"] = 1;

o["entry-245"] = 4;

o["entry-247"] = 5;

o["entry-250"] = 1;

o["entry-251"] = 8;

o["entry-252"] = 3;

o["entry-253"] = 1;

o["entry-257"] = 2;

o["entry-258"] = 1;

o["entry-263"] = 2;

o["entry-261"] = 1;

o["entry-262"] = 1;

o["entry-265"] = 6;

o["entry-264"] = 3;

o["entry-267"] = 4;

o["entry-100"] = 1;

o["entry-269"] = 2;

o["entry-273"] = 5;

o["entry-50"] = 1;

o["entry-278"] = 2;

o["entry-277"] = 1;

o["entry-279"] = 2;

o["entry-280"] = 3;

o["entry-281"] = 3;

o["entry-286"] = 1;

o["entry-287"] = 2;

o["entry-289"] = 5;

o["entry-294"] = 2;

o["entry-305"] = 1;

o["entry-307"] = 2;

o["entry-302"] = 4;

o["entry-314"] = 1;

o["entry-316"] = 2;

o["entry-318"] = 1;

o["entry-320"] = 1;

o["entry-322"] = 5;

o["entry-323"] = 5;

o["entry-324"] = 3;

o["entry-330"] = 1;

o["entry-329"] = 1;

o["entry-332"] = 2;

o["entry-333"] = 1;

o["entry-335"] = 1;

o["entry-339"] = 1;

o["entry-343"] = 1;

o["entry-345"] = 3;

o["entry-344"] = 2;

o["entry-350"] = 1;

o["entry-351"] = 4;

o["entry-355"] = 3;

o["entry-354"] = 2;

o["entry-357"] = 2;

o["entry-359"] = 1;

o["entry-361"] = 2;

o["entry-367"] = 1;

o["entry-381"] = 2;

o["entry-383"] = 1;

o["entry-391"] = 2;

o["entry-393"] = 1;

o["entry-395"] = 1;

o["entry-399"] = 1;

o["entry-400"] = 2;

o["entry-402"] = 1;

o["entry-405"] = 1;

o["entry-403"] = 2;

o["entry-412"] = 1;

o["entry-413"] = 1;

o["entry-414"] = 2;

o["entry-420"] = 1;

o["entry-421"] = 2;

o["entry-249"] = 1;

o["entry-430"] = 1;

o["entry-438"] = 1;

o["entry-455"] = 1;

o["entry-462"] = 4;

o["entry-466"] = 2;

o["entry-474"] = 6;

o["entry-481"] = 2;

o["entry-482"] = 3;

o["entry-479"] = 1;

o["entry-484"] = 2;

o["entry-471"] = 1;

o["entry-490"] = 1;

o["entry-495"] = 1;

o["entry-499"] = 2;

o["entry-502"] = 6;

o["entry-503"] = 2;

o["entry-506"] = 2;

o["entry-508"] = 3;

o["entry-507"] = 1;

o["entry-517"] = 2;


var locationBase = "http://www.klio.org/weblog/";
var styleList = ["retrostyle2002.css", 
		"lightstyle2003.css", 
		"darkstyle2003.css", 
		"springstyle2003.css", 
		"defaultstyle.css",
		"oldschool.css"];

$(document).ready(function() {
  setCommentCounts();
  addStyleSwitcher();
});

function setCommentCounts() {
  $("div.entry a.comment").each(function() {
       var id = $(this).parents("div.entry").attr("id");
       $(this).html("Comments [" + (o[id] == null ? 0 : o[id]) + "]");
  })
}

function addStyleSwitcher() {
    $("div.navigation ul").append(
	$.create('li', {}, 
		 [$.create('a', { 'href': 'index.html', 
			 'title': 'Cycle through available styles'},
		  'Switch Style') ]).bind("click", styleClickHandler));

    setDefaultStyle();
}

function setDefaultStyle() {
  var cookie = $.cookie("booklogStyle");
  if (cookie) {
    setStyleSheet(cookie);
  }
}

function setStyleSheet(href) {
    $("head link[rel='stylesheet']").attr('href', href);
}

function styleClickHandler(clickEvent) {
  var cssLink = $("head link[rel='stylesheet']")[0];
  for (var i=0; i < styleList.length; i++) {
    if (locationBase + styleList[i] == cssLink.href) {
      var newCssUrl = locationBase + 
	(i+1 == styleList.length ? styleList[0] : styleList[i+1]);
      setStyleSheet(newCssUrl);
      $.cookie("booklogStyle", newCssUrl, { expires: 365 });
      return false;
    }
  }
  return false;
}



