(function($) {
	window.isIE6 = /msie 6/i.test(navigator.userAgent)? true:false;
	
	$(function() {		
		Cufon.replace('h1')('.navigation>ul>li>a')('#tagline')('.office-more h2');
		$('body').addClass('js-enabled');
	});
	
	window.setTimeout(function() {
		var root = $(document);
		this.setHeight = function(obj) {
			var h = 0;
			obj.each(function() { h = Math.max(h, $(this).get(0).offsetHeight); });
			obj.each(function() {
				var p = parseInt($(this).css("paddingTop")) + parseInt($(this).css("paddingBottom"));
				$(this).css({ minHeight: (h - p) + "px" });
				// compensate for stubborn IE6
				if(window.isIE6) $(this).css({ height: (h - p) + "px" });
			});
			// tickle DOM, for some browser
			$("body").addClass("tickled");
		};
		$(".equalize", root).each(function() {
			self.setHeight($(".equal", $(this)));
		});
	}, 100);

	$(function() {
		$('.clickable').hover(
			function() {
				$(this).addClass('hover');
			},
			function() {
				$(this).removeClass('hover');
			}
		).click(function(e) {
			if(e.target.tagName.toUpperCase() != "A") {
				var url = $('a[rel=bookmark]', $(this)).get(0).href;
				document.location = url;
			}
		});
	});
	
})(jQuery);
