js for xplorer;cleanup of old templates