function updateOrientation()
{
	var displayStr = "Orientation : ";
	
	switch(window.orientation) {
		case 0:
			displayStr += "Portrait";
			break;
		
		case -90:
			displayStr += "Landscape (right, screen turned clockwise)";
			break;
		
		case 90:
			displayStr += "Landscape (left, screen turned counterclockwise)";
			break;
			
		case 180:
			displayStr += "Portrait (upside-down portrait)";
			break;
	}
	document.getElementById("output").innerHTML = displayStr;
}

function hideAddressBar()
{
	new Fx.Scroll(window,{
		wait: false,
		duration: 600
	}).toElement('top');
}

function getOrientation() {
	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;
		default:
			orient = $$('body').getProperty('orient');
			break;
	}
	return orient;
}

function changeOrientation()
{
	if(getOrientation() == 'portrait') {
		$$('body').setProperty('id', 'portrait');
		$$('body').setProperty('orient', 'portrait');
	} else {
		$$('body').setProperty('id', 'landscape');
		$$('body').setProperty('orient', 'landscape');
	}

	/* toggle_search('hide');	*/
	hideAddressBar();
}
