function getFlashObject(name)
{
   if (window.document[name])
   {
      return window.document[name];
   }

   if (document.all)
   {
      if (document.all[name])
      {
         return document.all[name];
      }

      if (window.opera)
      {
         var movie = eval(window.document + name);

         if (movie.SetVariable)
         {
            return movie;
         }
      }

      return;
   }

   if(document.layers)
   {
      if(document.embeds[name])
      {
         var movie = document.embeds[name];

         if (movie.SetVariable)
         {
            return movie;
         }
      }

      return;
   }

   if (!document.getElementById)
   {
      return;
   }

   var movie = document.getElementById(name);

   if (movie.SetVariable)
   {
      return movie;
   }

   var movies = movie.getElementsByTagName('embed');

   if (!movies || !movies.length)
   {
      return;
   }

   movie = movies[0];

   if (movie.SetVariable)
   {
      return movie;
   }

   return;
}
