var h2 = document.getElementsByTagName('h2');
var o = null;

function ConvertHTMLEntities(input)
{
	input = input.replace(/&amp;/gi, "&");
	
	return input;
}

for(var x=0; x<h2.length; x++)
{
	var h = h2[x];
	
	if(h.className == 'swf')
	{
		var hd = document.createElement('div');
		hd.id = h.id + '_clone';
		hd.className = 'swf_clone';
		h.parentNode.insertBefore(hd, h);
		
		o = new SWFObject('/heading.swf', h.id + '_swf', '520', '21', '7', '#ffffff');
		o.addVariable('txt', escape(ConvertHTMLEntities(h.innerHTML)));
		o.addParam('wmode', 'transparent');
		o.write(h.id + '_clone');
	}
	else if(h.className == 'swf2')
	{
		var hd = document.createElement('div');
		hd.id = h.id + '_clone';
		hd.className = 'swf_clone';
		h.parentNode.insertBefore(hd, h);
		
		o = new SWFObject('/heading_sml.swf', h.id + '_swf', '120', '21', '7', '#ffffff');
		o.addVariable('txt', escape(ConvertHTMLEntities(h.innerHTML)));
		o.addParam('wmode', 'transparent');
		o.write(h.id + '_clone');
	}
}