onclick check session value either it is empty or not

onclick check session value either it is empty or not

when hit 'Go' button then it will be check that either session is in set or not. if session is empty or unset then a div (loginWin) will be shown. i am very confused please help me. thanks in advance.
Html Code:
  1. <? session_start(); ?>
  2.   <input type="button" value="Go" onclick=" userValidate()" />
  3. <div id="loginWin" style="display:none">
  4.       <iframe style=" position:absolute; top:200px; left:300px;" id="framSrc" width="500px" height="400px"></iframe>
  5. </div>

  6. <script>
  7. function login(){
  8. $("#framSrc").css("src","login.php");
  9. $("#loginWin").css("display", "block");
  10. }
  11. function userValidate(){
  12.        usrid = '<?=$_SESSION['user_id'];?>';
  13.       // alert(usrid);
  14.        if (usrid=="")
  15.             return true;
  16.        else return false;
  17. }
  18. </script>