var geometry = {};
if (window.innerWidth)
{
 geometry.getViewportWidth = function() { return window.innerWidth; };
 geometry.getViewportHeight = function() { return window.innerHeight; };
} else
{
 if (document.documentElement && document.documentElement.clientWidth)
 {
  geometry.getViewportWidth = function() { return document.documentElement.clientWidth; };
  geometry.getViewportHeight = function() { return document.documentElement.clientHeight; };
 } else
 {
  if (document.body.clientWidth)
  {
   geometry.getViewportWidth = function() { return document.body.clientWidth; };
   geometry.getViewportHeight = function() { return document.body.clientHeight; };
  }
 }
}
if (document.documentElement && document.documentElement.scrollWidth)
{
 geometry.getDocumentWidth = function() { return document.documentElement.scrollWidth; };
 geometry.getDocumentHeight = function() { return document.documentElement.scrollHeight; };
} else
{
 if (document.body.scrollWidth)
 {
  geometry.getDocumentWidth = function() { return document.body.scrollWidth; };
  geometry.getDocumentHeight = function() { return document.body.scrollHeight; };
 }
}


