function cutoff_by_element(el, w)	{
	for(var i=0; i < el.length; i++)	{
		cutoff(el[i], w);
	}
	return true;
}

function cutoff(el, w)	{
	if (el.offsetWidth > w)	{
		while (el.offsetWidth > w)
        {
            el.innerHTML = el.innerHTML.substring(0, el.innerHTML.length-1);
        }
		el.innerHTML += '...';
	}
}

