separated javascript file. clean up. php script rearranging.