max=300;
maxim=25;
timerID=null;
running=false;

function countChars() {
if(document.join_form.description.value.length>max) {
document.join_form.description.blur();
document.join_form.lungime.value =0;
alert("Ati atins numarul maxim de caractere permis pentru descriere!");
}
else document.join_form.lungime.value =
max-document.join_form.description.value.length;
if (document.join_form.lungime.value==0) {
var text=document.join_form.description.value
document.join_form.description.value=text.substr(0,max);
}
}

function countChars2() {
if(document.join_form.title.value.length>maxim) {
document.join_form.title.blur();
document.join_form.lungime.value =0;
alert("Ati atins numarul maxim de caractere permis pentru titlu!");
}
}


function timerTick() {
if(running) {
	stopTimer();
	if(navigator.appName=="Netscape") {
		//document.join_form.Descript.blur();
		}
	startTimer();
	countChars();
	}
}
function stopTimer() {
clearTimeout(timerID);
running=false;
}
function startTimer() {
if(!running) {
	running=true;
	timerID=setTimeout("timerTick()",200);
	}
}
