title: detect window width and compensate for scrollbars - Javascript
body: <p>How do I detect the width of a user's window with Javascript and account for their scrollbar? (I need the width of the screen INSIDE of the scrollbar). Here's what I have...it seems to work in multiple browsers...except that it doesn't account for the scrollbars..</p>
  
  <pre><code>    function browserWidth() {
    var myWidth = 0;
    if( typeof( window.innerWidth ) == 'number' ) {
      //Non-IE
      myWidth = window.innerWidth;
    } else if( document.documentElement &amp;&amp; document.documentElement.clientWidth ) {
      //IE 6+ in 'standards compliant mode'
      myWidth = document.documentElement.clientWidth;
    } else if( document.body &amp;&amp; document.body.clientWidth ) {
      //IE 4 compatible
      myWidth = document.body.clientWidth;
    }
    return myWidth;
  }
  </code></pre>
  
  <p>any ideas? i need it to work in all browsers;)</p>