function moveleft(divnr)
{
	
	var actpos =parseInt($('#emactpos_'+divnr).val());
	var actcount = $('#emactcount_'+divnr).val();
	var actwidth = $('#emactwidth_'+divnr).val();
	
	if (actpos > 1)
	{
		actpos -= 1;
		var newleft = -(actpos-1) * actwidth;
		
		$("#innerbox_"+divnr).animate({ 
			marginLeft: newleft - 22 +  "px"
		}, 350 );
		
		$('#emactpos_'+divnr).val(actpos);
		
	
	}
	checkposition(divnr,'');
	
	
}
function checkposition(divnr, products)
{
	
	var actpos =parseInt($('#emactpos_'+divnr).val());
	var actcount = $('#emactcount_'+divnr).val();
	var actwidth = $('#emactwidth_'+divnr).val();
	
    
    if (actpos == 1)
	{
		$('#embuttonmoveleft_'+divnr).css('display','none');
		
        
        if ($('#emactreverse_'+divnr))
		{
			
			var button2bottom = parseInt($('#embutton2bottom_'+divnr).val());
			if (button2bottom == '')
			{
				button2bottom = 192;
			}
			$('#emdivmoveright_'+divnr ).css('bottom', button2bottom + 'px');
		}
	}
	else
	{
		if ($('#emactreverse_'+divnr))
		{
			var button2bottom = parseInt($('#embutton2bottom_'+divnr).val());
			if (button2bottom == '')
			{
				button2bottom = 242;
			}
			else
			{
				button2bottom += 50;
			}
			
			
			if ($('#emactreverse_'+divnr))
			{
				$('#emdivmoveright_'+divnr ).css('bottom', button2bottom + 'px');
			}
			$('#embuttonmoveleft_'+divnr).css('display','inline');
		}
	}
	
	if (actpos <= actcount-(products))
	{
		$('#embuttonmoveright_'+divnr).css('display','block');
	}
	else
	{
        
        $('#embuttonmoveright_'+divnr).css('display','none');
	}
	
}
function moveright(divnr, products)
{
	
	var actpos =parseInt($('#emactpos_'+divnr).val());
	var actcount = $('#emactcount_'+divnr).val();
	var actwidth = $('#emactwidth_'+divnr).val();
    
	if (actpos <= actcount-(products))
	{
      
		actpos += 1;
		var newleft = -(actpos-1) * actwidth;
		$("#innerbox_"+divnr).animate({ 
			marginLeft: newleft - 22 + "px"
		}, 350 );
		
		$('#emactpos_'+divnr).val(actpos);
		
		
	}
	
	checkposition(divnr,products);
	
	
	
}
