var vari;
var timer;
var nr_of_tabs;

function startTimer()
{
	timer=setTimeout("switchTab()",4000);
}
function switchTab()
{
	if(vari == nr_of_tabs)
	{
		var next = 0;
	}
	else
	{
		var next = vari + 1;
	}
	$("#tabs").tabs('select', next);
}
function sayHi()
{
	alert("hi");
}

$(document).ready(function(){
	
	$('#tabs').bind('tabsshow', function(event, ui) 
	{
		vari = $("#tabs").tabs('option','selected');
		startTimer();
	});
	$("#tabs").bind('tabsselect', function(event,ui)
	{
		clearTimeout(timer);
	});
		
	$("#tabs").removeClass("hidden");
	$("#tabs").tabs('option', 'cache', true);
	$('#tabs').tabs({ event: 'mouseover'});
	


	//$('#tabs').tabs('option', 'event', 'mouseover');
	
	$("#tabs").tabs();
	
	nr_of_tabs = $("#tabs").tabs('length') - 1;
	
});

