var GeotabConfig = {
	/////////////////////////////////////////////////////
	/////////////////////////////////////////////////////
	"datatable" : {
		// geo_dataTable. Basic styles and options
		"global_options":{
			rootPId : 9998,
			filterEmptyText : "Type here to search for item",
			checkboxesLabel : "Select All/None",
			rootLabel : "Back to Top",
			iptDisabledClass : "geo_iptFilterDisabled",
			iptEnabledClass : "geo_iptFilterEnabled",
			iconGroup: "/gfx/groupIcon.gif",
			iconLevelUp : "/gfx/iconLevelUp.gif",
			iconDevice : "/gfx/iconDevice.gif",
			iconDriver : "/gfx/iconDriver.gif",
			trNormalClass: "geo_normalRow",
			trSelectedClass: "geo_selectedRow",
			elementID : {
				"grid" : "geo_groups_grid",
				"selector" : "geo_groups_selector",
				"filter" : "geo_filter",
				"path" : "geo_groupPath",
				"buttons" : "geo_buttonArea",
				"bottomLine" : "containerGroupsBottom"
			},
			dialogWindowClass: "dialogWindow",
			dialogWindowIptClass: "geo_ipt",
			btnClass: "btn",
			addBtnLbl:"Add",
			delBtnLbl:"Remove",
			editBtnLbl:"Edit"
		},
		//specific options for the table with reports
		"options_report" : {
			Elements : ["selector","path","filter","grid"],
			onFilter : function(id,filter,selector,callback){window.dataSource.getNodes(id,filter,selector,callback);},
			onSelectorChange : function(id,filter,selector,callback){window.dataSource.getNodes(id,filter,selector,callback);},
			onRowClick : function(id,filter,selector,callback){window.dataSource.getNodes(id,filter,selector,callback);},
			blCheckboxes:true
		},
		//specific options for the table update
		"options_editgroup" : {
			Elements : ["path","filter","grid","buttons"],
			onFilter : function(id,filter,selector,callback){window.dataSource.getNodes(id,filter,selector,callback);},
			onSelectorChange : function(id,filter,selector,callback){window.dataSource.getNodes(id,filter,selector,callback);},
			onRowClick : function(id,filter,selector,callback){window.dataSource.getNodes(id,filter,selector,callback);},
			blCheckboxes:false,
			onAdd : function(id,pId,name,selector,callback){window.dataSource.addNode(id,pId,name,selector,callback);},
			onEdit : function(id,pId,name,callback){window.dataSource.setNodeName(id,pId,name,callback);},
			onDelete : function(id,pId,name,callback){window.dataSource.deleteNode(id,pId,callback);}
		},
		"dialog":{
			autoOpen:false,
			height : 100,
			width:200,
			modal : true,
			resizable : false,
			draggable : false
		},
		"dialog_add":{
			title: "Add Group",
			buttons: ["Add","Canecel"]
		},
		"dialog_edit":{
			title: "Edit Group",
			buttons: ["Save","Canecel"]
		}
	},
	/////////////////////////////////////////////////////
	/////////////////////////////////////////////////////
	"login": {
	    "dialog": {
	        autoOpen: false,
	        closeOnEscape: false,
	        height: 155,
	        width: 270,
	        modal: true,
	        resizable: false,
	        title_login: "Login",
	        title_wait: "Authorizing..."
	    },
	    authorizationFailed: "Invalid Login",
        unknownDatabase: "Unknown Database",
        unknownError: "Unknown Error",
        serverTimeout: "Login Timeout"
	},
	/////////////////////////////////////////////////////
	/////////////////////////////////////////////////////
	"register": {
	    authorizationFailed: "Invalid Login",
	    invalidReferrer: "Registration is not supported outside of geotab.com domain",
	    databaseExists: "Company with the same name is already registered",
	    unknownResponse: "Unexpected Registration Server response: <result>. Please report this issue to GEOTAB",
	    registrationServerDown: "Registration Server is down, please try again later or contact GEOTAB if the problem persists",
	    registrationServerTimeout: "Registration request has timed out before receiving a confirmation response from the Server. Please contact GEOTAB with your registration details",
	    createDatabaseFailed: "Registration Server could not create account due to internal error, please report this issue to GEOTAB",
	    invalidCompany: "Provide valid Company name",
	    invalidName: "Provide First and Last name",
	    registrationDisallowed: "Registration Server is currently does not accept new registration requests. Please contact GEOTAB for more information",
	    invalidEmail: "Provide a valid E-Mail",
	    emailServerDown: "Registration Server could not process your request because its Email Server is down. Please contact GEOTAB for support",
	    invalidPassword: "Provide a valid secure Password at least five letters/numbers long",
	    mismatchingPassword: "Passwords do not match",
	    invalidFleetSize: "Fleet Size is not a valid number"
	},
	/////////////////////////////////////////////////////
	/////////////////////////////////////////////////////
	"dialog":{
			autoOpen:false,
			closeOnEscape: true,
			height : 600,
			width : 800,
			modal : true,
			overlay : {backgroundColor:"gray",opacity : 0.5},
			resizable : true,
			draggable : true
	},
	/////////////////////////////////////////////////////
	/////////////////////////////////////////////////////	
	"reporttable" : {
		// reportTable. Vasic styles and options
		"options":{
			onGridRefresh: function(){window.dataSource.loadReport();},
			onLoadReport: function(type,fromDate,toDate,nodes,drivers,devices,minCustomerStopMinutes,expandNodesIntoAssets,includeAuxiliary,callback){
				window.dataSource.loadReport(type,fromDate,toDate,nodes,drivers,devices,minCustomerStopMinutes,expandNodesIntoAssets,includeAuxiliary,callback);
			},
			onEnable:null,
			onDisable:null,
			onGetDeviceOrDriver:null,
			onGetNodes:null,
			onGetDrivers:null,
			onGetDevices:null,
			onGetStartDate:null,
			onGetEndDate:null,
		
		
			connectOptionsForm: null,
			includeDriverName:false,
			minCustomerStopMinutes:0,
			includeAuxiliary:false,
			excludeStopsOver:false,
			excludeStopsOverValue:0,
			highlightStopsOver:false,
			highlightStopsOverValue:0,
			expandNodesIntoAssets:false,
			driver_or_device:"",
			current_report_cell_data:"empty"
		},
		"grid_config" : function(report,options){
				var yellowFormater = function(jqTD, propValue, dataObj){
					if (dataObj.isStartDriveWorkHours==false)
						jqTD.css('background-color', 'yellow');
				};
				var stopRedFormatter =   function(jqTD, propValue, dataObj){
					var highlightStopOver = (window.DataTableReports||window.ActivityAndTripsReport.DataTableReports).options.highlightStopsOver;
					if (!highlightStopOver)
						return;
					var highlightStopOverValue = (window.DataTableReports||window.ActivityAndTripsReport.DataTableReports).options.highlightStopsOverValue;
					if (Number(ConverterAPI.strToSeconds(propValue)) >= Number(highlightStopOverValue)*60)
						jqTD.css('background-color', 'red');
				};
				var idlingRedFormatter =   function(jqTD, propValue, dataObj){
					var highlightIdleOver = (window.DataTableReports||window.ActivityAndTripsReport.DataTableReports).options.highlightIdleOver;
					if (!highlightIdleOver)
						return;
					var highlightIdleOverValue = (window.DataTableReports||window.ActivityAndTripsReport.DataTableReports).options.highlightIdleOverValue;
					if (Number(ConverterAPI.strToSeconds(propValue)) >= Number(highlightIdleOverValue)*60)
						jqTD.css('background-color', 'red');
				};
				var auxMFormatter = function(jqTD, propValue, dataObj){
					if (propValue && Number(ConverterAPI.strToSeconds(propValue)) > 0)jqTD.css('background-color', 'red');
				};
				var auxDFormatter = function(jqTD, propValue, dataObj){
					if (propValue && Number(propValue) > 0)jqTD.css('background-color', 'red');
				};
				var Reports = {
					"empty": [{name:'', label:'', index:'', width:0}],
					"details":[
								 {name:'device.name', label:'Device', index:'device.name', width:80, sorttype:'text'},
								 {name:'deviceGroup', label:'Group', index:'deviceGroup', width:80, sorttype:'text'},
								 {name:'driver.name', label:'Driver', index:'driver.name', width:80, sorttype:'text', hidden:(!options.includeDriverName||options.driver_or_device!="device")?true:false},
								 {name:'startDrive', label:'Departure', index:'startDrive', width:80, formatter:yellowFormater, sorttype:'date', datefmt:ConverterAPI.dateTimeFormatForGrid(), convertor:"time", groupingType:"date"},
								 {name:'drivingDuration', label:'Driving', index:'drivingDuration', width:80, sorttype:'date', datefmt:ConverterAPI.timeFormatForGrid(), convertor:"duration"},
								 {name:'stopDrive', label:'Arrival', index:'stopDrive', width:80, formatter:yellowFormater, sorttype:'date', datefmt:ConverterAPI.dateTimeFormatForGrid(), convertor:"time", groupingType:"date"},
								 {name:'distance', label:'Distance', index:'distance', width:80, sorttype:'float', convertor:"distance", groupingType:"distance_1_5000"},
								 {name:'stopDuration', label:'Stop', index:'stopDuration', width:80, formatter:stopRedFormatter, sorttype:'date', datefmt:ConverterAPI.timeFormatForGrid(), convertor:"duration"},
								 {name:'locationName', label:'Location', index:'locationName', width:80, sorttype:'text'},
								 {name:'idlingDuration', label:'Idling', index:'idlingDuration', width:80, formatter:idlingRedFormatter, sorttype:'date', datefmt:ConverterAPI.timeFormatForGrid(), convertor:"duration"},
								 {name:'maximumSpeed', label:'Max Speed', index:'maximumSpeed', width:80, sorttype:'float', convertor:"distance"}
					],
					"aux":[
								 {name:'aux1d', formatter:auxDFormatter, label:'Auxiliary 1 Duration', index:'aux1d', width:80, sorttype:'date', datefmt:ConverterAPI.dateTimeFormatForGrid()},
								 {name:'aux1m', formatter:auxMFormatter, label:'Auxiliary 1 Distance', index:'aux1m', width:80, sorttype:'float'},
								 {name:'aux2d', formatter:auxDFormatter, label:'Auxiliary 2 Duration', index:'aux2d', width:80, sorttype:'date', datefmt:ConverterAPI.dateTimeFormatForGrid()},
								 {name:'aux2m', formatter:auxMFormatter, label:'Auxiliary 2 Distance', index:'aux2m', width:80, sorttype:'float'},
								 {name:'aux3d', formatter:auxDFormatter, label:'Auxiliary 3 Duration', index:'aux3d', width:80, sorttype:'date', datefmt:ConverterAPI.dateTimeFormatForGrid()},
								 {name:'aux3m', formatter:auxMFormatter, label:'Auxiliary 3 Distance', index:'aux3m', width:80, sorttype:'float'},
								 {name:'aux4d', formatter:auxDFormatter, label:'Auxiliary 4 Duration', index:'aux4d', width:80, sorttype:'date', datefmt:ConverterAPI.dateTimeFormatForGrid()},
								 {name:'aux4m', formatter:auxMFormatter, label:'Auxiliary 4 Distance', index:'aux4m', width:80, sorttype:'float'},
								 {name:'aux5d', formatter:auxDFormatter, label:'Auxiliary 5 Duration', index:'aux5d', width:80, sorttype:'date', datefmt:ConverterAPI.dateTimeFormatForGrid()},
								 {name:'aux5m', formatter:auxMFormatter, label:'Auxiliary 5 Distance', index:'aux5m', width:80, sorttype:'float'},
								 {name:'aux6d', formatter:auxDFormatter, label:'Auxiliary 6 Duration', index:'aux6d', width:80, sorttype:'date', datefmt:ConverterAPI.dateTimeFormatForGrid()},
								 {name:'aux6m', formatter:auxMFormatter, label:'Auxiliary 6 Distance', index:'aux6m', width:80, sorttype:'float'},
								 {name:'aux7d', formatter:auxDFormatter, label:'Auxiliary 7 Duration', index:'aux7d', width:80, sorttype:'date', datefmt:ConverterAPI.dateTimeFormatForGrid()},
								 {name:'aux7m', formatter:auxMFormatter, label:'Auxiliary 7 Distance', index:'aux7m', width:80, sorttype:'float'},
								 {name:'aux8d', formatter:auxDFormatter, label:'Auxiliary 8 Duration', index:'aux8d', width:80, sorttype:'date', datefmt:ConverterAPI.dateTimeFormatForGrid()},
								 {name:'aux8m', formatter:auxMFormatter, label:'Auxiliary 8 Distance', index:'aux8m', width:80, sorttype:'float'}
					],
					"summary":[
								 {name:'name', label:(options.driver_or_device=="device"?"Device":"Driver") + "\\Group", index:'name', width:80, sorttype:'text'},
								 {name:'groupName', label:'Group', index:'groupName', width:80, sorttype:'text'},
								 {name:'customerDuration', label:'Customer Time', index:'customerDuration', width:80, sorttype:'date', datefmt:ConverterAPI.timeFormatForGrid(), convertor:"duration"},
								 {name:'nonCustomerDuration', label:'Undefined Stop Time', index:'nonCustomerDuration', width:80, sorttype:'date', datefmt:ConverterAPI.timeFormatForGrid(), convertor:"duration"},
								 {name:'drivingDuration', label:'Driving', index:'drivingDuration', width:80, sorttype:'date', datefmt:ConverterAPI.timeFormatForGrid(), convertor:"duration"},
								 {name:'officeDepotDuration', label:'Office/Depot Time', index:'officeDepotDuration', width:80, sorttype:'date', datefmt:ConverterAPI.timeFormatForGrid(), convertor:"duration"},
								 {name:'homeDuration', label:'Home Time', index:'homeDuration', width:80, sorttype:'date', datefmt:ConverterAPI.timeFormatForGrid(), convertor:"duration"},
								 {name:'customerStopsCount', label:"# Customer Stops > "+options.minCustomerStopMinutes+" min.", index:'customerStopsCount', width:80, sorttype:'int', convertor:"number"},
								 {name:'distance', label:'Distance', index:'distance', width:80, sorttype:'float', convertor:"distance"},
								 {name:'idlingDuration', label:'Idling', index:'idlingDuration', width:80, sorttype:'date', datefmt:ConverterAPI.timeFormatForGrid(), convertor:"duration"},
								 {name:'drivingDurationPercent', label:'Idling/Driving %', index:'drivingDurationPercent', width:80, sorttype:'float', convertor:"number"}
					]
				};
				return 	Reports[report];
		}
	}
};