(function($) {
	var GK = {
		Config : {
			sPathImg : "/-/img/"
			,sSelPNG : "h1, .content li"
			,sHTMLtag : "can-has-js"
		}
		,init : function() {
			var c = GK;
			var p = c.Project;

			$(document).ready(function() {
				if (typeof DD_belatedPNG != "undefined") {
					DD_belatedPNG.fix(c.Config.sSelPNG);
				}
				p.books();
				p.tagIt();
			});
		}
		,Project : {
			books : function() {
				var oBooks = $("li.book"),
					count = oBooks.length;
				for (var i = 0; i < count; i++) {
					var oThis = $(oBooks[i]),
						oDD = oThis.find("dd"),
						oImg = oThis.find("img"),
						sTitle = oImg.attr("alt");
					$(oDD).prepend('<h3><cite>' + sTitle + '</cite></h3>');
				}
				oBooks.hover(
					function() {
						$(this).addClass("book-over");
					},
					function() {
						$(this).removeClass("book-over");
					}
				);
				oBooks.toggle(
					function() {
						oBooks.removeClass("book-over");
						$(this).addClass("book-over");
					},
					function() {
						$(this).removeClass("book-over");
					}
				);
				$(document.body).click(function(event) {
					var $src = $(event.target);

					if (oBooks.index($src) === -1) {
						oBooks.removeClass("book-over");
					}
				});
			}
			,tagIt : function() {
				var c = GK;
				$("html").addClass(c.Config.sHTMLtag);
			}
		}
	};

	GK.init();
})(jQuery);

