

var x_14a = {
x_14b:5000,     x_14c:500,  x_14d:false,    x_14e: null,         x_14f: null,        x_u: '',  x_14g: null, x_14h: {}          };

x_14a.x_14i = function(x_si, x_4g) {
var x_tl = /([^\:]*)\:\/\/(.*)/.exec(x_si.href);
window.clearTimeout(x_14a.x_14g);
var x_wl = new Ajax.Request('set.php', {
method: 'post',
asynchronous: true,
parameters: {
target:'x_4e',
x_4g:x_4g,
x_u:x_14a.x_u
},
onComplete: function(x_76) {
x_14a.x_14j(x_tl[1], x_tl[2], x_76); 
}
});
x_14a.x_14k(x_si, 2); }

x_14a.x_14l = function(x_si, x_4g) {
var x_tl = /([^\:]*)\:\/\/(.*)/.exec(x_si.href);
window.clearTimeout(x_14a.x_14g);
var x_wl = new Ajax.Request('set.php', {
method: 'post',
asynchronous: true,
parameters: {
target:'x_4j',
x_4g:x_4g,
x_u:x_14a.x_u
},
onComplete: function(x_76) {
x_14a.x_14j(x_tl[1], x_tl[2], x_76); 
}
});
x_14a.x_14k(x_si, 3); }
x_14a.x_14j = function(x_tl, x_14m, x_76) {
if (x_76.responseText) {
var x_se = x_76.responseText.evalJSON(true);
if (x_se.x_4i) {
x_14a.x_14n();
return; }
}
switch (x_tl) { case 'dial':
alert(x_14a.x_st('dialError').replace('%1', x_14m));
break;
case 'hang':
alert(x_14a.x_st('hangError').replace('%1', x_14m));
break;
}
x_14a.x_14n();
}

x_14a.x_14k = function(x_si, x_14o) {
x_14o = x_14a.x_14o(x_14o); var x_14p = x_si.parentNode;
if ('TD' == x_14p.tagName) {
x_14p.innerHTML = x_14a.x_st('pleaseWait');
if (x_14p.className = 'C3') {
x_14p.previousSibling.innerHTML = x_14o;
}
} else {
x_si.innerHTML = x_14a.x_st('pleaseWait');
}
}

x_14a.x_14q = function() {
var doc = window.top.document.getElementById('rasList');
if (doc) {
x_14a.x_14e = window.top.document;
window.top.x_14a = x_14a;
x_14a.x_14f = x_14a.x_14e.getElementById('rasList');
x_14a.x_u = x_14a.x_14e.getElementById('rasDefaults').x_u.value;
x_14a.x_14r();
x_14a.x_14n();
} else {
window.setTimeout(x_14q, 500); }
}

x_14a.x_14r = function() {
var x_14s = x_14a.x_14e.getElementById('rasDefaults');
var x_14h = {}, name = '', value = '';
for (var x_14t in x_14s) {
if (parseInt(x_14t)) {
name = x_14s[x_14t].name;
value = x_14s[x_14t].value;
x_14h[name] = value;
} else {
if (/^x_14u(.*)/.test(x_14t)) {
x_14h[x_14t] = x_14s[x_14t].value;
}
}
}
x_14a.x_14h = x_14h;
}

x_14a.x_st = function(x_14v) {
if (!/^x_14u(.*)/.test(x_14v)) {
x_14v = 'x_14u'+x_14v; }
if (x_14a.x_14h[x_14v]) {
return x_14a.x_14h[x_14v];
} else {
return 'Translation error: unknown text "' + x_14v + '"';
}
}

x_14a.x_14w = function(x_76) {
if (x_76.responseText) {
var x_se = x_76.responseText.evalJSON(true);
if (!x_se) { alert('no JSON response!'); }
} else {
alert('no response!');
}
if (x_se.x_4l) {
x_14a.x_14x(x_se.x_4l);
return; }
if(x_se.x_4x) {
if (0 == x_se.x_4x.length) {
x_14a.x_14x('noLines');
return; }
x_14a.x_14y(x_se.x_4x);
x_14a.x_14g = window.setTimeout(x_14a.x_14n,
x_14a.x_14d?x_14a.x_14c:x_14a.x_14b);
return;
}
x_14a.x_14x('noServer');
return; }

x_14a.x_14x = function(x_14z, x_150) {
var x_151 = x_14a.x_14e.getElementById('ras');
var x_yc = x_14a.x_14e.getElementById('rasMessage');
x_151.className = 'hide';
x_yc.className = 'noData';
if (undefined != x_150) {
x_yc.innerHTML = x_14a.x_st('noServer') + '<br>' +
x_14a.x_st(x_14z).replace('%1', x_150);
} else {
switch (typeof x_14z) {
case 'object':
x_14a.x_14x('badResponse', x_14z.status);
break;
case 'string':
x_yc.innerHTML = x_14a.x_st(x_14z);
break;
default:
x_yc.innerHTML = x_14a.x_st('noServer'); 
}
}
}

x_14a.x_14n = function() {
if (x_14a.x_14g) {
window.clearTimeout(x_14a.x_14g);
x_14a.x_14g = null;
}
var xhr = new Ajax.Request('set.php',
{
method:'post',
asynchronous: true,
parameters: {
target:'x_4k',
x_u: x_14a.x_u
},
onSuccess: x_14a.x_14w,
onFailure: x_14a.x_14x
});
}

x_14a.x_152 = function() {
while (x_14a.x_14f.firstChild) {
x_14a.x_14f.removeChild(x_14a.x_14f.firstChild);
}
}

x_14a.x_153 = function(x_76, x_154) {
var td = x_14a.x_14e.createElement('td');
td.className = x_154;
td.innerHTML = x_76;
return td;
}

x_14a.x_14o = function (x_14o) {
if (2 == x_14o || 3 == x_14o) {
x_14a.x_14d = true;
} var x_14v;
switch (x_14o) {
case 0:
x_14v = x_14a.x_st('disconnected');
break;
case 1:
x_14v = x_14a.x_st('connected');
break;
case 2:
x_14v = x_14a.x_st('connecting');
break;
case 3:
x_14v = x_14a.x_st('disconnecting');
break;
default:
x_14v = x_14a.x_st('unknown');
break;
}
return x_14v;
}

x_14a.x_tl = function (x_14o, x_4g, x_14m) {
var x_tl = '';
switch (x_14o) {
case 0: x_tl = '<a ' +
'href=dial://' + x_14m + '" ' +
'onclick="x_14a.x_14i(this, \''+x_4g+'\'); return false;")>'+
x_14a.x_st('doConnect')+'</a>';
break;
case 1: x_tl = '<a ' +
'href=hang://' + x_14m + '" ' +
'onclick="x_14a.x_14l(this, \''+x_4g+'\'); return false;")>'+
x_14a.x_st('doDisconnect')+'</a>';
break;
case 2: case 3: x_tl = x_14a.x_st('pleaseWait');
break;
default: x_tl = '&nbsp;'; }
return x_tl;
}

x_14a.x_14y = function(x_76) {
x_14a.x_152();
x_14a.x_14e.getElementById('rasMessage').className = 'hide';
x_14a.x_14e.getElementById('ras').className = '';
x_14a.x_14d = false; x_76.each( function(item) {
var tr = x_14a.x_14e.createElement('tr');
tr.appendChild(x_14a.x_153(item.name, 'C1'));
tr.appendChild(x_14a.x_153(x_14a.x_14o(item.status), 'C2'));
tr.appendChild(x_14a.x_153(x_14a.x_tl(item.status, item.id, item.name), 'C3'));
if (1 == item.status) { tr.appendChild(x_14a.x_153(x_14a.x_155(item.time), 'C4'));
tr.appendChild(x_14a.x_153(x_14a.x_156(item.bytesIn), 'C5'));
tr.appendChild(x_14a.x_153(x_14a.x_156(item.bytesOut), 'C6'));
} else { tr.appendChild(x_14a.x_153(x_14a.x_155(), 'C4'));
tr.appendChild(x_14a.x_153(x_14a.x_156(), 'C5'));
tr.appendChild(x_14a.x_153(x_14a.x_156(), 'C6'));
}
x_14a.x_14f.appendChild(tr);
});
}

x_14a.x_156 = function(x_157) {
if (x_157) {
return x_157 + ' kB';
} else {
return '&nbsp;';
}
}

x_14a.x_155 = function(x_158) {
if (x_158) {
return x_158;
} else {
return '&nbsp;';
}
}

if (window != window.top) { x_14a.x_14q();
}
