Yes. Sorry I'm finally get back to this thread. I got the orientation to work in Firefox.
Here is my code for anybody interested:
if (MobileDevice == "ANDROID" && MobileDeviceBrowser == "FIREFOX") {
window.addEventListener("deviceorientation", handleOrientation, true);
}
function handleOrientation(orientData) {
var absolute = orientData.absolute;
var alpha = orientData.alpha;
var beta = orientData.beta;
var gamma = orientData.gamma;
// Do stuff with the new orientation data
if (screen.width > screen.height) {
CurrentOrientation = 'Landscape';
} else {
CurrentOrientation = 'Portrait';
}
if (OldOrientation != CurrentOrientation) {
RepositionAndResizeMap();
}
OldOrientation = CurrentOrientation;
}
function RepositionAndResizeMap() {
SetWindowOrientation();
if (MobileDevice == "ANDROID") {
setTimeout('FixAndroidMenuBar();', 500);
} else {
RepositionAndResizeMapPart2();
}
}
function SetWindowOrientation() {
if (MobileDevice != "ANDROID" || MobileDeviceBrowser != "FIREFOX") {
if (window.orientation == 90 || window.orientation == -90) {
CurrentOrientation = 'Landscape';
} else {
CurrentOrientation = 'Portrait';
}
}
}
function RepositionAndResizeMapPart2() {
if (map) {
var MapDiv = document.getElementById('map');
MapDiv.style.top = "0px";
MapDiv.style.left = "0px";
MapDiv.style.width = "100%";
MapDiv.style.height = "100%";
map.reposition();
TryMapResize();
}
AdjustProgressWindow();
}
function TryMapResize() {
var tbMap = document.getElementById('tbMap');
if (tbMap.style.display == "none") {
setTimeout('TryMapResize();', 1000);
} else {
map.resize();
AdjustProgressWindow();
}
}
function AdjustProgressWindow() {
var CalcWidth = screen.width;
var CalcHeight = screen.height;
if (MobileDevice == "WINDOWS") {
CalcWidth = typeof window.outerWidth != 'undefined' ? window.outerWidth : document.body.clientWidth;
CalcHeight = typeof window.outerHeight != 'undefined' ? window.outerHeight : (document.body.clientHeight - 22);
} else {
if (CurrentOrientation == 'Landscape') {
if (CalcWidth < CalcHeight) {
CalcWidth = screen.height;
CalcHeight = screen.width;
}
} else {
if (CalcWidth > CalcHeight) {
CalcWidth = screen.height;
CalcHeight = screen.width;
}
}
}
var CenterX = CalcWidth / 2;
var CenterY = CalcHeight / 2;
var OffsetY = 170;
var OffsetX = 120;
if (CurrentOrientation == 'Landscape') {
if (MobileDevice == "ANDROID") {
if (MobileDeviceVersion > "4") {
OffsetY = 200;
OffsetX = 230;
} else {
OffsetY = 130;
OffsetX = 60;
}
} else if (MobileDevice == "IPOD" || MobileDevice == "IPHONE") {
OffsetY = 110;
OffsetX = 75;
}
} else {
if (MobileDevice == "ANDROID") {
if (MobileDeviceVersion > "4") {
OffsetY = 320;
OffsetX = 185;
} else {
OffsetY = 170;
OffsetX = 60;
}
} else if (MobileDevice == "IPOD" || MobileDevice == "IPHONE") {
OffsetY = 110;
OffsetX = 70;
}
}
var Progress = document.getElementById(ProgressWindow);
if (Progress != null) {
Progress.style.top = CenterY - OffsetY + "px";
Progress.style.left = CenterX - OffsetX + "px";
}
}