$(document).ready(function(){
	$('a[id^="viewMore"]').each(function(){
		$(this).attr('href', 'javascript:;');
		$(this).click(function(){
			$.get('/function/jsGetPost.php',
				{ post: $(this).attr('id').replace('viewMore', ''), action: 'comment' },
				function(data){
					var id = data.match(/^\d+/gi)[0];
					data = data.replace(/^\d+,/gi, '');
					$('#commentDetails' + id).empty()
					$('#commentDetails' + id).hide();
					$('#commentDetails' + id).append(data);
					$('#commentDetails' + id).slideDown();
				}
			);
		});
	});
	// Transform YouTube URLs
	$('#content').html($('#content').html().replace(/(http:\/\/www\.youtube\.com\/watch\?v=)([^ &]+)([^ <]+)/gi, '<a id="youTube$2" class="youTube" href="javascript:;" url="http://www.youtube.com/v/$2" origurl="$1$2">$1$2$3</a>'));
});