var visiblewidth = 513;
var movestep = 171;
var inprogress = 0;
var movespeed = 0.8;
function moveNext() { 
 if (inprogress == 1) { return false; }
 inprogress = 1;
 totalwidth = document.getElementById('fholder').style.width;
 if (totalwidth == visiblewidth) { return false; }
 pc = document.getElementById('pfmover').offsetLeft;
 if ( parseInt(pc)+parseInt(totalwidth) != visiblewidth ){
  new Effect.Move ('pfmover',{ x: -movestep, y: 0, mode: 'relative',duration: movespeed , afterFinish: function() { updateAfterMove(); } });
 }
}
function movePrevious() {
 if (inprogress == 1) { return false; }
 inprogress = 1;
 totalwidth = document.getElementById('fholder').style.width;
 if (totalwidth == visiblewidth) { return false; }
 pc = document.getElementById('pfmover').offsetLeft;
 if ( parseInt(pc)+parseInt(totalwidth) != parseInt(totalwidth) ){
  new Effect.Move ('pfmover',{ x: movestep, y: 0, mode: 'relative',duration: movespeed, afterFinish: function() { updateAfterMove(); } });
 }
}
function hideRightArrow() {
 document.getElementById('ipr_arimg').style.display = 'none';
}
function showRightArrow() {
 document.getElementById('ipr_arimg').style.display = 'inline';
}
function hideLeftArrow() {
 document.getElementById('ipl_arimg').style.display = 'none';
}
function showLeftArrow() {
 document.getElementById('ipl_arimg').style.display = 'inline';
}
function updateArrows() {
 totalwidth = document.getElementById('fholder').style.width;
 if (parseInt(totalwidth) != visiblewidth || totalwidth != 'visiblewidthpx') { showRightArrow(); }
 pc = document.getElementById('pfmover').offsetLeft;
 if ( parseInt(pc)+parseInt(totalwidth) != parseInt(totalwidth) ){ showLeftArrow(); }
}
function updateAfterMove() {
 pc = document.getElementById('pfmover').offsetLeft;
 if ( parseInt(pc)+parseInt(totalwidth) == visiblewidth ){ hideRightArrow() }
 if ( parseInt(pc)+parseInt(totalwidth) != visiblewidth ){ showRightArrow() }
 if ( parseInt(pc)+parseInt(totalwidth) != parseInt(totalwidth) ){ showLeftArrow(); }
 if ( parseInt(pc)+parseInt(totalwidth) == parseInt(totalwidth) ){ hideLeftArrow(); }
 inprogress = 0;
}
  

