title: Javascript function not working properly in Safari 5.1.7
body: <p>On Load of Access.aspx a javascript function is called. </p>
  
  <pre><code>&lt;head&gt;
  &lt;title&gt;access&lt;/title&gt;
  &lt;meta content="Microsoft Visual Studio .NET 7.1" name="GENERATOR"&gt;
  &lt;meta content="Visual Basic .NET 7.1" name="CODE_LANGUAGE"&gt;
  &lt;meta content="JavaScript" name="vs_defaultClientScript"&gt;
  &lt;meta content="http://schemas.microsoft.com/intellisense/ie5" name="vs_targetSchema"&gt;
  &lt;link href="rtsBanner.css" type="text/css" rel="stylesheet"&gt;
  
  &lt;script language="JavaScript" type="text/javascript" src="winopen.js"&gt; &lt;/script&gt;
  
  &lt;script type="text/javascript" language="javascript"&gt;
      function openLogin(site, pass) {
          var loginUrl = 'login.aspx';
          if (site != '' &amp;&amp; pass != '') {
              loginUrl += '?SITE=' + site + '&amp;PASS=' + pass;
          }
          else if (site != '') {
              loginUrl += '?SITE=' + site;
          }
          var popUpFeatures = 'dialogHeight: 385px; dialogWidth: 600px; edge: Raised; center: Yes; help: No; resizable: No; scroll: Yes; status: No;';
          var RetVal = window.showModalDialog(loginUrl, 'null', popUpFeatures);
          if (typeof (RetVal) == 'undefined') {
              top.window.close();
          }
          else {
              var RetArray = RetVal.split(',')
              var ValidLogon = RetArray[0];
              var MUName = RetArray[1];
              if (ValidLogon == 1) {
                  document.location.href = 'newRequest.aspx?desc=' + MUName;
              }
              else {
                  top.window.close();
              }
          } // else(typeof(RetVal)
      }
  &lt;/script&gt;
  
  &lt;/head&gt;
  &lt;body ms_positioning="GridLayout" onload="openLogin('&lt;%=Request("SITE")%&gt;','&lt;%=Request("PASS")%&gt;');"&gt;
  &lt;form id="Form1" method="post" runat="server"&gt;
  &amp;nbsp;
  &lt;/form&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>This code works perfectly in IE but in safari on the login screen after I enter site name and password and hit login button it doesn't redirect me to the newRequest.aspx page instead just closes the login popup and shows a blank access.aspx page.</p>
  
  <p>Editted:</p>
  
  <p>This is the code on btnLogin_Click on Login.aspx.vb page</p>
  
  <pre><code>If txtSiteName.Text = "" And txtPassPhrase.Text = "" Then Return
          If ValidateSiteAndPass(txtSiteName.Text, txtPassPhrase.Text) = False Then
              Throw New Exception("OOPS!!! Either SiteName or Pass Phrase is Invalid, please check")
          Else
              Session("valid") = "true"
              Response.Write("&lt;script language='javascript'&gt;{window.returnValue='1," + txtSiteName.Text + "'; self.close();}&lt;/script&gt;") '''document.Form1.submit();")
              Response.End()
          End If
  </code></pre>
  
  <p>Please suggest</p>
  
  <p>Thanks,
  Kavita</p>