var myBodyElements = document.getElementsByTagName("td");
var i;
for (i=0; i< myBodyElements.length; i++)
{
	if (myBodyElements[i].id.indexOf("cswmExpand")>-1)
	{
		if (myBodyElements[i].innerHTML == "")
			myBodyElements[i].innerHTML = "&nbsp;";
	}
}

// Opens up links in new window.
$('.lnkTargetBlank').each(function() {
	$(this).attr('target','_blank');
});

// Change opacity on hover.
$('a.social').hover(function() {
	$(this).css('opacity','0.7');
}, function() {
	$(this).css('opacity','1.0');
});

$(document).ready(function() {
	// Hide the text for the Social Media links.
	$('.social span').hide();
	$("#MainContentArea img").each(function() {
		if ( $(this).attr('align') ) {
			var hspace = 10; var vspace = 10;
			var align = $(this).attr('align');
			if ( $(this).attr('hspace') ) {
				hspace = $(this).attr('hspace');
			}
			if ( $(this).attr('vspace') ) {
				vspace = $(this).attr('vspace');
			}
			$(this).css('float', align).css('marginBottom', vspace+"px");
			if ( align == 'left' ) {
				$(this).css('margin-right', hspace+"px");
			} else if ( align == 'right' ) {
				$(this).css('margin-left', hspace+"px");
			}
			$(this).removeAttr('hspace').removeAttr('vspace');
		}
	});
});
