$(document).ready(function() {
	
	$('body').addClass('jsEnabled');
	
	$('a.new-window').each(function(index) {
		if (this.title != "") this.title += ' ';
		this.title += '(opens in a new window)';
		
		this.onclick = function() {
			window.open(this.href);
			return false;
		};
	});
	
	$('ul.idTabs li:not(.images-tab) a').click(function() {
		$('div.column-2').fadeIn();
	});
	
	$('ul.idTabs li.images-tab a').click(function() {
		$('div.column-2').fadeOut();
		$.scrollTo( $('.line:first'), {duration: 1000} )
	});
	
	$('div.post h2:first-child').addClass('first-child');
	
	if (typeof(dp) != "undefined") {
		dp.SyntaxHighlighter.ClipboardSwf = TEMPLATEURL + '/javascript/SyntaxHighlighter/clipboard.swf';
		dp.SyntaxHighlighter.HighlightAll('code');
	}
	
	$("a.fancybox").fancybox();
	
	if ($.fn.lazyload) {
		if ($('.idTabs').length == 0) {
			$(".post img").lazyload({ 
			    effect : "fadeIn",
				threshold : 200
			});
		}
	}
	
});

tb_pathToImage = TEMPLATEURL + "/images/other/loading.gif";