Index: /trunk/xpressme_integration_kit/include/xpress_render.php
===================================================================
--- /trunk/xpressme_integration_kit/include/xpress_render.php	(revision 559)
+++ /trunk/xpressme_integration_kit/include/xpress_render.php	(revision 560)
@@ -92,5 +92,6 @@
 function get_body($contents)
 {
-	$xpess_config = new XPressME_Class();
+	global $xpess_config;
+	if (!is_object($xpess_config)) $xpess_config = new XPressME_Class();
 	$pattern = "<body[^>]*?>(.*)<\/body>";
 	$body = '';
@@ -98,8 +99,25 @@
 		$body = $body_matches[1];
 	}
+	
+	$pattern = '<body\s*([^>]*)>';
+	$body_class = 'class="xpress"';
+	if(preg_match("/".$pattern."/s",  $contents, $body_matches)){
+		$body_tag_option = $body_matches[1];
+
+		$pattern = 'class\s*=\s*[\'|"]([^\'|^"]*)[\'|"]';		
+		if(preg_match("/".$pattern."/",  $body_tag_option, $class_matches)){
+			$class_value = $class_matches[1];
+			$reprace = 'xpress '. $class_value;
+			$body_class = preg_replace("/".$class_value."/",  $reprace, $body_tag_option);
+		} else {
+			$body_class = 'class="xpress" ' . $body_tag_option;
+		}
+	}
+
 	if (!$xpess_config->is_theme_sidebar_disp){
 		$side_panel = get_sidebar_rander();
 			$body = str_replace($side_panel,'',$body);
 	}
+	$body = "\n<div " . $body_class . "> <!-- Substitution of wordpress <body > -->\n" . $body . "\n</div> <!-- Substitution of wordpress </body > -->\n";
 	return $body;
 }
