// JavaScript Document
	//Variables:
	var width_container;
	var width_cliente;
	var qtd_clientes;
	var i;
	var ultimo_cliente;
	var tempo_transicao;

	$(document).ready(function(){
		//Variables:
		tempo_transicao = 3000;
		i = 0;
		width_cliente = $('div#clientes div.mask ul li').width();
		qtd_clientes = $('div#clientes div.mask ul li').length;
		width_container = width_cliente * qtd_clientes;

		//Actions:
			//Configuro o status inicial dos elementos
			$('div#clientes div.mask').css('position','relative');
			$('div#clientes div.mask ul').css('width',width_container);
			$('div#clientes div.mask ul li').css('position','absolute');
			for ( i ; i < qtd_clientes ; i++ ) {
				//Sets position li
				$('div#clientes div.mask ul li:eq('+ i +')').css('left', width_cliente * i );
			};
			//Chamo a função '_init()'
			_init_clientes();
	});

	//Functions:
		function _init_clientes() {
			//Variables:
			ultimo_cliente = $('div#clientes div.mask ul li:eq(' + (qtd_clientes - 1) + ')');

			//Actions:
				//Mudo a posição dos logos dos clientes
				$(document).everyTime(tempo_transicao, 'clientes', function() {
					//Chamo a função 'mudar_posicao'
					mudar_posicao();
				});
		}

		function mudar_posicao() {
			//Mudo a posição
			for ( i = 0 ; i < qtd_clientes ; i++ ) {
				//Variables:
					var position_left = $('div#clientes div.mask ul li:eq('+ i +')').css('left');
					var position_left_ultimo_cliente = ultimo_cliente.css('left');

					position_left = parseInt(position_left.substr( 0, position_left.length - 2 ));
					position_left_ultimo_cliente = parseInt(position_left_ultimo_cliente.substr( 0, position_left_ultimo_cliente.length - 2 ));

					if ( position_left == -90 ) {
						position_left = position_left_ultimo_cliente + 90;
						$('div#clientes div.mask ul li:eq('+ i +')').css('left', position_left_ultimo_cliente + 90);
						ultimo_cliente = $('div#clientes div.mask ul li:eq('+ i +')');
					};

				//Actions:
					//Animo os clientes
					$('div#clientes div.mask ul li:eq('+ i +')').animate({ left: position_left - 90 }, { duration: 1000 });
			}
		}
