
var position_x=new Array();
var scroll_per_time=new Array();
var num_of_items=new Array();

function GE(id){return document.getElementById(id);}

function ScrollerRight(scroller_type,block)
{
	if(position_x[scroller_type]<0) position_x[scroller_type]=0;
	if(num_of_items[scroller_type]>1){

	if(position_x[scroller_type]<(num_of_items[scroller_type]-1)*scroll_per_time[scroller_type]){
		position_x[scroller_type]+=scroll_per_time[scroller_type];
		$((scroller_type?'.'+scroller_type+' ':'')+'.scroller_opinions_set').animate({right: position_x[scroller_type] },function(){});
		if(block)
		{
			if(position_x[scroller_type]>=(num_of_items[scroller_type]-1)*scroll_per_time[scroller_type])
					$((scroller_type?'.'+scroller_type+' ':'')+'.arrows_left').addClass('disable_left');
				$((scroller_type?'.'+scroller_type+' ':'')+'.arrows_right').removeClass('disable_right');
		}
	}
	else {
			if(!block){
				position_x[scroller_type]=0;
				$((scroller_type?'.'+scroller_type+' ':'')+'.scroller_opinions_set').animate({right: position_x[scroller_type] },function(){});
			}
		}

}
}

function ScrollerLeft(scroller_type,block)
{

	if(position_x[scroller_type]<0) position_x[scroller_type]=0;
	if(num_of_items[scroller_type]>1){
		if(position_x[scroller_type]>0){
			position_x[scroller_type]-=scroll_per_time[scroller_type];
			$((scroller_type?'.'+scroller_type+' ':'')+'.scroller_opinions_set').animate({right: position_x[scroller_type] },function(){});
				if(block)
				{
				if(position_x[scroller_type]<scroll_per_time[scroller_type])
					$((scroller_type?'.'+scroller_type+' ':'')+'.arrows_right').addClass('disable_right');
				$((scroller_type?'.'+scroller_type+' ':'')+'.arrows_left').removeClass('disable_left');
				}
		}
		else
		{
			if(!block){
			position_x[scroller_type]=(num_of_items[scroller_type]-1)*scroll_per_time[scroller_type];
			$((scroller_type?'.'+scroller_type+' ':'')+'.scroller_opinions_set').animate({right: position_x[scroller_type] },function(){});
			}
		}
	}
}
