function moveNext() { 
 totalwidth = document.getElementById('categorytable').style.width;
 if (totalwidth == 727) { return false; }
 pc = document.getElementById('product_container').offsetLeft;
 if ( parseInt(pc)+parseInt(totalwidth) != 727 ){
  new Effect.Move ('product_container',{ x: -727, y: 0, mode: 'relative',duration: 1.5 , afterFinish: function() { updateAfterMove(); } });
 }
}
function movePrevious() {
 totalwidth = document.getElementById('categorytable').style.width;
 if (totalwidth == 727) { return false; }
 pc = document.getElementById('product_container').offsetLeft;
 if ( parseInt(pc)+parseInt(totalwidth) != parseInt(totalwidth) ){
  new Effect.Move ('product_container',{ x: 727, y: 0, mode: 'relative',duration: 1.5, afterFinish: function() { updateAfterMove(); } });
 }
}
function hideRightArrow() {
 document.getElementById('rightarrow').style.display = 'none';
}
function showRightArrow() {
 document.getElementById('rightarrow').style.display = 'block';
}
function hideLeftArrow() {
 document.getElementById('leftarrow').style.display = 'none';
}
function showLeftArrow() {
 document.getElementById('leftarrow').style.display = 'block';
}
function updateArrows() {
 totalwidth = document.getElementById('categorytable').style.width;
 if (parseInt(totalwidth) != 727 || totalwidth != '727px') { showRightArrow(); }
 pc = document.getElementById('product_container').offsetLeft;
 if ( parseInt(pc)+parseInt(totalwidth) != parseInt(totalwidth) ){ showLeftArrow(); }
}
function updateAfterMove() {
 pc = document.getElementById('product_container').offsetLeft;
 if ( parseInt(pc)+parseInt(totalwidth) == 727 ){ hideRightArrow() }
 if ( parseInt(pc)+parseInt(totalwidth) != 727 ){ showRightArrow() }
 if ( parseInt(pc)+parseInt(totalwidth) != parseInt(totalwidth) ){ showLeftArrow(); }
 if ( parseInt(pc)+parseInt(totalwidth) == parseInt(totalwidth) ){ hideLeftArrow(); }
}
  
window.onload = updateArrows;

