$(document).ready(function() {
    // execute each 2000 milliseconds 
    t = setTimeout("blah()", 2000);
})

function blah()
{
    alert('hi');
    t=setTimeout("blah()", 2000);
}

// Add click event and auto run:
$(document).ready(function() {
	t = setTimeout("rotate_companies()", 2000);

	$('.next_btn').on('click', function(e){
		e.preventDefault();
		rotate_companies();
	});
});

function rotate_companies()
{
	clearTimeout(t);
	var pos = parseInt($(".logobar ul").css('left'));
	if (pos == 0 || isNaN(pos))
		$(".logobar ul").animate({"left": -925}, 600);
	else
		$(".logobar ul").animate({"left": 0}, 600);
	t = setTimeout("rotate_companies()", 4000);
}