﻿// JScript File
 var CarUserList={ children:[{
            text:'Активные',
            expanded:true,
            cls: 'folder',
            children:[]
        },{
            text:'Не активные',
            expanded:true,
            cls: 'folder',
            children:[]
        }]
    };
    
    CarUserList.Update= function(Json){
       for (var i=0; i<Json.length; i++) 
            this.children[0].children[i]=new MapsList(Json[i]);
    };

    MapsList=function(JsonMap){
       this.text='Карта-'+JsonMap.Maps;
       this.id='1-'+JsonMap.Maps;
       this.expanded=true;
       this.cls='maps',
       this.children=[];
       for (var j=0; j<JsonMap.Markers.length; j++)
            this.children[j] = new MapsChildrenList(JsonMap.Maps,JsonMap.Markers[j]);
    }
    
    MapsChildrenList=function(Map,JsonMapChild){
         this.id = '0-'+Map+'-'+JsonMapChild.CarId;
         this.text =JsonMapChild.title;
         this.iconCls = 'user';
         this.cls='file',
         this.leaf = true;
       };    
