	$(function()
	{
		actions = new Array();
		actionsCount = 0;
		actionsFullCount = 0;
		actionsLastId = 1;
				
		$("div.scrollable").scrollable({
			size: 1, 
			loop: true
		}); 

		setTimeout('autoScroll();', 6000);
	});

	function autoScroll()
	{
		var api = $("div.scrollable").scrollable({api: true}); 
		 
		api.next(); 

		setTimeout('autoScroll();', 6000);
	}

	function showComments(id, show, tab)
	{
	}

	function print_r(theObj)
	{
		  if(theObj.constructor == Array ||
		     theObj.constructor == Object){
		    document.write("<ul>")
		    for(var p in theObj)
		    {
		      if(theObj[p].constructor == Array||
		         theObj[p].constructor == Object)
		      {
		    	  	document.write("<li>["+p+"] => "+typeof(theObj)+"</li>");
		        document.write("<ul>")
		        print_r(theObj[p]);
		        document.write("</ul>")
		      } else 
		      {
		    	  document.write("<li>["+p+"] => "+theObj[p]+"</li>");
		      }
		    }
		    document.write("</ul>")
		  }
	}

	function setFullCount(actionsFullCount)
	{
		actionsFullCount = actionsFullCount;
	}

	function getFullCount()
	{
		return actionsFullCount;
	}

	function setCount(actionsFullCount)
	{
		actionsFullCount = actionsFullCount;
	}

	function getCount()
	{
		return actionsCount;
	}

	function setActions(actions)
	{
		actions = actions;
	}

	function getActions()
	{
		return actions;
	}
	

	function getLatestActions(date)
	{
		if (date == 0)
			$('#latestActions').html('');

		actionsFullCount = actionsFullCount;

		setFullCount(actionsFullCount);
		setCount(actionsFullCount);
		setActions(actions);
	
		//if (html != '')
		//	$('#latestActions').html(html + $('#latestActions').html());
		functionName = "getLatestActions('"+date+"');";
		setTimeout(functionName, 5000);
	}

	function addToShoutBox()
	{  
	}

	$(window).load(function() 
	{
		getLatestActions(0);
	});

	function is_array(input) 
	{
		return typeof (input) == 'object' && (input instanceof Array);
	}

	function generateHtml(array,type)
	{
	
	}

	function getDataToTheTab(tabId) 
	{
	
	}
