var currentWidth = 0;
checkTimer = setInterval(checkOrientAndLocation, 300);
function checkOrientAndLocation(){
    if (window.innerWidth != currentWidth){   
        currentWidth = window.innerWidth;
        var orient = currentWidth == 320 ? "profile" : "landscape";
        document.body.setAttribute("orient", orient);
		setTimeout(scrollTo, 100, 0, 1);
    }
}
addEventListener(
"load",
function() {
	setTimeout(hideURLbar, 0);
	}, false
);                     
function hideURLbar() {
	window.scrollTo(0, 1);    
}