/**
 * Added by Abhishek on Tuesday, December 16, 2008 3:54:57 PM for Character counter limitation
 */

var bName = navigator.appName;
function taLimit(taObj,maxL) {
	if (taObj.value.length>maxL) 
	{
		taObj.value = taObj.value.substr(0,maxL);
		alert('\nPlease note that your text exceeded the specified\nlimit of ' + maxL + ' characters. The extra characters were\ntruncated to fit within the character limit.');
		return false;
	}
	return true;
}

function taCount(taObj,Cnt,maxL) {
	if (taObj.value.length>maxL)
	{
		taObj.value = taObj.value.substr(0,maxL);
		alert('\nPlease note that your text exceeded the specified\nlimit of ' + maxL + ' characters. The extra characters were\ntruncated to fit within the character limit.');
	}

	objCnt=createObject(Cnt);
	objVal=taObj.value;
	if (objVal.length>maxL) objVal=objVal.substring(0,maxL);
	if (objCnt) {
		if(bName == "Netscape"){	
			objCnt.textContent=maxL-objVal.length;}
		else{objCnt.innerText=maxL-objVal.length;}
	}
	return true;
}
function createObject(objId) {
	if (document.getElementById) return document.getElementById(objId);
	else if (document.layers) return eval("document." + objId);
	else if (document.all) return eval("document.all." + objId);
	else return eval("document." + objId);
}
