function dropDown(elId, subElId) {
	try {
		el = document.getElementById(elId);
		subEl = document.getElementById(subElId);
		if(el && subEl && subEl.childNodes.length > 0) {
			if(subEl.style.display !== 'block') {
				el.className = 'active';
				subEl.style.display = 'block';
			}
			else {
				el.removeAttribute('class');
				el.removeAttribute('className');
				subEl.style.display = 'none';
			}
		}
	}
	catch(e) {}
}

// Check if highlights have an image attached, otherwise replace their classname so:
// A. The shortenClass will use a higher maxlength becasue it works on class
// B. The elements will be wider because of different styling
function setWidth(messageId, highlightClass, titleClass, descClass) {
	try {
		highlightId = 'highlight' + messageId;
		thumbnailId = 'thumbnail' + messageId;
		titleId = 'title' + messageId;
		descId = 'desc' + messageId;
		if(!document.getElementById(thumbnailId)) {
			document.getElementById(highlightId).className = highlightClass;
			document.getElementById(titleId).className = titleClass;
			document.getElementById(descId).className = descClass;
		}
	}
	catch(e) {
	}
}

function shortenClass(tagName, className, maxLength) {
	aElements = document.getElementsByTagName(tagName);
	for(iElements = 0; iElements < aElements.length; iElements++) {
		if(aElements[iElements].className == className) {
			if(aElements[iElements].innerHTML.length > maxLength) 
				aElements[iElements].innerHTML = aElements[iElements].innerHTML.substring(0, maxLength) + '&hellip;';
		}
	}
}