myApp.PostLight_win.addEventListener('pause', function(e) {
	    sensor.removeEventListener('update', myApp.LightSensorsCallback);
		});
	myApp.PostLight_win.addEventListener('resume', function(e) {
	    sensor.addEventListener('update', myApp.LightSensorsCallback);
		});
		"sensorInfo": {
			"sensorId": LightSensorID},
		"sensorData": {
		// the readings of the sensor
			"illumination": illumination,
			"Light_Time"  : Light_Time 
			}
	}};
	
	myApp.xhr.send(JSON.stringify(object));
}


///Light function
	var sensor = require('com.geraudbourdin.sensor');
	sensor.setSensor(sensor.TYPE_LIGHT);
	// set the callback function
	myApp.LightSensorsCallback = function(e) {
    if(e.sType == sensor.TYPE_LIGHT){
    	illumination = e.lux;
    	//alert(e.lux);
		}
	};
	myApp.PostLight_win.addEventListener('open', function(e) {
	   sensor.addEventListener('update', myApp.LightSensorsCallback);
		});
	
	myApp.PostLight_win.addEventListener('close', function() {
	    sensor.removeEventListener('update', myApp.LightSensorsCallback);
		});