var imei_tracking = "";
function tracking(imei){
	imei_tracking = imei;
	var obj = $('#modals_tracking');
	$("#imei_tracking").html(imei);
	 obj.modal(); 
	 
}
$("#modals_tracking").on("shown.bs.modal",function(){
	tk_initialize();
	tk_globalPlay();
})

$("#modals_tracking").on("hidden.bs.modal",function(){
	console.info("close modals tracking");
	tk_globalPause();
})
function path(imei){
	document.location = "replay.php?imei="+imei;
}

$("#id_search").on("submit",function(e){
	var frm = $("#id_search");
	g_monitor = false;
	g_monitor_devices = [];
	globalFunc_removeAllMarker();
	$('#tree_loader').html('<img src="media/icon/ajax_loader_blue_350.gif" height="50px" width="50px" align="center" />');
	e.preventDefault();
	 $.ajax({
         type: frm.attr('method'),
         url: frm.attr('action'),
         data: frm.serialize(),
         success: function (data) {
			  $('#tree_loader').html('');
	          tree = $.fn.zTree.init($("#customerTree"), setting, data);
	          tree = $.fn.zTree.getZTreeObj("customerTree");
         },
         error: function(data) {
        	 $('#tree_loader').html('<font color="red">Unable to load.</font>');
         }
     });
});