
//Called when application is started.
function OnStart()
{
	//Create a layout with objects vertically centered.
	lay = app.CreateLayout( "linear", "VCenter,FillXY" );	
lay.SetBackColor( "#ffffff" );
	//Create a text label and add it to layout.
	txt = app.CreateText( "" );
	txt.SetTextSize( 32 );
	lay.AddChild( txt );
	so();
	//Add layout to app.	
	app.AddLayout( lay );
}
function so(){
var or = app.GetOrientation();
if(or=="Portrait"){
app.Alert( or);
txt.SetText( or );
app.Exit(  );
}
else app.Alert( or );
txt.SetText( or );
}