var visiblewidth = 878;
var movestep = 371;
movestep = visiblewidth/3
var inprogress = 0;
var movespeed = 0.8;
var counter = 0;
function moveNext() { 
 if (inprogress == 1) { return false; }
 inprogress = 1;
 totalwidth = document.getElementById('sn_holder').style.width;
 if (parseInt(totalwidth) == visiblewidth) { return false; }
 pc = document.getElementById('sn_mover').offsetLeft;
 if ( parseInt(pc)+parseInt(totalwidth) != visiblewidth ){
  new Effect.Move ('sn_mover',{ x: -movestep, y: 0, mode: 'relative',duration: movespeed , afterFinish: function() { updateAfterMove(); } });
 }
} 
function movePrevious() {
 if (inprogress == 1) { return false; }
 inprogress = 1;
 totalwidth = document.getElementById('sn_holder').style.width;
 if (parseInt(totalwidth) == visiblewidth) { return false; }
 pc = document.getElementById('sn_mover').offsetLeft;
 if ( parseInt(pc)+parseInt(totalwidth) != parseInt(totalwidth) ){
  new Effect.Move ('sn_mover',{ x: movestep, y: 0, mode: 'relative',duration: movespeed, afterFinish: function() { updateAfterMove(); } });
 }
}
function hideRightArrow() {
 document.getElementById('sn_r_link').style.display = 'none';
}
function showRightArrow() {
 document.getElementById('sn_r_link').style.display = 'inline';
}
function hideLeftArrow() {
 document.getElementById('sn_l_link').style.display = 'none';
}
function showLeftArrow() {
 document.getElementById('sn_l_link').style.display = 'inline';
}
function updateArrows() {
 totalwidth = document.getElementById('sn_holder').style.width;
 pc = document.getElementById('sn_mover').offsetLeft;
 if (parseInt(totalwidth) != visiblewidth || totalwidth != 'visiblewidthpx' || parseInt(totalwidth) > parseInt(-pc)+visiblewidth ) { showRightArrow(); }
 pc = document.getElementById('sn_mover').offsetLeft;
 if ( parseInt(pc)+parseInt(totalwidth) != parseInt(totalwidth) ){ showLeftArrow(); }
 if (parseInt(totalwidth) < parseInt(-pc)+visiblewidth) { hideRightArrow(); }
 if( parseInt(pc) == 0) { hideLeftArrow(); }
}
function updateAfterMove() {
 pc = document.getElementById('sn_mover').offsetLeft;
 if ( parseInt(pc)+parseInt(totalwidth) == visiblewidth || parseInt(totalwidth) < parseInt(-pc)+visiblewidth ){ hideRightArrow(); }
 if ( parseInt(pc)+parseInt(totalwidth) != visiblewidth || parseInt(totalwidth) > parseInt(-pc)+visiblewidth ){ showRightArrow(); }
 if ( parseInt(pc)+parseInt(totalwidth) != parseInt(totalwidth) || parseInt(totalwidth) > parseInt(-pc)+visiblewidth ){ showLeftArrow(); }
 if ( parseInt(pc)+parseInt(totalwidth) == parseInt(totalwidth) || parseInt(totalwidth) > parseInt(-pc)+visiblewidth ){ hideLeftArrow(); }
 inprogress = 0;
 updateArrows();
}
  
