	var current_tab = "tab1";
	var fx_speed = 500;
	
	function do_tab(n) {
		
		current_tab = n;
		
		// cycle through tabs and set the correct
		// "on" or "off" class depending on which one
		// is currently selected
		//
		$$('.c2 a').each(function(el) {
			
			if($(n) == el)
				el.addClass("on");
			else
				el.removeClass("on");
			
		});
		
		
		// hide other panels first and then set
		// opacity down to 0 so we can find in
		// the chosen panel
		//
		for(var x=1; x<=3; x++) {
			
			var _display  = 'tab'+x == n ? 'block' : 'none';
			var _opacity  = 0;
			$('tab'+x+'_container').setStyles({ display: _display, opacity: _opacity });
		}
		
		
		// fade in chosen panel
		//
		$(n+'_container').set('tween', {
			duration: fx_speed,
			onComplete: function(e) {
					$(e.id).set('tween', { onComplete: Class.empty });
					$(e.id).tween('opacity', 1);
				}
			}
		);
		
		$(n+'_container').tween('opacity', 1);
	}
	
	function init_href_listeners() {
		
		/**
		* tabs
		*/
			$$('.c2 a').each(function(el) {
			
				el.addEvent('click',function(el) {
					do_tab(this.id);
					return false;
				});
			
			});
	
	}
	
	function init_tab_content_panels() {
		for(var x=1; x<=3; x++) {
			
			//if(current_tab != 'tab'+x)
				$('tab'+x+'_container').setStyles({ opacity: 0 });
		}
	}
	
	// let's do this
	//
	window.addEvent('domready', function() {
    	
    	init_href_listeners();
    	init_tab_content_panels();
    	do_tab(current_tab);
    });