document.addEventListener("deviceready", onDeviceReady, false);

function onDeviceReady() {
	if (cordova.platformId == 'android') {
StatusBar.backgroundColorByHexString("#C60C1C");
	}

cordova.plugins.backgroundMode.enable();

cordova.plugins.backgroundMode.setDefaults({
title: '<!-- AppName -->',
text: 'My Amazing Application',
icon: 'icon',
color: 'C60C1C',
resume: True,
hidden: False,
bigText: True
})

cordova.plugins.backgroundMode.on('activate', function() {
cordova.plugins.backgroundMode.disableWebViewOptimizations(); 
});

}


/*    Element = function (el) { return document.getElementById(el) };      */

BabelFish = {};
BabelFish.Element = function (el) { return document.getElementById(el); };
BFElement = function(el) { return BabelFish.Element(el); };

BabelFish.Blur = function () {
let el = document.querySelector( ':focus' );
if( el ) el.blur();
}

window.fn = {};

window.fn.open = function() {
var menu = document.getElementById('menu');
menu.open();
};

window.fn.load = function(page) {
var content = document.getElementById('content');
var menu = document.getElementById('menu');
content.load(page)
.then(menu.close.bind(menu));
};

function change(page)
{
var myNavigator = document.getElementById('pushpage_navigator');
myNavigator.pushPage(page);
}


function search1_SearchFor(SearchTerm) {
ons.notification.alert(SearchTerm);
BabelFish.Blur();
}


function miwa_onclick() {
	change('tab4.html');
}

function disableMenus() {

   if (document.addEventListener) {
            document.addEventListener('contextmenu', function (e) {
                e.preventDefault();
            }, false);
        } else {
            document.attachEvent('oncontextmenu', function () {
                window.event.returnValue = false;
            });
        }
}

disableMenus();