separate resource_func.js from resource.js