function coalesce_unscramble() { for (i = 0; i < c_arr.length; i++) { tmp = getElement(c_arr[i]+"_"+i); dx = (ox_arr[i] - nx_arr[i]) / steps; dy = (oy_arr[i] - ny_arr[i]) / steps; for (x = 1; x < steps - 1; x++) { pointx[i] = new Array(steps); pointy[i] = new Array(steps); pointx[i].push(Math.round(ox_arr[i] + (x * dx))); pointy[i].push(Math.round(oy_arr[i] + (x * dy))); } } for (i = 0; i < pointx.length; i++) { for (x = 0; x < c_arr.length; x++) { tmp = getElement(c_arr[x]+"_"+x); tmp.style.offsetTop = pointy[x][i]; tmp.style.offsetLeft = pointx[x][i]; } } }