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

