// JavaScript Document
//Validate textareas
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 = "<span class=boxCount>"+ len +"</span>" + " of " + maxKeys + " characters.";
  if (len > maxKeys) showstr += '&nbsp;&nbsp;  Limit exceeded. Information may be lost.';
  txtShow( cTxtName, showstr );
}