function updateOrientation()
{
	var orientation = window.orientation;
	switch(orientation)
	{
	
		case 0:
				document.body.setAttribute("class","portrait");
				break;	
				
		case 90:
		case -90:
				document.body.setAttribute("class","landscape");
				break;
	}
}

window.onload = function() {
	updateOrientation();
	
	this.addEventListener( "orientationchange", updateOrientation );
}
