var mootabs = new Class({
	
	initialize: function(panel_height) {
		
		
		

		

		
		this.tabs = $$('ul.mootabs_title li a');
		
		
		this.tabs.each(function(tab) {
			if(!tab.hasClass('not_tab')) {  //don't apply click function , this means the tab isn't meant to open a panel
				tab.addEvent('click', function() {
					this.activate(tab);
				}.bind(this));
			}
			
		}.bind(this));
	},
	
	activate: function(tab) {
		
		var linkName = tab.getProperty('href').split('#')[1];
		this.tabs.each(function(tab) {
			tab.removeClass('active');
		});
		tab.addClass('active');
		
		
		$$('.mootabs_panel').each(function(panel) {
			panel.removeClass('active');
		});
		
		(function(){$(linkName).addClass('active');}).delay(100);  //just to keep image from flashing before effect starts

		if (linkName=='photos_div') $('control_wrapper').style.display="none";  // turn off photo controls if they had already been turned on.
		var div_effect= $(linkName).effect('height', {duration:1500, transition: Fx.Transitions.bounceOut})
		div_effect.start(0,$(linkName).getStyle('height')).chain(function(){
					if (linkName=='photos_div')  show_controls();
					if (linkName=='pano_div'&&document.pano_loaded!='yes') {$('pano1').onclick();  document.pano_loaded='yes'}
					if (linkName=='map_div'&&document.map_loaded!='yes') { load_map();  document.map_loaded='yes'}
					
				});

		
	}
	

	
});