function quickQuote( author, message, className ) {
	$('#QuickReplyBox').each(function (i) {
		this.value = "[quote=\"" + author + "\" class=\"" + className + "\"]" + message + "[/quote]\n";
		this.focus();
		this.selStart = this.value.length;
		if (this.createTextRange) {
			var range = this.createTextRange();
			range.collapse(false);
			range.scrollIntoView(false);
		} else {
			scrollElementToEnd(this);
		}
	});
};


function scrollElementToEnd (element) {
	if (typeof element.scrollTop != 'undefined' && typeof element.scrollHeight != 'undefined') {
		element.scrollTop = element.scrollHeight;
	}
}

function openOffTopicPost (postID) {
	$('#post'+postID).each(function (i){;
		this.rows[0].style.display = 'none';
		this.rows[1].style.display = '';
		this.rows[2].style.display = '';
	});
}

$(function () {

	if ( $(".blinkslow").length > 0 ) {
		$(".blinkslow").cyclicFade({
			repeat: 0,
			params: [
				{fadeout:1000, stayout:100, opout:0.25, fadein:1000, stayin:100, opin:0.999999}
			]
		});	
	}

	if ( $(".blinkfast").length > 0 ) {
		$(".blinkfast").cyclicFade({
			repeat: 0,
			params: [
				{fadeout:500, stayout:0, opout:0.25, fadein:500, stayin:0, opin:0.999999}
			]
		});
	}
	
   // create the "page loaded" message
   $("tbody.OffTopic").each(function (i) {
		this.rows[1].style.display = 'none';
		this.rows[2].style.display = 'none';
   });
//   fnLoadPngs();
   
   sorttable.init();

});


