var env = $$.environment();

if(screen.width >= 768) {
	tablet = true;
} else {
	tablet = false;
}

if (paidapp === true && tablet === true) {
	document.write('<link rel="stylesheet" type="text/css" href="includes/css/tablet.css">');
}


if (paidapp === false) {
	$('.upgrade-required').show();
}

$.getJSON("includes/json/schedule.json", function (e) {
	window.json = e;
});


function upgradePrompt() {
	navigator.notification.confirm(
	    'An upgrade is required to Ferries+ for you to have this feature. Sorry!', // message
	     upgrade,            // callback to invoke with index of button pressed
	    'Upgrade Required',           // title
	    ['Upgrade','Cancel']     // buttonLabels
	);
}

function upgrade(buttonIndex) {
	if (buttonIndex === 1) {
		window.open('https://itunes.apple.com/us/app/ferries+/id602435586?ls=1&mt=8', '_system', 'location=yes');
	}
}

document.addEventListener("deviceready", function() {departList();}, false);
