Why would you use javascript to set the page title?
See `CRM_Utils_System::setTitle`