

var IE = (document.all) ? 1 : 0;
var DOM = 0; 
if (parseInt(navigator.appVersion) >=5) {DOM=1};

        function txtShow( cId, txt2show ) {
            
            // Detect Browser

            if (DOM) {
		var viewer = document.getElementById(cId);
                viewer.innerHTML=txt2show;
            }
            else if(IE) {
                document.all[cId].innerHTML=txt2show;
            }
        }//txtshow
        
        function getTxt( cId ) {
            var output = "";
            // Detect Browser
            if (DOM) {
		var viewer = document.getElementById(cId);
		output = viewer.value;
            }
            else if(IE) {
                output = document.all[cId].value;
            }
            return output;
        }//getTxt

function countChars(cBoxName, cTxtName, maxKeys) 
{
  var str = new String(getTxt(cBoxName));
  var len = str.length;
  var showstr = "<font color=#F20616><b>" + len + " </b></font>characters of " + maxKeys + " entered";
  if (len > maxKeys) showstr += '&nbsp;<font color=#F20616>:<b>Some information will be lost, please edit your text</b></font>';
  txtShow( cTxtName, showstr );
}
