﻿  document.observe('dom:loaded', EmbedFlash);
        function EmbedFlash()
        {                    
            //Get the div tag from the file
            var divLayer = document.getElementsByTagName('div');
            //Check the div tag's classname equal to flashcontent
            if (divLayer.length>0)
            {                
                var myFlash = new Array()
                for (i=0; i<divLayer.length; i++)         
                {                            
                    if (divLayer[i].className == 'flashcontent')
                    {                        
                        myFlash.push(divLayer[i].id)
                    }
                }
                var so = new Array()
                for (j=0; j<myFlash.length; j++)         
                {
                    //split the div tag based on ::
                    tempParam = myFlash[j].split('::')
                    //Following method used to display the flash file, swfobject.embedSWF([URL],[div Id],[Height], [Width], [Flash Version], [Background Colour], [Alternative flash or image]);
                    
                    var content = "<object ";
                    if (tempParam[2] != "")
                       content += "width=\"" + tempParam[2] + "\" ";                      
                    if (tempParam[3] != "")
                       content += "height=\"" + tempParam[3] + "\" ";
                    content += "codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0\" classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\"><param value=\"" + tempParam[0] + "\" name=\"movie\"><param value=\"high\" name=\"quality\"><param value=\"transparent\" name=\"wmode\"><embed width=\"" + tempParam[2] + "\" height=\"" + tempParam[3] + "\" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" wmode=\"transparent\" quality=\"high\" src=\"" + tempParam[0] + "\"></object>"          
                                                
                    document.getElementById(tempParam[1]).innerHTML = content;
                    //swfobject.embedSWF(tempParam[0], tempParam[1], "775", "1210", "1.0.0", "", {}, {}, {});                    
                    //swfobject.embedSWF(tempParam[0], tempParam[1], tempParam[2], tempParam[3], tempParam[4], tempParam[5],"expressInstall.swf");
                    //swfobject.embedSWF(tempParam[0], tempParam[1], "775", "1210", "1.0.0", "", {}, {}, {});
                }
            }
        }
