/* snippet from Joe Hewitt (http://www.joehewitt.com) */
/* actually using this because of weird scrolling bug */
/* was originally intended to hide the address bar */
addEventListener("load", function() {
    setTimeout(updateLayout, 0);
}, false);

var currentWidth = 0;

function updateLayout() {
    if (window.innerWidth != currentWidth) {
        currentWidth = window.innerWidth;
        var orient = currentWidth == 320 ? "profile" : "landscape";
        document.body.setAttribute("orient", orient);
        
        setTimeout(function() {
            window.scrollTo(0, 0);
        }, 100);
        
    }
}
setInterval(updateLayout, 400);
/* end Joe Hewitt */
