Returns an object with information about the viewport for some responsive JavaScript goodness:
function getViewport(){
this.w = Math.max(document.documentElement.clientWidth, window.innerWidth || 0);
this.h = Math.max(document.documentElement.clientHeight, window.innerHeight || 0);
this.output = {
w: this.w,
h: this.h,
orientation: this.w < this.h ? "portrait" : "landscape"
};
return this.output;
}