/* customize */
var duration = 1000;
var autoplay = false;
var steps = 1;

/* not customize */
var sliderbox;
var current = 0;
var number;
var width;
var one_width;
var last;
function initSliderTabs()
{
	if(document.getElementById("logos"))
	{
		sliderbox = $('logos');

		number = $('#logos li').length;
		one_width = $('#logos li')[0].clientWidth;
		width = one_width*steps;
		last = number - steps*Math.floor(number/steps);

		/* next */
		$("#next").mouseover(function()
		{
			autoplay = true;
			rotate(0);

		});
		$("#next").mouseout(function()
		{
			autoplay = false;
		});
	
		/* next */
		$("#prev").mouseover(function()
		{
			autoplay = true;
			rotate(1);
		});
		$("#prev").mouseout(function()
		{
			autoplay = false;
		});
	}
}
function rotate(direction)
{
	if(autoplay)
	{
		if(direction==0)
		{
			if(current<number-6)
			{
				current++;
				$('#logos').animate({left: -current*width}, { duration: 400, queue:false });
			}
		}
		if(direction==1)
		{
			if(current>0)
			{
				current--;
				$('#logos').animate({left: -current*width}, { duration: 400, queue:false });
			}
		}
		
		setTimeout('rotate(' + direction + ')', duration);
	}
	else return 0;
}

if (window.addEventListener)
	window.addEventListener("load", initSliderTabs, false);
else if (window.attachEvent)
	window.attachEvent("onload", initSliderTabs);