     	scrolling = false;
        scrolling2 = false;
		scrolling3 = false;
        currentPage = 0;
        currentPage2 = 0;
		currentPage3 = 0;
		
		function resetPages(){
         scrolling = false;
         scrolling2 = false;
		 scrolling3 = false;
         currentPage = 0;
         currentPage2 = 0;
		 currentPage3 = 0;
        }


function scrollLength(id, length){
    if (id == 'selector') {
    
        if (scrolling) 
            return;
        
        
        if (currentPage == 0 && length > 0) 
            return;
        
		
        if (currentPage == $('pages').value && length < 0) 
            return;
        
        
        if (length > 0) 
            currentPage -= 1;
        else 
            currentPage += 1;
        
        scrolling = true;
        
        
        var e = document.getElementById(id);
        new Effect.Move($(id), {
            x: length,
            y: 0,
            mode: 'relative',
            duration: 1.4,
            afterFinish: function(obj){
                scrolling = false;
            }
        });
        
    }
       if (id == 'selector2') {


        if (scrolling2) 
            return;
        
        if (currentPage2 == 0 && length > 0) 
            return;
        if (currentPage2 == $('pages2').value && length < 0) 
            return;
        
        if (length > 0) 
            currentPage2 -= 1;
        else 
            currentPage2 += 1;
        
        scrolling2 = true;
        
        
        var e = document.getElementById(id);
        new Effect.Move($(id), {
            x: length,
            y: 0,
            mode: 'relative',
            duration: 1.4,
            afterFinish: function(obj){
                scrolling2 = false;
            }
        });
        
        
    }


	if (id == 'photo-selector') {


        if (scrolling3) 
            return;
        
        if (currentPage3 == 0 && length > 0) 
            return;
        if (currentPage3 == $('pages3').value && length < 0) 
            return;
        
        if (length > 0) 
            currentPage3 -= 1;
        else 
            currentPage3 += 1;
        
        scrolling3 = true;
        
        
        var e = document.getElementById(id);
        new Effect.Move($(id), {
            x: length,
            y: 0,
            mode: 'relative',
            duration: 1.5,
            afterFinish: function(obj){
                scrolling3 = false;
            }
        });
        
        
    }
    
}
