window.addEvent('domready', function() {
	if ($ifel('tabs')) {
		var tcont = $('tabcontent');
		var tabs = $('tabs');
		var tbtns = new Element('div', {'id': 'tButtons'}).inject(tabs, 'top');
		
		TextMuncher.implement({
			headEl: 'h3',
			targetH: tbtns,
			target: $('tabs'),
			leaveH: true,
			ptr: new Element('i', {'class': 'c ptr'}).setStyle('display', 'block').set('tween', {duration:'short'}).inject(tcont),
			transformH: function (el) {
				return new Element('a', {'class': 'tbtn', href: '#'})
					.adopt(new Element('i', {html: el.get('html')}))
					.adopt(new Element('span'));
			},
			onHClick: function(h, i) {
				this.ptr.tween('top', 20 + i*41);
			}
		});
		
		window.tm = new TextMuncher(tcont);
		tcont.setStyle('min-height', tbtns.getSize().y);
		Browser.Engine.trident && tcont.setStyle('height', tbtns.getSize().y);
	}
	
	// Щёлкни 9-10 раз на низ синей пижни слева.
	var yopcount = 10;
	var hate = {};
	$('zayava').addEvent('click', function() {
		if (--yopcount == 1) {
			$('left').setStyles({
				overflow: 'hidden',
				height: $('left').getScrollSize().y
			});
			hate = new Element('div', {text: 'Э, э, сломаешь о_о!!!'})
				.setStyles({color: 'red', 'font-size': 20, position: 'absolute', top: -40, right: -20});
			$('zayava')
				.setStyles({position: 'relative'})
				.adopt(hate)
				.set('tween', {transition: new Fx.Transition(Fx.Transitions.Bounce, 3).easeInOut})
				.tween('margin-top', 0);
		}
		else if (yopcount < 1) {
			hate.set({text: 'Йопта О_о!!!'}).setStyles({'font-size': 30})
			$('zayava')
				.setStyles({position: 'relative'})
				.set('tween', {transition: 'sine:out'})
				.tween('margin-top', 1000);
		}
	});
});