$j=jQuery.noConflict();

$j(function (){  	
	
	$j('.wp-caption a').fancybox({
		'showCloseButton'	: true,
		'titleShow'		: true,
		'titlePosition' 		: 'inside'
	});
	
	//numbering for comments
	
	$j('#topnav li:last').addClass('last');
	$j('.relatedSingle').eq(3).addClass('last');
	$j('.relatedSingle').eq(2).addClass('prelast');
	$j('.addthis_button_email').hide();
	$j('.addthis_button_email:eq(0)').show();
	
	var i=1;
	$j('.acomment .comment_number').each(function() {
		$j(this).text(i);
		i++;
	});
	$j('.relatedSingle img').each(function() {
		var checkRelatedImage = $(this).attr('src');	
		if (checkRelatedImage == '') {
			$j('.relatedSingle img').attr('src').val('http://inthelab.info/wp-content/themes/yud-koren/img/default.gif');
		}
	});
	
	// Checking if H2 on featured story has a line break....
    var featuredTitleH = $j('.featured h2').height();
	if (featuredTitleH>=45) { // If there's a line break
		$j('.comments_count_featured').css("top", "107px");
	}
	if (featuredTitleH>=70) { // If there are two line breaks (i.e. title is 3 lines long)
		$j('.comments_count_featured').css("top", "139px");
	}
	
	// Getting the columns to get the same height
	var contentH = $j('#rightcolumn').height();
	var sidebarH = $j('#leftcolumn').height();
	if (contentH<sidebarH) {
		$j('#rightcolumn').height(sidebarH);
	}
	
});
