var isDOM = (document.getElementById);
var isIE4 = (document.all && !isDOM);
var isNS4 = (document.layers);
var isDyn = (isDOM || isIE4 || isNS4);

function getRef(id) {
if (isDOM) return document.getElementById(id);
if (isIE4) return document.all[id];
if (isNS4) return document.layers[id];
}

function getVP(x) {
  if (typeof x == 'undefined') x = 'vp';
	return document.forms[x];
}

function r2(x, desMist) {
x = parseFloat(x);
return Math.round(x * Math.pow(10, desMist)) / Math.pow(10, desMist)
}

function nf(x) {
x = parseFloat(x.replace(/,/, "."));
return isNaN(x) ? 0 : x;
}

function showNum(x) {
return (x == Infinity || x == -Infinity || isNaN(x)) ? "-" : x;
}

function enAb(theObject) {
theObject.style.backgroundColor = '#FFFFFF';
theObject.readOnly = false;
}

function disAb(theObject) {
theObject.style.backgroundColor = '#CCCCCC';
theObject.readOnly = true;
}

function itemIndex(r) {
for (var i = 0; i < r.length; i++) { if (r[i].checked == true) {return i} }
return -1;
}

function createSelect(s, p, d) {
s.length = 0;
for (var i = 0; i < p.length; i++) { s[i] = new Option(p[i]); }
s.selectedIndex = d;
}


