You would need to write a separate function to accept the page id as an argument. The newPage/oldPage as your are using them are local to the multipage widget.
function within _custom.js
function myPage (activePage) {
//place conditional code here
}
code within multipage widget JS window
myPage ($(newPage).attr('id'));
I did not test this code, I just typed it up quickly to give you an idea on how to proceed.