function rewriteFlash(path, w, h, id) {
	var str = '';
	if ((path != '') && (path != undefined))
	{
		str =	'<object type="application/x-shockwave-flash" data="'+ path +'" width="'+ w +'" height="'+ h +'">' +
				'	<param name="movie" value="'+ path +'"/>' +
				'</object>';
	} 
	return str;
}

window.onload = function()
{
	var objs = document.getElementsByTagName("object");
	for(i = 0; i < objs.length; i++)
	{
		width = objs[i].getAttributeNode('width').value;
		height = objs[i].getAttributeNode('height').value;
		for(j = 0; j < objs[i].childNodes.length; j++)
		{
			name = objs[i].childNodes[j].getAttributeNode('name').value;
			value = objs[i].childNodes[j].getAttributeNode('value').value;
			if (name == 'movie')
			{
				path = value;
			}
		}
		objs[i].outerHTML = rewriteFlash(path, width, height);
	}
}

window.onunload = function() 
{
	var objs = document.getElementsByTagName("object");
	for(i = 0; i < objs.length; i++)
	{
		objs[i].outerHTML = '';
	}
}