var zw_visible;
var svgns = 'xmlns="http://www.w3.org/2000/svg"';
function
zw_nl(fhemFn)
{
log("ZWNL called with "+fhemFn);
zw_visible = !zw_visible;
var txt = (zw_visible ? 'Hide' : 'Show');
var width=960,height=480;
$('#ZWDongleNr').html(''+txt+' neighbor map');
if(!zw_visible) {
$("#ZWDongleNrSVG")
.css({width:0, height:0})
.html('');
return;
}
FW_cmd(FW_root+"?cmd={"+fhemFn+"}&XHR=1", function(r){
var xpos=20, ypos=20, fnRet = JSON.parse(r);
var cnt=0;
for(var elName in fnRet.el) {
var el = fnRet.el[elName];
el.lines = [];
el.width = el.height = 30;
if(!el.pos.length) {
el.pos = [xpos, ypos];
xpos += 150;
if(xpos+150 >= width)
xpos = 20, ypos += 50;
}
cnt++;
}
if(height < cnt*35)
height = cnt*35;
zw_draw(fnRet, width, height);
});
}
function
zw_draw(fnRet, width, height)
{
var h = fnRet.el;
var svg = '