--- /wwwRoot/Code Library/drupal/modules/swfobject_api/swfobject_api.module	2008-03-20 19:57:22.000000000 -0400
+++ /wwwRoot/www.star883.com/blog/modules/swfobject_api/swfobject_api.module	2008-06-04 11:57:10.000000000 -0400
@@ -129,17 +129,33 @@ function theme_swfobject_api($url, $para
   // add the parameters
   if ($params) {
     $script[] = 'var params = {';
+	$length=count($params);
+	$i=1;
     foreach ($params as $key => $value) {
-       $script [] = "  $key: '$value',";
+       if($i<$length){
+			$script [] = "  $key: '$value',";
+		}
+		else{
+			$script [] = "  $key: '$value'";
+		}
+		$i++;
     }
     $script[] ='};';
   }
 
   // add the flashvars
   if ($vars) {
-    $script[] = 'var flashvars = {'; 
+    $script[] = 'var flashvars = {';
+	$length=count($vars);
+	$i=1;
     foreach ($vars as $key => $value) {
-      $script[] = "  $key: '$value',";
+    if($i<$length){
+		$script[] = "  $key: '$value',";
+		}
+		else{
+			$script[] = "  $key: '$value'";
+		}
+		$i++;
     }
     $script[] = "};";
   }
@@ -150,8 +166,16 @@ function theme_swfobject_api($url, $para
   // add the attributes
   if ($attributes) {
     $script[] = 'var attributes = {'; 
+	$length=count($attributes);
+	$i=1;
     foreach ($attributes as $key => $value) {
-      $script[] = "  $key: '$value',";
+       if($i<$length){
+      		$script[] = "  $key: '$value',";
+		}
+		else{
+			$script[] = "  $key: '$value'";
+		}
+		$i++;
     }
     $script[] = "};";
   }
@@ -159,31 +183,42 @@ function theme_swfobject_api($url, $para
     $script[] = "var attributes = {};";
   }
 
-  // Express install redirect URL: as per the SWFObject docs, this should
-  // actually be xiRedirectUrl; variable name changed for simplicity.
-  if (! $params['express_redirect']) {
-    $params['express_redirect'] = variable_get('swfoa_express', true) ? drupal_get_path('module', 'swfobject_api') .'/expressinstall.swf' : 'false';
-  }
+	 // Express install redirect URL: as per the SWFObject docs, this should
+	 // actually be xiRedirectUrl; variable name changed for simplicity.
+	 if (! $params['express_redirect']) {
+	   $params['express_redirect'] = variable_get('swfoa_express', true) ? drupal_get_path('module', 'swfobject_api') .'/expressinstall.swf' : 'false';
+	 }
 
-  // Set the minimum version of flash expected
-  if (! $params['version']) {
-    $params['version'] = variable_get('swfoa_version', 9) ? variable_get('swfoa_express', "9.0.0") : 'false';
-  }
+	 // Set the minimum version of flash expected
+	 if (! $params['version']) {
+	   $params['version'] = variable_get('swfoa_version', 9) ? variable_get('swfoa_express', "9.0.0") : 'false';
+	 }
 
-  // register the swfojbect
-  $script[] = "  swfobject.embedSWF('$url', '$div_id', '". $params['width'] ."', '". $params['height'] ."', '".  $params['version'] ."', '". $params['express_redirect'] ."', flashvars, params, attributes );";
-  
-  // close the document ready
-  $script[] = "});";
-  
-  // output the js
-  drupal_add_js(implode("\n", $script), 'inline' );
-  
-  // increment the id count
-  $id_count ++; 
-  
-  // create the html output
-  $html  = "<div  id=\"$div_id\"  $class >". $base_params['no_flash'] ."</div>\n";
+	 // register the swfojbect
+	 $script[] = "  swfobject.embedSWF('$url', '$div_id', '". $params['width'] ."', '". $params['height'] ."', '".  $params['version'] ."', '". $params['express_redirect'] ."', flashvars, params, attributes );";
+ 
+	 // close the document ready
+	 $script[] = "});";
+ 
+	 // output the js
+	 drupal_add_js(implode("\n", $script), 'inline' );
+ 
+	 // increment the id count
+	 $id_count ++; 
+  
+	// Build Object
+	$html = "<div".$class.">
+				<object id='".$div_id."' classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' width='".$params['width']."' height='".$params['height']."'>
+					<param name='movie' value='".$url."' />
+					<!--[if !IE]>-->
+						<object type='application/x-shockwave-flash' data='".$url."' width='".$params['width']."' height='".$params['height']."'>
+							<!--<![endif]-->
+								<p>". $base_params['no_flash'] ."</p>
+							<!--[if !IE]>-->
+						</object>
+					<!--<![endif]-->
+				</object>
+			</div>";
   
   return $html;
 }
\ No newline at end of file
