$(document).ready(function() {
	$('tr.uread td.threadIcon img').each(function() {
		if (this.src.indexOf('unread')) {
			this.title += ' Doublie click to mark it as read.';
		}
		$(this).dblclick(function(e) {
			e.preventDefault();
			var id = this.id.replace('f', '');
			this.src = this.src.replace('unread', 'read');
			this.title = 'Forum contains no unread messages';
			$('#td'+id).removeClass('newPosts');
			$.ajax({
				type: 'post',
				url: window.location.href,
				data: {'jsAction': 'markForumRead', 'forumID': id},
			});
		});
	});
});
