$(window).bind('unload beforeunload',function() {
$.ajax({
	type: 'POST',
	url: '/controllers/update-dm.php',
	data: 'update=1&_i='+$('#q_i').val(),
	success: function(msg){
	}
});

});

