

theObjects = document.getElementsByTagName('object');
var theFlashVars;

for (var i = 0; i < theObjects.length; i++) 
{

	var theParams = theObjects[i].getElementsByTagName("param");    
	var theParamsLength = theParams.length;    

	for (var j = 0; j < theParamsLength; j++) 
	{      
		if(theParams[j].name.toLowerCase() == 'flashvars')
		{        
			theFlashVars = theParams[j].value; 
			  
		}    
	}    

	var theOuterHTML = theObjects[i].outerHTML;    
	
	var re = "<PARAM NAME=\"FlashVars\" VALUE=\"\">";
	theOuterHTML = theOuterHTML.replace(re,"<param name=\"FlashVars\" value=\"" + theFlashVars + "\">");
	theObjects[i].outerHTML = theOuterHTML;
  	
}

