--- modules/voting/voting.module.old	Wed Apr 11 20:30:56 2007
+++ modules/voting/voting.module	Wed Apr 11 20:30:31 2007
@@ -355,20 +355,33 @@ function theme_voting_control_flash($con
   
 	// create the Flash filename, including the required variables and optional querystring
 	$filename = base_path() . drupal_get_path('module', 'voting') . "/voting.swf?content_type=$content_type&content_id=$content_id&base_url=" . base_path() . $optional_vars;
-  
+
+  // Include swfobject.js from http://blog.deconcept.com/swfobject/, thanks Geoff! 
+  $output .= '<script type="text/javascript" src="'. base_path() . drupal_get_path('module', 'voting') .'/swfobject.js"></script>'. "\n";
+ 
 	// create the HTML to put the Flash object on the page
 	//
 	// NOTE: The object is nested in a table for CSS styling.  It does 
 	// not seem to work correctly in Firefox when a DIV is used instead.
   $output .= "<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" class=\"voting\"><tr><td>\n";
-  $output .= '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
-   codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0"
-   width="210" height="35" id="voting" align="">' . "\n";
-  $output .= '<param name=movie value="' . $filename . '">' . "\n";
-  $output .= '<param name=quality value=high>' . "\n";
-  $output .= '<embed src="' . $filename . '" quality="high" width="210" height="35" name="voting" align=""
-   type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"></embed>' . "\n";
-  $output .= "</object>\n";
+
+  // div that will contain flash object via javascript
+  // each div has a unique id based off the node id
+  // because in IE the javascript wouldn't replace flashcontent div
+  // beyond the first one for pages with more than one voting
+  $output .= '<div id="flashcontent-'. $content_id .'">' . "\n";
+  $output .= '  This text is replaced by the Flash movie.' . "\n";
+  $output .= '</div>' . "\n";
+
+  // inline javascript for creating SWFObject and writing to 
+  // flashcontent div
+  $output .= '<script type="text/javascript">' . "\n";
+  $output .= 'var so = new SWFObject("'. $filename .'", "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000", "210", "35", "6", "#FFFFFF");' . "\n";
+  $output .= 'so.addParam("quality", "high");' . "\n";
+  $output .= 'so.addParam("name", "voting");' . "\n";
+  $output .= 'so.write("flashcontent-'. $content_id .'");' . "\n";
+  $output .= '</script>' . "\n";
+
   $output .= "</td></tr></table>\n";
   
   return $output;
