function shorten_words(lines, maxlength) {
	this.shorten_word = function(word) {
		if(word.length > maxlength) {
			var w1 = shorten_word(word.substr(0, word.length / 2)) + "&ndash; ";
			var w2 = shorten_word(word.substr(word.length / 2));
			return w1 + w2;
		}
		return word;					
	}

	for(var i=0; i < lines.length; i++) {
		var words = lines[i].innerHTML.split(" ");
		for(var j=0; j < words.length; j++) {
			words[j] = this.shorten_word(words[j]);
		}
		lines[i].innerHTML = words.join(" ");
	}
}