title: Gray and disable out the parent window as soon as pop up window is opened
body: <p>I am trying to disable the Parent window as soon as the child window is opened. I would like to gray out the parent window whenever pop window is opened.</p>
  
  <p>Below is my popup window code-</p>
  
  <pre><code>&lt;html&gt;
  &lt;head&gt;
      &lt;title&gt;Applying&lt;/title&gt;
  &lt;/head&gt;
  &lt;body&gt;
  
  &lt;script&gt;
  function getUrlVars() {
      var vars = {};
      var parts = window.location.href.replace(/[?&amp;]+([^=&amp;]+)=([^&amp;]*)/gi, 
          function(m,key,value) {
              vars[key] = value;
          });
      return vars;
  }
  var variable1 = getUrlVars()["parameter1"];    
  
  var myScript = document.createElement('script');
  
  myScript.setAttribute('type', 'text/javascript');
  myScript.setAttribute('urlId', '420');
  myScript.setAttribute('dataTitle', variable1);
  myScript.setAttribute('dataemail', 'admin@domain.net');
  
  document.body.appendChild(myScript);                              
  &lt;/script&gt;
  
  &lt;input name="Apply" type="button" id="Apply" value="Apply" ONCLICK="window.location.href='some_url'"&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>Below is my Parent window code-</p>
  
  <pre><code>&lt;html&gt;
  
  &lt;body&gt;
  &lt;SCRIPT LANGUAGE="JavaScript"&gt;
  &lt;!-- 
  function popUp(URL) {
  day = new Date();
  id = day.getTime();
  eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=550,height=650,left = 570,top = 300');");
  }
  &lt;/script&gt;
  &lt;input type=button value="Apply" onClick="javascript:popUp('popup_window_url')"&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>What's the best and easy way to disable the parent window here? Any example with my above code will help me a lot in understanding a simple example. </p>
  
  <p>I saw various other post on the stackoverflow but I am not able to understand how to incorporate those things here in my code. I am trying to do something like <a href="https://stackoverflow.com/questions/10679283/gray-out-parent-window-when-child-window-is-up">this</a>.</p>
  
  <p>Any suggestions will be of great help.</p>