
function countChars(ta,max) 
{
	
	var taElement = document.getElementById(ta);
	var txt = taElement.value.length;
	var charsRemaining = max-txt;
	if (charsRemaining>=0) {
		document.getElementById(ta+'-counter').value=charsRemaining;
	} else {
		taElement.value=taElement.value.substring(0,max);
	}
}

/*
$(document).ready(function(){
    // clear search box on click if the value is "Search"
    $('#search_query').click(function(){
        if ($(this).val() == 'Search') { $(this).val(''); }
    });
});
*/

