// script for texarea check maxlength
	function maxLength(field,maxChars)
	{
	   if(field.value.length >= maxChars) {
		  event.returnValue=false; 
		  alert("more than " +maxChars + " chars");
		  return false;
	   }
	
	}  
	
	function maxLengthPaste(field,maxChars)
	{
	   event.returnValue=false;
	   if((field.value.length +  window.clipboardData.getData("Text").length) > maxChars) {
		 alert("more than " +maxChars + " chars");
		 return false;
	   }
	   event.returnValue=true;
	}
// end

<!-- Begin
function textCounter(field, countfield, maxlimit) {
	if (field.value.length > maxlimit) // if too long...trim it!
		field.value = field.value.substring(0, maxlimit);
	// otherwise, update 'characters left' counter
	else 
		countfield.value = maxlimit - field.value.length;
}
// End -->

// function to hide/visible the block		
	function fn_expand(imgid,imgpath,trid)
	{	
		var imid = imgid.id;	
		if(document.getElementById(trid)){			
			if(document.getElementById(trid).style.display == 'none'){
				document.getElementById(imid).src = imgpath + 'collapseall.jpg';
				document.getElementById(trid).style.display = '';
			}else{
				document.getElementById(imid).src = imgpath + 'expandall.jpg';			
				document.getElementById(trid).style.display = 'none';
			}
		}																													
	}
// end

// Use in admin section 
function fn_listItemTask( id, task ) {
    var f = document.adminForm;
    cb = eval( 'f.' + id );
    if (cb) {
        for (i = 0; true; i++) {
            cbx = eval('f.cb'+i);
            if (!cbx) break;
            cbx.checked = false;
        } // for
        cb.checked = true;
        f.boxchecked.value = 1;
        submitbutton(task);
    }
    return false;
}
// end


