if (window.HTMLElement && HTMLElement.prototype) {
   HTMLElement.prototype.__defineSetter__(
     'innerText',
     function (text) {
       while (this.hasChildNodes())
         this.removeChild(this.lastChild);
       this.appendChild(document.createTextNode(text));
     }
   );
   HTMLElement.prototype.__defineGetter__(
     'innerText',
     function () {
       var text = '';
       for (var i = 0; i < this.childNodes.length; i++)
         if (this.childNodes[i].nodeType == 3)
           text += this.childNodes[i].nodeValue;
         else if (this.childNodes[i].nodeType == 1)
           text += this.childNodes[i].innerText;
       return text;
     }
   );
}
function setInnerText (elementId, text) {
   var el;
   if (document.all)
     el = document.all[elementId];
   else if (document.getElementById)
     el = document.getElementById(elementId);
   if (el) {
     el.innerText = text;
   }
}
function setInnerHTML (elementId, text) {
   var el;
   if (document.all)
     el = document.all[elementId];
   else if (document.getElementById)
     el = document.getElementById(elementId);
   if (el) {
	 el.innerHTML = text;
   }
}

// Функция открывает выплывающее окно help
function OpenHelpWindow(name,width,height,scrollbars,resize) {
	var window_left_pos = Math.round((screen.width - width)/2);
	var window_top_pos= Math.round((screen.height - height)/3);
	open('/help/help.html?'+name, name, 'toolbar=no, location=no, menubar=no, directories=no, status=no, resizable='+resize+', scrollbars='+scrollbars+', width='+width+', height='+height+', top='+window_top_pos+', left='+window_left_pos);
	}
function ChangeColor(tableRow, highLight)
	{
			if (highLight)
			{
				tableRow.style.backgroundColor = '#dcfac9';
			}
			else
			{
				tableRow.style.backgroundColor = 'white';
			}
	}
function DoNav(theUrl)
	{
		document.location.href = theUrl;
	}
