Ext.onReady(function(){

	Ext.select(".title").on('mouseover', function() {
		Ext.get( this ).addClass('over');
	});

	Ext.select('li', true, 'nav').on('mouseout', function() {
		this.removeClass('over');
	});

	var oldTab = Ext.query("li[class='on']", Ext.query("ul[class='tabs']") );
	oldTab = Ext.fly( oldTab[0] );

	Ext.select( "a", true, Ext.query("ul[class='tabs']") ).on('click', function( e ) {
																																			 
		e.stopEvent();
		
		if ( this.parent().parent() != oldTab ) {
			var newTab = this.parent().parent();
			newTab.addClass('on');

			Ext.get(oldTab.first().first().dom.href.split('#')[1]).setStyle('display', 'none');
			Ext.get(this.dom.href.split('#')[1]).show();
			
			if ( oldTab != null ) {
				oldTab.removeClass('on');
			}
			oldTab = this.parent().parent();
						
		}
		
	});

});
