window.onload = function initialLoad(){ updateOrientation(); }
window.addEventListener("load", function() { setTimeout(loaded, 100) }, false);  

function updateOrientation(){  
	var contentType = "main";  
	switch(window.orientation){
	case -90:  
	case 90:
		alert("wide");
		contentType += "_wide";
		break;
	}
	document.getElementById("page_wrapper").setAttribute("class", contentType);  
}

function loaded() {  
	document.getElementById("page_wrapper").style.visibility = "visible";  
	window.scrollTo(0, 1); // pan to the bottom, hides the location bar  
}