あ、ちなみに xの値を減らす処理については
document.getElementById(hoge[i]).style.left = (x -10) + "px";
という感じです