$(document).ready(function(){
	
	$('#midmenu>li>a').click(function(){
		
		var $this = $(this), $flow = $('#flow');
		
		if ( $(':animated', this).length ) 
		{ return; }
		
		if ( $this.hasClass('active') )
		{ return; }
		
		$('#midmenu>li>a.active').removeClass('active');
		
	    $this.addClass('active');				

		var itemIndex = $('#midmenu>li').index($this.parent()) -1;

		$('#fitems').animate({left: itemIndex*-980}, 1200, 'easeOutCubic');

	});
	
	$('.slideshow').cycle({
		fx: 'fade',
		pager:  '#pager',
		timeout: 5000,
		speed: 1000
	});
	
	 $('#midmenu a').prepend('<span>&nbsp;</span>');

	$('#midmenu a').hover(
		function(){
			$(this).find('span').stop().fadeTo(100, 1);
		}, 
		function(){
			$(this).find('span').stop().fadeTo(500, 0);
		}
	);
	
	
	jQuery(".tabtxt:not(:first)").hide();

	//to fix u know who
	jQuery(".tabtxt:first").show();
	
	jQuery("#vid a").click(function(){
		stringref = jQuery(this).attr("href").split('#')[1];

		jQuery('.tabtxt:not(#'+stringref+')').hide();

		if (jQuery.browser.msie && jQuery.browser.version.substr(0,3) == "6.0") {
			jQuery('.tabtxt#' + stringref).show();
		}
		else 
			jQuery('.tabtxt#' + stringref).fadeIn();
		
		return false;
	});	
	
});


