Thanks Jason, putting the call within a php block did it for me.
I set up a jquery call and for now, I set it to only open the popup if a member is logged in. so having set a default value for the MemberID of 0 if not set..
<?php if ($_SESSION["MemberID"] != 0) { //trigger popup window if a member is logged in?>
<script type="text/javascript" charset="utf-8">
$(document).ready(function(){
window.document.body.onload = openWindow;
});
</script>
<?php } ?>
I will add other parameters later so the member can disable the popup for the session and popup will only fire if recordset has a rowcount of > 0