// i shorthanded alot of this in order to make it not shitty; match.com, who i accredit for the script
// used long-winded var names, eg: "container_item-counter-timbaqtu_" + field shit. please note that I 
// hate javascript; however, for the haters out there, i hope you can find a good use for it.

function textCounter(field,maxChars,spanName)
{
   var txtArea = document.getElementById('counter_' + field)
   var strTemp = "";
    if (txtArea.value.length > maxChars)
    {
		alert("Oops!  Please shorten your answer.\r\nYour answer can contain up to " + maxChars + " characters, including letters, numbers and underscores.  Watch the counter to tell how many characters you have remaining.");
		strTemp = txtArea.value.substring(0, maxChars);
		txtArea.value = strTemp;
    }
   document.getElementById(spanName).innerHTML = maxChars - txtArea.value.length;
}

function _onloadEventHandler(args)
{
	if(FireOnload){FireOnload(args);}
}


function FireOnload(args)
{
	textCounter('txtDesc',3000,'chrDesc');

}

