var InFocus = {

	initTocLinks : function () {
		var toc_selectors = ".toc .extras .post:has('[rel=bookmark]'), .toc .secondary .post:has('[rel=bookmark]')";

		jQuery(toc_selectors).bind('mouseover.infocus', function () {
			jQuery(this).addClass('hover').css('cursor', 'pointer');
		});

		jQuery(toc_selectors).bind('mouseout.infocus', function () {
			jQuery(this).removeClass('hover');	
		});

		jQuery(toc_selectors).bind('click.infocus', function () {
			var target = jQuery('a[rel=bookmark]', this).attr('href');
			if (target) {
				window.location = target;
				return false;
			}
		});
	},
	
	initFonts : function () {

	},
	
	initEmailSignup : function () {
		jQuery('#newsletter_signup').submit(function () {
			jQuery.post(this.action, jQuery('#newsletter_signup').serialize(), function (d) {
				jQuery('#signup_message').html(d);
			});
			return false;
		});
	},
	
	initDropCaps : function () {
		/*var firstpara = jQuery('.feature > p:first');

		var t = firstpara.text();
		var f = t.substring(0,1);
		var l = t.length;
		t = "<div class='firstp'>" + t + "</div>";
		jQuery(firstpara).hide().replaceWith( t ).show();

		jQuery('.feature > p:first:first-letter').css({
			float : 'left',
			display : 'block',
			margin : '.1em .1em 0 0',
			padding : 0,
			color : '#be1e2d',
			fontSize : '385%',
			lineHeight : .9
		});*/
		//console.dir(jQuery('.feature>p:first'));
		
	}
};


jQuery(document).ready(function () {
	InFocus.initFonts();
	InFocus.initTocLinks();
	InFocus.initEmailSignup();
	InFocus.initDropCaps();
});
