jQuery(function() {
	jQuery('#features-table td, #features-table th').hover(function() {  
		var index = jQuery(this.parentNode).children().index(this) + 1;
		current = jQuery(this.parentNode.parentNode).find('tr > td:nth-child('+ index +')');
		current.addClass('hover');
	}, function() {
		current.removeClass('hover');
	});
	
	tid = setInterval('compareToggle()', 4000);
	jQuery('.compare').hover(function() {
		clearInterval(tid); 
	}, function() {
		compareToggle();
		tid = setInterval('compareToggle()', 4000);
	});
	
	jQuery('#how-it-works a').hover(function() {
		jQuery('#how-it-works').css('backgroundPosition', '0 ' + ( (jQuery(this).attr('id').replace('step','') - 1) * (-399) ) + 'px');
	}, function() {
		jQuery('#how-it-works').css('backgroundPosition','0 0');
	});
});

function compareToggle() {
	jQuery('.compare').toggle();
}