var ficlicked = false;
var indexcount = 0;
window.addEvent('domready', function() {
//  var scroll = new Scroller('scrollerPlacement', {area: 250, velocity: 0.1});
//  $('scrollerPlacement').addEvent('mouseenter', scroll.start.bind(scroll));
//  $('scrollerPlacement').addEvent('mouseleave', scroll.stop.bind(scroll));

  var scrollfx = new Fx.Scroll('scrollerPlacement', {
    wait: false,
    duration: 1500,
    offset: {'x': 0, 'y': 0},
    transition: Fx.Transitions.Cubic.easeInOut
  });//Fx.Transitions.Quad.easeOut  | Fx.Transitions.Bounce.easeOut

  $('scroller-right').addEvent('click', function(event) {
	ficlicked = true;
    event = new Event(event).stop();
	if(indexcount >= homecount){
		indexcount = 0;
	}else{		
		indexcount = indexcount + 1;
	}
    scrollfx.toElement('homeproduct' + indexcount);
  });

  $('scroller-left').addEvent('click', function(event) {
	ficlicked = true;
    event = new Event(event).stop();
	if(indexcount == 0){
		indexcount = homecount;
	}else{		
		indexcount = indexcount - 1;
	}
    scrollfx.toElement('homeproduct' + indexcount);
  });
  scrollfx.toElement('homeproduct' + indexcount);

setInterval(function(){
	if(ficlicked == false){
		if(indexcount >= homecount){
			indexcount = 0;
		}else{		
			indexcount = indexcount + 1;
		}
	    scrollfx.toElement('homeproduct' + indexcount);		
	}
}, 10000);

});


