var manufacturers = new Array()
var how_many = 0;
var where_am_i = 0;

$(document).ready(function() 
{
  
  $('#manufacturerContainer').children('a').each(function(){
		how_many++;
	});
	
	var width = (how_many * 70); 
	
	$('#manufacturerContainer').css('width', width + 'px');
	$('#manufacturerContainer').css('position', 'relative');  
      
  $('.manufacturerslist').children('ul').children('li').each(function(){
    manufacturers.push($(this));
    how_many++;
  });    
    
  $("a.manufacturer").each(function(index){
    $(this).children().css('z-index', 100);
    $(this).mouseenter(function(e){
      $(this).children().css('border', '1px solid #9AD239')
    });
    $(this).mouseleave(function(e){
      $(this).children().css('border', '1px solid #EFEFEF')
    });
  });
  animateManufacturersLeft(width);                       
});

this.animateManufacturersLeft = function(width) {
  $('#manufacturerContainer').animate({
		'left' : (-width + 820) + 'px'
	}, how_many * 900, function(){animateManufacturersRight(width);});
}

this.animateManufacturersRight = function(width) {
  $('#manufacturerContainer').animate({
		'left' : '0px'
	}, how_many * 900, function(){animateManufacturersLeft(width);});
}
