title: Cannot read property 'style' of null - in Chrome's Javascript Console
body: <p>I was checking the JS console out and it helped me fix a few minor issues, but I would like to know if this warning is anything to seriously worry about?</p>
  
  <p>This is the code which gives the error:</p>
  
  <pre><code>&lt;script type="text/javascript"
  src="https://www.safaviehhome.com/product_images/locations/js/jqgalscroll.js"&gt;&lt;/script&gt;
  &lt;script src="https://www.safaviehhome.com/product_images/mainnav/stuHover.js"             type="text/javascript"&gt;&lt;/script&gt;
  &lt;script&gt;
  function layerSetup(id,visibility){
  if(document.getElementById){
  this.obj = document.getElementById(id).style;
  Uncaught TypeError: Cannot read property 'style' of null
  Uncaught TypeError: Cannot read property 'style' of null
  &lt;!--Includes many more of the same "Cannot read property 'style' of null messages --&gt;
  
  this.obj.visibility = visibility;
  return this.obj;}
  else if(document.all){
  this.obj = document.all[id].style;
  this.obj.visibility = visibility;
  return this.obj;}
  else if(document.layers){
  this.obj = document.layers[id];
  this.obj.visibility = visibility;
  return this.obj;}
  }
  function visVisible(param){
  new layerSetup(param,'visible');
  }
  
  function visHidden(param){
  new layerSetup(param,'hidden');
  }&lt;/script&gt;
  </code></pre>
  
  <p>I cannot really figure out why this is happening and whether it's something I should worry about since our Rug categories function fine. Can anybody offer any insight? I apologize for not offering any of my own explanations but I didn't write this JS a former co-worked did and it's now up to me to debug every mistake he made. It's a learning process but I'm still somewhat new to this .. </p>