/***********************************************
* Form Field Progress Bar- By Ron Jonk- http://www.euronet.nl/~jonkr/
* Modified by Dynamic Drive for minor changes
* Script featured/ available at Dynamic Drive- http://www.dynamicdrive.com
* Please keep this notice intact
***********************************************/

function textCounter(field,counter,maxlimit,linecounter)
{
	// text width//
	var fieldWidth =  parseInt(field.offsetWidth);
	var charcnt = field.value.length;        

	// trim the extra text
	if (charcnt > maxlimit) 
	{ 
		field.value = field.value.substring(0, maxlimit);
	}

	else 
		{
			var percentage = parseInt(100 - (( maxlimit - charcnt) * 100)/maxlimit) ;
			document.getElementById(counter).style.width =  parseInt((fieldWidth*percentage)/100)+"px";
	//document.getElementById(counter).innerHTML="Limit: "+percentage+"%"
			document.getElementById(linecounter).innerHTML= charcnt +" tecken"
		}
	
	// color correction on style from CCFFF -> CC0000
		
		}


