LyteBox.prototype.getPageSize = function() {  
  var xScroll, yScroll, windowWidth, windowHeight;
  if (window.innerHeight && window.scrollMaxY) {
    xScroll = this.doc.scrollWidth;
    yScroll = (this.isFrame ? parent.innerHeight : self.innerHeight) + (this.isFrame ? parent.scrollMaxY : self.scrollMaxY);
  } else if (this.doc.body.scrollHeight > this.doc.body.offsetHeight){
    xScroll = this.doc.body.scrollWidth;
    yScroll = this.doc.body.scrollHeight;
  } else {
    xScroll = this.doc.getElementsByTagName("html").item(0).offsetWidth;
    yScroll = this.doc.getElementsByTagName("html").item(0).offsetHeight;
    xScroll = (xScroll < this.doc.body.offsetWidth) ? this.doc.body.offsetWidth : xScroll;
    yScroll = (yScroll < this.doc.body.offsetHeight) ? this.doc.body.offsetHeight : yScroll;
  }
  if (self.innerHeight) {
    windowWidth = (this.isFrame) ? parent.innerWidth : self.innerWidth;
    windowHeight = (this.isFrame) ? parent.innerHeight : self.innerHeight;
  } else if (document.documentElement && document.documentElement.clientHeight) {
    windowWidth = this.doc.documentElement.clientWidth;
    windowHeight = this.doc.documentElement.clientHeight;
  } else if (document.body) {
    windowWidth = this.doc.getElementsByTagName("html").item(0).clientWidth;
    windowHeight = this.doc.getElementsByTagName("html").item(0).clientHeight;
    windowWidth = (windowWidth == 0) ? this.doc.body.clientWidth : windowWidth;
    windowHeight = (windowHeight == 0) ? this.doc.body.clientHeight : windowHeight;
  }
  var pageHeight = (yScroll < windowHeight) ? windowHeight : yScroll;
  if(getBrowserVersion().indexOf("IE6")>-1){
    if(typeof document.pHeight != 'number'){      
      var beforeScroll = document.documentElement.scrollTop;
      document.documentElement.scrollTop = 6000;
      pageHeight += document.documentElement.scrollTop;
      document.documentElement.scrollTop = beforeScroll;
      document.pHeight = pageHeight;
    }
    else {
      pageHeight = document.pHeight;
    }
  }
  var pageWidth = (xScroll < windowWidth) ? windowWidth : xScroll;
  return new Array(pageWidth, pageHeight, windowWidth, windowHeight);
};
function getBrowserVersion(){
  if(document.ids)x='nc4';
    else if( document.all && !document.getElementById )x='IE4';
    else if( window.opera && !document.createElement )x='op5';
    else if( window.opera && window.getComputedStyle )  {
      if(document.createRange)x='op8';
      else if(window.navigate)x='op7.5';
      else x='op7.2';
    }
    else if( window.opera && document.compatMode )x='op7';
    else if( window.opera && document.releaseEvents )x='op6';
    else if( document.contains && !window.opera )x='kq3';
    else if(window.pkcs11&&window.XML)x='f15';
    else if( window.getSelection && window.atob )x='nn7';
    else if( window.getSelection && !document.compatMode )x='nn6';
    else if( window.clipboardData && document.compatMode )x=window.XMLHttpRequest? 'IE7' : 'IE6';
    else if( window.clipboardData ){
      x='IE5';
      if( !document.createDocumentFragment ) x+='.5';
      if( document.doctype && !window.print ) x+='m';
    }
    else x='???';
    return x;
}

