Improved code by cache content and using php instead of Javascript to grab content.