jablonka.czprosek.czf

mapstats

Subversion Repositories:
[/] [mapstats.js] - Blame information for rev 6

 

Line No. Rev Author Line
11unreal// --------------------------------------------------------
2// This script made JKLIR as. Unreal][ [http://jklir.net]
34unreal// Map engine originally from Emcee Lam [http://sjsutech.com]
41unreal// Licence: GNU/GPL
5// (c) 2008 All rights reserved
6// --------------------------------------------------------
7 
8 var mainMap;
9 var magnifier;
105unreal if (navigator.appName=="Microsoft Internet Explorer") {
11 var imgon = new Image();
12 imgon.src = 'on.png';
13 var imgoff = new Image();
14 imgoff.src = 'off.png';
15 var imginfo = new Image();
16 imginfo.src = 'info.png';
17 var imgap = new Image();
18 imgap.src = 'ap.png';
19 var imgcn = new Image();
20 imgcn.src = 'client.png';
21 var imgsw = new Image();
22 imgsw.src = 'switch.png';
23 }
241unreal 
25 var node = new Array();
265unreal var nodecount;
271unreal var pozdrav8 = new Array();
28 var pomocna = new Array();
29 var pomocna1 = new Array();
30 var pomocna2 = new Array();
31 var pomocna3 = new Array();
32 var pomocna4 = new Array();
33 var ann;
34 var m1;
35 var m2;
36 var m3;
37 var m4;
38 var m5;
39 var m6;
40 var m7;
41 var m8;
42 var m9;
43 var m1_a;
44 var m2_a;
45 var m3_a;
46 var m4_a;
47 var m5_a;
48 var m6_a;
49 var m7_a;
50 var m8_a;
51 var m9_a;
52 var cntm;
53 
54 function mapInit(startzoom) {
55 magnifier = new Magnifier();
56 mainMap = new MainMap(startzoom);
57 
58 var miniMapDiv = document.getElementById("miniMapInner");
59 miniMapDiv.onmousedown
60 = function (event) { return magnifier.startMove(event) };
61 miniMapDiv.onmousemove
62 = function (event) { return magnifier.processMove(event) };
63 miniMapDiv.onmouseup
64 = function (event) { return magnifier.stopMove(event) };
65 miniMapDiv.ondragstart = function() { return false; } // for IE
66 }
67 
68 function Magnifier () {
69 var this1 = this;
70 this.f_dragging = false;
71 this.div = document.getElementById("magnifier");
72 this.div.ondragstart = function() { return false; } // for IE
73 this.div.onmousedown
74 = function (event) { return this1.startMove(event) };
75 this.div.onmousemove
76 = function (event) { return this1.processMove(event) };
77 this.div.onmouseup
78 = function (event) { return this1.stopMove(event) };
79 }
80 
81 Magnifier.prototype.startMove =
82 function (event) {
83 // for IE
84 if (!event)
85 event = window.event;
86 
874unreal var magnifierDiv = document.getElementById("magnifier");
88 //var magnifierDiv = this.div;
891unreal this.dragStartLeft = event.clientX;
90 this.dragStartTop = event.clientY;
914unreal //magnifierDiv.style.cursor = "move";
921unreal 
93 this.top = magnifierDiv.offsetTop;
94 this.left = magnifierDiv.offsetLeft;
95 
96 this.f_dragging = true;
97 return false;
98 }
99 
100 /* As you drag the mouse in the mini map, the magnifier responds by
101 moving. Likewise, the main map will show the current area
102 enclosed by the magnifier. */
103 Magnifier.prototype.processMove =
104 function (event) {
105 var magnifierDiv = this.div;
106 
107 if (!event) event = window.event; // for IE
108 if (this.f_dragging) {
109 
110 var minX = 0;
111 var maxX = magres_x - magnifierDiv.offsetWidth;
112 var minY = 0;
113 var maxY = magres_y - magnifierDiv.offsetHeight;
114 
115 var shiftedLeft = this.left + (event.clientX - this.dragStartLeft);
116 if (shiftedLeft < minX) shiftedLeft = minX; // map is not infinite
117 if (shiftedLeft > maxX) shiftedLeft = maxX;
118 magnifierDiv.style.left = shiftedLeft + "px";
119 
120 var shiftedTop = this.top + (event.clientY - this.dragStartTop);
121 if (shiftedTop < minY) shiftedTop = minY; // map is not infinite
122 if (shiftedTop > maxY) shiftedTop = maxY;
123 magnifierDiv.style.top = shiftedTop + "px";
124 
125 mainMap.setViewPort();
126 }
127 }
128 
129 Magnifier.prototype.stopMove =
130 function (event) {
1314unreal //this.div.style.cursor = "";
1321unreal this.f_dragging = false;
133 }
134 
135 Magnifier.prototype.setSize =
136 function (innerDivWidth, innerDivHeight) {
137 var magnifierWidth = Math.round((magres_x * inres_x) / innerDivWidth) - 2; // 200 * 700px
138 /* We subtract 2 because the borders are 1 pixel each */
139 var magnifierHeight = Math.round((magres_y * inres_y) / innerDivHeight) - 2; // 141 * 500px
140 /* We subtract 2 because the borders are 1 pixel each */
141 var magnifierDiv = document.getElementById("magnifier");
142 magnifierDiv.style.width = magnifierWidth + "px";
143 magnifierDiv.style.height = magnifierHeight + "px";
144 }
145 
146 Magnifier.prototype.setPosition =
147 function () {
148 var innerDiv = document.getElementById("innerDiv");
149 var innerDivWidth = innerDiv.clientWidth;
150 var innerDivHeight = innerDiv.clientHeight;
151 var innerDivLeft = innerDiv.offsetLeft;
152 var innerDivTop = innerDiv.offsetTop;
153 this.left
154 = Math.round(Math.abs(innerDivLeft) * magres_x / innerDivWidth);
155 this.top
156 = Math.round(Math.abs(innerDivTop) * magres_y / innerDivHeight);
157 
158 // alter magnifier
159 var magnifierDiv = this.div;
160 magnifierDiv.style.left = this.left + "px";
161 magnifierDiv.style.top = this.top + "px";
162 }
163 
164 function MainMap (zoomfirst) {
165 var this1 = this;
166 
167 // constants
168 // view port is the visible portion of the main map
169 this.viewPortWidth = inres_x; //500
170 this.viewPortHeight = inres_y; //400
171 
172 this.tileSize = 256;
173 this.f_dragging = false;
174 this.innerDiv = document.getElementById("innerDiv");
1754unreal this.innerDiv.style.cursor = "url(grab.cur), default";
1761unreal 
177 var outerDiv = document.getElementById("outerDiv");
178 this.outerDiv = outerDiv;
179 outerDiv.style.width = inres_x + "px";
180 outerDiv.style.height = inres_y + "px";
181 var underMap = document.getElementById("underMap");
182 underMap.style.width = (inres_x - 4) + "px";
183 
184 outerDiv.onmousedown
185 = function(event) { return this1.startMove(event) };
186 outerDiv.onmousemove
187 = function(event) { return this1.processMove(event) };
188 outerDiv.onmouseup
189 = function(event) { return this1.stopMove(event) };
190 outerDiv.ondblclick
191 = function(event) { return this1.doubleClick() };
192 outerDiv.ondragstart = function() { return false; } // for IE
193 
194 var zf = 0;
195 if(zoomfirst==eq_mini) { zf = 0; }
196 if(zoomfirst==eq_medi) { zf = 1; }
197 if(zoomfirst==eq_high) { zf = 2; }
198 if(zoomfirst==eq_orig) { zf = 3; }
199 
200 this.zoom = zf;
201 this.zoomDim = [
202 {
203 width:parseInt(full_x * eq_mini),
204 height:parseInt(full_y * eq_mini),
205 size:1
206 },
207 {
208 width:parseInt(full_x * eq_medi),
209 height:parseInt(full_y * eq_medi),
210 size:2
211 },
212 {
213 width:parseInt(full_x * eq_high),
214 height:parseInt(full_y * eq_high),
215 size:3
216 },
217 {
218 width:parseInt(full_x * eq_orig),
219 height:parseInt(full_y * eq_orig),
220 size:4
221 },
222 ]
223 
224 var zoomElt = this.zoomDim[this.zoom];
2255unreal this.setInnerDivSize (zoomElt.width, zoomElt.height, zoomElt.size, (parseInt(zoomfirst*1000)/10));
2261unreal 
227 var innerDiv = document.getElementById("innerDiv");
228 innerDiv.style.left = -(start_left) + "px";
229 innerDiv.style.top = -(start_top) + "px";
230 
231 magnifier.setPosition();
232 this.checkTiles();
233 }
234 
235 MainMap.prototype.startMove =
236 function (event) {
237 // for IE
238 if (!event) event = window.event;
239 
240 this.dragStartLeft = event.clientX;
241 this.dragStartTop = event.clientY;
242 var innerDiv = this.innerDiv;
2434unreal innerDiv.style.cursor = "url(grabbing.cur), default";
2441unreal 
245 this.top = innerDiv.offsetTop;
246 this.left = innerDiv.offsetLeft;
247 
248 this.f_dragging = true;
249 return false;
250 }
251 
252 MainMap.prototype.processMove =
253 function (event) {
254 var zoomElt = this.zoomDim[this.zoom];
255 var maxY = 0;
256 var minY = -(zoomElt.height - this.viewPortHeight);
257 var maxX = 0;
258 var minX = -(zoomElt.width - this.viewPortWidth);
259 
260 if (!event) event = window.event; // for IE
261 var innerDiv = this.innerDiv;
262 if (this.f_dragging) {
263 var shiftedTop = this.top + (event.clientY - this.dragStartTop);
264 if (shiftedTop > maxY) shiftedTop = maxY; // map is not infinite
265 if (shiftedTop < minY) shiftedTop = minY;
266 innerDiv.style.top = shiftedTop + "px";
267 
268 var shiftedLeft = this.left + (event.clientX - this.dragStartLeft);
269 if (shiftedLeft > maxX) shiftedLeft = maxX; // map is not infinite
270 if (shiftedLeft < minX) shiftedLeft = minX;
271 innerDiv.style.left = shiftedLeft + "px";
272 
273 this.checkTiles();
274 magnifier.setPosition();
275 }
276 
2776unreal var nasbek;
2781unreal var konst = 0;
2796unreal if(this.zoom==0) { nasbek = eq_mini; }
280 if(this.zoom==1) { nasbek = eq_medi; }
281 if(this.zoom==2) { nasbek = eq_high; }
282 if(this.zoom==3) { nasbek = eq_orig; }
2831unreal if (navigator.appName=="Microsoft Internet Explorer") { konst = -2; }
284 var outerDiv = document.getElementById("outerDiv");
285 var infoDiv = document.getElementById("infoDiv");
2866unreal if (this.f_dragging) {
287 infoDiv.innerHTML = parseInt((Math.abs(shiftedLeft) + event.clientX - outerDiv.offsetLeft + konst)/nasbek) + " x " + parseInt((Math.abs(shiftedTop) + event.clientY - outerDiv.offsetTop + konst)/nasbek);
288 } else {
289 infoDiv.innerHTML = parseInt((Math.abs(parseInt(innerDiv.style.left)) + event.clientX - outerDiv.offsetLeft + konst)/nasbek) + " x " + parseInt((Math.abs(parseInt(innerDiv.style.top)) + event.clientY - outerDiv.offsetTop + konst)/nasbek);
290 }
2911unreal }
292 
293 MainMap.prototype.checkZoom =
294 function () {
295 var zoomElt = this.zoomDim[this.zoom];
296 var maxY = 0;
297 var minY = -(zoomElt.height - this.viewPortHeight);
298 var maxX = 0;
299 var minX = -(zoomElt.width - this.viewPortWidth);
300 var chcky = 0;
301 var chckx = 0;
302 
303 var innerDiv = this.innerDiv;
304 var shiftedTop = innerDiv.offsetTop;
305 if (shiftedTop > maxY) { shiftedTop = maxY; chcky = 1; } // map is not infinite
306 if (shiftedTop < minY) { shiftedTop = minY; chcky = 1; }
307 if (chcky == 1) innerDiv.style.top = shiftedTop + "px";
308 
309 var shiftedLeft = innerDiv.offsetLeft;
310 if (shiftedLeft > maxX) { shiftedLeft = maxX; chckx = 1; }// map is not infinite
311 if (shiftedLeft < minX) { shiftedLeft = minX; chckx = 1; }
3126unreal if (chckx == 1) innerDiv.style.left = shiftedLeft + "px";
3131unreal 
314 magnifier.setPosition();
315 }
316 
317 MainMap.prototype.checkTiles =
318 function () {
319 var innerDiv = this.innerDiv;
320 var tileSize = this.tileSize;
321 var visibleTiles = this.getVisibleTiles();
322 var visibleTilesMap = {};
323 var i;
324 
325 var size = this.zoomDim[this.zoom].size;
326 for (i=0;i<visibleTiles.length; i++) {
327 var tile = visibleTiles[i];
328 var xy = "x" + tile.x + "y" + tile.y;
329 var tileName
330 = xy + "z" + this.zoom;
331 visibleTilesMap[tileName] = true;
332 var img = document.getElementById (tileName);
333 if (!img) {
334 img = document.createElement("img");
335 img.src
336 = "size" + size + "/" + xy + ".jpg";
337 img.style.position = "absolute";
338 img.style.left = (tile.x * tileSize) + "px";
339 img.style.top = (tile.y * tileSize) + "px";
340 img.setAttribute("id", tileName);
341 img.setAttribute("galleryimg", "no");
342 innerDiv.appendChild(img);
343 }
344 }
345 
346 var imgs = innerDiv.getElementsByTagName("img");
347 for (i = 0; i < imgs.length; i++) {
348 var id = imgs[i].getAttribute("id");
349 if (!visibleTilesMap[id]) {
350 innerDiv.removeChild(imgs[i]);
351 i--;
352 }
353 }
354 }
355 
356 MainMap.prototype.getVisibleTiles =
357 function () {
358 var innerDiv = this.innerDiv;
359 var mapX = innerDiv.offsetLeft;
360 var mapY = innerDiv.offsetTop;
361 var tileSize = this.tileSize;
362 
363 var startX = Math.abs(Math.floor(mapX / tileSize)) - 1;
364 if (startX < 0) startX = 0;
365 var startY = Math.abs(Math.floor(mapY / tileSize)) - 1;
366 if (startY < 0) startY = 0;
367 var tilesX = Math.ceil(this.viewPortWidth / tileSize) + 1;
368 var tilesY = Math.ceil(this.viewPortHeight / tileSize) + 1;
369 
370 var visibleTiles = [];
371 var counter = 0;
372 for (x = startX; x < (tilesX + startX); x++) {
373 for (y = startY; y < (tilesY + startY); y++) {
374 var tile = {};
375 tile.x = x;
376 tile.y = y;
377 visibleTiles[counter++] = tile;
378 }
379 }
380 return visibleTiles;
381 }
382 
383 MainMap.prototype.stopMove =
384 function (event) {
3854unreal this.innerDiv.style.cursor = "url(grab.cur), default";
3861unreal this.f_dragging = false;
387 }
388 
389 // movement in the magnifier moves main map's view port
390 MainMap.prototype.setViewPort =
391 function () {
392 var magDiv = document.getElementById("magnifier");
393 var innerDiv = this.innerDiv;
394 var magLeft = magDiv.offsetLeft;
395 var magTop = magDiv.offsetTop;
396 var innerDivWidth = innerDiv.clientWidth;
397 var innerDivHeight = innerDiv.clientHeight;
398 
399 /* set innerDivLeft */
400 var innerDivLeftMin = inres_x - innerDivWidth; //500
401 var innerDivLeft
402 = Math.round((-magLeft) * innerDivWidth / magres_x);
403 if (innerDivLeft < innerDivLeftMin) innerDivLeft = innerDivLeftMin;
404 innerDiv.style.left = innerDivLeft + "px";
405 
406 /* set innerDivTop */
407 var innerDivTopMin = inres_y - innerDivHeight; //400
408 var innerDivTop
409 = Math.round((-magTop) * innerDivHeight / magres_y);
410 if (innerDivTop < innerDivTopMin) innerDivTop = innerDivTopMin;
411 innerDiv.style.top = innerDivTop + "px";
412 
413 this.checkTiles();
414 }
415 
416 MainMap.prototype.setInnerDivSize =
417 function (width, height, size, percent) {
418 var innerDiv = this.innerDiv;
419 innerDiv.style.width = width + "px";
420 innerDiv.style.height = height + "px";
421 magnifier.setPosition();
422 magnifier.setSize (width, height);
423 
424 var resolutionInfo = document.getElementById("resolutionInfo");
425 resolutionInfo.innerHTML = percent + "%, " + width + " x " + height + "px";
426 }
427 
428 MainMap.prototype.setZoom =
429 function (newZoom) {
430 if (this.zoom == newZoom) return;
431 var oldZ = this.zoomDim[this.zoom];
432 var newZ = this.zoomDim[newZoom];
433 var innerDiv = this.innerDiv;
434 var imgs = innerDiv.getElementsByTagName("img");
435 while (imgs.length > 0) {
436 innerDiv.removeChild(imgs[0]);
437 }
438 
439 var oldLeft = innerDiv.offsetLeft;
440 var oldTop = innerDiv.offsetTop;
441 var wdth = Math.round(((magres_x * inres_x) / newZ.width) - 2); // 200 * 700px
442 var hght = Math.round(((magres_y * inres_y) / newZ.height) - 2); // 141 * 500px
443 var wdth2 = Math.round(((magres_x * inres_x) / oldZ.width) - 2); // 200 * 700px
444 var hght2 = Math.round(((magres_y * inres_y) / oldZ.height) - 2); // 141 * 500px
445 
446 var newLeft = Math.round(newZ.width * oldLeft / oldZ.width);
447 var newTop = Math.round(newZ.height * oldTop / oldZ.height);
448 
449 if (this.zoom < newZoom) {
450 newLeft = Math.round(newLeft + ((wdth-wdth2)*4));
451 newTop = Math.round(newTop + ((hght-hght2)*4));
452 }
453 if (this.zoom > newZoom) {
454 newLeft = Math.round(newLeft + ((wdth-wdth2)*4));
455 newTop = Math.round(newTop + ((hght-hght2)*4));
456 }
457 
458 innerDiv.style.left = newLeft + "px";
459 innerDiv.style.top = newTop + "px";
460 this.zoom = newZoom; // set the global zoom
461 var nasobek;
462 if(this.zoom==0) { nasobek = eq_mini; }
463 if(this.zoom==1) { nasobek = eq_medi; }
464 if(this.zoom==2) { nasobek = eq_high; }
465 if(this.zoom==3) { nasobek = eq_orig; }
4666unreal this.setInnerDivSize(newZ.width, newZ.height, newZ.size, (nasobek*1000)/10);
4671unreal 
468 this.checkZoom();
469 this.checkTiles();
470 
471 titulek1 = document.getElementById("mapstats_infopoint");
4725unreal titulek2 = document.getElementById("mapstats_name");
473 titulek3 = document.getElementById("mapstats_ip");
474 titulek4 = document.getElementById("mapstats_status");
475 titulek5 = document.getElementById("mapstats_legend");
476 titulek6 = document.getElementById("mapstats_wave");
477 titulek7 = document.getElementById("mapstats_points");
478 
4791unreal titulek1.innerHTML = "";
480 titulek2.innerHTML = "";
481 titulek3.innerHTML = "";
482 titulek4.innerHTML = "";
483 titulek5.innerHTML = "";
4845unreal titulek6.innerHTML = "";
485 titulek7.innerHTML = "";
4861unreal 
487 canvasInit(nasobek);
488 
489 }
490 
491 MainMap.prototype.doubleClick =
492 function () {
493 if (this.zoom == 3) return;
494 
495 var stara = this.zoom;
496 stara = stara + 1;
497 this.setZoom(stara);
498 
499 }
500 
501 function canvasInit(nasobek) {
502 
503 var canvas_id1 = document.getElementById("paint");
504 canvas_id1.width = parseInt(full_x*nasobek);
505 canvas_id1.height = parseInt(full_y*nasobek);
506 
5076unreal if (navigator.appName=="Microsoft Internet Explorer") {
508 var canvas_id2 = document.getElementById("paint2");
509 canvas_id2.width = parseInt(full_x*nasobek);
510 canvas_id2.height = parseInt(full_y*nasobek);
511 }
5121unreal 
513 ann = nasobek;
514 var pozdrav = new Array();
515 var pozdrav1 = new Array();
516 var pozdrav2 = new Array();
517 var pozdr = new Array();
518 pozdrav = pomocna.split('\n');
519 pozdrav1 = pomocna1.split('\n');
520 var a_cnt = 0;
5215unreal var p0count = pozdrav.length;
522 var p1count = pozdrav1.length;
5231unreal 
5245unreal for(a=0;a<p0count;a++){
5251unreal if(pozdrav[a]!="") {
526 node[a] = new Array();
527 pozdrav2 = pozdrav[a].split(';');
528 for(b=0;b<pozdrav2.length;b++){
529 node[a][b] = pozdrav2[b];
530 }
531 a_cnt++;
532 }
533 }
5345unreal for(e=0;e<p1count;e++) {
5351unreal if(pozdrav1[e]!="") {
536 node[(e+a_cnt)] = new Array();
537 pozdr = pozdrav1[e].split(';');
538 for(f=0;f<pozdr.length;f++){
539 node[(e+a_cnt)][f] = pozdr[f];
540 }
541 }
542 }
543 
5445unreal nodecount = node.length;
5451unreal var pozdrav3 = new Array();
546 var pozdrav4 = new Array();
547 var size;
548 var clrlnk;
549 m1 = 0;
550 m2 = 0;
551 m3 = 0;
552 m4 = 0;
553 m5 = 0;
554 m6 = 0;
555 m7 = 0;
556 m8 = 0;
557 m9 = 0;
558 m1_a = 0;
559 m2_a = 0;
560 m3_a = 0;
561 m4_a = 0;
562 m5_a = 0;
563 m6_a = 0;
564 m7_a = 0;
565 m8_a = 0;
566 m9_a = 0;
567 cntm = 0;
568 
569 if(pomocna2.length>0) {
570 pozdrav3 = pomocna2.split('\n');
5715unreal var p3count = pozdrav3.length;
572 for(a=0;a<p3count;a++){
5731unreal if(pozdrav3[a]!="") {
574 pozdrav4 = pozdrav3[a].split(';');
5754unreal if(pozdrav4[1].toLowerCase()=="backbone") { size = 4.5; } else { size = 2.7; }
5761unreal if(pozdrav4[2].toLowerCase()=="inp") {
577 if(pozdrav4[3]==1) { clrlnk = wifi_client_a; m1_a = 1; }
578 else if(pozdrav4[3]==2) { clrlnk = wifi_backbone_a; m2_a = 1; }
579 else if(pozdrav4[3]==3) { clrlnk = eth_100_a; m3_a = 1; }
580 else if(pozdrav4[3]==4) { clrlnk = fso_a; m4_a = 1; }
581 else if(pozdrav4[3]==5) { clrlnk = fso_backup_a; m5_a = 1; }
582 else if(pozdrav4[3]==6) { clrlnk = ghz5_a; m6_a = 1; }
583 else if(pozdrav4[3]==7) { clrlnk = ghz10_a; m7_a = 1; }
584 else if(pozdrav4[3]==8) { clrlnk = fiber_a; m8_a = 1; }
585 else { clrlnk = other_a; m9_a = 1; }
586 } else {
587 if(pozdrav4[3]==1) { clrlnk = wifi_client; m1 = 1; }
588 else if(pozdrav4[3]==2) { clrlnk = wifi_backbone; m2 = 1; }
589 else if(pozdrav4[3]==3) { clrlnk = eth_100; m3 = 1; }
590 else if(pozdrav4[3]==4) { clrlnk = fso; m4 = 1; }
591 else if(pozdrav4[3]==5) { clrlnk = fso_backup; m5 = 1; }
592 else if(pozdrav4[3]==6) { clrlnk = ghz5; m6 = 1; }
593 else if(pozdrav4[3]==7) { clrlnk = ghz10; m7 = 1; }
594 else if(pozdrav4[3]==8) { clrlnk = fiber; m8 = 1; }
595 else { clrlnk = other; m9 = 1; }
596 }
597 
598 // Vykreslime si nase linky
599 if(pozdrav4[2].toLowerCase()=="inp") {
600 if(ch_inp) {
601 drawINPLink(pozdrav4[0], size-1, nasobek, clrlnk);
602 }
603 } else {
604 if((ch_backbone) && (size==4.5)) {
605 drawLink(pozdrav4[0], size, nasobek, clrlnk);
606 }
6074unreal if((ch_client) && (size==2.7)) {
6081unreal drawLink(pozdrav4[0], size, nasobek, clrlnk);
609 }
610 }
611 }
612 }
613 }
614 
615 cntm = m1 + m2 + m3 + m4 + m5 + m6 + m7 + m8 + m9 + m1_a + m2_a + m3_a + m4_a + m5_a + m6_a + m7_a + m8_a + m9_a;
616 
617 var pozdrav5 = new Array();
618 var pozdrav6 = new Array();
619 if(ch_infopoint) {
620 if(pomocna3.length>0) {
621 pozdrav5 = pomocna3.split('\n');
622 for(d=0;d<pozdrav5.length;d++) {
623 if(pozdrav5[d]!="") {
624 pozdrav6 = pozdrav5[d].split(';');
625 // Vykreslime si infopointy
626 if(ch_name) {
627 drawInfo(pozdrav6[0],pozdrav6[1],pozdrav6[2],nasobek);
628 }
629 drawInfoPoint(pozdrav6[1],pozdrav6[2],nasobek);
630 }
631 }
632 }
633 }
634 
6355unreal for(e=0;e<p1count;e++) {
6361unreal if(pozdrav1[e]!="") {
637 if(ch_noping) {
638 if(node[(a_cnt+e)][3]==1) {
639 drawClient(node[(a_cnt+e)][1],node[(a_cnt+e)][2],nasobek);
640 if(ch_name) {
641 drawName(node[(a_cnt+e)][0],(node[(a_cnt+e)][1])-1,(node[(a_cnt+e)][2])-1,nasobek)
642 }
643 }
644 if(node[(a_cnt+e)][3]==2) {
645 drawSwitch(node[(a_cnt+e)][1],node[(a_cnt+e)][2],nasobek);
646 }
647 }
648 }
649 }
650 
651 var pozdrav7 = new Array();
652 pozdrav7 = pomocna4.split('\n');
653 var clrpnt;
654 var x_pos;
655 var y_pos;
656 var name_pos;
657 var title_pos;
6585unreal var p7count = pozdrav7.length;
6591unreal 
6605unreal for(c=0;c<p7count;c++){
6611unreal if(pozdrav7[c]!="") {
662 pozdrav8 = pozdrav7[c].split(';');
6635unreal if(pozdrav8[1]==1) { clrpnt = "on"; pozdrav8[2] = pozdrav8[2] + ' ms'; } else { clrpnt = "off"; pozdrav8[2] = "offline"; }
6641unreal if(pozdrav8[0]!=node[c][4]) { x_pos = ip2sour(pozdrav8[0],1); y_pos = ip2sour(pozdrav8[0],2); name_pos = ip2sour(pozdrav8[0],0); title_pos = ip2sour(pozdrav8[0],3); } else { x_pos = node[c][1]; y_pos = node[c][2]; name_pos = node[c][0]; title_pos = node[c][3]; } // check if the result doesnt replaced
665 
666 if(title_pos.toLowerCase()=="ap") {
667 if(ch_ap) {
668 drawAP(x_pos,y_pos,nasobek);
669 drawNode(x_pos,y_pos,nasobek,clrpnt);
670 if(ch_name) {
671 drawName(name_pos,x_pos,y_pos,nasobek);
672 }
673 if((ch_ip) && (ch_status)) {
674 drawStatus(pozdrav8[2],x_pos,y_pos,nasobek);
675 drawIP(pozdrav8[0],x_pos,y_pos,nasobek);
676 } else if((!ch_ip) && (ch_status)) {
677 drawStatus(pozdrav8[2],x_pos,y_pos-parseInt(12/nasobek),nasobek);
678 } else if((ch_ip) && (!ch_status)) {
679 drawIP(pozdrav8[0],x_pos,y_pos,nasobek);
680 }
681 }
682 } else if(title_pos.toLowerCase()=="router") {
683 if(ch_router) {
684 drawNode(x_pos,y_pos,nasobek,clrpnt);
685 if(ch_name) {
686 drawName(name_pos,x_pos,y_pos,nasobek);
687 }
688 if(ch_status) {
689 drawStatus(pozdrav8[2],x_pos,y_pos-parseInt(12/nasobek),nasobek);
690 }
691 }
692 } else {
693 if(ch_node) {
694 drawNode(x_pos,y_pos,nasobek,clrpnt);
695 if(ch_name) {
696 drawName(name_pos,x_pos,y_pos,nasobek);
697 }
698 }
699 }
700 }
701 }
702 
703 var legend = document.getElementById('legend');
704 if((ch_legend) && (cntm>0)) {
705 drawLegend();
706 legend.style.display = "block";
707 } else {
708 legend.style.display = "none";
709 }
710 
711 }
712 
713 function drawLink(pos, size, nas, color) {
714 var ctx = document.getElementById('paint').getContext('2d');
715 var points = new Array();
716 var posxy = new Array();
717 var coordinates = new Array();
718 points = pos.split('#');
719 var reg=/(\d+)&(\d+)/;
720 for(i=0;i<points.length;i++){
721 if (reg.test(points[i])) {
722 posxy = points[i].split('&');
723 coordinates[i*2] = parseInt(posxy[0]*nas); // checkni to....
724 coordinates[i*2+1] = parseInt(posxy[1]*nas);
725 } else {
726 coordinates[i*2] = parseInt(node2sour(points[i],1)*nas);
727 coordinates[i*2+1] = parseInt(node2sour(points[i],2)*nas);
728 }
729 }
730 
731 ctx.lineJoin = "round";
732 ctx.strokeStyle = "rgb(20, 20, 20)";
733 ctx.lineWidth = size+1;
734 ctx.beginPath();
735 ctx.moveTo(coordinates[0],coordinates[1]);
736 for(i=2;i<coordinates.length;i+=2){
737 ctx.lineTo(coordinates[i],coordinates[i+1]);
738 }
739 ctx.stroke();
740 
741 ctx.lineJoin = "round";
742 ctx.strokeStyle = "rgb(0, 0, 0)";
743 ctx.lineWidth = size;
744 ctx.beginPath();
745 ctx.moveTo(coordinates[0],coordinates[1]);
746 for(i=2;i<coordinates.length;i+=2){
747 ctx.lineTo(coordinates[i],coordinates[i+1]);
748 }
749 ctx.stroke();
750 
751 ctx.lineJoin = "round";
752 ctx.strokeStyle = color;
753 ctx.lineWidth = size-1;
754 ctx.beginPath();
755 ctx.moveTo(coordinates[0],coordinates[1]);
756 for(i=2;i<coordinates.length;i+=2){
757 ctx.lineTo(coordinates[i],coordinates[i+1]);
758 }
759 ctx.stroke();
760 }
761 
762 function drawINPLink(pos, size, nas, color) {
763 var ctx = document.getElementById('paint').getContext('2d');
764 var points = new Array();
765 var posxy = new Array();
766 var coordinates = new Array();
767 points = pos.split('#');
768 var reg=/(\d+)&(\d+)/;
769 for(i=0;i<points.length;i++){
770 if (reg.test(points[i])) {
771 posxy = points[i].split('&');
772 coordinates[i*2] = parseInt(posxy[0]*nas);
773 coordinates[i*2+1] = parseInt(posxy[1]*nas);
774 } else {
775 coordinates[i*2] = parseInt(node2sour(points[i],1)*nas);
776 coordinates[i*2+1] = parseInt(node2sour(points[i],2)*nas);
777 }
778 }
779 
780 ctx.lineJoin = "round";
781 ctx.strokeStyle = "rgba(0, 0, 0, 0.1)";
782 ctx.lineWidth = size+1.5;
783 ctx.beginPath();
784 ctx.moveTo(coordinates[0],coordinates[1]);
785 for(i=2;i<coordinates.length;i+=2){
786 ctx.lineTo(coordinates[i],coordinates[i+1]);
787 }
788 ctx.stroke();
789 
790 ctx.lineJoin = "round";
791 ctx.strokeStyle = color;
792 ctx.lineWidth = size+0.5;
793 ctx.beginPath();
794 ctx.moveTo(coordinates[0],coordinates[1]);
795 for(i=2;i<coordinates.length;i+=2){
796 ctx.lineTo(coordinates[i],coordinates[i+1]);
797 }
798 ctx.stroke();
799 }
800 
801 function drawNode(xo, yo, nas, img) {
8025unreal xo = parseInt((xo*nas)-7);
803 yo = parseInt((yo*nas)-7);
804 if (navigator.appName=="Microsoft Internet Explorer") {
805 if(img=="on") { img = imgon; } else { img = imgoff; }
806 var ctx = document.getElementById('paint2').getContext('2d');
807 ctx.drawImage(img,xo,yo);
808 } else {
8096unreal var text = '<div style="position:absolute;left:' + xo + 'px;top:' + yo + 'px;width: 14px;height: 14px;background-image: url(\'' + img + '.png\');font-size: 0px;cursor: url(grab.cur) default;" unselectable = "on"></div>';
8105unreal titulek = document.getElementById("mapstats_points");
811 titulek.innerHTML = titulek.innerHTML + text;
812 }
8131unreal }
814 
815 function drawAP(xn, yn, nas) {
8165unreal xn = parseInt((xn*nas)-31);
817 yn = parseInt((yn*nas)-17);
818 if (navigator.appName=="Microsoft Internet Explorer") {
819 var ctx = document.getElementById('paint').getContext('2d');
820 ctx.drawImage(imgap,xn,yn);
821 } else {
8226unreal var text = '<div style="position:absolute;left:' + xn + 'px;top:' + yn + 'px;width: 62px;height: 34px;background-image: url(\'ap.png\');font-size: 0px;cursor: url(grab.cur) default;" unselectable = "on"></div>';
8235unreal titulek = document.getElementById("mapstats_wave");
824 titulek.innerHTML = titulek.innerHTML + text;
825 }
8261unreal }
827 
828 function drawClient(xc, yc, nas) {
8295unreal xc = parseInt((xc*nas)-7);
830 yc = parseInt((yc*nas)-7);
831 if (navigator.appName=="Microsoft Internet Explorer") {
832 var ctx = document.getElementById('paint').getContext('2d');
833 ctx.drawImage(imgcn,xc,yc);
834 } else {
8356unreal var text = '<div style="position:absolute;left:' + xc + 'px;top:' + yc + 'px;width: 14px;height: 14px;background-image: url(\'client.png\');font-size: 0px;cursor: url(grab.cur) default;" unselectable = "on"></div>';
8365unreal titulek = document.getElementById("mapstats_wave");
837 titulek.innerHTML = titulek.innerHTML + text;
838 }
8391unreal }
840 
841 function drawSwitch(xs, ys, nas) {
8425unreal xs = parseInt((xs*nas)-6);
843 ys = parseInt((ys*nas)-6);
844 if (navigator.appName=="Microsoft Internet Explorer") {
845 var ctx = document.getElementById('paint').getContext('2d');
846 ctx.drawImage(imgsw,xs,ys);
847 } else {
8486unreal var text = '<div style="position:absolute;left:' + xs + 'px;top:' + ys + 'px;width: 12px;height: 12px;background-image: url(\'switch.png\');font-size: 0px;cursor: url(grab.cur) default;" unselectable = "on"></div>';
8495unreal titulek = document.getElementById("mapstats_wave");
850 titulek.innerHTML = titulek.innerHTML + text;
851 }
8521unreal }
853 
854 function drawInfoPoint(xl, yl, nas) {
8555unreal xl = parseInt((xl*nas)-7);
856 yl = parseInt((yl*nas)-7);
857 if (navigator.appName=="Microsoft Internet Explorer") {
858 var ctx = document.getElementById('paint').getContext('2d');
859 ctx.drawImage(imginfo,xl,yl);
860 } else {
8616unreal var text = '<div style="position:absolute;left:' + xl + 'px;top:' + yl + 'px;width: 14px;height: 14px;background-image: url(\'info.png\');font-size: 0px;cursor: url(grab.cur) default;" unselectable = "on"></div>';
8625unreal titulek = document.getElementById("mapstats_wave");
863 titulek.innerHTML = titulek.innerHTML + text;
864 }
8651unreal }
866 
867 function drawLegend() {
868 var epsilon;
869 var cislo = 0;
870 var name = "";
871 var paintlegend = document.getElementById('paintlegend');
872 paintlegend.height = (((cntm-1) * 12)+13);
873 paintlegend.width = "25";
874 var ctx = paintlegend.getContext('2d');
875 ctx.clearRect(0,0,25,((cntm-1) * 12)+13);
8764unreal if(m1==1) { epsilon = ((cislo*12)+5); drawLegendLink(epsilon,wifi_client,2.9); name = name + name1 + "<br/>"; cislo++; }
8771unreal if(m2==1) { epsilon = ((cislo*12)+5); drawLegendLink(epsilon,wifi_backbone,4.5); name = name + name2 + "<br/>"; cislo++; }
878 if(m3==1) { epsilon = ((cislo*12)+5); drawLegendLink(epsilon,eth_100,4.5); name = name + name3 + "<br/>"; cislo++; }
879 if(m4==1) { epsilon = ((cislo*12)+5); drawLegendLink(epsilon,fso,4.5); name = name + name4 + "<br/>"; cislo++; }
880 if(m5==1) { epsilon = ((cislo*12)+5); drawLegendLink(epsilon,fso_backup,4.5); name = name + name5 + "<br/>"; cislo++; }
881 if(m6==1) { epsilon = ((cislo*12)+5); drawLegendLink(epsilon,ghz5,4.5); name = name + name6 + "<br/>"; cislo++; }
882 if(m7==1) { epsilon = ((cislo*12)+5); drawLegendLink(epsilon,ghz10,4.5); name = name + name7 + "<br/>"; cislo++; }
883 if(m8==1) { epsilon = ((cislo*12)+5); drawLegendLink(epsilon,fiber,4.5); name = name + name8 + "<br/>"; cislo++; }
884 if(m9==1) { epsilon = ((cislo*12)+5); drawLegendLink(epsilon,other,4.5); name = name + name9 + "<br/>"; cislo++; }
8854unreal if(m1_a==1) { epsilon = ((cislo*12)+5); drawLegendINPLink(epsilon,wifi_client_a,2.9); name = name + name1 + " " + inp + "<br/>"; cislo++; }
8861unreal if(m2_a==1) { epsilon = ((cislo*12)+5); drawLegendINPLink(epsilon,wifi_backbone_a,4.5); name = name + name2 + " " + inp + "<br/>"; cislo++; }
887 if(m3_a==1) { epsilon = ((cislo*12)+5); drawLegendINPLink(epsilon,eth_100_a,4.5); name = name + name3 + " " + inp + "<br/>"; cislo++; }
888 if(m4_a==1) { epsilon = ((cislo*12)+5); drawLegendINPLink(epsilon,fso_a,4.5); name = name + name4 + " " + inp + "<br/>"; cislo++; }
889 if(m5_a==1) { epsilon = ((cislo*12)+5); drawLegendINPLink(epsilon,fso_backup_a,4.5); name = name + name5 + " " + inp + "<br/>"; cislo++; }
890 if(m6_a==1) { epsilon = ((cislo*12)+5); drawLegendINPLink(epsilon,ghz5_a,4.5); name = name + name6 + " " + inp + "<br/>"; cislo++; }
891 if(m7_a==1) { epsilon = ((cislo*12)+5); drawLegendINPLink(epsilon,ghz10_a,4.5); name = name + name7 + " " + inp + "<br/>"; cislo++; }
892 if(m8_a==1) { epsilon = ((cislo*12)+5); drawLegendINPLink(epsilon,fiber_a,4.5); name = name + name8 + " " + inp + "<br/>"; cislo++; }
893 if(m9_a==1) { epsilon = ((cislo*12)+5); drawLegendINPLink(epsilon,other_a,4.5); name = name + name9 + " " + inp + "<br/>"; }
894 drawLegendText(name);
895 }
896 
897 function drawLegendLink(yg,color,size) {
898 var ctx = document.getElementById('paintlegend').getContext('2d');
899 ctx.strokeStyle = "rgb(20, 20, 20)";
900 ctx.lineWidth = size+1;
901 ctx.beginPath();
902 ctx.moveTo(1,yg);
903 ctx.lineTo(24,yg);
904 ctx.stroke();
905 
906 ctx.strokeStyle = "rgb(0, 0, 0)";
907 ctx.lineWidth = size;
908 ctx.beginPath();
909 ctx.moveTo(1,yg);
910 ctx.lineTo(24,yg);
911 ctx.stroke();
912 
913 ctx.strokeStyle = color;
914 ctx.lineWidth = size-1;
915 ctx.beginPath();
916 ctx.moveTo(1,yg);
917 ctx.lineTo(24,yg);
918 ctx.stroke();
919 
920 }
921 
922 function drawLegendINPLink(yg,color,size) {
923 var ctx = document.getElementById('paintlegend').getContext('2d');
9244unreal ctx.strokeStyle = "rgba(255, 255, 255, 0.5)";
925 ctx.lineWidth = size;
926 ctx.beginPath();
927 ctx.moveTo(1,yg);
928 ctx.lineTo(24,yg);
929 ctx.stroke();
930 
9311unreal ctx.strokeStyle = "rgba(0, 0, 0, 0.1)";
932 ctx.lineWidth = size;
933 ctx.beginPath();
934 ctx.moveTo(1,yg);
935 ctx.lineTo(24,yg);
936 ctx.stroke();
937 
938 ctx.strokeStyle = color;
939 ctx.lineWidth = size-0.5;
940 ctx.beginPath();
941 ctx.moveTo(1,yg);
942 ctx.lineTo(24,yg);
943 ctx.stroke();
944 }
945 
946 function clearMap(ann) {
947 var ctx = document.getElementById('paint').getContext('2d');
948 ctx.clearRect(0,0,parseInt(full_x * ann),parseInt(full_y * ann));
9496unreal if (navigator.appName=="Microsoft Internet Explorer") {
950 var ctx2 = document.getElementById('paint2').getContext('2d');
951 ctx2.clearRect(0,0,parseInt(full_x * ann),parseInt(full_y * ann));
952 }
9531unreal }
954 
955 function node2sour(name, pos) {
956 var ok = 0;
9575unreal for(k=0;k<nodecount;k++){
9581unreal if(node[k][0]==name) {
959 ok = node[k][pos];
960 }
961 if(ok!=0) { return ok; }
962 }
963 return ok;
964 }
965 
966 function ip2sour(ip, pos) {
967 var ok = 0;
9685unreal for(k=0;k<nodecount;k++){
9691unreal if(node[k][4]==ip) {
970 ok = node[k][pos];
971 }
972 if(ok!=0) { return ok; }
973 }
974 return ok;
975 }
976 
977 function nactiSoubory() {
9785unreal var d = new Date();
979 var tm = d.getTime();
980 pomocna = getFile(nodes + "?" + tm);
981 pomocna1 = getFile(noping + "?" + tm);
982 pomocna2 = getFile(links + "?" + tm);
983 pomocna3 = getFile(infopoints + "?" + tm);
984 pomocna4 = getFile(state + "?" + tm);
9851unreal redrawUpdate();
986 }
987 
988 function getFile(url) {
989 AJAX = (window.XMLHttpRequest ? new XMLHttpRequest() : (window.ActiveXObject ? new ActiveXObject("Microsoft.XMLHTTP") : false));
990 if (AJAX) {
991 AJAX.open("GET", url, false);
9924unreal AJAX.setRequestHeader("Cache-Control", "no-store");
993 AJAX.setRequestHeader("Cache-Control", "no-cache");
994 AJAX.setRequestHeader("Cache-Control", "must-revalidate");
995 AJAX.setRequestHeader("Pragma", "no-cache");
9961unreal AJAX.send(null);
997 return AJAX.responseText;
998 } else {
999 return false;
1000 }
1001 }
1002 
1003 function timerMe() {
1004 // auto-downloading source files every 2 minutes
1005 setInterval("nactiSoubory()", 2 * 60 * 1000);
1006 }
1007 
1008 function nastavCheck() {
1009 document.form_map.ch_ap.checked = ch_ap;
1010 document.form_map.ch_router.checked = ch_router;
1011 document.form_map.ch_node.checked = ch_node;
1012 document.form_map.ch_infopoint.checked = ch_infopoint;
1013 document.form_map.ch_noping.checked = ch_noping;
1014 document.form_map.ch_legend.checked = ch_legend;
1015 document.form_map.ch_name.checked = ch_name;
1016 document.form_map.ch_ip.checked = ch_ip;
1017 document.form_map.ch_status.checked = ch_status;
1018 document.form_map.ch_backbone.checked = ch_backbone;
1019 document.form_map.ch_client.checked = ch_client;
1020 document.form_map.ch_inp.checked = ch_inp;
1021 }
1022 
1023 function reDraw() {
1024 if(document.form_map.ch_ap.checked) { ch_ap = true; } else { ch_ap = false; }
1025 if(document.form_map.ch_router.checked) { ch_router = true; } else { ch_router = false; }
1026 if(document.form_map.ch_node.checked) { ch_node = true; } else { ch_node = false; }
1027 if(document.form_map.ch_infopoint.checked) { ch_infopoint = true; } else { ch_infopoint = false; }
1028 if(document.form_map.ch_noping.checked) { ch_noping = true; } else { ch_noping = false; }
1029 if(document.form_map.ch_legend.checked) { ch_legend = true; } else { ch_legend = false; }
1030 if(document.form_map.ch_name.checked) { ch_name = true; } else { ch_name = false; }
1031 if(document.form_map.ch_ip.checked) { ch_ip = true; } else { ch_ip = false; }
1032 if(document.form_map.ch_status.checked) { ch_status = true; } else { ch_status = false; }
1033 if(document.form_map.ch_backbone.checked) { ch_backbone = true; } else { ch_backbone = false; }
1034 if(document.form_map.ch_client.checked) { ch_client = true; } else { ch_client = false; }
1035 if(document.form_map.ch_inp.checked) { ch_inp = true; } else { ch_inp = false; }
1036 titulek1 = document.getElementById("mapstats_infopoint");
10375unreal titulek2 = document.getElementById("mapstats_name");
1038 titulek3 = document.getElementById("mapstats_ip");
1039 titulek4 = document.getElementById("mapstats_status");
1040 titulek5 = document.getElementById("mapstats_legend");
1041 titulek6 = document.getElementById("mapstats_wave");
1042 titulek7 = document.getElementById("mapstats_points");
10431unreal titulek1.innerHTML = "";
1044 titulek2.innerHTML = "";
1045 titulek3.innerHTML = "";
1046 titulek4.innerHTML = "";
1047 titulek5.innerHTML = "";
10485unreal titulek6.innerHTML = "";
1049 titulek7.innerHTML = "";
10501unreal clearMap(ann);
1051 canvasInit(ann);
1052 }
1053 
10545unreal function deleteNames() {
1055 titulek1 = document.getElementById("mapstats_infopoint");
1056 titulek2 = document.getElementById("mapstats_name");
1057 titulek3 = document.getElementById("mapstats_ip");
1058 titulek4 = document.getElementById("mapstats_status");
1059 titulek6 = document.getElementById("mapstats_wave");
1060 titulek7 = document.getElementById("mapstats_points");
1061 titulek1.innerHTML = "";
1062 titulek2.innerHTML = "";
1063 titulek3.innerHTML = "";
1064 titulek4.innerHTML = "";
1065 titulek6.innerHTML = "";
1066 titulek7.innerHTML = "";
1067 }
1068 
10691unreal function drawInfo(txt, xa, ya, nas) {
1070 xa = parseInt((xa*nas)+6);
1071 ya = parseInt((ya*nas)-13);
10726unreal var text = '<div style="position:absolute;white-space:nowrap;letter-spacing: 1px;left:' + xa + 'px;top:' + ya + 'px;font-family: arial;font-size: 9px;background-color: #000000;color: #ffffff;padding-left: 3px;padding-right: 2px;cursor: url(grab.cur) default;" unselectable = "on">' + txt + '</div>';
10731unreal 
1074 titulek = document.getElementById("mapstats_infopoint");
1075 titulek.innerHTML = titulek.innerHTML + text;
1076 }
1077 
1078 function drawName(txt, xa, ya, nas) {
1079 xa = parseInt((xa*nas)+6);
1080 ya = parseInt((ya*nas)-13);
10816unreal var text = '<div style="position:absolute;white-space:nowrap;letter-spacing: 1px;left:' + xa + 'px;top:' + ya + 'px;font-family: arial;font-size: 9px;background-color: #000000;color: #ffffff;padding-left: 3px;padding-right: 2px;cursor: url(grab.cur) default;" unselectable = "on">' + txt + '</div>';
10821unreal 
1083 titulek = document.getElementById("mapstats_name");
1084 titulek.innerHTML = titulek.innerHTML + text;
1085 }
1086 
1087 function drawIP(txt, xb, yb, nas) {
1088 xb = parseInt((xb*nas)+6);
1089 yb = parseInt((yb*nas)-1);
10906unreal var text = '<div style="position:absolute;white-space:nowrap;letter-spacing: 1px;left:' + xb + 'px;top:' + yb + 'px;font-family: arial;font-size: 9px;background-color: #000000;color: #ffffff;padding-left: 3px;padding-right: 2px;cursor: url(grab.cur) default;" unselectable = "on">' + txt + '</div>';
10911unreal 
1092 titulek = document.getElementById("mapstats_ip");
1093 titulek.innerHTML = titulek.innerHTML + text;
1094 }
1095 
1096 function drawStatus(txt, xc, yc, nas) {
1097 xc = parseInt((xc*nas)+6);
1098 yc = parseInt((yc*nas)+11);
10996unreal var text = '<div style="position:absolute;white-space:nowrap;letter-spacing: 1px;left:' + xc + 'px;top:' + yc + 'px;font-family: arial;font-size: 9px;background-color: #000000;color: #ffffff;padding-left: 3px;padding-right: 2px;cursor: url(grab.cur) default;" unselectable = "on">' + txt + '</div>';
11001unreal 
1101 titulek = document.getElementById("mapstats_status");
1102 titulek.innerHTML = titulek.innerHTML + text;
1103 }
1104 
1105 function drawLegendText(txt) {
1106 var text = '<div style="position:relative;white-space:nowrap;letter-spacing: 1px;font-family: arial;font-size: 9px;color: black;padding-left: 3px;padding-right: 2px;cursor: default;" unselectable = "on">' + txt + '</div>';
1107 
1108 titulek = document.getElementById("mapstats_legend");
1109 titulek.innerHTML = text;
1110 }
1111 
1112 function changeOpacity(opc) {
1113 var opcprc = opc / 100;
1114 var mapstats_update = document.getElementById("mapstats_update");
1115 
1116 if (navigator.appName=="Microsoft Internet Explorer") {
1117 mapstats_update.style.filter = 'alpha(opacity=' + opc + ');';
1118 } else {
1119 mapstats_update.style.setProperty("-moz-opacity",opcprc,null);
1120 mapstats_update.style.setProperty("opacity",opcprc,null);
1121 }
1122 }
1123 
1124 function changeUpdate() {
1125 var promenna = new Date();
1126 var rok = promenna.getFullYear();
1127 var mesic = "" + (promenna.getMonth() + 1);
1128 var den = "" + (promenna.getDate());
1129 var hodin = "" + (promenna.getHours());
1130 var minut = "" + (promenna.getMinutes());
1131 var sekund = "" + (promenna.getSeconds());
1132 if(mesic.length==1) { mesic = "0" + mesic; }
1133 if(den.length==1) { den = "0" + den; }
1134 if(hodin.length==1) { hodin = "0" + hodin; }
1135 if(minut.length==1) { minut = "0" + minut; }
1136 if(sekund.length==1) { sekund = "0" + sekund; }
1137 var mapstats_update = document.getElementById("mapstats_update");
1138 mapstats_update.innerHTML = den + ". " + mesic + ". " + rok + " " + hodin + ":" + minut + ":" + sekund;
1139 }
1140 
1141 function redrawUpdate() {
1142 setTimeout("changeOpacity(90)",100);
1143 setTimeout("changeOpacity(80)",200);
1144 setTimeout("changeOpacity(70)",300);
1145 setTimeout("changeOpacity(60)",400);
1146 setTimeout("changeOpacity(50)",500);
1147 setTimeout("changeOpacity(40)",600);
1148 setTimeout("changeOpacity(30)",700);
1149 setTimeout("changeOpacity(20)",800);
1150 setTimeout("changeOpacity(10)",900);
1151 setTimeout("changeOpacity(0)",1000);
1152 setTimeout("changeUpdate()",1050);
1153 setTimeout("changeOpacity(10)",1100);
1154 setTimeout("changeOpacity(20)",1200);
1155 setTimeout("changeOpacity(30)",1300);
1156 setTimeout("changeOpacity(40)",1400);
1157 setTimeout("changeOpacity(50)",1500);
1158 setTimeout("changeOpacity(60)",1600);
1159 setTimeout("changeOpacity(70)",1700);
1160 setTimeout("changeOpacity(80)",1800);
1161 setTimeout("changeOpacity(90)",1900);
1162 setTimeout("changeOpacity(100)",2000);
1163 }

Powered by WebSVN 2.2.1