// JavaScript Document
function trunc(divId, length){
	if(!divId || !length || length <= 0)
		return;
	var str = document.getElementById(divId);
	if(str){
		var truncStr = str.innerHTML;
		if(truncStr.length > length){
		 truncStr = truncStr.substring(0, length);
		 //truncStr = truncStr.replace(/\w+$/, '');
		 str.innerHTML = truncStr + '...';
		}
	}
}

//function trunc8(phrase,max_words){
//	var phrase_array = explode(' ',phrase);
//	if(count(phrase_array) > max_words && max_words > 0)
//		phrase = implode(' ',array_slice(phrase_array, 0, max_words)).'...'  
//	return phrase;
//}
