﻿function RenderFlash(obj,src,width,height)
{

    var my_parent=obj.parentElement;
	var obj2=document.createElement("EMBED");
	
	obj2.setAttribute("src",src);
	obj2.setAttribute("width",width);
	obj2.setAttribute("height",height);
	obj2.setAttribute("name","FlashNavigation");
	obj2.setAttribute("swliveconnect","true");
	obj2.setAttribute("wmode","transparent");
	obj2.setAttribute("quality","high");
	obj2.setAttribute("type","application/x-shockwave-flash");
	obj2.setAttribute("PLUGINSPAGE","http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash");
	obj2.setAttribute("FlashVars","currentLanguage=en-US&currentSection=homepage");
	//my_parent.appendChild(obj2);
	//my_parent.removeChild(obj);
	obj=obj2;
	
	//obj2.value="hello";
	//alert(obj2.tagName)

//document.write(Flashscript);
}

/*function RenderFlash(src,width,height)
{
	var Flashscript = '';
	Flashscript += '<OBJECT id="FlashNavigation"  codeBase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0"';
	Flashscript += 'height="'+ height +'" width="'+ width +'" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" VIEWASTEXT> ';
	Flashscript += '<PARAM NAME="_cx" VALUE="20003"> ';
	Flashscript += '<PARAM NAME="_cy" VALUE="7011"> ';
	Flashscript += '<PARAM NAME=FlashVars VALUE="currentLanguage=en-US&currentSection=homepage"> ';
	Flashscript += '<PARAM NAME="Movie" VALUE="'+ src +'"> ';
	Flashscript += '<PARAM NAME="Src" VALUE="'+ src +'"> ';
	Flashscript += '<PARAM NAME="WMode" VALUE="Transparent"> ';
	Flashscript += '<PARAM NAME="Play" VALUE="-1"> ';
	Flashscript += '<PARAM NAME="Loop" VALUE="-1"> ';
	Flashscript += '<PARAM NAME="Quality" VALUE="High"> ';
	Flashscript += '<PARAM NAME="SAlign" VALUE=""> ';
	Flashscript += '<PARAM NAME="Menu" VALUE="-1"> ';
	Flashscript += '<PARAM NAME="Base" VALUE=""> ';
	Flashscript += '<PARAM NAME="AllowScriptAccess" VALUE=""> ';
	Flashscript += '<PARAM NAME="Scale" VALUE="ShowAll"> ';
	Flashscript += '<PARAM NAME="DeviceFont" VALUE="0"> ';
	Flashscript += '<PARAM NAME="EmbedMovie" VALUE="0"> ';
	Flashscript += '<PARAM NAME="BGColor" VALUE="FFFFFF"> ';
	Flashscript += '<PARAM NAME="SWRemote" VALUE=""> ';
	Flashscript += '<PARAM NAME="MovieData" VALUE=""> ';
	Flashscript += '<PARAM NAME="SeamlessTabbing" VALUE="1"> ';
	Flashscript += '<PARAM NAME="Profile" VALUE="0"> ';
	Flashscript += '<PARAM NAME="ProfileAddress" VALUE=""> ';
	Flashscript += '<PARAM NAME="ProfilePort" VALUE="0"> ';
	Flashscript += '<EMBED name="FlashNavigation" swliveconnect="true" src="'+ src +'" wmode="transparent" quality="high" bgcolor="#FFFFFF" ';
	Flashscript += 'WIDTH="'+ width +'" HEIGHT="'+ height +'" TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"';
	Flashscript += 'FlashVars="currentLanguage=en-US&currentSection=homepage"> </EMBED> ';
	Flashscript += '</OBJECT>'

document.write(Flashscript);
}*/


/*if (window.addEventListener){
        window.addEventListener('onload', RenderEmbedObjects, false);
      }
      else if (window.attachEvent)
      {
      window.attachEvent('onload', RenderEmbedObjects);
      }*/

function RenderEmbedObjects()
{

var obj_arr=document.getElementsByTagName("EMBED");
var m_width=obj_arr[0].width;
var m_height=obj_arr[0].height;
var m_src=obj_arr[0].src;
RenderFlash(obj_arr[0],m_src,m_width,m_height);

}