Greetings!

I'm new in javascript, I'm making a function that will open new window upon submitting the form.

How can I combine this two?
Code:
function advance(){
    onSubmit="window.open('', 'foo', 'width=450,height=300,status=yes,resizable=yes,scrollbars=yes' 
    document.inventory.action="pagination.php";
And is it possible to put button close and submit in the new window?
Any help is greatly appreciated.