if ( typeof window.addEventListener != "undefined" ) {
//	window.addEventListener( "load", init_short_text, false );
} else if ( typeof window.attachEvent != "undefined" ) {
//	window.attachEvent( "onload", init_short_text );
}
else {
//	window.onload = init_short_text;
}

function init_short_text() {
	var a_elements = document.getElementsByTagName( "*" );
	var len = a_elements.length;
	for (var n = 0; n < len; n++)
	{
		c_item = a_elements[n];
		if (c_item && c_item.className == "lc_toggle_text" && c_item.innerHTML.length > 350) {
			var c_text = c_item.innerHTML;
			c_item.innerHTML = "";
			c_item.origHTML = c_text;
			c_item.shortHTML = shorten_text(c_text);
			toggle_short_text(c_item,1);
			c_item.className = "lc_toggle_text_on";
		}
	}
}

function toggle_short_text(item,init) {
	if (init) {
		var obj = item;
	} else {
		var obj = item.parentNode;
	}
	if (obj) {

		if (obj.short_text != obj.origHTML) {
			if (obj.short_text == true) {
				new_text = obj.origHTML;
				new_text += "&nbsp;&nbsp;<a href=\"javascript:void(null);\" onclick=\"toggle_short_text(this)\" style=\"font-weight: bold;\">[^]</a>";
				//obj.style.height = "";
			} else {
				new_text = obj.shortHTML;
				new_text += "&nbsp;&nbsp;<a href=\"javascript:void(null);\" onclick=\"toggle_short_text(this)\" style=\"font-weight: bold;\">[...]</a>";
				//obj.style.height = "65px";
			}
			obj.innerHTML = new_text;
			obj.short_text = true &! obj.short_text;
		}
	}
}

function shorten_text (text) {
	if (text.length > 350) {
		text=text.substring(text,350);
	}
	return text;
}
