PageSourceSearch

https://eveeye.com/js/info.js?600003

js eveeye.com collected 2026-09-26 03:46:41 UTC 175,973 bytes, 2,567 lines download raw bytes

1// pi : Barren,Gas,Ice,Lava,Oceanic,Plasma,Storm,Temperate,Shattered
2// cel: Planets,Moons,Belts,Ice Anomalies,Stargates,Stations
3
4var ssinfoDebug = false;
5
6function getToprowSovInfo(ss,regionline) { //console.log('getToprowSovInfo',ss)
7
8    var txt = '';
9    var ptxt= '';
10    var col = '';
11    var pcol = '';
12    var img = '';
13
14    if (regionline) ss.sid=ss.rid;
15
16    if (APIdata_structures.systems[ss.sid]) {
17
18        // get solarsystem sov
19        if (ss.sid>30000000) {
20            try {  //quirksy errorcatching
21                if ( APIdata_alliances.alliances[APIdata_structures.systems[ss.sid].ihb_aid] ) {
22                        var txt = APIdata_alliances.alliances[APIdata_structures.systems[ss.sid].ihb_aid].name+' ';
23                        var ptxt='[ '+APIdata_alliances.alliances[APIdata_structures.systems[ss.sid].ihb_aid].shortName+' ] '
24
25                        var img = '<img src="https://images.evetech.net/alliances/'+APIdata_structures.systems[ss.sid].ihb_aid+'/logo?size=64" height="23" width="23" style="vertical-align:-38%;outline: 2px solid '+theme_main+';outline-offset: -2px;" title="'+txt+ptxt+'" alt="'+txt+ptxt+'">';
26
27                        var col = theme_grey_close;
28                        var txt = '<span class="toprow_sovinfo" style="color:'+col+';">'+txt+'</span> <span class="toprow_sovinfo" style="color:'+d3.rgb(col).darker(1)+';">'+ptxt+'</span>';
29                }
30            } catch(e) {}
31        // get regional sovereignty info
32        } else if (APIdata_structures.systems[ss.sid].sovholders == undefined) { 
33            // no sov holder: display nothing
34
35        } else if (APIdata_structures.systems[ss.sid].sovholders[0].percentage<33) { // not over a third of systems display
36
37            if (APIdata_alliances.alliances[APIdata_structures.systems[ss.sid].sovholders[0].aid] != undefined) {
38
39                var txt = APIdata_alliances.alliances[APIdata_structures.systems[ss.sid].sovholders[0].aid].name+' ';;
40
41                if (APIdata_alliances.alliances[APIdata_structures.systems[ss.sid].sovholders[0].aid].coalition != undefined) {
42                    txt += " [ " + contructCoalitionTicker(APIdata_coalitions.coalitions[APIdata_alliances.alliances[APIdata_structures.systems[ss.sid].sovholders[0].aid].coalition].name) + " ] "
43                }
44
45                ptxt='[ '+APIdata_alliances.alliances[APIdata_structures.systems[ss.sid].sovholders[0].aid].shortName+' ] '+APIdata_structures.systems[ss.sid].sovholders[0].count+'/'+APIdata_structures.systems[ss.sid].sovholders[0].total+' systems ('+APIdata_structures.systems[ss.sid].sovholders[0].percentage+'%) ';
46
47                var img = '<img src="https://images.evetech.net/alliances/'+APIdata_structures.systems[ss.sid].sovholders[0].aid+'/logo?size=64" height="23" width="23" style="vertical-align:-38%;outline: 2px solid '+theme_main+';outline-offset: -2px;" title="'+txt+ptxt+'" alt="'+txt+ptxt+'">';
48
49                var col = theme_grey_close;
50                var txt = '<span class="toprow_sovinfo" style="color:'+col+';">'+txt+'</span> <span class="toprow_sovinfo" style="color:'+d3.rgb(col).darker(1)+';">'+ptxt+'</span>';
51
52            } else {
53                //_paq.push(['trackEvent', 'Debug', 'alliances.name', 'aid', APIdata_structures.systems[ss.sid].sovholders[0].aid])
54            }
55        } else { // over a third of systems display
56
57            if (APIdata_alliances.alliances[APIdata_structures.systems[ss.sid].sovholders[0].aid] != undefined) {
58
59                var txt = APIdata_alliances.alliances[APIdata_structures.systems[ss.sid].sovholders[0].aid].name+' ';
60
61                if (APIdata_alliances.alliances[APIdata_structures.systems[ss.sid].sovholders[0].aid].coalition != undefined) {
62                    txt += " [ " + contructCoalitionTicker(APIdata_coalitions.coalitions[APIdata_alliances.alliances[APIdata_structures.systems[ss.sid].sovholders[0].aid].coalition].name) + " ] "
63                }
64
65                var col = sovColor(Number(APIdata_structures.systems[ss.sid].sovholders[0].aid));
66                if (!regionline) var col = theme_grey_close; // do not use colors, stay grey
67                //if (theme=='light') col = d3.rgb(col).darker(1);
68
69                ptxt='[ '+APIdata_alliances.alliances[APIdata_structures.systems[ss.sid].sovholders[0].aid].shortName+' ] '+APIdata_structures.systems[ss.sid].sovholders[0].count+'/'+APIdata_structures.systems[ss.sid].sovholders[0].total+' systems ('+APIdata_structures.systems[ss.sid].sovholders[0].percentage+'%) ';
70
71                var img = '<img src="https://images.evetech.net/alliances/'+APIdata_structures.systems[ss.sid].sovholders[0].aid+'/logo?size=64" height="23" width="23" style="vertical-align:-38%;outline: 2px solid '+theme_main+';outline-offset: -2px;" title="'+txt+ptxt+'" alt="'+txt+ptxt+'">';
72
73                var txt = '<span class="toprow_sovinfo" style="color:'+col+';">'+txt+'</span> <span class="toprow_sovinfo" style="color:'+d3.rgb(col).darker(1)+';">'+ptxt+'</span>';
74
75            } else {
76                //_paq.push(['trackEvent', 'Debug', 'alliances.name', 'aid', APIdata_structures.systems[ss.sid].sovholders[0].aid])
77            }
78        } 
79
80
81        if (tablet) {
82            return img+'&nbsp;&nbsp;'+txt;
83        } else {
84            return img;
85        }
86
87    } else {
88        return '';
89    }
90
91}
92
93function solarSystemInfo(id,from,force) { if (ssinfoDebug) console.log(from+' solarSystemInfo (funcCall) for '+id) 
94if (currentDisplayedSysID != id || force || from=='removeConnection' || from=='addConnection' || from=='sigs_parse' || from=='d3_draw' || from=='d3_draw_chain') {
95
96  
97if (id!=0 && id!=13000000) { // quirky exclusions
98
99    //if (devmode) ssinfoDebug = true;
100    
101    clearTimeout(showSolarSystemInfo_timeout);
102    showSolarSystemInfo_timeout = setTimeout(function() {
103
104        logg('solarSystemInfo ('+from+') executed:'+$('#ui-pane_1').is(":visible") +'/'+ id+'/'+manuallyChangedMapWhileInSync+'/'+ from)
105        //$('.toprow').css('background-color',theme_menu);
106        setUIcolor(theme_menu);
107        //if (fullscreenIphone) fullscreenIphone_setStatusBarColor(theme_menu,'wht');
108
109        //if ( findInSolarSystems('getSsRegionID',currentSelectedSysID) == currentMap && previousMap == currentMap || currentMap==12000001 || currentMap==12000002 ) {
110             if (!waitForAlternateMid && !waitForAlternateExit) updateJumpRangeDisplay(currentSelectedSysID,'solarSystemInfo');    
111             cloud_pilots_redraw(currentSharedLocations);
112        //}
113        if (previousMap != currentMap) previousMap = currentMap;
114
115        $('#ss_title_r').html('');
116
117        // --------------------------------------------------------
118        // --------------------------------------------------------
119        // No ID or special map ID passed
120
121        if (!$('#ui-pane_1').is(":visible") && inSync==false || id==undefined && characterLocationID==0 || id==0 && characterLocationID==0 || !$('#ui-pane_1').is(":visible") && manuallyChangedMapWhileInSync==true && currentMap!=10000000 || id==10000000 || id==12000001 || id==12000002 ) {
122
123            // NO SOLARSYSTEM ACTIVE
124            if (ssinfoDebug) console.log("case1")
125
126            currentDisplayedSysName = '';
127            currentDisplayedSysID = 0;
128            updateAddress();
129
130            var ss = findInSolarSystems('getSsObject', id);
131
132            //$('#ui-pane_1').is(":visible")==false && id==0
133            var factionImg=''
134            var antiFactionImg=''
135            var FWimg=''
136            var sovInfo='';
137            var locationInfo=''
138
139                if (sigmaMap) {  // Universe Map
140                    $('#title_tr').off("click");
141                    $('#title_tr').unbind();
142                    locationInfo='<span style="font-family:EEMfontLight" oncontextmenu="copyToClipboard(\''+currentMapName+'\',\'&quot;'+currentMapName+'&quot;\')">' + currentMapName +'</span>'
143                    antiFactionImg='' 
144                    FWimg=''
145
146                } else if (currentMap==12000001) { // FW CG
147                    $('#title_tr').off("click");
148                    $('#title_tr').unbind().click(function(){panTo()})
149
150                    locationInfo='<span style="font-family:EEMfontLight" oncontextmenu="copyToClipboard(\''+currentMapName+'\',\'&quot;'+currentMapName+'&quot;\')">' + currentMapName +'</span>';
151                    antiFactionImg='<img class="ui-ico-varia" src="img/faction/500001.png" height="23" width="23" style="vertical-align:-38%;" title="Caldari" alt="Caldari"><img class="ui-ico-varia" src="img/faction/500004.png" height="23" width="23" style="vertical-align:-38%;" title="Gallente" alt="Gallente">' 
152                    FWimg='<img class="ui-ico-varia" src="img/faction/fw.png" height="23" width="23" style="vertical-align:-38%;margin-right:1px;">'
153
154                } else if (currentMap==12000002) { // FW MA
155                    $('#title_tr').off("click");
156                    $('#title_tr').unbind().click(function(){panTo()})
157
158                    locationInfo='<span style="font-family:EEMfontLight" oncontextmenu="copyToClipboard(\''+currentMapName+'\',\'&quot;'+currentMapName+'&quot;\')">' + currentMapName +'</span>';
159                    antiFactionImg='<img class="ui-ico-varia" src="img/faction/500002.png" height="23" width="23" style="vertical-align:-38%;" title="Minmatar" alt="Minmatar"><img class="ui-ico-varia" src="img/faction/500003.png" height="23" width="23" style="vertical-align:-38%;" title="Amarr" alt="Amarr">' 
160                    FWimg='<img class="ui-ico-varia" src="img/faction/fw.png" height="23" width="23" style="vertical-align:-38%;margin-right:1px;">'
161
162                } else { // Normal regional map
163                    
164                    if (currentMapName=='Radar' || currentMapName=='Chain' || currentMapName=='Regions') {
165                        $('#title_tr').off("click")
166                        $('#title_tr').unbind().click(function(){panTo()})
167
168                    } else { 
169                        $('#title_tr').off("click")
170                        var rid = findInSolarSystems('getRnRegionID',currentMapName);
171                        $('#title_tr').unbind().click(function(){redrawMap(10000000,rid)})
172                    }
173                    if (currentMap > 10000000) {
174                        var ssr = buildNodeData(Number(currentMap));
175                        if (currentMap==10000070) ssr={"sec":-1.00};
176                        locationInfo='<span oncontextmenu="copyToClipboard(\''+currentMapName+'\',\'&quot;'+currentMapName+'&quot;\')"><span style="'+getSecTxtStyles(ssr.sec)+'">'+ secSan(ssr.sec) + '</span>' + '&nbsp;&nbsp;' + '<span style="font-family:EEMfontLight">' + currentMapName +'</span></span>';
177                    } else {
178                        locationInfo='<span style="font-family:EEMfontLight" oncontextmenu="copyToClipboard(\''+currentMapName+'\',\'&quot;'+currentMapName+'&quot;\')">' + currentMapName +'</span>';
179                    }
180                    if (currentMap==10000000 || currentMap==13000000) { //&& id!=10000000 && id!=undefined
181                        var fid = undefined;
182                        var afid = undefined;
183                    } else {
184                        var fid = getFactionID(currentMap)
185                        var afid = getAntiFactionID(currentMap)
186                    }
187                    // Images
188                    if (fid != undefined && afid != fid && fid!=0 ) {
189                        if (ss.fid==501618) { // Mordu and SOE Constellations Sov Region (own id creation)
190                            factionImg='<img class="ui-ico-varia" src="img/faction/500016.png" height="23" width="23" style="vertical-align:-38%;" title="SOE controlled constellation" alt="SOE controlled constellation"><img class="ui-ico-varia" src="img/faction/500018.png" height="23" width="23" style="vertical-align:-38%;" title="Mordu controlled constellation" alt="Mordu controlled constellation">'
191                            antiFactionImg='<img class="ui-ico-varia" src="img/faction/'+afid+'.png" height="23" width="23" style="vertical-align:-38%;" title="'+getFacName(afid)+' NPCs" alt="'+getFacName(afid)+' NPCs">'
192
193                        } else if (ss.cfid!=undefined) { //region with sovspace and faction space
194                            factionImg='<img class="ui-ico-varia" src="img/faction/'+ss.cfid+'.png" height="23" width="23" style="vertical-align:-38%;" title="'+getFacName(ss.cfid)+' controlled constellation" alt="'+getFacName(ss.cfid)+' controlled constellation">'
195                            antiFactionImg='<img class="ui-ico-varia" src="img/faction/'+afid+'.png" height="23" width="23" style="vertical-align:-38%;" title="'+getFacName(afid)+' NPCs" alt="'+getFacName(afid)+'  NPCs">'
196
197                        } else if (fid==500026 || fid==500027) { // Edencom / Trigalvian
198                            factionImg='<img src="img/faction/'+fid+'.png" height="23" width="23" style="vertical-align:-38%;" title="'+getFacName(fid)+'" alt="'+getFacName(fid)+'">'
199                            antiFactionImg='';//<img src="img/faction/'+afid+'.png" height="23" width="23" style="vertical-align:-38%;">
200
201                        } else { // normal
202                            factionImg='<img class="ui-ico-varia" src="img/faction/'+fid+'.png" height="23" width="23" style="vertical-align:-38%;" title="'+getFacName(fid)+' controlled" alt="'+getFacName(fid)+' controlled">'
203                            antiFactionImg='<img class="ui-ico-varia" src="img/faction/'+afid+'.png" height="23" width="23" style="vertical-align:-38%;" title="'+getFacName(afid)+' NPCs" alt="'+getFacName(afid)+' NPCs">'
204
205                        }
206                        sovInfo=getToprowSovInfo(ss);
207                    }
208                }
209
210            $('#ss_title').html(locationInfo);
211            if (tablet) $('#ss_title_r').html('&nbsp;' + FWimg + antiFactionImg + factionImg + sovInfo);
212
213            ui_pane_1_hide();
214            //if (tablet==false) $('#titleline').show(); 
215
216
217        // --------------------------------------------------------
218        // --------------------------------------------------------
219        // solarsystem or region ID passed
220
221        } else if (id!=0) {
222
223            var factionImg=''
224            var antiFactionImg=''
225            var FWimg=''
226            var sovInfo='';
227
228            if (ssinfoDebug) console.log("case2")
229
230            if (id==undefined && currentDisplayedSysID!=0 && currentDisplayedSysID!=undefined) {
231                id = currentDisplayedSysID;
232            } else if (id==undefined && characterLocationID!=0 || currentMap==10000000 && inSync && $('#ui-pane_1').css("display")=="none" || checkNodeOnMap(characterLocationID) && inSync && $('#ui-pane_1').css("display")=="none") {
233                id = characterLocationID;  //console.log("case3");  
234            }
235
236
237            if (id > 34000000 && id < 35000000) { if (ssinfoDebug) console.log("case34"); // Convergence Space
238
239                var factionImg ='';
240                $('#title_tr').off("click")                 
241                $('#title_tr').unbind().click(function(){panTo()})
242                if (tablet) $('#ss_title_r').html(factionImg);
243                locationInfo='<span style="'+getSecTxtStyles(-0.99)+'">' + '-0.99' + '</span>&nbsp;&nbsp;' + '<font color="'+colorSec(-0.66)+'">Convergence Space</font>';// + '&nbsp;'+sep+'&nbsp;&nbsp;' + ss.cn + '&nbsp;'+sep+'&nbsp;&nbsp;' + ss.rn +'</span>');
244                
245            } else if (id > 33000000 && id < 34000000) { if (ssinfoDebug) console.log("case33"); // Unknown Space
246
247                var factionImg = '';
248                $('#title_tr').off("click")                 
249                $('#title_tr').unbind().click(function(){panTo()})
250                if (tablet) $('#ss_title_r').html(factionImg);
251                locationInfo='<span style="'+getSecTxtStyles(-0.99)+'">' + '-0.99' + '</span>&nbsp;&nbsp;' + '<font color="'+colorSec(-0.66)+'">Unknown Space</font>';// + '&nbsp;'+sep+'&nbsp;&nbsp;' + ss.cn + '&nbsp;'+sep+'&nbsp;&nbsp;' + ss.rn +'</span>');
252
253            } else if (id > 32000000) { if (ssinfoDebug) console.log("case32"); // Abyssal System
254
255                var factionImg ='<img src="img/faction/500026.png" height="23" width="23" style="vertical-align:-38%;">'
256                $('#title_tr').off("click")                 
257                $('#title_tr').unbind().click(function(){panTo()})
258                if (tablet) $('#ss_title_r').html(factionImg);
259                locationInfo='<span style="'+getSecTxtStyles(-0.99)+'">' + '-0.99' + '</span>&nbsp;&nbsp;' + '<font color="'+colorSec(-0.66)+'">Abyssal Deadspace</font>';// + '&nbsp;'+sep+'&nbsp;&nbsp;' + ss.cn + '&nbsp;'+sep+'&nbsp;&nbsp;' + ss.rn +'</span>');
260
261            } else { if (ssinfoDebug) console.log("case4: "+id); // K-Space and W-Space System
262
263                $('#title_tr').off("click");
264                if (characterLocationID<32000000) abyssmark(id,false);
265
266                var ss = buildNodeData(Number(id));//findInSolarSystems('getSsObject',id);
267                //console.log (ss);
268                var jadd=''
269                var phe=''
270                var clsadd=''
271                var factionImg=''
272                var antiFactionImg=''
273                var sovInfo = ''
274                var locationInfo = ''
275                var invasion_add = ''
276                var FWimg=''
277                var sep='&#12296;'//&sdot;&#9666;10092,10094,10096,10216,10641,10633,10748,12296
278                // location
279                var locImg = '';
280                /* var locImg = ""
281                if ( inSync==true ) {
282                    var locImg = '<img src="img/icons/Marker-100_off.png" height="23" width="23" style="vertical-align:-38%;">&nbsp;'
283                    if (characterLocationID==id) locImg='<img src="img/icons/Marker-100_on.png" height="23" width="23" style="vertical-align:-38%;">&nbsp;'
284                }*/
285
286                if ($('#ui-pane_1').css("display") != "none") {
287                    currentDisplayedSysName = ss.sn;
288                    currentDisplayedSysID = id;
289                } else {
290                    currentDisplayedSysName = '';
291                    currentDisplayedSysID = 0;
292                }
293                updateAddress();
294
295                if (ss.sid>31000000) { // -------------- W-Space System
296
297                    if (ssinfoDebug) console.log("case4w"); 
298                    
299                    //$('#tab_ss_ss').html('WH')
300                    for (var i = 0; i < ss.statics.length; i++) {
301                        var col=colorClassTxt(ss.statics[i].class);
302                        if ( ss.statics[i].class==7 && jadd.indexOf('High ')==-1) { jadd += '<span style="font-family:EEMfont;color:'+col+'">High</span> '}
303                        else if ( ss.statics[i].class==8 && jadd.indexOf('Low ')==-1) { jadd += '<span style="font-family:EEMfont;color:'+col+'">Low</span> ' }
304                        else if ( ss.statics[i].class==9 && jadd.indexOf('Null ')==-1) { jadd += '<span style="font-family:EEMfont;color:'+col+'">Null</span> ' }
305                        else if ( ss.statics[i].class<7 && jadd.indexOf('C'+ss.statics[i].class+' ')==-1 ) { jadd += '<span style="font-family:EEMfont;color:'+col+'">C'+ss.statics[i].class+'</span> ' }
306                    }
307                    if (jadd != '') jadd = '&nbsp;&nbsp;' + 'Static ' + jadd
308                    if (ss.phe!=undefined && ss.class==13) phe = '&nbsp;&nbsp;C6 '+ss.phe
309                    if (ss.phe!=undefined && ss.class!=13) phe = '&nbsp;&nbsp;'+ss.phe    
310                    clsadd = '<font color="'+colorClassTxt(ss.class)+'">C'+ss.class + '</font>'   
311                    $('#ss_title_r').empty();
312                    $('#title_tr').off("click")                 
313                    $('#title_tr').unbind().click(function(){panTo()})
314                    locationInfo='<span oncontextmenu="copyToClipboard(\''+ss.sn+'\',\'&quot;'+ss.sn+'&quot;\')">'+locImg + clsadd + '&nbsp;&nbsp;' + ss.sn + '<span style="font-family:EEMfontLight">' + '&nbsp;'+sep+'&nbsp;&nbsp;' + ss.cn + '&nbsp;'+sep+'&nbsp;&nbsp;' + ss.rn +'</span></span></span>';//+'>span // + phe + jadd
315                    //style="font-family:EEMfontLight">' + ss.d + 'au</span>&nbsp;&nbsp;'
316
317                } else { // ----------------- K-Space Systems and K + W-Space Regions
318                    
319                    if (ssinfoDebug) console.log("case4b");
320
321                    var ssrid = ss.rid
322
323                    if (ss.fw==true) { // FW System
324
325                        if (ssinfoDebug) console.log("case4b1");
326
327                        FWimg='<img class="ui-ico-varia" src="img/faction/fw.png" height="23" width="23" style="vertical-align:-38%;margin-right:1px;" title="Faction Warfare System" alt="Faction Warfare System">'
328                        if (ss.fid==500026 || ss.fid==500027) {
329                            factionImg='<img src="img/faction/'+ss.fid+'.png" height="23" width="23" style="vertical-align:-38%;" title="'+getFacName(ss.fid)+'" alt="'+getFacName(ss.fid)+'">'      
330                        } else {
331                            factionImg='<img class="ui-ico-varia" src="img/faction/'+ss.fid+'.png" height="23" width="23" style="vertical-align:-38%;" title="'+getFacName(ss.fid)+'" alt="'+getFacName(ss.fid)+'">' 
332                        } 
333                        if (ss.fid == 500001) factionImg+='<img class="ui-ico-varia" src="img/faction/500004.png" height="23" width="23" style="vertical-align:-38%;" title="Gallente" alt="Gallente">' 
334                        if (ss.fid == 500004) factionImg+='<img class="ui-ico-varia" src="img/faction/500001.png" height="23" width="23" style="vertical-align:-38%;" title="Caldari" alt="Caldari">'
335                        if (ss.fid == 500002) factionImg+='<img class="ui-ico-varia" src="img/faction/500003.png" height="23" width="23" style="vertical-align:-38%;" title="Amarr" alt="Amarr">'
336                        if (ss.fid == 500003) factionImg+='<img class="ui-ico-varia" src="img/faction/500002.png" height="23" width="23" style="vertical-align:-38%;" title="Minmatar" alt="Minmatar">'
337
338                        antiFactionImg = '';
339
340                    } else { // all other Systems or Regions
341
342                        if (ssinfoDebug) console.log("case4b2");
343
344                        if (ss.rid==10000000) ssrid=ss.sid;
345
346                        if (ssinfoDebug) console.log ("ssrid: "+ssrid);
347
348                        // Faction Image
349                        if (ss.fid!=undefined && Number(getAntiFactionID(ssrid))!=Number(ss.fid) ) { 
350                            if (ss.fid == 501618) {
351                                factionImg ='<img class="ui-ico-varia" src="img/faction/500016.png" height="23" width="23" style="vertical-align:-38%;" title="SOE controlled constellation" alt="Sisters of Eve controlled constellation"><img src="img/faction/500018.png" height="23" width="23" style="vertical-align:-38%;" title="Mordu controlled constellation">' 
352                                sovInfo = getToprowSovInfo(ss);
353
354                            } else {
355                                
356                                var fid=ss.fid
357                                if (APIdata_incursions.systems[ss.sid] != undefined) {
358
359                                    if (ssinfoDebug) console.log("case4b2a");
360
361                                    if (APIdata_incursions.systems[ss.sid].invasion_state != undefined) {
362                                        var fid = getFactionID(ss.rid)
363                                        if (fid==500026 || fid==500027) {
364                                            factionImg ='<img src="img/faction/'+fid+'.png" height="23" width="23" style="vertical-align:-38%;" title="'+getFacName(fid)+'" alt="'+getFacName(fid)+'">';
365
366                                        } else {
367                                            factionImg ='<img class="ui-ico-varia" src="img/faction/'+fid+'.png" height="23" width="23" style="vertical-align:-38%;" title="'+getFacName(fid)+' controlled" alt="'+getFacName(fid)+' controlled">' 
368                                        }
369                                    }
370                                } else {
371                                    if (ssinfoDebug) console.log("case4b3");
372                                    if (ss.fid==500026 || ss.fid==500027) {
373                                        factionImg ='<img src="img/faction/'+ss.fid+'.png" height="23" width="23" style="vertical-align:-38%;" title="'+getFacName(ss.fid)+'" alt="'+getFacName(ss.fid)+'">';
374                                    } else {
375                                        factionImg ='<img class="ui-ico-varia" src="img/faction/'+ss.fid+'.png" height="23" width="23" style="vertical-align:-38%;" title="'+getFacName(ss.fid)+'" alt="'+getFacName(ss.fid)+'">';
376                                    }
377                                }
378                                sovInfo = '&nbsp;'+'<span class="toprow_sovinfo" style="color:'+theme_grey_close+';">'+getFacName(ss.fid)+'</span>';
379                            }
380
381                        // Alliance Image
382                        } else if (Number(getAntiFactionID(ssrid))!=Number(ss.fid)) {
383                            //if (ssinfoDebug) console.log("case4b4");
384                            sovInfo=getToprowSovInfo(ss);
385                        }
386
387                    }
388
389                    // Sovereign alliance
390                    if (ss.cfid!=undefined && ss.fid != 501618) sovInfo=getToprowSovInfo(ss);
391
392                    if (ssinfoDebug) console.log ("ssrid2: "+ssrid);
393                    var afid = getAntiFactionID(ssrid);
394                    if (ssinfoDebug) console.log ("afid2: "+afid);
395
396                    if (afid==500026 || afid==500027) {
397                        if (ssinfoDebug) console.log("case4b5a");
398                        antiFactionImg='';//'<img class="ui-ico-varia" src="img/faction/'+afid+'.png" height="23" width="23" style="vertical-align:-38%;" title="'+getFacName(fid)+' controlled" alt="'+getFacName(fid)+' controlled">'
399                    } else {
400                        if (ssinfoDebug) console.log("case4b5b");
401                        antiFactionImg='<img class="ui-ico-varia" src="img/faction/'+afid+'.png" height="23" width="23" style="vertical-align:-38%;" title="'+getFacName(afid)+' NPCs" alt="'+getFacName(afid)+' NPCs">' 
402                        if (ss.cfid!=undefined && ss.fid != 501618) {
403                            antiFactionImg = antiFactionImg+'<img class="ui-ico-varia" src="img/faction/'+afid+'.png" height="23" width="23" style="vertical-align:-38%;" title="'+getFacName(afid)+' NPCs" alt="'+getFacName(afid)+' NPCs">' 
404                        }
405                    }
406
407                    // Incursion
408                    //var incadd=''
409                    //if (APIdata_incursions.systems[ss.sid].incursion != undefined) incadd = '<span style="font-size:0.9rem;font-family:EEMfontLight;color:'+colorFac(APIdata_incursions.systems[ss.sid].incursion)+'">INCURSION</span> '
410                    //console.log(APIdata_incursions.systems[ss.sid])
411
412                    // Incursion
413                    var incursioned = false;
414                    var invasion_pic = '';
415                    if (APIdata_incursions.systems[ss.sid] != undefined && id>30000000) {
416                        if (APIdata_incursions.systems[ss.sid].incursion != undefined && APIdata_incursions.systems[ss.sid].invasion_state == undefined) { 
417                            if (ssinfoDebug) console.log ("Invasions1"); 
418                            var col = d3.rgb(colorFac(APIdata_incursions.systems[ss.sid].incursion)).darker(4).formatHex();
419                            //col = 'rgb('+col.r.toFixed(0)+','+col.g.toFixed(0)+','+col.b.toFixed(0)+')'
420                            var afidn = getFacName(APIdata_incursions.systems[ss.sid].incursion);
421                            antiFactionImg='<img src="img/faction/'+APIdata_incursions.systems[ss.sid].incursion+'.png" height="23" width="23" style="vertical-align:-38%;" title="'+afidn+'" alt="'+afidn+'">' 
422                            //$('.toprow').css('background-color',col) 
423                            setUIcolor(col);
424                            //if (fullscreenIphone) fullscreenIphone_setStatusBarColor(col,'wht');
425                            incursioned = col;
426                            if (APIdata_incursions.systems[ss.sid].incursion==500019) invasion_pic = '<img src="img/icon/incursion_500019.png" title="Sansha Incursion" alt="Sansha Incursion" height="23" width="23" style="vertical-align:-38%;padding-top:1px;margin-right:8px;">';
427                        } else {
428                            //$('.toprow').css('background-color', theme_menu)
429                            setUIcolor(theme_menu);
430                            //if (fullscreenIphone) fullscreenIphone_setStatusBarColor(theme_menu,'wht');
431                        }
432
433                    } else {
434                        //$('.toprow').css('background-color',theme_menu)
435                        setUIcolor(theme_menu);
436                        //if (fullscreenIphone) fullscreenIphone_setStatusBarColor(theme_menu,'wht');
437                    }
438
439
440                    // Region Map toprow html
441                    if (currentMap == 10000000 && id<30000000) { if (ssinfoDebug) console.log ("case6"); 
442                        $('#title_tr').off("click");
443                        $('#gotoRegion').attr('s',''); 
444                        updateAddress();
445                        $('#title_tr').unbind().click(function(){panTo(id)})
446                        var fid = getFactionID(id)
447                        var afid = getAntiFactionID(id)
448                        if (ssinfoDebug) console.log ("afid: "+afid); 
449                        if (fid != undefined && afid != fid && fid!=0 ) {
450                            if (fid==500026 || fid==500027) {
451                                factionImg='<img src="img/faction/'+fid+'.png" height="23" width="23" style="vertical-align:-38%;" title="'+getFacName(fid)+'" alt="'+getFacName(fid)+'">'
452                                antiFactionImg=''; 
453                            } else {
454                                factionImg='<img class="ui-ico-varia" src="img/faction/'+fid+'.png" height="23" width="23" style="vertical-align:-38%;" title="'+getFacName(fid)+' controlled" alt="'+getFacName(fid)+' controlled">'
455                                antiFactionImg='<img class="ui-ico-varia" src="img/faction/'+afid+'.png" height="23" width="23" style="vertical-align:-38%;" title="'+getFacName(afid)+' NPCs" alt="'+getFacName(afid)+' NPCs">'
456                            }
457                        }
458                        var toF = 3;
459                        if (currentMap==10000000) toF = 1;
460                        locationInfo='<span oncontextmenu="copyToClipboard(\''+ss.sn+'\',\'&quot;'+ss.sn+'&quot;\')">'+locImg+'<span style="'+getSecTxtStyles(ss.sec)+'">'+ (Math.floor(ss.sec*1000)/1000).toFixed(toF) + '</span>' + '&nbsp;&nbsp;' + ss.sn + '<span style="font-family:EEMfontLight">'+''+'</span></span>'; // ' + '&nbsp;'+sep+'&nbsp;&nbsp;' + ss.rn +'</span></span>'
461
462
463                    // Solarsystem Map toprow html
464                    } else {
465                        $('#title_tr').off("click");
466
467                        // region toprow location tracking on
468                        if (currentMap == 10000000 && inSync) {  if (ssinfoDebug) console.log ("case7a"); 
469
470                             locationInfo='<span oncontextmenu="copyToClipboard(\''+ss.sn+'\',\'&quot;'+ss.sn+'&quot;\')"><span onClick="redrawMap('+ss.rid+','+ss.sid+')">'+locImg+'<span style="'+getSecTxtStyles(ss.sec)+'">'+ (Math.floor(ss.sec*1000)/1000).toFixed(2) + '</span>' + '&nbsp;&nbsp;' + ss.sn + '<span style="font-family:EEMfontLight">' + '&nbsp;'+sep+'&nbsp;&nbsp;' + ss.cn + '&nbsp;</span></span>'+sep+'&nbsp;<span onClick="panTo('+ss.rid+')" style="font-family:EEMfontLight">&nbsp;' + ss.rn +'</span></span>';  //
471
472                        // region toprow
473                        } else if (id < 20000000) { if (ssinfoDebug) console.log ("case7b"); 
474
475                        locationInfo='<span oncontextmenu="copyToClipboard(\''+ss.sn+'\',\'&quot;'+ss.sn+'&quot;\')"><span onClick="redrawMap('+ss.rid+')">'+locImg+'<span style="'+getSecTxtStyles(ss.sec)+'">'+ secSan(ss.sec) + '</span>' + '&nbsp;&nbsp;' + ss.sn + '<span style="font-family:EEMfontLight"></span></span>'; // ' + '&nbsp;'+sep+'&nbsp;<span onClick="panTo('+ss.rid+')" style="font-family:EEMfontLight">&nbsp;' + ss.rn +'</span></span>';
476
477                        // solarsystem toprow 
478                        } else { if (ssinfoDebug) console.log ("case7c");  
479                            var sec = '<span style="'+getSecTxtStyles(ss.sec)+'">'+ (Math.floor(ss.sec*1000)/1000).toFixed(3) + '</span>';
480                            if (APIdata_incursions.systems[id] != undefined) {
481                                if (APIdata_incursions.systems[id].invasion_state != undefined) {
482                                    var invasion_state = APIdata_incursions.systems[id].invasion_state;
483                                    if (invasion_state>-4 && invasion_state<0) sec = '<img src="img/icon/lim'+invasion_state+'.png" height="23" width="23" style="vertical-align:-38%;">';
484                                }
485                            }
486                            locationInfo='<span oncontextmenu="copyToClipboard(\''+ss.sn+'\',\'&quot;'+ss.sn+'&quot;\')"><span onClick="panTo('+ss.sid+')">'+locImg + sec + '&nbsp;&nbsp;' + ss.sn + '<span style="font-family:EEMfontLight">' + '&nbsp;'+sep+'&nbsp;&nbsp;' + ss.cn + '&nbsp;</span></span>'+sep+'&nbsp;<span onClick="redrawMap(10000000,'+ss.rid+')" style="font-family:EEMfontLight">
486&nbsp;' + ss.rn +'</span></span>';   
487                        }
488
489                    }
490
491                    // Invasions 
492                    var cel_inv='';
493                    var invasion_add = '';
494                    var invasion_btn = '';
495                    if (APIdata_incursions.systems[ss.sid] != undefined && incursioned==false) { 
496                        if (APIdata_incursions.systems[ss.sid].invasion_state != undefined) { if (ssinfoDebug) console.log ("Invasions2"); 
497                            var state = APIdata_incursions.systems[ss.sid].invasion_state;
498                            var invasion = APIdata_incursions.systems[ss.sid].invasion;
499                            if (invasion == null) invasion = 500027;
500                            var col = d3.rgb(colorFac(invasion)).darker(4).formatHex();
501                            //col = 'rgb('+col.r.toFixed(0)+','+col.g.toFixed(0)+','+col.b.toFixed(0)+')'
502                            //antiFactionImg='<img src="img/faction/'+APIdata_fw.systems[ss.sid].invasion+'.png" height="23" width="23" style="vertical-align:-38%;">' 
503                            //$('.toprow').css('background-color',col)
504                            setUIcolor(col);
505                            //if (fullscreenIphone) fullscreenIphone_setStatusBarColor(col,'wht');
506                            var Iimg='';
507                            var Timg = '<img src="img/faction/500026.png" height="23" width="23" style="vertical-align:-38%;" title="Triglavian" alt="Triglavian">';
508                            var Eimg = '<img src="img/faction/500027.png" height="23" width="23" style="vertical-align:-38%;" title="Edencom" alt="Edencom">';
509                            // invasion_add = inv_states(state);
510                            if (state==-5) {invasion_add='Massive Triglavian Invasion';Iimg=Timg}//ss.sec=-1;}
511                            if (state==-4) {invasion_add='Triglavian Minor Victory';Iimg=Timg}//ss.sec=-1;}
512                            if (state==-3) {invasion_add='Final Liminality';Iimg=Timg;}//ss.sec=-1;}
513                            if (state==-2) {invasion_add='Second Liminality';Iimg=Timg;antiFactionImg=Eimg}//ss.sec=ss.sec-0.3;}
514                            if (state==-1) {invasion_add='First Liminality';Iimg=Timg;antiFactionImg=Eimg}//ss.sec=ss.sec-0.3;}
515                            if (state== 0) {invasion_add='Stellar Reconnaissance';Iimg=Eimg;antiFactionImg=Timg}
516                            if (state== 1) {invasion_add='EDENCOM Redoubt';Iimg=Eimg;antiFactionImg=Timg}
517                            if (state== 2) {invasion_add='EDENCOM Bulwark';Iimg=Eimg;antiFactionImg=Timg}
518                            if (state== 3) {invasion_add='EDENCOM Fortress';Iimg=Eimg}
519                            if (state== 4) {invasion_add='EDENCOM Minor Victory';Iimg=Eimg}
520                            if (state== 5) {invasion_add='Massive EDENCOM Fortification';Iimg=Eimg}
521                            cel_inv = invasion_add;
522                            var va = '-21%';
523                            if (!tablet) va = 'middle';
524                            invasion_pic = '<img src="img/icon/invstate_'+state+'.png" title="'+invasion_add+'" height="23" width="23" style="vertical-align:'+va+';padding-top:1px;margin-right:8px;">';
525                            FWimg='';
526                            invasion_add = Iimg + '&nbsp;<span style="font-size:1.25rem;font-family:EEMfontLight;color:'+colorFac(invasion)+'">' +invasion_add+ '</span>'
527                        } else {
528                            //$('.toprow').css('background-color', theme_menu)
529                            setUIcolor(theme_menu);
530                            //if (fullscreenIphone) fullscreenIphone_setStatusBarColor(theme_menu,'wht');
531                        }
532                    
533                    } else if (incursioned!=false) {
534                        //$('.toprow').css('background-color',incursioned)
535                        setUIcolor(incursioned);
536                        //if (fullscreenIphone) fullscreenIphone_setStatusBarColor(incursioned,'wht');
537                    
538                    } else {
539                        //$('.toprow').css('background-color',theme_menu) 
540                        setUIcolor(theme_menu);
541                        //if (fullscreenIphone) fullscreenIphone_setStatusBarColor(theme_menu,'wht');
542                    }
543
544                    var invasioned=false
545                    if (APIdata_incursions.systems[ss.sid] != undefined) if (APIdata_incursions.systems[ss.sid].invasion_state != undefined) invasioned=true;
546                    
547                    // Reporting Button html (disabled)
548                    if (tablet) {}
549                    if (characterID!=0 && cloudEnabled && incursioned==false || characterID!=0 && cloudEnabled && invasioned) {
550                        // || invasion_add!='' && ss.sid>30000000 
551                        if (ss.sec>0 && ss.sid>30000000 || invasioned) invasion_btn = '<button type="button" class="btn_report"  onClick="report_invasion_start('+ss.sid+',\''+ss.sn+'\');">REPORT INVASION STATE</button>'
552                    }
553                    
554                }
555
556                $('#ss_title').html(locationInfo);
557
558                $('#ss_title_r').html('');
559                $('#ss_title_inv').html('');
560                if (tablet) {
561                    $('#ss_title_r').html('&nbsp;' + FWimg + antiFactionImg + factionImg + invasion_add + sovInfo); // + invasion_btn (disabled)
562                } else {
563                    $('#ss_title_inv').html(invasion_pic);
564                }
565
566                //ads
567                //placeAd();
568
569                selectSystem(ss,true,12);
570
571                // populate info pane
572                if (!eeechoes) {
573                    //SSI_agt(ss.sid,ss.sn);
574                    getPI(ss.sid,ss.pi,ss);
575                    SSI_int(id);
576                } else {
577                    SSI_plp(ss);
578                }
579
580                SSI_sig(ss.sid);
581                SSI_cel(ss,cel_inv,invasion);
582                SSI_sta(ss);
583
584                //WH/WEA
585                $('#ss_W_selection').empty();
586                $('#ss_W_selection').append(SSheadlineHTML('ENVIRONMENT',2));
587                if (ss.sid>31000000) {
588                    SSI_wh(id,ss);
589                } else if (ss.sid>10000000 && ss.sid<30000000) {
590                    checkEffects(ss);
591                    //$('#ss_W_selection').append('<tr><td class="td_ss_info" valign="top" colspan="2"><font color="'+lightgrey+'">No info available at regions</font></td></tr><tr colspan="2" height="4"><td></td></tr>');
592                } else {
593                    checkEffects(ss);
594                    // if (ss.rid==10000070) SSI_pwh(id); // would show possible wormholes in k-space ENV
595                    // SSI_pwh(id);
596                }
597
598                SSI_sov(id,ss);
599                SSI_hub(ss.sid,0);
600                //SSI_kil(ss.sid);
601                SSI_dbs(ss.sid);
602                if ($('#tab_T_ss').hasClass('tab_ss_on')==true) SSI_txt(ss.sid);
603
604                setActiveList('stc_pwh',true);
605
606                // quirky open tabs if selected
607                var tabs = ['W','C','P','N','A','H','K','S','E','D','X'];
608                for (var t in tabs) if ($('#tab_'+tabs[t]+'_ss').hasClass('tab_ss_on')) $('#ss_'+tabs[t]+'_selection').show();
609
610                //ui
611                //if (ss.sid<31000000) $('#tab_W_ss').html('ENV');
612                //if (ss.sid>31000000) $('#tab_W_ss').html('ENV');
613
614            }
615
616            // zkb -------------------------------------- <<<<<<<<<<<<<< removed for 1.4.3 fix version, reenable after release
617            //$('#ss_K_selection').empty();
618            //getSSkills(ss.sid)
619
620        }
621        if (theme=='light') $('.ui-ico-varia').css('filter','invert(1)');
622    },100); 
623  } 
624} 
625}
626
627function SSI_cel(ss,invasion_add,invasion) { 
628
629    /*
630    cel
631    solarsystem
632        0 planets
633        1 moons
634        2 belts
635        3 ice
636        4 gates
637        5 stations
638    region
639        6 solarsystems
640        7 constellations
641    ext
642        0 cosmos constellations
643        1 booster type
644        2 agents in space
645        3 jove obervatories
646    */
647
648    if (ss!=false) { /// <<<<<<<<<<<< why ???
649    
650    if (ss.sid == 12000001 || ss.sid == 12000002) {
651        
652        //$('#ss_C_selection').append('<tr><td class="td_ss_info" valign="top" colspan="2"><font color="'+lightgrey+'">No special info available</font></td></tr>');
653                
654    } else {
655    
656        $('.hl_C_selection').remove();
657        $('#ss_C_selection').prepend(SSheadlineHTML('CELESTIALS',4,'hl_C_selection')) 
658        
659        //// SUN
660        if (ss.sid > 30000000) {
661            if (ss.sun) {
662                if (theme=='light') {
663                    $('.ss_sun').css("color", d3.rgb(sunSpec[ss.sun].hex).darker(1).formatHex() );
664                } else {
665                    $('.ss_sun').css("color", d3.rgb(sunSpec[ss.sun].hex).formatHex() );
666                }
667                $('#ss_cel_sun_num').html('&nbsp;'+sunSpec[ss.sun].short+'&nbsp;&nbsp;'); 
668                var sun = sunSpec[ss.sun];
669                if (!eeechoes && ss.rid==10000070) {
670                    if (sun.short=="G5") sun.name="G5 (Gold Immanence)";
671                    if (sun.short=="B0") sun.name="B0 (Fruitful Immanence)";
672                    if (sun.short=="O1") sun.name="O1 (Divine Immanence)";
673                    if (sun.short=="A0") sun.name="A0 (Glory Immanence)";
674                }
675                var nom = sun.name.replace(sun.short+' ','').replace('(','').replace(')','')
676                $('#ss_cel_sun_txt').html(nom+' Sun');
677            }
678        } else {
679            $('.ss_sun').css("color", theme_main_txt )
680            $('#ss_cel_sun_num').html('&nbsp;&nbsp;&nbsp;'); 
681            $('#ss_cel_sun_txt').html('Region Statistics');
682        }
683
684        //SECC
685        if (ss.secc!=undefined && ss.secc!=0) {
686            $('#ss_cel_secc').show();
687            $('.ss_secc').css("color",secClassCol(ss.secc));
688            $('#ss_cel_secc_num').html('&nbsp;'+ss.secc+'&nbsp;&nbsp;');
689            $('#ss_cel_secc_txt').html('Security Class&nbsp;&nbsp;'); 
690        } else {
691            $('#ss_cel_secc').show();
692            $('.ss_secc').css("color","var(--col-txt-2)");
693            $('#ss_cel_secc_num').html('&nbsp;&nbsp;&nbsp;');
694            $('#ss_cel_secc_txt').html('Security class unknown&nbsp;&nbsp;');
695        }
696        if (ss.sid<30000000) $('#ss_cel_secc').hide();
697    
698        //// Planets,Moons,Belts,Ice Anomalies,Stargates,Stations,Solarsystems,Constellations
699        //if (ss.cel==undefined) ss.cel=["n/a","n/a","n/a","n/a","n/a","n/a","n/a","n/a"];
700        if (ss.d != undefined) {
701            $('#ss_cel_dia_num').html('&nbsp;'+ss.d.toFixed(0)+'&nbsp;&nbsp;');
702            $('#ss_cel_dia_txt').html('au Diameter'); 
703        } else {
704            $('#ss_cel_dia_num').html('&nbsp;'+ss.cel[6]+'&nbsp;&nbsp;');
705            $('#ss_cel_dia_txt').html('Systems&nbsp;in&nbsp;&nbsp;'+ss.cel[7]+'&nbsp;&nbsp;Constellations'); 
706        }
707        if (ss.cel[0]==0) { 
708            $('.ss_pla').css("color","var(--col-txt-2)") 
709        } else { 
710            $('.ss_pla').css("color","var(--col-txt)") 
711        }
712        $('#ss_cel_pla_num').html('&nbsp;'+ss.cel[0]+'&nbsp;&nbsp;'); 
713        $('#ss_cel_pla_txt').html('Planets');
714        if (ss.cel[1]==0) { 
715            $('.ss_moo').css("color","var(--col-txt-2)") 
716        } else { 
717            $('.ss_moo').css("color","var(--col-txt)") 
718        }
719        $('#ss_cel_moo_num').html('&nbsp;'+ss.cel[1]+'&nbsp;&nbsp;');     
720        $('#ss_cel_moo_txt').html('Moons');
721        //stations and outposts
722        $('.ss_sta').css("color","var(--col-txt-2)")
723        $('#ss_cel_sta_txt').html('Stations') //NPC Stations
724        var stas = ss.cel[5]
725        if (ss.cel[5]==0) { 
726            $('.ss_sta').css("color",lightgrey) 
727        } else { 
728            $('.ss_sta').css("color","var(--col-txt)") 
729        }
730        if ( ss.stasrv != undefined && ss.sta==undefined) {
731            $('#ss_cel_sta_txt').html('Conquerable Station') 
732            stas=1;
733        } else if (stas==0){ 
734            $('#ss_cel_sta_txt').html('Stations') 
735        }
736        $('#ss_cel_sta_num').html('&nbsp;'+stas+'&nbsp;&nbsp;');   
737        //
738        if (ss.cel[2]==0) { 
739            $('.ss_blt').css("color","var(--col-txt-2)") 
740        } else { 
741            $('.ss_blt').css("color","var(--col-txt)") 
742        }
743        $('#ss_cel_blt_num').html('&nbsp;'+ss.cel[2]+'&nbsp;&nbsp;');    
744        $('#ss_cel_blt_txt').html('Asteroid Belts');
745        //
746        if (ss.cel[3]==0) { 
747            $('.ss_ice').css("color",lightgrey) 
748        } else { 
749            $('.ss_ice').css("color","var(--col-txt)") 
750        }
751        $('#ss_cel_ice_num').html('&nbsp;'+ss.cel[3]+'&nbsp;&nbsp;');
752        if (currentMap==10000000 || ss.sid<20000000) {
753            $('#ss_cel_ice_txt').html('Ice Systems');
754        } else {
755            $('#ss_cel_ice_txt').html('Ice Anomalies');
756        }
757    }
758}
759
760};
761
762function SSI_int(id) {
763
764
765    //if (currentMap!=10000000) { // do not show on region map at all aslong as there is no data
766
767
768        if( id < 30000000 ) {
769            $('#ss_K_selection').empty();
770            $('#ss_K_selection').append(SSheadlineHTML('ACTIVITY GRAPH',2,'hl_K_selection'))   
771            $('#ss_K_selection').append('<tr><td id="td_intel" class="td_ss_info" ><font color="'+lightgrey+'">Chart not available for regions.</font></td></tr><tr colspan="1" height="4"><td></td></tr>');
772        } else {
773            //$('#ss_K_selection').append('<tr><td height="170" width="1"> </td><td id="td_intel" class="td_ss_info" width="100%"><div class="chart-container" style="position: relative; height:170px; width:100%">
773<canvas id="chart_canvas"></canvas></div></td></tr>');
774            
775            // moved to charts.js
776            
777            // with table upfront $('#ss_K_selection').append('<tr><td><table style="margin-top:-30px;overflow:hidden;"><tr height="30"><td>&nbsp;</td><td rowspan="6" id="td_intel" width="100%"></td></tr><tr><td class="verttd" width="0" style="background-color:var(--col-kills-rgba);"><div class="vertxt" style="color:var(--col-kills)">SHIP</div></td></tr><tr><td class="verttd" style="background-color:var(--col-pods-rgba)"><div class="vertxt" style="color:var(--col-pods)">POD</div></td></tr><tr><td class="verttd" style="background-color:var(--col-npcs-rgba)"><div class="vertxt" style="color:var(--col-npcs)">NPC</div></td></tr><tr><td class="verttd" style="background-color:var(--col-jumps-rgba)"><div class="vertxt" style="color:var(--col-jumps)">JUMP</div></td></tr><tr height="30"><td>&nbsp;</td></tr></table></td></tr>');
778            updateACT(id);
779            //$('#ss_K_selection').append('<tr colspan="1" height="4"><td></td></tr>');
780        };
781        
782   // };
783}
784
785function SSI_wh(id,ss,returnit) {
786    
787    if (ss.statics==undefined) ss=buildNodeData(id);
788    /*
789    C414 leading to J200727 (Pulsar) - Conflux - 31000004
790    V928 leading to J164710 (Magnetar) - Vidette - 31000003
791    R259 leading to J174618 (Wolf-Rayet) - Redoubt - 31000006
792    S877 leading to J055520 (Red Giant) - Sentinel - 31000001
793    B735 leading to J110145 (Cataclysmic Variable) - Barbican - 31000002
794    
795    Sansha Wormholes: J005299, J010556, J011195
796    c
797    J000214 - spawns Sleeper Bioinformatics complex - a unique combat site in Eve.
798    J000xxx - spawn ... (this cache site i forgot the name)
799    
800    */
801    var specialWH=undefined;
802    //if (ss.sn == 'Thera'   ) specialWH='<font color="'+lightgrey+'">No Static Connections</font>';
803    if (ss.sn == 'J200727' ) specialWH='<font color="'+lightgrey+'">Conflux Drifter Wormhole</font>';
804    if (ss.sn == 'J164710' ) specialWH='<font color="'+lightgrey+'">Vidette Drifter Wormhole</font>';
805    if (ss.sn == 'J174618' ) specialWH='<font color="'+lightgrey+'">Redoubt Drifter Wormhole</font>';
806    if (ss.sn == 'J055520' ) specialWH='<font color="'+lightgrey+'">Sentinel Drifter Wormhole</font>';
807    if (ss.sn == 'J110145' ) specialWH='<font color="'+lightgrey+'">Barbican Drifter Wormhole</font>'; 
808    if (ss.sn == 'J005299' ) specialWH='<font color="'+lightgrey+'">Sansha Wormhole</font>';
809    if (ss.sn == 'J010556' ) specialWH='<font color="'+lightgrey+'">Sansha Wormhole</font>';
810    if (ss.sn == 'J011195' ) specialWH='<font color="'+lightgrey+'">Sansha Wormhole</font>';
811    if (ss.sn == 'J102834' ) specialWH='<font color="'+lightgrey+'">Eyjafjallajokull</font>';
812    if (!returnit && specialWH) $('#ss_W_selection').append('<tr><td class="td_ss_info" valign="top" colspan="2">'+specialWH+'</td></tr>');
813        var returner = {"statics":[],"specialWH":[]};
814        if (ss.statics!=undefined) { 
815            var jadd = '';
816            for (var i = 0; i < ss.statics.length; i++) {
817                var col=colorClassTxt(ss.statics[i].class);
818                if ( ss.statics[i].class==7 ) { jadd = 'High-Sec '}
819                else if ( ss.statics[i].class==8 ) { jadd = 'Low-Sec ' }
820                else if ( ss.statics[i].class==9 ) { jadd = 'Null-Sec ' }
821                else if ( ss.statics[i].code=="Q063") { jadd = 'High-Sec ';var col=colorClassTxt(7);}
822                else if ( ss.statics[i].code=="V898") { jadd = 'Low-Sec ';var col=colorClassTxt(8);}
823                else if ( ss.statics[i].code=="E587") { jadd = 'Null-Sec ';var col=colorClassTxt(9);}
824                else if ( ss.statics[i].class<7 ) { jadd = 'Class '+ss.statics[i].class+' ' }
825                var regen = '';
826                if (ss.statics[i].regen > 0) regen=' + '+ss.statics[i].regen.toLocaleString(Language, { useGrouping: true })+' kt/day'
827
828                var tdadd = 'Static <span style="font-family:EEMfont;color:'+col+'">'+jadd+' '+ss.statics[i].code+'</span> '
829                tdadd += '<span style="padding-bottom:0px"><font color="'+lightgrey+'">
829'+ss.statics[i].mass.toLocaleString(Language, { useGrouping: true })+' kt / '+ss.statics[i].quota.toLocaleString(Language, { useGrouping: true })+' kt'+regen+', '+ss.statics[i].life+' h</font></span>'
830
831                if (!returnit) $('#ss_W_selection').append('<tr><td class="td_ss_info" valign="top" colspan="2">'+tdadd+'</td></tr>');
832
833                var whadd= 'Static <span style="font-family:EEMfont;color:'+col+'">'+jadd+'</span> ' //ss.statics[i].code+' '
834                if (returnit) {returner.statics.push(whadd);}
835            }
836        }
837        if (!returnit) $('#ss_W_selection').append('<tr height="4"><td colspan="2"></td></tr>');
838        if (returnit && specialWH!=undefined) returner.specialWH.push(specialWH);
839        if (returnit) return returner;
840        //display wh effects
841        if (ss.phe!=undefined) phe_effects(ss.phe,ss.class) 
842        //refresh sspane content height
843        //SSI_pwh(id);
844};
845
846function SSI_pwh(id) {
847
848    ss=buildNodeData(id);
849
850    function className(c) {
851        var sec=-3;
852        var returntxt= '';
853        for (var x in c) {
854            if (c[x]>0 && c[x]<7) {sec = -2;wclass="C"+c[x];} // standard wormholes
855            if (c[x]==7) {sec = 1;wclass="High"};
856            if (c[x]==8) {sec = 0.1;wclass="Low"};
857            if (c[x]==9) {sec = -1;wclass="Null"};
858            if (c[x]==10) {sec = -1;wclass="Drone Region"}; // thera
859            if (c[x]==12) {sec = -2;wclass="Thera"}; // thera
860            if (c[x]==13) {sec = -2;wclass="C13"}; // ?
861            if (c[x]>13 && c[x]<19){ sec = -2;wclass="Drifter"}; // drifter wormholes
862            if (c[x]==25) {sec = -2;wclass="Pochven"}; // from or to Pochven
863            col=colorClass(c[x]);
864            returntxt += '<span style="color:'+col+'">'+wclass+'</span>&nbsp;'
865        }
866        return returntxt;
867    }
868
869    $('#ss_W_selection').append('<tr height="4"><td colspan="2"></td></tr>');
870    // possible wormholes
871    if (id>30000000) {
872        var currentClass = 0;
873        if (id>31000000) currentClass = ss.class
874        if (id<31000000 && ss.sec>=0.45) currentClass = 7;
875        if (id<31000000 && ss.sec<0.45) currentClass = 8;
876        if (id<31000000 && ss.sec<=0) currentClass = 9;
877        // outgoing
878        $('#ss_W_selection').append('<tr style="padding-top:10px"><td class="td_ss_info" colspan="2"><span style="color:#666">Possible outgoing wormholes</span><div class="td_ss_info" style="position:absolute;float:right" onClick="if ($(\'#outinwhs\').css(\'display\')==\'none\') {$(\'.outinwhs\').show()} else {$(\'.outinwhs\').hide()}">x&nbsp;</div></td></tr>');
879        for (var i in wormholes) {
880            for (var c in wormholes[i].from) {
881                if (wormholes[i].from[c]==currentClass) $('#ss_W_selection').append('<tr class="outinwhs"><td colspan="2" class="td_ss_info">'+wormholes[i].code+' <span style="color:#666">to</span> '+className(wormholes[i].to)+'</td></tr>');
882            }
883        }
884        // incoming
885        $('#ss_W_selection').append('<tr id="outinwhs" class="outinwhs" style="padding-top:10px"><td colspan="2" class="td_ss_info"><span style="color:#666">Possible incoming wormholes</span></td></tr>');
886        for (var i in wormholes) {
887            for (var c in wormholes[i].to) {
888                if (wormholes[i].to[c]==currentClass) $('#ss_W_selection').append('<tr class="outinwhs"><td colspan="2" class="td_ss_info">'+wormholes[i].code+' <span style="color:#666">from</span> '+className(wormholes[i].from)+'</td></tr>');
889            }
890        }
891        $('#ss_W_selection').append('<tr class="outinwhs" height="4"><td colspan="2"></td></tr>');
892    }
893}
894
895function SSI_sig(id) { logg('SSI_sig '+id+', Signatures.length = '+Signatures.length);
896
897    merging=false;
898
899    if (eeechoes) {
900        $('#ss_E_selection').empty();
901        SSI_connectionData(id);
902        return;
903    }
904
905    if (id!=0) { // why?
906        
907        $('#ss_E_selection').empty();
908        $('#ss_E_selection').append(SSheadlineHTML('SIGNATURES',3));
909        
910        var tdadd = '<tr class="opt_row_h_d2"><td><table width="100%" class="opt_table xborder" cellspacing="0" cellpadding="0" border="0" style="margin-bottom:4px;"><tr class="opt_row_h_d2"><td id="btn_sig_anomaly" onClick="sigs_toggle('+id+',\'anomaly\')" align="center" valign="middle" width="33%" class="td_ss_submenu">ANOMALIES</td>'
911        tdadd += '<td id="btn_sig_cosmic" onClick="sigs_toggle('+id+',\'cosmic\')" align="center" valign="middle" width="34%" class="td_ss_submenu">SIGNATURES</td>'
912        tdadd += '<td id="btn_sig_del" onClick="sigs_toggle('+id+',\'del\')" align="center" valign="middle" width="33%" class="td_ss_submenu">DELETED</td>'
913        tdadd += '</tr></table></td></tr>'
914        $('#ss_E_selection').append(tdadd);
915        
916        if ( Options['set_sig_anomaly']==true || Options['set_sig_anomaly']==undefined) $('#btn_sig_anomaly').addClass('tabsub_ss_on'); 
917        if ( Options['set_sig_cosmic']==true || Options['set_sig_cosmic']==undefined) $('#btn_sig_cosmic').addClass('tabsub_ss_on'); 
918        if ( Options['set_sig_del']==true || Options['set_sig_del']==undefined) $('#btn_sig_del').addClass('tabsub_ss_on'); 
919        
920        var noSig=true;
921        var sigCount=0;
922        if (Signatures==undefined) { clog('SSI_sig Signatures was undefined !?'); Signatures=[]; } // should not happen !?!?!?
923
924        Signatures.sort(function(a, b){
925            if(a.id < b.id) { return -1; }
926            if(a.id > b.id) { return 1; }
927            return 0;
928        });    
929
930        if (Signatures.length>0) {
931            var sigShown=0;
932            for ( var s in Signatures) {
933                if (id<20000000) {
934                    var compareID = findInSolarSystems ('getSsRegionID',Signatures[s].sid);
935                    var systemName = findInSolarSystems ('getSsName',Signatures[s].sid)+": ";
936                } else {
937                    var compareID = Signatures[s].sid
938                    var systemName = '';
939                };
940                if (compareID == id && Signatures[s].del!=true || compareID == id && Signatures[s].del==true && Options['set_sig_del']==true) {
941                    if (Signatures[s].type=='Wormhole') { 
942
943                        //if (id>30000000) console.warn('Wormhole wanted to show in signatures.');
944
945                    } else {
946                    if (checkSigWithinConnection(id,Signatures[s].id)==false) {
947                        sigCount+=1;
948                        var sigCol = sigColor(Signatures[s].group,Signatures[s].type)
949                        var typ = 'Anomaly'
950                        var label='';if (Signatures[s].label!=undefined && Signatures[s].label!=null) var label = ' ['+Signatures[s].label+'] ';
951                        if (Signatures[s].group.indexOf('Anomaly')==-1) typ = Signatures[s].type
952                        var name=Signatures[s].name;
953                        if (name=='' && typ!='') name='Unknown '+typ;//.replace(' Site','');
954                        if (name=='') name='Unknown';
955                        var unknownsig = false;
956                        if (typ=='') unknownsig = true;
957                        if (typ=='') typ =  Signatures[s].group //.replace("Signature","")
958                        if (typ != 'Anomaly' && Options['set_sig_cosmic']==true || typ != 'Anomaly' && Options['set_sig_cosmic']==undefined || typ == 'Anomaly' && Options['set_sig_anomaly']==true || typ == 'Anomaly' && Options['set_sig_anomaly']==undefined) {
959                            sigShown+=1;
960                            var classed="";
961                            if (name.includes('Unstable Wormhole') && currentMap!=10000000 || typ=='Wormhole' && currentMap!=10000000  ) {name='Unknown Wormhole';typ='Drag to merge with connection';sigCol=lightgrey;classed="merge"}
962                            if (unknownsig && currentMap!=10000000) classed="merge";
963                            //if (name.includes('Unstable Wormhole') && currentMap!=10000000 && mobileApp) {sigCol=lightgrey;classed=""}
964                            if (sigCol==undefined) sigCol=lightgrey;
965                            
966                            //row 1
967                            var c = 'var(--col-bars)';
968                            if (unknownsig) c = 'var(--col-pane2-hl-bg)'
969                            if (unknownsig) c = 'transparent'
970                            //if (theme=='light') c = d3.rgb(sigCol).copy({opacity: 0.05})
971                            var opac=1;
972                            if (unknownsig) opac=0.9;
973                            if (Signatures[s].del==true) opac=0.4;
974
975                            if(Signatures[s].ss<100) {var ss = Math.trunc(Signatures[s].ss)+'%'} else {var ss=''}
976    
977                            ////c='var(--col-main)';
978                            
979                            var onClick ='';
980                            var onContextmenu ='';
981
982                            if (tablet && enable_contextMenus) {
983                                if (!Signatures[s].del) onContextmenu =' oncontextmenu="toggleConfirmation(\'sigdel_'+s+'\',\'off\');sigClicked('+s+');displayContextMenu(window.event.clientX,window.event.clientY,\'sig\');"' 
984                                if (!Signatures[s].del) onClick =' onclick="toggleConfirmation(\'sigdel_'+s+'\',\'off\');sigClicked('+s+');displayContextMenu(window.event.clientX,window.event.clientY,\'sig\');"';
985                            } else {
986                                if (!Signatures[s].del) onClick =' onclick="toggleConfirmation(\'sigdel_'+s+'\',\'off\');sigClicked('+s+')"'    
987                            }
988                            
989
990                    if (Options['set_sig_compact']!=true) {
991
992                            ////var tdadd = '<tr><td colspan="3"><table width="100%" border="0" cellpadding="0" cellspacing="0" class="opt_table '+classed+'" key="'+s+'" style="background-color:'+c+' !important;opacity:'+opac+'" cellspacing="1"><tr>'//margin-bottom:4px;
993                            var tdadd = '<table width="100%" border="0" cellpadding="0" cellspacing="0" typ="sig" class="'+classed+'" key="'+s+'" style="height:var(--ui-base);background-color:'+c+' !important;opacity:'+opac+';margin-bottom:4px;" cellspacing="1" '+onContextmenu+'><tr>'//
994                            
995                            tdadd += '<td class="td_sig_ss" width="5" rowspan="2" style="background-color:'+sigStateColor(Signatures[s].ss)+';"><div id="sigdel_'+s+'_confirm" class="td_nav anim setconfirm confirm" onmousedown="event.stopPropagation();" onClick="sigs_deleteSigs('+s+','+id+')">DELETE</div></td>';
996                            
997                            tdadd += '<td class="td_sig_ss_glitchfix" width="40" title="'+Signatures[s].id+'" align="center" '+onClick+'>'+Signatures[s].id.substring(0,3)+'</td>' //Signature ID //+ rowspan="2"'<br>'+Signatures[s].id.substring(4,7)
998                            tdadd += '<td class="td_sig" colspan="2" '+onClick+'>'+systemName+'<font color="'+sigCol+'">'+name+'</font></td>' //Signature Name
999                            if (Signatures[s].del==true) {
1000                                tdadd += '<td width="16" onClick="sigs_deleteSigs('+s+','+id+',true);" class="td_sig_mini">UNDELETE</td>' //UnDelete Sig 
1001                            } else {
1002                                tdadd += '<td width="16" onClick="toggleConfirmation(\'sigdel_'+s+'\',undefined,60);"><img class="ui-ico-varia" src="img/icon/Delete_white Filled-100.png" width="16" height="16" style="opacity:0.3;"></td>' //Delete Sig
1003                            }
1004                            tdadd += '</tr>'                    
1005                            
1006                            //row 2
1007                            ////tdadd += '<tr class="opt_row_info">'
1008                            tdadd += '<tr>'
1009                            
1010                            tdadd += '<td class="td_sig_ss_glitchfix" align="center" title="'+Signatures[s].id+'" valign="middle" '+onClick+'>'+Signatures[s].id.substring(4,7)+'</td>' //Signature ID //
1011                            tdadd += '<td class="" '+onClick+'>' //Signature Name //td_sig_mini
1012                            if (typ == 'Anomaly') {
1013                                tdadd += ' <span class="td_sig_mini3" '+onClick+'>'+typ+'</span></td>' 
1014                            } else {
1015                                tdadd += ' <span class="td_sig_mini3" '+onClick+'>'+typ+' &nbsp;'+ss+'</span></td>'       
1016                            }
1017                            tdadd += '<td class="td_sig_mini3" '+onClick+' align="right" colspan="2" style="white-space: nowrap" '+onClick+'>' //yellow.: e3ff00
1018                            //if (Signatures[s].warp!=undefined && Signatures[s].warp!=null) tdadd += '&nbsp;&nbsp;<span class="td_sig_mini">Spawned</span>&nbsp;' //warped
1019                            if (Signatures[s].label!=undefined && Signatures[s].label!=null) tdadd += '<span style="color:var(--col-postit-txt);">'+Signatures[s].label+'</span>&nbsp;';
1020                            tdadd += '</td>' 
1021                            tdadd += '</tr>'
1022
1023                            /*
1024                            //row 3
1025                            tdadd += '<tr>'
1026                            tdadd += '<td class="td_sig_mini" onClick="sigs_deleteSigs('+s+','+id+')"><img class="ui-ico-varia" src="img/icon/Delete_white Filled-100.png" width="16" height="16"></td>'
1027                            tdadd += '<td class="td_sig_mini">' //Signature Name
1028                            tdadd += 'Created '+Signatures[s].time.replace('T',' ').replace('Z','')
1029                            if (Signatures[s].edit!=undefined) tdadd += ', edited '+hoursago(Signatures[s].edit)
1030                            tdadd += '</td>'
1031                            tdadd += '<td class="td_sig_mini" align="right">'
1032                            if (Signatures[s].label!=undefined && Signatures[s].label!=null) tdadd += Signatures[s].label+'&nbsp;'
1033                            tdadd += '</td>' //Signature Deletion
1034                            tdadd += '</tr>'
1035                            */
1036                            
1037                            //tdadd += '</table></td></tr>'
1038                            tdadd += '</table></td></tr>'
1039
1040                    } else { // compact mode
1041
1042                        var tdadd = '<table width="100%" border="0" cellpadding="0" cellspacing="0" typ="sig" class="'+classed+'" key="'+s+'" style="height:calc(var(--ui-base) / 2);background-color:'+c+' !important;opacity:'+opac+';margin-bottom:4px;" cellspacing="1" '+onContextmenu+'><tr>'//
1043                            
1044                        tdadd += '<td class="td_sig_ss" width="5" style="background-color:'+sigStateColor(Signatures[s].ss)+';"><div id="sigdel_'+s+'_confirm" class="td_nav anim setconfirm confirm" onmousedown="event.stopPropagation();" onClick="sigs_deleteSigs('+s+','+id+')">DELETE</div></td>';
1045                        
1046                        tdadd += '<td class="td_sig_ss_glitchfix" width="60" title="'+Signatures[s].id+'" align="center" '+onClick+'>'+Signatures[s].id+'</td>' //Signature ID
1047                        tdadd += '<td class="td_sig" colspan="2" '+onClick+'>'+systemName+'<font color="'+sigCol+'">'+name+'</font>' //Signature Name
1048                        
1049                        tdadd += ' <span class="td_sig_mini3" '+onClick+'>'+typ+'</span></td>' 
1050                        
1051                        tdadd += '</td>'
1052
1053
1054                        tdadd += '<td class="td_sig_mini3" '+onClick+' align="right" colspan="2" style="white-space: nowrap" '+onClick+'>' //yellow.: e3ff00
1055                        //if (Signatures[s].warp!=undefined && Signatures[s].warp!=null) tdadd += '&nbsp;&nbsp;<span class="td_sig_mini">Spawned</span>&nbsp;' //warped
1056                        if (Signatures[s].label!=undefined && Signatures[s].label!=null) tdadd += '<span style="color:var(--col-postit-txt);">'+Signatures[s].label+'</span>&nbsp;&nbsp;&nbsp;';
1057                        tdadd += '</td>' 
1058
1059
1060                        if (Signatures[s].del==true) {
1061                            tdadd += '<td width="16" onClick="sigs_deleteSigs('+s+','+id+',true);" class="td_sig_mini">UNDELETE</td>' //UnDelete Sig 
1062                        } else {
1063                            tdadd += '<td width="16" onClick="toggleConfirmation(\'sigdel_'+s+'\',undefined,60);"><img class="ui-ico-varia" src="img/icon/Delete_white Filled-100.png" width="16" height="16" style="opacity:0.3;"></td>' //Delete Sig
1064                        }
1065                        tdadd += '</tr>';
1066                        
1067
1068                        tdadd += '</table></td></tr>'
1069                    }
1070                            
1071                            $('#ss_E_selection').append(tdadd);
1072                            setDraggables();
1073                            noSig=false;
1074                        }
1075                    } else {  } // do not count merged sigs (connection sigs) //sigCount+=-1
1076                }
1077            }
1078                //if (Signatures[s].del==true) sigCount+=-1;
1079            }
1080        } 
1081        if (sigCount>0 && sigShown==0) $('#ss_E_selection').append('<tr colspan=3><td class="td_ss_info"><font color="'+lightgrey+'">Signatures filtered</font></td></tr>'); //'+sigCount+'
1082        if (sigCount<=0) $('#ss_E_selection').append('<tr colspan=3><td class="td_ss_info"><font color="'+lightgrey+'">No Signatures recorded</font></td></tr>');
1083        $('#ss_E_selection').append('<tr height=4 colspan=3><td></td></tr>');
1084
1085        SSI_connectionData(id); 
1086
1087    } // id = 0
1088};
1089
1090function SSI_connectionData(id) { //logg('SSI_connectionData '+id+', Connections.length = '+Connections);
1091    var first=true;
1092    var connCount=0;
1093    var connShown=0;
1094    if (Connections != undefined) {
1095        
1096        //sortConnections('name',id); //sort after name.. better sorted after sig
1097
1098        //console.log('SSI_connectionData iterating connections')
1099
1100        Connections.sort(function(a, b){
1101            if(!a.sigF) { 
1102                if(a.from > b.from) return 1;
1103                return -1;
1104            }
1105            if(a.sigF > b.sigF) return 1;
1106            if(a.sigF < b.sigF) return -1;
1107            return 0;
1108        });
1109
1110        for (var i in Connections) { 
1111
1112                //console.log(Connections[i])
1113
1114                var dontshow=false;
1115                //check for dontshow condiditzons
1116                //remaining from merged connection
1117                if (Connections[i].to<10000000) {
1118                    for (var cc in Connections) {
1119                        if (i!=cc && Connections[i].sigF==Connections[cc].sigF && Connections[i].from==Connections[cc].from && Connections[i].to!=Connections[cc].to && Connections[cc].to>30000000) dontshow=true;
1120                        if (dontshow) break;
1121                    }
1122                }
1123
1124                if (dontshow) {
1125
1126                    //console.log('dontshow:',Connections[i])
1127                } else {
1128
1129
1130
1131                        if (id<20000000) {
1132                            var compareIDfrom = findInSolarSystems ('getSsRegionID',Connections[i].from);
1133                            var compareIDto = findInSolarSystems ('getSsRegionID',Connections[i].to);
1134                            var systemNameFrom = findInSolarSystems ('getSsName',Connections[i].from) + ' &nbsp;>&nbsp; ';
1135                            var systemNameTo = findInSolarSystems ('getSsName',Connections[i].to) + ' &nbsp;>&nbsp; ';
1136                        } else {
1137                            var compareIDfrom = Connections[i].from;
1138                            var compareIDto = Connections[i].to;
1139                            var systemNameFrom = "";
1140                            var systemNameTo = "";
1141                        };
1142                        var dontshow=false;
1143                        if (Connections[i].jb!=undefined && Options['set_conn_jb']==false) dontshow=true;
1144                        if (Connections[i].jb==undefined && Options['set_conn_wh']==false) dontshow=true;
1145                        if (Connections[i].del==true && Options['set_conn_del']==false) dontshow=true;
1146
1147                        //console.log('1dontshow',dontshow)
1148
1149                        // check if merged conn
1150                        for (var x in Connections) { 
1151                            if (Connections[i].to<10000000) { 
1152                                if (Connections[i].from==Connections[x].from && Connections[i].to==Connections[x].to && Connections[i].time==Connections[x].time) { // ytf didnt i implement an id ftw
1153                                    // same skip
1154                                } else {
1155                                    if (Connections[i].from==Connections[x].from && Connections[i].to<10000000) {
1156                                        if (Connections[i].sigF==Connections[x].sigF && Connections[i].sigF!='' && Connections[i].sigF!=undefined) dontshow=true;
1157                                    }
1158                                    if (Connections[i].from==Connections[x].to && Connections[i].to<10000000) {
1159                                        if (Connections[i].sigF==Connections[x].sigT && Connections[i].sigF!='' && Connections[i].sigF!=undefined) dontshow=true;
1160                                    }
1161                                }
1162                            }
1163                        }
1164                        if (dontshow && Connections[i].from==currentDisplayedSysID) logg('merged conn dontshow: '+JSON.stringify(Connections[i]));
1165
1166                        if (compareIDfrom == id || compareIDto == id ) {
1167
1168                        if (first) {
1169                            $('#ss_E_selection').append(SSheadlineHTML('CONNECTIONS',1));
1170                            var tdadd = '<tr class="opt_row_h_d2"><td><table width="100%" class="opt_table xborder" cellspacing="0" cellpadding="0" border="0" style="margin-bottom:4px;"><tr class="opt_row_h_d2"><td id="btn_conn_wh" onClick="conn_toggle('+id+',\'wh\')" align="center" valign="middle" width="33%" class="td_ss_submenu">WORMHOLES</td>'
1171                            tdadd += '<td id="btn_conn_jb" onClick="conn_toggle('+id+',\'jb\')" align="center" valign="middle" width="34%" class="td_ss_submenu">JUMPBRIDGES</td>'
1172                            tdadd += '<td id="btn_conn_del" onClick="conn_toggle('+id+',\'del\')" align="center" valign="middle" width="33%" class="td_ss_submenu">DELETED</td>'
1173                            tdadd += '</tr></td></table></tr>'
1174                            $('#ss_E_selection').append(tdadd);
1175
1176                            if ( Options['set_conn_wh']==true || Options['set_conn_wh']==undefined) $('#btn_conn_wh').addClass('tabsub_ss_on'); 
1177                            if ( Options['set_conn_jb']==true || Options['set_conn_jb']==undefined) $('#btn_conn_jb').addClass('tabsub_ss_on'); 
1178                            if ( Options['set_conn_del']==true || Options['set_conn_del']==undefined) $('#btn_conn_del').addClass('tabsub_ss_on'); 
1179                        } 
1180                        first=false;
1181                        if (Connections[i].del!=true) connCount += 1;
1182
1183                        //console.log('2dontshow',dontshow)
1184
1185                        if (!dontshow) {
1186                        connShown += 1;
1187
1188                        var sig = undefined;
1189                        var mass = undefined; 
1190                        var jb = undefined; 
1191                        var whcode, codeF, codeT, secF, secT;
1192                        var code = '';
1193
1194                            // more quirky fixing of missing k162
1195                            if (Connections[i].codeF!=undefined && Connections[i].codeF!="" && Connections[i].codeF!='K162') Connections[i].codeT='K162';
1196                            if (Connections[i].codeT!=undefined && Connections[i].codeT!="" && Connections[i].codeT!='K162') Connections[i].codeF='K162';
1197
1198                        Connections[i].codeF != undefined ? codeF=Connections[i].codeF : codeF='';
1199                        Connections[i].codeT != undefined ? codeT=Connections[i].codeT : codeT='';
1200                        if (codeT == 'K162' || codeT==undefined && codeF!=undefined) { var whcode = codeF } 
1201                        else if (codeF == 'K162' || codeF==undefined && codeT!=undefined) { var whcode = codeT };
1202                        
1203                        if (id==compareIDfrom ) {
1204                            var ss = findInSolarSystems('getSsObject', Connections[i].to);///buildNodeData(Connections[i].to);
1205                            var ssF = findInSolarSystems('getSsObject', Connections[i].from);
1206                            var sigSide="F"
1207                            secF=ssF.sec;
1208                            secT=ss.sec;
1209                            if (codeF=='K162') {k162=codeF} else if (codeT=='K162') {k162=''} else {k162='?'};
1210                            sig = Connections[i].sigF;
1211                            mass = Connections[i].mass;
1212                            jb = Connections[i].jb;
1213                            var phe = getPhonomenon(ss.phe);
1214                            var systemName = systemNameFrom;
1215                        }
1216                        if (id==compareIDto ) {
1217                            var ss = findInSolarSystems('getSsObject', Connections[i].from);//buildNodeData(Connections[i].from);
1218                            var ssF = findInSolarSystems('getSsObject', Connections[i].to);
1219                            var sigSide="T"
1220                            secF=ss.sec;
1221                            secT=ssF.sec;
1222                            if (codeT=='K162') {k162=codeT} else if (codeF=='K162') {k162=''} else {k162='?'};
1223                            sig = Connections[i].sigT;
1224                            mass = Connections[i].mass;
1225                            jb = Connections[i].jb;
1226                            var phe = getPhonomenon(ss.phe);
1227                            var systemName = systemNameTo;
1228                        }
1229
1230                        if (codeT=='K162') {whcode=codeF} else {whcode=codeT};
1231                        
1232                        if (mass != undefined || jb != undefined ) {
1233                            
1234                            if (ss.sid < 31000000) {
1235                            //var col = colorSecSimple(ss.sec);
1236                            var col = colorSec(ss.sec);
1237                            var sec = secSan(ss.sec);
1238                            } else {
1239                            var col = colorClassTxt(ss.class);
1240                            var sec = 'C'+ss.class
1241                            }
1242                            
1243                            // jump bridges
1244                            if (Connections[i].jb!=undefined && Options['set_conn_jb']==true || Connections[i].jb!=undefined && Options['set_conn_jb']==undefined) { 
1245                            
1246                                var bgcol='var(--col-bars)'
1247                                var opac=1;
1248                                if (Connections[i].del==true) opac=0.4;
1249                                classed="";
1250                                if (Connections[i].jb==true) var scol = jbgreen;
1251                                if (Connections[i].jb==2) var scol = jbblue;
1252                                if (Connections[i].jb==false) var scol = jbred;
1253                                //var scol = purple;
1254
1255                                var onClick ='';
1256                                var onContextmenu ='';
1257
1258                                if (tablet && enable_contextMenus) {
1259                                    if (!Connections[i].del) onContextmenu=' oncontextmenu="toggleConfirmation(\'conndel_'+i+'\',\'off\');selectedLink={s:'+Connections[i].from+', t:'+Connections[i].to+', ssec:\''+secF+'\', tsec:\''+secT+'\', ssig:\''+Connections[i].sigF+'\', tsig:\''+Connections[i].sigT+'\', scode:\''+Connections[i].codeF+'\', tcode:\''+Connections[i].codeT+'\'};displayContextMenu(window.event.clientX,window.event.clientY,\'lnk\');linkClicked('+Connections[i].from+','+Connections[i].to+','+i+');"';
1260                                    if (!Connections[i].del) onClick=' onclick="toggleConfirmation(\'conndel_'+i+'\',\'off\');if(!merging){selectedLink={s:'+Connections[i].from+', t:'+Connections[i].to+', ssec:\''+secF+'\', tsec:\''+secT+'\', ssig:\''+Connections[i].sigF+'\', tsig:\''+Connections[i].sigT+'\', scode:\''+Connections[i].codeF+'\', tcode:\''+Connections[i].codeT+'\'};displayContextMenu(window.event.clientX,window.event.clientY,\'lnk\');linkClicked('+Connections[i].from+','+Connections[i].to+','+i+');}"';
1261                                } else {
1262                                    if (!Connections[i].del) onClick=' onClick="toggleConfirmation(\'conndel_'+i+'\',\'off\');if(!merging){selectedLink={s:'+Connections[i].from+', t:'+Connections[i].to+', ssec:\''+secF+'\', tsec:\''+secT+'\', ssig:\''+Connections[i].sigF+'\', tsig:\''+Connections[i].sigT+'\', scode:\''+Connections[i].codeF+'\', tcode:\''+Connections[i].codeT+'\'};linkClicked('+Connections[i].from+','+Connections[i].to+','+i+');}"';    
1263                                }
1264
1265                                //row 1
1266                                ////var tdadd = '<tr><td colspan="3"><table width="100%" border="0" cellpadding="0" cellspacing="0" class="opt_table '+classed+'" key="'+i+'" sigSide="'+sigSide+'" sid="'+id+'" style="background-color:'+c+' !important;opacity:'+opac+'" cellspacing="1"><tr>' //margin-bottom:4px;
1267                                var tdadd = '<table width="100%" border="0" cellpadding="0" cellspacing="0" typ="conn" class="'+classed+'" key="'+i+'" sigSide="'+sigSide+'" sid="'+id+'" style="height:var(--ui-base);background-color:'+bgcol+' !important;opacity:'+opac+';margin-bottom:4px;" cellspacing="1" '+onContextmenu+'><tr>'
1268                                
1269                                var link = "{'s':"+Connections[i].from+",'t':"+Connections[i].to+",'sigF':'"+Connections[i].sigF+"','sigT':'"+Connections[i].sigT+"','codeF':'"+Connections[i].codeF+"','codeT':'"+Connections[i].codeT+"'}"
1270
1271                                tdadd += '<td class="td_sig_ss" width="5" rowspan="2" style="background-color:'+scol+';"><div id="conndel_'+i+'_confirm" class="td_nav anim setconfirm confirm" onmousedown="event.stopPropagation();" onClick="removeConnection('+link+')">DELETE</div></td>';
1272
1273                                tdadd += '<td class="td_sig_ss_glitchfix" width="40" align="center" valign="middle" '+onClick+'> &nbsp; </td>' //Signature ID
1274                                tdadd += '<td class="td_sig" colspan="2" '+onClick+'>Jumpbridge to <span style="color:var(--col-txt)">'+ss.sn+'</span></td>'; //<font color="'+col+'">'+sec+'</font>
1275                                if (Connections[i].del==true) {
1276                                    tdadd += '<td width="16" onClick="undeleteConnection('+link+');" class="td_sig_mini">UNDELETE</td>' //UnDelete 
1277                                } else {
1278                                    tdadd += '<td width="16" onClick="toggleConfirmation(\'conndel_'+i+'\',undefined,60);"><img class="ui-ico-varia" src="img/icon/Delete_white Filled-100.png" width="16" height="16" style="opacity:0.3;"></td>' //Delete
1279                                }
1280                                tdadd += '</tr>';
1281                                var name = Connections[i].name;
1282                                if (name==undefined) name ='';
1283                                
1284                                //row 2
1285                                var ltxt = '';
1286                                if (Connections[i].label!= undefined && Connections[i].label!='') ltxt = Connections[i].label;
1287                                ////tdadd += '<tr class="opt_row_info">'
1288                                tdadd += '<tr>'
1289
1290                                tdadd += '<td class="td_sig_ss_glitchfix" align="center" valign="middle" '+onClick+'> &nbsp; </td>' //WH code
1291                                tdadd += '<td class="td_sig_mini3" '+onClick+'>' //Signature Name                    
1292                                tdadd += ' <span class="td_sig_mini3">'+name+' </span></td>' 
1293                                tdadd += '<td class="td_sig_mini3" '+onClick+' align="right" colspan="2" style="white-space: nowrap">' //yellow.: e3ff00
1294                                tdadd += '<span style="color:var(--col-postit-txt);">'+ltxt+'</span>';
1295                                tdadd += '&nbsp;</td>' 
1296                                tdadd += '</tr>'
1297
1298                                //tdadd += '</table></td></tr>'
1299                                tdadd += '</table></td></tr>'
1300
1301                                $('#ss_E_selection').append(tdadd);
1302                                setDraggables();
1303                                noSig=false; 
1304
1305                            // wormholes
1306                            } else {
1307
1308                                var ownPublic = checkOwnPublic(Connections[i]);
1309
1310                                if (ownPublic!=="1") {
1311
1312                                    var bgcol='var(--col-bars)'
1313                                    classed="";
1314                                    var classed = '';
1315                                    var whtype = '';
1316                                    //console.log(codeF+'/'+codeT);
1317                                    
1318                                    var title='K162 side in this system'; 
1319                                    if (k162!=undefined) whtype = ' <span title="'+title+'">'+k162+'</span>' // style="font-family:EEMfontMono;color:'+lightgrey+';"
1320                                    
1321                                    if (sig==undefined || sig=='') {sig="";classed="drop"}
1322                                    if (Connections[i].del!=undefined) classed="";
1323
1324                                    var mtxt='';
1325                                    var opac=1;
1326                                    if (Connections[i].del==true) opac=0.4;
1327
1328                                    // whname
1329                                    var sn = ss.sn;
1330                                    var whname='';
1331                                    if (Options['set_share_whnames']) {
1332                                        for (var n in WHnames_Shared) {
1333                                            if (WHnames_Shared[n].id == ss.sid && WHnames_Shared[n].del != true) {
1334                                                whname = WHnames_Shared[n].name+' ';
1335                                                break;
1336                                            }
1337                                        }
1338                                    } else {
1339                                        for (var n in WHnames) {
1340                                            if (WHnames[n].id == ss.sid && WHnames[n].del != true) {
1341                                                whname = WHnames[n].name+' ';
1342                                                break;
1343                                            }
1344                                        }
1345                                    }
1346
1347                                    //statics
1348                                    /*var statics = SSI_wh(ss.sid,ss,true);
1349                                    statictxt = '<span class="td_sig_mini">&nbsp;'
1350                                    if (phe!="") statictxt+=phe+", "
1351                                    if (statics.specialWH[0]!=undefined)  statictxt+=statics.specialWH[0]+' ';
1352                                    if (statics.statics[statics.statics.length-1]!=undefined)  statictxt+=statics.statics[statics.statics.length-1];
1353                                    statictxt+='</span>'*/
1354
1355                                    // quirks
1356                                    if (Connections[i].life == 2 && Connections[i].eol==undefined) Connections[i].eol=getTimeStr();
1357
1358                                    // unknown wormholes
1359                                    if (Connections[i].to<10000000) {
1360
1361                                        systemName = systemName + 'Unknown System';
1362                                        if (Connections[i].class!=undefined || Connections[i].inc!=undefined) {
1363                                            var cc=0;
1364                                            if (Connections[i].inc!=undefined && Connections[i].codeF=='K162') {
1365                                                cc = Connections[i].inc;
1366                                            } else if (Connections[i].codeF!='' && Connections[i].codeF!=undefined) {
1367                                                cc = Connections[i].class;
1368                                            }
1369                                            var ctxt='';
1370                                            if (cc!=0) ctxt= '<span style="font-family:EEMfont;color:'+colorClassTxt(cc)+'">C'+cc+'</span>'
1371                                            if (cc==7) ctxt= '<span style="font-family:EEMfont;color:'+colorClassTxt(cc)+'">High</span>'
1372                                            if (cc==8) ctxt= '<span style="font-family:EEMfont;color:'+colorClassTxt(cc)+'">Low</span>'
1373                                            if (cc==9) ctxt= '<span style="font-family:EEMfont;color:'+colorClassTxt(cc)+'">Null</span>'
1374                                            //if (cc==0) ctxt= '<span style="font-family:EEMfont;color:'+colorClassTxt(cc)+'">?</span>'
1375                                            if (cc==-1) ctxt= '<span style="font-family:EEMfont;color:'+colorClassTxt(cc)+'">C1-3</span>'
1376                                            if (cc==-2) ctxt= '<span style="font-family:EEMfont;color:'+colorClassTxt(cc)+'">C4-5</span>'
1377                                            if (cc==-3) ctxt= '<span style="font-family:EEMfont;color:'+colorClassTxt(cc)+'">C6</span>'
1378                                            if (cc==-4 || cc==25) ctxt= '<span style="font-family:EEMfont;color:'+colorClassTxt(cc)+'">Pochven</span>'
1379                                            if (cc>13 && cc<19) ctxt= '<span style="font-family:EEMfont;color:'+colorClassTxt(cc)+'">Drifter</span>'
1380                                            if (Connections[i].codeF!="" && Connections[i].codeF!=undefined && Connections[i].codeF!="K162") {
1381                                                ctxt = '<span style="font-family:EEMfont;color:'+colorClassTxt(cc)+'">'+Connections[i].codeF+'</span> '+ctxt;
1382                                            } else if (Connections[i].codeT!="" && Connections[i].codeT!=undefined && Connections[i].codeT!="K162") {
1383                                                ctxt = '<span style="font-family:EEMfont;color:'+colorClassTxt(cc)+'">'+Connections[i].codeT+'</span> '+ctxt;
1384                                                ctxt = 'Incoming '+ctxt;
1385                                            } else if (Connections[i].codeT=="") {
1386                                                ctxt = 'Incoming '+ctxt;
1387                                            }
1388                                            systemName = 'Unknown '+ctxt;
1389                                            if (cc==12) systemName = 'Thera';
1390                                            if (cc==0) systemName = 'Unknown System';
1391                                        }
1392                                        statictxt='';
1393                                        sec='';
1394                                        sn='';
1395                               
1395         sigCol=lightgrey;
1396                                        classed="merge"
1397                                        bgcol='transparent';
1398                                    } else {
1399                                        var statictxt = '<span class="td_sig_mini">&nbsp;'+staticsOneLiner(ss.sid)+'</span>';
1400                                    }
1401
1402                                    if (Connections[i].life == 1) {
1403                                        var scol = blue;
1404
1405                                    } else if (Connections[i].life == 2 && Connections[i].eol!=undefined) {
1406                                        var hago = Math.ceil(timeDiff(Connections[i].eol)/60/60/1000*-1);
1407                                        if (hago>=4) {
1408                                            var scol = red;bgcol=col_connlife;mtxt += '&nbsp;<font color="'+red+'">Despawn imminent</font>'
1409                                        } else {
1410                                            var scol = red;bgcol=col_connlife;mtxt += '&nbsp;<font color="'+red+'">EOL</font>'
1411                                        }
1412
1413                                    } else if ( whcode!='' && whcode!=undefined && whcode!='K162') {
1414
1415                                        var wh =  $.grep(wormholes, function(d){ return d.code == whcode; }); //{"code":"A641","class":7,"mass":1000,"quota":2000,"regen":0,"life":16}
1416                                        wh = wh[0];
1417                                        if (wh!=undefined) {
1418                                            var life = Number(wh.life);
1419                                            //var hago = Number((timeDiff(Connections[i].time)/60/60/1000*-1).toFixed(0));
1420                                            var hago = Math.ceil(timeDiff(Connections[i].time)/60/60/1000*-1);
1421                                            if (hago+4>=life) $('#setLife_tr').hide();
1422                                        }
1423
1424                                        if (wh!=undefined) {
1425                                             //console.log(life,hago,life-hago)
1426                                            if (life-hago<=0) { //
1427                                                //$('#remLife').html('<br><span style="color:var(--col-red)"><b>Despawn imminent</b>');
1428                                                var scol = red;bgcol=col_connlife;mtxt += '&nbsp;<font color="'+red+'">Despawn imminent</font>'
1429                                            } else if (life-hago<=4) { //EOL not set but only 4h remaining
1430                                                //$('#remLife').html('<br><span style="color:var(--col-red)">Maximum remaining lifetime '+(life-hago)+' hours');
1431                                                var scol = red;bgcol=col_connlife;mtxt += '&nbsp;<font color="'+red+'">EOL</font>'
1432                                                
1433                                            } else {
1434                                                //$('#remLife').html('<br><span style="color:var(--col-blue)">Maximum remaining lifetime '+(life-hago)+' hours');
1435                                                var scol = blue;
1436                                            }
1437                                        }
1438                                    }
1439
1440
1441
1442
1443                                    if (Connections[i].mass == 0) mtxt += '';
1444                                    if (Connections[i].mass == 1) mtxt += '&nbsp;Stability reduced';
1445                                    if (Connections[i].mass == 2) {mtxt += '&nbsp;<font color="'+red+'">Stability critical</font>';c=col_connlife}
1446                                    if (Connections[i].mass == 3) mtxt += '&nbsp;Frigate sized';
1447                                    if (Connections[i].external) {
1448                                        if (Connections[i].external == 'public') {
1449                                            mtxt += '&nbsp;<span style="color:rgb(51, 122, 183);font-family:EEMfontExtraLight" title="Connection shared publicly.">( Public )</span>'; // '+orange+'
1450                                        } else {
1451                                            mtxt += '&nbsp;<span style="color:rgb(51, 122, 183);font-family:EEMfontExtraLight" title="This is an External connection by '+Connections[i].external+'.">( External )</span>';
1452                                        }
1453                                    } else if (ownPublic=="2") {
1454                                        // mtxt += '&nbsp;<span style="color:'+orange+';font-family:EEMfontExtraLight" title="Connection shared publicly.">( Own Public )</span>';
1455                                    }
1456
1457                                    if (systemName == 'Unknown System') {scol = d3.rgb(col_connunknown).brighter(0.5).formatHex();c = col_connunknown;}
1458
1459                                    var onClick ='';
1460                                    var onContextmenu ='';
1461
1462                                    if (tablet && enable_contextMenus) {
1463                                        if (!Connections[i].del) onContextmenu='oncontextmenu="toggleConfirmation(\'conndel_'+i+'\',\'off\');selectedLink={s:'+Connections[i].from+', t:'+Connections[i].to+', ssec:\''+secF+'\', tsec:\''+secT+'\', ssig:\''+Connections[i].sigF+'\', tsig:\''+Connections[i].sigT+'\', scode:\''+Connections[i].codeF+'\', tcode:\''+Connections[i].codeT+'\'};displayContextMenu(window.event.clientX,window.event.clientY,\'lnk\');linkClicked('+Connections[i].from+','+Connections[i].to+','+i+');"';
1464                                        if (!Connections[i].del) onClick='onClick="toggleConfirmation(\'conndel_'+i+'\',\'off\');if(!merging){selectedLink={s:'+Connections[i].from+', t:'+Connections[i].to+', ssec:\''+secF+'\', tsec:\''+secT+'\', ssig:\''+Connections[i].sigF+'\', tsig:\''+Connections[i].sigT+'\', scode:\''+Connections[i].codeF+'\', tcode:\''+Connections[i].codeT+'\'};displayContextMenu(window.event.clientX,window.event.clientY,\'lnk\');linkClicked('+Connections[i].from+','+Connections[i].to+','+i+');}"';  
1465                                    } else {
1466                                        if (!Connections[i].del) onClick='onClick="toggleConfirmation(\'conndel_'+i+'\',\'off\');if(!merging){selectedLink={s:'+Connections[i].from+', t:'+Connections[i].to+', ssec:\''+secF+'\', tsec:\''+secT+'\', ssig:\''+Connections[i].sigF+'\', tsig:\''+Connections[i].sigT+'\', scode:\''+Connections[i].codeF+'\', tcode:\''+Connections[i].codeT+'\'};linkClicked('+Connections[i].from+','+Connections[i].to+','+i+');}"';  
1467                                    }
1468
1469                                    //row 1
1470                                    ////var tdadd = '<tr><td colspan="3"><table width="100%" border="0" cellpadding="0" cellspacing="0" class="opt_table '+classed+'" key="'+i+'" sigSide="'+sigSide+'" sid="'+id+'" style="background-color:'+c+' !important;opacity:'+opac+'" cellspacing="1"><tr>' //margin-bottom:4px;
1471                                    var tdadd = '<table width="100%" border="0" cellpadding="0" cellspacing="0" typ="conn" class="opt_table '+classed+'" key="'+i+'" sigSide="'+sigSide+'" sid="'+id+'" style="background-color:'+bgcol+' !important;opacity:'+opac+';margin-bottom:4px;" cellspacing="1" '+onContextmenu+'><tr>' 
1472
1473                                    var link = "{'s':"+Connections[i].from+",'t':"+Connections[i].to+",'sigF':'"+Connections[i].sigF+"','sigT':'"+Connections[i].sigT+"','codeF':'"+Connections[i].codeF+"','codeT':'"+Connections[i].codeT+"'}"
1474
1475                                    tdadd += '<td class="td_sig_ss" width="5" rowspan="2" style="background-color:'+d3.color(scol).darker(1)+';"><div id="conndel_'+i+'_confirm" class="td_nav anim setconfirm confirm" onmousedown="event.stopPropagation();" onClick="removeConnection('+link+')">DELETE</div></td>';
1476                                                    
1477                                    tdadd += '<td class="td_sig_ss_glitchfix" width="40" align="center" title="'+sig+'" valign="middle" '+onClick+'>'+sig.substring(0,3)+'</td>' //Signature ID
1478                                    if (whname=='') {
1479                                        tdadd += '<td class="td_sig" colspan="2" '+onClick+'><span style="color:var(--col-txt)">'+systemName+'</span><span style="'+getSecTxtStyles(sec)+'">'+sec+'</span> <span style="color:var(--col-txt)">'+sn+'</span>'+statictxt+mtxt; 
1480                                    } else {
1481                                        tdadd += '<td class="td_sig" colspan="2" '+onClick+'><span style="'+getSecTxtStyles(sec)+'">'+sec+'</span> <span style="color:var(--col-txt)">'+whname+'</span><span class="td_sig_mini">'+sn+'</span>'+statictxt+mtxt; 
1482                                    }
1483                                    if (Connections[i].del==true) {
1484                                        tdadd += '<td width="16" onClick="undeleteConnection('+link+');" class="td_sig_mini">UNDELETE</td>' //UnDelete 
1485                                    } else {
1486                                        tdadd += '<td width="16" onClick="toggleConfirmation(\'conndel_'+i+'\',undefined,60);"><img class="ui-ico-varia" src="img/icon/Delete_white Filled-100.png" width="16" height="16" style="opacity:0.3;"></td>' //Delete
1487                                    }
1488                                    tdadd += '</tr>'                    
1489                                    
1490                                    //row 2
1491                                    var ltxt = '';
1492                                    if (Connections[i].label!= undefined && Connections[i].label!='') ltxt = Connections[i].label;
1493                                    ////tdadd += '<tr class="opt_row_info">'
1494                                    tdadd += '<tr>'
1495
1496                                    //tdadd += '<td class="td_sig_ss_glitchfix" align="center" valign="middle">'+k162+'</td>' //WH code
1497                                    tdadd += '<td class="td_sig_ss_glitchfix" align="center" title="'+sig+'" valign="middle" '+onClick+'>'+sig.substring(4,7)+'</td>' //WH code
1498                                    tdadd += '<td class="td_sig_mini3" '+onClick+'>' //Signature Name
1499
1500                                    var typ='&nbsp;';
1501                                    if (whcode) {
1502                                        var wh =  $.grep(wormholes, function(d){ return d.code == whcode; }); //{"code":"A641","class":7,"mass":1000,"quota":2000,"regen":0,"life":16}    
1503                                        wh = wh[0];
1504
1505                                        var regen='';
1506                                        if (wh!=undefined) {
1507                                            if (wh.regen >
1507 0) regen=' + '+wh.regen.toLocaleString(Language, { useGrouping: true })+' kt/day'
1508                                            var whadd= ', '+wh.mass.toLocaleString(Language, { useGrouping: true })+' kt / '+wh.quota.toLocaleString(Language, { useGrouping: true })+' kt'+regen+', '+wh.life+' h'
1509                                            if (k162!='K162') {
1510                                                var typ = whcode + whadd;
1511                                            } else {
1512                                                var typ = 'K162 ( '+whcode+' )' + whadd;
1513                                            }
1514                                        }
1515                                    }
1516
1517                                    // unknown wormholes
1518                                    if (Connections[i].to<10000000 && Connections[i].codeT=='' || Connections[i].to<10000000 && !Connections[i].codeT || Connections[i].codeF=='') {
1519                                        typ='Drag to merge with connection';
1520                                    }
1521                                    
1522                                    tdadd += '<span class="td_sig_mini3" style="padding-left:0px !important">'+typ+'</span>' 
1523                                    tdadd += '<td class="td_sig_mini3" '+onClick+' align="right" colspan="2" style="white-space: nowrap">' //yellow.: e3ff00
1524                                    //if (Connections[i].warp!=undefined && Connections[i].warp!=null) tdadd += '&nbsp;&nbsp;<span class="td_sig_mini">Spawned</span>&nbsp;' //warped
1525                                    //tdadd += statictxt+'&nbsp;';
1526                                    tdadd += '<span style="color:var(--col-postit-txt);">'+ltxt+'</span>';
1527                                    tdadd += '&nbsp;</td>' 
1528                                    tdadd += '</tr>'
1529                                    
1530                                    /*
1531                                    //row 3
1532                                    tdadd += '<tr>'
1533                                    tdadd += '<td class="td_sig_mini" onClick="sigs_deleteSigs('+i+','+id+')"><img class="ui-ico-varia" src="img/icon/Delete_white Filled-100.png" width="16" height="16"></td>'
1534                                    tdadd += '<td class="td_sig_mini">' //Signature Name
1535                                    tdadd += 'Created '+Connections[i].time.replace('T',' ').replace('Z','')
1536                                    if (Connections[i].edit!=undefined) tdadd += ', edited '+hoursago(Connections[i].edit)
1537                                    tdadd += '</td>'
1538                                    tdadd += '<td class="td_sig_mini" align="right"><font color="#DDD">'
1539                                    if (Connections[i].label!=undefined && Connections[i].label!=null) tdadd += Connections[i].label+'&nbsp;'
1540                                    tdadd += '</font></td>' //Signature Deletion
1541                                    tdadd += '</tr>'
1542                                    */
1543                                    
1544                                    //tdadd += '</table></td></tr>'
1545                                    tdadd += '</table></td></tr>'
1546                                    
1547                                    //if (Connections[i].to<10000000 && Connections[i].del!=undefined) {
1548                                        // do not show deleted unknowns or the could be undeleted... better this way
1549                                    //} else {
1550                                    var found=false;
1551                                    /*for (var c in Connections) {
1552                                        console.log(c)
1553                                        console.log(Connections[c])
1554                                        if (Connections[i].to<10000000 && Connections[c].to!=Connections[i].to && Connections[c].sigF==Connections[i].sigF && !Connections[c].del) found = true;
1555                                        //if (Connections[i].to<10000000 && Connections[c].from==Connections[i].to && Connections[c].sigF==Connections[i].sigT && !Connections[c].del) found = true;
1556                                        if (found) {
1557                                            console.log(i,c)
1558                                            console.log(Connections[i])
1559                                            break
1560                                        }
1561                                    }
1562                                    console.log(found)
1563                                    */
1564                                    if (!found) $('#ss_E_selection').append(tdadd);
1565                                    //}
1566                                    setDraggables();
1567                                    noSig=false;
1568                                }
1569                            }
1570                        }
1571                    }
1572                }
1573        }}
1574        if (connCount>0 && connShown==0) $('#ss_E_selection').append('<tr colspan=3><td class="td_sig_mini">Connections filtered</td></tr>'); //'+connCount+' 
1575        if (connCount<=0) $('#ss_E_selection').append('<tr colspan=3><td class="td_ss_info"><font color="'+lightgrey+'">No Connections recorded</font></td></tr>');
1576    }
1577    //if (connCount == 0 && id < 31000000) $('#ss_E_selection').append('<tr><td class="td_ss_info" valign="top" colspan="2"><font color="'+lightgrey+'">No special info available</font></td></tr>');
1578    //if (connCount == 0 && currentMap == 10000000) $('#ss_E_selection').append('<tr><td class="td_ss_info" valign="top" colspan="2"><font color="'+lightgrey+'">No connections mapped</font></td></tr>');
1579    //refresh sspane content height
1580    if (theme=='light') $('.ui-ico-varia').css('filter','invert(1)');
1581}
1582
1583function SSI_sov(id,ss) { //console.log('SSI_sov',id,ss)
1584    $('#ss_S_selection').empty();
1585    $('#ss_S_selection').append(SSheadlineHTML('SOVEREIGNTY',3));
1586
1587    //Incursion
1588    if (APIdata_incursions.systems[ss.sid] != undefined && ss.rid!=10000070) {
1589        if (APIdata_incursions.systems[ss.sid].incursion != undefined || APIdata_incursions.systems[ss.sid].invasion != undefined) {                    
1590            var invasion = APIdata_incursions.systems[ss.sid].invasion;
1591            var invasion_add = "";
1592            var state = APIdata_incursions.systems[ss.sid].invasion_state;
1593            if (state == -3) invasion_add='Triglavian System';
1594            if (state == -4) invasion_add='Triglavian Minor Victory System';
1595            if (state == 3) invasion_add='EDENCOM Fortress';
1596            if (state == 4) invasion_add='EDENCOM Minor Victory System';
1597            var txt = '';
1598            if (APIdata_incursions.systems[ss.sid].invasion_state!=undefined){
1599                txt += '<tr><td class="td_ss_info" nowrap colspan="3"><span style="font-family:EEMfontLight;color:'+colorFac(invasion)+'">' +invasion_add+ '</span>&nbsp;&nbsp;</td></tr>';
1600            }
1601            if( APIdata_incursions.systems[ss.sid].staging != undefined) {
1602                txt += '<tr><td class="td_ss_info" nowrap colspan="3"><font color="'+colorFac(APIdata_incursions.systems[ss.sid].incursion)+'">'+getFactionTicker(APIdata_incursions.systems[ss.sid].incursion)+' Incursion Staging System&nbsp;&nbsp;</font></td></tr>';  
1603            } else if ( APIdata_incursions.systems[ss.sid].incursion != undefined){
1604                txt += '<tr><td class="td_ss_info"nowrap colspan="3"><font color="'+colorFac(APIdata_incursions.systems[ss.sid].incursion)+'">'+getFactionTicker(APIdata_incursions.systems[ss.sid].incursion)+' Incursion&nbsp;&nbsp;</font></td></tr>';   
1605            }
1606            $('#ss_S_selection').append(txt); 
1607        }
1608    }
1609    
1610    if (currentMap == 10000000 || id<20000000) {
1611        if (getFactionID(id) != 0) {
1612            var a = getFacName(getFactionID(id))
1613            $('#ss_S_selection').append('<tr><td class="td_ss_info">'+a+'</td></tr>');
1614        } else {
1615            if (APIdata_structures.systems[id] != undefined) {
1616                if (APIdata_structures.systems[id].sovholders != undefined) {
1617                var html = '';
1618                var total = APIdata_structures.systems[id].sovholders[0].total
1619                for (var i in APIdata_structures.systems[id].sovholders) {
1620                    if (APIdata_alliances.alliances[APIdata_structures.systems[id].sovholders[i].aid] != undefined) {
1621                        var an = APIdata_alliances.alliances[APIdata_structures.systems[id].sovholders[i].aid].name
1622                        var asn = APIdata_alliances.alliances[APIdata_structures.systems[id].sovholders[i].aid].shortName
1623                        var col = sovColor(Number(APIdata_structures.systems[id].sovholders[i].aid))
1624                        if (theme=='light') col = d3.rgb(col).darker(1).formatHex();
1625                        if (APIdata_alliances.alliances[APIdata_structures.systems[id].sovholders[i].aid].coalition != undefined) {
1626                            var coa = ', '+APIdata_coalitions.coalitions[APIdata_alliances.alliances[APIdata_structures.systems[id].sovholders[i].aid].coalition].name
1627                        } else { 
1628                            var coa = ''
1629                        }
1630                        var p = APIdata_structures.systems[id].sovholders[i].count+' ('+APIdata_structures.systems[id].sovholders[i].percentage+'%)'
1631                        html +=  '<tr><td class="td_ss_info" valign="top" align="right" nowrap><font color="'+col+'">'+APIdata_structures.systems[id].sovholders[i].count+'&nbsp;&nbsp;&nbsp;</font></td><td class="td_ss_info" valign="top" align="right" nowrap><font color="'+col+'">'+APIdata_structures.systems[id].sovholders[i].percentage+'%&nbsp;&nbsp;&nbsp;</font></td><td class="td_ss_info" valign="top" width="100%"><font color="'+col+'">'+an+' ['+asn+']</font>'+coa+'&nbsp;&nbsp;<font color='+lightgrey+'>'+APIdata_structures.systems[id].sovholders[i].admavg+'</font>&nbsp;&nbsp;<font color='+grey+'>ADM avg</font></td></tr>'
1632                    } /*else {
1633                        var an = '<i>retrieving alliance info failed</i>'
1634                        var asn = ''
1635                        var col = grey
1636                        var p = ''  
1637                    }*/   
1638                }
1639                html +=  '<tr><td class="td_ss_info" valign="top" align="right" nowrap><font color="'+lightgrey+'">'+total+'&nbsp;&nbsp;&nbsp;</font></td><td class="td_ss_info" valign="top" width="100%" colspan="2"><font color="'+lightgrey+'">systems in total</font></td></tr>'
1640                $('#ss_S_selection').append(html);
1641                }
1642            }
1643        }
1644        $('#ss_S_selection').append('<tr colspan="3" height="4"><td></td></tr>');
1645        
1646    } else {
1647        
1648        if (APIdata_structures.systems[id] != undefined) {
1649            if (id > 31000000) {
1650                $('#ss_S_selection').append('<tr><td class="td_ss_info" valign="top" colspan="2"><font color="'+lightgrey+'">Wormhole Space</font></td></tr>');
1651
1652            } else if (APIdata_structures.systems[id].sovID>0 && APIdata_structures.systems[id].sovID < 600000 ) { 
1653                var sovID = APIdata_structures.systems[id].sovID
1654                var col = colorFac(sovID)
1655                var a = getFacName(sovID)
1656                var fwlines='<tr><td class="td_ss_info">'+a
1657                if (ss.fw == true) fwlines += '<font color="'+lightgrey+'"> Faction Warfare System</font>'
1658                fwlines += '</td></tr>'
1659                if (ss.fw == true && APIdata_fw.systems[id] != undefined) {
1660                    if (APIdata_fw.systems[id].fwID != undefined && APIdata_fw.systems[id].fwID != APIdata_structures.systems[id].sovID) {
1661                      fwlines += '<tr><td class="td_ss_info">'+getFacName(APIdata_fw.systems[id].fwID)+' Occupation</td></tr>'
1662                    }
1663                    if (APIdata_fw.systems[id].fwVP != undefined && APIdata_fw.systems[id].fwVPT != undefined ){
1664                     var p = (APIdata_fw.systems[id].fwVP/APIdata_fw.systems[id].fwVPT*100).toFixed(0);  
1665                     fwlines += '<tr><td class="td_ss_info">'+p+' % Contested</td></tr>'    
1666                    } else {
1667                     fwlines += '<tr><td class="td_ss_info">Uncontested</td></tr>'  
1668                    }
1669
1670
1671                }
1672                $('#ss_S_selection').append(fwlines);
1673
1674           } else { // Alliance
1675                var foundsov=false
1676                //TCU
1677                if (APIdata_structures.systems[id].ihb_aid != 0 && APIdata_structures.systems[id].ihb_aid != undefined) { //was tcu_
1678                    foundsov = true;
1679                    var sovID = APIdata_structures.systems[id].ihb_aid //was tcu_
1680                    var col = sovColor(Number(sovID)) 
1681                    if (theme=='light') col = d3.rgb(col).darker(1).formatHex();
1682                    var htmlStrg = '<tr><td class="td_ss_info">TCU';
1683                    if (APIdata_alliances.alliances[sovID] != undefined) {
1684                        htmlStrg += ' - <font color="'+col+'">'+APIdata_alliances.alliances[sovID].name+' [ '+APIdata_alliances.alliances[sovID].shortName+' ]</font>'
1685                        if (APIdata_alliances.alliances[sovID].coalition != undefined) {
1686                            //var mc = APIdata_coalitions.coalitions[APIdata_alliances.alliances[sovID].coalition].memberCount.toLocaleStr
1686ing(Language, { useGrouping: true });
1687                            htmlStrg += ', '+APIdata_coalitions.coalitions[APIdata_alliances.alliances[sovID].coalition].name
1688                        }
1689                    }
1690                    htmlStrg += '</td></tr>'
1691                    var timeline = '';
1692                    if (APIdata_structures.systems[id].tcu_adm != undefined) timeline = 'ADM '+APIdata_structures.systems[id].tcu_adm.toFixed(1)+', ' 
1693                    if (APIdata_campaigns.systems[id] == undefined) APIdata_campaigns.systems[id] = {};
1694                    if (APIdata_campaigns.systems[id].tcu_defense != undefined)  {
1695                        if (timeDiff(APIdata_campaigns.systems[id].tcu_defense) <= 0) {
1696                            col = cmp_ongoing;
1697                            timeline += 'Ongoing Campaign'
1698                        } else {
1699                            col = cmp_reinforced;
1700                            timeline += 'Reinforced. Campaign starts '+formatTime(APIdata_campaigns.systems[id].tcu_defense)
1701                        }
1702                    } else if (timeDiff(APIdata_structures.systems[id].tcu_s) < 0 && timeDiff(APIdata_structures.systems[id].tcu_e) > 0) {
1703                        col = lightergrey;
1704                        timeline += 'Vulnerable until '+formatTime(APIdata_structures.systems[id].tcu_e)
1705                    } else {
1706                        col = lightgrey;
1707                        timeline += 'Invulnerable until '+formatTime(APIdata_structures.systems[id].tcu_s)
1708                    }
1709                    $('#ss_S_selection').append(htmlStrg + '<tr><td class="td_ss_info"><font color="'+col+'">'+timeline+'</font></td></tr>');
1710                    $('#ss_S_selection').append('<tr><td height="4"></td></tr>');
1711                };
1712                //IHUB
1713                if (APIdata_structures.systems[id].ihb_aid != undefined) {
1714                    foundsov = true;
1715                    var sovID = APIdata_structures.systems[id].ihb_aid
1716                    var col = sovColor(Number(sovID))
1717                    if (theme=='light') col = d3.rgb(col).darker(1).formatHex();
1718                    var htmlStrg = '<tr><td class="td_ss_info">IHUB'
1719                    if (APIdata_alliances.alliances[sovID] != undefined) {
1720                        htmlStrg += ' - <font color="'+col+'">'+APIdata_alliances.alliances[sovID].name+' [ '+APIdata_alliances.alliances[sovID].shortName+' ]</font>';
1721                        if (APIdata_alliances.alliances[sovID].coalition != undefined) {
1722                            //var mc = APIdata_coalitions.coalitions[APIdata_alliances.alliances[sovID].coalition].memberCount.toLocaleString(Language, { useGrouping: true });
1723                            htmlStrg += ', '+APIdata_coalitions.coalitions[APIdata_alliances.alliances[sovID].coalition].name
1724                        }
1725                    }
1726                    htmlStrg += '</td></tr>'
1727                    var timeline = '';
1728                    if (APIdata_structures.systems[id].ihb_adm != undefined) timeline = 'ADM '+APIdata_structures.systems[id].ihb_adm.toFixed(1)+', '
1729                    if (APIdata_campaigns.systems[id] == undefined) APIdata_campaigns.systems[id] = {};
1730                    if (APIdata_campaigns.systems[id].ihb_defense != undefined)  {
1731                        if (timeDiff(APIdata_campaigns.systems[id].ihb_defense) <= 0) {
1732                            col = cmp_ongoing;
1733                            timeline += 'Ongoing Campaign'
1734                        } else {
1735                            col = cmp_reinforced;
1736                            timeline += 'Reinforced. Campaign starts '+formatTime(APIdata_campaigns.systems[id].ihb_defense)
1737                        }
1738                    } else if (timeDiff(APIdata_structures.systems[id].ihb_s) < 0 && timeDiff(APIdata_structures.systems[id].ihb_e) > 0) {
1739                        col = lightergrey;
1740                        timeline += 'Vulnerable until '+formatTime(APIdata_structures.systems[id].ihb_e)
1741                    } else {
1742                        col = lightgrey;
1743                        timeline += 'Invulnerable until '+formatTime(APIdata_structures.systems[id].ihb_s)
1744                    }
1745                    $('#ss_S_selection').append(htmlStrg + '<tr><td class="td_ss_info"><font color="'+col+'">'+timeline+'</font></td></tr>');
1746                    $('#ss_S_selection').append('<tr><td height="4"></td></tr>');
1747                };
1748                //OUTPOST
1749                if (APIdata_structures.systems[id].sta_aid != undefined) {
1750                    foundsov = true;
1751                    var sovID = APIdata_structures.systems[id].sta_aid
1752                    var col = sovColor(Number(sovID))
1753                    if (theme=='light') col = d3.rgb(col).darker(1).formatHex();
1754                    var htmlStrg = '<tr><td class="td_ss_info">OUTPOST'
1755                    if (APIdata_alliances.alliances[sovID] != undefined) {
1756                        htmlStrg += ' - <font color="'+col+'">'+APIdata_alliances.alliances[sovID].name+' [ '+APIdata_alliances.alliances[sovID].shortName+' ]</font>'
1757                        if (APIdata_alliances.alliances[sovID].coalition != undefined) {
1758                            //var mc = APIdata_coalitions.coalitions[APIdata_alliances.alliances[sovID].coalition].memberCount.toLocaleStr
1758ing(Language, { useGrouping: true });
1759                            htmlStrg += ', '+APIdata_coalitions.coalitions[APIdata_alliances.alliances[sovID].coalition].name
1760                        }
1761                    }
1762                    htmlStrg += '</td></tr>'
1763                    var timeline = '';
1764                    if (APIdata_structures.systems[id].sta_adm != undefined) timeline = 'ADM '+APIdata_structures.systems[id].sta_adm.toFixed(1)+', '
1765                    if (APIdata_campaigns.systems[id] == undefined) APIdata_campaigns.systems[id] = {};
1766                    if (APIdata_campaigns.systems[id].station_defense != undefined)  {
1767                        if (timeDiff(APIdata_campaigns.systems[id].station_defense) <= 0) {
1768                            col = cmp_ongoing;
1769                            timeline += 'Ongoing Campaign'
1770                        } else {
1771                            col = cmp_reinforced;
1772                            timeline += 'Reinforced. Campaign starts '+formatTime(APIdata_campaigns.systems[id].station_defense)
1773                        }
1774                    } else if (timeDiff(APIdata_structures.systems[id].sta_s) < 0 && timeDiff(APIdata_structures.systems[id].sta_e) > 0) {
1775                        col = lightergrey;
1776                        timeline += 'Vulnerable until '+formatTime(APIdata_structures.systems[id].sta_e)
1777                    } else {
1778                        col = lightgrey;
1779                        timeline += 'Invulnerable until '+formatTime(APIdata_structures.systems[id].sta_s)
1780                    }
1781                    $('#ss_S_selection').append(htmlStrg + '<tr><td class="td_ss_info"><font color="'+col+'">'+timeline+'</font></td></tr>');
1782                    $('#ss_S_selection').append('<tr><td height="4"></td></tr>');
1783                };
1784               //FREEPORT
1785                if (APIdata_campaigns.systems[id] == undefined) APIdata_campaigns.systems[id] = {};
1786                if (APIdata_campaigns.systems[id].station_freeport != undefined) { 
1787                    foundsov = true;
1788                    var htmlStrg = '<tr><td class="td_ss_info">FREEPORT</td></tr>'
1789                    var timeline = '';
1790                    if (timeDiff(APIdata_campaigns.systems[id].station_freeport) <= 0) {
1791                        col = cmp_ongoing;
1792                        timeline += 'Ongoing Campaign'
1793                    } else {
1794                        col = cmp_reinforced;
1795                        timeline += 'Campaign starts '+formatTime(APIdata_campaigns.systems[id].station_freeport)
1796                    }
1797                    $('#ss_S_selection').append(htmlStrg + '<tr><td class="td_ss_info"><font color="'+col+'">'+timeline+'</font></td></tr>');
1798                };
1799               if (foundsov == false) $('#ss_S_selection').append('<tr><td class="td_ss_info"><font color="'+lightgrey+'">No sovereign alliance</font></td></tr>')
1800               //REGION SOV
1801               $('#ss_S_selection').append('<tr><td height="4"></td></tr>');
1802               $('#ss_S_selection').append('<tr><td class="td_ss_info">Region Sovereignty<br>'+getToprowSovInfo(ss,true)+'</td></tr>');
1803           }
1804        } else {
1805            //system not in APIdata
1806            $('#ss_S_selection').append('<tr><td class="td_ss_info"><font color="'+lightgrey+'">No sovereign alliance</font></td></tr>')
1807        };
1808        $('#ss_S_selection').append('<tr height="100%"><td class="td_ss_info" valign="top"></td></tr>'); 
1809        $('#ss_S_selection').append('<tr height="4"><td></td></tr>');
1810    }
1811};
1812
1813function SSI_hub(id,delay) { //dlog('SSI_hub '+id+' delay '+delay)
1814
1815    if (updating.SSI_hub==undefined) updating.SSI_hub=false;
1816    if (umaproute!=undefined && !updating.SSI_hub) {
1817
1818    updating.SSI_hub=true;
1819
1820    var routeSetTxt = '';
1821
1822    if (Options['set_nav_sec']=='shortest') routeSetTxt = "Shorter route"
1823    if (Options['set_nav_sec']=='secure') routeSetTxt = "Safer route"
1824    if (Options['set_nav_sec']=='avoid00') routeSetTxt = "Avoid nullsec route"
1825    if (Options['set_nav_sec']=='insecure') routeSetTxt = "Less secure route"
1826    if (Options['set_nav_conn_wh'] && !Options['set_nav_conn_jb']) routeSetTxt += " using Wormholes"
1827    if (Options['set_nav_conn_jb'] && !Options['set_nav_conn_wh']) routeSetTxt += " using Jump Bridges"
1828    if (Options['set_nav_conn_wh'] && Options['set_nav_conn_jb']) routeSetTxt += " using Wormholes and Jump Bridges"
1829
1830    var headline='';
1831    headline=SSheadlineHTML('DISTANCES <span style="font-family: EEMfontExtraLight;color:var(--col-txt-highlight)" onClick="toggleSelection(\'set\',\'set_rou_selection\');$(\'#set_mnu_rou\').addClass(\'tab_on\');toggleSettings();">&nbsp;'+routeSetTxt+'</span>',4);
1832
1833    $('#ss_H_selection').empty();
1834    $('#ss_H_selection').append(headline);
1835
1836    if (currentMap == 10000000 || id<30000000) {
1837            /*
1838            30000142	Jita	           448611	 141
1839            30002187	Amarr	             230483	2186
1840            30002510	Rens	          162658	2509
1841            30002659	Dodixie	           160685	2658
1842            30002053	Hek	               109558	2052
1843            30003862	Agil	              64274	3861
1844            30002385	Teonusude	         62776	2384
1845            30045329	Ichoriya	          52261	5405
1846            30001671	Tash-Murkon Prime	 52161	1670
1847            30004969	Oursulaert	        52153	4968
1848            */ 
1849            $('#ss_H_selection').append('<tr><td class="td_ss_info" valign="top" colspan="4"><font color="'+lightgrey+'">Not available at regions</font></td></tr>')
1850
1851    } else {
1852        if ($('#tab_H_ss').hasClass('tab_ss_on')==true && id != 0) {
1853
1854            $('#ss_H_selection').append('<tr><td colspan="4"><table id="ss_H_content" width="100%" cellspacing="0" cellpadding="0" class="opt_table">'); 
1855
1856            // top row
1857            var row  = '<tr class="opt_row_info" style="height:25px !important">';
1858                row += '<td id="ss_H_content_th_0" onclick="sortBy(0,\'ss_H_content\')" class="td_sig_mini" title="Sort by name">&nbsp;Destination</td>';
1859                row += '<td id="ss_H_content_th_1" onclick="sortBy(1,\'ss_H_content\')" class="td_sig_mini" align="right" title="Sort by distance">&nbsp;Jumps</td>';
1860                row += '<td></td><td></td>';
1861                row += '</tr>';
1862            $('#ss_H_content').append(row);
1863
1864            var j = ''//'<font color="'+lightgrey+'">loading</font>'
1865            var row = '';
1866            var closestITCsid = 0;
1867
1868            if (eeechoes && umap.graph.nodes(id+"") != undefined) { // closest ITC
1869
1870                if (umap.graph.nodes(id+"").i_s != undefined) {
1871                    closestITCsid = umap.graph.nodes(id+"").i_s+30000000;
1872                    var ss = findInSolarSystems('getSsObject',closestITCsid);
1873                    //var nom = ss.sn //+ '<span style="color:var(--col-lightgrey)" title="Closest Trade Center"> (ITC)</span>';
1874                    var infotxt='';
1875                    for (var e in ee_ITC) {
1876                        if (closestITCsid==ee_ITC[e].sid) {
1877                            /*if (ee_ITC[e].m!="") {
1878                                j = '<span style="color:var(--col-lightgrey)" title="Closest Trade Center">ITC Route to '+ee_ITC[e].p.replace(ss.sn+' ','')+' - '+ee_ITC[e].m+' - '+ee_ITC[e].n+'</span>';
1879                            } else {
1880                                j = '<span style="color:var(--col-lightgrey)" title="Closest Trade Center">ITC Route to '+ee_ITC[e].p.replace(ss.sn+' ','')+' - '+ee_ITC[e].n+'</span>';
1881                            }*/
1882                            j = 'Closest Trade Center: '+ee_ITC[e].p+'-'+ee_ITC[e].m+' - '+ee_ITC[e].n
1883                            //'<span style="color:var(--col-lightgrey)" title="Closest Trade Center">ITC Route to '+ee_ITC[e].p+' - '+ee_ITC[e].m+'</span>';
1884                            
1885                            break;
1886                        }
1887                    }
1888                    row += '<tr id="hub_tr_'+closestITCsid+'" class="ssInfoRow"><td class="td_ss_info" style="white-space: nowrap" onClick="panTo('+closestITCsid+',true)">'+ss.sn+'<span style="color:var(--col-lightgrey)" title="'+j+'"> (ITC)</span>'+'&nbsp;&nbsp;</td>
1888<td width="35" class="td_ss_info" align="right" style="white-space: nowrap" id="hub_j_'+closestITCsid+'">'+infotxt+'</td><td id="hub_'+closestITCsid+'" class="td_ss_info" width="100%" valign="middle" style="white-space: nowrap"></td>'
1889                    row += '<td class="td_sig_mini" align="right"><span onClick="ee_setCurrent('+id+');setRoute('+id+','+closestITCsid+');"><img id="hub_rou_sd_'+closestITCsid+'" class="ui-ico-varia" src="img/icon/rou.png" width="15" height="15" style="opacity:0.8;padding-right:3px;margin-top:-1px;margin-bottom:-1px;"></span></td></tr>'
1890                    $('#ss_H_content').append(row) //, #infopane_bm_selection
1891                    row='';
1892                }
1893            }
1894            //display custom systems
1895            var infotxt='';
1896            //if (eeechoes && characterLocationID==0) infotxt="No current system selected"
1897            var bcounter = 0;
1898            var counter = 0;
1899
1900            Bookmarks = Bookmarks.filter((v,i,a)=>a.findIndex(t=>(t.id === v.id))===i);
1901
1902            for (var i in Bookmarks) {
1903                if (Bookmarks[i].del==undefined) bcounter += 1;
1904                if (Bookmarks[i].del==undefined && Bookmarks[i].dst == undefined && Bookmarks[i].sid >
1904 30000000 && Bookmarks[i].sid!=closestITCsid) {
1905                    //if (Bookmarks[i].id!=id) {
1906
1907                        counter += 1;
1908
1909                        if (Bookmarks[i].sid ==undefined) Bookmarks[i].sid=Bookmarks[i].id; //quirks errors after change
1910                        if (Bookmarks[i].id ==undefined ) Bookmarks[i].id=Bookmarks[i].sid;  //quirks errors after change
1911
1912                        var ss = findInSolarSystems('getSsObject',Bookmarks[i].sid);
1913
1914                        // whname
1915                        var whname = '';
1916                        if (ss.sid>10000000 && ss.sid<40000000) {
1917                            if (Options['set_share_whnames']) {
1918                                for (var n in WHnames_Shared) {
1919                                    if (WHnames_Shared[n].id == ss.sid && WHnames_Shared[n].del != true) {
1920                                        whname = WHnames_Shared[n].name;
1921                                        break;
1922                                    }
1923                                }
1924                            } else {
1925                                for (var n in WHnames) {
1926                                    if (WHnames[n].id == ss.sid && WHnames[n].del != true) {
1927                                        whname = WHnames[n].name;
1928                                        break;
1929                                    }
1930                                }
1931                            }
1932                        }
1933
1934                        // contextmenu
1935                        var onclick='panTo('+Bookmarks[i].sid+',true)'; //directly goto system
1936                        var oncontextmenu="$('#mnu_bm_txt').attr('bmid',"+Bookmarks[i].id+");selectSystem("+Bookmarks[i].sid+");clicked_handler("+Bookmarks[i].sid+","+Bookmarks[i].id+")"; 
1937                        var onclick='panTo('+Bookmarks[i].sid+',true)'; //directly goto system
1938                        var oncontextmenu="$('#mnu_bm_txt').attr('bmid',"+Bookmarks[i].id+");selectSystem("+Bookmarks[i].sid+");clicked_handler("+Bookmarks[i].sid+","+Bookmarks[i].id+")"; 
1939                        if (enable_contextMenus && Bookmarks[i].id < 20000000) {
1940                            var oncontextmenu="$('#mnu_bm_txt').attr('bmid',"+Bookmarks[i].id+");clicked_region("+Bookmarks[i].id+",undefined,window.event.clientX,window.event.clientY)"; 
1941                        } else if (enable_contextMenus && Bookmarks[i].id < 30000000) {
1942                            var oncontextmenu="$('#mnu_bm_txt').attr('bmid',"+Bookmarks[i].id+");clicked_constellation("+Bookmarks[i].id+",undefined,window.event.clientX,window.event.clientY)";
1943                        } else if (enable_contextMenus && Bookmarks[i].id > 60000000) {
1944                            var oncontextmenu="$('#mnu_bm_txt').attr('bmid',"+Bookmarks[i].id+");clicked_station("+Bookmarks[i].id+","+Bookmarks[i].sid+",window.event.clientX,window.event.clientY)"; 
1945                        } else if (enable_contextMenus) {
1946                            var oncontextmenu="$('#mnu_bm_txt').attr('bmid',"+Bookmarks[i].id+");selectSystem("+Bookmarks[i].sid+");clicked_solarsystem("+Bookmarks[i].sid+","+Bookmarks[i].sid+",window.event.clientX,window.event.clientY)"; 
1947                        }
1948
1949                        if (whname!='') {
1950                            var nom = '<span style="color:'+col_namedsys+'">'+whname+'</span>';
1951                        } else {
1952                            var nom = Bookmarks[i].sn;
1953                            if (nom==null) nom = Bookmarks[i].name;
1954                        }
1955
1956                        if (Bookmarks[i].id>60000000) {
1957                            if (!eeechoes && ss.itc==undefined) nom = nom + '<span style="color:var(--col-lightgrey)" title="'+Bookmarks[i].name+'"> ( S )</span>';
1958                            if (eeechoes && ss.ee_itc==undefined) nom = nom + '<span style="color:var(--col-lightgrey)" title="'+Bookmarks[i].name+'"> ( S )</span>';
1959                            if (eeechoes && ss.ee_itc) nom = nom + '<span style="color:var(--col-lightgrey)" title="'+Bookmarks[i].name+'"> ( ITC )</span>';
1960                            if (!eeechoes && ss.itc) nom = nom + '<span style="color:var(--col-lightgrey)" title="'+Bookmarks[i].name+'"> ( HUB )</span>';
1961                        }
1962                        row += '<tr id="hub_tr_'+Bookmarks[i].id+'" class="ssInfoRow" onclick="'+onclick+'" oncontextmenu="'+oncontextmenu+'"><td class="td_ss_info"  style="white-space: nowrap" onClick="panTo('+Bookmarks[i].sid+',true)">'+nom+'&nbsp;&nbsp;</td>
1962<td width="35" class="td_ss_info" align="right" style="white-space: nowrap" id="hub_j_'+Bookmarks[i].id+'">'+infotxt+'</td><td id="hub_'+Bookmarks[i].id+'" class="td_ss_info" width="100%" valign="middle" style="white-space: nowrap"></td>'
1963                        if (characterLocationID!=0 && id != Bookmarks[i].sid) {  
1964                            row += '<td class="td_sig_mini" align="right"><span onClick="setWaypoint(true,'+Bookmarks[i].id+','+Bookmarks[i].sid+')"><img id="hub_rou_sd_'+Bookmarks[i].id+'" class="ui-ico-varia" src="img/icon/setDestination.png" width="24" height="15" style="opacity:0.4;padding-right:3px;margin-top:-1px;margin-bottom:-1px;"></span></td></tr>'
1965                        } else if (characterLocationID!=0 && eeechoes && id != Bookmarks[i].sid) {
1966                            row += '<td class="td_sig_mini" align="right"><span onClick="ee_setCurrent('+id+');setRoute('+id+','+Bookmarks[i].sid+');"><img  id="hub_rou_sd_'+Bookmarks[i].id+'" class="ui-ico-varia" src="img/icon/rou.png" width="15" height="15" style="opacity:0.8;padding-right:3px;margin-top:-1px;margin-bottom:-1px;"></span></td></tr>'
1967                        } else {
1968                            row += '<td></td></tr>'
1969                        } 
1970                    //}
1971                }
1972            }
1973
1974            //add current route
1975            /*if (tablet) headline=SSheadlineHTML('CURRENT ROUTE',4)*/
1976            if (bcounter==0) row = headline+'<tr><td class="td_ss_info" valign="top" colspan="4"><font color="'+lightgrey+'">No solarsystems bookmarked</font></td></tr>'
1977            if (counter==0 && bcounter>0) row = headline+'<tr><td class="td_ss_info" valign="top" colspan="4"><font color="'+lightgrey+'">No bookmarked solarsystems set to display distances</font></td></tr>'
1978            
1979            $('#ss_H_content').append(row) //, #infopane_bm_selection
1980            $('#ss_H_selection').append('</table></td></tr><tr colspan="4" height="4"><td></td></tr>');
1981
1982            if (closestITCsid!=0) getCurrentRoute([{"id":id,"sid":id,"typ":'waypoint'},{"id":closestITCsid,"sid":closestITCsid,"typ":'waypoint'}],true); 
1983
1984            clearTimeout(delayer);
1985            delayer = setTimeout(function(){ //console.log('SSI_hub esi_route calls '+delay)
1986                /*esi_route(id,30000142,true,'Jita') 
1987                esi_route(id,30002187,true,'Amarr') 
1988                esi_route(id,30002659,true,'Dodixie') 
1989                esi_route(id,30002510,true,'Rens')*/
1990                for (var i in Bookmarks) {
1991                    if (Bookmarks[i].del==undefined) {
1992                        //esi_route(id,Bookmarks[i].sid,true,Bookmarks[i].name)
1993                        var waypoints = [];
1994                        waypoints.push({"id":id,"sid":id,"typ":'waypoint'})
1995                        waypoints.push({"id":Bookmarks[i].id,"sid":Bookmarks[i].sid,"typ":'waypoint'})
1996                        getCurrentRoute(waypoints,true);
1997                    } 
1998                }; //if (Bookmarks[i].id!=id) { }
1999 
2000            },delay);
2001        }
2002    }
2003    
2004    /*  try {retryTimeout = null;} catch(e) {};
2005        } else {
2006        retryTimeout = false; 
2007        clearTimeout(retryTimeout);
2008        retryTimeout = setTimeout(function(){SSI_hub(id,delay)},300);
2009    */
2010
2011        updating.SSI_hub=false;
2012
2013    }
2014};
2015
2016function SSI_plp(ss) { //only echoes
2017
2018    var P='_P_';
2019    $('#ss_P_selection').empty();
2020    $('#ss_P_list_selection').empty();    
2021    
2022    if (ss.sid<30000000) {
2023        $('#ss'+P+'selection').append(SSheadlineHTML('PLANETARY PRODUCTION',2));
2024        $('#ss'+P+'selection').append('<tr><td class="td_ss_info" valign="top" colspan="2"><font color="'+lightgrey+'">Not available at regions</font></td></tr>');
2025        return;
2026    } 
2027
2028    if (supersearch_pla_initiated==false) {
2029        // $('#ss'+P+'selection').append(SSheadlineHTML('Loading a lot of planetary data.... please wait aptiently<br>The data will get cached and stored for your subsequent visits.',2));
2030        showStatusMessage (3,'Loading planetary data ... please stand by', blue, undefined, true);
2031        $.getJSON( "mapdata/echoes_supersearch_pla.txt?3", function( data ) { supersearch_pla = data; closeStatusMessage ();supersearch_pla_initiated=true; SSI_plp(ss); });
2032        return;
2033    }
2034
2035    $('#ss'+P+'selection').append(SSheadlineHTML('PLANETARY PRODUCTION',2));
2036    $('#ss'+P+'selection').append('<tr><td><table width="100%" border="0" cellpadding="0" cellspacing="0"><tr height="8"><td></td></tr></table>');
2037
2038    var results =  $.grep(supersearch_pla.planets, function(d){ return d.sid == ss.sid });
2039
2040    for (var p in results) {
2041
2042        var row = '';
2043        //echoes_PIselector//"name":"Base Metals","id":1,"planets":[1,8,2,3]
2044
2045        // row 1
2046        row += '<table width="100%" border="0" cellpadding="0" cellspacing="0" style="margin-bottom:8px;">'
2047        row += '<tr height="30" class="opt_row_h_d2" style="background-color:var(--col-bars)">'
2048        row += '<td class="td_sig" width="24" align="left" valign="middle"><span stlye="padding-top:1px;"></span></td>';
2049        row += '<td colspan="2" class="sta_nom td_sig_hl" id="p_'+results[p].id+'"><span style="color:var(--col-lightgrey)">'+ss.sn+'</span> '+results[p].p+'</td>' //highlighting disabled for now
2050        row += '</tr>'   
2051
2052        /*var materials = JSON.parse(results[p].m);
2053        var richness = JSON.parse(results[p].r);
2054        var output = JSON.parse(results[p].o);
2055        var abundance = JSON.parse(results[p].a);*/
2056        var materials = results[p].m
2057        var richness = results[p].r
2058        var output = results[p].o
2059        var abundance = results[p].a
2060
2061
2062        for (var m in materials) {
2063            
2064            var c='var(--col-bars)'
2065            //if (theme=='dark') c = d3.rgb(abundanceColor(abundance[m])).darker(7).formatHex()
2066            // materials
2067            row += '<tr class="opt_row_h_d2" style="background-color:'+c+'">'
2068            row += '<td class="td_sig_mini" valign="" title="'+getRichTxt(richness[m])+'"><img src="img/icon/r'+richness[m]+'.png" width="12" height="12" style="opacity:0.8;margin-left:3px;margin-top:1px;"></td>'
2069            row += '<td class="td_sig_mini"><span class="mats mat_'+results[p].m+'" style="color:var(--col-txt)">'+echoes_PIselector[materials[m]-1].name+'</span>&nbsp;</td><td class="td_sig_mini" align="right"><span style="color:var(--col-lightgrey)">'+output[m]+' /h, '+(abundance[m]*100).toFixed(0)+' %</span>&nbsp</td></tr>' // ('+output[m]+')
2070            row += '<tr height="3" style="background-color:'+c+'"><td colspan="3"><table width="'+(abundance[m]*100).toFixed(0)+'%"><tr height="2" style="background-color:'+abundanceColor(abundance[m])+'"><td></td></tr></table></td><tr>'
2071        }
2072        row += '</table>'  
2073        $('#ss'+P+'selection').append(row);
2074    }
2075    $('#ss'+P+'selection').append('</td></tr>');
2076    $('#ss'+P+'selection').append('<tr colspan="3" height="4"><td></td></tr>');
2077
2078}
2079
2080function getRichTxt(r) {
2081    if (r==4) return 'PERFECT';
2082    if (r==3) return 'RICH';
2083    if (r==2) return 'MEDIUM';
2084    if (r==1) return 'POOR';
2085}
2086
2087function SSI_sta(ss) { //console.log('SSI_sta ss '+ss)
2088
2089    if (typeof ss === 'object' && ss !== null) {
2090    } else {
2091        var ss = findInSolarSystems('getSsObject',ss);
2092    }
2093
2094    var sid = ss.sid;
2095    var sn = ss.sn;
2096
2097    $('#ss_N_selection').empty();
2098    var title = 'STATIONS';
2099    if ($('#tab_A_ss').hasClass('tab_ss_on')==true) title = 'STATIONS AND AGENTS'
2100    $('#ss_N_selection').append(SSheadlineHTML(title,3));
2101    
2102    if (currentMap == 10000000 || sid < 30000000) {
2103
2104        if (eeechoes) {
2105            $('#ss_N_selection').append('<tr><td class="td_ss_info" valign="top" colspan="2">'+ee_getRegionITC(ss.sid)+'</td></tr>');
2106        } else {
2107            $('#ss_N_selection').append('<tr><td class="td_ss_info" valign="top" colspan="2"><font color="'+lightgrey+'">No info available</font></td></tr>')
2108        }
2109        
2110    } else {
2111        if ($('#tab_N_ss').hasClass('tab_ss_on')==true && sid != 0 || $('#tab_A_ss').hasClass('tab_ss_on')==true && sid != 0) {     
2112            var row = '';
2113            var result =  $.grep(supersearch_sta, function(d){ if (eeechoes) {return ( d.sid == sid && d.eoonly==undefined )} else {return ( d.sid == sid && d.eeonly==undefined )} });
2114            result.sort(function(a, b) {
2115                if (a.nom > b.nom) return 1;
2116                if (a.nom < b.nom) return -1;                   
2117                return 0;
2118            });
2119            var c='var(--col-bars)'
2120            if ($('#tab_A_ss').hasClass('tab_ss_on')==true) var c='var(--col-bars)'
2121            var opac=1;
2122            
2123            if (result.length==0) $('#ss_N_selection').append('<tr><td class="td_ss_info"colspan="3"><font color="'+lightgrey+'">No NPC station in system</font></td></tr>'); 
2124
2125            for (var i in result) {
2126                
2127                        var row='';
2128                        var prefix='';
2129                        var nom = result[i].nom.replace(sn+' ','').replace('- Moon ',' ')
2130                        var loc = nom.split(' - ')[0]
2131                        if (loc.length>8) {
2132                            
2133                            nom = nom.split(' - ')[1] 
2134                            if (loc.includes("(")) {
2135                                brackets = loc.split(' (')[1]
2136                                brackets = brackets.split(')')[0]
2137                                prefix = brackets +' - '
2138                                loc = loc.replace(' ('+brackets+')','')
2139                                loc = loc.replace('Griklaeum','G')
2140                            } else if (loc.includes('- Deathless Custodians')) {
2141                                loc = loc.replace('- Deathless Custodians','')
2142                            }
2143                            /*
2144                            New Caldari II (Matias) - Kaalakiota Corporation F...
2145                            Amarr VIII (Oris) - Moon 4 - Expert Distribution R...
2146                            Amarr VIII (Oris) - Emperor Family Academy
2147                            Pator V (Vakir) - Moon 1 - Quafe Company Factory
2148                            Luminaire VII (Caldari Prime) - Federal Administra...
2149                            Luminaire VII (Caldari Prime) - Moon 4 - Federal A...
2150                            Pator VII (Kulheim) - Moon 1 - Republic Fleet Test...
2151                            Pator V (Vakir) - Republic Fleet Logistic Support
2152                            New Caldari V (Oniteseru) - Moon 2 - House of Reco...
2153                            Luminaire III (Astrin) - Moon 1 - Duvolle Laborato...
2154                            Uplingur IV (Ndoria) - Moon 16 - Nurtura Plantatio...
2155                            Kor-Azor Prime IV (Eclipticum) - Moon Griklaeum - ...
2156                            New Caldari I (Matigu) - Poksu Mineral Group Miner...
2157                            Pator III (Huggar) - Moon 2 - Republic Security Se...
2158                            Pator VII (Kulheim) - Republic Security Services A...
2159                            Yulai IX (Kjarval) - CONCORD Bureau
2160                            Luminaire VII (Caldari Prime) - Moon 1 - Federatio...
2161                            Luminaire VII (Caldari Prime) - Moon 6 - Federatio...
2162                            Luminaire VII (Caldari Prime) - Moon 5 - Federatio...
2163                            Kor-Azor Prime IV (Eclipticum) - Moon Griklaeum - ... // <<< only named Moon in New Eden
2164                            Amarr VI (Zorast) - Moon 2 - Theology Council Trib...                        
2165                            */
2166                        } else {
2167                             nom = nom.split(' - ')[1]   
2168                        }
2169                            
2170                        var stasrv =''
2171                        if (eeechoes) {
2172                            if (result[i].itc) stasrv+= '<font color="'+blue+'">Interstellar Trading Center</font>';
2173                        } else {
2174                            if (result[i].srv!=undefined) {
2175                                if (theme=='light') {
2176                                    if (result[i].srv.indexOf('C')!=-1) stasrv+=' <font color="'+d3.rgb(lightgrey).darker(1).formatHex()+'">Cloning</font>&nbsp;' 
2177                                    if (result[i].srv.indexOf('R')!=-1) stasrv+=' <font color="'+d3.rgb(green).darker(1).formatHex()+'">Repair</font>&nbsp;' 
2178                                    if (result[i].srv.indexOf('F')!=-1) stasrv+=' <font color="'+d3.rgb(orange).darker(1).formatHex()+'">Factory</font>&nbsp;' 
2179                                    if (result[i].srv.indexOf('L')!=-1) stasrv+=' <font color="'+d3.rgb(blue).darker(1).formatHex()+'">Research</font>&nbsp;' 
2180                                } else {
2181                                    if (result[i].srv.indexOf('C')!=-1) stasrv+=' <font color="'+lightgrey+'">Cloning</font>&nbsp;' 
2182                                    if (result[i].srv.indexOf('R')!=-1) stasrv+=' <font color="'+green+'">Repair</font>&nbsp;' 
2183                                    if (result[i].srv.indexOf('F')!=-1) stasrv+=' <font color="'+orange+'">Factory</font>&nbsp;' 
2184                                    if (result[i].srv.indexOf('L')!=-1) stasrv+=' <font color="'+blue+'">Research</font>&nbsp;' 
2185                                }
2186                            }
2187                        }
2188                        
2189                        //var reproc=' REPROCESSING BASE '+(100*result[i].rE)+'%'
2190                        var reproc="";
2191                    
2192                        if (eeechoes) {
2193                            //
2194                        } else {
2195                            if (Number(result[i].rE)<0.5) reproc+=" <font color='"+red+"'>Bad Reprocessing</font>"
2196                            if (Number(result[i].rS)<0.05) reproc+=" <font color='"+green+"'>Low Reprocessing Tax</font>"
2197                        }
2198                
2199                        if (tablet && enable_contextMenus) {
2200                            var oncontextmenu='oncontextmenu="clicked_station('+result[i].id+','+result[i].sid+',window.event.clientX,window.event.clientY);"'; 
2201                        } else {
2202                            var oncontextmenu='';
2203                        }
2204                        var bookmarker = ' <img class="ui-ico-varia" id="img_'+result[i].id+'_bm" class="infopane_img" src="img/icon/bmk_on.png" width="11" height="11" onClick="bookmarks_toggle('+result[i].id+','+result[i].sid+')" style="opacity:0.2;padding-left:2px;">';
2205                        var ml = "";
2206                        //if (!tablet) ml = "margin-left:4px;";
2207                
2208                        // row 1
2209                        row += '<table width="100%" border="0" cellpadding="0" cellspacing="0" '+oncontextmenu+' style="background-color:'+c+';margin-bottom:4px;'+ml+'opacity:'+opac+';" cellspacing="1"><tr class="opt_row_h_d2">'
2210                        row += '<td class="td_sig" width="40" align="left" valign="middle" title="Planet/Moon" alt="Planet/Moon" style="white-space:nowrap;"><span stlye="padding-top:1px;">&nbsp;'+loc+'&nbsp;</span></td>';
2211                        row += '<td class="sta_nom td_sig_hl" id="xxxi_sta_'+result[i].id+'">'+prefix+nom+bookmarker+'</td>' //highlighting disabled for now
2212                        if (inSync) {  
2213                            row += '<td class="td_sig_mini" align="right" valign="bottom"><span onClick="setWaypoint(true,'+result[i].id+','+result[i].sid+')"><img class="ui-ico-varia" src="img/icon/setDestination.png" width="24" height="15" style="opacity:0.4;padding-right:3px;margin-top:-1px;"></span></td>'
2214                        } else {
2215                            row += '<td class="td_sig_mini"></td>'
2216                        }
2217                        row += '</tr>'   
2218
2219                        var ucol = '';
2220                        if (result[i].u<17) ucol = lowsec;
2221                        if (result[i].u<10) ucol = nullsec;
2222                        if (result[i].u<0) {ucol = grey;result[i].u='?';}
2223                
2224                        // row 2
2225                        row += '<tr class="opt_row_h_d2">'
2226                        if (eeechoes) {
2227                            var infotxt = '';
2228                            if (ss.ee_itc==true) {
2229                                for (let itci in ee_ITC) {
2230                                    //nom: Amarr VIII (Oris) - Moon 4 - Expert Distribution Retail Center
2231                                    //"p":"Amarr VIII (Oris)","m":"4","n":"Expert Distribution Retail Center"
2232                                    if (result[i].nom==ee_ITC[itci].p+' - Moon '+ee_ITC[itci].m+' - '+ee_ITC[itci].n) infotxt = 'ITC';
2233                                }
2234                            }
2235                           row += '<td class="td_sig_mini3" valign="top" style="white-space: nowrap;">&nbsp;';//+infotxt;
2236                        } else if (result[i].u>0) {
2237                           row += '<td class="td_sig_mini3" valign="top" title="Undock range" alt="Undock range" style="white-space: nowrap;">&nbsp;<span style="color:'+ucol+'">'+result[i].u+ ' km&nbsp;</span>' 
2238                        } else {
2239                           row += '<td class="td_sig_mini3" valign="top" title="Undock range" alt="Undock range" style="white-space: nowrap;">&nbsp;&nbsp;</span>' 
2240                         }
2241                        
2242                            //if (Characters.scopes!=undefined) if (inSync && Characters.scopes.indexOf('open_window')!=-1) row += '<span onClick="showInfoIngame('+result[i].id+')"><img src="img/icon/info.png" height="14" width="14" style="opacity:0.4;vertical-align:middle;padding-bottom:1px;padding-right:3px;"></span>' // does not work with stations or solarsystems
2243                        row += '</td>'
2244                        if (eeechoes) {
2245                            if (infotxt=='ITC') infotxt = 'Interstellar Trade Center';
2246                            row += '<td class="td_sig_mini3" style="opacity:0.8">'+infotxt+'&nbsp;</td>' 
2247                        } else {
2248                            row += '<td class="td_sig_mini3" style="opacity:0.6">'+stasrv+reproc+'&nbsp;</td>' 
2249                        }
2250                        if (inSync) {
2251                            row += '<td class="td_sig_mini3" align="right" valign="top"><span onClick="setWaypoint(false,'+result[i].id+','+result[i].sid+')"><img class="ui-ico-varia" src="img/icon/setWaypoint.png" width="24" height="15" style="opacity:0.4;padding-right:3px;margin-top:-1px;margin-bottom:-1px;"></span></td>'
2252                        } else {
2253                            row += '<td class="td_sig_mini3"></td>'
2254                        }
2255                        if (i < result.length-1 && $('#tab_A_ss').hasClass('tab_ss_on')==false) row += '</tr></table>'  
2256            $('#ss_N_selection').append(row)
2257            if($('#tab_A_ss').hasClass('tab_ss_on')) SSI_agt_lines(result[i].id)
2258            }
2259            SSI_agt_lines(sid,true); 
2260        }
2261    }
2262    $('#ss_N_selection').append('<tr colspan="3" height="4"><td></td></tr>');
2263    paintBMStars();
2264
2265    // POS
2266    var result =  $.grep(Structures, function(d){ return ( d.sid == sid && d.del==undefined ) });
2267    $('#ss_N_selection').append(SSheadlineHTML('CITADELS',3));
2268    if (result.length==0) $('#ss_N_selection').append('<tr colspan=3><td class="td_ss_info"><font color="'+lightgrey+'">No Structures recorded</font></td></tr>'); 
2269
2270    for (var i in Structures) { 
2271        if (Structures[i].sid==sid && Structures[i].del==undefined) {
2272
2273                        var onClick ='';
2274                        var onContextmenu='';
2275
2276                        if (enable_contextMenus) {
2277                            onContextmenu =' oncontextmenu="posClicked('+i+');displayContextMenu(window.event.clientX,window.event.clientY,\'pos\');"' 
2278                        } 
2279                        onClick =' onmousedown="event.stopPropagation();" onclick="event.stopPropagation();posClicked('+i+');if(!merging) displayContextMenu(window.event.clientX,window.event.clientY,\'pos\');"' 
2280                        
2281                        var loc = "<!--[?]-->";
2282
2283                        var standingCol = 'transparent';
2284                        if (Structures[i].standing!=undefined) standingCol = posStandingColor(Structures[i].standing)
2285
2286                        // row 1
2287                        row  = '<table width="100%" border="0" cellpadding="0" cellspacing="0" style="background-color:'+c+';margin-bottom:4px;" cellspacing="1" '+onContextmenu+'><tr class="opt_row_h_d2">';
2288                        row += '<td id="posStanding_'+i+'" class="td_sig_ss" width="5" rowspan="2" style="background-color:'+standingCol+';"><div id="posdel_'+i+'_confirm" class="td_nav anim setconfirm confirm" onmousedown="event.stopPropagation();" onClick="deleteStructure('+i+')">DELETE</div></td>';
2289                        row += '<td class="td_sig" width="40" align="left" valign="middle" title="" alt=""><span stlye="padding-top:1px;" '+onClick+'>&nbsp;'+loc+'&nbsp;</span></td>';
2290                        var sep = '';
2291                        if (Structures[i].name!='' && Structures[i].type!='' && Structures[i].type!=undefined && Structures[i].type!=null) sep = ' - ';
2292                        row += '<td class="sta_nom td_sig_hl" '+onClick+'><span id="POSname_'+i+'">'+Structures[i].name+'</span><span id="POSsep_'+i+'" style="font-family:EEMfontLight;color: var(--col-txt-2)">'+sep+'</span><span id="POStype_'+i+'" style="font-family:EEMfontLight;color: var(--col-txt-2)">'+Structures[i].type+'</span></td>';                        
2293                        row += '<td width="16" onClick="toggleConfirmation(\'posdel_'+i+'\',undefined,60);" style="text-align:right"><img class="ui-ico-varia" src="img/icon/Delete_white Filled-100.png" width="16" height="16" style=";opacity:0.4;"></td>' //Delete Structure
2294                        row += '</tr>'
2295
2296                        // row 2
2297                        row += '<td class="td_sig" '+onClick+'>&nbsp;<!--[?]-->&nbsp;</td>';
2298                        row += '<td id="POStxt_'+i+'"class="td_sig_mini3" '+onClick+'></td>';
2299                        var state = Structures[i].state;
2300                        if (state==undefined) state = 0;
2301                        row += '<td id="posState_'+i+'" colspan="2" valign="bottom" class="td_sig_mini3" align="right" style="white-space:nowrap;color:'+colorPOSstate[state]+'" '+onClick+'>'+localized['posState_'+state]+'&nbsp;</td>';
2302                        row += '</tr></table>'
2303                        $('#ss_N_selection').append(row);
2304                        posClicked(i,true); //update but do not open menu
2305
2306        }
2307    }
2308};
2309
2310function SSI_agt_lines(stationID,AIS) { //console.log('SSI_agt_lines '+stationID)
2311    
2312      if ($('#tab_A_ss').hasClass('tab_ss_on')==true && stationID != 0) {   
2313            var row = '<tr><td>';
2314            var query = 'd.str == stationID';
2315            if (AIS) query = 'd.str == undefined && d.sid == stationID'; 
2316        
2317            var result =  $.grep(supersearch_agt, function(d){ return eval(query) });
2318            result.sort(function(a, b) {
2319                if(a.str < b.str) return -1;
2320                if(a.str > b.str) return 1;
2321                if (a.lvl > b.lvl) return 1;
2322                if (a.lvl < b.lvl) return -1; 
2323                if (a.nom > b.nom) return 1;
2324                if (a.nom < b.nom) return -1;                   
2325                return 0;
2326            });
2327            var c='rgba(20,20,20,0)'
2328            var opac=1;
2329            var oldloc=0;
2330          
2331      
2332            if (result[0] != undefined && AIS==true && stationID<60000000) {
2333                row += '<table width="100%" border="0" cellpadding="0" cellspacing="0" style="background-color:var(--col-bars);margin-bottom:4px;" cellspacing="1"><tr class="opt_row_h_d2">'
2334                row += '<td class="td_sig" width="40" align="left" valign="middle"><span style="color:'+grey+';font-size:1.15rem;"></span></td>';
2335                row += '<td class="td_sig_mini">&nbsp;</td>'
2336                row += '<td class="td_sig_mini" align="right"></td>'
2337                row += '</tr>'                    
2338                row += '<tr class="opt_row_h_d2"><td></td><td class="td_sig_hl">Agents in Space</td><td></td></tr></table>'  
2339                $('#ss_N_selection').append(row)  
2340                row='';
2341            }
2342          
2343            //if (agtCount==0) $('#ss_N_selection').append('<tr colspan=3><td class="td_ss_info"><font color="'+lightgrey+'">No agent in system</font></td></tr>'); 
2344          
2345            for (var i in result) {
2346                
2347                if (i>0 && oldloc!=result[i].str) row += '</td></tr><tr height="1"><td class="uiLine"></td></tr><tr><td>'
2348                
2349                var div='';
2350                if (result[i].div==18) {var div = 'R&amp;D'}
2351                if (result[i].div==22) {var div = 'Distribution'}
2352                if (result[i].div==23) {var div = 'Mining'}
2353                if (result[i].div==24) {var div = 'Security'} 
2354                if (result[i].div==25) {var div = 'Business Career'}
2355                if (result[i].div==26) {var div = 'Exploration Career'}
2356                if (result[i].div==27) {var div = 'Industry Career'}
2357                if (result[i].div==28) {var div = 'Military Career'}
2358                if (result[i].div==29) {var div = 'Advanced Military Career'}
2359                if (result[i].div==37) {var div = 'EverMark'}
2360                
2361                var atp='';
2362                //if (result[i].atp==1) {var atp = 'NonAgent'} //NonAgent
2363                //if (result[i].atp==2) {var atp = 'Basic Agent'} //Basic Agent
2364                if (result[i].atp==3) {var atp = 'Tutorial'} //Tutorial Agent
2365                if (result[i].atp==4) {var atp = 'Research'} //Research Agent
2366                if (result[i].atp==5) {var atp = 'CONCORD'} //CONCORD Agent
2367                if (result[i].atp==6) {var atp = 'Storyline'} //Generic Storyline Mission Agent
2368                if (result[i].atp==7) {var atp = 'Storyline'} //Storyline Mission Agent
2369                if (result[i].atp==8) {var atp = 'Event'} //Event Mission Agent
2370                if (result[i].atp==9) {var atp = 'FW'} //Factional Warfare Agent
2371                if (result[i].atp==10) {var atp = 'Epic Arc'} //Epic Arc Agent
2372                if (result[i].atp==11) {var atp = 'Aura'} //Aura Agent
2373                if (result[i].atp==12) {var atp = 'Career'} //Career Agent
2374                if (result[i].atp==13) {var atp = 'IRIS'} //IRIS EverMark Agent
2375                var rd='';
2376                if (result[i].rd==1) {var rd = 'High Energy Physics'} 
2377                if (result[i].rd==2) {var rd = 'Plasma Physics'} 
2378                if (result[i].rd==3) {var rd = 'Nanite Engineering'} 
2379                if (result[i].rd==4) {var rd = 'Hydromagnetic Physics'} 
2380                if (result[i].rd==5) {var rd = 'Amarr Starship Engineering'} 
2381                if (result[i].rd==6) {var rd = 'Minmatar Starship Engineering'} 
2382                if (result[i].rd==7) {var rd = 'Graviton Physics'} 
2383                if (result[i].rd==8) {var rd = 'Laser Physicsv'} 
2384                if (result[i].rd==9) {var rd = 'Electromagnetic Physics'} 
2385                if (result[i].rd==10) {var rd = 'Rocket Science'} 
2386                if (result[i].rd==11) {var rd = 'Gallente Starship Engineering'} 
2387                if (result[i].rd==12) {var rd = 'Nuclear Physics'} 
2388                if (result[i].rd==13) {var rd = 'Mechanical Engineering'} 
2389                if (result[i].rd==14) {var rd = 'Electronic Engineering'} 
2390                if (result[i].rd==15) {var rd = 'Caldari Starship Engineering'} 
2391                if (result[i].rd==16) {var rd = 'Quantum Physics'} 
2392                if (result[i].rd==17) {var rd = 'Astronautic Engineering'} 
2393                if (result[i].rd==18) {var rd = 'Molecular Engineering'} 
2394                if (result[i].rd==19) {var rd = 'Hypernet Science'} 
2395                
2396
2397                if (rd!='') {
2398                    var div = 'Research & Development'
2399                    rd = '<span class="td_sig_mini"><font color="'+lightgrey+'">'+rd+' Level '+result[i].lvl+'</font></span>' 
2400                } else {
2401                    rd = '<font color="'+grey+'" class="td_sig_mini">'+div+' Level '+result[i].lvl+'</font>'
2402                }
2403                var loc=''
2404                if (result[i].loc==1) loc='Locator'
2405                
2406                //{"id":3019226,"rid":10000042,"cid":20000304,"sid":30002061,"str":60015103,"typ":30,"ssn":"Ofstold","nom":"Anjell Ameko","crp":"Tribal Liberation Force","div":24,"lvl":2,"atp":9,"loc":1,"sec":"0.274","fac":500002}
2407                
2408                //"id":3018715,"rid":10000003,"cid":20000044,"sid":30000310,"typ":30,"ssn":"G5ED-Y","nom":"Tomi Hakiro","crp":"Caldari Navy","div":24,"lvl":4,"atp":8,"sec":"-0.267","fac":500001}
2409                
2410                //var bookmarker = ' <img class="ui-ico-varia" id="img_'+result[i].id+'_bm" class="infopane_img" src="img/icon/bmk.png" width="11" height="11" onClick="bookmarks_toggle('+result[i].str+','+result[i].sid+','+result[i].id+')" style="padding-left:2px;">'; 
2411                
2412                var bookmarker='';
2413                
2414                row += '<table width="100%" border="0" cellpadding="0" cellspacing="0" style="background-color:'+c+';margin-bottom:4px;opacity:'+opac+'" cellspacing="1"><tr>'
2415                    row += '<td class="td_sig_ss" width="40" align="left" valign="middle">'
2416                    if (Characters.scopes!=undefined) if (inSync && Characters.scopes.indexOf('open_window')!=-1) row += '<span onClick="showInfoIngame('+result[i].id+')"><img src="img/icon/info.png" height="14" width="14" style="opacity:0.4;vertical-align:middle;padding-bottom:3px;padding-right:3px;"></span>'
2417                    row += div.charAt(0)+result[i].lvl+'</td>';
2418                row += '<td class="td_sig" valign="middle" id="xxx_i_agt_'+result[i].id+'">'+result[i].nom+bookmarker+'&nbsp;&nbsp;'+rd //highlighting disabled for now
2419                row += '<td class="td_sig_mini" align="right"><font color="'+grey+'">'+loc+' '+atp+'</font>&nbsp;'
2420                row += '</td></tr>';
2421
2422                /*var staname = $.grep(supersearch_sta, function(d){ return ( d.id == result[i].str && d.typ==6 ) });
2423                if (staname[0]!=undefined) {var nom = staname[0].nom.replace(sn+' ','').replace('- Moon ',' ')} else { nom="Agent in Space" }
2424                row += '<tr>'
2425                row += '<td class="td_sig_mini"><font color="'+grey+'">'+loc+'</</td>'
2426                row += '<td class="td_sig_ss" align="top" ><font color="'+grey+'">'+nom+'</font></td>' 
2427                row += '<td class="td_sig_mini" align="right"></td>'*/
2428                
2429                row += '</tr></table>' 
2430                
2431                oldloc = result[i].str;
2432            }
2433            $('#ss_N_selection').append(row+'</td></tr>')
2434        }
2435};
2436
2437function SSI_zkb(id,kil) {
2438    if (kil.att_char != '') { // filter npc only kills
2439        var ally=''
2440        if (kil.allianceID != 0 ) ally =  ' <font color="'+sovColor(Number(kil.allianceID))+'">[ '+APIdata_alliances.alliances[kil.allianceID].shortName+' ]</font>'
2441        var line = '<tr><td class="td_ss_info">'+kil.char+' / '+kil.corpname+ally        
2442        ally=''
2443        if (kil.att_allianceID != 0 ) ally =  ' <font color="'+sovColor(Number(kil.att_allianceID))+'">[ '+APIdata_alliances.alliances[kil.att_allianceID].shortName+' ]</font>'
2444        var att = kil.att_corpname
2445        if (kil.att_char != '' ) att = kil.att_char+' / '+kil.att_corpname
2446        line += '<br><font color="'+lightgrey+'">destroyed by</font> '+att+ally                           
2447        line += '</td></tr>'
2448        $('#ss_K_selection').append(SSheadlineHTML('ZKILLS',1)+line)
2449        //kil.shipTypeID 
2450        //kil.att_shipTypeID 
2451        //kil.time 
2452        //kil.involved 
2453        //(kil.isk/1000000).toFixed(0)    
2454    }
2455    //refresh sspane content height
2456    $('#ss_K_selection').append('<tr colspan="1" height="4"><td></td></tr>');
2457}
2458
2459//helpers
2460function whichSec(s){
2461  	if (s>0.449) return 'high'
2462	else if (s<0.45 && s>0.00) return 'low'
2463	else if (s<=0.00) return 'null'
2464}
2465
2466function SSheadlineHTML (txt,colspan,classed) { //console.log(txt+'/'+colspan)
2467
2468    /*var extraoption='';
2469    if (txt=="SIGNATURES" && OS=="browser" ) {
2470        if (Options['set_pastemode']==true) extraoption ='<img src="img/icon/switch-off.png" width="14" height="14" onClick="toggleSetting(\'set_pastemode\');"/>';
2471        if (Options['set_pastemode']!=true) extraoption ='<img src="img/icon/switch-on.png" width="14" height="14" onClick="toggleSetting(\'set_pastemode\');"/>';
2472    }
2473    if (txt=="SIGNATURES" && OS=="browser" && Options['set_pastemode']==true) txt+='&nbsp;&nbsp;<span style="color:var(--col-txt-highlight);" onClick="toggleSetting(\'set_pastemode\');">Use Ctrl+V to paste Sigs: ADDITIVE MODE (click to change)</span>' //07111E 0b192b
2474    if (txt=="SIGNATURES" && OS=="browser" && Options['set_pastemode']!=true) txt+='&nbsp;&nbsp;<span style="color:var(--col-txt-highlight);" onClick="toggleSetting(\'set_pastemode\');">Use Ctrl+V to paste Sigs: OVERWRITE MODE (click to change)</span>' //07111E 0b192b
2475
2476    style="background-color: #1D9BF0;color: #FBFBFB;"
2477    */
2478
2479    // if (browser=='FF') { // Firefox does not allow reading the clipboard
2480
2481        //var ptxt='Use Ctrl+V to ADD.' // TODO <<<<<<<< check to get this to work in FF some day?
2482        if (Options['set_FF_sigPasteOverwrite']) {
2483            var ptxt='Clipboard pasting mode: <button class="btn_ss_headline" id="FF_pasteMode" onClick="toggleSetting(\'set_FF_sigPasteOverwrite\')" style="pointer-events:all;cursor:pointer;" title="Click to toggle mode.">OVERWRITE</button><input id="set_FF_sigPasteOverwrite" type="checkbox" checked="checked" style="display:none;"/>'
2484        } else {
2485            var ptxt='Clipboard pasting mode: <button class="btn_ss_headline" id="FF_pasteMode" onClick="toggleSetting(\'set_FF_sigPasteOverwrite\')" style="pointer-events:all;cursor:pointer;" title="Click to toggle mode.">ADD</button><input id="set_FF_sigPasteOverwrite" type="checkbox" style="display:none;"/>'
2486        }
2487
2488    /*} else {
2489        //var ptxt='Use Ctrl+V to ADD. Use Shift+Ctrl+V to OVERWRITE.'
2490        var addButton='Paste from Clipboard: <button class="btn_ss_headline" onClick="handleButtonPaste(false);" style="pointer-events:all;cursor:pointer;" title="Ctrl+V">ADD</button>'
2491        var overwriteButton='<button class="btn_ss_headline" onClick="handleButtonPaste(true);" style="pointer-events:all;cursor:pointer;" title="Shift+Ctrl+V">OVERWRITE</button>'
2492        var ptxt=addButton+' '+overwriteButton;
2493    }*/
2494
2495
2496    if (txt.includes("SIGNATURES") && OS=="browser" && !eeechoes
2496) {
2497        txt+='&nbsp;&nbsp;<span style="font-family: EEMfontExtraLight;color:var(--col-txt-highlight);">'+ptxt+'</span>' //07111E 0b192b
2498        txt+= '<div style="position:relative;margin-top:3px;margin-right:2px;float:right;opacity:0.5;"><img class="ui-ico-varia" src="img/icon/lst2_on.png" height="14" width="12" title="Toggle signature list mode" onClick="toggleSetting(\'set_sig_compact\');SSI_sig('+currentDisplayedSysID+');" style="padding-right:6px"/><img class="ui-ico-varia" src="img/icon/trash-30.png" height="14" title="Doubleclick to clear system"  ondblclick="sigs_clearSystemSigs('+currentDisplayedSysID+')"/></div>'
2499    }
2500
2501    if (txt.includes("DISTANCES")) {
2502
2503        txt+= '<div style="margin-top:3px;margin-right:2px;float:right;">'
2504        txt+= '<img class="ui-ico-varia" src="img/icon/Settings-100_off.png" height="10" title="Open route settings" style="margin-top:2px;margin-right: 2px;opacity:0.8;" onclick="toggleSelection(\'set\',\'set_rou_selection\');$(\'#set_mnu_rou\').addClass(\'tab_on\');toggleSettings();"/>'
2505        txt += '</div>'
2506
2507    }
2508
2509    if (txt.includes("PI NOT AVAILABLE")) {
2510        var ptxt='in this Solarsystem'
2511        var col = '';//'color:red';
2512        txt='<span style="'+col+';opacity:1">'+txt+'</span>&nbsp;&nbsp;<span style="font-family: EEMfontExtraLight;">'+ptxt+'</span>' 
2513    }
2514
2515    if (txt.includes("CITADELS") && OS=="browser" && !eeechoes) {
2516        var ptxt='Use Ctrl+V to paste Structures from directional'
2517        txt+='&nbsp;&nbsp;<span style="font-family: EEMfontExtraLight;color:var(--col-txt-highlight);">'+ptxt+'</span>' //07111E 0b192b
2518    }
2519    if (txt.includes("CITADELS")) {
2520        txt+= '<div style="margin-top:3px;margin-right:2px;float:right;">'
2521        txt+= '<img class="ui-ico-varia" src="img/icon/Plus-fat_w.png" height="14" title="Click to add a structure" style="margin-right: 2px;opacity:0.6;" onclick="structures_addNewStructure('+currentDisplayedSysID+')"/>'
2522        txt+= '<img class="ui-ico-varia" src="img/icon/trash-30.png" height="14" title="Doubleclick to clear system" ondblclick="structures_clearSystemStructures('+currentDisplayedSysID+')" style="opacity:0.5;"/>'
2523        txt+= '</div>';
2524    }
2525
2526    if (txt.includes("CONNECTIONS") && OS=="browser" && !eeechoes) txt+='&nbsp;&nbsp;<span style="font-family: EEMfontExtraLight;color:var(--col-txt-highlight)">Use Ctrl+V to paste Jumpbridges from directional</span>' //07111E 0b192b
2527
2528    //if (tablet) {  // do show headlines in portrait aswell
2529    
2530          var html = '';//'<tr height="4"><td colspan="'+colspan+'"></td></tr>'
2531          html += '<tr class="ui-V ss_headline opt_row_h_d2 '
2532          if (classed!=undefined) html += classed
2533          html += '"><td align="left" valign="bottom" class="td_ss_category_hl" colspan="'+colspan+'">'+txt+'</td></tr><tr height="1" class="ss_headline '; //<td class="td_ss_category_hl">'+extraoption+'</td>
2534          if (classed!=undefined) html += classed
2535          html += '"></tr>' // <td></td> class="uiLine ss_headline" 
2536          //html += '<tr height="2"><td colspan="'+colspan+'"></td></tr>'
2537          return html;
2538    //};
2539}
2540
2541function staticsOneLiner(sid) {
2542
2543    statics = buildNodeData(sid).statics;
2544    if (statics) {
2545
2546        var txt = 'Static ';
2547        for (var s = 0; s < statics.length; s++) {
2548
2549            var col=colorClass(statics[s].class);
2550        
2551            if ( statics[s].class==7 && txt.indexOf('High ')==-1) { txt += '<span style="color:'+highsec+'">High</tspan> '}
2552            else if ( statics[s].class==8 && txt.indexOf('Low ')==-1) { txt += '<span style="color:'+lowsec+'">Low</tspan> ' }
2553            else if ( statics[s].class==9 && txt.indexOf('Null ')==-1) { txt += '<span style="color:'+nullsec+'">Null</tspan> ' }
2554            else if ( statics[s].class<7 && txt.indexOf('C'+statics[s].class+' ')==-1 ) { txt += '<span style="color:'+col+'">C'+statics[s].class+'</span> ' }
2555            // Pseudostatics
2556            else if ( statics[s].code=="Q063") { txt += '<span style="color:'+highsec+'">High</tspan> '}
2557            else if ( statics[s].code=="V898") { txt += '<span style="color:'+lowsec+'">Low</tspan> ' }
2558            else if ( statics[s].code=="E587") { txt += '<span style="color:'+nullsec+'">Null</tspan> ' }
2559        }
2560
2561        return txt;
2562    } else {
2563        //dlog('staticsOneLiner: no statics passed');
2564        return '';
2565    }
2566
2567}

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.