var pos = 1;
			
			function getSteps(subId1, subId2) { 
                
				scrolled_box_width = $(subId1).width();
			    scrolled_box_width2 = $(subId2).width() - 70;
			    
			    //alert(scrolled_box_width);
			    
			    steps = scrolled_box_width / scrolled_box_width2;
			    
			    //if (steps % 1 > 0.4) { steps = steps + 1; }
			    //alert(parseInt(steps));
			    return parseInt(steps);
			}
			
			function getStepSize(subId1, steps) {
			    scrolled_box_width = $(subId1).width();
			    return parseInt(scrolled_box_width / steps);
			}
			
			function testRightHandState(handId, subId1, subId2, pos) {
			    steps =  getSteps(subId1, subId2);
			    //alert(pos);
			    
			    if (steps == 0) { 
			        $(handId).attr("src", "/images/h3.png"); 
			    } else {
			        if (pos == steps) {
			            $(handId).attr("src", "/images/h3.png");
			        } else {
			            $(handId).attr("src", "/images/h2.png");
			        }
			   }
			}
			
			function testLeftHandState(handId, pos) {
			    
			    if (pos == 1) {
			        $(handId).attr("src", "/images/h1.png");
			    } else {
			        $(handId).attr("src", "/images/h4.png");
			    }
			}
            
			function onLeftHandClick(id1, id2, id3, handId, handId2) {

				steps =  getSteps(id1, id2);
                step_size = getStepSize(id1, steps);
				
				if(pos > 1) {
				    pos--;

				    $(id3).animate({ left: "-"+(step_size*(pos - 1))+"px"}, 500 );
				}
				
				testRightHandState(handId, id1, id2, pos);
				testLeftHandState(handId2, pos);
			}
			
			function onRightHandClick(id1, id2, id3, handId, handId2) {

				steps =  getSteps(id1, id2);
                step_size = getStepSize(id1, steps);
                
                //alert(steps);
                
				if(pos < steps) {
				    pos++;
				    
					$(id3).animate({ left: "-"+(step_size*(pos - 1))+"px"}, 500 );
				}
				
				testRightHandState(handId, id1, id2, pos);
				testLeftHandState(handId2, pos);
			}
