﻿var WindowSize = new Class({
  initialize: function(win){
    if(!win) {
	  var $_win = window;
	} else {
	  var $_win = win;
	}
	
	var $_return = new Object();
	
	if(typeof $_win.innerWidth != 'undefined') {
	  $_return.width  = $_win.innerWidth;
	  $_return.height = $_win.innerHeight;
	} else {
	  var $_body = this.getBody($_win);
	  
	  $_return.width  = parseInt($_body.clientWidth);
	  $_return.height = parseInt($_body.clientHeight);
	}
	
	return $_return;
  },
  
  getBody: function(w) {
    return (w.document.compatMode && w.document.compatMode == "CSS1Compat") ? w.document.documentElement : w.document.body || null;
  }  
});
