PHP, Javascript, and JQuery port of my RailSplitter application