function getWindowSize(gwsDimension) {
  var gwsWidth = 0, gwsHeight = 0;
  if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    gwsWidth = window.innerWidth;
    gwsHeight = window.innerHeight;
  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    gwsWidth = document.documentElement.clientWidth;
    gwsHeight = document.documentElement.clientHeight;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
    gwsWidth = document.body.clientWidth;
    gwsHeight = document.body.clientHeight;
  }
  
  switch (gwsDimension){
    case 'width':
      return gwsWidth;
    case 'height':
      return gwsHeight;
    case 'both':
      return {width: gwsWidth, height: gwsHeight};
  }
}