<div id="goods_info">
  <?php if ($this->_var['gallery'] [ 0 ]): ?>
  <script type='text/javascript' src='temp/js/3d375c304b293b2161a9f47d8b310896.js'></script>
  <script type="text/javascript">
  var _magnifier = null;
  Event.observe(window, "load", function(){_magnifier = new magnifier($("goods_pic"), 400, 310);});
  </script>
  <?php endif; ?>
  <div class="pic">
    <span class="bigpic"><div><img id="goods_pic" src="<?php echo $this->image(array('file'=>$this->_var['gallery']['0']['file_id'],'width'=>'280','height'=>'280')); ?>" alt="<?php echo htmlspecialchars($this->_var['goods']['goods_name']); ?>" id="goodspic" org="<?php echo $this->_var['gallery']['0']['file_name']; ?>" /></div></span>
    <div class="btnlarge"><a href="javascript:;" onclick="viewLargePic()">查看原图</a></div>
    <?php if ($this->_var['gallery_count'] > 1): ?>
    <ul id="gallerylist" onclick="return changeGallery(event)">
      <?php $_from = $this->_var['gallery']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }; $this->push_vars('', 'pic');$this->_foreach['gallery'] = array('total' => count($_from), 'iteration' => 0);
if ($this->_foreach['gallery']['total'] > 0):
    foreach ($_from AS $this->_var['pic']):
        $this->_foreach['gallery']['iteration']++;
?>
        <?php if (($this->_foreach['gallery']['iteration'] <= 1)): ?>
        <li class="selected"><a href="<?php echo $this->image(array('file'=>$this->_var['pic']['file_id'],'width'=>'280','height'=>'280')); ?>"><img src="<?php echo $this->image(array('file'=>$this->_var['pic']['file_id'],'width'=>'32','height'=>'32')); ?>"  org="<?php echo $this->_var['pic']['file_name']; ?>"/></a></li>
        <?php else: ?>
        <li><a href="<?php echo $this->image(array('file'=>$this->_var['pic']['file_id'],'width'=>'280','height'=>'280')); ?>"><img src="<?php echo $this->image(array('file'=>$this->_var['pic']['file_id'],'width'=>'32','height'=>'32')); ?>" org="<?php echo $this->_var['pic']['file_name']; ?>"/></a></li>
        <?php endif; ?>
      <?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?>
    </ul>
    <?php endif; ?>
  </div>
  <div class="globalinfo">
    <h1 class="name"><?php echo htmlspecialchars($this->_var['goods']['goods_name']); ?>
    <br /><span>货号: <?php echo htmlspecialchars($this->_var['goods']['sku']); ?></span>
    </h1>
    
    <table border="0" class="infolist">
      <tr>
        <th width="50">本店价格</th><th>:</th><td colspan="4"><span class="goodsprice"><?php echo price_format($this->_var['goods']['store_price']); ?></span></td>
      </tr>
      <?php if ($this->_var['goods']['brand_name']): ?>
      <tr>
        <th>品牌</th><th>:</th><td colspan="4"><a href="<?php echo $this->url_rewrite(array('app'=>'category','brand_id'=>$this->_var['goods']['brand_id'])); ?>" target="_blank"><?php echo htmlspecialchars($this->_var['goods']['brand_name']); ?></a></td>
      </tr>
      <?php endif; ?>
      <tr>
        <th>市场价</th><th>:</th><td><span class="marketprice"><?php echo price_format($this->_var['goods']['market_price']); ?></span></td>
        <th width="50">新旧程度</th><th>:</th><td><?php echo $this->_var['goods']['lang_new_level']; ?></td>
      </tr>
      <tr>
        <th>节省了</th><th>:</th><td><?php echo price_format($this->_var['goods']['to_save']); ?></td>
        <th>已销售</th><th>:</th><td><?php echo ($this->_var['goods']['sales_volume'] == '') ? '0' : $this->_var['goods']['sales_volume']; ?> 件</td>
      </tr>
    </table>
    <div class="attrlist">
      <table border="0">
        <?php if ($this->_var['goods_color']): ?>
        <tr>
          <th>颜色: </th>
          <td class="attrselect">
            <?php $_from = $this->_var['goods_color']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }; $this->push_vars('', 'color');if (count($_from)):
    foreach ($_from AS $this->_var['color']):
?>
              <?php if ($this->_var['goods']['color_name'] == $this->_var['color']['color_name']): ?>
              <a class="goods_color goods_color_selected" title="<?php echo htmlspecialchars($this->_var['color']['color_name']); ?>"><span <?php if ($this->_var['goods']['color_rgb']): ?>style="background-color:<?php echo $this->_var['goods']['color_rgb']; ?>"<?php endif; ?>>&nbsp;</span></a>
              <?php else: ?>
              <a class="goods_color" href="<?php echo $this->url_rewrite(array('app'=>'goods','spec_id'=>$this->_var['color']['spec_id'])); ?>" title="<?php echo htmlspecialchars($this->_var['color']['color_name']); ?>"><span <?php if ($this->_var['color']['color_rgb']): ?>style="background-color:<?php echo $this->_var['color']['color_rgb']; ?>"<?php endif; ?>>&nbsp;</span></a>
              <?php endif; ?>
            <?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?>
           </td>
        </tr>
        <?php endif; ?>
        <?php if ($this->_var['goods_spec']): ?>
        <tr>
          <th>规格: </th>
          <td class="attrselect">
            <?php $_from = $this->_var['goods_spec']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }; $this->push_vars('', 'spec');if (count($_from)):
    foreach ($_from AS $this->_var['spec']):
?>
              <?php if ($this->_var['spec']['spec_name'] == $this->_var['goods']['spec_name']): ?>
                <a class="goods_spec goods_spec_selected" title="<?php echo htmlspecialchars($this->_var['goods']['spec_name']); ?>"><span><?php echo htmlspecialchars($this->_var['goods']['spec_name']); ?></span></a>
              <?php else: ?>
                <?php if ($this->_var['spec']['active']): ?>
                  <a class="goods_spec" href="<?php echo $this->url_rewrite(array('app'=>'goods','spec_id'=>$this->_var['spec']['spec_id'])); ?>" title="<?php echo htmlspecialchars($this->_var['spec']['spec_name']); ?>"><span><?php echo htmlspecialchars($this->_var['spec']['spec_name']); ?></span></a>
                <?php else: ?>
                  <a class="goods_spec goods_spec_disable" title="当前颜色下该规格不存在"><span><?php echo htmlspecialchars($this->_var['spec']['spec_name']); ?></span></a>
                <?php endif; ?>

              <?php endif; ?>
            <?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?>
          </td>
        </tr>
        <?php endif; ?>
      </table>
      <p class="btnbuy">我要购买 <input type="text" size="5" class="sinput" id="goods_num" value="1" /> 件 <span class="desc">(库存<?php 
$k = array (
  'name' => 'nocache',
  '_template' => '<?php echo $this->_var[\'goods\'][\'stock\']; ?>',
);
echo $this->_echash . $k['name'] . '|' . serialize($k) . $this->_echash;
?> 件)</span></p>
    </div>
    <p class="btn">
      <a href="javascript:;" id="addcart_button" onclick="addToCart(<?php echo $this->_var['goods']['spec_id']; ?>, $('goods_num').value);"><img src="themes/store/skin/blueglass/images/btn_addcart.gif" alt="加入购物车" /></a>
      <a href="javascript:;" onclick="addToFavorite(<?php echo $this->_var['goods']['goods_id']; ?>);" ><img src="themes/store/skin/blueglass/images/btn_addfav.gif" alt="加入收藏夹" /></a>
    </p>
    <?php if ($this->_var['goods']['keywords']): ?>
    <p id="goodstag">
    <label>搜索更多相关商品</label>
    <?php $_from = $this->_var['goods']['tags']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }; $this->push_vars('', 'tag');if (count($_from)):
    foreach ($_from AS $this->_var['tag']):
?>
    <a href="<?php echo $this->url_rewrite(array('app'=>'search','tag_words'=>$this->_var['tag'])); ?>"><?php echo htmlspecialchars($this->_var['tag']); ?></a>
    <?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?>
    </p>
    <?php endif; ?>
  </div>
</div>
