/**
 * (c) by aheadware.com
 */

var app = app || {};
app.util = app.util || {};

app.util.Environment = (function(){

    return {
        isNativeMobile : function()
        {
            if ( window && window.hasOwnProperty( 'isNativeMobile' ) )
            {
                return window.isNativeMobile;
            }
            else
            {
                return false;
            }
        }
        ,
        getDevice : function()
        {
            var deviceName = 'WEB';

            if ( app.util.Environment.isNativeMobile() && device )
            {
                deviceName = device.platform.toUpperCase();
            }

            return deviceName;
        }
        ,
        isCameraAvailable : function()
        {
            return ( app.util.Environment.isNativeMobile() && navigator.camera );
        }
        ,
        getCameraOptions : function( srcType )
        {
            var options = {
                // Some common settings are 20, 50, and 100
                quality: 50,
                destinationType: Camera.DestinationType.DATA_URL,
                // In this app, dynamically set the picture source, Camera or photo gallery
                sourceType: srcType,
                encodingType: Camera.EncodingType.JPEG,
                mediaType: Camera.MediaType.PICTURE,
                allowEdit: false,
                correctOrientation: true  //Corrects Android orientation quirks
            };
            return options;
        }
    }

})();