// -----------------------------------------------------
// Get window width in pixels; returns 0 if unidentifiable.
// -----------------------------------------------------

function getWindowWidth(){
  var ww = 0;
  if (window.innerWidth && window.innerWidth > 0)
  {
	ww = window.innerWidth; 
  }
  else if (document.documentElement &&  document.documentElement.clientWidth &&
                                        document.documentElement.clientWidth > 0)
  {
	ww = document.documentElement.clientWidth; 
  }
  else if (document.body && document.body.clientWidth)
  {
	ww = document.body.clientWidth; 
  }
  return ww;
}