Maine,
function foo(a, c) {
a += "";
for (var b = 0; b < a.length / 2; b++) {
if (a > c) return !1;
a.substr(b, 1) != a.substr(-(b + 1), 1) && (a = +a + 1 + "", b = -1)
}
return +a
};
alert("99,99 -> "+ foo(99,99));
alert("100,999 -> "+ foo(100,999));
alert("102,110 -> "+ foo(102,110));
alert("102,112 -> "+ foo(102,112));