//trap onload event
window.onload = function ()
{
	//OS Detect for Windows Platform
	var os_type = navigator.platform;
	myMatch = new RegExp("win","i");
	os_type = os_type.match(myMatch);

	//Determine browser, we only need this for Internet Explorer
	if (os_type!=null && (os_type.length>0) && (navigator.appName == "Microsoft Internet Explorer"))
	{
		embeds=document.getElementsByTagName('embed');

		if(embeds!=null && embeds!='undefined' && embeds.length>0)
		{
			for(e=0;e<embeds.length;e++)
			{
				tParent=embeds[e].parentNode;
				tHTML=tParent.innerHTML;
				tParent.innerHTML=tHTML;
			}
		}

		//set object for brevity
                var arrElements = new Array(1);
                arrElements[0] = "object";
                //arrElements[1] = "embed";

		for(tx=0; tx < arrElements.length; tx++)
		{
			var replaceObj = document.getElementsByTagName(arrElements[tx]);

			//loop over element objects returned
			for (ti = 0; ti < replaceObj.length; ti++ )
			{
				//set parent object for brevity
				parentObj = replaceObj[ti].parentNode;

				//grab the html inside of the element before removing it from the DOM
				var newHTML ='';

				//flashType=replaceObj[ti].type;
				flashHeight=replaceObj[ti].height;
				flashWidth=replaceObj[ti].width;
				flashData=replaceObj[ti].data;
				flashClassID=replaceObj[ti].classid;
				tflashClassID='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000';
				flashCodebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0';
				flashID=replaceObj[ti].id;

				if(flashClassID==null || flashClassID=='undefined' || flashClassID.length==0)
					flashClassID=tflashClassID;

				newHTML+='<object';
				
				//if(flashType.length>0)
				//	newHTML+=' type="'+flashType+'"';
				
				if(flashHeight.length>0)
					newHTML+=' height="'+flashHeight+'"';

				if(flashWidth.length>0)
					newHTML+=' width="'+flashWidth+'"';
					
				//if(flashData.length>0)
				//	newHTML+=' data="'+flashData+'"';

				if(flashClassID.length>0)
					newHTML+=' classid="'+flashClassID+'"';

				if(flashID.length>0)
					newHTML+=' id="'+flashID+'"';

				newHTML+='>';

				for(tt = 0; tt < replaceObj[ti].childNodes.length; tt++)
				{
					paramType=replaceObj[ti].childNodes[tt].nodeName;
					paramName=replaceObj[ti].childNodes[tt].name;
					paramValue=replaceObj[ti].childNodes[tt].value;

					newHTML+='<param name="'+paramName+'" value="'+paramValue+'"/>';
				}

				newHTML+='</object>';

				//Return New Data
				//alert(newHTML);
				parentObj.innerHTML=newHTML;
			}
		}
	}
}
