instead of using the submit button's onclick event, why not just use a hidden field with the id number and use the form's action to reload the page. Then, test for the $_POST variable and assign the session id and parse the javascript function if it exists.
For example:
<?php { ?>
<form method="post" action="thispage.php">
<input type="hidden" name="id" value="<?= $id ?>">
<input type="submit" value="issue notam">
</form>
<? } ?>
Then, also on the page, you can test for the $_POST['id'] and run both the php code to save the session id and parse the Javascript function to the browser if it exists. If it does not exist, neither occurs.
For example:
<?php
if (isset($_POST['id']))
{
$_SESSION['id']=$_POST['id'];
?>
<script language="Javascript" type="text/javascript">
window.open('notam1.php','','height=100,width=530,resizable=yes');
</script>
<? } ?>
My syntax might be incorrect or I may be missing something (I'm still very new to all this), but this should do the trick if you don't mind reloading the page (which is really your only option when you need to call php functions based on JS events).