var $rotator;

$(document).ready(function() {

	$rotator = $("#rotator > ul").tabs({fx: {opacity: "toggle"}}).tabs("rotate", 0, true);	
	$( "#rotator > ul" ).bind( "tabsshow", function(event, ui) {  initScroll(ui);  });

	

	
	
	//$( "#rotator" ).bind( "tabsshow", function(event, ui) {
//		alert('show');
//	});
	
	$("#feature").hover(
		function() {
		$("#rotator > ul").tabs("rotate",0,true);
		},
		function() {
		$("#rotator > ul").tabs("rotate",0,true);
		}
		
		
		
	);

	
	

	$.featureList(
		$("#tabs li a"),
		$("#tab_content li"), {
			start_item	:	0
			
				
			
		}
	);
	
	



	
	
$(function()
	{
	//$('.scrollpane').jScrollPane({showArrows:true, scrollbarWidth: 15, arrowSize: 16});
	$('#news_list').jScrollPane({showArrows:true, scrollbarWidth: 15, arrowSize: 16});
	$('#twitter_feed').jScrollPane({showArrows:true, scrollbarWidth: 15, arrowSize: 16});
	//$('#video_thumb_scroller').jScrollPane();
	//$('#pub_list').jScrollPane({showArrows:true, scrollbarWidth: 15, arrowSize: 16});

	});
	
});




function initScroll(ui)
{

var fragment = $("#rotator ul > li.ui-tabs-selected").attr('id');
	if(fragment == "nav-fragment-3")
	{
		$('#photo_thumbs').jScrollPane({showArrows:true, scrollbarWidth: 15, arrowSize: 16});
	}
	else if(fragment == "nav-fragment-4")
	{
		$('#pub_list').jScrollPane({showArrows:true, scrollbarWidth: 15, arrowSize: 16});
	}
}




$(function(){
 $('.tweets').tweet({username: 'moftt', time: true, limit: 20});
});



		




// JavaScript Document
