Moved phpjs.org functions to new js file