var mtustories = new Array();
var idcomments_acct = 'f421c1c14685f918aa5008476df6f5db';

document.addEvent('domready', function() {
	if ($('featured')) {
		/*if (Browser.Engine.trident4) {
			var maxHeight = Array.max($$('#featured .item').map(function(item) { return item.getSize().y - item.getStyle('padding-bottom').toInt(); }));
			$$('#featured .item').map(function(item) { item.setStyles({'height': maxHeight, 'padding-bottom': '11px', 'margin-bottom': 0})});
		}*/
		$('featured').getElements('.item').each(function(item) {
			item.addEvents({
				'click': function(e) {
					e = new Event(e).stop();
					location.href = this.getElement('a.link').getProperty('href');
				}.bind(item),
				'mouseenter': function() {
					this.addClass('highlight');
				}.bind(item),
				'mouseleave': function() {
					this.removeClass('highlight');
				}.bind(item)
			});
		});
	}
});

window.addEvent('load', function() {
	loadit();
});

var totalTime = 0;
function loadit() {
	if (!$('txtNameNewThread') && totalTime++ < 100) {
		loadit.delay(100);
	}
	else if ($('txtNameNewThread')) {
		$('txtNameNewThread').getNext().set('text',$('txtNameNewThread').getNext().get('text') + ' or ');
		new Element('a', {
			'href': '#',
			'events': {
				'click': function(e) {
					new Event(e).stop();
					if ($('txtNameNewThread').get('value') == 'Anonymous') {
						$('txtNameNewThread').set('value','');
					} else {
						$('txtNameNewThread').set('value', 'Anonymous');
					}
				}
			}
		}).set('text','anonymously').inject($('txtNameNewThread').getNext());
	}
}
Array.max = function( array ){
    return Math.max.apply( Math, array );
};