var docHeight,viewportwidth,viewportheight,dsocleft,dsoctop;

function setscreendimensions() {
  if (document.compatMode && document.compatMode != 'BackCompat') {
    docHeight = document.documentElement.scrollHeight;
    docWidth  = document.documentElement.scrollWidth;
  } else if (document.body && typeof document.body.scrollHeight != 'undefined') {
    docHeight = document.body.scrollHeight;
    docWidth  = document.body.scrollWidth;
  }

  if (typeof window.innerWidth != 'undefined') {
    viewportwidth = window.innerWidth,
    viewportheight = window.innerHeight
  } else if (typeof document.documentElement != 'undefined' && typeof document.documentElement.clientWidth != 'undefined' && document.documentElement.clientWidth != 0) {
    viewportwidth = document.documentElement.clientWidth,
    viewportheight = document.documentElement.clientHeight
  } else {
    viewportwidth = document.getElementsByTagName('body')[0].clientWidth,
    viewportheight = document.getElementsByTagName('body')[0].clientHeight
  }
  var iebody=(document.compatMode && document.compatMode != "BackCompat")? document.documentElement : document.body;
  dsocleft=document.all? iebody.scrollLeft : pageXOffset;
  dsoctop=document.all? iebody.scrollTop : pageYOffset;
}
