var sb = {};

sb.keepaliveInterval = null;

sb.keepalive = function()
{
	$.get('/index/keepalive', 
		function(data) {
//			console.log(data);
		}
	);

};

$(document).ready(function(){
	$('.toggle').click(function(){
		var pos = $(this).offset();
		var tabToShow = $(this).attr('href');
		$('.block:not(' + tabToShow + ')').hide();
		$(tabToShow)
		.css({
			top: pos.top - 2,
			left: pos.left - $(tabToShow).width() + $(this).width() 
		})
		.toggle();
		return false;
	});
	
	if(typeof cluetip == 'function')
	{
		$('.tooltip').cluetip({
			activation: 'click',
			splitTitle: '|',
			closePosition: 'title',
			sticky: true
		});
	};

	sb.keepaliveInterval = setInterval(sb.keepalive, 30000);
	
});
