Index: /branches/comu-ver2/html/user_data/packages/default/css/window.css
===================================================================
--- /branches/comu-ver2/html/user_data/packages/default/css/window.css	(revision 16708)
+++ /branches/comu-ver2/html/user_data/packages/default/css/window.css	(revision 17360)
@@ -1,27 +1,23 @@
 @charset "utf-8";
 
-
-/* 商品詳細拡大写真
+/* ポップアップウィンドウ
 ----------------------------------------------- */
-div#bigimage {
-    width: 520px;
-    margin: 15px auto 0 auto;
-    background-color: #ffffff;
+div#windowcolumn {
+    margin: 15px 15px 0 15px;
+    background-color: #fff;
+    border-top: 5px solid #ffa85c;
+    border-bottom: 5px solid #ffa85c;
 }
 
-div#bigimage img {
-    padding: 10px;
+/* 商品詳細拡大写真、カート拡大写真
+----------------------------------------------- */
+div#bigimage,
+div#cartimage {
+    margin-top: 15px;
     background-color: #ffffff;
+    text-align: center;
 }
 
-
-/* カート拡大写真
------------------------------------------------ */
-div#cartimage {
-    width: 280px;
-    margin: 15px auto 0 auto;
-    background-color: #ffffff;
-}
-
+div#bigimage img,
 div#cartimage img {
     padding: 10px;
@@ -29,17 +25,7 @@
 }
 
-
-/* お客様の声の書き込み・新しいお届け先の追加・変更
+/* お客様の声の書き込み、新しいお届け先の追加・変更
 ----------------------------------------------- */
-div#windowcolumn {
-    width: 550px;
-    margin: 15px auto 0 auto;
-    background-color: #fff;
-    border-top: 5px solid #ffa85c;
-    border-bottom: 5px solid #ffa85c;
-}
-
 div#windowcolumn h2 {
-    width: 500px;
     margin: 0 0 15px 0;
 }
Index: /branches/comu-ver2/data/Smarty/templates/default/products/detail_image.tpl
===================================================================
--- /branches/comu-ver2/data/Smarty/templates/default/products/detail_image.tpl	(revision 17336)
+++ /branches/comu-ver2/data/Smarty/templates/default/products/detail_image.tpl	(revision 17360)
@@ -22,5 +22,5 @@
 <!--{include file="`$smarty.const.TEMPLATE_DIR`popup_header.tpl" subtitle="拡大画像"}-->
 
-<!--{if $tpl_width > 300}-->
+<!--{if $tpl_image_key == 'main_large_image'}-->
   <!--{assign var=id value=bigimage}-->
 <!--{else}-->
Index: /branches/comu-ver2/data/class/SC_Image.php
===================================================================
--- /branches/comu-ver2/data/class/SC_Image.php	(revision 16680)
+++ /branches/comu-ver2/data/class/SC_Image.php	(revision 17360)
@@ -29,5 +29,5 @@
     function SC_Image($tmp_dir) {
         // ヘッダファイル読込
-        if(!ereg("/$", $tmp_dir)) {
+        if (!ereg("/$", $tmp_dir)) {
             $this->tmp_dir = $tmp_dir . "/";
         } else {
@@ -52,6 +52,6 @@
         $from_path = $this->tmp_dir.$filename;
         $to_path = $save_dir."/".$filename;
-        if(file_exists($from_path) && file_exists($save_dir)) {
-            if(copy($from_path , $to_path)) {
+        if (file_exists($from_path) && file_exists($save_dir)) {
+            if (copy($from_path , $to_path)) {
                 unlink($from_path);
             }
@@ -63,5 +63,5 @@
     //---- 指定ファイルを削除
     function deleteImage($filename, $dir) {
-        if(file_exists($dir."/".$filename)) {
+        if (file_exists($dir."/".$filename)) {
             unlink($dir."/".$filename);
         }
@@ -88,21 +88,21 @@
         $PreWord = $head;
 
-            //拡張子取得
-            if (!$ext) {
-                $array_ext = explode(".", $FromImgPath);
-                $ext = $array_ext[count($array_ext) - 1];
-            }
+        //拡張子取得
+        if (!$ext) {
+            $array_ext = explode(".", $FromImgPath);
+            $ext = $array_ext[count($array_ext) - 1];
+        }
 
         $MW = $ThmMaxWidth;
-        if($tmpMW) $MW = $tmpMW; // $MWに最大横幅セット
+        if ($tmpMW) $MW = $tmpMW; // $MWに最大横幅セット
 
         $MH = $ThmMaxHeight;
-        if($tmpMH) $MH = $tmpMH; // $MHに最大縦幅セット
-
-        if(empty($FromImgPath) || empty($ToImgPath)){
+        if ($tmpMH) $MH = $tmpMH; // $MHに最大縦幅セット
+
+        if (empty($FromImgPath) || empty($ToImgPath)){
             return array(0,"出力元画像パス、または出力先フォルダが指定されていません。");
         }
 
-        if(!file_exists($FromImgPath)){
+        if (!file_exists($FromImgPath)){
             return array(0,"出力元画像が見つかりません。");
         }
@@ -111,5 +111,5 @@
         $re_size = $size;
 
-        if(!$size[2] || $size[2] > 3){ // 画像の種類が不明 or swf
+        if (!$size[2] || $size[2] > 3){ // 画像の種類が不明 or swf
             return array(0,"画像形式がサポートされていません。");
         }
@@ -118,16 +118,16 @@
         $tmp_w = $size[0] / $MW;
 
-        if($MH != 0){
+        if ($MH != 0){
             $tmp_h = $size[1] / $MH;
         }
 
-        if($tmp_w > 1 || $tmp_h > 1){
-            if($MH == 0){
-                if($tmp_w > 1){
+        if ($tmp_w > 1 || $tmp_h > 1){
+            if ($MH == 0){
+                if ($tmp_w > 1){
                     $re_size[0] = $MW;
                     $re_size[1] = $size[1] * $MW / $size[0];
                 }
             } else {
-                if($tmp_w > $tmp_h){
+                if ($tmp_w > $tmp_h){
                     $re_size[0] = $MW;
                     $re_size[1] = $size[1] * $MW / $size[0];
@@ -148,6 +148,6 @@
         switch($size[2]) {
         case "1": //gif形式
-            if($tmp_w <= 1 && $tmp_h <= 1){
-                if ( $newFileName ) {
+            if ($tmp_w <= 1 && $tmp_h <= 1){
+                if ($newFileName) {
                     $ToFile = $newFileName;
                 } elseif  ($ext) {
@@ -156,5 +156,5 @@
                     $ToFile .= ".gif";
                 }
-                if(!@copy($FromImgPath , $ToImgPath.$ToFile)) { // エラー処理
+                if (!@copy($FromImgPath , $ToImgPath.$ToFile)) { // エラー処理
                     return array(0,"ファイルのコピーに失敗しました。");
                 }
@@ -169,7 +169,7 @@
             ImageRectangle ($ImgNew,0,0,($re_size[0]-1),($re_size[1]-1),    $black);
 
-            if ( $newFileName ) {
+            if ($newFileName) {
                 $ToFile = $newFileName;
-            } elseif($ext) {
+            } elseif ($ext) {
                 $ToFile .= "." . $ext;
             } else {
@@ -178,5 +178,5 @@
             $TmpPath = $ToImgPath.$ToFile;
             @Imagepng($ImgNew,$TmpPath);
-            if(!@file_exists($TmpPath)){ // 画像が作成されていない場合
+            if (!@file_exists($TmpPath)){ // 画像が作成されていない場合
                 return array(0,"画像の出力に失敗しました。");
             }
@@ -188,5 +188,5 @@
             //ImageCopyResized( $ImgNew,$ImgDefault, 0, 0, 0, 0,$re_size[0], $re_size[1],$size[0], $size[1]);
 
-            if($re_size[0] != $size[0] || $re_size[0] != $size[0]) {
+            if ($re_size[0] != $size[0] || $re_size[0] != $size[0]) {
                 ImageCopyResampled( $ImgNew,$ImgDefault, 0, 0, 0, 0,$re_size[0], $re_size[1],$size[0], $size[1]);
             }
@@ -197,7 +197,7 @@
 
 
-            if ( $newFileName ) {
+            if ($newFileName) {
                 $ToFile = $newFileName;
-            } elseif($ext) {
+            } elseif ($ext) {
                 $ToFile .= "." . $ext;
             } else {
@@ -206,5 +206,5 @@
             $TmpPath = $ToImgPath.$ToFile;
             @ImageJpeg($ImgNew,$TmpPath);
-            if(!@file_exists($TmpPath)){ // 画像が作成されていない場合
+            if (!@file_exists($TmpPath)){ // 画像が作成されていない場合
                 return array(0,"画像の出力に失敗しました。<br>${ImgNew}<br>${TmpPath}");
             }
@@ -217,5 +217,5 @@
             ImageCopyResampled($ImgNew, $ImgDefault, 0, 0, 0, 0,$re_size[0], $re_size[1],$size[0], $size[1]);
 
-            if ( $newFileName ) {
+            if ($newFileName) {
                 $ToFile = $newFileName;
             } elseif ($ext) {
@@ -226,5 +226,5 @@
             $TmpPath = $ToImgPath.$ToFile;
             @ImagePNG($ImgNew,$TmpPath );
-            if(!@file_exists($TmpPath)){ // 画像が作成されていない場合
+            if (!@file_exists($TmpPath)){ // 画像が作成されていない場合
                 return array(0,"画像の出力に失敗しました。");
             }
Index: /branches/comu-ver2/data/class/pages/products/LC_Page_Products_DetailImage.php
===================================================================
--- /branches/comu-ver2/data/class/pages/products/LC_Page_Products_DetailImage.php	(revision 16582)
+++ /branches/comu-ver2/data/class/pages/products/LC_Page_Products_DetailImage.php	(revision 17360)
@@ -58,5 +58,5 @@
 
         // 管理ページからの確認の場合は、非公開の商品も表示する。
-        if(isset($_GET['admim']) && $_GET['admin'] == 'on') {
+        if (isset($_GET['admim']) && $_GET['admin'] == 'on') {
             $where = "del_flg = 0";
         } else {
@@ -65,5 +65,5 @@
 
         // 値の正当性チェック
-        if(!SC_Utils_Ex::sfIsInt($_GET['product_id']) || !$objDb->sfIsRecord("dtb_products", "product_id", $_GET['product_id'], $where)) {
+        if (!SC_Utils_Ex::sfIsInt($_GET['product_id']) || !$objDb->sfIsRecord("dtb_products", "product_id", $_GET['product_id'], $where)) {
             SC_Utils_Ex::sfDispSiteError(PRODUCT_NOT_FOUND);
         }
@@ -75,15 +75,15 @@
         $col = "name, $image_key";
         $arrRet = $objQuery->select($col, "dtb_products", "product_id = ?", array($_GET['product_id']));
-		$image_path = IMAGE_SAVE_DIR . $arrRet[0][$image_key];
-		
-		if(file_exists($image_path)) {
-	        list($width, $height) = getimagesize($image_path);
-		} else {
-			$width = 0;
-			$height = 0;
-		}
-	    
-		$this->tpl_width = $width;
-	    $this->tpl_height = $height;
+        $image_path = IMAGE_SAVE_DIR . $arrRet[0][$image_key];
+        
+        if (file_exists($image_path)) {
+            list($width, $height) = getimagesize($image_path);
+        } else {
+            $width = 0;
+            $height = 0;
+        }
+        
+        $this->tpl_width = $width;
+        $this->tpl_height = $height;
         $this->tpl_table_width = $this->tpl_width + 20;
         $this->tpl_table_height = $this->tpl_height + 20;
@@ -91,4 +91,5 @@
         $this->tpl_image = $arrRet[0][$image_key];
         $this->tpl_name = $arrRet[0]['name'];
+        $this->tpl_image_key = $image_key;
 
         $objView->assignobj($this);
